@justifi/webcomponents 6.14.5 → 6.14.6

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 (201) hide show
  1. package/dist/cjs/{Analytics-BVHauOC2.js → Analytics-Cze-FdF4.js} +3 -3
  2. package/dist/cjs/{Api-BzB0rppJ.js → Api-DXk5kyJo.js} +1 -1
  3. package/dist/cjs/{Business-oBifyXkW.js → Business-CNaz-VLa.js} +5 -1
  4. package/dist/cjs/additional-questions-form-step_15.cjs.entry.js +10 -10
  5. package/dist/cjs/additional-questions_4.cjs.entry.js +3 -3
  6. package/dist/cjs/bank-account-billing-form-simple_4.cjs.entry.js +4 -4
  7. package/dist/cjs/bank-account-document-form-inputs.cjs.entry.js +1 -1
  8. package/dist/cjs/bank-account-form.cjs.entry.js +3 -3
  9. package/dist/cjs/{business-form-options-CnlrfbQ6.js → business-form-options-BHBs_yiK.js} +1 -1
  10. package/dist/cjs/{business-identity-schema-hpDJFnB4.js → business-identity-schema-BEMy_JIU.js} +3 -3
  11. package/dist/cjs/{business.service-j_VDzA2-.js → business.service-p2Bqafkw.js} +2 -2
  12. package/dist/cjs/card-form.cjs.entry.js +3 -3
  13. package/dist/cjs/{check-pkg-version-JMiLuNXu.js → check-pkg-version-BXCrlgK8.js} +1 -1
  14. package/dist/cjs/{checkout.service-0vHtBDZY.js → checkout.service-BIju-7Ws.js} +2 -2
  15. package/dist/cjs/{country-config-C1bWmF8P.js → country-config-DQQujh5h.js} +1 -1
  16. package/dist/cjs/dispute-notification_2.cjs.entry.js +6 -6
  17. package/dist/cjs/{event-types-CMpeGHw8.js → event-types-uuCyUwjx.js} +2 -2
  18. package/dist/cjs/form-address-fields_3.cjs.entry.js +2 -2
  19. package/dist/cjs/form-alert_3.cjs.entry.js +1 -1
  20. package/dist/cjs/form-control-number_2.cjs.entry.js +4 -4
  21. package/dist/cjs/{get-business-BBDsPv-b.js → get-business-CfD1erNM.js} +1 -1
  22. package/dist/cjs/{get-payment-details-BYZeUFAB.js → get-payment-details-CFtBV14o.js} +1 -1
  23. package/dist/cjs/{get-subaccounts-B7e8Eovg.js → get-subaccounts-BujVf5t4.js} +2 -2
  24. package/dist/cjs/{input-handlers-_51J5q7J.js → input-handlers-v9h_2Ysi.js} +1 -1
  25. package/dist/cjs/justifi-apple-pay_11.cjs.entry.js +7 -7
  26. package/dist/cjs/justifi-bank-account-billing-form-simple.cjs.entry.js +5 -5
  27. package/dist/cjs/justifi-bank-account-form.cjs.entry.js +5 -5
  28. package/dist/cjs/justifi-business-details.cjs.entry.js +7 -7
  29. package/dist/cjs/justifi-business-form.cjs.entry.js +10 -10
  30. package/dist/cjs/justifi-card-form.cjs.entry.js +5 -5
  31. package/dist/cjs/justifi-checkout-qr-code.cjs.entry.js +5 -5
  32. package/dist/cjs/justifi-checkout.cjs.entry.js +5 -5
  33. package/dist/cjs/justifi-checkouts-list-filters.cjs.entry.js +1 -1
  34. package/dist/cjs/justifi-checkouts-list.cjs.entry.js +7 -7
  35. package/dist/cjs/justifi-dispute-management.cjs.entry.js +6 -6
  36. package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +5 -5
  37. package/dist/cjs/justifi-order-terminals.cjs.entry.js +8 -8
  38. package/dist/cjs/justifi-payment-details.cjs.entry.js +7 -7
  39. package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +6 -6
  40. package/dist/cjs/justifi-payment-transactions-list.cjs.entry.js +6 -6
  41. package/dist/cjs/justifi-payments-list.cjs.entry.js +6 -6
  42. package/dist/cjs/justifi-payout-details.cjs.entry.js +6 -6
  43. package/dist/cjs/justifi-payout-transactions-list.cjs.entry.js +6 -6
  44. package/dist/cjs/justifi-payouts-list-filters.cjs.entry.js +1 -1
  45. package/dist/cjs/justifi-payouts-list.cjs.entry.js +7 -7
  46. package/dist/cjs/justifi-qr-terminal.cjs.entry.js +6 -6
  47. package/dist/cjs/justifi-refund-payment.cjs.entry.js +7 -7
  48. package/dist/cjs/justifi-season-interruption-insurance.cjs.entry.js +5 -5
  49. package/dist/cjs/justifi-terminal-orders-list-filters.cjs.entry.js +1 -1
  50. package/dist/cjs/justifi-terminal-orders-list.cjs.entry.js +5 -5
  51. package/dist/cjs/justifi-terminals-list-filters.cjs.entry.js +1 -1
  52. package/dist/cjs/justifi-terminals-list.cjs.entry.js +7 -7
  53. package/dist/cjs/{package-DfdMLmz7.js → package-B0FHC7k4.js} +1 -1
  54. package/dist/cjs/payment-provisioning-form-buttons_2.cjs.entry.js +1 -1
  55. package/dist/cjs/{payment.service-Bs3HJ4Kv.js → payment.service-CyxLhEAB.js} +2 -2
  56. package/dist/cjs/{payout.service-DNWZxt3R.js → payout.service-unqj9jXy.js} +2 -2
  57. package/dist/cjs/{plaid.service-B_YQGBoC.js → plaid.service-BPhDklM3.js} +2 -2
  58. package/dist/cjs/{schema-validations-DehT309E.js → schema-validations-BKj8elpB.js} +3 -3
  59. package/dist/cjs/{terminal.service-CvFZEemr.js → terminal.service-Dd23PPNj.js} +2 -2
  60. package/dist/collection/api/Business.js +2 -0
  61. package/dist/collection/components/business-forms/utils/helpers.js +3 -1
  62. package/dist/docs.json +1 -1
  63. package/dist/esm/{Analytics-Dgz_MQ1D.js → Analytics-CBMjkdEf.js} +3 -3
  64. package/dist/esm/{Api-DScockhO.js → Api-DE9HFh_l.js} +1 -1
  65. package/dist/esm/{Business-DaDqgDrb.js → Business-CTtGaVYs.js} +5 -1
  66. package/dist/esm/additional-questions-form-step_15.entry.js +10 -10
  67. package/dist/esm/additional-questions_4.entry.js +3 -3
  68. package/dist/esm/bank-account-billing-form-simple_4.entry.js +4 -4
  69. package/dist/esm/bank-account-document-form-inputs.entry.js +1 -1
  70. package/dist/esm/bank-account-form.entry.js +3 -3
  71. package/dist/esm/{business-form-options-BxVQL9ar.js → business-form-options-DLRkVtee.js} +1 -1
  72. package/dist/esm/{business-identity-schema-BkmRlnQo.js → business-identity-schema-XbOMTfjZ.js} +3 -3
  73. package/dist/esm/{business.service-DR2ldRqG.js → business.service-CSNn9LiK.js} +2 -2
  74. package/dist/esm/card-form.entry.js +3 -3
  75. package/dist/esm/{check-pkg-version-CPMg0K2m.js → check-pkg-version-CgeoL5yv.js} +1 -1
  76. package/dist/esm/{checkout.service-CU4BnB34.js → checkout.service-wTPILlzF.js} +2 -2
  77. package/dist/esm/{country-config-CJwnhkdq.js → country-config-F5YwgHgR.js} +1 -1
  78. package/dist/esm/dispute-notification_2.entry.js +6 -6
  79. package/dist/esm/{event-types-BNfdthYa.js → event-types-BSvbjTX_.js} +2 -2
  80. package/dist/esm/form-address-fields_3.entry.js +2 -2
  81. package/dist/esm/form-alert_3.entry.js +1 -1
  82. package/dist/esm/form-control-number_2.entry.js +4 -4
  83. package/dist/esm/{get-business-BSyOONF0.js → get-business-Cd50muQY.js} +1 -1
  84. package/dist/esm/{get-payment-details-CoGzqJ6o.js → get-payment-details-DPz_PR2P.js} +1 -1
  85. package/dist/esm/{get-subaccounts-BraeNX17.js → get-subaccounts-D_TjvZR0.js} +2 -2
  86. package/dist/esm/{input-handlers-Dfuc6aDW.js → input-handlers-Dm8jO-BT.js} +1 -1
  87. package/dist/esm/justifi-apple-pay_11.entry.js +7 -7
  88. package/dist/esm/justifi-bank-account-billing-form-simple.entry.js +5 -5
  89. package/dist/esm/justifi-bank-account-form.entry.js +5 -5
  90. package/dist/esm/justifi-business-details.entry.js +7 -7
  91. package/dist/esm/justifi-business-form.entry.js +10 -10
  92. package/dist/esm/justifi-card-form.entry.js +5 -5
  93. package/dist/esm/justifi-checkout-qr-code.entry.js +5 -5
  94. package/dist/esm/justifi-checkout.entry.js +5 -5
  95. package/dist/esm/justifi-checkouts-list-filters.entry.js +1 -1
  96. package/dist/esm/justifi-checkouts-list.entry.js +7 -7
  97. package/dist/esm/justifi-dispute-management.entry.js +6 -6
  98. package/dist/esm/justifi-gross-payment-chart.entry.js +5 -5
  99. package/dist/esm/justifi-order-terminals.entry.js +8 -8
  100. package/dist/esm/justifi-payment-details.entry.js +7 -7
  101. package/dist/esm/justifi-payment-provisioning.entry.js +6 -6
  102. package/dist/esm/justifi-payment-transactions-list.entry.js +6 -6
  103. package/dist/esm/justifi-payments-list.entry.js +6 -6
  104. package/dist/esm/justifi-payout-details.entry.js +6 -6
  105. package/dist/esm/justifi-payout-transactions-list.entry.js +6 -6
  106. package/dist/esm/justifi-payouts-list-filters.entry.js +1 -1
  107. package/dist/esm/justifi-payouts-list.entry.js +7 -7
  108. package/dist/esm/justifi-qr-terminal.entry.js +6 -6
  109. package/dist/esm/justifi-refund-payment.entry.js +7 -7
  110. package/dist/esm/justifi-season-interruption-insurance.entry.js +5 -5
  111. package/dist/esm/justifi-terminal-orders-list-filters.entry.js +1 -1
  112. package/dist/esm/justifi-terminal-orders-list.entry.js +5 -5
  113. package/dist/esm/justifi-terminals-list-filters.entry.js +1 -1
  114. package/dist/esm/justifi-terminals-list.entry.js +7 -7
  115. package/dist/esm/{package-CiypNylL.js → package-ryeG8Qmw.js} +1 -1
  116. package/dist/esm/payment-provisioning-form-buttons_2.entry.js +1 -1
  117. package/dist/esm/{payment.service-BxBf9T-D.js → payment.service-CnNrx2S_.js} +2 -2
  118. package/dist/esm/{payout.service-DKe3_O4y.js → payout.service-5QFemCmP.js} +2 -2
  119. package/dist/esm/{plaid.service-DwWljJOH.js → plaid.service-4dApvBdO.js} +2 -2
  120. package/dist/esm/{schema-validations-8dbMCACI.js → schema-validations-CQ-xcOYf.js} +3 -3
  121. package/dist/esm/{terminal.service-Q4KXLOka.js → terminal.service-999VOiBJ.js} +2 -2
  122. package/dist/module/Business.js +5 -1
  123. package/dist/module/package.js +1 -1
  124. package/dist/types/api/Business.d.ts +2 -0
  125. package/dist/webcomponents/{p-373586db.entry.js → p-036c9210.entry.js} +1 -1
  126. package/dist/webcomponents/{p-e7909732.entry.js → p-05214ff6.entry.js} +1 -1
  127. package/dist/webcomponents/{p-a47854b9.entry.js → p-054ad143.entry.js} +1 -1
  128. package/dist/webcomponents/{p-15934f30.entry.js → p-063c7bfb.entry.js} +1 -1
  129. package/dist/webcomponents/{p-6f34fa90.entry.js → p-0bb43df1.entry.js} +1 -1
  130. package/dist/webcomponents/{p-537ea763.entry.js → p-0bd830c7.entry.js} +1 -1
  131. package/dist/webcomponents/{p-f8f01bbb.entry.js → p-0e861550.entry.js} +1 -1
  132. package/dist/webcomponents/{p-bf3866b3.entry.js → p-16261d8a.entry.js} +1 -1
  133. package/dist/webcomponents/p-26WAmgkZ.js +1 -0
  134. package/dist/webcomponents/p-4731cdcc.entry.js +1 -0
  135. package/dist/webcomponents/{p-b9316945.entry.js → p-496a28c0.entry.js} +1 -1
  136. package/dist/webcomponents/{p-51714ea9.entry.js → p-4a8270e5.entry.js} +1 -1
  137. package/dist/webcomponents/p-4be1497f.entry.js +1 -0
  138. package/dist/webcomponents/{p-04153e8c.entry.js → p-4cac605d.entry.js} +1 -1
  139. package/dist/webcomponents/{p-d57ae599.entry.js → p-4d81586c.entry.js} +1 -1
  140. package/dist/webcomponents/{p-f6b900f4.entry.js → p-50590d46.entry.js} +1 -1
  141. package/dist/webcomponents/{p-1cdbe8c1.entry.js → p-5c889829.entry.js} +1 -1
  142. package/dist/webcomponents/p-5d6e02a0.entry.js +1 -0
  143. package/dist/webcomponents/p-5de57f37.entry.js +1 -0
  144. package/dist/webcomponents/{p-9b758a11.entry.js → p-5e426c59.entry.js} +1 -1
  145. package/dist/webcomponents/{p-e954f46c.entry.js → p-9c9d8aac.entry.js} +1 -1
  146. package/dist/webcomponents/p-9d29eec9.entry.js +1 -0
  147. package/dist/webcomponents/p-9vgW3EzU.js +1 -0
  148. package/dist/webcomponents/p-BT5xuVdM.js +1 -0
  149. package/dist/webcomponents/{p-CnHbIkmu.js → p-C42DoBRr.js} +1 -1
  150. package/dist/webcomponents/p-CTtGaVYs.js +1 -0
  151. package/dist/webcomponents/p-CgOgijHy.js +1 -0
  152. package/dist/webcomponents/{p-C8g8unYJ.js → p-CrvxQRNt.js} +1 -1
  153. package/dist/webcomponents/{p-OReJ-ZQb.js → p-CtlBL-X6.js} +1 -1
  154. package/dist/webcomponents/{p-CnDagPty.js → p-DNZxGLlV.js} +1 -1
  155. package/dist/webcomponents/p-DX2Fz9jh.js +1 -0
  156. package/dist/webcomponents/{p-DcA_wt-j.js → p-DfTbkDwg.js} +1 -1
  157. package/dist/webcomponents/p-DiT4LMeE.js +1 -0
  158. package/dist/webcomponents/{p-BEOJqK7T.js → p-QSBZ8Y8q.js} +1 -1
  159. package/dist/webcomponents/{p-CbyGKcz_.js → p-RoSunhgN.js} +1 -1
  160. package/dist/webcomponents/{p-f8cff289.entry.js → p-a9f712b0.entry.js} +1 -1
  161. package/dist/webcomponents/{p-6884fa3d.entry.js → p-afe4e737.entry.js} +1 -1
  162. package/dist/webcomponents/p-ba212488.entry.js +1 -0
  163. package/dist/webcomponents/{p-29f68bd0.entry.js → p-bb47cd78.entry.js} +1 -1
  164. package/dist/webcomponents/{p-3ef039ec.entry.js → p-ce0233f7.entry.js} +1 -1
  165. package/dist/webcomponents/{p-0d9022e5.entry.js → p-cf30ad07.entry.js} +1 -1
  166. package/dist/webcomponents/{p-387aba3d.entry.js → p-d49883fc.entry.js} +1 -1
  167. package/dist/webcomponents/p-d4dce838.entry.js +1 -0
  168. package/dist/webcomponents/{p-3870712e.entry.js → p-dad34b71.entry.js} +3 -3
  169. package/dist/webcomponents/{p-c14dde7c.entry.js → p-e183a0a7.entry.js} +1 -1
  170. package/dist/webcomponents/{p-9c506058.entry.js → p-e63b8493.entry.js} +1 -1
  171. package/dist/webcomponents/{p-b9b5d046.entry.js → p-e7209af7.entry.js} +1 -1
  172. package/dist/webcomponents/{p-49e40ebe.entry.js → p-ea05061f.entry.js} +1 -1
  173. package/dist/webcomponents/{p-b945fa49.entry.js → p-ea4b81fb.entry.js} +1 -1
  174. package/dist/webcomponents/{p-027ef7e9.entry.js → p-f00a93e0.entry.js} +1 -1
  175. package/dist/webcomponents/{p-543fcff2.entry.js → p-f047ede0.entry.js} +1 -1
  176. package/dist/webcomponents/{p-25d24964.entry.js → p-fb74abab.entry.js} +1 -1
  177. package/dist/webcomponents/{p-2128265d.entry.js → p-fdd238f1.entry.js} +1 -1
  178. package/dist/webcomponents/p-fxlKlc2W.js +1 -0
  179. package/dist/webcomponents/{p-WnMmPpEb.js → p-i45EJXKs.js} +1 -1
  180. package/dist/webcomponents/{p-rIJv0FaI.js → p-j9aA2OuG.js} +1 -1
  181. package/dist/webcomponents/{p-CawcnSoV.js → p-riZDHN5-.js} +1 -1
  182. package/dist/webcomponents/p-ryeG8Qmw.js +1 -0
  183. package/dist/webcomponents/{p-CMvr3y5s.js → p-y82vVQVM.js} +1 -1
  184. package/dist/webcomponents/webcomponents.esm.js +1 -1
  185. package/package.json +1 -1
  186. package/dist/webcomponents/p-0fe976d6.entry.js +0 -1
  187. package/dist/webcomponents/p-21a5c3d8.entry.js +0 -1
  188. package/dist/webcomponents/p-3086ee7a.entry.js +0 -1
  189. package/dist/webcomponents/p-BL112JyU.js +0 -1
  190. package/dist/webcomponents/p-BlqdDtQr.js +0 -1
  191. package/dist/webcomponents/p-C0w_sG9P.js +0 -1
  192. package/dist/webcomponents/p-CaLXuYmg.js +0 -1
  193. package/dist/webcomponents/p-CiypNylL.js +0 -1
  194. package/dist/webcomponents/p-DNuxxP2B.js +0 -1
  195. package/dist/webcomponents/p-DaDqgDrb.js +0 -1
  196. package/dist/webcomponents/p-Do9dxNjh.js +0 -1
  197. package/dist/webcomponents/p-H4vl65HO.js +0 -1
  198. package/dist/webcomponents/p-b17fabdc.entry.js +0 -1
  199. package/dist/webcomponents/p-c0bd4006.entry.js +0 -1
  200. package/dist/webcomponents/p-c5560a87.entry.js +0 -1
  201. package/dist/webcomponents/p-cc5a97a0.entry.js +0 -1
