@justifi/webcomponents 6.15.0 → 6.16.0-rc.2

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 (441) hide show
  1. package/dist/cjs/{Analytics-BjZHa0wt.js → Analytics-CDE3KpL6.js} +2 -2
  2. package/dist/cjs/{Api-us3AxMRC.js → Api-CaEn8pKs.js} +1 -1
  3. package/dist/cjs/additional-questions-form-step_15.cjs.entry.js +8 -8
  4. package/dist/cjs/additional-questions_4.cjs.entry.js +1 -1
  5. package/dist/cjs/additional-statement_8.cjs.entry.js +8 -8
  6. package/dist/cjs/bank-account-billing-form-simple_4.cjs.entry.js +13 -7
  7. package/dist/cjs/bank-account-form.cjs.entry.js +64 -12
  8. package/dist/cjs/{business-identity-schema-XiCLzxWM.js → business-identity-schema-DuOIMFjG.js} +2 -2
  9. package/dist/cjs/{business.service-_Sl3vWmu.js → business.service-DIspRonp.js} +1 -1
  10. package/dist/cjs/card-form.cjs.entry.js +12 -10
  11. package/dist/cjs/{checkout.service-B_qymeqJ.js → checkout.service-CM1Duar4.js} +1 -1
  12. package/dist/cjs/{checkout.store-DaV9lvEQ.js → checkout.store-B5lTwvUV.js} +1 -0
  13. package/dist/cjs/{country-config-DQQujh5h.js → country-config-CFC3KuVD.js} +24 -2
  14. package/dist/cjs/custom-popper_2.cjs.entry.js +2 -2
  15. package/dist/cjs/detect-duplicate-version-DyHHkx4J.js +29 -0
  16. package/dist/cjs/dispute-notification_2.cjs.entry.js +9 -9
  17. package/dist/cjs/{event-types-DmY59QXs.js → event-types-DNCxVTir.js} +1 -1
  18. package/dist/cjs/form-address-fields_3.cjs.entry.js +5 -5
  19. package/dist/cjs/form-alert_3.cjs.entry.js +122 -16
  20. package/dist/cjs/form-control-checkbox.cjs.entry.js +2 -2
  21. package/dist/cjs/form-control-date.cjs.entry.js +2 -2
  22. package/dist/cjs/form-control-file-v2_2.cjs.entry.js +1 -1
  23. package/dist/cjs/form-control-file.cjs.entry.js +2 -2
  24. package/dist/cjs/form-control-monetary.cjs.entry.js +2 -2
  25. package/dist/cjs/form-control-number_2.cjs.entry.js +3 -3
  26. package/dist/cjs/form-control-radio.cjs.entry.js +2 -2
  27. package/dist/cjs/form-control-select_2.cjs.entry.js +22 -6
  28. package/dist/cjs/{get-subaccounts-BMY2bOFj.js → get-subaccounts-8LeFCTm6.js} +1 -1
  29. package/dist/cjs/internal-button.cjs.entry.js +1 -1
  30. package/dist/cjs/justifi-apple-pay_12.cjs.entry.js +54 -32
  31. package/dist/cjs/justifi-bank-account-billing-form-simple.cjs.entry.js +6 -6
  32. package/dist/cjs/justifi-bank-account-form.cjs.entry.js +8 -7
  33. package/dist/cjs/justifi-billing-form-full.cjs.entry.js +1 -1
  34. package/dist/cjs/justifi-business-details.cjs.entry.js +7 -7
  35. package/dist/cjs/justifi-business-form.cjs.entry.js +9 -9
  36. package/dist/cjs/justifi-card-billing-form-simple.cjs.entry.js +1 -1
  37. package/dist/cjs/justifi-card-form.cjs.entry.js +9 -6
  38. package/dist/cjs/justifi-checkout-qr-code.cjs.entry.js +5 -5
  39. package/dist/cjs/justifi-checkout.cjs.entry.js +17 -8
  40. package/dist/cjs/justifi-checkouts-list-filters.cjs.entry.js +2 -2
  41. package/dist/cjs/justifi-checkouts-list.cjs.entry.js +9 -9
  42. package/dist/cjs/justifi-dispute-management.cjs.entry.js +7 -7
  43. package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +5 -5
  44. package/dist/cjs/justifi-order-terminals.cjs.entry.js +8 -8
  45. package/dist/cjs/justifi-payment-details.cjs.entry.js +14 -14
  46. package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +6 -6
  47. package/dist/cjs/justifi-payment-transactions-list.cjs.entry.js +7 -7
  48. package/dist/cjs/justifi-payments-list-filters.cjs.entry.js +2 -2
  49. package/dist/cjs/justifi-payments-list.cjs.entry.js +7 -7
  50. package/dist/cjs/justifi-payout-details.cjs.entry.js +9 -9
  51. package/dist/cjs/justifi-payout-transactions-list.cjs.entry.js +7 -7
  52. package/dist/cjs/justifi-payouts-list-filters.cjs.entry.js +2 -2
  53. package/dist/cjs/justifi-payouts-list.cjs.entry.js +8 -8
  54. package/dist/cjs/justifi-qr-terminal.cjs.entry.js +6 -6
  55. package/dist/cjs/justifi-refund-payment.cjs.entry.js +6 -6
  56. package/dist/cjs/justifi-save-new-payment-method.cjs.entry.js +1 -1
  57. package/dist/cjs/justifi-season-interruption-insurance.cjs.entry.js +6 -6
  58. package/dist/cjs/justifi-terminal-orders-list-filters.cjs.entry.js +3 -3
  59. package/dist/cjs/justifi-terminal-orders-list.cjs.entry.js +7 -7
  60. package/dist/cjs/justifi-terminals-list-filters.cjs.entry.js +1 -1
  61. package/dist/cjs/justifi-terminals-list.cjs.entry.js +8 -8
  62. package/dist/cjs/loader.cjs.js +1 -1
  63. package/dist/cjs/{package-30T__1wH.js → package-DGrVUpde.js} +1 -3
  64. package/dist/cjs/payment-method-option.cjs.entry.js +1 -1
  65. package/dist/cjs/{payment.service-DRXVT-uB.js → payment.service-By7aeVkC.js} +1 -1
  66. package/dist/cjs/{payout.service-CuQ-mXKB.js → payout.service-Dn0rXkmg.js} +1 -1
  67. package/dist/cjs/{plaid.service-B58nzlUE.js → plaid.service-CjaugrzX.js} +1 -1
  68. package/dist/cjs/radio-list-item.cjs.entry.js +1 -1
  69. package/dist/cjs/save-new-payment-method.cjs.entry.js +2 -2
  70. package/dist/cjs/{schema-validations-sjRvL4KO.js → schema-validations-BDFa_oIq.js} +8 -2
  71. package/dist/cjs/table-filters-menu.cjs.entry.js +1 -1
  72. package/dist/cjs/terminal-quantity-selector.cjs.entry.js +1 -1
  73. package/dist/cjs/{terminal.service-CmtSEgTc.js → terminal.service-C0_r_A60.js} +1 -1
  74. package/dist/cjs/utils-Ct_X5q0U.js +62 -0
  75. package/dist/cjs/webcomponents.cjs.js +1 -1
  76. package/dist/collection/collection-manifest.json +1 -1
  77. package/dist/collection/components/business-details/justifi-business-details.js +3 -3
  78. package/dist/collection/components/business-forms/business-form/justifi-business-form.js +2 -2
  79. package/dist/collection/components/business-forms/payment-provisioning/form-address-fields/form-address-fields.js +3 -2
  80. package/dist/collection/components/business-forms/payment-provisioning/justifi-payment-provisioning.js +2 -2
  81. package/dist/collection/components/business-forms/schemas/schema-validations.js +8 -1
  82. package/dist/collection/components/business-forms/utils/country-config.js +3 -2
  83. package/dist/collection/components/checkout/bank-account-form/bank-account-form.js +88 -12
  84. package/dist/collection/components/checkout/billing-form/billing-form-full.js +6 -2
  85. package/dist/collection/components/checkout/billing-form/card-billing-form-simple.js +6 -2
  86. package/dist/collection/components/checkout/card-form/card-form.js +37 -11
  87. package/dist/collection/components/checkout/justifi-checkout.js +53 -4
  88. package/dist/collection/components/checkout/message-event-types.js +2 -0
  89. package/dist/collection/components/checkout/save-new-payment-method/justifi-save-new-payment-method.js +1 -1
  90. package/dist/collection/components/checkout/save-new-payment-method/save-new-payment-method.js +1 -1
  91. package/dist/collection/components/checkout-qr-code/justifi-checkout-qr-code.js +2 -2
  92. package/dist/collection/components/checkouts-list/checkouts-list-filters.js +2 -2
  93. package/dist/collection/components/checkouts-list/justifi-checkouts-list.js +4 -4
  94. package/dist/collection/components/dispute-management/dispute-notification.js +2 -2
  95. package/dist/collection/components/dispute-management/dispute-response/additional-statement.js +1 -1
  96. package/dist/collection/components/dispute-management/dispute-response/cancellation-policy.js +1 -1
  97. package/dist/collection/components/dispute-management/dispute-response/customer-details.js +1 -1
  98. package/dist/collection/components/dispute-management/dispute-response/dispute-response.js +3 -3
  99. package/dist/collection/components/dispute-management/dispute-response/duplicate-charge.js +1 -1
  100. package/dist/collection/components/dispute-management/dispute-response/electronic-evidence.js +1 -1
  101. package/dist/collection/components/dispute-management/dispute-response/product-or-service.js +1 -1
  102. package/dist/collection/components/dispute-management/dispute-response/refund-policy.js +1 -1
  103. package/dist/collection/components/dispute-management/dispute-response/shipping-details.js +1 -1
  104. package/dist/collection/components/dispute-management/justifi-dispute-management.js +3 -3
  105. package/dist/collection/components/filters/table-filters-menu.js +1 -1
  106. package/dist/collection/components/gross-payment-chart/justifi-gross-payment-chart.js +2 -2
  107. package/dist/collection/components/insurance/season-interruption/justifi-season-interruption-insurance.js +2 -2
  108. package/dist/collection/components/modular-checkout/justifi-modular-checkout.js +63 -19
  109. package/dist/collection/components/modular-checkout/sub-components/justifi-bank-account-billing-form-simple.js +3 -3
  110. package/dist/collection/components/modular-checkout/sub-components/justifi-bank-account-form.js +33 -6
  111. package/dist/collection/components/modular-checkout/sub-components/justifi-billing-form-full.js +1 -1
  112. package/dist/collection/components/modular-checkout/sub-components/justifi-card-billing-form-simple.js +1 -1
  113. package/dist/collection/components/modular-checkout/sub-components/justifi-card-form.js +28 -3
  114. package/dist/collection/components/modular-checkout/sub-components/justifi-checkout-summary.js +1 -1
  115. package/dist/collection/components/modular-checkout/sub-components/payment-method-option.js +1 -1
  116. package/dist/collection/components/modular-checkout/sub-components/paypal/justifi-paypal.js +1 -1
  117. package/dist/collection/components/order-terminals/justifi-order-terminals.js +3 -3
  118. package/dist/collection/components/order-terminals/terminal-quantity-selector/terminal-quantity-selector.js +1 -1
  119. package/dist/collection/components/payment-details/justifi-payment-details.js +10 -10
  120. package/dist/collection/components/payment-transactions-list/justifi-payment-transactions-list.js +3 -3
  121. package/dist/collection/components/payments-list/justifi-payments-list-filters.js +2 -2
  122. package/dist/collection/components/payments-list/justifi-payments-list.js +3 -3
  123. package/dist/collection/components/payout-details/justifi-payout-details.js +5 -5
  124. package/dist/collection/components/payout-transactions-list/justifi-payout-transactions-list.js +3 -3
  125. package/dist/collection/components/payouts-list/justifi-payouts-list-filters.js +2 -2
  126. package/dist/collection/components/payouts-list/justifi-payouts-list.js +3 -3
  127. package/dist/collection/components/qr-terminal/justifi-qr-terminal.js +2 -2
  128. package/dist/collection/components/refund-payment/justifi-refund-payment.js +2 -2
  129. package/dist/collection/components/terminal-orders-list/justifi-terminal-orders-list-filters.js +3 -3
  130. package/dist/collection/components/terminal-orders-list/justifi-terminal-orders-list.js +4 -4
  131. package/dist/collection/components/terminals-list/justifi-terminals-list-filters.js +1 -1
  132. package/dist/collection/components/terminals-list/justifi-terminals-list.js +3 -3
  133. package/dist/collection/components/tokenize-payment-method/justifi-tokenize-payment-method.js +45 -6
  134. package/dist/collection/store/checkout.store.js +1 -0
  135. package/dist/collection/ui-components/custom-popper/custom-popper.js +2 -2
  136. package/dist/collection/ui-components/form/form-control-checkbox.js +2 -2
  137. package/dist/collection/ui-components/form/form-control-date.js +2 -2
  138. package/dist/collection/ui-components/form/form-control-file-v2.js +1 -1
  139. package/dist/collection/ui-components/form/form-control-file.js +2 -2
  140. package/dist/collection/ui-components/form/form-control-monetary.js +2 -2
  141. package/dist/collection/ui-components/form/form-control-number-masked.js +2 -2
  142. package/dist/collection/ui-components/form/form-control-number.js +2 -2
  143. package/dist/collection/ui-components/form/form-control-radio.js +2 -2
  144. package/dist/collection/ui-components/form/form-control-select.js +2 -2
  145. package/dist/collection/ui-components/form/form-control-text.js +37 -4
  146. package/dist/collection/ui-components/form/iframe-input.js +136 -14
  147. package/dist/collection/ui-components/form/utils.js +32 -0
  148. package/dist/collection/ui-components/internal-button.js +1 -1
  149. package/dist/collection/ui-components/radio-list-item.js +1 -1
  150. package/dist/collection/utils/detect-duplicate-version.js +24 -0
  151. package/dist/collection/utils/frame-comunication-service.js +6 -1
  152. package/dist/collection/utils/postal-code.js +19 -0
  153. package/dist/docs.json +315 -17
  154. package/dist/esm/{Analytics-BtMYbHD0.js → Analytics-tBzmPsnT.js} +2 -2
  155. package/dist/esm/{Api-nVK-rgbk.js → Api-BH6Wa9CT.js} +1 -1
  156. package/dist/esm/additional-questions-form-step_15.entry.js +8 -8
  157. package/dist/esm/additional-questions_4.entry.js +1 -1
  158. package/dist/esm/additional-statement_8.entry.js +8 -8
  159. package/dist/esm/bank-account-billing-form-simple_4.entry.js +13 -7
  160. package/dist/esm/bank-account-form.entry.js +64 -12
  161. package/dist/esm/{business-identity-schema-BP61Unwf.js → business-identity-schema-BLKCH6xV.js} +2 -2
  162. package/dist/esm/{business.service-Cq7H5w1T.js → business.service-XOnczlAa.js} +1 -1
  163. package/dist/esm/card-form.entry.js +12 -10
  164. package/dist/esm/{checkout.service-JA7oTq5d.js → checkout.service-DvSxk9EZ.js} +1 -1
  165. package/dist/esm/{checkout.store-B2mtQcB5.js → checkout.store-B8CGkx0o.js} +1 -0
  166. package/dist/esm/{country-config-F5YwgHgR.js → country-config-DJFj1v-Q.js} +23 -3
  167. package/dist/esm/custom-popper_2.entry.js +2 -2
  168. package/dist/esm/detect-duplicate-version-BD3-8NL2.js +27 -0
  169. package/dist/esm/dispute-notification_2.entry.js +9 -9
  170. package/dist/esm/{event-types-Dsf8IwD6.js → event-types-CM5AGGBD.js} +1 -1
  171. package/dist/esm/form-address-fields_3.entry.js +5 -5
  172. package/dist/esm/form-alert_3.entry.js +122 -16
  173. package/dist/esm/form-control-checkbox.entry.js +2 -2
  174. package/dist/esm/form-control-date.entry.js +2 -2
  175. package/dist/esm/form-control-file-v2_2.entry.js +1 -1
  176. package/dist/esm/form-control-file.entry.js +2 -2
  177. package/dist/esm/form-control-monetary.entry.js +2 -2
  178. package/dist/esm/form-control-number_2.entry.js +3 -3
  179. package/dist/esm/form-control-radio.entry.js +2 -2
  180. package/dist/esm/form-control-select_2.entry.js +22 -6
  181. package/dist/esm/{get-subaccounts-B-S2TGRa.js → get-subaccounts-P-x_RqL5.js} +1 -1
  182. package/dist/esm/internal-button.entry.js +1 -1
  183. package/dist/esm/justifi-apple-pay_12.entry.js +54 -32
  184. package/dist/esm/justifi-bank-account-billing-form-simple.entry.js +6 -6
  185. package/dist/esm/justifi-bank-account-form.entry.js +8 -7
  186. package/dist/esm/justifi-billing-form-full.entry.js +1 -1
  187. package/dist/esm/justifi-business-details.entry.js +7 -7
  188. package/dist/esm/justifi-business-form.entry.js +9 -9
  189. package/dist/esm/justifi-card-billing-form-simple.entry.js +1 -1
  190. package/dist/esm/justifi-card-form.entry.js +9 -6
  191. package/dist/esm/justifi-checkout-qr-code.entry.js +5 -5
  192. package/dist/esm/justifi-checkout.entry.js +17 -8
  193. package/dist/esm/justifi-checkouts-list-filters.entry.js +2 -2
  194. package/dist/esm/justifi-checkouts-list.entry.js +9 -9
  195. package/dist/esm/justifi-dispute-management.entry.js +7 -7
  196. package/dist/esm/justifi-gross-payment-chart.entry.js +5 -5
  197. package/dist/esm/justifi-order-terminals.entry.js +8 -8
  198. package/dist/esm/justifi-payment-details.entry.js +14 -14
  199. package/dist/esm/justifi-payment-provisioning.entry.js +6 -6
  200. package/dist/esm/justifi-payment-transactions-list.entry.js +7 -7
  201. package/dist/esm/justifi-payments-list-filters.entry.js +2 -2
  202. package/dist/esm/justifi-payments-list.entry.js +7 -7
  203. package/dist/esm/justifi-payout-details.entry.js +9 -9
  204. package/dist/esm/justifi-payout-transactions-list.entry.js +7 -7
  205. package/dist/esm/justifi-payouts-list-filters.entry.js +2 -2
  206. package/dist/esm/justifi-payouts-list.entry.js +8 -8
  207. package/dist/esm/justifi-qr-terminal.entry.js +6 -6
  208. package/dist/esm/justifi-refund-payment.entry.js +6 -6
  209. package/dist/esm/justifi-save-new-payment-method.entry.js +1 -1
  210. package/dist/esm/justifi-season-interruption-insurance.entry.js +6 -6
  211. package/dist/esm/justifi-terminal-orders-list-filters.entry.js +3 -3
  212. package/dist/esm/justifi-terminal-orders-list.entry.js +7 -7
  213. package/dist/esm/justifi-terminals-list-filters.entry.js +1 -1
  214. package/dist/esm/justifi-terminals-list.entry.js +8 -8
  215. package/dist/esm/loader.js +1 -1
  216. package/dist/esm/package-DhrQechy.js +5 -0
  217. package/dist/esm/payment-method-option.entry.js +1 -1
  218. package/dist/esm/{payment.service-B42sKlQE.js → payment.service-CBUnE4bP.js} +1 -1
  219. package/dist/esm/{payout.service-BIoAgNJJ.js → payout.service-DUYaYbeJ.js} +1 -1
  220. package/dist/esm/{plaid.service-C6Ltk2ef.js → plaid.service-Umm80G4q.js} +1 -1
  221. package/dist/esm/radio-list-item.entry.js +1 -1
  222. package/dist/esm/save-new-payment-method.entry.js +2 -2
  223. package/dist/esm/{schema-validations-De7Qe0VU.js → schema-validations-8GJ34Do1.js} +8 -2
  224. package/dist/esm/table-filters-menu.entry.js +1 -1
  225. package/dist/esm/terminal-quantity-selector.entry.js +1 -1
  226. package/dist/esm/{terminal.service-DV3qIwBy.js → terminal.service-DeunLqmo.js} +1 -1
  227. package/dist/esm/utils-Cpck08K0.js +59 -0
  228. package/dist/esm/webcomponents.js +1 -1
  229. package/dist/module/additional-statement2.js +1 -1
  230. package/dist/module/bank-account-form2.js +63 -10
  231. package/dist/module/billing-form-full2.js +6 -2
  232. package/dist/module/cancellation-policy2.js +1 -1
  233. package/dist/module/card-billing-form-simple2.js +6 -2
  234. package/dist/module/card-form2.js +12 -9
  235. package/dist/module/checkout.store.js +1 -0
  236. package/dist/module/country-config.js +23 -3
  237. package/dist/module/custom-popper2.js +2 -2
  238. package/dist/module/customer-details2.js +1 -1
  239. package/dist/module/detect-duplicate-version.js +27 -0
  240. package/dist/module/dispute-notification2.js +2 -2
  241. package/dist/module/dispute-response2.js +3 -3
  242. package/dist/module/duplicate-charge2.js +1 -1
  243. package/dist/module/electronic-evidence2.js +1 -1
  244. package/dist/module/form-address-fields2.js +3 -3
  245. package/dist/module/form-control-checkbox2.js +2 -2
  246. package/dist/module/form-control-date2.js +2 -2
  247. package/dist/module/form-control-file-v22.js +1 -1
  248. package/dist/module/form-control-file2.js +2 -2
  249. package/dist/module/form-control-monetary2.js +2 -2
  250. package/dist/module/form-control-number-masked2.js +2 -2
  251. package/dist/module/form-control-number2.js +2 -2
  252. package/dist/module/form-control-radio2.js +2 -2
  253. package/dist/module/form-control-select2.js +2 -2
  254. package/dist/module/form-control-text2.js +21 -4
  255. package/dist/module/iframe-input2.js +125 -16
  256. package/dist/module/internal-button2.js +1 -1
  257. package/dist/module/justifi-bank-account-billing-form-simple.js +3 -3
  258. package/dist/module/justifi-bank-account-form.js +6 -4
  259. package/dist/module/justifi-billing-form-full.js +1 -1
  260. package/dist/module/justifi-business-details.js +3 -3
  261. package/dist/module/justifi-business-form.js +2 -2
  262. package/dist/module/justifi-card-billing-form-simple.js +1 -1
  263. package/dist/module/justifi-card-form.js +6 -3
  264. package/dist/module/justifi-checkout-qr-code2.js +2 -2
  265. package/dist/module/justifi-checkout-summary2.js +1 -1
  266. package/dist/module/justifi-checkout.js +15 -4
  267. package/dist/module/justifi-checkouts-list-filters.js +2 -2
  268. package/dist/module/justifi-checkouts-list.js +4 -4
  269. package/dist/module/justifi-dispute-management.js +3 -3
  270. package/dist/module/justifi-gross-payment-chart.js +2 -2
  271. package/dist/module/justifi-modular-checkout2.js +43 -19
  272. package/dist/module/justifi-order-terminals.js +3 -3
  273. package/dist/module/justifi-payment-details.js +10 -10
  274. package/dist/module/justifi-payment-provisioning.js +2 -2
  275. package/dist/module/justifi-payment-transactions-list.js +3 -3
  276. package/dist/module/justifi-payments-list-filters.js +2 -2
  277. package/dist/module/justifi-payments-list.js +3 -3
  278. package/dist/module/justifi-payout-details.js +5 -5
  279. package/dist/module/justifi-payout-transactions-list.js +3 -3
  280. package/dist/module/justifi-payouts-list-filters.js +2 -2
  281. package/dist/module/justifi-payouts-list.js +3 -3
  282. package/dist/module/justifi-paypal2.js +1 -1
  283. package/dist/module/justifi-qr-terminal.js +2 -2
  284. package/dist/module/justifi-refund-payment.js +2 -2
  285. package/dist/module/justifi-save-new-payment-method.js +1 -1
  286. package/dist/module/justifi-season-interruption-insurance.js +2 -2
  287. package/dist/module/justifi-terminal-orders-list-filters.js +3 -3
  288. package/dist/module/justifi-terminal-orders-list.js +4 -4
  289. package/dist/module/justifi-terminals-list-filters.js +1 -1
  290. package/dist/module/justifi-terminals-list.js +3 -3
  291. package/dist/module/justifi-tokenize-payment-method2.js +9 -6
  292. package/dist/module/package.js +1 -3
  293. package/dist/module/payment-method-option.js +1 -1
  294. package/dist/module/product-or-service2.js +1 -1
  295. package/dist/module/radio-list-item2.js +1 -1
  296. package/dist/module/refund-policy2.js +1 -1
  297. package/dist/module/save-new-payment-method2.js +1 -1
  298. package/dist/module/schema-validations.js +8 -2
  299. package/dist/module/shipping-details2.js +1 -1
  300. package/dist/module/table-filters-menu2.js +1 -1
  301. package/dist/module/terminal-quantity-selector2.js +1 -1
  302. package/dist/module/utils4.js +33 -1
  303. package/dist/types/components/checkout/bank-account-form/bank-account-form.d.ts +8 -1
  304. package/dist/types/components/checkout/card-form/card-form.d.ts +5 -1
  305. package/dist/types/components/checkout/justifi-checkout.d.ts +9 -0
  306. package/dist/types/components/checkout/message-event-types.d.ts +2 -0
  307. package/dist/types/components/modular-checkout/justifi-modular-checkout.d.ts +9 -0
  308. package/dist/types/components/modular-checkout/sub-components/justifi-bank-account-form.d.ts +4 -1
  309. package/dist/types/components/modular-checkout/sub-components/justifi-card-form.d.ts +9 -0
  310. package/dist/types/components/tokenize-payment-method/justifi-tokenize-payment-method.d.ts +9 -0
  311. package/dist/types/components.d.ts +95 -3
  312. package/dist/types/store/checkout.store.d.ts +1 -0
  313. package/dist/types/ui-components/form/form-control-text.d.ts +1 -0
  314. package/dist/types/ui-components/form/iframe-input.d.ts +24 -0
  315. package/dist/types/ui-components/form/utils.d.ts +1 -0
  316. package/dist/types/utils/detect-duplicate-version.d.ts +7 -0
  317. package/dist/types/utils/postal-code.d.ts +3 -0
  318. package/dist/webcomponents/{p-de047614.entry.js → p-06ed3518.entry.js} +1 -1
  319. package/dist/webcomponents/p-12f5fdc0.entry.js +1 -0
  320. package/dist/webcomponents/p-1ceb65cc.entry.js +1 -0
  321. package/dist/webcomponents/{p-777470cb.entry.js → p-2272a65b.entry.js} +1 -1
  322. package/dist/webcomponents/{p-c4889a06.entry.js → p-2d25f1d1.entry.js} +1 -1
  323. package/dist/webcomponents/p-357d14ee.entry.js +1 -0
  324. package/dist/webcomponents/{p-a10beb26.entry.js → p-3d02cb78.entry.js} +1 -1
  325. package/dist/webcomponents/{p-ead48010.entry.js → p-4450dbe9.entry.js} +1 -1
  326. package/dist/webcomponents/p-4dabcfd6.entry.js +1 -0
  327. package/dist/webcomponents/p-511bc0b2.entry.js +1 -0
  328. package/dist/webcomponents/p-51238f79.entry.js +1 -0
  329. package/dist/webcomponents/p-521c534c.entry.js +1 -0
  330. package/dist/webcomponents/{p-0e9351c4.entry.js → p-5331e011.entry.js} +1 -1
  331. package/dist/webcomponents/p-5be775e8.entry.js +1 -0
  332. package/dist/webcomponents/{p-cec7164e.entry.js → p-5e196140.entry.js} +1 -1
  333. package/dist/webcomponents/{p-f40fa614.entry.js → p-5f20b0da.entry.js} +1 -1
  334. package/dist/webcomponents/p-63e02d42.entry.js +1 -0
  335. package/dist/webcomponents/{p-9e3e2e32.entry.js → p-6aaf2758.entry.js} +1 -1
  336. package/dist/webcomponents/p-6bfdc443.entry.js +1 -0
  337. package/dist/webcomponents/{p-42021e67.entry.js → p-6f3b035b.entry.js} +1 -1
  338. package/dist/webcomponents/p-6f7756b7.entry.js +1 -0
  339. package/dist/webcomponents/p-80177bcb.entry.js +1 -0
  340. package/dist/webcomponents/p-8758aec4.entry.js +1 -0
  341. package/dist/webcomponents/p-87f8d4e7.entry.js +1 -0
  342. package/dist/webcomponents/{p-88a44a02.entry.js → p-89ed2d99.entry.js} +1 -1
  343. package/dist/webcomponents/p-91358854.entry.js +1 -0
  344. package/dist/webcomponents/p-9b930446.entry.js +1 -0
  345. package/dist/webcomponents/p-9c4ac3c5.entry.js +1 -0
  346. package/dist/webcomponents/{p-B_2zgnvM.js → p-B6kC9tX2.js} +1 -1
  347. package/dist/webcomponents/{p-D7fNBSlC.js → p-BKrZL95i.js} +1 -1
  348. package/dist/webcomponents/{p-rFpPIJgu.js → p-Bo7ndXwR.js} +1 -1
  349. package/dist/webcomponents/{p-iA-Amt2z.js → p-C8J9uVEs.js} +1 -1
  350. package/dist/webcomponents/{p-DC2djVls.js → p-CEGSQXGU.js} +1 -1
  351. package/dist/webcomponents/{p-BjjKkMO1.js → p-CEHwp4sh.js} +1 -1
  352. package/dist/webcomponents/{p-C60AkJ6a.js → p-CKL24GQA.js} +1 -1
  353. package/dist/webcomponents/{p-BmaQUnqv.js → p-CRaiEpKf.js} +1 -1
  354. package/dist/webcomponents/p-CkrzG0pB.js +1 -0
  355. package/dist/webcomponents/{p-D694H6co.js → p-Cl6irPVE.js} +1 -1
  356. package/dist/webcomponents/p-Cpck08K0.js +1 -0
  357. package/dist/webcomponents/{p-C6Jq8YDT.js → p-DCpGH4xL.js} +1 -1
  358. package/dist/webcomponents/{p-pueOrhXO.js → p-DEfLsy2W.js} +1 -1
  359. package/dist/webcomponents/p-DF7oFWnO.js +1 -0
  360. package/dist/webcomponents/p-DMzYgqml.js +1 -0
  361. package/dist/webcomponents/p-DhrQechy.js +1 -0
  362. package/dist/webcomponents/p-FsWkrvEF.js +1 -0
  363. package/dist/webcomponents/p-a1e1afa4.entry.js +1 -0
  364. package/dist/webcomponents/{p-13814028.entry.js → p-a1ef7674.entry.js} +1 -1
  365. package/dist/webcomponents/p-a2c4e99f.entry.js +1 -0
  366. package/dist/webcomponents/p-a8f1c9b3.entry.js +1 -0
  367. package/dist/webcomponents/p-aba3b0dc.entry.js +1 -0
  368. package/dist/webcomponents/{p-065b854f.entry.js → p-abebb03c.entry.js} +1 -1
  369. package/dist/webcomponents/{p-1cfa634a.entry.js → p-adaa1c98.entry.js} +1 -1
  370. package/dist/webcomponents/{p-f2b3c7d5.entry.js → p-b2b0303d.entry.js} +1 -1
  371. package/dist/webcomponents/{p-59b95eae.entry.js → p-b39c7414.entry.js} +1 -1
  372. package/dist/webcomponents/p-b925d666.entry.js +1 -0
  373. package/dist/webcomponents/p-bd4d2924.entry.js +1 -0
  374. package/dist/webcomponents/p-c172decb.entry.js +1 -0
  375. package/dist/webcomponents/p-d19d7d41.entry.js +1 -0
  376. package/dist/webcomponents/p-d59d6c23.entry.js +1 -0
  377. package/dist/webcomponents/p-deff4422.entry.js +1 -0
  378. package/dist/webcomponents/p-e1fbadea.entry.js +1 -0
  379. package/dist/webcomponents/{p-1365a46b.entry.js → p-e3c7b4e5.entry.js} +1 -1
  380. package/dist/webcomponents/{p-a7c594d1.entry.js → p-e5feca94.entry.js} +1 -1
  381. package/dist/webcomponents/p-e75d1756.entry.js +1 -0
  382. package/dist/webcomponents/{p-97c6593d.entry.js → p-ebae270b.entry.js} +1 -1
  383. package/dist/webcomponents/p-ebed68aa.entry.js +1 -0
  384. package/dist/webcomponents/{p-16261d8a.entry.js → p-f0084d20.entry.js} +1 -1
  385. package/dist/webcomponents/p-f2c99647.entry.js +1 -0
  386. package/dist/webcomponents/{p-429046e1.entry.js → p-f5686720.entry.js} +1 -1
  387. package/dist/webcomponents/p-f681f747.entry.js +1 -0
  388. package/dist/webcomponents/p-fcc5af24.entry.js +1 -0
  389. package/dist/webcomponents/{p-0f7e3515.entry.js → p-fd1718e0.entry.js} +4 -4
  390. package/dist/webcomponents/p-ff67c8f7.entry.js +1 -0
  391. package/dist/webcomponents/webcomponents.esm.js +1 -1
  392. package/package.json +14 -14
  393. package/LICENSE +0 -21
  394. package/dist/cjs/check-pkg-version-CjJab8fX.js +0 -47
  395. package/dist/cjs/utils-DAyWinG2.js +0 -29
  396. package/dist/collection/utils/check-pkg-version.js +0 -42
  397. package/dist/esm/check-pkg-version-BW9zgceK.js +0 -45
  398. package/dist/esm/package-BC9n8nB2.js +0 -7
  399. package/dist/esm/utils-BnjCmwMr.js +0 -27
  400. package/dist/module/check-pkg-version.js +0 -45
  401. package/dist/types/utils/check-pkg-version.d.ts +0 -1
  402. package/dist/webcomponents/p-082f912c.entry.js +0 -1
  403. package/dist/webcomponents/p-0cd689f4.entry.js +0 -1
  404. package/dist/webcomponents/p-0fbc806f.entry.js +0 -1
  405. package/dist/webcomponents/p-10787684.entry.js +0 -1
  406. package/dist/webcomponents/p-19cabdaf.entry.js +0 -1
  407. package/dist/webcomponents/p-1fa62eba.entry.js +0 -1
  408. package/dist/webcomponents/p-2ef913b8.entry.js +0 -1
  409. package/dist/webcomponents/p-36340e63.entry.js +0 -1
  410. package/dist/webcomponents/p-388082cd.entry.js +0 -1
  411. package/dist/webcomponents/p-3a1f8c5b.entry.js +0 -1
  412. package/dist/webcomponents/p-3f2fb856.entry.js +0 -1
  413. package/dist/webcomponents/p-44ff4f2c.entry.js +0 -1
  414. package/dist/webcomponents/p-4740601b.entry.js +0 -1
  415. package/dist/webcomponents/p-6c7fca1a.entry.js +0 -1
  416. package/dist/webcomponents/p-72bb4aff.entry.js +0 -1
  417. package/dist/webcomponents/p-735d397e.entry.js +0 -1
  418. package/dist/webcomponents/p-8432cb42.entry.js +0 -1
  419. package/dist/webcomponents/p-89f0c2aa.entry.js +0 -1
  420. package/dist/webcomponents/p-9b43b90d.entry.js +0 -1
  421. package/dist/webcomponents/p-9db15fac.entry.js +0 -1
  422. package/dist/webcomponents/p-9eb00966.entry.js +0 -1
  423. package/dist/webcomponents/p-9f0ef3f3.entry.js +0 -1
  424. package/dist/webcomponents/p-BAvoKtN2.js +0 -1
  425. package/dist/webcomponents/p-BC9n8nB2.js +0 -1
  426. package/dist/webcomponents/p-BnjCmwMr.js +0 -1
  427. package/dist/webcomponents/p-Fpaf7CLD.js +0 -1
  428. package/dist/webcomponents/p-_MjmE9YT.js +0 -1
  429. package/dist/webcomponents/p-a71cc8e2.entry.js +0 -1
  430. package/dist/webcomponents/p-a8d25057.entry.js +0 -1
  431. package/dist/webcomponents/p-acb0b66c.entry.js +0 -1
  432. package/dist/webcomponents/p-b9ba7c95.entry.js +0 -1
  433. package/dist/webcomponents/p-c385f10d.entry.js +0 -1
  434. package/dist/webcomponents/p-c55fdbbf.entry.js +0 -1
  435. package/dist/webcomponents/p-ca6c5365.entry.js +0 -1
  436. package/dist/webcomponents/p-d3544e86.entry.js +0 -1
  437. package/dist/webcomponents/p-f0434a13.entry.js +0 -1
  438. package/dist/webcomponents/p-f5cb6a26.entry.js +0 -1
  439. package/dist/webcomponents/p-f9f310dc.entry.js +0 -1
  440. package/dist/webcomponents/p-fda6f27d.entry.js +0 -1
  441. package/dist/webcomponents/p-riZDHN5-.js +0 -1