@@ -141,6 +141,7 @@ export interface IBusiness {
141
141
  phone: string;
142
142
  platform_account_id: string;
143
143
  product_categories: ProductCategories;
144
+ provisioned?: string[];
144
145
  representative?: Identity | null;
145
146
  tax_id: string;
146
147
  tax_id_last4: string;
@@ -178,6 +179,7 @@ export declare class Business implements IBusiness {
178
179
  product_categories: ProductCategories;
179
180
  country_of_establishment?: CountryCode;
180
181
  bank_account_verification?: boolean;
182
+ provisioned: string[];
181
183
  constructor(business: IBusiness);
182
184
  get payload(): {
183
185
  tax_id_last4: string;
@@ -1 +1 @@
1
- import{h as t,r as e,c as s}from"./p-CV0Pyo1O.js";import"./p-B4vLfYnZ.js";import"./p-HXpYMWUU.js";import{m as a,C as i,b as o}from"./p-8fO8CrtQ.js";import{p as r}from"./p-CLHwhyvu.js";import"./p-DaDqgDrb.js";import{g as c,a as h}from"./p-D1H6VUbM.js";import{c as n}from"./p-DcA_wt-j.js";import{J as d}from"./p-C8g8unYJ.js";import{C as p}from"./p-BlqdDtQr.js";import{m as u,S as m}from"./p-C0w_sG9P.js";import{S as b}from"./p-05AWudQe.js";import{T as f,a as l,b as y,c as g,d as k,e as j,f as v,g as C,h as _,i as w,j as T,k as P,l as S}from"./p-DZr0wLGh.js";import{T as D}from"./p-CZfYo5-1.js";import{d as A,b as O}from"./p-Ds_P-dB8.js";import{B as x,a as I}from"./p-Dz8KJn2G.js";import{a6 as E,a7 as G}from"./p-Bu7gdOaV.js";import{o as L,g as M}from"./p-CArdj6i_.js";import"./p-DgTOxu8x.js";import"./p-CiypNylL.js";import"./p-WnMmPpEb.js";import"./p-MPer3Rw7.js";const B={created_at:()=>t("th",{part:E,scope:"col",title:"The date each checkout occurred"},"Processed On"),payment_amount:()=>t("th",{part:E,scope:"col",title:"The dollar amount of each checkout"},"Payment Amount"),payment_description:()=>t("th",{part:E,scope:"col",title:"The description of each checkout"},"Payment Description"),sub_account_name:()=>t("th",{part:E,scope:"col",title:"The sub account associated with the checkout"},"Sub Account"),payment_mode:()=>t("th",{part:E,scope:"col",title:"The payment mode of each checkout"},"Payment Mode"),status:()=>t("th",{part:E,scope:"col",title:"The current status of each checkout"},"Status")},z={created_at:(e,s)=>t("td",{part:G(s)},t("div",{class:"fw-bold"},O(e.created_at)),t("div",{class:"fw-bold"},A(e.created_at))),payment_amount:(e,s)=>t("td",{part:G(s)},e.formattedPaymentAmount(e.payment_amount)),payment_description:(e,s)=>t("td",{part:G(s)},e.payment_description),sub_account_name:(e,s)=>t("td",{part:G(s)},e.sub_account_name),payment_mode:(e,s)=>t("td",{part:G(s)},e.payment_mode),status:(e,s)=>t("td",{part:G(s)},t(I,Object.assign({},{created:{variant:x.PRIMARY,title:"The checkout has been created",text:"Created"},completed:{variant:x.SUCCESS,title:"The checkout has been completed",text:"Completed"},attempted:{variant:x.SECONDARY,title:"The checkout has been attempted",text:"Attempted"},expired:{variant:x.DANGER,title:"The checkout has expired",text:"Expired"}}[e.status])))},W=class{constructor(t){e(this,t),this.clickEvent=s(this,"click-event",7),this.errorEvent=s(this,"error-event",7),this.columns="created_at,payment_amount,payment_description,payment_mode,status",this.checkouts=[],this.subAccounts=[],this.loading=!0,this.paging=r,this.pagingParams={},this.handleClickPrevious=t=>{this.pagingParams={before_cursor:t},this.clickEvent.emit({name:D.previous})},this.handleClickNext=t=>{this.pagingParams={after_cursor:t},this.clickEvent.emit({name:D.next})},this.rowClickHandler=t=>{const e=t.target.closest("tr").dataset.rowEntityId;if(!e)return;const s=this.checkouts.find((t=>t.id===e));this.clickEvent.emit({name:D.row,data:s})}}componentWillLoad(){n(),this.analytics=new d(this),this.checkoutsTable=new f(this.checkouts,this.columns,B,z),this.initializeGetData(),this.getCheckouts&&this.fetchData(),L("set",(()=>{this.pagingParams={}})),L("reset",(()=>{this.pagingParams={},this.errorMessage=""}))}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}authPropChanged(){this.initializeGetData(),this.getCheckouts&&this.fetchData()}pagingOrColumnsChanged(){this.getCheckouts&&this.fetchData()}initializeGetData(){this.initializeGetCheckouts(),this.initializeGetSubAccounts()}initializeGetCheckouts(){const t=this.subAccountId||this.accountId;t&&this.authToken?this.getCheckouts=(({accountId:t,authToken:e,service:s})=>async({params:o,onSuccess:r,onError:n})=>{var d,p;try{const u=await s.fetchCheckouts(t,e,o);if(u.error)return n({error:h(u.error),code:c(null===(p=u.error)||void 0===p?void 0:p.code),severity:i.ERROR});{const t=Object.assign({},u.page_info);r({checkouts:(null===(d=u.data)||void 0===d?void 0:d.map((t=>new a(t))))||[],pagingInfo:t})}}catch(t){const e=c(null==t?void 0:t.code);return n({error:t.message||t,code:e,severity:i.ERROR})}})({accountId:t,authToken:this.authToken,service:new p}):(this.errorMessage="Account ID/Sub Account ID and Auth Token are required",this.errorEvent.emit({errorCode:o.MISSING_PROPS,message:this.errorMessage,severity:i.ERROR}))}initializeGetSubAccounts(){this.accountId&&this.authToken&&(this.getSubAccounts=u({primaryAccountId:this.accountId,authToken:this.authToken,service:new m}))}fetchData(){this.getCheckouts&&(this.loading=!0,this.getCheckouts({params:this.checkoutParams,onSuccess:async({checkouts:t,pagingInfo:e})=>{this.checkouts=t,this.paging=e,this.checkoutsTable.collectionData=this.checkouts,this.checkoutsTable.columnKeys.includes("sub_account_name")?await this.fetchSubAccounts():this.loading=!1},onError:({error:t,code:e,severity:s})=>{this.errorMessage=t,this.errorEvent.emit({errorCode:e,message:t,severity:s}),this.loading=!1}}))}async fetchSubAccounts(){this.getSubAccounts?this.getSubAccounts({params:this.subAccountParams,onSuccess:({subAccounts:t})=>{this.subAccounts=t,this.checkouts=this.checkouts.map((t=>{var e;return t.sub_account_name=null===(e=this.subAccounts.find((e=>e.id===t.account_id)))||void 0===e?void 0:e.name,t})),this.loading=!1},onError:({error:t,code:e,severity:s})=>{this.errorMessage=t,this.errorEvent.emit({errorCode:e,message:t,severity:s}),this.loading=!1}}):this.loading=!1}get checkoutParams(){const t=M();return Object.assign(Object.assign({},t),this.pagingParams)}get subAccountParams(){const t=this.checkouts.map((t=>t.account_id));return{sub_account_id:[...new Set(t)].join(",")}}get entityId(){return this.checkouts.map((t=>t.id))}get showEmptyState(){return!this.loading&&!this.errorMessage&&this.checkoutsTable.rowData.length<1}get showErrorState(){return!this.loading&&!!this.errorMessage}get showRowData(){return!this.showEmptyState&&!this.showErrorState&&!this.loading}render(){return t(b,{key:"882db931e1e29698776ffa6c715ca4abb7d322f7"},t(l,{key:"7bb610f41ae1feab6e4a1cf8abb19fbff00914e6"},t(y,{key:"4ca7ca2a8fcb7b26cd4cdb7679ef7c3db17bb1d1"},t(g,{key:"b2fdd2852c74f066cfdf7aee27148fa36cf5df74"},t(k,{key:"688d8189928c8ee54e6b60383492cdd2e7717fcf"},this.checkoutsTable.columnData.map((t=>t)))),t(j,{key:"0e3e589b387455bdbb30c5130e206c46447d2a43"},t(v,{key:"b0d74610ef26b4b67e1c1a70b93e9932c4d47350",columnSpan:this.checkoutsTable.columnKeys.length,isLoading:this.loading}),t(C,{key:"dfc775ac8f7a47611e740e1e4b7562adfffd15d3",isEmpty:this.showEmptyState,columnSpan:this.checkoutsTable.columnKeys.length}),t(_,{key:"8ba255c49e9ea76d13644b4c5842f9c003816040",columnSpan:this.checkoutsTable.columnKeys.length,errorMessage:this.errorMessage}),this.showRowData&&this.checkoutsTable.rowData.map(((e,s)=>t(w,{"data-test-id":"table-row","data-row-entity-id":this.entityId[s],onClick:this.rowClickHandler},e)))),this.paging&&t(T,{key:"82cf7b391647fdb6cefcbdbe13113ebb6e70bf62"},t(P,{key:"6678e2573867bf3c79f266ebab392034eb143c65"},t(S,{key:"c981a304af815c314e8306922b779cea8670b825",colSpan:this.checkoutsTable.columnData.length},t("pagination-menu",{key:"ea32b8d13a5af7122095fd4081d29668019928ee",paging:Object.assign(Object.assign({},this.paging),{handleClickPrevious:this.handleClickPrevious,handleClickNext:this.handleClickNext})})))))))}static get watchers(){return{accountId:["authPropChanged"],authToken:["authPropChanged"],subAccountId:["authPropChanged"],pagingParams:["pagingOrColumnsChanged"],columns:["pagingOrColumnsChanged"]}}};export{W as justifi_checkouts_list}
1
+ import{h as t,r as e,c as s}from"./p-CV0Pyo1O.js";import"./p-B4vLfYnZ.js";import"./p-HXpYMWUU.js";import{m as a,C as i,b as o}from"./p-8fO8CrtQ.js";import{p as r}from"./p-CLHwhyvu.js";import"./p-CTtGaVYs.js";import{g as c,a as h}from"./p-D1H6VUbM.js";import{c as n}from"./p-DfTbkDwg.js";import{J as d}from"./p-CrvxQRNt.js";import{C as p}from"./p-9vgW3EzU.js";import{m as u,S as m}from"./p-26WAmgkZ.js";import{S as b}from"./p-05AWudQe.js";import{T as f,a as l,b as y,c as g,d as k,e as v,f as j,g as C,h as _,i as w,j as T,k as S,l as A}from"./p-DZr0wLGh.js";import{T as P}from"./p-CZfYo5-1.js";import{d as O,b as D}from"./p-Ds_P-dB8.js";import{B as x,a as I}from"./p-Dz8KJn2G.js";import{a6 as E,a7 as G}from"./p-Bu7gdOaV.js";import{o as z,g as L}from"./p-CArdj6i_.js";import"./p-DgTOxu8x.js";import"./p-ryeG8Qmw.js";import"./p-i45EJXKs.js";import"./p-MPer3Rw7.js";const M={created_at:()=>t("th",{part:E,scope:"col",title:"The date each checkout occurred"},"Processed On"),payment_amount:()=>t("th",{part:E,scope:"col",title:"The dollar amount of each checkout"},"Payment Amount"),payment_description:()=>t("th",{part:E,scope:"col",title:"The description of each checkout"},"Payment Description"),sub_account_name:()=>t("th",{part:E,scope:"col",title:"The sub account associated with the checkout"},"Sub Account"),payment_mode:()=>t("th",{part:E,scope:"col",title:"The payment mode of each checkout"},"Payment Mode"),status:()=>t("th",{part:E,scope:"col",title:"The current status of each checkout"},"Status")},W={created_at:(e,s)=>t("td",{part:G(s)},t("div",{class:"fw-bold"},D(e.created_at)),t("div",{class:"fw-bold"},O(e.created_at))),payment_amount:(e,s)=>t("td",{part:G(s)},e.formattedPaymentAmount(e.payment_amount)),payment_description:(e,s)=>t("td",{part:G(s)},e.payment_description),sub_account_name:(e,s)=>t("td",{part:G(s)},e.sub_account_name),payment_mode:(e,s)=>t("td",{part:G(s)},e.payment_mode),status:(e,s)=>t("td",{part:G(s)},t(I,Object.assign({},{created:{variant:x.PRIMARY,title:"The checkout has been created",text:"Created"},completed:{variant:x.SUCCESS,title:"The checkout has been completed",text:"Completed"},attempted:{variant:x.SECONDARY,title:"The checkout has been attempted",text:"Attempted"},expired:{variant:x.DANGER,title:"The checkout has expired",text:"Expired"}}[e.status])))},B=class{constructor(t){e(this,t),this.clickEvent=s(this,"click-event",7),this.errorEvent=s(this,"error-event",7),this.columns="created_at,payment_amount,payment_description,payment_mode,status",this.checkouts=[],this.subAccounts=[],this.loading=!0,this.paging=r,this.pagingParams={},this.handleClickPrevious=t=>{this.pagingParams={before_cursor:t},this.clickEvent.emit({name:P.previous})},this.handleClickNext=t=>{this.pagingParams={after_cursor:t},this.clickEvent.emit({name:P.next})},this.rowClickHandler=t=>{const e=t.target.closest("tr").dataset.rowEntityId;if(!e)return;const s=this.checkouts.find((t=>t.id===e));this.clickEvent.emit({name:P.row,data:s})}}componentWillLoad(){n(),this.analytics=new d(this),this.checkoutsTable=new f(this.checkouts,this.columns,M,W),this.initializeGetData(),this.getCheckouts&&this.fetchData(),z("set",(()=>{this.pagingParams={}})),z("reset",(()=>{this.pagingParams={},this.errorMessage=""}))}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}authPropChanged(){this.initializeGetData(),this.getCheckouts&&this.fetchData()}pagingOrColumnsChanged(){this.getCheckouts&&this.fetchData()}initializeGetData(){this.initializeGetCheckouts(),this.initializeGetSubAccounts()}initializeGetCheckouts(){const t=this.subAccountId||this.accountId;t&&this.authToken?this.getCheckouts=(({accountId:t,authToken:e,service:s})=>async({params:o,onSuccess:r,onError:n})=>{var d,p;try{const u=await s.fetchCheckouts(t,e,o);if(u.error)return n({error:h(u.error),code:c(null===(p=u.error)||void 0===p?void 0:p.code),severity:i.ERROR});{const t=Object.assign({},u.page_info);r({checkouts:(null===(d=u.data)||void 0===d?void 0:d.map((t=>new a(t))))||[],pagingInfo:t})}}catch(t){const e=c(null==t?void 0:t.code);return n({error:t.message||t,code:e,severity:i.ERROR})}})({accountId:t,authToken:this.authToken,service:new p}):(this.errorMessage="Account ID/Sub Account ID and Auth Token are required",this.errorEvent.emit({errorCode:o.MISSING_PROPS,message:this.errorMessage,severity:i.ERROR}))}initializeGetSubAccounts(){this.accountId&&this.authToken&&(this.getSubAccounts=u({primaryAccountId:this.accountId,authToken:this.authToken,service:new m}))}fetchData(){this.getCheckouts&&(this.loading=!0,this.getCheckouts({params:this.checkoutParams,onSuccess:async({checkouts:t,pagingInfo:e})=>{this.checkouts=t,this.paging=e,this.checkoutsTable.collectionData=this.checkouts,this.checkoutsTable.columnKeys.includes("sub_account_name")?await this.fetchSubAccounts():this.loading=!1},onError:({error:t,code:e,severity:s})=>{this.errorMessage=t,this.errorEvent.emit({errorCode:e,message:t,severity:s}),this.loading=!1}}))}async fetchSubAccounts(){this.getSubAccounts?this.getSubAccounts({params:this.subAccountParams,onSuccess:({subAccounts:t})=>{this.subAccounts=t,this.checkouts=this.checkouts.map((t=>{var e;return t.sub_account_name=null===(e=this.subAccounts.find((e=>e.id===t.account_id)))||void 0===e?void 0:e.name,t})),this.loading=!1},onError:({error:t,code:e,severity:s})=>{this.errorMessage=t,this.errorEvent.emit({errorCode:e,message:t,severity:s}),this.loading=!1}}):this.loading=!1}get checkoutParams(){const t=L();return Object.assign(Object.assign({},t),this.pagingParams)}get subAccountParams(){const t=this.checkouts.map((t=>t.account_id));return{sub_account_id:[...new Set(t)].join(",")}}get entityId(){return this.checkouts.map((t=>t.id))}get showEmptyState(){return!this.loading&&!this.errorMessage&&this.checkoutsTable.rowData.length<1}get showErrorState(){return!this.loading&&!!this.errorMessage}get showRowData(){return!this.showEmptyState&&!this.showErrorState&&!this.loading}render(){return t(b,{key:"882db931e1e29698776ffa6c715ca4abb7d322f7"},t(l,{key:"7bb610f41ae1feab6e4a1cf8abb19fbff00914e6"},t(y,{key:"4ca7ca2a8fcb7b26cd4cdb7679ef7c3db17bb1d1"},t(g,{key:"b2fdd2852c74f066cfdf7aee27148fa36cf5df74"},t(k,{key:"688d8189928c8ee54e6b60383492cdd2e7717fcf"},this.checkoutsTable.columnData.map((t=>t)))),t(v,{key:"0e3e589b387455bdbb30c5130e206c46447d2a43"},t(j,{key:"b0d74610ef26b4b67e1c1a70b93e9932c4d47350",columnSpan:this.checkoutsTable.columnKeys.length,isLoading:this.loading}),t(C,{key:"dfc775ac8f7a47611e740e1e4b7562adfffd15d3",isEmpty:this.showEmptyState,columnSpan:this.checkoutsTable.columnKeys.length}),t(_,{key:"8ba255c49e9ea76d13644b4c5842f9c003816040",columnSpan:this.checkoutsTable.columnKeys.length,errorMessage:this.errorMessage}),this.showRowData&&this.checkoutsTable.rowData.map(((e,s)=>t(w,{"data-test-id":"table-row","data-row-entity-id":this.entityId[s],onClick:this.rowClickHandler},e)))),this.paging&&t(T,{key:"82cf7b391647fdb6cefcbdbe13113ebb6e70bf62"},t(S,{key:"6678e2573867bf3c79f266ebab392034eb143c65"},t(A,{key:"c981a304af815c314e8306922b779cea8670b825",colSpan:this.checkoutsTable.columnData.length},t("pagination-menu",{key:"ea32b8d13a5af7122095fd4081d29668019928ee",paging:Object.assign(Object.assign({},this.paging),{handleClickPrevious:this.handleClickPrevious,handleClickNext:this.handleClickNext})})))))))}static get watchers(){return{accountId:["authPropChanged"],authToken:["authPropChanged"],subAccountId:["authPropChanged"],pagingParams:["pagingOrColumnsChanged"],columns:["pagingOrColumnsChanged"]}}};export{B as justifi_checkouts_list}
@@ -1 +1 @@
1
- import{h as s,F as e,r as i,c as t}from"./p-CV0Pyo1O.js";import{E as r}from"./p-Bh6Q8AqQ.js";import{B as a}from"./p-CnHbIkmu.js";import{m as o}from"./p-CMvr3y5s.js";import{C as n,b as l}from"./p-8fO8CrtQ.js";import{J as d}from"./p-C8g8unYJ.js";import{c as p}from"./p-DcA_wt-j.js";import{S as h}from"./p-05AWudQe.js";import"./p-CZfYo5-1.js";import{S as c}from"./p-eBK-iWrz.js";import"./p-Bu7gdOaV.js";import"./p-WnMmPpEb.js";import"./p-B4vLfYnZ.js";import"./p-DgTOxu8x.js";import"./p-Ds_P-dB8.js";import"./p-HXpYMWUU.js";import"./p-CiypNylL.js";import"./p-CLHwhyvu.js";import"./p-DaDqgDrb.js";import"./p-D1H6VUbM.js";const u=()=>{const i=()=>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(i,null),s(i,null),s(i,null),s(i,null))},m=class{constructor(s){i(this,s),this.errorEvent=t(this,"error-event",7),this.loading=!0}componentWillLoad(){p(),this.analytics=new d(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:l.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:i})=>{this.errorMessage=s,this.errorEvent.emit({errorCode:e,message:s,severity:i})},final:()=>{this.loading=!1}})}render(){return s(h,{key:"7ce48e6905cdbbf8f94470913ecfa3ef8dbb76c7"},this.loading&&s(u,{key:"7c3439e0c247436cd7951d3bdc32e7672c9f8447"}),!this.loading&&this.errorMessage&&r(this.errorMessage),!this.loading&&!this.errorMessage&&this.business&&s("justifi-details",{key:"bf57dacf2067f2704014ce3e002958e3306bba73",errorMessage:this.errorMessage},s("div",{key:"46d19a178ba0d33aa21a4f3900128e3e905731a9",slot:"detail-sections"},s("core-info-details",{key:"ac217a4cfe6b45810a85ca320760b7331f76e60b",business:this.business}),s("legal-address-details",{key:"1fc1a196a43bcf5f9eafd09bfe74c8bb7c409797",legalAddress:this.business.legal_address}),s("representative-details",{key:"1e0833606b129f69a05946726172963cbec05189",representative:this.business.representative}),s("owner-details",{key:"c974111dc67a8961ef6435c34843ca927ad8a7e5",owners:this.business.owners}),s("additional-questions-details",{key:"0951d284a373457e98a1dafc80231ec3ee057e0a",additionalQuestions:this.business.additional_questions}))))}static get watchers(){return{businessId:["propChanged"],authToken:["propChanged"],getBusiness:["updateOnPropChange"]}}};export{m as justifi_business_details}
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-C42DoBRr.js";import{m as o}from"./p-y82vVQVM.js";import{C as n,b as l}from"./p-8fO8CrtQ.js";import{J as d}from"./p-CrvxQRNt.js";import{c as h}from"./p-DfTbkDwg.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-i45EJXKs.js";import"./p-B4vLfYnZ.js";import"./p-DgTOxu8x.js";import"./p-Ds_P-dB8.js";import"./p-HXpYMWUU.js";import"./p-ryeG8Qmw.js";import"./p-CLHwhyvu.js";import"./p-CTtGaVYs.js";import"./p-D1H6VUbM.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))},m=class{constructor(s){t(this,s),this.errorEvent=i(this,"error-event",7),this.loading=!0}componentWillLoad(){h(),this.analytics=new d(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:l.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:"7ce48e6905cdbbf8f94470913ecfa3ef8dbb76c7"},this.loading&&s(u,{key:"7c3439e0c247436cd7951d3bdc32e7672c9f8447"}),!this.loading&&this.errorMessage&&r(this.errorMessage),!this.loading&&!this.errorMessage&&this.business&&s("justifi-details",{key:"bf57dacf2067f2704014ce3e002958e3306bba73",errorMessage:this.errorMessage},s("div",{key:"46d19a178ba0d33aa21a4f3900128e3e905731a9",slot:"detail-sections"},s("core-info-details",{key:"ac217a4cfe6b45810a85ca320760b7331f76e60b",business:this.business}),s("legal-address-details",{key:"1fc1a196a43bcf5f9eafd09bfe74c8bb7c409797",legalAddress:this.business.legal_address}),s("representative-details",{key:"1e0833606b129f69a05946726172963cbec05189",representative:this.business.representative}),s("owner-details",{key:"c974111dc67a8961ef6435c34843ca927ad8a7e5",owners:this.business.owners}),s("additional-questions-details",{key:"0951d284a373457e98a1dafc80231ec3ee057e0a",additionalQuestions:this.business.additional_questions}))))}static get watchers(){return{businessId:["propChanged"],authToken:["propChanged"],getBusiness:["updateOnPropChange"]}}};export{m as justifi_business_details}
@@ -1 +1 @@
1
- import{h as e,r as t,c as a}from"./p-CV0Pyo1O.js";import{P as i}from"./p-H4vl65HO.js";import"./p-B4vLfYnZ.js";import"./p-HXpYMWUU.js";import{k as s,C as d,b as o}from"./p-8fO8CrtQ.js";import"./p-CLHwhyvu.js";import"./p-DaDqgDrb.js";import{g as c,a as r}from"./p-D1H6VUbM.js";import{h,b as l,d as b}from"./p-Ds_P-dB8.js";import{a as f,b as n,D as p,c as u,C as v,E as y}from"./p-Bh6Q8AqQ.js";import{J as m}from"./p-C8g8unYJ.js";import{m as k,M as g}from"./p-Co3Rtlnu.js";import{c as j}from"./p-DcA_wt-j.js";import{B as C}from"./p-CU2Dwa94.js";import{S as w}from"./p-05AWudQe.js";import"./p-CZfYo5-1.js";import{S as x}from"./p-eBK-iWrz.js";import{a as D,B as A}from"./p-Dz8KJn2G.js";import"./p-WnMmPpEb.js";import"./p-CiypNylL.js";import"./p-DgTOxu8x.js";import"./p-Bu7gdOaV.js";const T=()=>e("div",{class:"row gap-3"},e("div",{class:"col-12"},e(x,{width:"35%",height:"30px"})),e("div",{class:"col-12"},e(x,{width:"70%"})),e("div",{class:"col-12"},e(x,{width:"40%"})),e("div",{class:"col-12"},e(x,{width:"40%"})),e("div",{class:"col-12"},e(x,{width:"100%"})),e("div",{class:"col-12"},e(x,{width:"80%"}))),S=class{constructor(e){t(this,e),this.errorEvent=a(this,"error-event",7),this.recordClickEvent=a(this,"record-click-event",7),this.enableRecordClick=!1,this.loading=!0,this.errorMessage=null,this.downloadCSV=()=>{this.getPayoutCSV({payoutId:this.payout.id,onError:({error:e,code:t,severity:a})=>{this.errorMessage=e,this.errorEvent.emit({message:e,errorCode:t,severity:a})}})},this.handleRecordClick=e=>{this.recordClickEvent.emit({id:e,type:"account"})}}componentWillLoad(){j(),this.analytics=new m(this),this.initializeServices(),this.getPayout&&this.fetchData()}disconnectedCallback(){var e;null===(e=this.analytics)||void 0===e||e.cleanup()}propChanged(){this.initializeServices()}getPayoutWatcher(){this.fetchData()}initializeServices(){this.payoutId&&this.authToken?(this.getPayout=(({id:e,authToken:t,service:a})=>async({onSuccess:i,onError:o})=>{var h;try{const l=await a.fetchPayout(e,t);l.error?o({error:r(l.error),code:c(null===(h=l.error)||void 0===h?void 0:h.code),severity:d.ERROR}):i(new s(l.data))}catch(e){o({error:r(e),code:c(null==e?void 0:e.code),severity:d.ERROR})}})({id:this.payoutId,authToken:this.authToken,service:new i}),this.getPayoutCSV=k({authToken:this.authToken,service:new i})):(this.errorMessage="Failed to load payout details. payoutId or authToken is not provided.",this.errorEvent.emit({message:this.errorMessage,errorCode:o.MISSING_PROPS,severity:d.ERROR}))}fetchData(){this.loading=!0,this.getPayout({onSuccess:e=>{this.errorMessage=null,this.payout=e,this.loading=!1},onError:({error:e,code:t,severity:a})=>{this.errorMessage=e,this.errorEvent.emit({message:e,errorCode:t,severity:a}),this.loading=!1}})}formatMethod(e){return"ach"===e?"ACH":h(e)}render(){var t,a,i,s;return e(w,{key:"da86ceeb41265056f9bc64c07b3bd7db4a91471c"},this.loading&&e(T,{key:"49ae2848db4a5b59770c2b84bfba745861573a6d"}),!this.loading&&this.errorMessage&&y(this.errorMessage),!this.loading&&this.payout&&e("justifi-details",{key:"b4e6740d49ae1099f28ea3d6f21fe0da48149c71",errorMessage:this.errorMessage},e(f,{key:"e9efbeeb7894996f318d90fb38826a6a9e4cc4b3",slot:"head-info",badge:e("div",{class:"d-flex gap-1"},g(null===(t=this.payout)||void 0===t?void 0:t.status),e(D,"expedited"===this.payout.settlement_priority?{variant:A.WARNING,title:"Expedited",text:"Expedited"}:{variant:A.SECONDARY,title:"Standard",text:"Standard"})),title:this.payout.formattedPaymentAmount(this.payout.amount)},e(n,{key:"feb913d2b90e86fb4f5575379e9b9a47adfa723f",classes:"border-1 border-end",title:"Updated At",value:`${l(this.payout.updated_at)} ${b(this.payout.updated_at)}`}),e(n,{key:"9fe6da08323735948f145a72a02db26a6eb31f02",classes:"border-1 border-end",title:"Created At",value:`${l(this.payout.created_at)} ${b(this.payout.created_at)}`}),e(n,{key:"d01c4b7ea7c966b524026a6e97c0575466de3f74",title:"ID",value:this.payout.id}),e("div",{key:"4c4f73e5898caedbb1b7aba326dbfb0dcfbb59e6",class:"m-4"},e(C,{key:"622a6e8384da37f4bb3896bcafea46ef697b140e",variant:"outline-secondary",class:"btn btn-outline-secondary d-flex align-items-center",onClick:this.downloadCSV},"Export CSV"))),e("div",{key:"9b9271663673dc2e78e89bec5c7c9c47daa6761e",slot:"detail-sections"},e(p,{key:"ac5c6e1c09e63cd0616794b7df367a73889e37b2",sectionTitle:"Details"}),e("div",{key:"95f9d5a0097499fdb24f44ea87313c3b34a96068",class:"d-flex flex-column gap-2 w-100"},e(u,{key:"ecf60d4a4783c8fb52e10222dd4f6e9935cd0910",title:"Date paid",value:l(this.payout.deposits_at)}),e(u,{key:"289971a08641bc2dc725d603ef611291025cd6b4",title:"Statement Description",value:this.payout.description}),e(u,{key:"d237aacbeb9b23ac0d45aa978350aad4824b0695",title:"Payout Method",value:this.formatMethod(this.payout.delivery_method)}),e(u,{key:"744ef2b8878b742483750fb921ca9790f6aa9ec1",title:"Amount",value:this.payout.formattedPaymentAmount(this.payout.amount)}),e(u,{key:"dbf3327510523afc6edd78ea2926f99593da9748",title:"Fee",value:this.payout.formattedPaymentAmount(this.payout.fees_total)})),e(p,{key:"15983342dbe916770291f33226b744e8c4c1129e",sectionTitle:"Account"}),e("div",{key:"b3fb4353794dc490633a14abcc829ff0835d989f",class:"d-flex flex-column gap-2 w-100"},e(u,{key:"665fbe47e3b35c0b7ffb3e6c17e15c3703c90250",title:"ID",value:this.payout.account_id,onClick:this.enableRecordClick?()=>this.handleRecordClick(this.payout.account_id):void 0}),e(u,{key:"5b15d5bc8a63541ac8d77eddccb47c89659fd05a",title:"Account Type",value:null===(a=this.payout.bank_account)||void 0===a?void 0:a.account_type}),e(u,{key:"947043e3571f27a672060f2101296daba0073727",title:"Institution",value:null===(i=this.payout.bank_account)||void 0===i?void 0:i.account_type}),e(u,{key:"74ac687b37c7ca91a88863730560333c41b9413c",title:"Routing Number",value:null===(s=this.payout.bank_account)||void 0===s?void 0:s.routing_number}),e(u,{key:"43cd9aa5ac45f6efba97901e3e1386446065c28a",title:"Account Number",value:this.payout.bank_account?`**** ${this.payout.bank_account.account_number_last4}`:void 0})),this.payout.metadata&&[e(p,{key:"8bf04ae43a08d8ef624357f64df900a11b8f2dad",sectionTitle:"Metadata"}),e("div",{key:"1bf737734f34f626cbfb9dd878afbb91b6f01913",class:"d-table gap-2 w-100"},e(v,{key:"0d1481e1823e9b2f28328ebfb3cd1c92c6342cc6",metadata:this.payout.metadata}))])))}static get watchers(){return{payoutId:["propChanged"],authToken:["propChanged"],getPayout:["getPayoutWatcher"]}}};export{S as justifi_payout_details}
1
+ import{h as e,r as t,c as a}from"./p-CV0Pyo1O.js";import{P as i}from"./p-fxlKlc2W.js";import"./p-B4vLfYnZ.js";import"./p-HXpYMWUU.js";import{k as s,C as d,b as o}from"./p-8fO8CrtQ.js";import"./p-CLHwhyvu.js";import"./p-CTtGaVYs.js";import{g as c,a as r}from"./p-D1H6VUbM.js";import{h,b as l,d as b}from"./p-Ds_P-dB8.js";import{a as f,b as n,D as p,c as v,C as u,E as y}from"./p-Bh6Q8AqQ.js";import{J as m}from"./p-CrvxQRNt.js";import{m as k,M as g}from"./p-Co3Rtlnu.js";import{c as j}from"./p-DfTbkDwg.js";import{B as C}from"./p-CU2Dwa94.js";import{S as w}from"./p-05AWudQe.js";import"./p-CZfYo5-1.js";import{S as x}from"./p-eBK-iWrz.js";import{a as D,B as T}from"./p-Dz8KJn2G.js";import"./p-i45EJXKs.js";import"./p-ryeG8Qmw.js";import"./p-DgTOxu8x.js";import"./p-Bu7gdOaV.js";const A=()=>e("div",{class:"row gap-3"},e("div",{class:"col-12"},e(x,{width:"35%",height:"30px"})),e("div",{class:"col-12"},e(x,{width:"70%"})),e("div",{class:"col-12"},e(x,{width:"40%"})),e("div",{class:"col-12"},e(x,{width:"40%"})),e("div",{class:"col-12"},e(x,{width:"100%"})),e("div",{class:"col-12"},e(x,{width:"80%"}))),S=class{constructor(e){t(this,e),this.errorEvent=a(this,"error-event",7),this.recordClickEvent=a(this,"record-click-event",7),this.enableRecordClick=!1,this.loading=!0,this.errorMessage=null,this.downloadCSV=()=>{this.getPayoutCSV({payoutId:this.payout.id,onError:({error:e,code:t,severity:a})=>{this.errorMessage=e,this.errorEvent.emit({message:e,errorCode:t,severity:a})}})},this.handleRecordClick=e=>{this.recordClickEvent.emit({id:e,type:"account"})}}componentWillLoad(){j(),this.analytics=new m(this),this.initializeServices(),this.getPayout&&this.fetchData()}disconnectedCallback(){var e;null===(e=this.analytics)||void 0===e||e.cleanup()}propChanged(){this.initializeServices()}getPayoutWatcher(){this.fetchData()}initializeServices(){this.payoutId&&this.authToken?(this.getPayout=(({id:e,authToken:t,service:a})=>async({onSuccess:i,onError:o})=>{var h;try{const l=await a.fetchPayout(e,t);l.error?o({error:r(l.error),code:c(null===(h=l.error)||void 0===h?void 0:h.code),severity:d.ERROR}):i(new s(l.data))}catch(e){o({error:r(e),code:c(null==e?void 0:e.code),severity:d.ERROR})}})({id:this.payoutId,authToken:this.authToken,service:new i}),this.getPayoutCSV=k({authToken:this.authToken,service:new i})):(this.errorMessage="Failed to load payout details. payoutId or authToken is not provided.",this.errorEvent.emit({message:this.errorMessage,errorCode:o.MISSING_PROPS,severity:d.ERROR}))}fetchData(){this.loading=!0,this.getPayout({onSuccess:e=>{this.errorMessage=null,this.payout=e,this.loading=!1},onError:({error:e,code:t,severity:a})=>{this.errorMessage=e,this.errorEvent.emit({message:e,errorCode:t,severity:a}),this.loading=!1}})}formatMethod(e){return"ach"===e?"ACH":h(e)}render(){var t,a,i,s;return e(w,{key:"da86ceeb41265056f9bc64c07b3bd7db4a91471c"},this.loading&&e(A,{key:"49ae2848db4a5b59770c2b84bfba745861573a6d"}),!this.loading&&this.errorMessage&&y(this.errorMessage),!this.loading&&this.payout&&e("justifi-details",{key:"b4e6740d49ae1099f28ea3d6f21fe0da48149c71",errorMessage:this.errorMessage},e(f,{key:"e9efbeeb7894996f318d90fb38826a6a9e4cc4b3",slot:"head-info",badge:e("div",{class:"d-flex gap-1"},g(null===(t=this.payout)||void 0===t?void 0:t.status),e(D,"expedited"===this.payout.settlement_priority?{variant:T.WARNING,title:"Expedited",text:"Expedited"}:{variant:T.SECONDARY,title:"Standard",text:"Standard"})),title:this.payout.formattedPaymentAmount(this.payout.amount)},e(n,{key:"feb913d2b90e86fb4f5575379e9b9a47adfa723f",classes:"border-1 border-end",title:"Updated At",value:`${l(this.payout.updated_at)} ${b(this.payout.updated_at)}`}),e(n,{key:"9fe6da08323735948f145a72a02db26a6eb31f02",classes:"border-1 border-end",title:"Created At",value:`${l(this.payout.created_at)} ${b(this.payout.created_at)}`}),e(n,{key:"d01c4b7ea7c966b524026a6e97c0575466de3f74",title:"ID",value:this.payout.id}),e("div",{key:"4c4f73e5898caedbb1b7aba326dbfb0dcfbb59e6",class:"m-4"},e(C,{key:"622a6e8384da37f4bb3896bcafea46ef697b140e",variant:"outline-secondary",class:"btn btn-outline-secondary d-flex align-items-center",onClick:this.downloadCSV},"Export CSV"))),e("div",{key:"9b9271663673dc2e78e89bec5c7c9c47daa6761e",slot:"detail-sections"},e(p,{key:"ac5c6e1c09e63cd0616794b7df367a73889e37b2",sectionTitle:"Details"}),e("div",{key:"95f9d5a0097499fdb24f44ea87313c3b34a96068",class:"d-flex flex-column gap-2 w-100"},e(v,{key:"ecf60d4a4783c8fb52e10222dd4f6e9935cd0910",title:"Date paid",value:l(this.payout.deposits_at)}),e(v,{key:"289971a08641bc2dc725d603ef611291025cd6b4",title:"Statement Description",value:this.payout.description}),e(v,{key:"d237aacbeb9b23ac0d45aa978350aad4824b0695",title:"Payout Method",value:this.formatMethod(this.payout.delivery_method)}),e(v,{key:"744ef2b8878b742483750fb921ca9790f6aa9ec1",title:"Amount",value:this.payout.formattedPaymentAmount(this.payout.amount)}),e(v,{key:"dbf3327510523afc6edd78ea2926f99593da9748",title:"Fee",value:this.payout.formattedPaymentAmount(this.payout.fees_total)})),e(p,{key:"15983342dbe916770291f33226b744e8c4c1129e",sectionTitle:"Account"}),e("div",{key:"b3fb4353794dc490633a14abcc829ff0835d989f",class:"d-flex flex-column gap-2 w-100"},e(v,{key:"665fbe47e3b35c0b7ffb3e6c17e15c3703c90250",title:"ID",value:this.payout.account_id,onClick:this.enableRecordClick?()=>this.handleRecordClick(this.payout.account_id):void 0}),e(v,{key:"5b15d5bc8a63541ac8d77eddccb47c89659fd05a",title:"Account Type",value:null===(a=this.payout.bank_account)||void 0===a?void 0:a.account_type}),e(v,{key:"947043e3571f27a672060f2101296daba0073727",title:"Institution",value:null===(i=this.payout.bank_account)||void 0===i?void 0:i.account_type}),e(v,{key:"74ac687b37c7ca91a88863730560333c41b9413c",title:"Routing Number",value:null===(s=this.payout.bank_account)||void 0===s?void 0:s.routing_number}),e(v,{key:"43cd9aa5ac45f6efba97901e3e1386446065c28a",title:"Account Number",value:this.payout.bank_account?`**** ${this.payout.bank_account.account_number_last4}`:void 0})),this.payout.metadata&&[e(p,{key:"8bf04ae43a08d8ef624357f64df900a11b8f2dad",sectionTitle:"Metadata"}),e("div",{key:"1bf737734f34f626cbfb9dd878afbb91b6f01913",class:"d-table gap-2 w-100"},e(u,{key:"0d1481e1823e9b2f28328ebfb3cd1c92c6342cc6",metadata:this.payout.metadata}))])))}static get watchers(){return{payoutId:["propChanged"],authToken:["propChanged"],getPayout:["getPayoutWatcher"]}}};export{S as justifi_payout_details}
@@ -1 +1 @@
1
- import{r as a,h as e}from"./p-CV0Pyo1O.js";import{f as t,p as s,c as d}from"./p-CGnRD4wF.js";import{f as r,a as l}from"./p-Bu7gdOaV.js";import{S as i}from"./p-05AWudQe.js";import"./p-CZfYo5-1.js";import{c as o,a as p}from"./p-Ds_P-dB8.js";import"./p-B4vLfYnZ.js";import{P as c}from"./p-8fO8CrtQ.js";import"./p-CLHwhyvu.js";import"./p-DaDqgDrb.js";import"./p-DgTOxu8x.js";import"./p-HXpYMWUU.js";const f=class{constructor(e){a(this,e),this.setParamsOnChange=(a,e)=>{t[a]=e},this.handleDateInput=(a,e)=>{const t=o(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(i,{key:"4047a84518ef07a3e9d22f3d6866452dcdd7bab3"},e("table-filters-menu",{key:"a1db3d5c8c0bdc44ea7d9dc35f0c460b4b5930ab",params:a,clearParams:d,part:r},e("div",{key:"0d8e8244eb9516a97914942e1e0836dd8ab53639",class:"grid-cols-2 gap-3 p-1"},e("div",{key:"47021850703e8ab104b287b4efa93693272c435b",class:"p-2"},e("form-control-select",{key:"f0312f36bc05c4fa6d4e7841624f8d977cdec6c1",name:"status",label:"Status",options:this.statusOptions,inputHandler:this.setParamsOnChange,defaultValue:this.status||t.status||"",disabled:!!this.status,part:l})),e("div",{key:"211ac119c8172aa4e626b7344b25a1df26019aa8",class:"p-2"},e("form-control-date",{key:"168757bdc92bf54e076d4d5aff63f8a04de65464",name:"created_after",label:"Created After",inputHandler:this.handleDateInput,defaultValue:p(this.createdAfter,{showInputDate:!0})||p(t.created_after,{showInputDate:!0}),disabled:!!this.createdAfter,part:l})),e("div",{key:"43aa8054ba063b70eadfff7240908329f47d1c02",class:"p-2"},e("form-control-date",{key:"16a86a41c301dd32a6d46067c32d1316c80ceb5d",name:"created_before",label:"Created Before",inputHandler:this.handleDateInput,defaultValue:p(this.createdBefore,{showInputDate:!0})||p(t.created_before,{showInputDate:!0}),disabled:!!this.createdBefore,part:l})))))}};export{f as justifi_payouts_list_filters}
1
+ import{r as a,h as e}from"./p-CV0Pyo1O.js";import{f as t,p as s,c as d}from"./p-CGnRD4wF.js";import{f as r,a as l}from"./p-Bu7gdOaV.js";import{S as i}from"./p-05AWudQe.js";import"./p-CZfYo5-1.js";import{c as o,a as p}from"./p-Ds_P-dB8.js";import"./p-B4vLfYnZ.js";import{P as c}from"./p-8fO8CrtQ.js";import"./p-CLHwhyvu.js";import"./p-CTtGaVYs.js";import"./p-DgTOxu8x.js";import"./p-HXpYMWUU.js";const f=class{constructor(e){a(this,e),this.setParamsOnChange=(a,e)=>{t[a]=e},this.handleDateInput=(a,e)=>{const t=o(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(i,{key:"4047a84518ef07a3e9d22f3d6866452dcdd7bab3"},e("table-filters-menu",{key:"a1db3d5c8c0bdc44ea7d9dc35f0c460b4b5930ab",params:a,clearParams:d,part:r},e("div",{key:"0d8e8244eb9516a97914942e1e0836dd8ab53639",class:"grid-cols-2 gap-3 p-1"},e("div",{key:"47021850703e8ab104b287b4efa93693272c435b",class:"p-2"},e("form-control-select",{key:"f0312f36bc05c4fa6d4e7841624f8d977cdec6c1",name:"status",label:"Status",options:this.statusOptions,inputHandler:this.setParamsOnChange,defaultValue:this.status||t.status||"",disabled:!!this.status,part:l})),e("div",{key:"211ac119c8172aa4e626b7344b25a1df26019aa8",class:"p-2"},e("form-control-date",{key:"168757bdc92bf54e076d4d5aff63f8a04de65464",name:"created_after",label:"Created After",inputHandler:this.handleDateInput,defaultValue:p(this.createdAfter,{showInputDate:!0})||p(t.created_after,{showInputDate:!0}),disabled:!!this.createdAfter,part:l})),e("div",{key:"43aa8054ba063b70eadfff7240908329f47d1c02",class:"p-2"},e("form-control-date",{key:"16a86a41c301dd32a6d46067c32d1316c80ceb5d",name:"created_before",label:"Created Before",inputHandler:this.handleDateInput,defaultValue:p(this.createdBefore,{showInputDate:!0})||p(t.created_before,{showInputDate:!0}),disabled:!!this.createdBefore,part:l})))))}};export{f as justifi_payouts_list_filters}
@@ -1 +1 @@
1
- import{r as e,h as a}from"./p-CV0Pyo1O.js";import{l as t}from"./p-OeJ-3w3l.js";import"./p-B4vLfYnZ.js";import{c as s,a as c}from"./p-Ds_P-dB8.js";import{I as l,a as d}from"./p-8fO8CrtQ.js";import"./p-CLHwhyvu.js";import"./p-DaDqgDrb.js";import{f as i,p as r,c as o}from"./p-CArdj6i_.js";import{f,a as b}from"./p-Bu7gdOaV.js";import{S as p}from"./p-05AWudQe.js";import"./p-CZfYo5-1.js";import"./p-BFTU3MAI.js";import"./p-DgTOxu8x.js";import"./p-HXpYMWUU.js";const m=class{constructor(a){e(this,a),this.setParamsOnChange=(e,a)=>{i[e]=a},this.handleDateInput=(e,a)=>{const t=s(a,{setExactTime:!0});this.setParamsOnChange(e,t)}}componentWillLoad(){this.debouncedSetParamsOnChange=t.debounce(this.setParamsOnChange,300),Object.entries({status:this.checkoutStatus,payment_mode:this.paymentMode,checkout_id:this.checkoutId,successful_payment_id:this.successfulPaymentId,created_after:this.createdAfter,created_before:this.createdBefore}).forEach((([e,a])=>{a&&(r[e]=a)}))}get checkoutStatusOptions(){return[{label:"All",value:""},{label:"Created",value:l.created},{label:"Completed",value:l.completed},{label:"Attempted",value:l.attempted},{label:"Expired",value:l.expired}]}get checkoutPaymentModeOptions(){return[{label:"All",value:""},{label:"E-commerce",value:d.ecom},{label:"BNPL",value:d.bnpl},{label:"Apple Pay",value:d.apple_pay}]}render(){const e=Object.assign({},i);return a(p,{key:"bcee49169e1a26419ec784bc54f2c44647e45a9b"},a("table-filters-menu",{key:"610a73cf73a45f300cb860056be85948b4d88b33",params:e,clearParams:o,part:f},a("div",{key:"726a5c935121fc7371d0c87c3fc5caca97d9b28e",class:"grid-cols-2 gap-3 p-1"},a("div",{key:"f74c2c992b97c69e20bed9a6d58a2f5f87ed49bc",class:"p-2"},a("form-control-text",{key:"ebebfe02d605f782ec1b7d845af4d104b71683db",name:"checkout_id",label:"Checkout ID",inputHandler:this.debouncedSetParamsOnChange,defaultValue:this.checkoutId||i.checkout_id,disabled:!!this.checkoutId,part:b})),a("div",{key:"c21b068705bcd55176316010772b555dfb690571",class:"p-2"},a("form-control-text",{key:"0b583f4243e17019a0bce4284c52efa46885a1dc",name:"successful_payment_id",label:"Successful Payment ID",inputHandler:this.debouncedSetParamsOnChange,defaultValue:this.successfulPaymentId||i.successful_payment_id,disabled:!!this.successfulPaymentId,part:b})),a("div",{key:"8f37a6ff48c7d4a087fd97c4c7304ffaa366c5b8",class:"p-2"},a("form-control-select",{key:"93fe20d82fb240aa69bcacf22a6db686aa4aadf4",name:"status",label:"Status",options:this.checkoutStatusOptions,inputHandler:this.setParamsOnChange,defaultValue:this.checkoutStatus||i.status||"",disabled:!!this.checkoutStatus,part:b})),a("div",{key:"af69b75624d05163f9da8e125ae40b371c1fcc38",class:"p-2"},a("form-control-select",{key:"46a1db36de05f100b7ac5b9ad92dcce99f3fc4e4",name:"payment_mode",label:"Payment Mode",options:this.checkoutPaymentModeOptions,inputHandler:this.setParamsOnChange,defaultValue:this.paymentMode||i.payment_mode||"",disabled:!!this.paymentMode,part:b})),a("div",{key:"56bba4a390bbc1bedc57183c297414903261a52c",class:"p-2"},a("form-control-date",{key:"ee284ecee968db1520f7ced86c8c45aa47b6f802",name:"created_after",label:"Created After",inputHandler:this.handleDateInput,defaultValue:c(this.createdAfter,{showInputDateTime:!0})||c(i.created_after,{showInputDateTime:!0}),showTime:!0,disabled:!!this.createdAfter,part:b})),a("div",{key:"23cfe2cead1ff93326b7ffc2713c652a2ae37ffb",class:"p-2"},a("form-control-date",{key:"d06729ff97a8d48beb09652a098b7d1d1b47823b",name:"created_before",label:"Created Before",inputHandler:this.handleDateInput,defaultValue:c(this.createdBefore,{showInputDateTime:!0})||c(i.created_before,{showInputDateTime:!0}),showTime:!0,disabled:!!this.createdBefore,part:b})))))}};export{m as justifi_checkouts_list_filters}
1
+ import{r as e,h as a}from"./p-CV0Pyo1O.js";import{l as t}from"./p-OeJ-3w3l.js";import"./p-B4vLfYnZ.js";import{c as s,a as c}from"./p-Ds_P-dB8.js";import{I as l,a as d}from"./p-8fO8CrtQ.js";import"./p-CLHwhyvu.js";import"./p-CTtGaVYs.js";import{f as i,p as r,c as o}from"./p-CArdj6i_.js";import{f,a as b}from"./p-Bu7gdOaV.js";import{S as p}from"./p-05AWudQe.js";import"./p-CZfYo5-1.js";import"./p-BFTU3MAI.js";import"./p-DgTOxu8x.js";import"./p-HXpYMWUU.js";const m=class{constructor(a){e(this,a),this.setParamsOnChange=(e,a)=>{i[e]=a},this.handleDateInput=(e,a)=>{const t=s(a,{setExactTime:!0});this.setParamsOnChange(e,t)}}componentWillLoad(){this.debouncedSetParamsOnChange=t.debounce(this.setParamsOnChange,300),Object.entries({status:this.checkoutStatus,payment_mode:this.paymentMode,checkout_id:this.checkoutId,successful_payment_id:this.successfulPaymentId,created_after:this.createdAfter,created_before:this.createdBefore}).forEach((([e,a])=>{a&&(r[e]=a)}))}get checkoutStatusOptions(){return[{label:"All",value:""},{label:"Created",value:l.created},{label:"Completed",value:l.completed},{label:"Attempted",value:l.attempted},{label:"Expired",value:l.expired}]}get checkoutPaymentModeOptions(){return[{label:"All",value:""},{label:"E-commerce",value:d.ecom},{label:"BNPL",value:d.bnpl},{label:"Apple Pay",value:d.apple_pay}]}render(){const e=Object.assign({},i);return a(p,{key:"bcee49169e1a26419ec784bc54f2c44647e45a9b"},a("table-filters-menu",{key:"610a73cf73a45f300cb860056be85948b4d88b33",params:e,clearParams:o,part:f},a("div",{key:"726a5c935121fc7371d0c87c3fc5caca97d9b28e",class:"grid-cols-2 gap-3 p-1"},a("div",{key:"f74c2c992b97c69e20bed9a6d58a2f5f87ed49bc",class:"p-2"},a("form-control-text",{key:"ebebfe02d605f782ec1b7d845af4d104b71683db",name:"checkout_id",label:"Checkout ID",inputHandler:this.debouncedSetParamsOnChange,defaultValue:this.checkoutId||i.checkout_id,disabled:!!this.checkoutId,part:b})),a("div",{key:"c21b068705bcd55176316010772b555dfb690571",class:"p-2"},a("form-control-text",{key:"0b583f4243e17019a0bce4284c52efa46885a1dc",name:"successful_payment_id",label:"Successful Payment ID",inputHandler:this.debouncedSetParamsOnChange,defaultValue:this.successfulPaymentId||i.successful_payment_id,disabled:!!this.successfulPaymentId,part:b})),a("div",{key:"8f37a6ff48c7d4a087fd97c4c7304ffaa366c5b8",class:"p-2"},a("form-control-select",{key:"93fe20d82fb240aa69bcacf22a6db686aa4aadf4",name:"status",label:"Status",options:this.checkoutStatusOptions,inputHandler:this.setParamsOnChange,defaultValue:this.checkoutStatus||i.status||"",disabled:!!this.checkoutStatus,part:b})),a("div",{key:"af69b75624d05163f9da8e125ae40b371c1fcc38",class:"p-2"},a("form-control-select",{key:"46a1db36de05f100b7ac5b9ad92dcce99f3fc4e4",name:"payment_mode",label:"Payment Mode",options:this.checkoutPaymentModeOptions,inputHandler:this.setParamsOnChange,defaultValue:this.paymentMode||i.payment_mode||"",disabled:!!this.paymentMode,part:b})),a("div",{key:"56bba4a390bbc1bedc57183c297414903261a52c",class:"p-2"},a("form-control-date",{key:"ee284ecee968db1520f7ced86c8c45aa47b6f802",name:"created_after",label:"Created After",inputHandler:this.handleDateInput,defaultValue:c(this.createdAfter,{showInputDateTime:!0})||c(i.created_after,{showInputDateTime:!0}),showTime:!0,disabled:!!this.createdAfter,part:b})),a("div",{key:"23cfe2cead1ff93326b7ffc2713c652a2ae37ffb",class:"p-2"},a("form-control-date",{key:"d06729ff97a8d48beb09652a098b7d1d1b47823b",name:"created_before",label:"Created Before",inputHandler:this.handleDateInput,defaultValue:c(this.createdBefore,{showInputDateTime:!0})||c(i.created_before,{showInputDateTime:!0}),showTime:!0,disabled:!!this.createdBefore,part:b})))))}};export{m as justifi_checkouts_list_filters}
@@ -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-8fO8CrtQ.js";import{g as h,a as p}from"./p-D1H6VUbM.js";import{D as l,a as f}from"./p-rIJv0FaI.js";import{c as b}from"./p-DcA_wt-j.js";import{J as u}from"./p-C8g8unYJ.js";import"./p-HXpYMWUU.js";import"./p-WnMmPpEb.js";import"./p-B4vLfYnZ.js";import"./p-DgTOxu8x.js";import"./p-CiypNylL.js";import"./p-CLHwhyvu.js";import"./p-DaDqgDrb.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,b;return s("div",{key:"55685c8b421d48fb041862b2ae2ff0605a3a0b7f",class:"dispute-notification-root"},this.isLoading&&s("div",{key:"93fba7164eea0a00231f2f762a1370fe2ba4ca52",style:{marginBottom:"8px"}},s(c,{key:"db8ca80547c4e022ee9cbb59b51cf1d199a65f0c",height:"28px",width:"70%",styles:{marginBottom:"16px"}}),s(c,{key:"15c884a6bbfcab6e89d9eb36cfcdc14a0505c25a",height:"18px",styles:{marginBottom:"8px"}}),s(c,{key:"61474f21b3f82c1cff6455c7d87c0474a4c5ebdd",height:"18px",styles:{marginBottom:"8px"}})),(null===(e=this.dispute)||void 0===e?void 0:e.needsResponse)&&this.isDueDatePassed()&&s("div",{key:"724f8896f7985469d457d5dea5936dc8ef0b30c0",part:a},s("h1",{key:"d4e86227300211d8ab792e8ae128912166957b02",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:"40e2fff6dadd6426d847cbc7164a72bb137ee44d"},"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:"1efebe3baa295271c793faaba07b9d62a7f19e93",part:a},s("h1",{key:"a6e10b6d4e8f01aacefb8d3cd5244eecbbb251e6",class:"h4",part:d},"This payment is disputed"),s("p",{key:"fb99d2061fcae2a6b59a1121340bb141f8a2bcb2"},"The cardholder is disputing this payment. You may accept this dispute, or proceed to provide evidence in a counter dispute."),s("h2",{key:"5e6a34864d24df666ab69291e98dc569946933ad",class:"h5"},"Dispute details"),s("div",{key:"6a189bf2c84fad8024d60da7c6972917e8768fa9",class:"d-table gap-2"},s("div",{key:"1d76955da64391406f2cf082d473fac4da8f6be9",class:"d-table-row gap-2"},s("span",{key:"7dcc2947c8e2ba7e388dde66ec426b9d95e87938",part:"detail-section-item-title",class:"fw-bold d-table-cell pe-4"},"Amount"),s("span",{key:"b45cdeebd1ee9f0b6e4a023a41e496c28c265c64",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:"d33fd1331385a3b8bad3f44bb8d0d92c7d9fb3eb",class:"d-table-row gap-2"},s("span",{key:"d4a5c2fae926b736c6516522b32965c1f55d7623",part:"detail-section-item-title",class:"fw-bold d-table-cell pe-4"},"Reason"),s("span",{key:"034868aa10b8179e485f2cc497adcf9caaca123d",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:"8b56d8237d8039f90ec9141cc94e0147bc0e49bd",class:"d-table-row gap-2"},s("span",{key:"f301c07b7ceb2f54f642e764a61b359445962d17",part:"detail-section-item-title",class:"fw-bold d-table-cell pe-4"},"Due Date"),s("span",{key:"3c7478dd78c2cd58b9eee3a3b30b0816ab8011bc",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:"1c912ca4428f444d4dd4f27584a8a64099524539",class:"d-flex gap-2 mt-4 justify-content-end"},s(r,{key:"d15adbc5be96fbfe0545e87c57e1fe34449d4c8f",variant:"secondary",onClick:()=>this.acceptDispute()},"Accept dispute"),s(r,{key:"0d7b4a74b52210106929114bb8d7db76eeadedd6",variant:"primary",onClick:()=>this.initiateRespondToDispute()},"Counter dispute"))),(null===(l=this.dispute)||void 0===l?void 0:l.underReview)&&s("div",{key:"8f1e958c5601d937d71da120e908acdb9b303367",part:a},s("h1",{key:"67012e992b666b145bff9cf70011a0de88452e1e",class:"h4",part:d},"This payment is disputed and under review"),s("p",{key:"fda8d98bffac5daf67574aabc854e58b5a754de0"},"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:"8c3699f761f941114b4fa91cad166c78def3dc00",part:a},s("h1",{key:"411280747b719b85240bde3ab052ba4bd43437e3",class:"h4",part:d},"This payment was disputed"),s("p",{key:"82edec3d96009d23454f6ac63651b6763b4b22a4"},"The cardholder disputed this payment and the card issuer has settled it in your favor.")),(null===(b=this.dispute)||void 0===b?void 0:b.lost)&&s("div",{key:"68416771d44d09201b630d7b25952894ce4a096c",part:a},s("h1",{key:"dcaf92df776e75aa78762c07fdbb750f1933311a",class:"h4",part:d},"This payment was disputed"),s("p",{key:"811fcf0b3a9f38fcf857998a672286e5c5ae0a9a"},"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(){b(),this.analytics=new u(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:"50c96cb107115c27ff993ed7288a58cd801ef936",class:"dispute-response-root"},s("div",{key:"0ebe2541c4245c6371d3aa8cdfb58b3f92f2d96e",class:"row gy-3"},s("div",{key:"78feb00f6f5b8fb96ceacba2e7bcda1342f8a244",class:"col-12"},s("h1",{key:"a86ab0cd63ebb945a69982ea05607ae4eadc1cf8",class:"h4",part:d},"Counter dispute")),s("div",{key:"f9a5e9cad90d03ae773aaeb2e72049b453d05472",class:"col-12"},this.currentStepComponent),s("div",{key:"838c642fdf957bf0e3fd8d4ef4c4abc79c2d6f61",class:"col-12"},s("div",{key:"6b8af6fa4face4debee72950e86e3bc9461406da",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 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-8fO8CrtQ.js";import{g as h,a as p}from"./p-D1H6VUbM.js";import{D as l,a as f}from"./p-j9aA2OuG.js";import{c as b}from"./p-DfTbkDwg.js";import{J as u}from"./p-CrvxQRNt.js";import"./p-HXpYMWUU.js";import"./p-i45EJXKs.js";import"./p-B4vLfYnZ.js";import"./p-DgTOxu8x.js";import"./p-ryeG8Qmw.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,b;return s("div",{key:"55685c8b421d48fb041862b2ae2ff0605a3a0b7f",class:"dispute-notification-root"},this.isLoading&&s("div",{key:"93fba7164eea0a00231f2f762a1370fe2ba4ca52",style:{marginBottom:"8px"}},s(c,{key:"db8ca80547c4e022ee9cbb59b51cf1d199a65f0c",height:"28px",width:"70%",styles:{marginBottom:"16px"}}),s(c,{key:"15c884a6bbfcab6e89d9eb36cfcdc14a0505c25a",height:"18px",styles:{marginBottom:"8px"}}),s(c,{key:"61474f21b3f82c1cff6455c7d87c0474a4c5ebdd",height:"18px",styles:{marginBottom:"8px"}})),(null===(e=this.dispute)||void 0===e?void 0:e.needsResponse)&&this.isDueDatePassed()&&s("div",{key:"724f8896f7985469d457d5dea5936dc8ef0b30c0",part:a},s("h1",{key:"d4e86227300211d8ab792e8ae128912166957b02",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:"40e2fff6dadd6426d847cbc7164a72bb137ee44d"},"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:"1efebe3baa295271c793faaba07b9d62a7f19e93",part:a},s("h1",{key:"a6e10b6d4e8f01aacefb8d3cd5244eecbbb251e6",class:"h4",part:d},"This payment is disputed"),s("p",{key:"fb99d2061fcae2a6b59a1121340bb141f8a2bcb2"},"The cardholder is disputing this payment. You may accept this dispute, or proceed to provide evidence in a counter dispute."),s("h2",{key:"5e6a34864d24df666ab69291e98dc569946933ad",class:"h5"},"Dispute details"),s("div",{key:"6a189bf2c84fad8024d60da7c6972917e8768fa9",class:"d-table gap-2"},s("div",{key:"1d76955da64391406f2cf082d473fac4da8f6be9",class:"d-table-row gap-2"},s("span",{key:"7dcc2947c8e2ba7e388dde66ec426b9d95e87938",part:"detail-section-item-title",class:"fw-bold d-table-cell pe-4"},"Amount"),s("span",{key:"b45cdeebd1ee9f0b6e4a023a41e496c28c265c64",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:"d33fd1331385a3b8bad3f44bb8d0d92c7d9fb3eb",class:"d-table-row gap-2"},s("span",{key:"d4a5c2fae926b736c6516522b32965c1f55d7623",part:"detail-section-item-title",class:"fw-bold d-table-cell pe-4"},"Reason"),s("span",{key:"034868aa10b8179e485f2cc497adcf9caaca123d",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:"8b56d8237d8039f90ec9141cc94e0147bc0e49bd",class:"d-table-row gap-2"},s("span",{key:"f301c07b7ceb2f54f642e764a61b359445962d17",part:"detail-section-item-title",class:"fw-bold d-table-cell pe-4"},"Due Date"),s("span",{key:"3c7478dd78c2cd58b9eee3a3b30b0816ab8011bc",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:"1c912ca4428f444d4dd4f27584a8a64099524539",class:"d-flex gap-2 mt-4 justify-content-end"},s(r,{key:"d15adbc5be96fbfe0545e87c57e1fe34449d4c8f",variant:"secondary",onClick:()=>this.acceptDispute()},"Accept dispute"),s(r,{key:"0d7b4a74b52210106929114bb8d7db76eeadedd6",variant:"primary",onClick:()=>this.initiateRespondToDispute()},"Counter dispute"))),(null===(l=this.dispute)||void 0===l?void 0:l.underReview)&&s("div",{key:"8f1e958c5601d937d71da120e908acdb9b303367",part:a},s("h1",{key:"67012e992b666b145bff9cf70011a0de88452e1e",class:"h4",part:d},"This payment is disputed and under review"),s("p",{key:"fda8d98bffac5daf67574aabc854e58b5a754de0"},"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:"8c3699f761f941114b4fa91cad166c78def3dc00",part:a},s("h1",{key:"411280747b719b85240bde3ab052ba4bd43437e3",class:"h4",part:d},"This payment was disputed"),s("p",{key:"82edec3d96009d23454f6ac63651b6763b4b22a4"},"The cardholder disputed this payment and the card issuer has settled it in your favor.")),(null===(b=this.dispute)||void 0===b?void 0:b.lost)&&s("div",{key:"68416771d44d09201b630d7b25952894ce4a096c",part:a},s("h1",{key:"dcaf92df776e75aa78762c07fdbb750f1933311a",class:"h4",part:d},"This payment was disputed"),s("p",{key:"811fcf0b3a9f38fcf857998a672286e5c5ae0a9a"},"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(){b(),this.analytics=new u(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:"50c96cb107115c27ff993ed7288a58cd801ef936",class:"dispute-response-root"},s("div",{key:"0ebe2541c4245c6371d3aa8cdfb58b3f92f2d96e",class:"row gy-3"},s("div",{key:"78feb00f6f5b8fb96ceacba2e7bcda1342f8a244",class:"col-12"},s("h1",{key:"a86ab0cd63ebb945a69982ea05607ae4eadc1cf8",class:"h4",part:d},"Counter dispute")),s("div",{key:"f9a5e9cad90d03ae773aaeb2e72049b453d05472",class:"col-12"},this.currentStepComponent),s("div",{key:"838c642fdf957bf0e3fd8d4ef4c4abc79c2d6f61",class:"col-12"},s("div",{key:"6b8af6fa4face4debee72950e86e3bc9461406da",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 +1 @@
1
- import{h as s,r as t,c as i}from"./p-CV0Pyo1O.js";import{J as e}from"./p-C8g8unYJ.js";import{C as r,b as o}from"./p-8fO8CrtQ.js";import{m as n,b as a}from"./p-DD9-ceDZ.js";import{B as h}from"./p-CnHbIkmu.js";import{A as p}from"./p-WnMmPpEb.js";import"./p-CLHwhyvu.js";import{C as l,B as m,e as u}from"./p-DaDqgDrb.js";import{c as d}from"./p-DcA_wt-j.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-CiypNylL.js";import"./p-D1H6VUbM.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!"))),D=()=>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(b,null):this.businessProvisioned?s(C,null):this.formSubmitted?s(k,null):this.submissionFailed?s(D,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-CrvxQRNt.js";import{C as r,b as o}from"./p-8fO8CrtQ.js";import{m as n,b as a}from"./p-DD9-ceDZ.js";import{B as h}from"./p-C42DoBRr.js";import{A as p}from"./p-i45EJXKs.js";import"./p-CLHwhyvu.js";import{C as l,B as m,e as d}from"./p-CTtGaVYs.js";import{c as u}from"./p-DfTbkDwg.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-ryeG8Qmw.js";import"./p-D1H6VUbM.js";import"./p-B4vLfYnZ.js";import"./p-DgTOxu8x.js";import"./p-HXpYMWUU.js";import"./p-eBK-iWrz.js";const w=p();class j{async postProvisioning(s,t,i){return w.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 j})):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}
@@ -1 +1 @@
1
- import{r as e,h as a,H as t}from"./p-CV0Pyo1O.js";import{a as s,r as i,s as d,d as l,b as c}from"./p-OReJ-ZQb.js";import{C as o,I as r,P as n}from"./p-CVaOFfrI.js";import{b,x as f,u,a0 as h}from"./p-Bu7gdOaV.js";import{c as m,d as v,C as p}from"./p-DaDqgDrb.js";import{c as y}from"./p-CawcnSoV.js";const k=class{constructor(a){e(this,a),this.errors={},this.additional_questions={},this.inputHandler=this.inputHandler.bind(this)}componentDidLoad(){this.formController.errors.subscribe((e=>this.errors=Object.assign({},e))),this.formController.values.subscribe((e=>this.additional_questions=Object.assign({},e.additional_questions)))}inputHandler(e,a){this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{additional_questions:Object.assign(Object.assign({},this.formController.values.getValue().additional_questions),{[e]:a})}))}render(){var e,l,c,r,n,f,u,h,m,v,p,y,k,O;const j=this.formController.getInitialValues().additional_questions;return a(t,{key:"05b69febfcd1e3901109c2cf64d812ff766b81cc"},a("fieldset",{key:"84f06779dff94622fc7d14fdca53efb84f11e8cd"},a("legend",{key:"3079e5d172c833d8172660f2f66b4d9637bfdb21",part:b},"Additional Questions"),a("div",{key:"cf5155033143279316822237a84a0ad5e292a6cd",class:"row gy-3"},a("div",{key:"e28450dacb0d7040d62a4820c0252d95792d7e87",class:"col-12 col-md-6"},a("form-control-monetary-provisioning",{key:"e2ac8f211ffd9848fab123bc7826fd9f18e109a8",name:"business_revenue",label:"What is the business' estimated annual revenue from its primary business activities?",inputHandler:this.inputHandler,errorText:null===(l=null===(e=this.errors)||void 0===e?void 0:e.additional_questions)||void 0===l?void 0:l.business_revenue,defaultValue:null==j?void 0:j.business_revenue,maskOptions:o.WHOLE})),a("div",{key:"c5de85cd5e7b1501a0667a49d8d4826971e93052",class:"col-12 col-md-6"},a("form-control-monetary-provisioning",{key:"3da3805e4ddbc633f060d36487b46e76e4f6eb04",name:"business_payment_volume",label:"What is the business' annual credit card & ACH volume anticipated to process?",inputHandler:this.inputHandler,errorText:null===(r=null===(c=this.errors)||void 0===c?void 0:c.additional_questions)||void 0===r?void 0:r.business_payment_volume,defaultValue:null==j?void 0:j.business_payment_volume,maskOptions:o.WHOLE})),a("div",{key:"ad62fecba837464fddba48273635bc8ae3a7d7ed",class:"col-12"},a("form-control-select",{key:"9f09093b45c1c8eeb63065402f4b15e31c166d51",name:"business_when_service_received",label:"On average, how long after paying will your customers typically receive their goods or services?",inputHandler:this.inputHandler,errorText:null===(f=null===(n=this.errors)||void 0===n?void 0:n.additional_questions)||void 0===f?void 0:f.business_when_service_received,options:s,defaultValue:null==j?void 0:j.business_when_service_received})),a("div",{key:"e2a05cbb74138a554033817e3bb1372933e64b99",class:"col-12"},a("form-control-select",{key:"8a95d74c02f2cf662f6cf0658faeae1a1a8f6a11",name:"business_recurring_payments",label:"Does your business offer recurring payments?",inputHandler:this.inputHandler,errorText:null===(h=null===(u=this.errors)||void 0===u?void 0:u.additional_questions)||void 0===h?void 0:h.business_recurring_payments,options:i,defaultValue:null==j?void 0:j.business_recurring_payments})),a("div",{key:"8d94059b0966237c980b1c1622e1ed3fd5bd8a58",class:"col-12"},a("form-control-text",{key:"320fa784aef300393ddfcca4f2ef4798d207bf30",name:"business_recurring_payments_percentage",label:"What percent of revenue is generated from each recurring payment type offered?",inputHandler:this.inputHandler,errorText:null===(v=null===(m=this.errors)||void 0===m?void 0:m.additional_questions)||void 0===v?void 0:v.business_recurring_payments_percentage,defaultValue:null==j?void 0:j.business_recurring_payments_percentage})),a("div",{key:"8525c21ec91e652737455e7b093ff280800d97c2",class:"col-12"},a("form-control-select",{key:"c2cba23606b03f758ba704c074a65a212e111998",name:"business_seasonal",label:"Is this business seasonal?",inputHandler:this.inputHandler,errorText:null===(y=null===(p=this.errors)||void 0===p?void 0:p.additional_questions)||void 0===y?void 0:y.business_seasonal,options:d,defaultValue:null==j?void 0:j.business_seasonal})),a("div",{key:"c047c43284fbe92952c487544bc8206c98433edc",class:"col-12"},a("form-control-text",{key:"27348b1899f8b8f7f18a0618aa4dcb812a3bef04",name:"business_other_payment_details",label:"Is there anything else you would like us to know about how your customers pay the business?",inputHandler:this.inputHandler,errorText:null===(O=null===(k=this.errors)||void 0===k?void 0:k.additional_questions)||void 0===O?void 0:O.business_other_payment_details,defaultValue:null==j?void 0:j.business_other_payment_details})))))}},O=class{constructor(a){e(this,a),this.errors={},this.coreInfo={},this.isEditingTaxId=!1,this.inputHandler=this.inputHandler.bind(this)}componentDidLoad(){this.formController.values.subscribe((e=>this.coreInfo=Object.assign({},new m(e)))),this.formController.errors.subscribe((e=>{this.errors=Object.assign({},e)}))}inputHandler(e,a){this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[e]:a}))}render(){var e,s;const i=this.formController.getInitialValues();return a(t,{key:"9c73706505c1fa0a56d7eb68fc1c4c0a6fffd1dc"},a("fieldset",{key:"d30bae9bab7ffd0e385ce276e7797cfd606e5a42"},a("legend",{key:"5792db95cbbc080f3c990b4b9cea84484f374ec3",part:b},"General Info"),a("div",{key:"ae7fa3c788d625d60cfc83b270312946dce97f0b",class:"row gy-3"},a("div",{key:"f7e5ab1ec57a8ce8de5ef8591ecad8b2fbd2f030",class:"col-12"},a("form-control-text",{key:"fa96501ceca053263029489a74bddd31222b1462",name:"legal_name",label:"Legal Name",defaultValue:i.legal_name,errorText:this.errors.legal_name,inputHandler:this.inputHandler})),a("div",{key:"21e14d0c13017376d7e74e84169f30fe05fa13af",class:"col-12"},a("form-control-text",{key:"266187ec2209299a4b0ebc4c7d600c670de3b21f",name:"doing_business_as",label:"Doing Business As (DBA)",defaultValue:i.doing_business_as,errorText:this.errors.doing_business_as,inputHandler:this.inputHandler})),a("div",{key:"d9bbb19b4ec15a18a0467444e964512114e74031",class:"col-12 col-md-8"},a("form-control-select",{key:"fe490b4abb4a1e07392db9ad4e4c15b02d928f4c",name:"classification",label:"Business Classification",options:l,defaultValue:i.classification,errorText:this.errors.classification,inputHandler:this.inputHandler})),a("div",{key:"fc5dafdace199fd34d22f22d629d87fc8ff7cc3e",class:"col-12 col-md-4"},a("form-control-date",{key:"0263cdef27d1b36c22bde16dbdb3777ad9ef62e3",name:"date_of_incorporation",label:"Date of Incorporation",defaultValue:i.date_of_incorporation,errorText:this.errors.date_of_incorporation,inputHandler:this.inputHandler})),a("div",{key:"2ae2b710d615e5314d4b836b9a498fc9140b749a",class:"col-12 col-md-6"},a("form-control-text",{key:"f6e738254ff7ead5680b895b6df77dc58efbc393",name:"industry",label:"Industry",defaultValue:i.industry,errorText:this.errors.industry,inputHandler:this.inputHandler})),a("div",{key:"8a01de0514d495b103aa43070d268070f57af62a",class:"col-12 col-md-6"},!(null===(e=this.coreInfo)||void 0===e?void 0:e.tax_id_last4)||this.isEditingTaxId?a("form-control-number-masked",{name:"tax_id",label:y[this.country].taxIdLabelOptional||y[this.country].taxIdLabel,defaultValue:this.isEditingTaxId?"":i.tax_id,errorText:this.errors.tax_id,inputHandler:this.inputHandler,mask:r[this.country],helpText:y[this.country].taxIdHelpText}):a("div",null,a("label",{class:"form-label",part:f},y[this.country].taxIdLabel),a("div",{class:"input-group mb-3"},a("input",{type:"text",class:"form-control",part:u,value:`****${null===(s=this.coreInfo)||void 0===s?void 0:s.tax_id_last4}`,disabled:!0}),a("button",{class:"btn btn-secondary",type:"button",part:h,onClick:()=>{this.isEditingTaxId=!0,this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{tax_id:""}))}},"Change")))),a("div",{key:"a82eb6e652eb36fd57cd4a6c413e896aebfefce6",class:"col-12"},a("form-control-text",{key:"930f882235d7c4902ae6daf54d644a0cd9d23daf",name:"website_url",label:"Website URL",defaultValue:i.website_url,errorText:this.errors.website_url,inputHandler:this.inputHandler})),a("div",{key:"b2e819e6dfd97229e81e1860e1debe3ab95e3dc0",class:"col-12 col-md-6"},a("form-control-text",{key:"7a4a158a1c64adfe90b825ff54c9f1f607c25bb7",name:"email",label:"Email Address",defaultValue:i.email,errorText:this.errors.email,inputHandler:this.inputHandler})),a("div",{key:"948c4f98a4a7a8b898058adb0957b7251d8c9fe4",class:"col-12 col-md-6"},a("form-control-number-masked",{key:"dc5804f3c9254c859f5e6a78487dae423c9689f1",name:"phone",label:"Phone Number",defaultValue:i.phone,errorText:this.errors.phone,inputHandler:this.inputHandler,mask:n.US})))))}},j=class{constructor(a){e(this,a),this.errors={},this.representative={},this.isEditingIdentification=!1,this.inputHandler=(e,a)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{representative:Object.assign(Object.assign({},this.formController.values.getValue().representative),{[e]:a})}))},this.onAddressFormUpdate=e=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{representative:Object.assign(Object.assign({},this.formController.values.getValue().representative),{address:Object.assign(Object.assign({},this.formController.values.getValue().representative.address),e)})}))},this.onDateOfBirthUpdate=e=>{const a=v(e.detail);this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{representative:Object.assign(Object.assign({},this.formController.values.getValue().representative),{dob_day:a.dob_day,dob_month:a.dob_month,dob_year:a.dob_year})}))}}get identificationNumberLabel(){var e;return(null===(e=this.representative)||void 0===e?void 0:e.ssn_last4)||this.country===p.CAN?y[this.country].idNumberLabelOptional:y[this.country].idNumberLabel}componentDidLoad(){this.formController.errors.subscribe((e=>this.errors=Object.assign({},e.representative))),this.formController.values.subscribe((e=>this.representative=Object.assign({},e.representative)))}render(){var e,s;const i=this.formController.getInitialValues().representative;return a(t,{key:"9045242989e4d43d1e7b0770d0c5421005db78fa"},a("fieldset",{key:"6643f8bd8e81bbc64ae8a0e9bcf317e16f91bab9"},a("legend",{key:"20b897584a059ad98c109a37a3ea74c8be4b407c",part:b},"Representative"),a("div",{key:"37da5bfb73a7606c6180c151761aaf13dcc819c4",class:"row gy-3"},a("div",{key:"8d76accd442d9fda35ae4d3e1c47b65e17f098a0",class:"col-12 col-md-8"},a("form-control-text",{key:"2eadd087eac463e851192d8ee1c30390a29ee8b2",name:"name",label:"Full Name",defaultValue:null==i?void 0:i.name,errorText:this.errors.name,inputHandler:this.inputHandler})),a("div",{key:"f495a8cb3c6a0e9b4a00aac3e8c77f66da84b9e2",class:"col-12 col-md-4"},a("form-control-select",{key:"4b7669b96b7df9a387cf3c4f9638ea9ada9f37ee",name:"title",label:"Title",options:c,defaultValue:null==i?void 0:i.title,errorText:this.errors.title,inputHandler:this.inputHandler})),a("div",{key:"3e10f464a7e26a9518b4ce6d37c6f4a968514f98",class:"col-12 col-md-6"},a("form-control-text",{key:"a0d51c6999295428bfdcb43ef4b0ec15194eb077",name:"email",label:"Email Address",defaultValue:null==i?void 0:i.email,errorText:this.errors.email,inputHandler:this.inputHandler})),a("div",{key:"a8e1a4c8e4fa5a50d436c18e41a5b77f23bc53cf",class:"col-12 col-md-6"},a("form-control-number-masked",{key:"a72115bf51fc97a25add717c208e820c7e9e5495",name:"phone",label:"Phone Number",defaultValue:null==i?void 0:i.phone,errorText:this.errors.phone,inputHandler:this.inputHandler,mask:n.US})),a("div",{key:"db04f552f1757b6ac4e10539e4a148f399a75192",class:"col-12 col-md-4"},a("form-control-date",{key:"cb07a2cc4e6fc242d643f9caea01db380a9ff366",name:"dob_full",label:"Birth Date",defaultValue:null==i?void 0:i.dob_full,errorText:this.errors.dob_full,inputHandler:this.inputHandler,onFormControlInput:this.onDateOfBirthUpdate})),a("div",{key:"95348511ba3b1582053f754249b15efe4d707252",class:"col-12 col-md-8"},!(null===(e=this.representative)||void 0===e?void 0:e.ssn_last4)||this.isEditingIdentification?a("form-control-number-masked",{name:"identification_number",label:this.identificationNumberLabel,defaultValue:this.isEditingIdentification?"":null==i?void 0:i.identification_number,errorText:this.errors.identification_number,inputHandler:this.inputHandler,mask:r[this.country],helpText:y[this.country].identityHelpText}):a("div",null,a("label",{class:"form-label",part:f},this.identificationNumberLabel),a("div",{class:"input-group mb-3"},a("input",{type:"text",class:"form-control",part:u,value:`****${null===(s=this.representative)||void 0===s?void 0:s.ssn_last4}`,disabled:!0}),a("button",{class:"btn btn-secondary",type:"button",part:h,onClick:()=>{this.isEditingIdentification=!0,this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{representative:Object.assign(Object.assign({},this.formController.values.getValue().representative),{ssn_last4:null,identification_number:""})}))}},"Change")))),a("div",{key:"57dcdaad0ec89f94d82236bfc8e093b68b7ec478",class:"col-12"},a("identity-address-form",{key:"0ea02562077d352c5d3a1d0903dee1e8b69fa6f1",errors:this.errors.address,defaultValues:null==i?void 0:i.address,handleFormUpdate:this.onAddressFormUpdate,country:this.country})))))}},x=class{constructor(a){e(this,a),this.errors={},this.inputHandler=this.inputHandler.bind(this)}componentDidLoad(){this.formController.errors.subscribe((e=>this.errors=Object.assign({},e))),this.formController.values.subscribe((e=>this.legal_address=Object.assign({},e.legal_address)))}inputHandler(e,a){this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{legal_address:Object.assign(Object.assign({},this.formController.values.getValue().legal_address),{[e]:a})}))}render(){var e;const s=this.formController.getInitialValues().legal_address;return a(t,{key:"856cd25caef521b651b9dd8a40dc6f9f0c727706"},a("fieldset",{key:"150ad1f56747aae80ae8d2610fa08fcabee27c87"},a("legend",{key:"565a46bd0977680e400663ef0590d65e977135be",part:b},"Business Legal Address"),a("form-address-fields",{key:"c2ce05c006ec80c5319b30b40387e400ec52ab86",country:this.country,errors:null===(e=this.errors)||void 0===e?void 0:e.legal_address,defaultValues:s,inputHandler:this.inputHandler})))}};export{k as additional_questions,O as business_core_info,j as business_representative,x as legal_address_form}
1
+ import{r as e,h as a,H as t}from"./p-CV0Pyo1O.js";import{a as s,r as i,s as d,d as l,b as c}from"./p-CtlBL-X6.js";import{C as o,I as r,P as n}from"./p-CVaOFfrI.js";import{b,x as f,u,a0 as h}from"./p-Bu7gdOaV.js";import{c as m,d as v,C as p}from"./p-CTtGaVYs.js";import{c as y}from"./p-riZDHN5-.js";const k=class{constructor(a){e(this,a),this.errors={},this.additional_questions={},this.inputHandler=this.inputHandler.bind(this)}componentDidLoad(){this.formController.errors.subscribe((e=>this.errors=Object.assign({},e))),this.formController.values.subscribe((e=>this.additional_questions=Object.assign({},e.additional_questions)))}inputHandler(e,a){this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{additional_questions:Object.assign(Object.assign({},this.formController.values.getValue().additional_questions),{[e]:a})}))}render(){var e,l,c,r,n,f,u,h,m,v,p,y,k,j;const O=this.formController.getInitialValues().additional_questions;return a(t,{key:"05b69febfcd1e3901109c2cf64d812ff766b81cc"},a("fieldset",{key:"84f06779dff94622fc7d14fdca53efb84f11e8cd"},a("legend",{key:"3079e5d172c833d8172660f2f66b4d9637bfdb21",part:b},"Additional Questions"),a("div",{key:"cf5155033143279316822237a84a0ad5e292a6cd",class:"row gy-3"},a("div",{key:"e28450dacb0d7040d62a4820c0252d95792d7e87",class:"col-12 col-md-6"},a("form-control-monetary-provisioning",{key:"e2ac8f211ffd9848fab123bc7826fd9f18e109a8",name:"business_revenue",label:"What is the business' estimated annual revenue from its primary business activities?",inputHandler:this.inputHandler,errorText:null===(l=null===(e=this.errors)||void 0===e?void 0:e.additional_questions)||void 0===l?void 0:l.business_revenue,defaultValue:null==O?void 0:O.business_revenue,maskOptions:o.WHOLE})),a("div",{key:"c5de85cd5e7b1501a0667a49d8d4826971e93052",class:"col-12 col-md-6"},a("form-control-monetary-provisioning",{key:"3da3805e4ddbc633f060d36487b46e76e4f6eb04",name:"business_payment_volume",label:"What is the business' annual credit card & ACH volume anticipated to process?",inputHandler:this.inputHandler,errorText:null===(r=null===(c=this.errors)||void 0===c?void 0:c.additional_questions)||void 0===r?void 0:r.business_payment_volume,defaultValue:null==O?void 0:O.business_payment_volume,maskOptions:o.WHOLE})),a("div",{key:"ad62fecba837464fddba48273635bc8ae3a7d7ed",class:"col-12"},a("form-control-select",{key:"9f09093b45c1c8eeb63065402f4b15e31c166d51",name:"business_when_service_received",label:"On average, how long after paying will your customers typically receive their goods or services?",inputHandler:this.inputHandler,errorText:null===(f=null===(n=this.errors)||void 0===n?void 0:n.additional_questions)||void 0===f?void 0:f.business_when_service_received,options:s,defaultValue:null==O?void 0:O.business_when_service_received})),a("div",{key:"e2a05cbb74138a554033817e3bb1372933e64b99",class:"col-12"},a("form-control-select",{key:"8a95d74c02f2cf662f6cf0658faeae1a1a8f6a11",name:"business_recurring_payments",label:"Does your business offer recurring payments?",inputHandler:this.inputHandler,errorText:null===(h=null===(u=this.errors)||void 0===u?void 0:u.additional_questions)||void 0===h?void 0:h.business_recurring_payments,options:i,defaultValue:null==O?void 0:O.business_recurring_payments})),a("div",{key:"8d94059b0966237c980b1c1622e1ed3fd5bd8a58",class:"col-12"},a("form-control-text",{key:"320fa784aef300393ddfcca4f2ef4798d207bf30",name:"business_recurring_payments_percentage",label:"What percent of revenue is generated from each recurring payment type offered?",inputHandler:this.inputHandler,errorText:null===(v=null===(m=this.errors)||void 0===m?void 0:m.additional_questions)||void 0===v?void 0:v.business_recurring_payments_percentage,defaultValue:null==O?void 0:O.business_recurring_payments_percentage})),a("div",{key:"8525c21ec91e652737455e7b093ff280800d97c2",class:"col-12"},a("form-control-select",{key:"c2cba23606b03f758ba704c074a65a212e111998",name:"business_seasonal",label:"Is this business seasonal?",inputHandler:this.inputHandler,errorText:null===(y=null===(p=this.errors)||void 0===p?void 0:p.additional_questions)||void 0===y?void 0:y.business_seasonal,options:d,defaultValue:null==O?void 0:O.business_seasonal})),a("div",{key:"c047c43284fbe92952c487544bc8206c98433edc",class:"col-12"},a("form-control-text",{key:"27348b1899f8b8f7f18a0618aa4dcb812a3bef04",name:"business_other_payment_details",label:"Is there anything else you would like us to know about how your customers pay the business?",inputHandler:this.inputHandler,errorText:null===(j=null===(k=this.errors)||void 0===k?void 0:k.additional_questions)||void 0===j?void 0:j.business_other_payment_details,defaultValue:null==O?void 0:O.business_other_payment_details})))))}},j=class{constructor(a){e(this,a),this.errors={},this.coreInfo={},this.isEditingTaxId=!1,this.inputHandler=this.inputHandler.bind(this)}componentDidLoad(){this.formController.values.subscribe((e=>this.coreInfo=Object.assign({},new m(e)))),this.formController.errors.subscribe((e=>{this.errors=Object.assign({},e)}))}inputHandler(e,a){this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[e]:a}))}render(){var e,s;const i=this.formController.getInitialValues();return a(t,{key:"9c73706505c1fa0a56d7eb68fc1c4c0a6fffd1dc"},a("fieldset",{key:"d30bae9bab7ffd0e385ce276e7797cfd606e5a42"},a("legend",{key:"5792db95cbbc080f3c990b4b9cea84484f374ec3",part:b},"General Info"),a("div",{key:"ae7fa3c788d625d60cfc83b270312946dce97f0b",class:"row gy-3"},a("div",{key:"f7e5ab1ec57a8ce8de5ef8591ecad8b2fbd2f030",class:"col-12"},a("form-control-text",{key:"fa96501ceca053263029489a74bddd31222b1462",name:"legal_name",label:"Legal Name",defaultValue:i.legal_name,errorText:this.errors.legal_name,inputHandler:this.inputHandler})),a("div",{key:"21e14d0c13017376d7e74e84169f30fe05fa13af",class:"col-12"},a("form-control-text",{key:"266187ec2209299a4b0ebc4c7d600c670de3b21f",name:"doing_business_as",label:"Doing Business As (DBA)",defaultValue:i.doing_business_as,errorText:this.errors.doing_business_as,inputHandler:this.inputHandler})),a("div",{key:"d9bbb19b4ec15a18a0467444e964512114e74031",class:"col-12 col-md-8"},a("form-control-select",{key:"fe490b4abb4a1e07392db9ad4e4c15b02d928f4c",name:"classification",label:"Business Classification",options:l,defaultValue:i.classification,errorText:this.errors.classification,inputHandler:this.inputHandler})),a("div",{key:"fc5dafdace199fd34d22f22d629d87fc8ff7cc3e",class:"col-12 col-md-4"},a("form-control-date",{key:"0263cdef27d1b36c22bde16dbdb3777ad9ef62e3",name:"date_of_incorporation",label:"Date of Incorporation",defaultValue:i.date_of_incorporation,errorText:this.errors.date_of_incorporation,inputHandler:this.inputHandler})),a("div",{key:"2ae2b710d615e5314d4b836b9a498fc9140b749a",class:"col-12 col-md-6"},a("form-control-text",{key:"f6e738254ff7ead5680b895b6df77dc58efbc393",name:"industry",label:"Industry",defaultValue:i.industry,errorText:this.errors.industry,inputHandler:this.inputHandler})),a("div",{key:"8a01de0514d495b103aa43070d268070f57af62a",class:"col-12 col-md-6"},!(null===(e=this.coreInfo)||void 0===e?void 0:e.tax_id_last4)||this.isEditingTaxId?a("form-control-number-masked",{name:"tax_id",label:y[this.country].taxIdLabelOptional||y[this.country].taxIdLabel,defaultValue:this.isEditingTaxId?"":i.tax_id,errorText:this.errors.tax_id,inputHandler:this.inputHandler,mask:r[this.country],helpText:y[this.country].taxIdHelpText}):a("div",null,a("label",{class:"form-label",part:f},y[this.country].taxIdLabel),a("div",{class:"input-group mb-3"},a("input",{type:"text",class:"form-control",part:u,value:`****${null===(s=this.coreInfo)||void 0===s?void 0:s.tax_id_last4}`,disabled:!0}),a("button",{class:"btn btn-secondary",type:"button",part:h,onClick:()=>{this.isEditingTaxId=!0,this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{tax_id:""}))}},"Change")))),a("div",{key:"a82eb6e652eb36fd57cd4a6c413e896aebfefce6",class:"col-12"},a("form-control-text",{key:"930f882235d7c4902ae6daf54d644a0cd9d23daf",name:"website_url",label:"Website URL",defaultValue:i.website_url,errorText:this.errors.website_url,inputHandler:this.inputHandler})),a("div",{key:"b2e819e6dfd97229e81e1860e1debe3ab95e3dc0",class:"col-12 col-md-6"},a("form-control-text",{key:"7a4a158a1c64adfe90b825ff54c9f1f607c25bb7",name:"email",label:"Email Address",defaultValue:i.email,errorText:this.errors.email,inputHandler:this.inputHandler})),a("div",{key:"948c4f98a4a7a8b898058adb0957b7251d8c9fe4",class:"col-12 col-md-6"},a("form-control-number-masked",{key:"dc5804f3c9254c859f5e6a78487dae423c9689f1",name:"phone",label:"Phone Number",defaultValue:i.phone,errorText:this.errors.phone,inputHandler:this.inputHandler,mask:n.US})))))}},O=class{constructor(a){e(this,a),this.errors={},this.representative={},this.isEditingIdentification=!1,this.inputHandler=(e,a)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{representative:Object.assign(Object.assign({},this.formController.values.getValue().representative),{[e]:a})}))},this.onAddressFormUpdate=e=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{representative:Object.assign(Object.assign({},this.formController.values.getValue().representative),{address:Object.assign(Object.assign({},this.formController.values.getValue().representative.address),e)})}))},this.onDateOfBirthUpdate=e=>{const a=v(e.detail);this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{representative:Object.assign(Object.assign({},this.formController.values.getValue().representative),{dob_day:a.dob_day,dob_month:a.dob_month,dob_year:a.dob_year})}))}}get identificationNumberLabel(){var e;return(null===(e=this.representative)||void 0===e?void 0:e.ssn_last4)||this.country===p.CAN?y[this.country].idNumberLabelOptional:y[this.country].idNumberLabel}componentDidLoad(){this.formController.errors.subscribe((e=>this.errors=Object.assign({},e.representative))),this.formController.values.subscribe((e=>this.representative=Object.assign({},e.representative)))}render(){var e,s;const i=this.formController.getInitialValues().representative;return a(t,{key:"9045242989e4d43d1e7b0770d0c5421005db78fa"},a("fieldset",{key:"6643f8bd8e81bbc64ae8a0e9bcf317e16f91bab9"},a("legend",{key:"20b897584a059ad98c109a37a3ea74c8be4b407c",part:b},"Representative"),a("div",{key:"37da5bfb73a7606c6180c151761aaf13dcc819c4",class:"row gy-3"},a("div",{key:"8d76accd442d9fda35ae4d3e1c47b65e17f098a0",class:"col-12 col-md-8"},a("form-control-text",{key:"2eadd087eac463e851192d8ee1c30390a29ee8b2",name:"name",label:"Full Name",defaultValue:null==i?void 0:i.name,errorText:this.errors.name,inputHandler:this.inputHandler})),a("div",{key:"f495a8cb3c6a0e9b4a00aac3e8c77f66da84b9e2",class:"col-12 col-md-4"},a("form-control-select",{key:"4b7669b96b7df9a387cf3c4f9638ea9ada9f37ee",name:"title",label:"Title",options:c,defaultValue:null==i?void 0:i.title,errorText:this.errors.title,inputHandler:this.inputHandler})),a("div",{key:"3e10f464a7e26a9518b4ce6d37c6f4a968514f98",class:"col-12 col-md-6"},a("form-control-text",{key:"a0d51c6999295428bfdcb43ef4b0ec15194eb077",name:"email",label:"Email Address",defaultValue:null==i?void 0:i.email,errorText:this.errors.email,inputHandler:this.inputHandler})),a("div",{key:"a8e1a4c8e4fa5a50d436c18e41a5b77f23bc53cf",class:"col-12 col-md-6"},a("form-control-number-masked",{key:"a72115bf51fc97a25add717c208e820c7e9e5495",name:"phone",label:"Phone Number",defaultValue:null==i?void 0:i.phone,errorText:this.errors.phone,inputHandler:this.inputHandler,mask:n.US})),a("div",{key:"db04f552f1757b6ac4e10539e4a148f399a75192",class:"col-12 col-md-4"},a("form-control-date",{key:"cb07a2cc4e6fc242d643f9caea01db380a9ff366",name:"dob_full",label:"Birth Date",defaultValue:null==i?void 0:i.dob_full,errorText:this.errors.dob_full,inputHandler:this.inputHandler,onFormControlInput:this.onDateOfBirthUpdate})),a("div",{key:"95348511ba3b1582053f754249b15efe4d707252",class:"col-12 col-md-8"},!(null===(e=this.representative)||void 0===e?void 0:e.ssn_last4)||this.isEditingIdentification?a("form-control-number-masked",{name:"identification_number",label:this.identificationNumberLabel,defaultValue:this.isEditingIdentification?"":null==i?void 0:i.identification_number,errorText:this.errors.identification_number,inputHandler:this.inputHandler,mask:r[this.country],helpText:y[this.country].identityHelpText}):a("div",null,a("label",{class:"form-label",part:f},this.identificationNumberLabel),a("div",{class:"input-group mb-3"},a("input",{type:"text",class:"form-control",part:u,value:`****${null===(s=this.representative)||void 0===s?void 0:s.ssn_last4}`,disabled:!0}),a("button",{class:"btn btn-secondary",type:"button",part:h,onClick:()=>{this.isEditingIdentification=!0,this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{representative:Object.assign(Object.assign({},this.formController.values.getValue().representative),{ssn_last4:null,identification_number:""})}))}},"Change")))),a("div",{key:"57dcdaad0ec89f94d82236bfc8e093b68b7ec478",class:"col-12"},a("identity-address-form",{key:"0ea02562077d352c5d3a1d0903dee1e8b69fa6f1",errors:this.errors.address,defaultValues:null==i?void 0:i.address,handleFormUpdate:this.onAddressFormUpdate,country:this.country})))))}},x=class{constructor(a){e(this,a),this.errors={},this.inputHandler=this.inputHandler.bind(this)}componentDidLoad(){this.formController.errors.subscribe((e=>this.errors=Object.assign({},e))),this.formController.values.subscribe((e=>this.legal_address=Object.assign({},e.legal_address)))}inputHandler(e,a){this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{legal_address:Object.assign(Object.assign({},this.formController.values.getValue().legal_address),{[e]:a})}))}render(){var e;const s=this.formController.getInitialValues().legal_address;return a(t,{key:"856cd25caef521b651b9dd8a40dc6f9f0c727706"},a("fieldset",{key:"150ad1f56747aae80ae8d2610fa08fcabee27c87"},a("legend",{key:"565a46bd0977680e400663ef0590d65e977135be",part:b},"Business Legal Address"),a("form-address-fields",{key:"c2ce05c006ec80c5319b30b40387e400ec52ab86",country:this.country,errors:null===(e=this.errors)||void 0===e?void 0:e.legal_address,defaultValues:s,inputHandler:this.inputHandler})))}};export{k as additional_questions,j as business_core_info,O as business_representative,x as legal_address_form}
@@ -0,0 +1 @@
1
+ import{A as s}from"./p-i45EJXKs.js";import{S as o,C as r}from"./p-8fO8CrtQ.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-D1H6VUbM.js";const c=s();class a{async fetchSubAccounts(s,o,r){return c.get({authToken:o,endpoint:"sub_accounts",params:r,headers:{Account:s}})}}const e=({primaryAccountId:s,authToken:c,service:a})=>async({params:e,onSuccess:i,onError:p})=>{var u,m;try{const v=await a.fetchSubAccounts(s,c,e);if(v.error){return p({error:n(v.error),code:t(null===(m=v.error)||void 0===m?void 0:m.code),severity:r.ERROR})}{const s=Object.assign({},v.page_info);i({subAccounts:(null===(u=v.data)||void 0===u?void 0:u.map((s=>new o(s))))||[],pagingInfo:s})}}catch(s){const o=t(null==s?void 0:s.code);return p({error:s.message||s,code:o,severity:r.ERROR})}};export{a as S,e as m}
@@ -0,0 +1 @@
1
+ import{h as t,r as e,c as a}from"./p-CV0Pyo1O.js";import{c as s}from"./p-B4vLfYnZ.js";import"./p-HXpYMWUU.js";import{l as i,C as r,b as o}from"./p-8fO8CrtQ.js";import{p as n}from"./p-CLHwhyvu.js";import"./p-CTtGaVYs.js";import{J as c}from"./p-CrvxQRNt.js";import{c as d}from"./p-DfTbkDwg.js";import{g as p,a as h}from"./p-D1H6VUbM.js";import{P as l}from"./p-fxlKlc2W.js";import{T as f,a as u,b as m,c as b,d as y,e as _,f as w,g,h as T,i as j,j as v,k,l as D}from"./p-DZr0wLGh.js";import{S as P}from"./p-05AWudQe.js";import{T as C}from"./p-CZfYo5-1.js";import{a as S}from"./p-Ds_P-dB8.js";import{a6 as I,a7 as O}from"./p-Bu7gdOaV.js";import"./p-DgTOxu8x.js";import"./p-ryeG8Qmw.js";import"./p-i45EJXKs.js";import"./p-MPer3Rw7.js";const F={id:()=>t("th",{part:I,scope:"col",title:"The unique identifier of each transaction"},"ID"),account_id:()=>t("th",{part:I,scope:"col",title:"The unique identifier of the account associated with each transaction"},"Account ID"),payout_id:()=>t("th",{part:I,scope:"col",title:"The unique identifier of the payout associated with each transaction"},"Payout ID"),financial_transaction_id:()=>t("th",{part:I,scope:"col",title:"The unique identifier of the financial transaction associated with the payment balance transaction"},"Financial Transaction ID"),amount:()=>t("th",{part:I,scope:"col",title:"The dollar amount of each transaction"},"Amount"),fee:()=>t("th",{part:I,scope:"col",title:"The fee associated with each transaction"},"Fee"),net:()=>t("th",{part:I,scope:"col",title:"The net amount of each transaction"},"Net"),currency:()=>t("th",{part:I,scope:"col",title:"The currency of each transaction"},"Currency"),description:()=>t("th",{part:I,scope:"col",title:"The description of each transaction"},"Description"),source_id:()=>t("th",{part:I,scope:"col",title:"The unique identifier of the source object associated with the payment balance transaction"},"Source ID"),txn_type:()=>t("th",{part:I,scope:"col",title:"The type of each transaction"},"Type"),created_at:()=>t("th",{part:I,scope:"col",title:"The date and time each transaction was made"},"Processed On"),available_on:()=>t("th",{part:I,scope:"col",title:"The date and time each transaction will be available"},"Available On"),updated_at:()=>t("th",{part:I,scope:"col",title:"The date and time each transaction was last updated"},"Updated On")},x={fee:"Fee",payment:"Payment",payout:"Payout",seller_payment_refund:"Seller Payment Refund",dispute_amount_collected:"Dispute Amount Collected",dispute_fee_collected:"Dispute Fee Collected",seller_payment:"Seller Payment",transfer:"Transfer",partner_platform_proceeds_credit:"Partner Platform Proceeds Credit",processing_fee:"Processing Fee",refund_processing_fee:"Refund Processing Fee",fee_rounding_adjustment:"Fee Rounding Adjustment",platform_fee:"Platform Fee",processing_fee_return:"Processing Fee Return",platform_fee_return:"Platform Fee Return"},R={id:e=>t("td",{part:O(e.id)},e.id),account_id:e=>t("td",{part:O(e.account_id)},e.account_id),payout_id:e=>t("td",{part:O(e.payout_id)},e.payout_id),financial_transaction_id:e=>t("td",{part:O(e.financial_transaction_id)},e.financial_transaction_id),amount:e=>t("td",{part:O(e.amount)},e.formattedPaymentAmount(e.amount)),fee:e=>t("td",{part:O(e.fee)},e.formattedPaymentAmount(e.fee)),net:e=>t("td",{part:O(e.net)},e.formattedPaymentAmount(e.net)),currency:e=>t("td",{part:O(e.currency)},e.currency),description:e=>t("td",{part:O(e.description)},e.description),source_id:e=>t("td",{part:O(e.source_id)},e.source_id),txn_type:e=>t("td",{part:O(e.txn_type)},x[e.txn_type]),created_at:e=>t("td",{part:O(e.created_at)},t("div",{class:"fw-bold"},S(e.created_at,{showDisplayDate:!0})),t("div",{class:"fw-bold"},S(e.created_at,{showTime:!0}))),available_on:e=>t("td",{part:O(e.available_on)},t("div",{class:"fw-bold"},S(e.available_on,{showDisplayDate:!0})),t("div",{class:"fw-bold"},S(e.available_on,{showTime:!0}))),updated_at:e=>t("td",{part:O(e.updated_at)},t("div",{class:"fw-bold"},S(e.updated_at,{showDisplayDate:!0})),t("div",{class:"fw-bold"},S(e.updated_at,{showTime:!0})))},q=class{constructor(t){e(this,t),this.clickEvent=a(this,"click-event",7),this.errorEvent=a(this,"error-event",7),this.balanceTransactions=[],this.isLoading=!0,this.errorMessage=null,this.paging=n,this.pagingParams={},this.columns="created_at,txn_type,description,amount,fee,net",this.handleClickPrevious=t=>{this.pagingParams={before_cursor:t},this.clickEvent.emit({name:C.previous})},this.handleClickNext=t=>{this.pagingParams={after_cursor:t},this.clickEvent.emit({name:C.next})},this.rowClickHandler=t=>{const e=t.target.closest("tr").dataset.rowEntityId;if(!e)return;const a=this.balanceTransactions.find((t=>t.id===e));this.clickEvent.emit({name:C.row,data:a})}}componentWillLoad(){this.transactionsTable=new f(this.balanceTransactions,this.columns,F,R),d(),this.analytics=new c(this),this.initializeApi()}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}propChanged(){this.initializeApi()}handleError(t,e,a){this.isLoading=!1,this.errorEvent.emit({errorCode:t,message:e,severity:a})}initializeApi(){this.payoutId&&this.authToken?(({accountId:t,authToken:e,service:a})=>async({params:s,onSuccess:o,onError:n,final:c})=>{var d;try{const c=await a.fetchPayoutTransactions(t,e,s);c.error?n({error:h(c.error),code:p(null===(d=c.error)||void 0===d?void 0:d.code),severity:r.ERROR}):o({balanceTransactions:c.data.map((t=>new i(t))),pagingInfo:Object.assign({},c.page_info)})}catch(t){const e=p(null==t?void 0:t.code);n({error:h(t),code:e,severity:r.ERROR})}finally{c()}})({accountId:s.accountId,authToken:this.authToken,service:new l})({params:this.requestParams,onSuccess:({balanceTransactions:t,pagingInfo:e})=>{this.balanceTransactions=t,this.paging=e,this.transactionsTable.collectionData=this.balanceTransactions},onError:({error:t,code:e,severity:a})=>{this.errorMessage=t.message,this.handleError(t,e,a)},final:()=>{this.isLoading=!1}}):(this.errorMessage="payout-id and auth-token props are required",this.handleError(o.MISSING_PROPS,this.errorMessage,r.ERROR))}get entityId(){return this.balanceTransactions.map((t=>t.id))}get showEmptyState(){return!this.isLoading&&!this.errorMessage&&this.transactionsTable.rowData.length<1}get showErrorState(){return!this.isLoading&&!!this.errorMessage}get showRowData(){return!this.showEmptyState&&!this.showErrorState&&!this.isLoading}get requestParams(){return Object.assign({payout_id:this.payoutId,limit:"15"},this.pagingParams)}render(){return t(P,{key:"e7b5b219c34d1c8610fb4113fedd503f0512db2d"},t(u,{key:"97bbe678c90ba115a091db4fac42560c17f557f2"},t(m,{key:"ef90c77cd8f19a80e2b3e2b514aa1bc735a1b783"},t(b,{key:"f5f0a00594f099931f1ac1cd4e359bb8fab11ec8"},t(y,{key:"559648add19e0426d756f71ecb7bbd5cbcf1349e"},this.transactionsTable.columnData.map((t=>t)))),t(_,{key:"49f8da0be5dba34ffbb92805d7b5b0fb3eeb6bf7"},t(w,{key:"1d61dc2157608f38eb34e64452d7089857e6c67d",columnSpan:this.transactionsTable.columnKeys.length,isLoading:this.isLoading}),t(g,{key:"d1f735fdb009740a186a16ea7e15d0320965a286",isEmpty:this.showEmptyState,columnSpan:this.transactionsTable.columnKeys.length}),t(T,{key:"f50ecc151be5c9143fb69d575a1ef14b3aa17b61",columnSpan:this.transactionsTable.columnKeys.length,errorMessage:this.errorMessage}),this.showRowData&&this.transactionsTable.rowData.map(((e,a)=>t(j,{"data-test-id":"table-row","data-row-entity-id":this.entityId[a],onClick:this.rowClickHandler},e)))),this.paging&&t(v,{key:"560536e623b2437d613169af2980aec13ebb4531"},t(k,{key:"42b82920fdd6056bb654db92acf3741aafb13d99"},t(D,{key:"e2545104fdac51e0ada942138a08714f213bce63",colSpan:this.transactionsTable.columnData.length},t("pagination-menu",{key:"6a74b19f3fa02f0e86e00783a06b0dfba2bc0ed8",paging:Object.assign(Object.assign({},this.paging),{handleClickPrevious:this.handleClickPrevious,handleClickNext:this.handleClickNext})})))))))}static get watchers(){return{pagingParams:["propChanged"],payoutId:["propChanged"],authToken:["propChanged"]}}};export{q as justifi_payout_transactions_list}
@@ -1 +1 @@
1
- import{h as t,r as s,c as e}from"./p-CV0Pyo1O.js";import{k as a,C as i,b as o}from"./p-8fO8CrtQ.js";import{J as r}from"./p-C8g8unYJ.js";import{c as h}from"./p-DcA_wt-j.js";import{P as c}from"./p-H4vl65HO.js";import"./p-B4vLfYnZ.js";import"./p-HXpYMWUU.js";import{p as n}from"./p-CLHwhyvu.js";import"./p-DaDqgDrb.js";import{g as p,a as d}from"./p-D1H6VUbM.js";import{M as u,m as f}from"./p-Co3Rtlnu.js";import{m,S as l}from"./p-C0w_sG9P.js";import{S as b}from"./p-05AWudQe.js";import{T as y,a as g,b as v,c as j,d as C,e as _,f as w,g as k,h as S,i as P,j as D,k as T,l as O}from"./p-DZr0wLGh.js";import{T as A}from"./p-CZfYo5-1.js";import{a as E}from"./p-Ds_P-dB8.js";import{a6 as I,a7 as G}from"./p-Bu7gdOaV.js";import{o as L,g as M}from"./p-CGnRD4wF.js";import"./p-CiypNylL.js";import"./p-WnMmPpEb.js";import"./p-DgTOxu8x.js";import"./p-Dz8KJn2G.js";import"./p-MPer3Rw7.js";const V={created_at:()=>t("th",{part:I,scope:"col",title:"The date the payout was deposited"},"Created"),sub_account_name:()=>t("th",{part:I,scope:"col",title:"The sub account associated with the payout"},"Sub Account"),payments_total:()=>t("th",{part:I,scope:"col",title:"The total payments amount associated with the payout"},"Payments"),refunds_total:()=>t("th",{part:I,scope:"col",title:"The total refunds amount associated with the payout"},"Refunds"),fees_total:()=>t("th",{part:I,scope:"col",title:"The total fees amount associated with the payout"},"Fees"),other_total:()=>t("th",{part:I,scope:"col",title:"The total other amount"},"Other"),amount:()=>t("th",{part:I,scope:"col",title:"The total amount of the payout"},"Amount"),status:()=>t("th",{part:I,scope:"col",title:"The real-time status of each payout"},"Status"),csv:()=>t("th",{part:I,scope:"col",title:"Export CSV"})},x=class{constructor(t){s(this,t),this.errorEvent=e(this,"error-event",7),this.clickEvent=e(this,"click-event",7),this.errorMessage=null,this.payouts=[],this.subAccounts=[],this.loading=!0,this.paging=n,this.pagingParams={},this.columns="created_at,amount,status,payments_total,refunds_total,fees_total,other_total,csv",this.downloadCSV=t=>{this.getPayoutCSV({payoutId:t,onError:()=>{this.errorEvent.emit({errorCode:o.FETCH_ERROR,message:"Failed to download CSV",severity:i.ERROR})}})},this.handleClickPrevious=t=>{this.pagingParams={before_cursor:t},this.clickEvent.emit({name:A.previous})},this.handleClickNext=t=>{this.pagingParams={after_cursor:t},this.clickEvent.emit({name:A.next})},this.rowClickHandler=t=>{const s=t.target.closest("tr"),e=s.dataset.rowEntityId;if(!e)return;if(s.querySelector("a")===t.target)return;const a=this.payouts.find((t=>t.id===e));this.clickEvent.emit({name:A.row,data:a})}}componentWillLoad(){var s;h(),this.analytics=new r(this),this.initializeGetData(),this.payoutsTable=new y(this.payouts,this.columns,V,(s=this.downloadCSV,{created_at:(s,e)=>t("td",{part:G(e)},t("div",{class:"fw-bold"},E(s.created_at,{showDisplayDate:!0}))),sub_account_name:(s,e)=>t("td",{part:G(e)},s.sub_account_name),payments_total:(s,e)=>t("td",{part:G(e)},s.formattedPaymentAmount(s.payments_total)),refunds_total:(s,e)=>t("td",{part:G(e)},s.formattedPaymentAmount(s.refunds_total)),fees_total:(s,e)=>t("td",{part:G(e)},s.formattedPaymentAmount(s.fees_total)),other_total:(s,e)=>t("td",{part:G(e)},s.formattedPaymentAmount(s.other_total)),amount:(s,e)=>t("td",{part:G(e)},s.formattedPaymentAmount(s.amount)),status:(s,e)=>t("td",{part:G(e)},u(s.status)),csv:(e,a)=>t("td",{part:G(a)},t("a",{href:"#",onClick:t=>{t.preventDefault(),s(e.id)}},"CSV"))})),this.getPayouts&&this.getSubAccounts&&this.fetchData(),L("set",(()=>{this.pagingParams={}})),L("reset",(()=>{this.pagingParams={},this.errorMessage=""}))}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}propChanged(){this.initializeGetData()}updateOnPropChange(){this.fetchData()}initializeGetData(){this.initializePayoutsServices(),this.initializeGetSubAccounts()}initializePayoutsServices(){if(this.accountId&&this.authToken){const t={id:this.accountId,authToken:this.authToken,service:new c};this.getPayouts=(({id:t,authToken:s,service:e})=>async({params:o,onSuccess:r,onError:h})=>{var c,n;try{const u=await e.fetchPayouts(t,s,o);if(u.error)return h({error:d(u.error),code:p(null===(n=u.error)||void 0===n?void 0:n.code),severity:i.ERROR});{const t=Object.assign({},u.page_info);r({payouts:(null===(c=u.data)||void 0===c?void 0:c.map((t=>new a(t))))||[],pagingInfo:t})}}catch(t){const s=p(null==t?void 0:t.code);return h({error:t.message||t,code:s,severity:i.ERROR})}})(t),this.getPayoutCSV=f(t)}else this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:o.MISSING_PROPS,message:this.errorMessage,severity:i.ERROR})}initializeGetSubAccounts(){this.accountId&&this.authToken&&(this.getSubAccounts=m({primaryAccountId:this.accountId,authToken:this.authToken,service:new l}))}fetchData(){this.loading=!0,this.getPayouts({params:this.payoutParams,onSuccess:({payouts:t,pagingInfo:s})=>{this.payouts=t,this.paging=s,this.payoutsTable.collectionData=this.payouts,this.payoutsTable.columnKeys.includes("sub_account_name")?this.fetchSubAccounts():this.loading=!1},onError:({error:t,code:s,severity:e})=>{this.errorMessage=t,this.errorEvent.emit({errorCode:s,message:t,severity:e}),this.loading=!1}})}async fetchSubAccounts(){this.getSubAccounts({params:this.subAccountParams,onSuccess:({subAccounts:t})=>{this.subAccounts=t,this.payouts=this.payouts.map((t=>{var s;return t.sub_account_name=null===(s=this.subAccounts.find((s=>s.id===t.account_id)))||void 0===s?void 0:s.name,t})),this.loading=!1},onError:({error:t,code:s,severity:e})=>{this.errorMessage=t,this.errorEvent.emit({errorCode:s,message:t,severity:e}),this.loading=!1}})}get payoutParams(){const t=M();return Object.assign(Object.assign({},t),this.pagingParams)}get subAccountParams(){const t=this.payouts.map((t=>t.account_id));return{sub_account_id:[...new Set(t)].join(",")}}get entityId(){return this.payouts.map((t=>t.id))}get showEmptyState(){return!this.loading&&!this.errorMessage&&this.payoutsTable.rowData.length<1}get showErrorState(){return!this.loading&&!!this.errorMessage}get showRowData(){return!this.showEmptyState&&!this.showErrorState&&!this.loading}render(){return t(b,{key:"653896fabc4becf531ec119d252cbaea301a0dc6"},t(g,{key:"63787473d67118a7f092bad666c47346872a7834"},t(v,{key:"c17ecce261475c8bfe357ff30d06f189c8f96480"},t(j,{key:"cc23edeff6a1e595671b77fa51c73ff313692b16"},t(C,{key:"4ed5b5ee149538d2de60ee6e27edde55e8d11eaa"},this.payoutsTable.columnData.map((t=>t)))),t(_,{key:"a0a886e70ba99ececd78e5bc34aec065466fe6ce"},t(w,{key:"38bf9109ca73ecfd5c85529a8f7232069ffcdb00",columnSpan:this.payoutsTable.columnKeys.length,isLoading:this.loading}),t(k,{key:"6f5341305ef71f86bbf3680e2c6d0dc461f3d09f",isEmpty:this.showEmptyState,columnSpan:this.payoutsTable.columnKeys.length}),t(S,{key:"bd5e8cc72b460238636546a568645c797807f2d9",columnSpan:this.payoutsTable.columnKeys.length,errorMessage:this.errorMessage}),this.showRowData&&this.payoutsTable.rowData.map(((s,e)=>t(P,{"data-test-id":"table-row","data-row-entity-id":this.entityId[e],onClick:this.rowClickHandler},s)))),this.paging&&t(D,{key:"15145b7ef9cc37a2ad70cea5698d53df069979bf"},t(T,{key:"2d4ed5a1ab5eaf0eaae0bbe35f02edf59c23b22e"},t(O,{key:"11c8505cfd97117afaf79ea68a3fb00570a9c7cb",colSpan:this.payoutsTable.columnData.length},t("pagination-menu",{key:"b8e7e29d4d932f43b3381235de57b63cc6a5283b",paging:Object.assign(Object.assign({},this.paging),{handleClickPrevious:this.handleClickPrevious,handleClickNext:this.handleClickNext})})))))))}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"],pagingParams:["updateOnPropChange"],getPayouts:["updateOnPropChange"],getSubAccounts:["updateOnPropChange"]}}};export{x as justifi_payouts_list}
1
+ import{h as t,r as s,c as e}from"./p-CV0Pyo1O.js";import{k as a,C as i,b as o}from"./p-8fO8CrtQ.js";import{J as r}from"./p-CrvxQRNt.js";import{c as h}from"./p-DfTbkDwg.js";import{P as c}from"./p-fxlKlc2W.js";import"./p-B4vLfYnZ.js";import"./p-HXpYMWUU.js";import{p as n}from"./p-CLHwhyvu.js";import"./p-CTtGaVYs.js";import{g as p,a as d}from"./p-D1H6VUbM.js";import{M as u,m as f}from"./p-Co3Rtlnu.js";import{m,S as l}from"./p-26WAmgkZ.js";import{S as b}from"./p-05AWudQe.js";import{T as y,a as g,b as v,c as j,d as C,e as k,f as w,g as _,h as S,i as T,j as P,k as D,l as O}from"./p-DZr0wLGh.js";import{T as A}from"./p-CZfYo5-1.js";import{a as E}from"./p-Ds_P-dB8.js";import{a6 as x,a7 as G}from"./p-Bu7gdOaV.js";import{o as I,g as V}from"./p-CGnRD4wF.js";import"./p-ryeG8Qmw.js";import"./p-i45EJXKs.js";import"./p-DgTOxu8x.js";import"./p-Dz8KJn2G.js";import"./p-MPer3Rw7.js";const R={created_at:()=>t("th",{part:x,scope:"col",title:"The date the payout was deposited"},"Created"),sub_account_name:()=>t("th",{part:x,scope:"col",title:"The sub account associated with the payout"},"Sub Account"),payments_total:()=>t("th",{part:x,scope:"col",title:"The total payments amount associated with the payout"},"Payments"),refunds_total:()=>t("th",{part:x,scope:"col",title:"The total refunds amount associated with the payout"},"Refunds"),fees_total:()=>t("th",{part:x,scope:"col",title:"The total fees amount associated with the payout"},"Fees"),other_total:()=>t("th",{part:x,scope:"col",title:"The total other amount"},"Other"),amount:()=>t("th",{part:x,scope:"col",title:"The total amount of the payout"},"Amount"),status:()=>t("th",{part:x,scope:"col",title:"The real-time status of each payout"},"Status"),csv:()=>t("th",{part:x,scope:"col",title:"Export CSV"})},L=class{constructor(t){s(this,t),this.errorEvent=e(this,"error-event",7),this.clickEvent=e(this,"click-event",7),this.errorMessage=null,this.payouts=[],this.subAccounts=[],this.loading=!0,this.paging=n,this.pagingParams={},this.columns="created_at,amount,status,payments_total,refunds_total,fees_total,other_total,csv",this.downloadCSV=t=>{this.getPayoutCSV({payoutId:t,onError:()=>{this.errorEvent.emit({errorCode:o.FETCH_ERROR,message:"Failed to download CSV",severity:i.ERROR})}})},this.handleClickPrevious=t=>{this.pagingParams={before_cursor:t},this.clickEvent.emit({name:A.previous})},this.handleClickNext=t=>{this.pagingParams={after_cursor:t},this.clickEvent.emit({name:A.next})},this.rowClickHandler=t=>{const s=t.target.closest("tr"),e=s.dataset.rowEntityId;if(!e)return;if(s.querySelector("a")===t.target)return;const a=this.payouts.find((t=>t.id===e));this.clickEvent.emit({name:A.row,data:a})}}componentWillLoad(){var s;h(),this.analytics=new r(this),this.initializeGetData(),this.payoutsTable=new y(this.payouts,this.columns,R,(s=this.downloadCSV,{created_at:(s,e)=>t("td",{part:G(e)},t("div",{class:"fw-bold"},E(s.created_at,{showDisplayDate:!0}))),sub_account_name:(s,e)=>t("td",{part:G(e)},s.sub_account_name),payments_total:(s,e)=>t("td",{part:G(e)},s.formattedPaymentAmount(s.payments_total)),refunds_total:(s,e)=>t("td",{part:G(e)},s.formattedPaymentAmount(s.refunds_total)),fees_total:(s,e)=>t("td",{part:G(e)},s.formattedPaymentAmount(s.fees_total)),other_total:(s,e)=>t("td",{part:G(e)},s.formattedPaymentAmount(s.other_total)),amount:(s,e)=>t("td",{part:G(e)},s.formattedPaymentAmount(s.amount)),status:(s,e)=>t("td",{part:G(e)},u(s.status)),csv:(e,a)=>t("td",{part:G(a)},t("a",{href:"#",onClick:t=>{t.preventDefault(),s(e.id)}},"CSV"))})),this.getPayouts&&this.getSubAccounts&&this.fetchData(),I("set",(()=>{this.pagingParams={}})),I("reset",(()=>{this.pagingParams={},this.errorMessage=""}))}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}propChanged(){this.initializeGetData()}updateOnPropChange(){this.fetchData()}initializeGetData(){this.initializePayoutsServices(),this.initializeGetSubAccounts()}initializePayoutsServices(){if(this.accountId&&this.authToken){const t={id:this.accountId,authToken:this.authToken,service:new c};this.getPayouts=(({id:t,authToken:s,service:e})=>async({params:o,onSuccess:r,onError:h})=>{var c,n;try{const u=await e.fetchPayouts(t,s,o);if(u.error)return h({error:d(u.error),code:p(null===(n=u.error)||void 0===n?void 0:n.code),severity:i.ERROR});{const t=Object.assign({},u.page_info);r({payouts:(null===(c=u.data)||void 0===c?void 0:c.map((t=>new a(t))))||[],pagingInfo:t})}}catch(t){const s=p(null==t?void 0:t.code);return h({error:t.message||t,code:s,severity:i.ERROR})}})(t),this.getPayoutCSV=f(t)}else this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:o.MISSING_PROPS,message:this.errorMessage,severity:i.ERROR})}initializeGetSubAccounts(){this.accountId&&this.authToken&&(this.getSubAccounts=m({primaryAccountId:this.accountId,authToken:this.authToken,service:new l}))}fetchData(){this.loading=!0,this.getPayouts({params:this.payoutParams,onSuccess:({payouts:t,pagingInfo:s})=>{this.payouts=t,this.paging=s,this.payoutsTable.collectionData=this.payouts,this.payoutsTable.columnKeys.includes("sub_account_name")?this.fetchSubAccounts():this.loading=!1},onError:({error:t,code:s,severity:e})=>{this.errorMessage=t,this.errorEvent.emit({errorCode:s,message:t,severity:e}),this.loading=!1}})}async fetchSubAccounts(){this.getSubAccounts({params:this.subAccountParams,onSuccess:({subAccounts:t})=>{this.subAccounts=t,this.payouts=this.payouts.map((t=>{var s;return t.sub_account_name=null===(s=this.subAccounts.find((s=>s.id===t.account_id)))||void 0===s?void 0:s.name,t})),this.loading=!1},onError:({error:t,code:s,severity:e})=>{this.errorMessage=t,this.errorEvent.emit({errorCode:s,message:t,severity:e}),this.loading=!1}})}get payoutParams(){const t=V();return Object.assign(Object.assign({},t),this.pagingParams)}get subAccountParams(){const t=this.payouts.map((t=>t.account_id));return{sub_account_id:[...new Set(t)].join(",")}}get entityId(){return this.payouts.map((t=>t.id))}get showEmptyState(){return!this.loading&&!this.errorMessage&&this.payoutsTable.rowData.length<1}get showErrorState(){return!this.loading&&!!this.errorMessage}get showRowData(){return!this.showEmptyState&&!this.showErrorState&&!this.loading}render(){return t(b,{key:"653896fabc4becf531ec119d252cbaea301a0dc6"},t(g,{key:"63787473d67118a7f092bad666c47346872a7834"},t(v,{key:"c17ecce261475c8bfe357ff30d06f189c8f96480"},t(j,{key:"cc23edeff6a1e595671b77fa51c73ff313692b16"},t(C,{key:"4ed5b5ee149538d2de60ee6e27edde55e8d11eaa"},this.payoutsTable.columnData.map((t=>t)))),t(k,{key:"a0a886e70ba99ececd78e5bc34aec065466fe6ce"},t(w,{key:"38bf9109ca73ecfd5c85529a8f7232069ffcdb00",columnSpan:this.payoutsTable.columnKeys.length,isLoading:this.loading}),t(_,{key:"6f5341305ef71f86bbf3680e2c6d0dc461f3d09f",isEmpty:this.showEmptyState,columnSpan:this.payoutsTable.columnKeys.length}),t(S,{key:"bd5e8cc72b460238636546a568645c797807f2d9",columnSpan:this.payoutsTable.columnKeys.length,errorMessage:this.errorMessage}),this.showRowData&&this.payoutsTable.rowData.map(((s,e)=>t(T,{"data-test-id":"table-row","data-row-entity-id":this.entityId[e],onClick:this.rowClickHandler},s)))),this.paging&&t(P,{key:"15145b7ef9cc37a2ad70cea5698d53df069979bf"},t(D,{key:"2d4ed5a1ab5eaf0eaae0bbe35f02edf59c23b22e"},t(O,{key:"11c8505cfd97117afaf79ea68a3fb00570a9c7cb",colSpan:this.payoutsTable.columnData.length},t("pagination-menu",{key:"b8e7e29d4d932f43b3381235de57b63cc6a5283b",paging:Object.assign(Object.assign({},this.paging),{handleClickPrevious:this.handleClickPrevious,handleClickNext:this.handleClickNext})})))))))}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"],pagingParams:["updateOnPropChange"],getPayouts:["updateOnPropChange"],getSubAccounts:["updateOnPropChange"]}}};export{L as justifi_payouts_list}
@@ -1 +1 @@
1
- import{h as t,r as s,c as i}from"./p-CV0Pyo1O.js";import{A as e}from"./p-WnMmPpEb.js";import{C as r,b as o}from"./p-8fO8CrtQ.js";import"./p-CLHwhyvu.js";import"./p-DaDqgDrb.js";import{g as a,a as n}from"./p-D1H6VUbM.js";import{J as c}from"./p-C8g8unYJ.js";import{c as l}from"./p-DcA_wt-j.js";import{c as h}from"./p-DNxN6bjU.js";import{p as d,f as p,r as u,i as v}from"./p-Ds_P-dB8.js";import{v as m,i as y,a as f,H as j}from"./p-x2oNTAWh.js";import{t as g,z as _}from"./p-Bu7gdOaV.js";import{S as b}from"./p-05AWudQe.js";import"./p-CZfYo5-1.js";import{S as k}from"./p-eBK-iWrz.js";import"./p-B4vLfYnZ.js";import"./p-DgTOxu8x.js";import"./p-CiypNylL.js";import"./p-DkoufM1t.js";import"./p-HXpYMWUU.js";const w=e();class C{async fetchQuote(t,s){return w.post({endpoint:"insurance/quotes",body:s,authToken:t})}async toggleCoverage(t,s,i){return w.post({endpoint:`insurance/quotes/${s}/toggle`,body:i,authToken:t})}}const T=()=>t("div",{class:"row gap-3"},t("div",{class:"col-12"},t(k,{width:"35%",height:"30px"})),t("div",{class:"col-12"},t(k,{width:"70%"})),t("div",{class:"col-12"},t(k,{width:"40%"})),t("div",{class:"col-12"},t(k,{width:"40%"})),t("div",{class:"col-12"},t(k,{width:"100%"})),t("div",{class:"col-12"},t(k,{width:"80%"}))),D=class{constructor(t){s(this,t),this.insuranceUpdated=i(this,"insurance-updated",7),this.errorEvent=i(this,"error-event",7),this.isLoading=!0}async validate(){return m()}processHTMLContent(t){return d(t,[t=>u(t,"style"),t=>v(t,"a","part",g),t=>v(t,"p","part",g)])}componentWillLoad(){l(),this.analytics=new c(this),this.initializeServiceMethods(),this.getQuote&&this.fetchData()}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}initializeServiceMethods(){const t=this.authToken||h.authToken;if(!t)return void this.errorEvent.emit({errorCode:o.MISSING_PROPS,message:"Missing authToken",severity:r.ERROR});const s={authToken:t,service:new C};this.getQuote=(({authToken:t,service:s})=>async({payload:i,onSuccess:e,onError:o})=>{var c;try{const l=await s.fetchQuote(t,i);if(l.error)return o({error:n(l.error),code:a(null===(c=l.error)||void 0===c?void 0:c.code),severity:r.ERROR});e({quote:l.data})}catch(t){const s=a(null==t?void 0:t.code);return o({error:t.message||t,code:s,severity:r.ERROR})}})(s),this.toggleCoverage=(({authToken:t,service:s})=>async({quoteId:i,payload:e,onSuccess:o,onError:c})=>{var l;try{const h=await s.toggleCoverage(t,i,e);if(h.error)return c({error:n(h.error),code:a(null===(l=h.error)||void 0===l?void 0:l.code),severity:r.ERROR});o({quote:h.data})}catch(t){const s=a(null==t?void 0:t.code);return c({error:t.message||t,code:s,severity:r.ERROR})}})(s)}fetchData(){this.isLoading=!0,this.getQuote({payload:{checkout_id:this.checkoutId||h.checkoutId,policy_type:"season_interruption",primary_identity:{state:this.primaryIdentityState,email:this.primaryIdentityEmailAddress,first_name:this.primaryIdentityFirstName,last_name:this.primaryIdentityLastName,postal_code:this.primaryIdentityPostalCode,country:this.primaryIdentityCountry},policy_attributes:{insurable_amount:this.policyAttributesInsurableAmount,start_date:this.policyAttributesStartDate,end_date:this.policyAttributesEndDate,covered_identity:{first_name:this.coveredIdentityFirstName,last_name:this.coveredIdentityLastName}}},onSuccess:({quote:t})=>{this.quote=t,this.quote.product.description=this.processHTMLContent(this.quote.product.description),this.quote.product.legal_disclaimer=this.processHTMLContent(this.quote.product.legal_disclaimer),y[t.policy_type]=t.accepted,this.isLoading=!1},onError:({error:t,code:s,severity:i})=>{this.isLoading=!1,this.errorEvent.emit({errorCode:s,message:t,severity:i})}})}onChangeHandler(t,s){this.accepted=s,f[this.quote.policy_type]=!1,this.toggleCoverage({quoteId:this.quote.id,payload:{accepted:this.accepted},onSuccess:()=>{this.insuranceUpdated.emit(),y[this.quote.policy_type]=this.accepted},onError:({error:t,code:s,severity:i})=>{this.errorEvent.emit({errorCode:s,message:t,severity:i})}})}get error(){var t;return f[null===(t=this.quote)||void 0===t?void 0:t.policy_type]}render(){var s,i,e,r;return h&&!1===h.insuranceEnabled?(console.warn("[justifi-season-interruption-insurance] Insurance is disabled for this checkout (payment_settings.insurance_payments=false)."),null):t(b,null,this.isLoading?t(T,null):t("div",null,t(j,{text:null===(s=this.quote)||void 0===s?void 0:s.product.title,class:"fs-5 fw-bold pb-3"}),t("small",{part:g,innerHTML:null===(i=this.quote)||void 0===i?void 0:i.product.description}),t("form-control-radio",{label:`Accept coverage for ${p(null===(e=this.quote)||void 0===e?void 0:e.total_cents)}`,name:"opt-in",value:"true",checked:"true"===this.accepted,inputHandler:this.onChangeHandler.bind(this),errorText:this.error?" ":void 0}),t("form-control-radio",{label:"Decline coverage",name:"opt-in",value:"false",checked:"false"===this.accepted,inputHandler:this.onChangeHandler.bind(this),errorText:this.error?" ":void 0}),t("div",{class:"invalid-feedback",style:{display:this.error?"block":"none"},part:_},"Please select an option"),t("small",{part:g,innerHTML:null===(r=this.quote)||void 0===r?void 0:r.product.legal_disclaimer})))}};export{D as justifi_season_interruption_insurance}
1
+ import{h as t,r as s,c as i}from"./p-CV0Pyo1O.js";import{A as e}from"./p-i45EJXKs.js";import{C as r,b as o}from"./p-8fO8CrtQ.js";import"./p-CLHwhyvu.js";import"./p-CTtGaVYs.js";import{g as a,a as n}from"./p-D1H6VUbM.js";import{J as c}from"./p-CrvxQRNt.js";import{c as l}from"./p-DfTbkDwg.js";import{c as h}from"./p-DNxN6bjU.js";import{p as d,f as p,r as u,i as v}from"./p-Ds_P-dB8.js";import{v as m,i as f,a as y,H as j}from"./p-x2oNTAWh.js";import{t as g,z as _}from"./p-Bu7gdOaV.js";import{S as b}from"./p-05AWudQe.js";import"./p-CZfYo5-1.js";import{S as k}from"./p-eBK-iWrz.js";import"./p-B4vLfYnZ.js";import"./p-DgTOxu8x.js";import"./p-ryeG8Qmw.js";import"./p-DkoufM1t.js";import"./p-HXpYMWUU.js";const w=e();class T{async fetchQuote(t,s){return w.post({endpoint:"insurance/quotes",body:s,authToken:t})}async toggleCoverage(t,s,i){return w.post({endpoint:`insurance/quotes/${s}/toggle`,body:i,authToken:t})}}const C=()=>t("div",{class:"row gap-3"},t("div",{class:"col-12"},t(k,{width:"35%",height:"30px"})),t("div",{class:"col-12"},t(k,{width:"70%"})),t("div",{class:"col-12"},t(k,{width:"40%"})),t("div",{class:"col-12"},t(k,{width:"40%"})),t("div",{class:"col-12"},t(k,{width:"100%"})),t("div",{class:"col-12"},t(k,{width:"80%"}))),x=class{constructor(t){s(this,t),this.insuranceUpdated=i(this,"insurance-updated",7),this.errorEvent=i(this,"error-event",7),this.isLoading=!0}async validate(){return m()}processHTMLContent(t){return d(t,[t=>u(t,"style"),t=>v(t,"a","part",g),t=>v(t,"p","part",g)])}componentWillLoad(){l(),this.analytics=new c(this),this.initializeServiceMethods(),this.getQuote&&this.fetchData()}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}initializeServiceMethods(){const t=this.authToken||h.authToken;if(!t)return void this.errorEvent.emit({errorCode:o.MISSING_PROPS,message:"Missing authToken",severity:r.ERROR});const s={authToken:t,service:new T};this.getQuote=(({authToken:t,service:s})=>async({payload:i,onSuccess:e,onError:o})=>{var c;try{const l=await s.fetchQuote(t,i);if(l.error)return o({error:n(l.error),code:a(null===(c=l.error)||void 0===c?void 0:c.code),severity:r.ERROR});e({quote:l.data})}catch(t){const s=a(null==t?void 0:t.code);return o({error:t.message||t,code:s,severity:r.ERROR})}})(s),this.toggleCoverage=(({authToken:t,service:s})=>async({quoteId:i,payload:e,onSuccess:o,onError:c})=>{var l;try{const h=await s.toggleCoverage(t,i,e);if(h.error)return c({error:n(h.error),code:a(null===(l=h.error)||void 0===l?void 0:l.code),severity:r.ERROR});o({quote:h.data})}catch(t){const s=a(null==t?void 0:t.code);return c({error:t.message||t,code:s,severity:r.ERROR})}})(s)}fetchData(){this.isLoading=!0,this.getQuote({payload:{checkout_id:this.checkoutId||h.checkoutId,policy_type:"season_interruption",primary_identity:{state:this.primaryIdentityState,email:this.primaryIdentityEmailAddress,first_name:this.primaryIdentityFirstName,last_name:this.primaryIdentityLastName,postal_code:this.primaryIdentityPostalCode,country:this.primaryIdentityCountry},policy_attributes:{insurable_amount:this.policyAttributesInsurableAmount,start_date:this.policyAttributesStartDate,end_date:this.policyAttributesEndDate,covered_identity:{first_name:this.coveredIdentityFirstName,last_name:this.coveredIdentityLastName}}},onSuccess:({quote:t})=>{this.quote=t,this.quote.product.description=this.processHTMLContent(this.quote.product.description),this.quote.product.legal_disclaimer=this.processHTMLContent(this.quote.product.legal_disclaimer),f[t.policy_type]=t.accepted,this.isLoading=!1},onError:({error:t,code:s,severity:i})=>{this.isLoading=!1,this.errorEvent.emit({errorCode:s,message:t,severity:i})}})}onChangeHandler(t,s){this.accepted=s,y[this.quote.policy_type]=!1,this.toggleCoverage({quoteId:this.quote.id,payload:{accepted:this.accepted},onSuccess:()=>{this.insuranceUpdated.emit(),f[this.quote.policy_type]=this.accepted},onError:({error:t,code:s,severity:i})=>{this.errorEvent.emit({errorCode:s,message:t,severity:i})}})}get error(){var t;return y[null===(t=this.quote)||void 0===t?void 0:t.policy_type]}render(){var s,i,e,r;return h&&!1===h.insuranceEnabled?(console.warn("[justifi-season-interruption-insurance] Insurance is disabled for this checkout (payment_settings.insurance_payments=false)."),null):t(b,null,this.isLoading?t(C,null):t("div",null,t(j,{text:null===(s=this.quote)||void 0===s?void 0:s.product.title,class:"fs-5 fw-bold pb-3"}),t("small",{part:g,innerHTML:null===(i=this.quote)||void 0===i?void 0:i.product.description}),t("form-control-radio",{label:`Accept coverage for ${p(null===(e=this.quote)||void 0===e?void 0:e.total_cents)}`,name:"opt-in",value:"true",checked:"true"===this.accepted,inputHandler:this.onChangeHandler.bind(this),errorText:this.error?" ":void 0}),t("form-control-radio",{label:"Decline coverage",name:"opt-in",value:"false",checked:"false"===this.accepted,inputHandler:this.onChangeHandler.bind(this),errorText:this.error?" ":void 0}),t("div",{class:"invalid-feedback",style:{display:this.error?"block":"none"},part:_},"Please select an option"),t("small",{part:g,innerHTML:null===(r=this.quote)||void 0===r?void 0:r.product.legal_disclaimer})))}};export{x as justifi_season_interruption_insurance}
@@ -0,0 +1 @@
1
+ import{h as s,r as t,c as i}from"./p-CV0Pyo1O.js";import{c as e,F as r}from"./p-D9sqTVmd.js";import{b as o,i as a,a as h,c as n,d as p,e as l,f as m}from"./p-RoSunhgN.js";import"./p-B4vLfYnZ.js";import"./p-HXpYMWUU.js";import{C as d,b as c}from"./p-8fO8CrtQ.js";import"./p-CLHwhyvu.js";import{C as u,B as j,b as f}from"./p-CTtGaVYs.js";import{J as v}from"./p-CrvxQRNt.js";import{B as b}from"./p-CU2Dwa94.js";import{S as g}from"./p-05AWudQe.js";import{H as w}from"./p-CZk3i5Tu.js";import"./p-CZfYo5-1.js";import{c as C}from"./p-DfTbkDwg.js";import{S as y}from"./p-eBK-iWrz.js";import{B as D}from"./p-XYgDHrVL.js";import{m as B,a as x}from"./p-DD9-ceDZ.js";import{B as O}from"./p-C42DoBRr.js";import"./p-BFTU3MAI.js";import"./p-DX2Fz9jh.js";import"./p-riZDHN5-.js";import"./p-CtlBL-X6.js";import"./p-DgTOxu8x.js";import"./p-Ds_P-dB8.js";import"./p-ryeG8Qmw.js";import"./p-i45EJXKs.js";import"./p-Bu7gdOaV.js";import"./p-D1H6VUbM.js";const k=e(Object.assign(Object.assign({},o().fields),{legal_address:n(),additional_questions:h(),representative:a("representative")}));e(Object.assign(Object.assign({},p().fields),{legal_address:m(),additional_questions:h(),representative:l("representative")}));const S=k,T=()=>s("div",{class:"row gap-3"},s("div",{class:"col-12"},s(y,{width:"25%"})),s("div",{class:"col-12"},s(y,{width:"100%"})),s("div",{class:"col-12 d-flex gap-3"},s(y,{width:"50%"}),s(y,{width:"50%"})),s("div",{class:"col-12 d-flex gap-3"},s(y,{width:"65%"}),s(y,{width:"35%"}))),_=()=>s("div",{class:"row gap-5"},s("div",{class:"col-12"},s(y,{width:"40%",height:"40px"})),s(T,null),s(T,null),s(T,null)),H=class{constructor(s){t(this,s),this.submitEvent=i(this,"submit-event",7),this.clickEvent=i(this,"click-event",7),this.errorEvent=i(this,"error-event",7),this.isLoading=!1,this.isSaving=!1,this.country=u.USA,this.hideErrors=!1,this.formTitle="Business Information",this.removeTitle=!1,this.instantiateBusiness=s=>{const t=new j(s);this.country=t.country_of_establishment,this.formController.setInitialValues(Object.assign({},t))},this.sendData=async()=>{this.isSaving=!0;const s=this.formController.values.getValue(),t=this.formController.getInitialValues(),i=new j(Object.assign(Object.assign({},t),s)).payload;this.patchBusiness({payload:i,onSuccess:s=>{this.handleReponse(s)},onError:({error:s,code:t,severity:i})=>{this.errorMessage=s.message,this.errorEvent.emit({errorCode:t,message:s.message,severity:i})},final:()=>{this.isSaving=!1}})},this.validateAndSubmit=s=>{s.preventDefault(),this.formController.validateAndSubmit(this.sendData)}}componentWillLoad(){C(),this.analytics=new v(this),this.formController=new r(S),this.initializeApi()}disconnectedCallback(){var s;null===(s=this.analytics)||void 0===s||s.cleanup()}get title(){return this.removeTitle?"":this.formTitle}get disabledState(){return this.isSaving}get businessEndpoint(){return`entities/business/${this.businessId}`}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=B({authToken:this.authToken,businessId:this.businessId,service:new O}),this.patchBusiness=x({authToken:this.authToken,businessId:this.businessId,service:new O}),this.getBusiness({onSuccess:s=>{this.instantiateBusiness(s.data)},onError:({error:s,code:t,severity:i})=>{this.errorMessage=s.message,this.errorEvent.emit({errorCode:t,message:s.message,severity:i})},final:()=>{this.isLoading=!1}})):this.errorEvent.emit({message:"auth-token and business-id are required",errorCode:c.MISSING_PROPS,severity:d.ERROR})}handleReponse(s){s.error&&(this.errorMessage=f.patchData),this.submitEvent.emit({response:s}),this.instantiateBusiness(s.data)}render(){return s(g,null,this.isLoading?s(_,null):s("form",{onSubmit:this.validateAndSubmit},s("div",{class:"row gap-3"},s(w,{text:this.title}),s("form-alert",{text:this.errorMessage,hideAlert:this.hideErrors}),s("div",{class:"col-12 mb-4"},s("business-core-info",{formController:this.formController,country:this.country})),s("div",{class:"col-12 mb-4"},s("legal-address-form",{formController:this.formController,country:this.country})),s("div",{class:"col-12 mb-4"},s("additional-questions",{formController:this.formController})),s("div",{class:"col-12 mb-4"},s("business-representative",{formController:this.formController,country:this.country})),s("div",{class:"col-12 d-flex flex-row-reverse"},s(b,{type:"submit",disabled:this.disabledState,variant:"primary",onClick:()=>this.clickEvent.emit({name:D.submit}),isLoading:this.isSaving},"Submit")))))}};export{H as justifi_business_form}