@@ -1 +1 @@
1
- import{h as s,r as t,c as i}from"./p-CV0Pyo1O.js";import{J as e}from"./p-BjjKkMO1.js";import{C as r,b as o}from"./p-Dqxyi-uK.js";import{m as n,b as a}from"./p-DQmijfCN.js";import{B as h}from"./p-rFpPIJgu.js";import{A as p}from"./p-C6Jq8YDT.js";import"./p-CLHwhyvu.js";import{C as l,B as m,e as u}from"./p-CTtGaVYs.js";import{c as d}from"./p-_MjmE9YT.js";import{l as c}from"./p-Ds_P-dB8.js";import{t as v}from"./p-Bu7gdOaV.js";import{S as g}from"./p-05AWudQe.js";import{H as f}from"./p-CZk3i5Tu.js";import"./p-CZfYo5-1.js";import{B as y}from"./p-XYgDHrVL.js";import{P as j}from"./p-B-Ik8b-s.js";import"./p-BC9n8nB2.js";import"./p-BhpaUYtS.js";import"./p-B4vLfYnZ.js";import"./p-DgTOxu8x.js";import"./p-HXpYMWUU.js";import"./p-eBK-iWrz.js";const b=p();class w{async postProvisioning(s,t,i){return b.post({endpoint:"entities/provisioning",body:{business_id:t,product_category:i},authToken:s})}}const C=()=>s("div",{class:"row gap-3 p-5"},s("div",{class:"col-12"},s(f,{text:"Business Already Provisioned"})),s("div",{class:"col-12",part:v},s("p",null,"We have already received the onboarding information for this business."))),k=()=>s("div",{class:"row gap-3 p5"},s("div",{class:"col-12"},s(f,{text:"You're all set for now"})),s("div",{class:"col-12",part:v},s("p",null,"We're reviewing your information and working on your approval. We'll be in touch to let you know once you've been approved (or if we find anything that needs fixing). Have a good one!"))),B=()=>s("div",{class:"row gap-3 p-5"},s("div",{class:"col-12"},s(f,{text:"Something went wrong"})),s("div",{class:"col-12",part:v},s("p",null,"There was an error submitting the provisioning. Your progress has been saved — please try again later or contact the support team."))),x=class{constructor(s){t(this,s),this.clickEvent=i(this,"click-event",7),this.errorEvent=i(this,"error-event",7),this.submitEvent=i(this,"submit-event",7),this.loading=!1,this.businessLoading=!0,this.businessProvisioned=!1,this.formSubmitted=!1,this.submissionFailed=!1,this.currentStep=0,this.country=l.USA,this.allowOptionalFields=!1,this.formTitle="Business Information",this.refs=[],this.setBusinessProvisioned=()=>new Promise((s=>{this.getBusiness({onSuccess:t=>{const i=new m(t.data);this.businessProvisioned=u(i),this.country=i.country_of_establishment,this.businessProvisioned&&this.errorEvent.emit({message:"A request to provision payments for this business has already been submitted.",errorCode:o.PROVISIONING_REQUESTED,severity:r.INFO}),this.businessLoading=!1,s()},onError:({error:t,code:i,severity:e})=>{this.errorEvent.emit({message:t,errorCode:i,severity:e}),this.businessLoading=!1,s()}})})),this.postProvisioningData=()=>{this.postProvisioning({onSuccess:s=>{this.formSubmitted=!0,this.submitEvent.emit({response:s})},onError:({error:s,code:t,severity:i})=>{this.submissionFailed=!0,this.submitEvent.emit({response:{error:s}}),this.errorEvent.emit({message:s,errorCode:t,severity:i})}})},this.incrementSteps=()=>{if(this.currentStep<this.totalSteps)return this.currentStep++},this.decrementSteps=()=>{this.currentStep>0&&(this.currentStep-=1)},this.previousStepButtonOnClick=()=>{this.clickEvent.emit({name:y.previousStep}),this.decrementSteps()},this.nextStepButtonOnClick=(s,t)=>{s.preventDefault(),this.clickEvent.emit({name:t}),this.refs[this.currentStep].validateAndSubmit({onSuccess:this.incrementSteps})}}propChanged(){this.initializeApi()}handleFormCompleted(){this.postProvisioningData()}handleFormLoading(s){this.loading=s.detail}async componentWillLoad(){d(),this.analytics=new e(this),this.initializeApi(),this.getBusiness?await this.setBusinessProvisioned():this.businessLoading=!1,this.refs=new Array(8)}disconnectedCallback(){var s;null===(s=this.analytics)||void 0===s||s.cleanup()}initializeApi(){this.authToken&&this.businessId?c(this.authToken)?this.errorEvent.emit({message:"auth-token is expired",errorCode:o.NOT_AUTHENTICATED,severity:r.ERROR}):(this.getBusiness=n({authToken:this.authToken,businessId:this.businessId,service:new h}),this.postProvisioning=a({authToken:this.authToken,businessId:this.businessId,product:"payment",service:new w})):this.errorEvent.emit({message:"auth-token and business-id are required",errorCode:o.MISSING_PROPS,severity:r.ERROR})}get formDisabled(){return this.loading||this.businessProvisioned}get totalSteps(){return this.refs.length-1}get stepCounter(){return`Step ${this.currentStep+1} of ${this.totalSteps+1}`}render(){return s(g,null,this.businessLoading?s(j,null):this.businessProvisioned?s(C,null):this.formSubmitted?s(k,null):this.submissionFailed?s(B,null):s("div",{class:"row gap-3"},s(f,{text:this.formTitle}),s("payment-provisioning-form-steps",{businessId:this.businessId,authToken:this.authToken,refs:this.refs,currentStep:this.currentStep,allowOptionalFields:this.allowOptionalFields,country:this.country,handleFormLoading:this.handleFormLoading}),s("div",{class:"d-flex justify-content-between align-items-center"},s("div",{class:"d-flex align-items-center",part:v},this.stepCounter),s("payment-provisioning-form-buttons",{currentStep:this.currentStep,totalSteps:this.totalSteps,formLoading:this.loading,formDisabled:this.formDisabled,previousStepButtonOnClick:this.previousStepButtonOnClick,nextStepButtonOnClick:this.nextStepButtonOnClick}))))}static get watchers(){return{authToken:["propChanged"],businessId:["propChanged"]}}};export{x as justifi_payment_provisioning}
1
+ import{h as s,r as t,c as i}from"./p-CV0Pyo1O.js";import{J as e}from"./p-CEHwp4sh.js";import{C as r,b as o}from"./p-Dqxyi-uK.js";import{m as n,b as a}from"./p-DQmijfCN.js";import{B as h}from"./p-Bo7ndXwR.js";import{A as p}from"./p-DCpGH4xL.js";import"./p-CLHwhyvu.js";import{C as l,B as m,e as d}from"./p-CTtGaVYs.js";import{d as u}from"./p-DF7oFWnO.js";import{l as c}from"./p-Ds_P-dB8.js";import{t as v}from"./p-Bu7gdOaV.js";import{S as g}from"./p-05AWudQe.js";import{H as f}from"./p-CZk3i5Tu.js";import"./p-CZfYo5-1.js";import{B as y}from"./p-XYgDHrVL.js";import{P as b}from"./p-B-Ik8b-s.js";import"./p-DhrQechy.js";import"./p-BhpaUYtS.js";import"./p-B4vLfYnZ.js";import"./p-DgTOxu8x.js";import"./p-HXpYMWUU.js";import"./p-eBK-iWrz.js";const j=p();class w{async postProvisioning(s,t,i){return j.post({endpoint:"entities/provisioning",body:{business_id:t,product_category:i},authToken:s})}}const C=()=>s("div",{class:"row gap-3 p-5"},s("div",{class:"col-12"},s(f,{text:"Business Already Provisioned"})),s("div",{class:"col-12",part:v},s("p",null,"We have already received the onboarding information for this business."))),k=()=>s("div",{class:"row gap-3 p5"},s("div",{class:"col-12"},s(f,{text:"You're all set for now"})),s("div",{class:"col-12",part:v},s("p",null,"We're reviewing your information and working on your approval. We'll be in touch to let you know once you've been approved (or if we find anything that needs fixing). Have a good one!"))),x=()=>s("div",{class:"row gap-3 p-5"},s("div",{class:"col-12"},s(f,{text:"Something went wrong"})),s("div",{class:"col-12",part:v},s("p",null,"There was an error submitting the provisioning. Your progress has been saved — please try again later or contact the support team."))),B=class{constructor(s){t(this,s),this.clickEvent=i(this,"click-event",7),this.errorEvent=i(this,"error-event",7),this.submitEvent=i(this,"submit-event",7),this.loading=!1,this.businessLoading=!0,this.businessProvisioned=!1,this.formSubmitted=!1,this.submissionFailed=!1,this.currentStep=0,this.country=l.USA,this.allowOptionalFields=!1,this.formTitle="Business Information",this.refs=[],this.setBusinessProvisioned=()=>new Promise((s=>{this.getBusiness({onSuccess:t=>{const i=new m(t.data);this.businessProvisioned=d(i),this.country=i.country_of_establishment,this.businessProvisioned&&this.errorEvent.emit({message:"A request to provision payments for this business has already been submitted.",errorCode:o.PROVISIONING_REQUESTED,severity:r.INFO}),this.businessLoading=!1,s()},onError:({error:t,code:i,severity:e})=>{this.errorEvent.emit({message:t,errorCode:i,severity:e}),this.businessLoading=!1,s()}})})),this.postProvisioningData=()=>{this.postProvisioning({onSuccess:s=>{this.formSubmitted=!0,this.submitEvent.emit({response:s})},onError:({error:s,code:t,severity:i})=>{this.submissionFailed=!0,this.submitEvent.emit({response:{error:s}}),this.errorEvent.emit({message:s,errorCode:t,severity:i})}})},this.incrementSteps=()=>{if(this.currentStep<this.totalSteps)return this.currentStep++},this.decrementSteps=()=>{this.currentStep>0&&(this.currentStep-=1)},this.previousStepButtonOnClick=()=>{this.clickEvent.emit({name:y.previousStep}),this.decrementSteps()},this.nextStepButtonOnClick=(s,t)=>{s.preventDefault(),this.clickEvent.emit({name:t}),this.refs[this.currentStep].validateAndSubmit({onSuccess:this.incrementSteps})}}propChanged(){this.initializeApi()}handleFormCompleted(){this.postProvisioningData()}handleFormLoading(s){this.loading=s.detail}async componentWillLoad(){u(),this.analytics=new e(this),this.initializeApi(),this.getBusiness?await this.setBusinessProvisioned():this.businessLoading=!1,this.refs=new Array(8)}disconnectedCallback(){var s;null===(s=this.analytics)||void 0===s||s.cleanup()}initializeApi(){this.authToken&&this.businessId?c(this.authToken)?this.errorEvent.emit({message:"auth-token is expired",errorCode:o.NOT_AUTHENTICATED,severity:r.ERROR}):(this.getBusiness=n({authToken:this.authToken,businessId:this.businessId,service:new h}),this.postProvisioning=a({authToken:this.authToken,businessId:this.businessId,product:"payment",service:new w})):this.errorEvent.emit({message:"auth-token and business-id are required",errorCode:o.MISSING_PROPS,severity:r.ERROR})}get formDisabled(){return this.loading||this.businessProvisioned}get totalSteps(){return this.refs.length-1}get stepCounter(){return`Step ${this.currentStep+1} of ${this.totalSteps+1}`}render(){return s(g,null,this.businessLoading?s(b,null):this.businessProvisioned?s(C,null):this.formSubmitted?s(k,null):this.submissionFailed?s(x,null):s("div",{class:"row gap-3"},s(f,{text:this.formTitle}),s("payment-provisioning-form-steps",{businessId:this.businessId,authToken:this.authToken,refs:this.refs,currentStep:this.currentStep,allowOptionalFields:this.allowOptionalFields,country:this.country,handleFormLoading:this.handleFormLoading}),s("div",{class:"d-flex justify-content-between align-items-center"},s("div",{class:"d-flex align-items-center",part:v},this.stepCounter),s("payment-provisioning-form-buttons",{currentStep:this.currentStep,totalSteps:this.totalSteps,formLoading:this.loading,formDisabled:this.formDisabled,previousStepButtonOnClick:this.previousStepButtonOnClick,nextStepButtonOnClick:this.nextStepButtonOnClick}))))}static get watchers(){return{authToken:["propChanged"],businessId:["propChanged"]}}};export{B as justifi_payment_provisioning}
@@ -0,0 +1 @@
1
+ import{h as e,r as t,c as a}from"./p-CV0Pyo1O.js";import{P as s}from"./p-CRaiEpKf.js";import{m as i}from"./p-C9p1gWAC.js";import{C as d,b as c,i as f,h}from"./p-Dqxyi-uK.js";import{J as l}from"./p-CEHwp4sh.js";import{d as r}from"./p-DF7oFWnO.js";import"./p-B4vLfYnZ.js";import{b as o,d as b,s as p}from"./p-Ds_P-dB8.js";import"./p-CLHwhyvu.js";import"./p-CTtGaVYs.js";import{P as n,M as m}from"./p-Bi_GCMx0.js";import{a as y,b as u,D as v,c as k,C as j,E as g}from"./p-Bh6Q8AqQ.js";import{S as C}from"./p-05AWudQe.js";import"./p-CZfYo5-1.js";import{S as D}from"./p-eBK-iWrz.js";import{a as x,B as w}from"./p-Dz8KJn2G.js";import"./p-DCpGH4xL.js";import"./p-DhrQechy.js";import"./p-HXpYMWUU.js";import"./p-BhpaUYtS.js";import"./p-DgTOxu8x.js";import"./p-Bu7gdOaV.js";const P=()=>e("div",{class:"row gap-3"},e("div",{class:"col-12"},e(D,{width:"35%",height:"30px"})),e("div",{class:"col-12"},e(D,{width:"70%"})),e("div",{class:"col-12"},e(D,{width:"40%"})),e("div",{class:"col-12"},e(D,{width:"40%"})),e("div",{class:"col-12"},e(D,{width:"100%"})),e("div",{class:"col-12"},e(D,{width:"80%"}))),B=class{constructor(e){t(this,e),this.errorEvent=a(this,"error-event",7),this.recordClickEvent=a(this,"record-click-event",7),this.loading=!0}componentWillLoad(){r(),this.analytics=new l(this),this.initializeGetPaymentDetails()}disconnectedCallback(){var e;null===(e=this.analytics)||void 0===e||e.cleanup()}propChanged(){this.initializeGetPaymentDetails()}initializeGetPaymentDetails(){this.paymentId&&this.authToken?(this.getPaymentDetails=i({id:this.paymentId,authToken:this.authToken,service:new s}),this.fetchData()):(this.errorMessage="Payment ID and Auth Token are required",this.errorEvent.emit({message:this.errorMessage,errorCode:c.MISSING_PROPS,severity:d.ERROR}))}updateOnPropChange(){this.getPaymentDetails&&this.fetchData()}fetchData(){this.loading=!0,this.getPaymentDetails({onSuccess:({payment:e})=>{this.payment=e,this.errorMessage=null},onError:({error:e,code:t,severity:a})=>{this.errorMessage=e,this.errorEvent.emit({errorCode:t,message:e,severity:a})},final:()=>{this.loading=!1}})}get PaymentStatus(){return this.payment.status===f.disputed&&this.payment.disputes.some((e=>e.status===h.lost))?n.DISPUTE_LOST:this.payment.status}render(){return e(C,{key:"a7e9a3c93f59da404cf7c3df9b2cfb8f0b66f4d8"},this.loading&&e(P,{key:"05e83902cbff7a519d75d7a6e4d60f339ee96d62"}),!this.loading&&this.errorMessage&&g(this.errorMessage),!this.loading&&!this.errorMessage&&this.payment&&e("justifi-details",{key:"6834945fb72058baa2ea003ddd76e42bd668e1e9",errorMessage:this.errorMessage},e(y,{key:"e871f1bc22b7fe5258cc1f355889fa5dcd4ba248",slot:"head-info",badge:e("div",{class:"d-flex gap-1"},m(this.PaymentStatus),this.payment.expedited?e(x,{variant:w.WARNING,title:"Expedited",text:"Expedited"}):null),title:this.payment.formattedPaymentAmount(this.payment.amount)},e(u,{key:"8307379ee887005233312e034313e63807f5aa01",classes:"border-1 border-end",title:"Updated At",value:`${o(this.payment.updated_at)} ${b(this.payment.updated_at)}`}),e(u,{key:"4d52632189924a0eee5863ccb86ef8ed9cb3cd73",classes:"border-1 border-end",title:"Created At",value:`${o(this.payment.created_at)} ${b(this.payment.created_at)}`}),e(u,{key:"6da7139347579c1e624b0b9fd9eda91c3bceed26",title:"ID",value:this.payment.id})),e("div",{key:"702bfdbfc347dea70c59567e468921ee8a9a12cd",slot:"detail-sections"},e(v,{key:"14ef79439ca64078b38fbd1cf00294353fedc711",sectionTitle:"Details"}),e("div",{key:"db501b8356338bb8899ae31c1906aa4b2f972869",class:"d-flex flex-column gap-2 w-100"},e(k,{key:"d162560b7d68d00f0ec49052f0f233dd17c8ca6c",title:"Amount",value:this.payment.formattedPaymentAmount(this.payment.amount)}),e(k,{key:"25aa60b3b77584b7e2a950b02c261f2cc573374d",title:"Fees",value:this.payment.formattedPaymentAmount(this.payment.fee_amount)}),e(k,{key:"56f9734a9d5e99cd9ac0f501d0fdfe503bc43a43",title:"Refunded",value:this.payment.formattedPaymentAmount(this.payment.amount_refunded)}),e(k,{key:"9cf0070085d224bfde3112f3fd2a9a0f0ec0c644",title:"Net",value:this.payment.formattedPaymentAmount(this.payment.balance)}),e(k,{key:"1ec324fdc3c077382fb3aaa07c1d2c2cea55c851",title:"Status",value:m(this.PaymentStatus)}),e(k,{key:"6fc4866f2f107911f15b014d451b074fea813475",title:"Payment ID",value:this.payment.id}),e(k,{key:"d88f789cffbb9c998585f75b4951f3c1f7943317",title:"Processing Fees",value:this.payment.formattedPaymentAmount(this.payment.fee_amount)}),e(k,{key:"17aa232392ee07c67ecfb75f33c7bf9fcdc4827b",title:"Statement Descriptor",value:this.payment.statement_descriptor}),e(k,{key:"2e16cb0cb370245e4d5228187648115a3097deb8",title:"Description",value:this.payment.description}),e(k,{key:"48115ee84b177a50fb5d8ff52d5fc0dcf4b54f45",title:"Expedited",value:this.payment.expedited?"Yes":"No"})),this.payment.payment_method.card&&[e(v,{key:"4a9b102db3741a4b19f641d4dda40b868b2a850d",sectionTitle:"Payment Method"}),e("div",{key:"445700f124e5bd78002a950383abd04010d17566",class:"d-flex flex-column gap-2 w-100"},e(k,{key:"2d4af0d10f3a434a1ea959ea69edb9998babed1f",title:"ID",value:this.payment.payment_method.card.id}),e(k,{key:"25d1550693424530e9159d71652966c9a95c8ea1",title:"Payment Type",value:"Card"}),e(k,{key:"26ebdd7378212735eb9244a19300e11d2676e1b4",title:"Last 4 Numbers",value:this.payment.payment_method.lastFourDigits}),e(k,{key:"54ea6597354ee0973e8b26938929b59e2764979e",title:"Brand",value:p(this.payment.payment_method.card.brand)}),e(k,{key:"35570db9207f3a635e65a432645c48d719c43eb3",title:"Cardholder",value:this.payment.payment_method.payersName}))],this.payment.payment_method.bank_account&&[e(v,{key:"ddf40dd9d67bc7f1b2845e04f54e1c13ef3595d7",sectionTitle:"Payment Method"}),e("div",{key:"1e885546d02b46e6062ea14520cf4696ae700891",class:"d-flex flex-column gap-2 w-100"},e(k,{key:"720d5976c091e16c3b7588f90d5d9b75f4906df4",title:"ID",value:this.payment.payment_method.bank_account.id}),e(k,{key:"83d82efdb0c25417f7124623c8da76af09dccd4a",title:"Last 4 Numbers",value:this.payment.last_four_digits}),e(k,{key:"3940d8a1db31b249bb826606ad8dc432eaa254c5",title:"Bank Name",value:this.payment.payment_method.bank_account.brand}),e(k,{key:"000b585a4ea9937473fa8e2e33342756b99d6c19",title:"Account Owner",value:this.payment.payment_method.payersName}))],this.payment.metadata&&[e(v,{key:"27f2e988168efe8044782c0144764dd94e739986",sectionTitle:"Metadata"}),e("div",{key:"b3ecbaf625f30f85e3bc8e733d5041d62c5acaeb",class:"d-table gap-2 w-100"},e(j,{key:"2470f5603cd55c2a196668f7ff6184ca5d1a0373",metadata:this.payment.metadata}))])))}static get watchers(){return{paymentId:["propChanged"],authToken:["propChanged"],getPaymentDetails:["updateOnPropChange"]}}};export{B as justifi_payment_details}
@@ -1 +1 @@
1
- import{r as t,c as e,h as s,H as a,g as i}from"./p-CV0Pyo1O.js";import{F as r}from"./p-CLZcevBz.js";import{a3 as o,q as h,v as l,u as c,w as n,x as f}from"./p-Bu7gdOaV.js";const d=class{constructor(s){t(this,s),this.formControlInput=e(this,"formControlInput",7),this.formControlBlur=e(this,"formControlBlur",7),this.errorText="",this.inputHandler=()=>{},this.disabled=!1}render(){return s(a,{key:"8f1a2e7469bf052321e464d3d7d4434a8e1b94eb",exportparts:"label,input,input-invalid"},s("div",{key:"a930b47727ba05e965ec5df7b042d2416d38db2c",class:"form-group d-flex flex-column"},s("div",{key:"e1040ac692c0f597c0461bcaa27f562c69056c30",class:"d-flex align-items-start gap-2"},s("label",{key:"387e3d18da10274de2cf9ef680d9483d7855e77e",part:"label",class:"form-label",htmlFor:this.name},this.label),s("form-control-tooltip",{key:"4bc4aab440ec7cca2eb6af7105d2d9078922376a",helpText:this.helpText})),s("input",{key:"4050a93b51b5b1ecadfe9cff53c5794321c77d13",type:"file",name:this.name,part:`input ${this.errorText?"input-invalid ":""}${this.disabled?"input-disabled":""}`,class:this.errorText?"form-control is-invalid":"form-control",multiple:this.multiple,disabled:this.disabled,onBlur:()=>this.formControlBlur.emit(),onChange:()=>this.errorText=""}),s(r,{key:"aee21aa5cd54e48f2e7eca3763a07051dd942653",errorText:this.errorText,name:this.name})))}get el(){return i(this)}},m=class{constructor(s){t(this,s),this.formControlInput=e(this,"formControlInput",7),this.formControlBlur=e(this,"formControlBlur",7),this.isFocused=!1,this.helpText="",this.errorText="",this.inputHandler=()=>{},this.disabled=!1,this.handleFormControlInput=t=>{const e=t.target,s=e.getAttribute("name");this.inputHandler(s,e.value),this.formControlInput.emit({name:s,value:e.value})},this.updateInput=t=>{const e=this.el.querySelector("textarea");e&&(e.value=t||"")}}handleDefaultValueChange(t){this.updateInput(t)}componentDidLoad(){this.updateInput(this.defaultValue)}get part(){return this.isFocused&&this.errorText?o:this.errorText?h:this.isFocused?l:this.disabled?c:n}render(){return s(a,{key:"c23d0ccb0e033048012cb1e1110f785a6270b163"},s("div",{key:"971db0fe032afae7ea976e0fa3845040a39aab28",class:"form-group d-flex flex-column"},s("label",{key:"b733fd61b5421aea811e3b9423d85c6c682493f0",part:f,class:"form-label",htmlFor:this.name},this.label),s("textarea",{key:"fa13e420ffdfa28d139418ebfa48bf9108710438",id:this.name,name:this.name,onFocus:()=>this.isFocused=!0,onBlur:()=>{this.isFocused=!1,this.formControlBlur.emit()},onInput:this.handleFormControlInput,onKeyDown:this.keyDownHandler,onPaste:this.keyDownHandler,maxLength:this.maxLength,part:this.part,class:this.errorText?"form-control is-invalid":"form-control",disabled:this.disabled}),s("form-control-help-text",{key:"787e9ecc2833c827880c7a44c9a577c56f258375",helpText:this.helpText,name:this.name}),s("form-control-error-text",{key:"0f0915db581aee8672f6089d681596c9650b09c2",errorText:this.errorText,name:this.name})))}get el(){return i(this)}static get watchers(){return{defaultValue:["handleDefaultValueChange"]}}};export{d as form_control_file_v2,m as form_control_textarea}
1
+ import{r as t,c as e,h as s,H as a,g as i}from"./p-CV0Pyo1O.js";import{F as r}from"./p-CLZcevBz.js";import{a3 as o,q as h,v as l,u as c,w as f,x as n}from"./p-Bu7gdOaV.js";const d=class{constructor(s){t(this,s),this.formControlInput=e(this,"formControlInput",7),this.formControlBlur=e(this,"formControlBlur",7),this.errorText="",this.inputHandler=()=>{},this.disabled=!1}render(){return s(a,{key:"da210da60328a5f8ee71a88b5fa8d4d67220239b",exportparts:"label,input,input-invalid"},s("div",{key:"f77db6dd47f4d9d64beace790a6d4fcd937c381c",class:"form-group d-flex flex-column"},s("div",{key:"ce25b3f690fed13cefa402d07f0afffc7c168f46",class:"d-flex align-items-start gap-2"},s("label",{key:"82d2d2cebee0b98849c90ab90a67cb56be8c239e",part:"label",class:"form-label",htmlFor:this.name},this.label),s("form-control-tooltip",{key:"2593993d8ed2824c8ceaf0c7c9da194361edac25",helpText:this.helpText})),s("input",{key:"04d5a84a8c1a92b20ef26f47463b3a836027c8cb",type:"file",name:this.name,part:`input ${this.errorText?"input-invalid ":""}${this.disabled?"input-disabled":""}`,class:this.errorText?"form-control is-invalid":"form-control",multiple:this.multiple,disabled:this.disabled,onBlur:()=>this.formControlBlur.emit(),onChange:()=>this.errorText=""}),s(r,{key:"ccb9cc9b8e138f3f9e1ed96fe660f3d784de004f",errorText:this.errorText,name:this.name})))}get el(){return i(this)}},m=class{constructor(s){t(this,s),this.formControlInput=e(this,"formControlInput",7),this.formControlBlur=e(this,"formControlBlur",7),this.isFocused=!1,this.helpText="",this.errorText="",this.inputHandler=()=>{},this.disabled=!1,this.handleFormControlInput=t=>{const e=t.target,s=e.getAttribute("name");this.inputHandler(s,e.value),this.formControlInput.emit({name:s,value:e.value})},this.updateInput=t=>{const e=this.el.querySelector("textarea");e&&(e.value=t||"")}}handleDefaultValueChange(t){this.updateInput(t)}componentDidLoad(){this.updateInput(this.defaultValue)}get part(){return this.isFocused&&this.errorText?o:this.errorText?h:this.isFocused?l:this.disabled?c:f}render(){return s(a,{key:"c23d0ccb0e033048012cb1e1110f785a6270b163"},s("div",{key:"971db0fe032afae7ea976e0fa3845040a39aab28",class:"form-group d-flex flex-column"},s("label",{key:"b733fd61b5421aea811e3b9423d85c6c682493f0",part:n,class:"form-label",htmlFor:this.name},this.label),s("textarea",{key:"fa13e420ffdfa28d139418ebfa48bf9108710438",id:this.name,name:this.name,onFocus:()=>this.isFocused=!0,onBlur:()=>{this.isFocused=!1,this.formControlBlur.emit()},onInput:this.handleFormControlInput,onKeyDown:this.keyDownHandler,onPaste:this.keyDownHandler,maxLength:this.maxLength,part:this.part,class:this.errorText?"form-control is-invalid":"form-control",disabled:this.disabled}),s("form-control-help-text",{key:"787e9ecc2833c827880c7a44c9a577c56f258375",helpText:this.helpText,name:this.name}),s("form-control-error-text",{key:"0f0915db581aee8672f6089d681596c9650b09c2",errorText:this.errorText,name:this.name})))}get el(){return i(this)}static get watchers(){return{defaultValue:["handleDefaultValueChange"]}}};export{d as form_control_file_v2,m as form_control_textarea}
@@ -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 d,p as s,c as l}from"./p-BLhz_ggG.js";import{f as c,a as i}from"./p-Bu7gdOaV.js";import{S as r}from"./p-05AWudQe.js";import"./p-CZfYo5-1.js";import{c as o,a as f}from"./p-Ds_P-dB8.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)=>{d[e]=a},this.handleDateInput=(e,a)=>{const t=o(a,{setExactTime:!0});this.setParamsOnChange(e,t)}}componentWillLoad(){this.debouncedSetParamsOnChange=t.debounce(this.setParamsOnChange,300),Object.entries({payment_id:this.paymentId,terminal_id:this.terminalId,payment_status:this.paymentStatus,payment_mode:this.paymentMode,checkout_id:this.checkoutId,account_holder:this.accountHolder,created_after:this.createdAfter,created_before:this.createdBefore}).forEach((([e,a])=>{a&&(s[e]=a)}))}get paymentStatusOptions(){return[{label:"All",value:""},{label:"Pending",value:"pending"},{label:"Authorized",value:"authorized"},{label:"Succeeded",value:"succeeded"},{label:"Failed",value:"failed"},{label:"Disputed",value:"disputed"},{label:"Refunded",value:"refunded"}]}get paymentModeOptions(){return[{label:"All",value:""},{label:"E-commerce",value:"ecom"},{label:"ACH",value:"ach"},{label:"Card Present",value:"card_present"}]}render(){const e=Object.assign({},d);return a(r,{key:"fd6a6c240ed15d7d28d4d58db57085d9789e055c"},a("table-filters-menu",{key:"bc1524c293cc12f9d5976d1a7f888c4d35096b5a",params:e,clearParams:l,part:c},a("div",{key:"5180f595ac0d5c36e16fbcb8a6751c48ac88d166",class:"grid-cols-2 gap-3 p-1"},a("div",{key:"2771ebb890c0a9f469e02f22523cb7cfb418d513",class:"p-2"},a("form-control-text",{key:"3c93cc523f8e5e2d9e63c1b6265e8e03c08377fa",name:"payment_id",label:"Payment ID",inputHandler:this.debouncedSetParamsOnChange,defaultValue:this.paymentId||d.payment_id,disabled:!!this.paymentId,part:i})),a("div",{key:"66e985568825d8992c4081f0d459807a7773fd49",class:"p-2"},a("form-control-text",{key:"63efc9b447218119d90a0601eb85528117197b42",name:"terminal_id",label:"Terminal ID",inputHandler:this.debouncedSetParamsOnChange,defaultValue:this.terminalId||d.terminal_id,disabled:!!this.terminalId,part:i})),a("div",{key:"0147be1acda5af7b2ddd3ae76e61e0e2ec33ddcd",class:"p-2"},a("form-control-select",{key:"786ab3d3205d2feda8c11840a9c5429915f6ab4c",name:"payment_status",label:"Status",options:this.paymentStatusOptions,inputHandler:this.setParamsOnChange,defaultValue:this.paymentStatus||d.payment_status||"",disabled:!!this.paymentStatus,part:i})),a("div",{key:"e08cee43b808e3246989c277d1b5b870799b602d",class:"p-2"},a("form-control-select",{key:"b2edc5a654ad50a00ee8171f673c48a2f0b10699",name:"payment_mode",label:"Payment Mode",options:this.paymentModeOptions,inputHandler:this.setParamsOnChange,defaultValue:this.paymentMode||d.payment_mode||"",disabled:!!this.paymentMode,part:i})),a("div",{key:"9c393aed8075c68fa21e919fad3e66a75bf0801b",class:"p-2"},a("form-control-text",{key:"40967dca09780e59a096f117068c1f49dc7f68fb",name:"checkout_id",label:"Checkout ID",inputHandler:this.debouncedSetParamsOnChange,defaultValue:this.checkoutId||d.checkout_id,disabled:!!this.checkoutId,part:i})),a("div",{key:"4c5177f35cd58c1e465f5750bdf92559119bbffa",class:"p-2"},a("form-control-text",{key:"4a905f81a07c1a10df4d72ba85657baad464cc87",name:"account_holder",label:"Account Holder",inputHandler:this.debouncedSetParamsOnChange,defaultValue:this.accountHolder||d.account_holder,disabled:!!this.accountHolder,part:i})),a("div",{key:"272f47c23883018d4fda9a215738b6b81764b99e",class:"p-2"},a("form-control-date",{key:"40f7c019ec33378c42b7093c9023eb80df7f787f",name:"created_after",label:"Created After",inputHandler:this.handleDateInput,defaultValue:f(this.createdAfter,{showInputDateTime:!0})||f(d.created_after,{showInputDateTime:!0}),showTime:!0,disabled:!!this.createdAfter,part:i})),a("div",{key:"b714a400679ed1f4bcf96afe44e9100c6e52cef7",class:"p-2"},a("form-control-date",{key:"361a3d52c4f2c78aec9727cf6cfdd5b8d900bd3d",name:"created_before",label:"Created Before",inputHandler:this.handleDateInput,defaultValue:f(this.createdBefore,{showInputDateTime:!0})||f(d.created_before,{showInputDateTime:!0}),showTime:!0,disabled:!!this.createdBefore,part:i})))))}};export{n as justifi_payments_list_filters}
@@ -1 +1 @@
1
- import{r as e,h as a}from"./p-CV0Pyo1O.js";import{c as t,a as i,F as c}from"./p-D9sqTVmd.js";import{a9 as d}from"./p-Bu7gdOaV.js";import"./p-BFTU3MAI.js";const s=t({additional_statement:i().nullable()});var o,l;!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"}(o||(o={})),function(e){e.activity_log="activity_log",e.cancellationPolicy="cancellation_policy",e.customerCommunication="customer_communication",e.customerSignature="customer_signature",e.duplicateChargeDocumentation="duplicate_charge_documentation",e.receipt="receipt",e.refundPolicy="refund_policy",e.serviceDocumentation="service_documentation",e.shippingDocumentation="shipping_documentation",e.uncategorizedFile="uncategorized_file"}(l||(l={}));class n{set presignedUrl(e){this._presignedUrl=e}get presignedUrl(){return this._presignedUrl}async getFileString(){const e=new Promise(((e,a)=>{const t=new FileReader;t.onload=a=>{e(a.target.result)},t.onerror=()=>{a(new Error("Error reading file"))},t.readAsArrayBuffer(this._file)}));return await e}constructor(e,a){this._file=e,this.file_name=e.name,this.file_type=e.type,this.dispute_evidence_type=a}}const r=(e,a)=>{const t=e.target,i=t.name,c=t.files;a[i]=[];for(const e of c)a[i].push(new n(e,i))},f=class{constructor(a){e(this,a),this.documentErrors={},this.errors={},this.acceptedTerms=!1,this.documents={uncategorized_file:[]},this.inputHandler=(e,a)=>{this.form.setValues(Object.assign(Object.assign({},this.form.values.getValue()),{[e]:a}))}}async validateAndSubmit(e){const a=Object.values(this.documents).flat();this.form.validateAndSubmit((t=>e(t,a,o.additionalStatement)))}componentWillLoad(){this.form=new c(s)}componentDidLoad(){this.form.errors.subscribe((e=>{this.errors=Object.assign({},e)}))}render(){var e,t;return a("div",{key:"d87892b31a560cf5089bb8b94403deda25c75132"},a("div",{key:"a083b417adafd62cd32827014eb8566c8d8e431e",class:"row gy-3"},a("div",{key:"832973d1fd655582b7371dcb0906b5fed9d77727",class:"col-12"},a("h2",{key:"339e84637eb3e2080bc08c06379b436ed66cdbf3",class:"h5",part:d},"Additional Evidence")),a("div",{key:"a8228b7e9d8fd51f491f279975ba380a0f6f6029",class:"col-12"},a("form-control-textarea",{key:"966cd51de65c862e9371f2e013f9f666da5f049a",label:"Is there anything else you would like to say about this dispute?",name:"additional_statement",defaultValue:null===(e=this.disputeResponse)||void 0===e?void 0:e.additional_statement,inputHandler:this.inputHandler,errorText:this.errors.additional_statement})),a("div",{key:"3c21b60e1da1d208c16b4e4003242660f28f42e5",class:"col-12"},a("form-control-file-v2",{key:"f767738c5ebf8a63d403d48e971042aabdf91224",label:"Additional files",name:"uncategorized_file",multiple:!0,helpText:"Upload any additional pieces of evidence that have not already been provided.",onChange:e=>r(e,this.documents),errorText:null===(t=this.documentErrors)||void 0===t?void 0:t.uncategorized_file}))))}},b=t({cancellation_policy_disclosure:i().nullable(),cancellation_rebuttal:i().nullable()}),h=class{constructor(a){e(this,a),this.documentErrors={},this.errors={},this.documents={cancellation_policy:[]},this.inputHandler=(e,a)=>{this.form.setValues(Object.assign(Object.assign({},this.form.values.getValue()),{[e]:a}))}}async validateAndSubmit(e){const a=Object.values(this.documents).flat();this.form.validateAndSubmit((t=>e(t,a,o.cancellationPolicy)))}componentWillLoad(){this.form=new c(b)}componentDidLoad(){this.form.errors.subscribe((e=>{this.errors=Object.assign({},e)}))}render(){var e,t,i;return a("div",{key:"b2b9de71bee44157e6f62cab9a759ca3a6fc7c91"},a("div",{key:"b54a10355e8b0dd0da69e9c07abaf4376f759f4b",class:"row gy-3"},a("div",{key:"ed43e475ed87fa9658060f403187a063bec1813c",class:"col-12"},a("h2",{key:"48e9d7955c066771d8c47b55abf4fc2498bcc11a",class:"h5",part:d},"Cancellation Policy")),a("div",{key:"783da1c2a786ee85f412303583a778dd81331e8a",class:"col-12"},a("form-control-textarea",{key:"04267a5b01060f577eb88810c83013e6cb2bc437",label:"Cancellation Policy Disclosure",name:"cancellation_policy_disclosure",defaultValue:null===(e=this.disputeResponse)||void 0===e?void 0:e.cancellation_policy_disclosure,inputHandler:this.inputHandler,errorText:this.errors.cancellation_policy_disclosure})),a("div",{key:"340db58f52fa708a40a1548b84411174f1b7ca85",class:"col-12"},a("form-control-textarea",{key:"a8dafe6142a2ce7409d7d7dd60637e819bb99b9e",label:"Cancellation Rebuttal",name:"cancellation_rebuttal",defaultValue:null===(t=this.disputeResponse)||void 0===t?void 0:t.cancellation_rebuttal,inputHandler:this.inputHandler,errorText:this.errors.cancellation_rebuttal})),a("div",{key:"7ff48beda50edb31c80d0bbe5fe7948ce214a493",class:"col-12"},a("form-control-file-v2",{key:"2f3780f2036026f49db380d5201fc6a46d4b15c6",label:"Upload Cancellation Policy",name:"cancellation_policy",onChange:e=>r(e,this.documents),errorText:null===(i=this.documentErrors)||void 0===i?void 0:i.cancellation_policy}))))}},u=t({customer_name:i().nullable(),customer_email_address:i().nullable(),customer_billing_address:i().nullable()}),v=class{constructor(a){e(this,a),this.documentErrors={},this.errors={},this.documents={customer_signature:[],customer_communication:[]},this.inputHandler=(e,a)=>{this.form.setValues(Object.assign(Object.assign({},this.form.values.getValue()),{[e]:a}))}}async validateAndSubmit(e){const a=Object.values(this.documents).flat();this.form.validateAndSubmit((t=>e(t,a,o.customerDetails)))}componentWillLoad(){this.form=new c(u)}componentDidLoad(){this.form.errors.subscribe((e=>{this.errors=Object.assign({},e)}))}render(){var e,t,i,c,s;return a("div",{key:"4217dd2605586a82ee34515e6c9b5a3ab6358b55"},a("div",{key:"42eb8a48d1161d329bddf574c863c92376a4bbc9",class:"row gy-3"},a("div",{key:"4d8d1267035ed1e81e6050d7e648ff80d369365d",class:"col-12"},a("h2",{key:"923c89d2959dd09fdbb60cfbca0d0021697dc5b8",class:"h5",part:d},"Customer Details")),a("div",{key:"5b3daa86ad6ce05babf3efd0c3c4f3a3264b4c6c",class:"col-12"},a("form-control-text",{key:"bd6eae36d75ec77e8d652686f2f070bbead4e385",label:"Full Name",name:"customer_name",defaultValue:null===(e=this.disputeResponse)||void 0===e?void 0:e.customer_name,inputHandler:this.inputHandler,errorText:this.errors.customer_name})),a("div",{key:"3f8f8ff8fcb8a8e41053e3f9b55152296cb91d3e",class:"col-12"},a("form-control-text",{key:"ddf390a5e37e99b8f99b7673b6b07f3851a759f4",label:"Email",name:"customer_email_address",defaultValue:null===(t=this.disputeResponse)||void 0===t?void 0:t.customer_email_address,inputHandler:this.inputHandler,errorText:this.errors.customer_email_address})),a("div",{key:"eed293a2acc46219bd33974f93affb3ca977fc57",class:"col-12"},a("form-control-textarea",{key:"4f5e5b9cfc9aefe48c2c85bba3a3a308215c36b9",label:"Billing Address",name:"customer_billing_address",defaultValue:null===(i=this.disputeResponse)||void 0===i?void 0:i.customer_billing_address,inputHandler:this.inputHandler,errorText:this.errors.customer_billing_address})),a("div",{key:"0ccfa871557435a96350e8ace59179611c01dc2c",class:"col-12"},a("form-control-file-v2",{key:"e9d35062a5011f4e72d60e85855efb0d7ceed8c1",label:"Customer Signature",name:"customer_signature",onChange:e=>r(e,this.documents),errorText:null===(c=this.documentErrors)||void 0===c?void 0:c.customer_signature})),a("div",{key:"cb184b84ccc36bd51242dcb57c96ba2d85567e4a",class:"col-12"},a("form-control-file-v2",{key:"b7d1d427468cd0744001102e2c704e8ad65577b6",label:"Customer Communication",name:"customer_communication",onChange:e=>r(e,this.documents),errorText:null===(s=this.documentErrors)||void 0===s?void 0:s.customer_communication}))))}},p=t({duplicate_charge_original_payment_id:i().nullable(),duplicate_charge_explanation:i().nullable()}),m=class{constructor(a){e(this,a),this.documentErrors={},this.errors={},this.documents={duplicate_charge_documentation:[]},this.inputHandler=(e,a)=>{this.form.setValues(Object.assign(Object.assign({},this.form.values.getValue()),{[e]:a}))}}async validateAndSubmit(e){const a=Object.values(this.documents).flat();this.form.validateAndSubmit((t=>e(t,a,o.duplicateCharge)))}componentWillLoad(){this.form=new c(p)}componentDidLoad(){this.form.errors.subscribe((e=>{this.errors=Object.assign({},e)}))}render(){var e,t,i;return a("div",{key:"805b160927f30729b321ffbafc15fe78fed732c9"},a("div",{key:"fcc99471b08ea21905c1246849ec41e05194834f",class:"row gy-3"},a("div",{key:"f7259723ec39b5ae09aaa552a99f3a8a15b85fd8",class:"col-12"},a("h2",{key:"5f0719c624bce5542364120568079fb6921c7d6f",class:"h5",part:d},"Duplicate Charge")),a("div",{key:"718c50ebae8b6ca9c146d81f261dad5007945a33",class:"col-12"},a("form-control-text",{key:"090a5f0e4ca359af300f655ad94296af1a28eef0",label:"Original Payment ID",name:"duplicate_charge_original_payment_id",defaultValue:null===(e=this.disputeResponse)||void 0===e?void 0:e.duplicate_charge_original_payment_id,inputHandler:this.inputHandler,errorText:this.errors.duplicate_charge_original_payment_id})),a("div",{key:"217b8e9b896412a1e74d138c20d6cc42760e7a54",class:"col-12"},a("form-control-textarea",{key:"d9ba9a25ccaa5848f17ec8f1dfde222c29624e06",label:"Duplicate Charge Explanation",name:"duplicate_charge_explanation",defaultValue:null===(t=this.disputeResponse)||void 0===t?void 0:t.duplicate_charge_explanation,inputHandler:this.inputHandler,errorText:this.errors.duplicate_charge_explanation})),a("div",{key:"eb26362fb100e775339b4a64959521a1b7cad394",class:"col-12"},a("form-control-file-v2",{key:"5753787dd59e736a7a2dea84268d93983cfdeae4",label:"Duplicate Charge Documentation",name:"duplicate_charge_documentation",onChange:e=>r(e,this.documents),errorText:null===(i=this.documentErrors)||void 0===i?void 0:i.duplicate_charge_documentation}))))}},y=t({customer_purchase_ip_address:i().nullable()}),_=class{constructor(a){e(this,a),this.documentErrors={},this.errors={},this.documents={activity_log:[]},this.inputHandler=(e,a)=>{this.form.setValues(Object.assign(Object.assign({},this.form.values.getValue()),{[e]:a}))}}async validateAndSubmit(e){const a=Object.values(this.documents).flat();this.form.validateAndSubmit((t=>e(t,a,o.electronicEvidence)))}componentWillLoad(){this.form=new c(y)}componentDidLoad(){this.form.errors.subscribe((e=>{this.errors=Object.assign({},e)}))}render(){var e,t;return a("div",{key:"1de8dc7fafbd3dba15344a817fd2c008929ab0bc"},a("div",{key:"dda3c4b88713e0e1b9fe25c2a4fe2d015889f2b3",class:"row gy-3"},a("div",{key:"1638ff98ca047509306f9387e68ba83c9be5c885",class:"col-12"},a("h2",{key:"9ee705b8558a88bd4eebe2448e2da655fbcf9bf3",class:"h5",part:d},"Electronic Evidence")),a("div",{key:"71a392aa19784a1e25654791544fab6e9fd482a6",class:"col-12"},a("form-control-text",{key:"b2ef47161c0c73f010461f326f39f60efb140ae8",label:"Purchase IP Address",name:"customer_purchase_ip_address",helpText:"The IP address used by the customer during the purchase.",defaultValue:null===(e=this.disputeResponse)||void 0===e?void 0:e.customer_purchase_ip_address,inputHandler:this.inputHandler,errorText:this.errors.customer_purchase_ip_address})),a("div",{key:"0341ecbd1404b29e223d508e937752ed67a5f9e2",class:"col-12"},a("form-control-file-v2",{key:"00d8fd3c9bfded6f20ae8568aca1fd21564649df",label:"Activity Logs",name:"activity_log",helpText:"Any server or activity logs that provide evidence of the customer's access to or download of the purchased digital product. This information should encompass IP addresses, relevant timestamps, and any detailed records of activity.",onChange:e=>r(e,this.documents),errorText:null===(t=this.documentErrors)||void 0===t?void 0:t.activity_log}))))}},k=t({product_description:i().nullable(),service_date:i().nullable()}),g=class{constructor(a){e(this,a),this.documentErrors={},this.errors={},this.documents={service_documentation:[]},this.inputHandler=(e,a)=>{this.form.setValues(Object.assign(Object.assign({},this.form.values.getValue()),{[e]:a}))}}async validateAndSubmit(e){const a=Object.values(this.documents).flat();this.form.validateAndSubmit((t=>e(t,a,o.productOrService)))}componentWillLoad(){this.form=new c(k)}componentDidLoad(){this.form.errors.subscribe((e=>{this.errors=Object.assign({},e)}))}render(){var e,t,i;return a("div",{key:"3f2d1c2f4b0595e922712f8754ae1022b2d19261"},a("div",{key:"0ab14085510225a4d00b352014ea72f4dc0a059a",class:"row gy-3"},a("div",{key:"12271b714bf3e6b6756274674e3413018124fa4c",class:"col-12"},a("h2",{key:"9b6175bf1eb88788b909be3f7a46337a75856306",class:"h5",part:d},"Product & Service Details")),a("div",{key:"912e647000393b9146329e7d4cca78ee15837621",class:"col-12"},a("form-control-text",{key:"7b365315a58fdfa65fa7e1e6f009dc5c70c17d95",label:"Product Description",name:"product_description",defaultValue:null===(e=this.disputeResponse)||void 0===e?void 0:e.product_description,inputHandler:this.inputHandler,errorText:this.errors.product_description})),a("div",{key:"03d48b21fb83a4a4b07ed6f0f7b6f08a32c10ce5",class:"col-12"},a("form-control-date",{key:"fbd7c448acc69aa0012999f90d3b38f9374af933",label:"Service Date",name:"service_date",defaultValue:null===(t=this.disputeResponse)||void 0===t?void 0:t.service_date,inputHandler:this.inputHandler,errorText:this.errors.service_date})),a("div",{key:"74683fc2825cffa9403313b21d52a4ddb76db12e",class:"col-12"},a("form-control-file-v2",{key:"7d3e5f2f96375d884a98e207c22d2b3115ed6e1b",label:"Service Documentation",name:"service_documentation",onChange:e=>r(e,this.documents),errorText:null===(i=this.documentErrors)||void 0===i?void 0:i.service_documentation}))))}},x=t({refund_policy_disclosure:i().nullable(),refund_refusal_explanation:i().nullable()}),j=class{constructor(a){e(this,a),this.documentErrors={},this.errors={},this.documents={refund_policy:[],receipt:[]},this.inputHandler=(e,a)=>{this.form.setValues(Object.assign(Object.assign({},this.form.values.getValue()),{[e]:a}))}}async validateAndSubmit(e){const a=Object.values(this.documents).flat();this.form.validateAndSubmit((t=>e(t,a,o.refundPolicy)))}componentWillLoad(){this.form=new c(x)}componentDidLoad(){this.form.errors.subscribe((e=>{this.errors=Object.assign({},e)}))}render(){var e,t,i,c;return a("div",{key:"828ac1997382fa491920b9439099959ae5376c81"},a("div",{key:"8d0453e4c2ec424a2010cfd01885cb4a03020d93",class:"row gy-3"},a("div",{key:"d15021ea6df4b3939d4564a84951ebadb50cc7cd",class:"col-12"},a("h2",{key:"632eafab4924af0d433f28a3329877b98376ea27",class:"h5",part:d},"Refund Policy and Receipt")),a("div",{key:"cb55f0f106e68e9af4057a4496811db991f487d0",class:"col-12"},a("form-control-textarea",{key:"1fdca1aea95757a0dac55b338355eeffd351c6cb",label:"Refund Policy Disclosure",name:"refund_policy_disclosure",defaultValue:null===(e=this.disputeResponse)||void 0===e?void 0:e.refund_policy_disclosure,inputHandler:this.inputHandler})),a("div",{key:"6f6c35c4626a764e4119dc253aded2985ac6ffbc",class:"col-12"},a("form-control-textarea",{key:"6c0fcba48cad9f8c3cc9ed6c35d6b0e1301f9c35",label:"Refund Refusal Explanation",name:"refund_refusal_explanation",defaultValue:null===(t=this.disputeResponse)||void 0===t?void 0:t.refund_refusal_explanation,inputHandler:this.inputHandler})),a("div",{key:"1bf52c92c53313ab7542bfc1b2ed607e9d5db032",class:"col-12"},a("form-control-file-v2",{key:"67b266e26d5568e3370b3f8aaad2c0d6450f67f6",label:"Upload Refund Policy",name:"refund_policy",onChange:e=>r(e,this.documents),errorText:null===(i=this.documentErrors)||void 0===i?void 0:i.refund_policy})),a("div",{key:"8994ee85c8a31fc709a0fa396d97e4da576e57c3",class:"col-12"},a("form-control-file-v2",{key:"c468b92349b6a92f02b6eef0dc06c71dfc924c4e",label:"Upload Receipt",name:"receipt",onChange:e=>r(e,this.documents),errorText:null===(c=this.documentErrors)||void 0===c?void 0:c.receipt}))))}},O=t({shipping_carrier:i().nullable(),shipping_tracking_number:i().nullable(),shipping_date:i().nullable(),shipping_address:i().nullable()}),T=class{constructor(a){e(this,a),this.documentErrors={},this.errors={},this.documents={shipping_documentation:[]},this.documentList=[],this.inputHandler=(e,a)=>{this.form.setValues(Object.assign(Object.assign({},this.form.values.getValue()),{[e]:a}))}}async validateAndSubmit(e){const a=Object.values(this.documents).flat();this.form.validateAndSubmit((t=>e(t,a,o.shippingDetails)))}componentWillLoad(){this.form=new c(O)}componentDidLoad(){this.form.errors.subscribe((e=>{this.errors=Object.assign({},e)}))}render(){var e,t,i,c,s;return a("div",{key:"0d7695711048ad14596ba44e364b45e3aa3d1e39"},a("div",{key:"e6911e35f66ef8aaa591f54e389d67c202af8172",class:"row gy-3"},a("div",{key:"d59ab2fe6318a27c4b38650e4e9d07b9c851041f",class:"col-12"},a("h2",{key:"b8a8634fe9dcf11c332dab0c1736732e579aeb59",class:"h5",part:d},"Shipping Details")),a("div",{key:"5170b37a386805e194d8cf7c769ffdbac8db8fa2",class:"col-12"},a("form-control-text",{key:"7bc3f59737fa075134e2bc476fa26d79ddc4e26b",label:"Shipping Carrier Name",name:"shipping_carrier",defaultValue:null===(e=this.disputeResponse)||void 0===e?void 0:e.shipping_carrier,inputHandler:this.inputHandler,errorText:this.errors.shipping_carrier})),a("div",{key:"ef41052d0eec68b02d04638ce7cfdbc1477c16eb",class:"col-12"},a("form-control-text",{key:"b88d31bed47cdf09e04a29122c1adf955bdc4d25",label:"Tracking Number",name:"shipping_tracking_number",defaultValue:null===(t=this.disputeResponse)||void 0===t?void 0:t.shipping_tracking_number,inputHandler:this.inputHandler,errorText:this.errors.shipping_tracking_number})),a("div",{key:"743dea4d8f59e62103403fa58936ca86d7bbf216",class:"col-12"},a("form-control-date",{key:"4be255a38f91f9bf758428d780649d2775d22153",label:"Date Shipped",name:"shipping_date",defaultValue:null===(i=this.disputeResponse)||void 0===i?void 0:i.shipping_date,inputHandler:this.inputHandler,errorText:this.errors.shipping_date})),a("div",{key:"7b274a743a9ca8f3cb7b86facbe12b723b8695e4",class:"col-12"},a("form-control-textarea",{key:"833a03ac489cfa6fe6991e14a079b104b7b86ddc",label:"Shipping Address",name:"shipping_address",defaultValue:null===(c=this.disputeResponse)||void 0===c?void 0:c.shipping_address,inputHandler:this.inputHandler,errorText:this.errors.shipping_address})),a("div",{key:"a1363e8014fe90442e1d0f6820bf2b9cf9966c90",class:"col-12"},a("form-control-file-v2",{key:"beb99c4b9e898265f8a904984172fb1a6a52cb49",label:"Shipping Documentation",name:"shipping_documentation",onChange:e=>r(e,this.documents),errorText:null===(s=this.documentErrors)||void 0===s?void 0:s.shipping_documentation}))))}};export{f as additional_statement,h as cancellation_policy,v as customer_details,m as duplicate_charge,_ as electronic_evidence,g as product_or_service,j as refund_policy,T as shipping_details}
1
+ import{r as e,h as a}from"./p-CV0Pyo1O.js";import{c as t,a as i,F as c}from"./p-D9sqTVmd.js";import{a9 as d}from"./p-Bu7gdOaV.js";import"./p-BFTU3MAI.js";const s=t({additional_statement:i().nullable()});var o,l;!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"}(o||(o={})),function(e){e.activity_log="activity_log",e.cancellationPolicy="cancellation_policy",e.customerCommunication="customer_communication",e.customerSignature="customer_signature",e.duplicateChargeDocumentation="duplicate_charge_documentation",e.receipt="receipt",e.refundPolicy="refund_policy",e.serviceDocumentation="service_documentation",e.shippingDocumentation="shipping_documentation",e.uncategorizedFile="uncategorized_file"}(l||(l={}));class n{set presignedUrl(e){this._presignedUrl=e}get presignedUrl(){return this._presignedUrl}async getFileString(){const e=new Promise(((e,a)=>{const t=new FileReader;t.onload=a=>{e(a.target.result)},t.onerror=()=>{a(new Error("Error reading file"))},t.readAsArrayBuffer(this._file)}));return await e}constructor(e,a){this._file=e,this.file_name=e.name,this.file_type=e.type,this.dispute_evidence_type=a}}const r=(e,a)=>{const t=e.target,i=t.name,c=t.files;a[i]=[];for(const e of c)a[i].push(new n(e,i))},f=class{constructor(a){e(this,a),this.documentErrors={},this.errors={},this.acceptedTerms=!1,this.documents={uncategorized_file:[]},this.inputHandler=(e,a)=>{this.form.setValues(Object.assign(Object.assign({},this.form.values.getValue()),{[e]:a}))}}async validateAndSubmit(e){const a=Object.values(this.documents).flat();this.form.validateAndSubmit((t=>e(t,a,o.additionalStatement)))}componentWillLoad(){this.form=new c(s)}componentDidLoad(){this.form.errors.subscribe((e=>{this.errors=Object.assign({},e)}))}render(){var e,t;return a("div",{key:"8dff14b5f29b28a18901b1eff60b3855d9094013"},a("div",{key:"405d549adeb5150fd7ec834b699f83588892390e",class:"row gy-3"},a("div",{key:"a13e743d61fe9329e74b3a09712921cec6e253c2",class:"col-12"},a("h2",{key:"fbe30e865b8dbece987480e3ac804c3eabbf0746",class:"h5",part:d},"Additional Evidence")),a("div",{key:"921aa04960a0c30d9733bc0db71dee4fcd78af55",class:"col-12"},a("form-control-textarea",{key:"cc4a0136fa728cce0390e4d9dd456a7ad9095244",label:"Is there anything else you would like to say about this dispute?",name:"additional_statement",defaultValue:null===(e=this.disputeResponse)||void 0===e?void 0:e.additional_statement,inputHandler:this.inputHandler,errorText:this.errors.additional_statement})),a("div",{key:"0b35f4914c18432ca326a01c002710690c15d685",class:"col-12"},a("form-control-file-v2",{key:"8c6a32df62ea4c217fad64fa1283033a85885076",label:"Additional files",name:"uncategorized_file",multiple:!0,helpText:"Upload any additional pieces of evidence that have not already been provided.",onChange:e=>r(e,this.documents),errorText:null===(t=this.documentErrors)||void 0===t?void 0:t.uncategorized_file}))))}},b=t({cancellation_policy_disclosure:i().nullable(),cancellation_rebuttal:i().nullable()}),h=class{constructor(a){e(this,a),this.documentErrors={},this.errors={},this.documents={cancellation_policy:[]},this.inputHandler=(e,a)=>{this.form.setValues(Object.assign(Object.assign({},this.form.values.getValue()),{[e]:a}))}}async validateAndSubmit(e){const a=Object.values(this.documents).flat();this.form.validateAndSubmit((t=>e(t,a,o.cancellationPolicy)))}componentWillLoad(){this.form=new c(b)}componentDidLoad(){this.form.errors.subscribe((e=>{this.errors=Object.assign({},e)}))}render(){var e,t,i;return a("div",{key:"bd649d7bc48208dec588f5677f2c87897bc43b8b"},a("div",{key:"63263cfe2db3bb2d6f53ddf3c01124a6f70e4994",class:"row gy-3"},a("div",{key:"457bc4393385a88d9d815bd590425c65ebf63d7b",class:"col-12"},a("h2",{key:"66eadc2605b0541fca47cb426c8cf5f373b003f8",class:"h5",part:d},"Cancellation Policy")),a("div",{key:"dcdf62ecc017a197714207372104a355a42561f2",class:"col-12"},a("form-control-textarea",{key:"06e2d122d0cb677e86fdf697d48d11db72c3a360",label:"Cancellation Policy Disclosure",name:"cancellation_policy_disclosure",defaultValue:null===(e=this.disputeResponse)||void 0===e?void 0:e.cancellation_policy_disclosure,inputHandler:this.inputHandler,errorText:this.errors.cancellation_policy_disclosure})),a("div",{key:"e4b7de1e1820f7c59c7465784868ce4823244285",class:"col-12"},a("form-control-textarea",{key:"f57c5bd832f5bdf946341efe3ec0c594ebc27108",label:"Cancellation Rebuttal",name:"cancellation_rebuttal",defaultValue:null===(t=this.disputeResponse)||void 0===t?void 0:t.cancellation_rebuttal,inputHandler:this.inputHandler,errorText:this.errors.cancellation_rebuttal})),a("div",{key:"61e019cea906e3cb93952cf75fb01a6b9fc9cc66",class:"col-12"},a("form-control-file-v2",{key:"62e0f7432ae9445aa9b19b467323f9ed7d9161f6",label:"Upload Cancellation Policy",name:"cancellation_policy",onChange:e=>r(e,this.documents),errorText:null===(i=this.documentErrors)||void 0===i?void 0:i.cancellation_policy}))))}},u=t({customer_name:i().nullable(),customer_email_address:i().nullable(),customer_billing_address:i().nullable()}),v=class{constructor(a){e(this,a),this.documentErrors={},this.errors={},this.documents={customer_signature:[],customer_communication:[]},this.inputHandler=(e,a)=>{this.form.setValues(Object.assign(Object.assign({},this.form.values.getValue()),{[e]:a}))}}async validateAndSubmit(e){const a=Object.values(this.documents).flat();this.form.validateAndSubmit((t=>e(t,a,o.customerDetails)))}componentWillLoad(){this.form=new c(u)}componentDidLoad(){this.form.errors.subscribe((e=>{this.errors=Object.assign({},e)}))}render(){var e,t,i,c,s;return a("div",{key:"66ed4497457aab5cd214c356b23067eb5ab977b9"},a("div",{key:"00b2241580f26aed52fb8c0dca06ffb8e07c2303",class:"row gy-3"},a("div",{key:"23fd971d66b3e753df7ec5e20b8155865307261f",class:"col-12"},a("h2",{key:"df3880ae4959e4fe6a5fa2e67287e4bb40b6fc75",class:"h5",part:d},"Customer Details")),a("div",{key:"1bd1010ba8c9bbdb4390e3d953a8cfc798a6745c",class:"col-12"},a("form-control-text",{key:"170576aa6fbda10dcb3c3928cd8894df1f201223",label:"Full Name",name:"customer_name",defaultValue:null===(e=this.disputeResponse)||void 0===e?void 0:e.customer_name,inputHandler:this.inputHandler,errorText:this.errors.customer_name})),a("div",{key:"39a99685a01018afa466fa214fd9f217b5682200",class:"col-12"},a("form-control-text",{key:"8c99018cf0fe0c900512874be0261fb32578c803",label:"Email",name:"customer_email_address",defaultValue:null===(t=this.disputeResponse)||void 0===t?void 0:t.customer_email_address,inputHandler:this.inputHandler,errorText:this.errors.customer_email_address})),a("div",{key:"6db37be2d5b9bef95c7e5e00a879847cbc89a9db",class:"col-12"},a("form-control-textarea",{key:"48de189acf3dad170e1727b950cee28278eeabc9",label:"Billing Address",name:"customer_billing_address",defaultValue:null===(i=this.disputeResponse)||void 0===i?void 0:i.customer_billing_address,inputHandler:this.inputHandler,errorText:this.errors.customer_billing_address})),a("div",{key:"9a85ca65d2a80c54617034af5350e7301dd475f5",class:"col-12"},a("form-control-file-v2",{key:"0f6f2859e79998071e079bbb69fdb1b12e5b8c5d",label:"Customer Signature",name:"customer_signature",onChange:e=>r(e,this.documents),errorText:null===(c=this.documentErrors)||void 0===c?void 0:c.customer_signature})),a("div",{key:"8067bc3d834825f309fc3ed994b683233e2e9e90",class:"col-12"},a("form-control-file-v2",{key:"97105708f4f6e668a6e62cb2f516969c79bedef7",label:"Customer Communication",name:"customer_communication",onChange:e=>r(e,this.documents),errorText:null===(s=this.documentErrors)||void 0===s?void 0:s.customer_communication}))))}},p=t({duplicate_charge_original_payment_id:i().nullable(),duplicate_charge_explanation:i().nullable()}),m=class{constructor(a){e(this,a),this.documentErrors={},this.errors={},this.documents={duplicate_charge_documentation:[]},this.inputHandler=(e,a)=>{this.form.setValues(Object.assign(Object.assign({},this.form.values.getValue()),{[e]:a}))}}async validateAndSubmit(e){const a=Object.values(this.documents).flat();this.form.validateAndSubmit((t=>e(t,a,o.duplicateCharge)))}componentWillLoad(){this.form=new c(p)}componentDidLoad(){this.form.errors.subscribe((e=>{this.errors=Object.assign({},e)}))}render(){var e,t,i;return a("div",{key:"40c441cca0667d42a17b2d030cd11499b5fd0971"},a("div",{key:"9187708d76c4a631c8741e1ec60684fdb3b7c65f",class:"row gy-3"},a("div",{key:"9a388c46052814718253a4333da1a3e010316e14",class:"col-12"},a("h2",{key:"677c93c72112ac96e41e43080fba1d2750bc71de",class:"h5",part:d},"Duplicate Charge")),a("div",{key:"475e5bd708aed12d866560dd12ddde92b8643f82",class:"col-12"},a("form-control-text",{key:"a47b1642e9ca1475d6165403d5589f874908b1c0",label:"Original Payment ID",name:"duplicate_charge_original_payment_id",defaultValue:null===(e=this.disputeResponse)||void 0===e?void 0:e.duplicate_charge_original_payment_id,inputHandler:this.inputHandler,errorText:this.errors.duplicate_charge_original_payment_id})),a("div",{key:"75890d7ba8e0e0f4117477f0c52f3af0a867f3b3",class:"col-12"},a("form-control-textarea",{key:"c86ae32a39e1ed3be449eb91efa8039ec78b18eb",label:"Duplicate Charge Explanation",name:"duplicate_charge_explanation",defaultValue:null===(t=this.disputeResponse)||void 0===t?void 0:t.duplicate_charge_explanation,inputHandler:this.inputHandler,errorText:this.errors.duplicate_charge_explanation})),a("div",{key:"81d2eb27f4350e57cc3e89170839816166339731",class:"col-12"},a("form-control-file-v2",{key:"a7456a1a8f3363d05361667d5d9a8e99c6581bf1",label:"Duplicate Charge Documentation",name:"duplicate_charge_documentation",onChange:e=>r(e,this.documents),errorText:null===(i=this.documentErrors)||void 0===i?void 0:i.duplicate_charge_documentation}))))}},y=t({customer_purchase_ip_address:i().nullable()}),_=class{constructor(a){e(this,a),this.documentErrors={},this.errors={},this.documents={activity_log:[]},this.inputHandler=(e,a)=>{this.form.setValues(Object.assign(Object.assign({},this.form.values.getValue()),{[e]:a}))}}async validateAndSubmit(e){const a=Object.values(this.documents).flat();this.form.validateAndSubmit((t=>e(t,a,o.electronicEvidence)))}componentWillLoad(){this.form=new c(y)}componentDidLoad(){this.form.errors.subscribe((e=>{this.errors=Object.assign({},e)}))}render(){var e,t;return a("div",{key:"592472282564a406e318b5639e1f8e3f1aeb55bd"},a("div",{key:"0e49a34f48905ede20c17d4e2a8e529a3aaad2b9",class:"row gy-3"},a("div",{key:"9f15e709a8a31b6c2cf3ca43d543090a8dd8ca5d",class:"col-12"},a("h2",{key:"3223ed0c95dd5d08b5d8a481dfdc57d65ee3ea2f",class:"h5",part:d},"Electronic Evidence")),a("div",{key:"f82434ae90705238088c1e01625c1d674337f823",class:"col-12"},a("form-control-text",{key:"81586970861191e628ba6d3d55d792081f868193",label:"Purchase IP Address",name:"customer_purchase_ip_address",helpText:"The IP address used by the customer during the purchase.",defaultValue:null===(e=this.disputeResponse)||void 0===e?void 0:e.customer_purchase_ip_address,inputHandler:this.inputHandler,errorText:this.errors.customer_purchase_ip_address})),a("div",{key:"1ec47d1e437926e010e19f0352c6c237cb61aeaa",class:"col-12"},a("form-control-file-v2",{key:"8ee1599fc2142dd269ccddd08ef60cb1a337122a",label:"Activity Logs",name:"activity_log",helpText:"Any server or activity logs that provide evidence of the customer's access to or download of the purchased digital product. This information should encompass IP addresses, relevant timestamps, and any detailed records of activity.",onChange:e=>r(e,this.documents),errorText:null===(t=this.documentErrors)||void 0===t?void 0:t.activity_log}))))}},k=t({product_description:i().nullable(),service_date:i().nullable()}),g=class{constructor(a){e(this,a),this.documentErrors={},this.errors={},this.documents={service_documentation:[]},this.inputHandler=(e,a)=>{this.form.setValues(Object.assign(Object.assign({},this.form.values.getValue()),{[e]:a}))}}async validateAndSubmit(e){const a=Object.values(this.documents).flat();this.form.validateAndSubmit((t=>e(t,a,o.productOrService)))}componentWillLoad(){this.form=new c(k)}componentDidLoad(){this.form.errors.subscribe((e=>{this.errors=Object.assign({},e)}))}render(){var e,t,i;return a("div",{key:"466646e97a89d70914e592693918d5ea524504a8"},a("div",{key:"78f02a847c7474733400f2d4e8a6712c9689402e",class:"row gy-3"},a("div",{key:"0367c4de7453b26becfc2edfe7f5899e6b30f554",class:"col-12"},a("h2",{key:"10490c7e30a1ec7c23cd47f80a905e21bb874b38",class:"h5",part:d},"Product & Service Details")),a("div",{key:"a18c64c22a5efe19c5b6603d0497a17a54ac6fa8",class:"col-12"},a("form-control-text",{key:"7d35738871259b0b0bf83cbb6014062d09299a21",label:"Product Description",name:"product_description",defaultValue:null===(e=this.disputeResponse)||void 0===e?void 0:e.product_description,inputHandler:this.inputHandler,errorText:this.errors.product_description})),a("div",{key:"24a337727ad90599b1368c2c3fff6cea4c40d172",class:"col-12"},a("form-control-date",{key:"5222da0eed927c2bc61baba87d8c004bfbf674e0",label:"Service Date",name:"service_date",defaultValue:null===(t=this.disputeResponse)||void 0===t?void 0:t.service_date,inputHandler:this.inputHandler,errorText:this.errors.service_date})),a("div",{key:"1f422eea9d59d4d01d333e25e2003ecb3954656d",class:"col-12"},a("form-control-file-v2",{key:"8df9a14fc7311e1c47ca06c9a3a32ac09a291d4b",label:"Service Documentation",name:"service_documentation",onChange:e=>r(e,this.documents),errorText:null===(i=this.documentErrors)||void 0===i?void 0:i.service_documentation}))))}},x=t({refund_policy_disclosure:i().nullable(),refund_refusal_explanation:i().nullable()}),j=class{constructor(a){e(this,a),this.documentErrors={},this.errors={},this.documents={refund_policy:[],receipt:[]},this.inputHandler=(e,a)=>{this.form.setValues(Object.assign(Object.assign({},this.form.values.getValue()),{[e]:a}))}}async validateAndSubmit(e){const a=Object.values(this.documents).flat();this.form.validateAndSubmit((t=>e(t,a,o.refundPolicy)))}componentWillLoad(){this.form=new c(x)}componentDidLoad(){this.form.errors.subscribe((e=>{this.errors=Object.assign({},e)}))}render(){var e,t,i,c;return a("div",{key:"ec311e40104fb629ea148d4bd4e3b75b7384c271"},a("div",{key:"b520aca75b00bf6f698c551cd51efcd8ae8cddca",class:"row gy-3"},a("div",{key:"98c7a3ae28e9b9d8de6e9f860b26224ff83e5752",class:"col-12"},a("h2",{key:"334c7e259e7e8ba1202252e6135e1ff960ea34d4",class:"h5",part:d},"Refund Policy and Receipt")),a("div",{key:"bb6783c720ca99ae968580610a3af79a86bf6dc3",class:"col-12"},a("form-control-textarea",{key:"63fbdface8c0339b9989ddb2f9f0af427845118c",label:"Refund Policy Disclosure",name:"refund_policy_disclosure",defaultValue:null===(e=this.disputeResponse)||void 0===e?void 0:e.refund_policy_disclosure,inputHandler:this.inputHandler})),a("div",{key:"0a138ff7a02788003437e0d7f07dbe59e4cb05a7",class:"col-12"},a("form-control-textarea",{key:"9f2518ad7955096c93c74fd856514b68ef7d192a",label:"Refund Refusal Explanation",name:"refund_refusal_explanation",defaultValue:null===(t=this.disputeResponse)||void 0===t?void 0:t.refund_refusal_explanation,inputHandler:this.inputHandler})),a("div",{key:"18922e3843fa6b445b3aaa384b341aae5b2b2443",class:"col-12"},a("form-control-file-v2",{key:"0f34e5dd3901eb74bfd20d93eb9fe6087d808b5c",label:"Upload Refund Policy",name:"refund_policy",onChange:e=>r(e,this.documents),errorText:null===(i=this.documentErrors)||void 0===i?void 0:i.refund_policy})),a("div",{key:"42a5952ae76b7468bde8d2c3edd8bcb0bfde5cd6",class:"col-12"},a("form-control-file-v2",{key:"ad4297e944e1ac01f0f290595d70d12a9a05a93a",label:"Upload Receipt",name:"receipt",onChange:e=>r(e,this.documents),errorText:null===(c=this.documentErrors)||void 0===c?void 0:c.receipt}))))}},O=t({shipping_carrier:i().nullable(),shipping_tracking_number:i().nullable(),shipping_date:i().nullable(),shipping_address:i().nullable()}),T=class{constructor(a){e(this,a),this.documentErrors={},this.errors={},this.documents={shipping_documentation:[]},this.documentList=[],this.inputHandler=(e,a)=>{this.form.setValues(Object.assign(Object.assign({},this.form.values.getValue()),{[e]:a}))}}async validateAndSubmit(e){const a=Object.values(this.documents).flat();this.form.validateAndSubmit((t=>e(t,a,o.shippingDetails)))}componentWillLoad(){this.form=new c(O)}componentDidLoad(){this.form.errors.subscribe((e=>{this.errors=Object.assign({},e)}))}render(){var e,t,i,c,s;return a("div",{key:"6673b30e9af36cb2e560d0653776a42ab1777c22"},a("div",{key:"f687e69208f470a40699f870c4d09b04a0487faa",class:"row gy-3"},a("div",{key:"ffb1b65e29b6b912cefe862a2139e57f3d81087b",class:"col-12"},a("h2",{key:"2cea703b6f228aa127bbdb6f8c97f3f79e05d351",class:"h5",part:d},"Shipping Details")),a("div",{key:"fe2ae3034571b5ed2a8e5678ae5c32d84f750835",class:"col-12"},a("form-control-text",{key:"3b5c43c4b8baa62a756cc2dd7edb54fc0c118ede",label:"Shipping Carrier Name",name:"shipping_carrier",defaultValue:null===(e=this.disputeResponse)||void 0===e?void 0:e.shipping_carrier,inputHandler:this.inputHandler,errorText:this.errors.shipping_carrier})),a("div",{key:"807d7e0860265cb629083bb026e812e4d2ac06ff",class:"col-12"},a("form-control-text",{key:"5367ef8b37625d6e3ca42eb68eda5e142ff5d783",label:"Tracking Number",name:"shipping_tracking_number",defaultValue:null===(t=this.disputeResponse)||void 0===t?void 0:t.shipping_tracking_number,inputHandler:this.inputHandler,errorText:this.errors.shipping_tracking_number})),a("div",{key:"25e85572762af0d9964849d276dd18c5b8905d6e",class:"col-12"},a("form-control-date",{key:"821d218825643775282742b0c63f8c803a6c47e5",label:"Date Shipped",name:"shipping_date",defaultValue:null===(i=this.disputeResponse)||void 0===i?void 0:i.shipping_date,inputHandler:this.inputHandler,errorText:this.errors.shipping_date})),a("div",{key:"376e527d339217b897f02f0de111ea9377539769",class:"col-12"},a("form-control-textarea",{key:"f0130e6c0a7ca54e20f6406fbe6276fa8cffbf61",label:"Shipping Address",name:"shipping_address",defaultValue:null===(c=this.disputeResponse)||void 0===c?void 0:c.shipping_address,inputHandler:this.inputHandler,errorText:this.errors.shipping_address})),a("div",{key:"74699370d18065f453e68449749d5481772c4c08",class:"col-12"},a("form-control-file-v2",{key:"5d3f0d1a199b563c9ed433cb971f541a4cb54083",label:"Shipping Documentation",name:"shipping_documentation",onChange:e=>r(e,this.documents),errorText:null===(s=this.documentErrors)||void 0===s?void 0:s.shipping_documentation}))))}};export{f as additional_statement,h as cancellation_policy,v as customer_details,m as duplicate_charge,_ as electronic_evidence,g as product_or_service,j as refund_policy,T as shipping_details}
@@ -0,0 +1 @@
1
+ import{r as t,h as r}from"./p-CV0Pyo1O.js";import{J as s}from"./p-CEHwp4sh.js";import{d as o}from"./p-DF7oFWnO.js";import{w as a}from"./p-B4vLfYnZ.js";import{S as p}from"./p-05AWudQe.js";import"./p-CZfYo5-1.js";import{c as i}from"./p-FsWkrvEF.js";import"./p-DhrQechy.js";import"./p-DCpGH4xL.js";import"./p-Ds_P-dB8.js";import"./p-HXpYMWUU.js";import"./p-Dqxyi-uK.js";import"./p-CLHwhyvu.js";import"./p-CTtGaVYs.js";import"./p-DgTOxu8x.js";import"./p-DEx8fQeW.js";const e=class{constructor(r){t(this,r)}async componentWillLoad(){await a(),o(),this.analytics=new s(this)}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}async validate(){return this.cardFormElement.validate()}async tokenize({clientId:t,paymentMethodMetadata:r,account:s}){return this.cardFormElement.tokenize({clientId:t,paymentMethodMetadata:r,account:s})}render(){var t;return r(p,{key:"49cf4f202b0f327bd8ca4b4b3c892ae6df4a81f6"},r("card-form",{key:"480abf1238ed4b5bb1edd5362a432639fc9a7fb9",ref:t=>this.cardFormElement=t,maskCardNumber:null!==(t=this.maskCardNumber)&&void 0!==t?t:i.maskCardNumber}))}};export{e as justifi_card_form}
@@ -0,0 +1 @@
1
+ import{r as t,c as e,h as i,H as s,g as a}from"./p-CV0Pyo1O.js";import{A as n}from"./p-DCpGH4xL.js";import{A as o,r,s as h,t as l,u as c,v as d,w as u,C as p,b as y,c as m,I as v,x as f,y as g,z as b}from"./p-Dqxyi-uK.js";import{S as M}from"./p-05AWudQe.js";import"./p-CZfYo5-1.js";import{S as w}from"./p-eBK-iWrz.js";import{c as k,o as P,a as j,g as C,b as A}from"./p-FsWkrvEF.js";import{t as T,r as E}from"./p-Bu7gdOaV.js";import{f as N}from"./p-Ds_P-dB8.js";import{w as I,c as D}from"./p-B4vLfYnZ.js";import{H as S}from"./p-CZk3i5Tu.js";import{H as O,b as L,h as x,i as z}from"./p-x2oNTAWh.js";import{H as _}from"./p-BAB1lPu0.js";import{J as R}from"./p-CEHwp4sh.js";import{d as U}from"./p-DF7oFWnO.js";import"./p-HXpYMWUU.js";import"./p-CLHwhyvu.js";import"./p-CTtGaVYs.js";import{m as B,a as F}from"./p-D7nyPi2Q.js";import{C as Y}from"./p-BKrZL95i.js";import{P as Q}from"./p-CKL24GQA.js";import{P as V,a as H,b as W}from"./p-DEx8fQeW.js";import{C as G}from"./p-ZpPDShvP.js";import"./p-DhrQechy.js";import"./p-DgTOxu8x.js";import"./p-BhpaUYtS.js";const Z=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=n()}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 h(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,a)=>{try{if("undefined"==typeof window||!("ApplePaySession"in window))return console.error("[ApplePayService] ApplePaySession not available on window"),a({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,a,e,i),this.currentSession.begin()}catch(t){console.error("[ApplePayService] Exception while starting session:",t),a({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 a=>{try{const n=a.payment,o=Object.assign(Object.assign({},n.token),{product_details:{name:this.currentPaymentRequest.total.label,price:r.parseAmount(this.currentPaymentRequest.total.amount),description:this.currentPaymentRequest.total.label}}),h=await this.processPayment(i,s,o);h.success?(this.currentSession.completePayment({status:l.STATUS_SUCCESS}),t({success:!0,token:n.token,paymentMethodId:h.data.id})):(console.error("PSP reported payment failure:",h.data),this.currentSession.completePayment({status:l.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:l.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:l.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(w,{height:"44px",width:"100%",styles:{borderRadius:"8px"}})))):null},$=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 ")),X=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.countryCodeForCurrency(k.paymentCurrency),currencyCode:k.paymentCurrency,merchantCapabilities:[u.SUPPORTS_3DS,u.SUPPORTS_CREDIT,u.SUPPORTS_DEBIT],supportedNetworks:r.getDefaultSupportedNetworks(),total:r.createLineItem(k.paymentDescription,k.paymentAmount)},s=await this.applePayService.startPaymentSession(i,k.authToken,k.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)||X.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:X.ErrorCode.PAYMENT_FAILED}),this.applePayCompleted.emit({success:!1,error:e})}}finally{this.isProcessing=!1}}}componentWillLoad(){this.isAvailable=r.isApplePaySupported(),this.isAvailable?k.checkoutLoaded?this.loadApplePaySDK():P("checkoutLoaded",(t=>{t&&this.loadApplePaySDK()})):this.isLoading=!1}countryCodeForCurrency(t){return"cad"==t.toLowerCase()?"CA":"US"}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(k.paymentAmount)&&Boolean(k.paymentCurrency)&&Boolean(k.authToken)))return this.error="Missing required Apple Pay configuration",this.isConfigValid=!1,this.applePayError.emit({error:this.error,code:X.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:X.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:X.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:X.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(!k.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($,{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 "))}};X.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:"1e09a302d064e2e4a860dc4efd9eb9693d4d0055"},i("internal-button",{key:"9ce7819853789c44860de43f26632c62415ebdb5",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:"13d0570e2bdb79d842f9c0a17c7403963ea167c8"},i("section",{key:"c15f36caa2a9ebb66c7f0a16393926b643f1bc3b"},i("div",{key:"1e4e5d32cebb57ceaeb3786a29a9e08c8e83ac80"},i("div",{key:"42ff5c6ef33654a88858e8ed48e230dd674d1953",part:T},null==k?void 0:k.paymentDescription),i("div",{key:"c21d5eb012664efdd71e82bf24a88d0fefedad8c"},i("span",{key:"a8876afe5d7e993077ed8c4fb140c745d98e9196",part:T},"Total")," ",i("span",{key:"b81156e9f9240656b51f6ed374db9878bb3137c9",part:T},N(+(null==k?void 0:k.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(w,{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 at=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 I(),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"===k.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:k.accountId,merchantName:this.merchantDisplayName,authToken:k.authToken,accountId:k.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(k.paymentAmount/100),totalPriceStatus:"FINAL",currencyCode:k.paymentCurrency||"USD"};this.iframeElement.contentWindow.postMessage({eventType:st.startPayment,data:e},this.iframeOrigin)}render(){return k.checkoutLoaded?k.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}},nt=class{constructor(e){t(this,e),this.levels={h1:S,h2:O,h3:_},this.level="h1"}render(){return i(M,{key:"1843adabddf7d439036f8ce6f55627b7ca3e4a9f"},i(this.levels[this.level],{key:"b16e5624ce7e092cc8c144a7cdfd9cb6afdf7a83",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.maskCardNumber=!1,this.handlePaypalStarted=()=>{k.isWalletProcessing=!0},this.handlePaypalCompleted=t=>{const{success:e,paymentMethodId:i,fundingSource:s}=t.detail||{};k.isWalletProcessing=!1,e&&i?(k.paymentToken=i,k.selectedPaymentMethod={type:"venmo"===s?V.VENMO:V.PAYPAL},this.submitCheckout()):this.errorEvent.emit({message:"Paypal payment failed",errorCode:y.TOKENIZE_ERROR,severity:p.ERROR})},this.handlePaypalCancelled=()=>{k.isWalletProcessing=!1,k.paymentToken=void 0,k.selectedPaymentMethod=void 0},this.handlePaypalError=t=>{k.isWalletProcessing=!1;const{error:e,code:i}=t.detail||{};this.errorEvent.emit({message:e||"Paypal error occurred",errorCode:`PAYPAL_${i}`,severity:p.ERROR})},this.handleApplePayStarted=()=>{k.isWalletProcessing=!0},this.handleGooglePayStarted=()=>{k.isWalletProcessing=!0},this.handleGooglePayCompleted=t=>{const{success:e,paymentMethodId:i,error:s}=t.detail||{};e&&i?(k.isWalletProcessing=!1,k.paymentToken=i,k.selectedPaymentMethod={type:V.GOOGLE_PAY},this.submitCheckout()):(k.isWalletProcessing=!1,this.errorEvent.emit({message:s&&s.message||"Google Pay payment failed",errorCode:y.TOKENIZE_ERROR,severity:p.ERROR}))},this.handleGooglePayCancelled=()=>{k.isWalletProcessing=!1,k.paymentToken=void 0,k.selectedPaymentMethod=void 0},this.handleApplePayCompleted=t=>{const{success:e,token:i,paymentMethodId:s,error:a}=t.detail;e&&i?(k.isWalletProcessing=!1,k.paymentToken=s,k.selectedPaymentMethod={type:V.APPLE_PAY},this.submitCheckout()):(k.isWalletProcessing=!1,console.error("Apple Pay completed but failed:",a),this.errorEvent.emit({message:(null==a?void 0:a.message)||"Apple Pay payment failed",errorCode:y.TOKENIZE_ERROR,severity:p.ERROR}))},this.handleApplePayError=t=>{k.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=()=>{k.isWalletProcessing=!1,k.paymentToken=void 0,k.selectedPaymentMethod=void 0}}maskCardNumberChanged(){k.maskCardNumber=!!this.maskCardNumber}connectedCallback(){var t;this.observer=new MutationObserver((()=>{this.queryFormRefs(),this.setupApplePayListeners(),this.setupGooglePayListeners(),this.setupPaypalListeners()})),this.observer.observe(this.hostEl,{childList:!0,subtree:!0}),k.checkoutId=this.checkoutId,k.maskCardNumber=!!this.maskCardNumber;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=j((()=>{this.emitCheckoutChanged()}))}componentWillLoad(){this.analytics=new R(this),U(),k.authToken=this.authToken,this.fetchCheckout(),L("set",(t=>{const e=z[t];void 0!==e&&x(t,e)&&this.fetchCheckout()}))}componentDidLoad(){this.queryFormRefs(),this.setupApplePayListeners(),this.setupGooglePayListeners(),this.setupPaypalListeners()}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(),this.removePaypalListeners()}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:({error:t,code:e,severity:i})=>{this.errorEvent.emit({message:t,errorCode:e,severity:i})}}):this.errorEvent.emit({message:m.NOT_AUTHENTICATED,errorCode:y.NOT_AUTHENTICATED,severity:p.ERROR})}updateStore(t){var e,i,s,a,n,o,r,h,l,c,d,u,p,y,m;k.accountId=t.account_id;const v=null!=t.mode?String(t.mode).toLowerCase():"";k.checkoutMode="test"===v?"test":"live"===v?"live":null;const f=t.payment_methods.map((t=>new H(t))),g=Boolean(null===(e=t.payment_settings)||void 0===e?void 0:e.ach_payments);k.paymentMethods=f.filter((t=>t.type!==V.SAVED_BANK_ACCOUNT||g)),k.paymentMethodGroupId=t.payment_method_group_id,k.paymentDescription=t.payment_description,k.totalAmount=t.total_amount,k.paymentAmount=t.payment_amount,k.bnplEnabled=t.payment_settings.bnpl_payments,k.insuranceEnabled=null!==(i=t.payment_settings.insurance_payments)&&void 0!==i&&i,k.bankAccountVerification=null===(s=t.payment_settings)||void 0===s?void 0:s.bank_account_verification,k.applePayEnabled=null!==(n=null===(a=t.payment_settings)||void 0===a?void 0:a.apple_payments)&&void 0!==n&&n,k.googlePayEnabled=null!==(r=null===(o=t.payment_settings)||void 0===o?void 0:o.google_payments)&&void 0!==r&&r,k.paypalEnabled=null!==(l=null===(h=t.payment_settings)||void 0===h?void 0:h.paypal_payments)&&void 0!==l&&l,k.paypalProviderClientId=null!==(d=null===(c=t.paypal)||void 0===c?void 0:c.provider_client_id)&&void 0!==d?d:"",k.achPaymentsEnabled=g,k.bnplProviderClientId=null===(u=null==t?void 0:t.bnpl)||void 0===u?void 0:u.provider_client_id,k.bnplProviderMode=null===(p=null==t?void 0:t.bnpl)||void 0===p?void 0:p.provider_mode,k.bnplProviderApiVersion=null===(y=null==t?void 0:t.bnpl)||void 0===y?void 0:y.provider_api_version,k.bnplProviderCheckoutUrl=null===(m=null==t?void 0:t.bnpl)||void 0===m?void 0:m.provider_checkout_url,k.paymentCurrency=(t.payment_currency||k.paymentCurrency).toUpperCase(),k.checkoutLoaded=!0}emitCheckoutChanged(){const t={availablePaymentMethodTypes:C(),selectedPaymentMethod:k.selectedPaymentMethod,savedPaymentMethods:k.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.paypalRef=this.hostEl.querySelector("justifi-paypal"),this.paymentMethodFormRef=this.hostEl.querySelector("justifi-card-form, justifi-bank-account-form, justifi-tokenize-payment-method"),!k.selectedPaymentMethod&&this.paymentMethodFormRef){const t=this.paymentMethodFormRef.tagName.toLowerCase();"justifi-card-form"===t?k.selectedPaymentMethod={type:V.NEW_CARD}:"justifi-bank-account-form"!==t||k.checkoutLoaded&&!k.achPaymentsEnabled||(k.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))}setupPaypalListeners(){this.paypalRef&&(this.paypalRef.addEventListener("paypalStarted",this.handlePaypalStarted),this.paypalRef.addEventListener("paypalCompleted",this.handlePaypalCompleted),this.paypalRef.addEventListener("paypalCancelled",this.handlePaypalCancelled),this.paypalRef.addEventListener("paypalError",this.handlePaypalError))}removePaypalListeners(){this.paypalRef&&(this.paypalRef.removeEventListener("paypalStarted",this.handlePaypalStarted),this.paypalRef.removeEventListener("paypalCompleted",this.handlePaypalCompleted),this.paypalRef.removeEventListener("paypalCancelled",this.handlePaypalCancelled),this.paypalRef.removeEventListener("paypalError",this.handlePaypalError))}async tokenizePaymentMethod(t){var e,i,s;const a=null!==(i=await(null===(e=this.billingFormRef)||void 0===e?void 0:e.getValues()))&&void 0!==i?i:{},n=Object.assign(Object.assign({},t),a),o=Object.assign({accountId:k.accountId,payment_method_group_id:void 0},n);k.savePaymentMethod&&(o.payment_method_group_id=k.paymentMethodGroupId);const r=await(null===(s=this.paymentMethodFormRef)||void 0===s?void 0:s.tokenize({clientId:this.authToken,paymentMethodMetadata:o,account:k.accountId}));return r.error?r:(k.paymentToken=r.id,r.id)}async fillBillingForm(t){k.billingFormFields=t}async setSelectedPaymentMethod(t){k.selectedPaymentMethod=t,k.paymentToken=t.id||void 0}async validate(){var t,e;const i=[];k.insuranceEnabled&&this.insuranceFormRef&&i.push(this.insuranceFormRef.validate());const s=(null===(t=k.selectedPaymentMethod)||void 0===t?void 0:t.type)===V.NEW_CARD,a=(null===(e=k.selectedPaymentMethod)||void 0===e?void 0:e.type)===V.NEW_BANK_ACCOUNT;if((s||a)&&(this.paymentMethodFormRef&&i.push(this.paymentMethodFormRef.validate()),this.billingFormRef&&this.billingFormRef!==this.paymentMethodFormRef&&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,a,n,o,r,h;if(k.isSubmitting)return;k.isSubmitting=!0;const l=await this.validate();if(!k.selectedPaymentMethod)return k.isSubmitting=!1,void this.errorEvent.emit({message:"No payment method selected.",errorCode:y.VALIDATION_ERROR,severity:p.ERROR});if(!l)return k.isSubmitting=!1,void this.errorEvent.emit({message:"Please fill in all required fields.",errorCode:y.VALIDATION_ERROR,severity:p.ERROR});const c=(null===(e=k.selectedPaymentMethod)||void 0===e?void 0:e.type)===V.NEW_CARD,d=(null===(i=k.selectedPaymentMethod)||void 0===i?void 0:i.type)===V.NEW_BANK_ACCOUNT,u=(null===(s=k.selectedPaymentMethod)||void 0===s?void 0:s.type)===V.PLAID;if(c||d){const e=await this.tokenizePaymentMethod(t);if(null==e?void 0:e.error)return k.isSubmitting=!1,void this.errorEvent.emit({message:e.error.message,errorCode:y.TOKENIZE_ERROR,severity:p.ERROR})}if(u&&!k.paymentToken){const t=k.plaidPublicToken,e=k.plaidLinkTokenId;if(!t)return k.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(k.authToken,k.accountId,t,e||void 0,k.savePaymentMethod?k.paymentMethodGroupId:void 0);if(null==i?void 0:i.error)return k.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,n=(null===(a=null==s?void 0:s.bank_account)||void 0===a?void 0:a.token)||(null==s?void 0:s.token)||(null==s?void 0:s.id);k.paymentToken=n}catch(t){return k.isSubmitting=!1,void this.errorEvent.emit({message:(null==t?void 0:t.message)||"Plaid exchange error",errorCode:y.TOKENIZE_ERROR,severity:p.ERROR})}}const m=(null===(n=k.selectedPaymentMethod)||void 0===n?void 0:n.type)===V.SEZZLE;if(m){const t=this.hostEl.querySelector("justifi-sezzle-payment-method"),e=await(null==t?void 0:t.resolvePaymentMethod({isValid:l}));if("success"!==(null===(o=null==e?void 0:e.bnpl)||void 0===o?void 0:o.status))return k.isSubmitting=!1,void this.errorEvent.emit({message:(null===(r=null==e?void 0:e.error)||void 0===r?void 0:r.message)||"Sezzle checkout was not completed.",errorCode:y.TOKENIZE_ERROR,severity:p.ERROR})}if(!m&&!k.paymentToken)return k.isSubmitting=!1,void this.errorEvent.emit({message:"Payment token not found.",errorCode:y.TOKENIZE_ERROR,severity:p.ERROR});const v={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;case V.PAYPAL:return W.PAYPAL;case V.VENMO:return W.VENMO;default:return}})(null===(h=k.selectedPaymentMethod)||void 0===h?void 0:h.type),payment_token:m?void 0:k.paymentToken};if(this.preCompleteHook){const t=A();try{await new Promise(((e,i)=>{this.preCompleteHook(t,(()=>e()),(()=>i()))}))}catch(t){return k.isSubmitting=!1,void console.log("Checkout cancelled by preCompleteHook",t)}}this.completeCheckout({payment:v,onSuccess:({checkout:t})=>{k.isSubmitting=!1,this.submitEvent.emit({checkout:t,message:"Checkout completed successfully"})},onError:({error:t})=>{k.isSubmitting=!1,this.errorEvent.emit({message:t,errorCode:y.COMPLETE_CHECKOUT_ERROR,severity:p.ERROR})}})}render(){return i(s,{key:"d1e1326e66bc9347de573bc8b3aa30e19178ade9"})}get hostEl(){return a(this)}static get watchers(){return{maskCardNumber:["maskCardNumberChanged"]}}},rt=n();class ht{async createPaypalOrder(t,e,i,s){return rt.post({endpoint:`checkouts/${e}/paypal/orders`,body:{funding_source:i},authToken:t,signal:s})}}const lt="paypal-script",ct=["paypal-payments","venmo-payments"],dt="PAYMENT_FAILED",ut="shown",pt=(t,e)=>{t&&(e?t.classList.add(ut):t.classList.remove(ut))},yt=class{constructor(i){t(this,i),this.paypalStarted=e(this,"paypalStarted",7),this.paypalCompleted=e(this,"paypalCompleted",7),this.paypalCancelled=e(this,"paypalCancelled",7),this.paypalError=e(this,"paypalError",7),this.paypalService=new ht,this.paypalEligible=!1,this.venmoEligible=!1,this.startSession=async(t,e)=>{if(!t)return;this.pendingOrderId=void 0,this.paypalStarted.emit({fundingSource:e});let i=!1;const s=this.createOrder(e).then((t=>({orderId:t.provider_order_id}))).catch((t=>{throw i=!0,this.emitError((null==t?void 0:t.message)||"Could not create the Paypal order","ORDER_ERROR"),t}));s.catch((()=>{}));try{await t.start({presentationMode:"auto"},s)}catch(t){if(i)return;this.emitError((null==t?void 0:t.message)||"Paypal payment failed",dt)}}}componentDidLoad(){k.checkoutLoaded?this.initializePaypal():P("checkoutLoaded",(t=>{t&&this.initializePaypal()}))}componentDidRender(){this.applyVisibility()}get currencyCode(){return(k.paymentCurrency||"USD").toUpperCase()}get showPaypal(){return!!k.paypalEnabled&&this.paypalEligible}get showVenmo(){return!!k.paypalEnabled&&this.venmoEligible&&"USD"===this.currencyCode}applyVisibility(){const{showPaypal:t,showVenmo:e}=this;pt(this.buttonsEl,t||e),pt(this.paypalButtonEl,t),pt(this.venmoButtonEl,e)}emitError(t,e){this.paypalError.emit({error:t,code:e})}loadPaypalScript(){const t=window.paypal;return t?Promise.resolve(t):new Promise(((t,e)=>{let i=document.head.querySelector(`script[data-test-id="${lt}"]`);i||(i=document.createElement("script"),i.src="test"===k.checkoutMode?"https://www.sandbox.paypal.com/web-sdk/v6/core":"https://www.paypal.com/web-sdk/v6/core",i.async=!0,i.setAttribute("data-test-id",lt),document.head.appendChild(i)),i.addEventListener("load",(()=>{const i=window.paypal;i?t(i):e(new Error("Paypal script loaded but window.paypal is undefined"))})),i.addEventListener("error",(()=>e(new Error("Error loading Paypal script"))))}))}metadataId(){return Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15)}async initializePaypal(){const t=k.paypalProviderClientId;if(!t)return this.paypalEligible=!1,this.venmoEligible=!1,this.applyVisibility(),void this.emitError("Missing Paypal client id","CONFIG_ERROR");try{const e=await this.loadPaypalScript();this.sdkInstance=await e.createInstance({clientId:t,components:ct,pageType:"checkout",metadataId:this.metadataId()});const i=await this.sdkInstance.findEligibleMethods({currencyCode:this.currencyCode});this.paypalEligible=i.isEligible("paypal"),this.venmoEligible=i.isEligible("venmo"),this.paypalEligible&&(this.paypalSession=this.sdkInstance.createPayPalOneTimePaymentSession(this.sessionOptions("paypal"))),this.venmoEligible&&(this.venmoSession=this.sdkInstance.createVenmoOneTimePaymentSession(this.sessionOptions("venmo"))),this.applyVisibility()}catch(t){this.paypalEligible=!1,this.venmoEligible=!1,this.applyVisibility(),this.emitError((null==t?void 0:t.message)||"Error initializing Paypal","INITIALIZATION_ERROR")}}sessionOptions(t){return{onApprove:()=>this.paypalCompleted.emit({success:!0,paymentMethodId:this.pendingOrderId,fundingSource:t}),onCancel:()=>this.paypalCancelled.emit({fundingSource:t}),onError:t=>this.emitError((null==t?void 0:t.message)||"Paypal payment failed",dt)}}async createOrder(t){const e=await this.paypalService.createPaypalOrder(k.authToken,k.checkoutId,t);if(null==e?void 0:e.error)throw new Error(("string"==typeof e.error?e.error:e.error.message)||"Could not create the Paypal order");const i=null==e?void 0:e.data;if(!(null==i?void 0:i.provider_order_id))throw new Error("Paypal order is missing a provider order id");return this.pendingOrderId=i.id,i}render(){return i(M,{key:"39a2b473cfa47da5e079adbaffa93663289cb8ec"},i("div",{key:"9d3e3ff9236d2462157b310d691c43f54b6651dd",class:"paypal-buttons",ref:t=>this.buttonsEl=t},i("paypal-button",{key:"a0049d2bcf4aa295f65563f49c3287b2da2e63b8",type:"pay",ref:t=>this.paypalButtonEl=t,onClick:()=>this.startSession(this.paypalSession,"paypal")}),i("venmo-button",{key:"fd71ba73af2223271160601ec76039d3e0d6cb02",type:"pay",ref:t=>this.venmoButtonEl=t,onClick:()=>this.startSession(this.venmoSession,"venmo")})),i("style",{key:"7c7b62b3bbdf001760e888b4206702d210aeadcb"},"\n .paypal-buttons {\n display: none;\n gap: 8px;\n width: 100%;\n }\n .paypal-buttons.shown {\n display: flex;\n }\n .paypal-buttons > * {\n display: none;\n flex: 1 1 0;\n min-width: 0;\n }\n .paypal-buttons > .shown {\n display: block;\n }\n "))}},mt=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=()=>{k.authToken&&k.accountId&&k.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:g[b.PLAID_SDK_LOAD_FAILED],severity:f[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:g[b.PLAID_LINK_TOKEN_FAILED],severity:f[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:g[b.PLAID_LINK_INIT_FAILED],severity:f[b.PLAID_LINK_INIT_FAILED],originalError:t,retryable:!0,userAction:"Click to try again"})}},this.getLinkToken=async()=>{var t,e,i,s,a;try{if(!k.authToken||!k.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(k.authToken,k.accountId,k.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&&(k.plaidLinkTokenId=this.linkTokenId)}catch(t){this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null);let n=b.PLAID_LINK_TOKEN_FAILED,o=g[n],r=!0;"AbortError"===t.name?(n=b.PLAID_TIMEOUT,o=g[n],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"))?(n=b.PLAID_NETWORK_ERROR,o=g[n],r=!0):((null===(s=t.message)||void 0===s?void 0:s.includes("401"))||(null===(a=t.message)||void 0===a?void 0:a.includes("unauthorized")))&&(n=b.PLAID_INVALID_CREDENTIALS,o="Authentication failed. Please refresh the page and try again.",r=!1),this.handleError({code:n,message:o,severity:f[n],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,k.selectedPaymentMethod={type:V.PLAID}),this.plaidErrorRecovered.emit({code:"plaid-success",message:"Bank account connected successfully",severity:p.INFO}),k.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=g[e],s=!0,a="Click to try again";if(t.error_code)switch(t.error_code){case"INVALID_CREDENTIALS":e=b.PLAID_INVALID_CREDENTIALS,i=g[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=g[e],s=!1,a="Contact your bank";break;case"INSTITUTION_NOT_RESPONDING":e=b.PLAID_MAINTENANCE,i=g[e],s=!0;break;case"RATE_LIMIT_EXCEEDED":e=b.PLAID_RATE_LIMITED,i=g[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 n=t.error_message.toLowerCase();n.includes("not supported")||n.includes("unsupported")?(e=b.PLAID_BANK_NOT_SUPPORTED,i=g[e],s=!1,a="Try a different payment method"):(n.includes("expired")||n.includes("timeout"))&&(e=b.PLAID_TOKEN_EXPIRED,i=g[e],s=!0)}this.handleError({code:e,message:i,severity:f[e],originalError:t,retryable:s,userAction:a}),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=k.selectedPaymentMethod)||void 0===t?void 0:t.type)===V.PLAID;this.isSelected!==e&&(this.isSelected=e)}}onSelectionChange(t){var e;t&&(null===(e=k.selectedPaymentMethod)||void 0===e?void 0:e.type)!==V.PLAID&&(k.selectedPaymentMethod={type:V.PLAID}),!t||!this.plaidLink||this.publicToken||this.isAuthenticating||this.error||this.openPlaidLink()}componentWillLoad(){var t;this.isSelected=(null===(t=k.selectedPaymentMethod)||void 0===t?void 0:t.type)===V.PLAID,!0===k.bankAccountVerification&&(k.checkoutLoaded?k.achPaymentsEnabled&&this.loadPlaidSDK():P("checkoutLoaded",(t=>{t&&!0===k.bankAccountVerification&&k.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:g[b.PLAID_SDK_LOAD_FAILED],severity:f[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 k.paymentToken}async handleSelectionClick(){if(this.isSelected=!0,k.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&&(k.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=P("selectedPaymentMethod",this.syncWithStore);this.unsubscribeFromStore=t}disconnectedCallback(){this.unsubscribeFromStore&&this.unsubscribeFromStore(),this.timeoutId&&clearTimeout(this.timeoutId),this.abortController&&this.abortController.abort()}render(){if(k.checkoutLoaded&&!k.achPaymentsEnabled)return this.hasLoggedAchPaymentsDisabledWarning||(console.warn("[JustifiPlaidPaymentMethod] ACH payments are disabled for this checkout. Component will not render."),this.hasLoggedAchPaymentsDisabledWarning=!0),null;if(!0!==k.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"]}}},vt=class{constructor(e){t(this,e),this.onPaymentMethodOptionClick=t=>e=>{e.preventDefault(),k.selectedPaymentMethod={id:t.id,type:t.type},k.paymentToken=t.id},this.isAllowedPaymentMethod=t=>!(t===V.SAVED_CARD&&k.disableCreditCard||t===V.SAVED_BANK_ACCOUNT&&k.disableBankAccount)}componentWillLoad(){k.checkoutLoaded&&(k.paymentMethods.length||console.warn("No saved payment methods available."),k.disablePaymentMethodGroup&&console.warn("Payment method group is disabled."))}render(){return k.disablePaymentMethodGroup?null:i(M,null,i("div",{class:"saved-payment-methods"},k.paymentMethods.length?k.paymentMethods.filter((t=>this.isAllowedPaymentMethod(t.type))).map((t=>i("div",{class:"radio-list-item p-3",part:E,onClick:this.onPaymentMethodOptionClick(t)},i("form-control-radio",{name:"paymentMethodType",value:null==t?void 0:t.id,checked:k.paymentToken===(null==t?void 0:t.id),label:`${G[null==t?void 0:t.brand]||""} *${null==t?void 0:t.acct_last_four}`})))):null))}},ft=class{constructor(i){t(this,i),this.paymentMethodOptionSelected=e(this,"paymentMethodOptionSelected",7),this.paymentMethodOptionId=V.SEZZLE,this.initializeSezzleCheckout=()=>{const t=Number(k.paymentAmount),e=new(0,window.Checkout)({mode:"popup",publicKey:k.bnplProviderClientId,apiMode:k.bnplProviderMode,apiVersion:k.bnplProviderApiVersion});e.sezzleButtonElement=this.sezzleButtonRef,e.init({onClick:function(t){t.preventDefault(),e.startCheckout({checkout_url:k.bnplProviderCheckoutUrl})},onComplete:t=>{var e;return null===(e=this.resolveSezzlePromise)||void 0===e?void 0:e.call(this,{bnpl:t.data})},onCancel:t=>{var e;return null===(e=this.resolveSezzlePromise)||void 0===e?void 0:e.call(this,{bnpl:t.data})},onFailure:t=>{var e;return null===(e=this.resolveSezzlePromise)||void 0===e?void 0:e.call(this,{bnpl:t.data})}}),this.sezzleCheckout=e,this.installmentPlan=this.sezzleCheckout.getInstallmentPlan(t)}}componentDidRender(){this.scriptRef&&(this.scriptRef.onload=()=>{this.sezzleButtonRef=document.createElement("button"),this.initializeSezzleCheckout()})}async resolvePaymentMethod(t){if(!t.isValid)return{validationError:!0};if(!this.sezzleButtonRef)return{error:{code:"sezzle_not_ready",message:"Sezzle is not ready yet. Please try again.",decline_code:""}};const e=new Promise((t=>{this.resolveSezzlePromise=t}));return this.sezzleButtonRef.click(),e}async handleSelectionClick(){k.selectedPaymentMethod={type:V.SEZZLE},this.paymentMethodOptionSelected.emit(this.paymentMethodOptionId)}render(){var t,e;return k.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 ",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"}})),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"},N(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)}},gt={[V.NEW_BANK_ACCOUNT]:"New bank account",[V.NEW_CARD]:"New credit or debit card"},bt="Payment form not ready",Mt="Validation error",wt=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,k.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:Mt}),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){k.billingFormFields=t}async validate(){if(!this.areFormsReady())return{isValid:!1,errors:{general:bt}};const[t,e]=await Promise.all([this.billingFormRef.validate(),this.paymentMethodFormRef.validate()]);return{isValid:t.isValid&&e.isValid,errors:Object.assign({},t.errors)}}async getValues(){return this.billingFormRef.getValues()}async tokenize(){try{const t=await this.billingFormRef.getValues(),e={clientId:this.authToken||k.authToken,account:this.accountId||k.accountId,paymentMethodMetadata:this.buildPaymentMethodMetadata(t)};return await this.paymentMethodFormRef.tokenize(e)}catch(t){return t}}validateRequiredProps(){this.authToken||k.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||k.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||k.checkoutLoaded&&!k.achPaymentsEnabled||(this.selectedPaymentMethod=V.NEW_BANK_ACCOUNT,k.selectedPaymentMethod={type:V.NEW_BANK_ACCOUNT}):(this.selectedPaymentMethod=V.NEW_CARD,k.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=!k.checkoutLoaded||k.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",bt);try{const e=await this.validate();if(!e.isValid||!t.isValid){const t=Object.values(e.errors)[0]||Mt;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||k.paymentMethodGroupId}get shouldSavePaymentMethod(){return!(!this.paymentMethodGroupId&&!k.savePaymentMethod)}get shouldHideRadioInput(){return this.disableCreditCard||this.disableBankAccount}renderPaymentMethodOption(t){const e=this.selectedPaymentMethod===t&&void 0===k.selectedPaymentMethod.id;return i("div",{class:"payment-method"},i("radio-list-item",{name:"paymentMethodType",value:t,checked:e,label:gt[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 t===V.NEW_CARD?i("card-form",{ref:t=>{t&&(this.paymentMethodFormRef=t)},maskCardNumber:this.maskCardNumber}):i("bank-account-form",{ref:t=>{t&&(this.paymentMethodFormRef=t)},showAccountNumberConfirmation:this.showAccountNumberConfirmation})}render(){return i(M,{key:"d065263c69beef410298f14a3c8e595460149267"},i("form",{key:"cbf67700b366e26eb9a6aa1fe07afd3f7baf5c52"},i("fieldset",{key:"3fd1ccefca659985eb2b90c1080c71c0f2ffe99a"},i("div",{key:"7181cff13f4cc7aa6c00f4023757bac96625e87b",class:"row gy-3"},i("div",{key:"c04c382e858eab02206902d23e3921d15d2bfebc",class:"col-12"},this.availablePaymentMethods.map((t=>this.renderPaymentMethodOption(t)))),i("div",{key:"9faa4417ba3e5dba526103f8d92fd5a88ce2df7d",class:"col-12"},i("internal-button",{key:"e4fc2482631553212e5cf62b07f2f44f32239b75",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 a(this)}static get watchers(){return{disableCreditCard:["paymentMethodsChanged"],disableBankAccount:["paymentMethodsChanged"]}}};export{X as justifi_apple_pay,tt as justifi_button,et as justifi_checkout_summary,at as justifi_google_pay,nt as justifi_header,ot as justifi_modular_checkout,yt as justifi_paypal,mt as justifi_plaid_payment_method,Z as justifi_radio_list_item,vt as justifi_saved_payment_methods,ft as justifi_sezzle_payment_method,wt as justifi_tokenize_payment_method}
@@ -0,0 +1 @@
1
+ import{r as i,c as s,h as t,H as a}from"./p-CV0Pyo1O.js";import{r as e}from"./p-Bu7gdOaV.js";const r=class{constructor(t){i(this,t),this.radioClick=s(this,"radio-click",7),this.checked=!1,this.hidden=!1,this.handleClick=()=>{this.radioClick.emit(this.value)}}render(){return t(a,{key:"dde5efa79bdc1d9a7367474308d1a5955e134c9b"},t("div",{key:"0da16408e69f19e68d65031ab0579b3d1c972af8",class:`radio-list-item p-3 ${this.class||""}`,part:e,onClick:this.handleClick,hidden:this.hidden},t("form-control-radio",{key:"56ea84930e14226280818def685cfc8148f31c5a",name:this.name,value:this.value,checked:this.checked,label:this.label,inputHandler:()=>null})))}};export{r as radio_list_item}
@@ -0,0 +1 @@
1
+ import{r as e,c as a,h as t}from"./p-CV0Pyo1O.js";import{B as s,C as d,D as c}from"./p-Bu7gdOaV.js";const i=class{constructor(t){e(this,t),this.selectedQuantityChange=a(this,"selectedQuantityChange",7),this.limit=1/0,this.selectedQuantity=0,this.removeUnit=()=>{this.selectedQuantity>0&&(this.selectedQuantity--,this.selectedQuantityChange.emit({modelName:this.modelName,quantity:this.selectedQuantity}))},this.addUnit=()=>{this.limit>0&&(this.selectedQuantity++,this.selectedQuantityChange.emit({modelName:this.modelName,quantity:this.selectedQuantity}))}}render(){return t("div",{key:"38cd0765871fd366af0adc09910add544ecefb93",class:"rounded shadow-sm card p-2",part:c},t("div",{key:"5e367d97287d3fef28e4f24d78384c6d02ab1540",class:"d-flex gap-3"},t("div",{key:"e031d923a5a01665a7f1a37e1d7df529ba51b0b2",class:"d-flex align-items-center"},t("img",{key:"b520afcdbd4946105324410499aa4ede31da1a72",src:this.imageUrl,alt:this.modelName,height:75,width:75,part:s})),t("div",{key:"5bdb4760b16241d9cd76e70245a19555dce6f723",class:"d-flex flex-column flex-grow-1 gap-3 p-4 justify-content-center"},t("div",{key:"598bab6407c43f94896a1782b60f048696361113",class:"row"},t("div",{key:"c340942cadb9dc0411f7d7815f1ccc9df75cbfbc",class:"col-6 d-flex gap-2"},this.modelName,t("form-control-tooltip",{key:"1f0a3deeb00abcf3e3cd01fecdeb0435f091cbac",helpText:this.description})),t("div",{key:"df8b8567640a567a4b8f238a21c6ed57d60e444a",class:"col-6 d-flex justify-content-end align-items-center"},t("button",{key:"baf59d5ede260d44a8ebfaaf95d8d134f3ef60da",class:"p-0 minus btn",onClick:this.removeUnit,part:d},"-"),t("div",{key:"cd3f528e9a56385cd17b23eb85185c51cd0dff67",class:"w-25 text-center"},this.selectedQuantity),t("button",{key:"6a55baa1403892f79600ff4ee85734c14a5f2ecc",class:"p-0 plus btn",onClick:this.addUnit,part:d},"+"))))))}};export{i as terminal_quantity_selector}
@@ -1 +1 @@
1
- import{r as e,c as t,h as s}from"./p-CV0Pyo1O.js";import{f as i}from"./p-Ds_P-dB8.js";import{t as a,a8 as d}from"./p-Bu7gdOaV.js";import{B as r}from"./p-CU2Dwa94.js";import{S as c}from"./p-eBK-iWrz.js";import"./p-CZfYo5-1.js";import{C as o,b as n}from"./p-Dqxyi-uK.js";import{g as h,a as p}from"./p-BhpaUYtS.js";import{D as l,a as f}from"./p-B_2zgnvM.js";import{c as u}from"./p-_MjmE9YT.js";import{J as b}from"./p-BjjKkMO1.js";import"./p-HXpYMWUU.js";import"./p-C6Jq8YDT.js";import"./p-B4vLfYnZ.js";import"./p-DgTOxu8x.js";import"./p-BC9n8nB2.js";import"./p-CLHwhyvu.js";import"./p-CTtGaVYs.js";const y=({authToken:e,disputeId:t,service:s})=>async({payload:i,onSuccess:a,onError:d,final:r=()=>{}})=>{var c;try{const r=await s.submitDisputeResponse(t,e,i);if(r.error){return d({error:p(r.error),code:h(null===(c=r.error)||void 0===c?void 0:c.code),severity:o.ERROR})}a(r)}catch(e){const t=h(null==e?void 0:e.code);return d({error:e.message||e,code:t,severity:o.ERROR})}finally{r()}},v=class{constructor(s){e(this,s),this.clickEvent=t(this,"click-event",7),this.errorEvent=t(this,"error-event",7),this.submitEvent=t(this,"submit-event",7)}acceptDispute(){y({disputeId:this.dispute.id,authToken:this.authToken,service:new f})({payload:{forfeit:!0},onSuccess:e=>{this.submitEvent.emit({response:e})},onError:({error:e,code:t,severity:s})=>{this.errorEvent.emit({errorCode:t,message:e,severity:s})}})}initiateRespondToDispute(){this.clickEvent.emit({name:l.respondToDispute})}isDueDatePassed(){var e;if(!(null===(e=this.dispute)||void 0===e?void 0:e.due_date))return!1;const t=new Date(this.dispute.due_date.replace(/-/g,"/").replace(/T.+/,"")),s=new Date;return s.setHours(0,0,0,0),t.setHours(0,0,0,0),t<s}render(){var e,t,o,n,h,p,l,f,u;return s("div",{key:"0f4474fa70e6ab3895132b703ab5a3b7f810554a",class:"dispute-notification-root"},this.isLoading&&s("div",{key:"1bd7b07c15e6a88be6215dbca5e41cbcfc6e6e68",style:{marginBottom:"8px"}},s(c,{key:"a4436ec5cc58b0cccdcdc9ae3d25293fdfaeac40",height:"28px",width:"70%",styles:{marginBottom:"16px"}}),s(c,{key:"cda7ba45ed518e762239864b766f65da8488e713",height:"18px",styles:{marginBottom:"8px"}}),s(c,{key:"a0acf3c7c0ae988f8580bfbd8b2ff2b5c349fddb",height:"18px",styles:{marginBottom:"8px"}})),(null===(e=this.dispute)||void 0===e?void 0:e.needsResponse)&&this.isDueDatePassed()&&s("div",{key:"2fd8a28d4c3eefc4a1a881d3bc47422428d4f016",part:a},s("h1",{key:"243ca1a43064800b65fb27e259598ff85746e55b",class:"h4",part:d},"The due date (",null===(t=this.dispute)||void 0===t?void 0:t.due_date,") for this dispute has passed"),s("p",{key:"617f7b87510fee1d64ad121cf15f1ba193f6826c"},"You can no longer submit evidence to counter this dispute.")),(null===(o=this.dispute)||void 0===o?void 0:o.needsResponse)&&!this.isDueDatePassed()&&s("div",{key:"d9ad4c30643e0991c7327a800d8015aa49d227ff",part:a},s("h1",{key:"c6e2b6a4a012ad2ce3d371ac765359f0db018166",class:"h4",part:d},"This payment is disputed"),s("p",{key:"491ca4d83029e8aec16ee745cd3eb78854298d19"},"The cardholder is disputing this payment. You may accept this dispute, or proceed to provide evidence in a counter dispute."),s("h2",{key:"3fd51e33e3440d6fda3fb6f2aa3f83cd783255fc",class:"h5"},"Dispute details"),s("div",{key:"edb7c85ffccd4a1af64cdb61a702ce39c86987a9",class:"d-table gap-2"},s("div",{key:"8d611ad34fa2a40d52f175c6874228254d235bf6",class:"d-table-row gap-2"},s("span",{key:"db4c9c3379b475ddb4c966336a1a9905f286335a",part:"detail-section-item-title",class:"fw-bold d-table-cell pe-4"},"Amount"),s("span",{key:"9c61d28bc602dd3cdeaa0e99923c58fb20fb95bc",part:"detail-section-item-data",class:"flex-1 d-table-cell text-wrap"},i(null===(n=this.dispute)||void 0===n?void 0:n.amount))),s("div",{key:"d7a84cd67c59bfdc2c63b7e847b82d423d3277a4",class:"d-table-row gap-2"},s("span",{key:"e98e2a8a8593b3358ecf6d5b857d2f3cffae1ef5",part:"detail-section-item-title",class:"fw-bold d-table-cell pe-4"},"Reason"),s("span",{key:"61f843068e6bf04d8bab69cefeb148e9b6792a5f",part:"detail-section-item-data",class:"flex-1 d-table-cell text-wrap"},null===(h=this.dispute)||void 0===h?void 0:h.reason)),s("div",{key:"795fd5d907eb2e1456c737a201517dbe5434ea84",class:"d-table-row gap-2"},s("span",{key:"1dae1ba0dd7323756988c8f6d65be1fdf3c155e6",part:"detail-section-item-title",class:"fw-bold d-table-cell pe-4"},"Due Date"),s("span",{key:"b44ff4fcfd0beb70af6468a216eee0489c566a79",part:"detail-section-item-data",class:"flex-1 d-table-cell text-wrap"},null===(p=this.dispute)||void 0===p?void 0:p.due_date))),s("div",{key:"f7e1ac7543ca231cc7904654bfb9fcb3e3f31dc1",class:"d-flex gap-2 mt-4 justify-content-end"},s(r,{key:"35dfa1f4e0a7f02496751dc332a4c52b542fe538",variant:"secondary",onClick:()=>this.acceptDispute()},"Accept dispute"),s(r,{key:"0519e6959a2407315d600384121b6ad466de79eb",variant:"primary",onClick:()=>this.initiateRespondToDispute()},"Counter dispute"))),(null===(l=this.dispute)||void 0===l?void 0:l.underReview)&&s("div",{key:"600db9506bed0de6efc3d0367fb5df63273bba14",part:a},s("h1",{key:"139a034878c8433edb1b936440c1b71d9d1022b2",class:"h4",part:d},"This payment is disputed and under review"),s("p",{key:"bd9b3d46e57ec998e5e1a5bc465d981129fc1fd2"},"The cardholder is disputing this payment. A counter dispute has been submitted and is under review.")),(null===(f=this.dispute)||void 0===f?void 0:f.won)&&s("div",{key:"c03393474cea2a44b864eba0f9e36b1fe63eb256",part:a},s("h1",{key:"3c19db3b8aefd25a363d4cd183eaaa2487d33f8c",class:"h4",part:d},"This payment was disputed"),s("p",{key:"45d95070b59c3a0da28bc5cda5356c2aa171d974"},"The cardholder disputed this payment and the card issuer has settled it in your favor.")),(null===(u=this.dispute)||void 0===u?void 0:u.lost)&&s("div",{key:"a8727df139e8d1eff3e67bc13359534281ceb795",part:a},s("h1",{key:"bb533bb65c20722002bda966782fcc4d165a139e",class:"h4",part:d},"This payment was disputed"),s("p",{key:"5901b10090d20523de1f96630ce7a9b71d9fdcac"},"The cardholder disputed this payment and the card issuer has settled it in their favor.")))}},m=class{constructor(i){e(this,i),this.clickEvent=t(this,"click-event",7),this.errorEvent=t(this,"error-event",7),this.stepCompleteEvent=t(this,"complete-form-step-event",7),this.submitEvent=t(this,"submit-event",7),this.errorMessage=null,this.disputeResponse={},this.apiOrigin="https://wc-proxy.justifi.ai",this.isLoading=!1,this.documentList=[],this.documentErrors={},this.currentStep=0,this.componentStepMapping=[()=>s("product-or-service",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("customer-details",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("cancellation-policy",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("refund-policy",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("duplicate-charge",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("electronic-evidence",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("shipping-details",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("additional-statement",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors})],this.saveData=async(e,t)=>{if(Object.keys(e).length)return this.isLastStep?this.submitDisputeResponse({payload:e,onSuccess:e=>{this.submitEvent.emit({response:e}),this.stepCompleteEvent.emit({response:e,formStep:t})},onError:({error:e,code:t,severity:s})=>{this.errorEvent.emit({errorCode:t,message:e,severity:s})}}):this.updateDisputeResponse({payload:e,onSuccess:e=>{this.disputeResponse=Object.assign({},e.data),this.stepCompleteEvent.emit({response:e,formStep:t})},onError:({error:e,code:t,severity:s})=>{this.errorEvent.emit({errorCode:t,message:e,severity:s})}});this.stepCompleteEvent.emit({response:null,formStep:t})},this.initializeMakePresignedURLs=async()=>{const e=this.documentList.map((e=>this.getPresignedFileUrl(e)));return await Promise.all(e)},this.initializeFileUploads=async()=>{const e=this.documentList.map((e=>this.uploadDocument(e)));return Promise.all(e)},this.getPresignedFileUrl=async e=>this.createDisputeEvidence({payload:{file_name:e.file_name,file_type:e.file_type,dispute_evidence_type:e.dispute_evidence_type},onSuccess:t=>{e.presignedUrl=t.data.presigned_url},onError:({error:t,code:s,severity:i})=>{const a={[e.dispute_evidence_type]:t};this.documentErrors=Object.assign(Object.assign({},this.documentErrors),a),this.errorEvent.emit({errorCode:s,message:t,severity:i})}}),this.uploadDocument=async e=>{const t=await e.getFileString();if(!e.presignedUrl)throw new Error("Presigned URL is not set");return await fetch(e.presignedUrl,{method:"PUT",body:t})},this.handleSubmit=async(e,t,s)=>{if(this.isLoading=!0,t.length){if(this.documentErrors={},this.documentList=t,await this.initializeMakePresignedURLs(),Object.keys(this.documentErrors).length)throw this.isLoading=!1,new Error("Could not presign all documents");await this.initializeFileUploads()}await this.saveData(e,s),this.isLoading=!1},this.onCancel=()=>{this.clickEvent.emit({name:l.cancelDispute})},this.onBack=async()=>{await this.currentStepComponentRef.validateAndSubmit((async(e,t,s)=>{this.clickEvent.emit({name:l.previousStep}),await this.handleSubmit(e,t,s),this.currentStep--}))},this.onNext=async()=>{await this.currentStepComponentRef.validateAndSubmit((async(e,t,s)=>{this.clickEvent.emit({name:l.nextStep}),await this.handleSubmit(e,t,s),this.currentStep++}))},this.onSubmit=async()=>{await this.currentStepComponentRef.validateAndSubmit((async(e,t,s)=>{this.clickEvent.emit({name:l.submit});const i=Object.assign(Object.assign({},e),{forfeit:!1});await this.handleSubmit(i,t,s)}))}}componentWillLoad(){u(),this.analytics=new b(this),this.initializeDisputeServiceMethods()}disconnectedCallback(){var e;null===(e=this.analytics)||void 0===e||e.cleanup()}propChanged(){this.initializeDisputeServiceMethods()}initializeDisputeServiceMethods(){this.disputeId&&this.authToken?(this.updateDisputeResponse=(({authToken:e,disputeId:t,service:s})=>async({payload:i,onSuccess:a,onError:d,final:r=()=>{}})=>{var c;try{const r=await s.updateDisputeResponse(t,e,i);if(r.error)return d({error:p(r.error),code:h(null===(c=r.error)||void 0===c?void 0:c.code),severity:o.ERROR});a(r)}catch(e){const t=h(null==e?void 0:e.code);return d({error:e.message||e,code:t,severity:o.ERROR})}finally{r()}})({disputeId:this.disputeId,authToken:this.authToken,service:new f}),this.createDisputeEvidence=(({authToken:e,disputeId:t,service:s})=>async({payload:i,onSuccess:a,onError:d,final:r=()=>{}})=>{var c;try{const r=await s.createDisputeEvidence(t,e,i);if(r.error)return d({error:p(r.error),code:h(null===(c=r.error)||void 0===c?void 0:c.code),severity:o.ERROR});a(r)}catch(e){const t=h(null==e?void 0:e.code);return d({error:e.message||e,code:t,severity:o.ERROR})}finally{r()}})({disputeId:this.disputeId,authToken:this.authToken,service:new f}),this.submitDisputeResponse=y({disputeId:this.disputeId,authToken:this.authToken,service:new f})):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:n.MISSING_PROPS,message:this.errorMessage,severity:o.ERROR}))}get currentStepComponent(){return this.componentStepMapping[this.currentStep]()}get isLastStep(){return this.currentStep===this.componentStepMapping.length-1}get isFirstStep(){return 0===this.currentStep}render(){return s("div",{key:"57664882c2d3c6833f9a9cbe01452875119c6032",class:"dispute-response-root"},s("div",{key:"92c8e3b3426210b68063ad7474aeb13429fd4c76",class:"row gy-3"},s("div",{key:"0f7e1236d85765054a40a06d864199feba0cad21",class:"col-12"},s("h1",{key:"b12f3840caeb7c17d324829874b8a4089fcb123d",class:"h4",part:d},"Counter dispute")),s("div",{key:"c493a872abb1d058cd98fab46eefa6f68caaa351",class:"col-12"},this.currentStepComponent),s("div",{key:"06f7818c59490ec54c58e9e0a5d7effec11bf0a6",class:"col-12"},s("div",{key:"754852aaab1b5048ed52796a13e169228a6ac2d1",class:"d-flex gap-2 mt-4 justify-content-end"},this.isFirstStep?s(r,{variant:"secondary",onClick:()=>this.onCancel(),disabled:this.isLoading,isLoading:this.isLoading},"Cancel"):s(r,{variant:"secondary",onClick:()=>this.onBack(),disabled:this.isLoading,isLoading:this.isLoading},"Back"),this.isLastStep?s(r,{variant:"primary",onClick:()=>this.onSubmit(),disabled:this.isLoading,isLoading:this.isLoading},"Submit Counter Dispute"):s(r,{variant:"primary",onClick:()=>this.onNext(),disabled:this.isLoading,isLoading:this.isLoading},"Next")))))}static get watchers(){return{disputeId:["propChanged"],authToken:["propChanged"]}}};export{v as dispute_notification,m as dispute_response}
1
+ import{r as e,c as t,h as s}from"./p-CV0Pyo1O.js";import{f as i}from"./p-Ds_P-dB8.js";import{t as a,a8 as r}from"./p-Bu7gdOaV.js";import{B as d}from"./p-CU2Dwa94.js";import{S as c}from"./p-eBK-iWrz.js";import"./p-CZfYo5-1.js";import{C as o,b as n}from"./p-Dqxyi-uK.js";import{g as h,a as p}from"./p-BhpaUYtS.js";import{D as l,a as f}from"./p-B6kC9tX2.js";import{d as u}from"./p-DF7oFWnO.js";import{J as b}from"./p-CEHwp4sh.js";import"./p-HXpYMWUU.js";import"./p-DCpGH4xL.js";import"./p-B4vLfYnZ.js";import"./p-DgTOxu8x.js";import"./p-DhrQechy.js";import"./p-CLHwhyvu.js";import"./p-CTtGaVYs.js";const y=({authToken:e,disputeId:t,service:s})=>async({payload:i,onSuccess:a,onError:r,final:d=()=>{}})=>{var c;try{const d=await s.submitDisputeResponse(t,e,i);if(d.error){return r({error:p(d.error),code:h(null===(c=d.error)||void 0===c?void 0:c.code),severity:o.ERROR})}a(d)}catch(e){const t=h(null==e?void 0:e.code);return r({error:e.message||e,code:t,severity:o.ERROR})}finally{d()}},v=class{constructor(s){e(this,s),this.clickEvent=t(this,"click-event",7),this.errorEvent=t(this,"error-event",7),this.submitEvent=t(this,"submit-event",7)}acceptDispute(){y({disputeId:this.dispute.id,authToken:this.authToken,service:new f})({payload:{forfeit:!0},onSuccess:e=>{this.submitEvent.emit({response:e})},onError:({error:e,code:t,severity:s})=>{this.errorEvent.emit({errorCode:t,message:e,severity:s})}})}initiateRespondToDispute(){this.clickEvent.emit({name:l.respondToDispute})}isDueDatePassed(){var e;if(!(null===(e=this.dispute)||void 0===e?void 0:e.due_date))return!1;const t=new Date(this.dispute.due_date.replace(/-/g,"/").replace(/T.+/,"")),s=new Date;return s.setHours(0,0,0,0),t.setHours(0,0,0,0),t<s}render(){var e,t,o,n,h,p,l,f,u;return s("div",{key:"12cd6c17c1f4f70e136fa0e9d6ff74d37af82a1e",class:"dispute-notification-root"},this.isLoading&&s("div",{key:"33b1c6259abe1da5d92ac2aa37cfec9033fbb3d1",style:{marginBottom:"8px"}},s(c,{key:"1f5bc2333a37587d3d11e545b58c9b85a2a145a5",height:"28px",width:"70%",styles:{marginBottom:"16px"}}),s(c,{key:"280e35a187319c7698922c3cd3f579457a187e7a",height:"18px",styles:{marginBottom:"8px"}}),s(c,{key:"3fd7f151a3d7516dd40835d6c42d2240d7170613",height:"18px",styles:{marginBottom:"8px"}})),(null===(e=this.dispute)||void 0===e?void 0:e.needsResponse)&&this.isDueDatePassed()&&s("div",{key:"e78d3cf205ba862b8df5e5358e15c4961add1003",part:a},s("h1",{key:"c533f650a18a75ca7c9f1cb15a6d1da517317e54",class:"h4",part:r},"The due date (",null===(t=this.dispute)||void 0===t?void 0:t.due_date,") for this dispute has passed"),s("p",{key:"14f82547639777ab5179010f350d42f7b4082845"},"You can no longer submit evidence to counter this dispute.")),(null===(o=this.dispute)||void 0===o?void 0:o.needsResponse)&&!this.isDueDatePassed()&&s("div",{key:"a2eefdc255af0c3b07091183fff4c5860f66af3a",part:a},s("h1",{key:"043801fa6ac2f90ba10e6048feeecf670cc4e4dd",class:"h4",part:r},"This payment is disputed"),s("p",{key:"b4b115c46340ae96e43a63a1535b59f071efc7cc"},"The cardholder is disputing this payment. You may accept this dispute, or proceed to provide evidence in a counter dispute."),s("h2",{key:"451b315624efea9b5f1e619ae6b942611ba93135",class:"h5"},"Dispute details"),s("div",{key:"c7765f5f091a346de0eb7aa81c36d475832925d2",class:"d-table gap-2"},s("div",{key:"cb3ecb618099b579a488232d5ecafef28c7da235",class:"d-table-row gap-2"},s("span",{key:"86475be18418565529a2d08a544962209f9766ac",part:"detail-section-item-title",class:"fw-bold d-table-cell pe-4"},"Amount"),s("span",{key:"5efe0ffd6f0236b906ab9e52f32bd9a0533240a2",part:"detail-section-item-data",class:"flex-1 d-table-cell text-wrap"},i(null===(n=this.dispute)||void 0===n?void 0:n.amount))),s("div",{key:"286b29d07ddb23ba80d4831aadebb4f550545c39",class:"d-table-row gap-2"},s("span",{key:"2a8582b5e4c6e0b4ad1db9b7222148949accf10d",part:"detail-section-item-title",class:"fw-bold d-table-cell pe-4"},"Reason"),s("span",{key:"b8e43894965778696e0cb41204b3efe1aac9443e",part:"detail-section-item-data",class:"flex-1 d-table-cell text-wrap"},null===(h=this.dispute)||void 0===h?void 0:h.reason)),s("div",{key:"4864005f755bdbdecb5ed28370452850dfc9f047",class:"d-table-row gap-2"},s("span",{key:"64b10de9b84fe9992b07a88294caa38b2b63fdca",part:"detail-section-item-title",class:"fw-bold d-table-cell pe-4"},"Due Date"),s("span",{key:"5198c3cd3ebf4246c42d8b59603765bd39bae06b",part:"detail-section-item-data",class:"flex-1 d-table-cell text-wrap"},null===(p=this.dispute)||void 0===p?void 0:p.due_date))),s("div",{key:"29c98ba58742d3195eca08571cbf793bc9d5a7c6",class:"d-flex gap-2 mt-4 justify-content-end"},s(d,{key:"9ef19c0152cbb6342214aa5073ffed303fc85624",variant:"secondary",onClick:()=>this.acceptDispute()},"Accept dispute"),s(d,{key:"558126e83a05c0729e17a1abf5ce849e02574096",variant:"primary",onClick:()=>this.initiateRespondToDispute()},"Counter dispute"))),(null===(l=this.dispute)||void 0===l?void 0:l.underReview)&&s("div",{key:"f8c6fee1c63eef8cf2d2a00fb10051686c7572ae",part:a},s("h1",{key:"23c4bb1c8ab00f4cf9a1447156c124f8ecd1f4b7",class:"h4",part:r},"This payment is disputed and under review"),s("p",{key:"b1c469330757f22582e5c341c68adcd1aae3def3"},"The cardholder is disputing this payment. A counter dispute has been submitted and is under review.")),(null===(f=this.dispute)||void 0===f?void 0:f.won)&&s("div",{key:"46c92fe084337c67ce0bfedf11d89aca38bdc5e4",part:a},s("h1",{key:"ac06dc25f88d88d257ff56aec620d803a45d6344",class:"h4",part:r},"This payment was disputed"),s("p",{key:"30a26bceb37855460b8ae6ef54c20591900b5fcf"},"The cardholder disputed this payment and the card issuer has settled it in your favor.")),(null===(u=this.dispute)||void 0===u?void 0:u.lost)&&s("div",{key:"2320aa515a8112a27bdbd9e3f1b3a8daf2c1b28e",part:a},s("h1",{key:"32e0cfc6e8d27afe01194ab61ad342781ec31bf8",class:"h4",part:r},"This payment was disputed"),s("p",{key:"6a8b333f0be16d81ffc23609bcdcb8f70435d515"},"The cardholder disputed this payment and the card issuer has settled it in their favor.")))}},m=class{constructor(i){e(this,i),this.clickEvent=t(this,"click-event",7),this.errorEvent=t(this,"error-event",7),this.stepCompleteEvent=t(this,"complete-form-step-event",7),this.submitEvent=t(this,"submit-event",7),this.errorMessage=null,this.disputeResponse={},this.apiOrigin="https://wc-proxy.justifi.ai",this.isLoading=!1,this.documentList=[],this.documentErrors={},this.currentStep=0,this.componentStepMapping=[()=>s("product-or-service",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("customer-details",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("cancellation-policy",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("refund-policy",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("duplicate-charge",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("electronic-evidence",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("shipping-details",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("additional-statement",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors})],this.saveData=async(e,t)=>{if(Object.keys(e).length)return this.isLastStep?this.submitDisputeResponse({payload:e,onSuccess:e=>{this.submitEvent.emit({response:e}),this.stepCompleteEvent.emit({response:e,formStep:t})},onError:({error:e,code:t,severity:s})=>{this.errorEvent.emit({errorCode:t,message:e,severity:s})}}):this.updateDisputeResponse({payload:e,onSuccess:e=>{this.disputeResponse=Object.assign({},e.data),this.stepCompleteEvent.emit({response:e,formStep:t})},onError:({error:e,code:t,severity:s})=>{this.errorEvent.emit({errorCode:t,message:e,severity:s})}});this.stepCompleteEvent.emit({response:null,formStep:t})},this.initializeMakePresignedURLs=async()=>{const e=this.documentList.map((e=>this.getPresignedFileUrl(e)));return await Promise.all(e)},this.initializeFileUploads=async()=>{const e=this.documentList.map((e=>this.uploadDocument(e)));return Promise.all(e)},this.getPresignedFileUrl=async e=>this.createDisputeEvidence({payload:{file_name:e.file_name,file_type:e.file_type,dispute_evidence_type:e.dispute_evidence_type},onSuccess:t=>{e.presignedUrl=t.data.presigned_url},onError:({error:t,code:s,severity:i})=>{const a={[e.dispute_evidence_type]:t};this.documentErrors=Object.assign(Object.assign({},this.documentErrors),a),this.errorEvent.emit({errorCode:s,message:t,severity:i})}}),this.uploadDocument=async e=>{const t=await e.getFileString();if(!e.presignedUrl)throw new Error("Presigned URL is not set");return await fetch(e.presignedUrl,{method:"PUT",body:t})},this.handleSubmit=async(e,t,s)=>{if(this.isLoading=!0,t.length){if(this.documentErrors={},this.documentList=t,await this.initializeMakePresignedURLs(),Object.keys(this.documentErrors).length)throw this.isLoading=!1,new Error("Could not presign all documents");await this.initializeFileUploads()}await this.saveData(e,s),this.isLoading=!1},this.onCancel=()=>{this.clickEvent.emit({name:l.cancelDispute})},this.onBack=async()=>{await this.currentStepComponentRef.validateAndSubmit((async(e,t,s)=>{this.clickEvent.emit({name:l.previousStep}),await this.handleSubmit(e,t,s),this.currentStep--}))},this.onNext=async()=>{await this.currentStepComponentRef.validateAndSubmit((async(e,t,s)=>{this.clickEvent.emit({name:l.nextStep}),await this.handleSubmit(e,t,s),this.currentStep++}))},this.onSubmit=async()=>{await this.currentStepComponentRef.validateAndSubmit((async(e,t,s)=>{this.clickEvent.emit({name:l.submit});const i=Object.assign(Object.assign({},e),{forfeit:!1});await this.handleSubmit(i,t,s)}))}}componentWillLoad(){u(),this.analytics=new b(this),this.initializeDisputeServiceMethods()}disconnectedCallback(){var e;null===(e=this.analytics)||void 0===e||e.cleanup()}propChanged(){this.initializeDisputeServiceMethods()}initializeDisputeServiceMethods(){this.disputeId&&this.authToken?(this.updateDisputeResponse=(({authToken:e,disputeId:t,service:s})=>async({payload:i,onSuccess:a,onError:r,final:d=()=>{}})=>{var c;try{const d=await s.updateDisputeResponse(t,e,i);if(d.error)return r({error:p(d.error),code:h(null===(c=d.error)||void 0===c?void 0:c.code),severity:o.ERROR});a(d)}catch(e){const t=h(null==e?void 0:e.code);return r({error:e.message||e,code:t,severity:o.ERROR})}finally{d()}})({disputeId:this.disputeId,authToken:this.authToken,service:new f}),this.createDisputeEvidence=(({authToken:e,disputeId:t,service:s})=>async({payload:i,onSuccess:a,onError:r,final:d=()=>{}})=>{var c;try{const d=await s.createDisputeEvidence(t,e,i);if(d.error)return r({error:p(d.error),code:h(null===(c=d.error)||void 0===c?void 0:c.code),severity:o.ERROR});a(d)}catch(e){const t=h(null==e?void 0:e.code);return r({error:e.message||e,code:t,severity:o.ERROR})}finally{d()}})({disputeId:this.disputeId,authToken:this.authToken,service:new f}),this.submitDisputeResponse=y({disputeId:this.disputeId,authToken:this.authToken,service:new f})):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:n.MISSING_PROPS,message:this.errorMessage,severity:o.ERROR}))}get currentStepComponent(){return this.componentStepMapping[this.currentStep]()}get isLastStep(){return this.currentStep===this.componentStepMapping.length-1}get isFirstStep(){return 0===this.currentStep}render(){return s("div",{key:"a558e22c9d41b40d01fd7317566b8e92b181396a",class:"dispute-response-root"},s("div",{key:"b5ccda631bb6b8d9587c97c5f72c73563b32a336",class:"row gy-3"},s("div",{key:"680cd57e4c08c919284911e03c31bf88e9ea27bd",class:"col-12"},s("h1",{key:"aa9cad23ec784d2d037a39f536f25547e52038fd",class:"h4",part:r},"Counter dispute")),s("div",{key:"39e1d9bb2cd0cca28841430139c301fd18863f81",class:"col-12"},this.currentStepComponent),s("div",{key:"3c87124fcab317c738b2ecfdaa454b008bd921fd",class:"col-12"},s("div",{key:"210414d3492ce600c34b8c93824c81cae12bb3b4",class:"d-flex gap-2 mt-4 justify-content-end"},this.isFirstStep?s(d,{variant:"secondary",onClick:()=>this.onCancel(),disabled:this.isLoading,isLoading:this.isLoading},"Cancel"):s(d,{variant:"secondary",onClick:()=>this.onBack(),disabled:this.isLoading,isLoading:this.isLoading},"Back"),this.isLastStep?s(d,{variant:"primary",onClick:()=>this.onSubmit(),disabled:this.isLoading,isLoading:this.isLoading},"Submit Counter Dispute"):s(d,{variant:"primary",onClick:()=>this.onNext(),disabled:this.isLoading,isLoading:this.isLoading},"Next")))))}static get watchers(){return{disputeId:["propChanged"],authToken:["propChanged"]}}};export{v as dispute_notification,m as dispute_response}
@@ -0,0 +1 @@
1
+ import{r as a,h as e}from"./p-CV0Pyo1O.js";import{f as t,p as s,c as r}from"./p-CGnRD4wF.js";import{f as l,a as d}from"./p-Bu7gdOaV.js";import{S as f}from"./p-05AWudQe.js";import"./p-CZfYo5-1.js";import{c as i,a as o}from"./p-Ds_P-dB8.js";import"./p-B4vLfYnZ.js";import{P as c}from"./p-Dqxyi-uK.js";import"./p-CLHwhyvu.js";import"./p-CTtGaVYs.js";import"./p-DgTOxu8x.js";import"./p-HXpYMWUU.js";const p=class{constructor(e){a(this,e),this.setParamsOnChange=(a,e)=>{t[a]=e},this.handleDateInput=(a,e)=>{const t=i(e,{setEndOfDay:!0});this.setParamsOnChange(a,t)}}componentWillLoad(){Object.entries({status:this.status,created_after:this.createdAfter,created_before:this.createdBefore}).forEach((([a,e])=>{e&&(s[a]=e)}))}get statusOptions(){return[{label:"All",value:""},{label:c.paid,value:"paid"},{label:c.failed,value:"failed"},{label:c.forwarded,value:"forwarded"},{label:c.scheduled,value:"scheduled"},{label:c.in_transit,value:"in_transit"},{label:c.canceled,value:"canceled"}]}render(){const a=Object.assign({},t);return e(f,{key:"57aded74e21baf8bb4e48c372752a5f1160eede2"},e("table-filters-menu",{key:"28bd015a59ac27d25c91aa76a98d53a1d17f1ddd",params:a,clearParams:r,part:l},e("div",{key:"50afcc5bb969c562fc81ff4630a1cf0e778729b9",class:"grid-cols-2 gap-3 p-1"},e("div",{key:"9066f408b3e80d84c1259376ea5f333c64efbd1a",class:"p-2"},e("form-control-select",{key:"49fa9695945cf0bec87fe80ab20783ab86868e42",name:"status",label:"Status",options:this.statusOptions,inputHandler:this.setParamsOnChange,defaultValue:this.status||t.status||"",disabled:!!this.status,part:d})),e("div",{key:"169fd2190f8696a194436b8b8a22477c01e28c3f",class:"p-2"},e("form-control-date",{key:"edc8aa14f0162f74172a7eac92bb98bf7afe0185",name:"created_after",label:"Created After",inputHandler:this.handleDateInput,defaultValue:o(this.createdAfter,{showInputDate:!0})||o(t.created_after,{showInputDate:!0}),disabled:!!this.createdAfter,part:d})),e("div",{key:"6367da41915508aeb28ee8ff60f538322bfbd1c8",class:"p-2"},e("form-control-date",{key:"2768b468eccbfb746c62c1b9172c12213e70a4ed",name:"created_before",label:"Created Before",inputHandler:this.handleDateInput,defaultValue:o(this.createdBefore,{showInputDate:!0})||o(t.created_before,{showInputDate:!0}),disabled:!!this.createdBefore,part:d})))))}};export{p as justifi_payouts_list_filters}
@@ -0,0 +1 @@
1
+ import{h as s,F as e,r as t,c as i}from"./p-CV0Pyo1O.js";import{E as r}from"./p-Bh6Q8AqQ.js";import{B as a}from"./p-Bo7ndXwR.js";import{m as o}from"./p-BDtSw_d-.js";import{C as n,b as h}from"./p-Dqxyi-uK.js";import{J as l}from"./p-CEHwp4sh.js";import{d}from"./p-DF7oFWnO.js";import{S as p}from"./p-05AWudQe.js";import"./p-CZfYo5-1.js";import{S as c}from"./p-eBK-iWrz.js";import"./p-Bu7gdOaV.js";import"./p-DCpGH4xL.js";import"./p-B4vLfYnZ.js";import"./p-DgTOxu8x.js";import"./p-Ds_P-dB8.js";import"./p-HXpYMWUU.js";import"./p-DhrQechy.js";import"./p-CLHwhyvu.js";import"./p-CTtGaVYs.js";import"./p-BhpaUYtS.js";const u=()=>{const t=()=>s("div",{class:"mt-5"},s(c,{width:"40%",height:"1.5rem"}),s("hr",null),s("div",{class:"row g-3"},s("div",{class:"col-12 col-md-6"},s(c,null),s(c,null),s(c,null)),s("div",{class:"col-12 col-md-6"},s(c,null),s(c,null),s(c,null))));return s(e,null,s(t,null),s(t,null),s(t,null),s(t,null))},f=class{constructor(s){t(this,s),this.errorEvent=i(this,"error-event",7),this.loading=!0}componentWillLoad(){d(),this.analytics=new l(this),this.initializeGetBusiness()}disconnectedCallback(){var s;null===(s=this.analytics)||void 0===s||s.cleanup()}propChanged(){this.initializeGetBusiness()}initializeGetBusiness(){this.businessId&&this.authToken?(this.getBusiness=o({id:this.businessId,authToken:this.authToken,service:new a}),this.fetchData()):(this.errorMessage="Invalid business id or auth token",this.errorEvent.emit({errorCode:h.MISSING_PROPS,message:this.errorMessage,severity:n.ERROR}))}updateOnPropChange(){this.getBusiness&&this.fetchData()}fetchData(){this.loading=!0,this.getBusiness({onSuccess:({business:s})=>{this.business=s,this.errorMessage=null},onError:({error:s,code:e,severity:t})=>{this.errorMessage=s,this.errorEvent.emit({errorCode:e,message:s,severity:t})},final:()=>{this.loading=!1}})}render(){return s(p,{key:"5591589ce180d7102dc3403143556c1302af3fe5"},this.loading&&s(u,{key:"c45c978e7b9b1a2e086558be669be4f9c9962965"}),!this.loading&&this.errorMessage&&r(this.errorMessage),!this.loading&&!this.errorMessage&&this.business&&s("justifi-details",{key:"cbb51e9f2f7ab55573349cb2106949a5ca91833d",errorMessage:this.errorMessage},s("div",{key:"c85ae2fd98b56566795383c3a799b9b93853a786",slot:"detail-sections"},s("core-info-details",{key:"2a582bf825f75176e680882f05d287b1791a411b",business:this.business}),s("legal-address-details",{key:"3855cc37f98885547c425e7b21f3f153604ca8ee",legalAddress:this.business.legal_address}),s("representative-details",{key:"16b323711a50310012ce46f8d83d2ab8f64e1461",representative:this.business.representative}),s("owner-details",{key:"fd3609e46477071432a5fa276b84df00d5717f2c",owners:this.business.owners}),s("additional-questions-details",{key:"b42b0499a259c3e73c91278a5515e2dcf00c3f5f",additionalQuestions:this.business.additional_questions}))))}static get watchers(){return{businessId:["propChanged"],authToken:["propChanged"],getBusiness:["updateOnPropChange"]}}};export{f as justifi_business_details}
@@ -0,0 +1 @@
1
+ import{h as a,r as i,c as e}from"./p-CV0Pyo1O.js";import{S as t}from"./p-eBK-iWrz.js";import{w as r,c as s}from"./p-B4vLfYnZ.js";import{e as d}from"./p-Ds_P-dB8.js";import{d as o}from"./p-DF7oFWnO.js";import{C as n,c,b as h}from"./p-Dqxyi-uK.js";import"./p-CLHwhyvu.js";import"./p-CTtGaVYs.js";import{B as l}from"./p-CU2Dwa94.js";import"./p-CZfYo5-1.js";import"./p-Bu7gdOaV.js";import"./p-DgTOxu8x.js";import"./p-HXpYMWUU.js";import"./p-DhrQechy.js";const f=()=>a("div",{class:"container-fluid p-0"},a("div",{class:"mb-3"},a(t,{height:"18px",width:"100px"}),a(t,{height:"36px"})),a("div",{class:"row"},a("div",{class:"col-4 align-content-end"},a(t,{height:"18px",width:"80px"}),a(t,{height:"36px"})),a("div",{class:"col-4 align-content-end"},a(t,{height:"36px"})),a("div",{class:"col-4 align-content-end"},a(t,{height:"18px",width:"30px"}),a(t,{height:"36px"})))),p=class{constructor(a){i(this,a),this.errorEvent=e(this,"error-event",7),this.iframeState="loading",this.maskCardNumber=!1,this.reloadIframes=()=>{this.iframeState="loading",this.iframeElements.forEach((a=>a.reload())),this.watchIframesLoad()}}async componentWillLoad(){await r(),this.iframeOrigin=s.iframeOrigin,this.tabId=d(),o()}componentDidLoad(){this.watchIframesLoad()}disconnectedCallback(){var a;null===(a=this.loadAbortController)||void 0===a||a.abort()}async validate(){const a=[];for(const i of this.iframeElements)a.push(await i.validate());return{isValid:a.every((a=>!0===(null==a?void 0:a.isValid)))}}async tokenize({clientId:a,paymentMethodMetadata:i,account:e}){return await this.cardNumberIframeElement.tokenize(a,i,e)}get isReady(){return"ready"===this.iframeState}get iframeElements(){return[this.cardNumberIframeElement,this.expirationMonthIframeElement,this.expirationYearIframeElement,this.cvvIframeElement]}watchIframesLoad(){var a;null===(a=this.loadAbortController)||void 0===a||a.abort();const{signal:i}=this.loadAbortController=new AbortController,e=new Set(this.iframeElements.map((a=>a.inputId))),t=Promise.all(this.iframeElements.map((a=>new Promise((t=>{a.addEventListener("iframeLoaded",(()=>{e.delete(a.inputId),t()}),{once:!0,signal:i})}))))),r=new Promise(((a,t)=>{const r=window.setTimeout((()=>t(new Error(`Iframes failed to load: ${Array.from(e).join(", ")}`))),1e4);i.addEventListener("abort",(()=>{window.clearTimeout(r),t(new Error("iframe load watch aborted"))}),{once:!0})}));Promise.race([t,r]).then((()=>{var a;i.aborted||(this.iframeState="ready",null===(a=this.loadAbortController)||void 0===a||a.abort())})).catch((a=>{var e;i.aborted||(this.iframeState="error",null===(e=this.loadAbortController)||void 0===e||e.abort(),this.errorEvent.emit({errorCode:h.IFRAME_LOAD_ERROR,message:c.IFRAME_LOAD_ERROR,severity:n.ERROR,data:{errorMessage:a.message}}))}))}renderIframeError(){return a("div",null,a("form-alert",{text:c.IFRAME_LOAD_ERROR,hideAlert:!1}),a(l,{variant:"link",clickHandler:this.reloadIframes,"aria-label":"Reload payment form",type:"button"},"Try again"))}render(){return a("div",{key:"aa9433ca84a3c5d3d12970a0533247b10ef7a39c"},"loading"===this.iframeState&&a(f,{key:"af68a39d4d71d665699fd53efc436158eefeae60"}),"error"===this.iframeState&&this.renderIframeError(),a("hidden-input",{key:"aee1ab56e4777181e1598a4047b4ac873da4416d"}),a("div",{key:"0f1603b84d701da90f05f10c8b7c2d7d26d706e8",class:"container-fluid p-0",style:{opacity:this.isReady?"1":"0",height:this.isReady?"auto":"0"}},a("div",{key:"364249139cf19fa5567f9c694a2925e9ea26e4ae",class:"mb-3"},a("iframe-input",{key:"46f1bf0510d8ca73c231f2e7cca44c14b7c8578a",inputId:"cardNumber",ref:a=>this.cardNumberIframeElement=a,label:"Card Number",maskCardNumber:this.maskCardNumber,iframeOrigin:`${this.iframeOrigin}/v2/cardNumber?tabId=${this.tabId}`})),a("div",{key:"630569a17973f3aa17a07b0baccc85cae4c51bcc",class:"row"},a("div",{key:"7d9b30a60da5a45ae1f635caad6293c867d4bc0f",class:"col-4 align-content-end"},a("iframe-input",{key:"a1b51799646a1d53d4f3ee4b5f8b057190a8de9b",inputId:"expirationMonth",ref:a=>this.expirationMonthIframeElement=a,label:"Expiration",iframeOrigin:`${this.iframeOrigin}/v2/expirationMonth?tabId=${this.tabId}`})),a("div",{key:"2fdc1625946783a048a9e2b2899987e8cdc449b8",class:"col-4 align-content-end"},a("iframe-input",{key:"174b38998fe0a1fd278da55cb08a7ca1d0e8447f",inputId:"expirationYear",ref:a=>this.expirationYearIframeElement=a,label:"",iframeOrigin:`${this.iframeOrigin}/v2/expirationYear?tabId=${this.tabId}`})),a("div",{key:"1238f5d1370f27ba0ac3841563e66b51a18eaaa0",class:"col-4 align-content-end"},a("iframe-input",{key:"86d822f907b95ee86f1fcf6f2148da3449c41d48",inputId:"CVV",ref:a=>this.cvvIframeElement=a,label:"CVV",iframeOrigin:`${this.iframeOrigin}/v2/CVV?tabId=${this.tabId}`})))))}};export{p as card_form}
@@ -1 +1 @@
1
- import{A as e}from"./p-C6Jq8YDT.js";import"./p-Dqxyi-uK.js";import"./p-CLHwhyvu.js";import"./p-CTtGaVYs.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-DCpGH4xL.js";import"./p-Dqxyi-uK.js";import"./p-CLHwhyvu.js";import"./p-CTtGaVYs.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
- import{A as t}from"./p-C6Jq8YDT.js";import"./p-Dqxyi-uK.js";import"./p-CLHwhyvu.js";import"./p-CTtGaVYs.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}
1
+ import{A as t}from"./p-DCpGH4xL.js";import"./p-Dqxyi-uK.js";import"./p-CLHwhyvu.js";import"./p-CTtGaVYs.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}
@@ -1 +1 @@
1
- import{A as t}from"./p-C6Jq8YDT.js";import"./p-Dqxyi-uK.js";import"./p-CLHwhyvu.js";import"./p-CTtGaVYs.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-DCpGH4xL.js";import"./p-Dqxyi-uK.js";import"./p-CLHwhyvu.js";import"./p-CTtGaVYs.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 +1 @@
1
- import{A as o}from"./p-C6Jq8YDT.js";import{S as s,C as r}from"./p-Dqxyi-uK.js";import"./p-CLHwhyvu.js";import"./p-CTtGaVYs.js";import"./p-B4vLfYnZ.js";import"./p-HXpYMWUU.js";import{g as t,a as n}from"./p-BhpaUYtS.js";const a=o();class c{async fetchSubAccounts(o,s,r){return a.get({authToken:s,endpoint:"sub_accounts",params:r,headers:{Account:o}})}}const e=({primaryAccountId:o,authToken:a,service:c})=>async({params:e,onSuccess:p,onError:i})=>{var u,m;try{const v=await c.fetchSubAccounts(o,a,e);if(v.error){return i({error:n(v.error),code:t(null===(m=v.error)||void 0===m?void 0:m.code),severity:r.ERROR})}{const o=Object.assign({},v.page_info);p({subAccounts:(null===(u=v.data)||void 0===u?void 0:u.map((o=>new s(o))))||[],pagingInfo:o})}}catch(o){const s=t(null==o?void 0:o.code);return i({error:o.message||o,code:s,severity:r.ERROR})}};export{c as S,e as m}
1
+ import{A as o}from"./p-DCpGH4xL.js";import{S as s,C as r}from"./p-Dqxyi-uK.js";import"./p-CLHwhyvu.js";import"./p-CTtGaVYs.js";import"./p-B4vLfYnZ.js";import"./p-HXpYMWUU.js";import{g as t,a as n}from"./p-BhpaUYtS.js";const a=o();class c{async fetchSubAccounts(o,s,r){return a.get({authToken:s,endpoint:"sub_accounts",params:r,headers:{Account:o}})}}const e=({primaryAccountId:o,authToken:a,service:c})=>async({params:e,onSuccess:p,onError:i})=>{var u,m;try{const v=await c.fetchSubAccounts(o,a,e);if(v.error){return i({error:n(v.error),code:t(null===(m=v.error)||void 0===m?void 0:m.code),severity:r.ERROR})}{const o=Object.assign({},v.page_info);p({subAccounts:(null===(u=v.data)||void 0===u?void 0:u.map((o=>new s(o))))||[],pagingInfo:o})}}catch(o){const s=t(null==o?void 0:o.code);return i({error:o.message||o,code:s,severity:r.ERROR})}};export{c as S,e as m}
@@ -1 +1 @@
1
- import{A as e}from"./p-C6Jq8YDT.js";import"./p-Dqxyi-uK.js";import"./p-CLHwhyvu.js";import"./p-CTtGaVYs.js";const n=e();class r{async fetchTerminals(e,r,s){return n.get({endpoint:"terminals",params:s,headers:{Account:e},authToken:r})}async fetchTerminal(e,r){return n.get({endpoint:`terminals/${e}`,authToken:r})}async fetchTerminalModels(e,r){return n.get({endpoint:"terminals/order_models",headers:{"sub-account":e},authToken:r})}async orderTerminals(e,r){return n.post({endpoint:"terminals/orders",body:r,headers:{"sub-account":r.sub_account_id},authToken:e})}}export{r as T}
1
+ import{A as e}from"./p-DCpGH4xL.js";import"./p-Dqxyi-uK.js";import"./p-CLHwhyvu.js";import"./p-CTtGaVYs.js";const n=e();class r{async fetchTerminals(e,r,s){return n.get({endpoint:"terminals",params:s,headers:{Account:e},authToken:r})}async fetchTerminal(e,r){return n.get({endpoint:`terminals/${e}`,authToken:r})}async fetchTerminalModels(e,r){return n.get({endpoint:"terminals/order_models",headers:{"sub-account":e},authToken:r})}async orderTerminals(e,r){return n.post({endpoint:"terminals/orders",body:r,headers:{"sub-account":r.sub_account_id},authToken:e})}}export{r as T}
@@ -1 +1 @@
1
- import{p as t}from"./p-BC9n8nB2.js";import{A as s}from"./p-C6Jq8YDT.js";import"./p-Dqxyi-uK.js";import"./p-CLHwhyvu.js";import"./p-CTtGaVYs.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-DhrQechy.js";import{A as s}from"./p-DCpGH4xL.js";import"./p-Dqxyi-uK.js";import"./p-CLHwhyvu.js";import"./p-CTtGaVYs.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 n}from"./p-C6Jq8YDT.js";import"./p-Dqxyi-uK.js";import"./p-CLHwhyvu.js";import"./p-CTtGaVYs.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
+ import{A as n}from"./p-DCpGH4xL.js";import"./p-Dqxyi-uK.js";import"./p-CLHwhyvu.js";import"./p-CTtGaVYs.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`,p={public_token:a};return e&&(p.link_token_id=e),o&&(p.payment_method_group_id=o),t.post({endpoint:c,body:p,authToken:n,signal:s})}}export{i as P}
@@ -1 +1 @@
1
- import{A as t}from"./p-C6Jq8YDT.js";import"./p-Dqxyi-uK.js";import"./p-CLHwhyvu.js";import"./p-CTtGaVYs.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
+ import{A as t}from"./p-DCpGH4xL.js";import"./p-Dqxyi-uK.js";import"./p-CLHwhyvu.js";import"./p-CTtGaVYs.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}
@@ -0,0 +1 @@
1
+ import{S as e}from"./p-CTtGaVYs.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"}],t=/^([ABCEGHJKLMNPRSTVXY]\d[A-Z] \d[A-Z]\d|\d{5}(-\d{4})?)$/i,l=/^[A-Z]\d[A-Z]/,i=e=>{if(!e)return e;const a=e.toUpperCase();if(!l.test(a))return a;const t=a.replace(/[\s-]/g,"");return t.length>3?`${t.slice(0,3)} ${t.slice(3)}`:t},s={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."}},o=[{label:"Choose province / state",value:""},...a.filter((e=>""!==e.value)),...e.filter((e=>""!==e.value))],n={USA:{stateOptions:e},CAN:{stateOptions:o}},r={USA:{postalRegex:/^\d{5}(-\d{4})?$/,identityDigits:9,taxIdDigits:9},CAN:{postalRegex:t,identityDigits:9,taxIdDigits:9}};export{t as C,a as P,r as a,n as b,s as c,i as n}