@justifi/webcomponents 6.7.0 → 6.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/dist/cjs/{check-pkg-version-nSgWWvdw.js → check-pkg-version-cLAIX_H6.js} +1 -1
  2. package/dist/cjs/hidden-input_2.cjs.entry.js +1 -1
  3. package/dist/cjs/internal-tokenize-payment-method_7.cjs.entry.js +2 -2
  4. package/dist/cjs/justifi-apple-pay_8.cjs.entry.js +7 -6
  5. package/dist/cjs/justifi-business-details.cjs.entry.js +2 -2
  6. package/dist/cjs/justifi-business-form.cjs.entry.js +2 -2
  7. package/dist/cjs/justifi-checkout.cjs.entry.js +2 -2
  8. package/dist/cjs/justifi-checkouts-list.cjs.entry.js +2 -2
  9. package/dist/cjs/justifi-dispute-management.cjs.entry.js +2 -2
  10. package/dist/cjs/justifi-dispute-notification_3.cjs.entry.js +2 -2
  11. package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +2 -2
  12. package/dist/cjs/justifi-order-terminals.cjs.entry.js +2 -2
  13. package/dist/cjs/justifi-payment-details.cjs.entry.js +2 -2
  14. package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +2 -2
  15. package/dist/cjs/justifi-payment-transactions-list.cjs.entry.js +2 -2
  16. package/dist/cjs/justifi-payments-list.cjs.entry.js +2 -2
  17. package/dist/cjs/justifi-payout-details.cjs.entry.js +2 -2
  18. package/dist/cjs/justifi-payout-transactions-list.cjs.entry.js +2 -2
  19. package/dist/cjs/justifi-payouts-list.cjs.entry.js +2 -2
  20. package/dist/cjs/justifi-refund-payment.cjs.entry.js +2 -2
  21. package/dist/cjs/justifi-season-interruption-insurance.cjs.entry.js +2 -2
  22. package/dist/cjs/justifi-terminal-orders-list.cjs.entry.js +2 -2
  23. package/dist/cjs/justifi-terminals-list.cjs.entry.js +2 -2
  24. package/dist/cjs/{package-B8gOzTFM.js → package-C9E_BIbT.js} +1 -1
  25. package/dist/collection/api/services/google-pay.service.js +2 -1
  26. package/dist/collection/components/modular-checkout/sub-components/google-pay.js +3 -3
  27. package/dist/docs.json +1 -1
  28. package/dist/esm/{check-pkg-version-CmkUoEAo.js → check-pkg-version-o2X_8wJ4.js} +1 -1
  29. package/dist/esm/hidden-input_2.entry.js +1 -1
  30. package/dist/esm/internal-tokenize-payment-method_7.entry.js +2 -2
  31. package/dist/esm/justifi-apple-pay_8.entry.js +7 -6
  32. package/dist/esm/justifi-business-details.entry.js +2 -2
  33. package/dist/esm/justifi-business-form.entry.js +2 -2
  34. package/dist/esm/justifi-checkout.entry.js +2 -2
  35. package/dist/esm/justifi-checkouts-list.entry.js +2 -2
  36. package/dist/esm/justifi-dispute-management.entry.js +2 -2
  37. package/dist/esm/justifi-dispute-notification_3.entry.js +2 -2
  38. package/dist/esm/justifi-gross-payment-chart.entry.js +2 -2
  39. package/dist/esm/justifi-order-terminals.entry.js +2 -2
  40. package/dist/esm/justifi-payment-details.entry.js +2 -2
  41. package/dist/esm/justifi-payment-provisioning.entry.js +2 -2
  42. package/dist/esm/justifi-payment-transactions-list.entry.js +2 -2
  43. package/dist/esm/justifi-payments-list.entry.js +2 -2
  44. package/dist/esm/justifi-payout-details.entry.js +2 -2
  45. package/dist/esm/justifi-payout-transactions-list.entry.js +2 -2
  46. package/dist/esm/justifi-payouts-list.entry.js +2 -2
  47. package/dist/esm/justifi-refund-payment.entry.js +2 -2
  48. package/dist/esm/justifi-season-interruption-insurance.entry.js +2 -2
  49. package/dist/esm/justifi-terminal-orders-list.entry.js +2 -2
  50. package/dist/esm/justifi-terminals-list.entry.js +2 -2
  51. package/dist/esm/{package-CsRppqXL.js → package-Dr8Z8wfP.js} +1 -1
  52. package/dist/module/google-pay.js +5 -4
  53. package/dist/module/package.js +1 -1
  54. package/dist/types/api/services/google-pay.service.d.ts +1 -1
  55. package/dist/webcomponents/{p-50400c5e.entry.js → p-062fcfd5.entry.js} +1 -1
  56. package/dist/webcomponents/{p-f5dd3fa4.entry.js → p-1df660a9.entry.js} +1 -1
  57. package/dist/webcomponents/{p-ff5981fb.entry.js → p-262e4b23.entry.js} +1 -1
  58. package/dist/webcomponents/{p-b5b49e86.entry.js → p-296bd0b6.entry.js} +1 -1
  59. package/dist/webcomponents/p-3fb1cf2b.entry.js +1 -0
  60. package/dist/webcomponents/{p-eada0422.entry.js → p-3fbe8ac3.entry.js} +1 -1
  61. package/dist/webcomponents/{p-c0bd4e9a.entry.js → p-4dc358aa.entry.js} +1 -1
  62. package/dist/webcomponents/p-5a7207c0.entry.js +1 -0
  63. package/dist/webcomponents/{p-74fea39c.entry.js → p-5e6f2128.entry.js} +1 -1
  64. package/dist/webcomponents/{p-095cedc5.entry.js → p-7bb7aaca.entry.js} +1 -1
  65. package/dist/webcomponents/{p-f23428da.entry.js → p-8884e000.entry.js} +1 -1
  66. package/dist/webcomponents/{p-DISrhs4v.js → p-BEu9YFnf.js} +1 -1
  67. package/dist/webcomponents/p-Dr8Z8wfP.js +1 -0
  68. package/dist/webcomponents/{p-87988b4d.entry.js → p-abcb4945.entry.js} +1 -1
  69. package/dist/webcomponents/{p-04ec17bb.entry.js → p-ad3a73af.entry.js} +1 -1
  70. package/dist/webcomponents/{p-fc8f55d7.entry.js → p-c8a5a2a9.entry.js} +1 -1
  71. package/dist/webcomponents/p-ca0d1c6c.entry.js +1 -0
  72. package/dist/webcomponents/{p-fe73b09b.entry.js → p-cbd52897.entry.js} +1 -1
  73. package/dist/webcomponents/p-cc0c722c.entry.js +1 -0
  74. package/dist/webcomponents/{p-d2981754.entry.js → p-cc2a1c7c.entry.js} +1 -1
  75. package/dist/webcomponents/{p-b2a0cbad.entry.js → p-cf644e46.entry.js} +1 -1
  76. package/dist/webcomponents/p-d5765545.entry.js +1 -0
  77. package/dist/webcomponents/{p-d9cdd873.entry.js → p-def84700.entry.js} +1 -1
  78. package/dist/webcomponents/{p-c4585b68.entry.js → p-e2d33311.entry.js} +1 -1
  79. package/dist/webcomponents/webcomponents.esm.js +1 -1
  80. package/package.json +1 -1
  81. package/dist/webcomponents/p-0e981c28.entry.js +0 -1
  82. package/dist/webcomponents/p-15ceeea7.entry.js +0 -1
  83. package/dist/webcomponents/p-9c1aa22d.entry.js +0 -1
  84. package/dist/webcomponents/p-CsRppqXL.js +0 -1
  85. package/dist/webcomponents/p-aa145996.entry.js +0 -1
  86. package/dist/webcomponents/p-ef04f334.entry.js +0 -1
@@ -1 +1 @@
1
- import{h as t,r as e,c as a}from"./p-DwYM91AU.js";import"./p-tGDdRx0W.js";import"./p-HXpYMWUU.js";import{C as s,a as i}from"./p-Cjcsf8ku.js";import{h as r}from"./p-BrRsgB8S.js";import{p as n}from"./p-CLHwhyvu.js";import"./p-B5rtFhtR.js";import"./p-BH0Xfn-F.js";import{c as o,J as c}from"./p-DISrhs4v.js";import{g as p,a as h}from"./p-D2muobcE.js";import{P as d}from"./p-DGGjRqDa.js";import{T as f,l,a as u,b as m,c as y,d as b,e as _,f as g,g as j,h as k,i as T,j as w,k as v}from"./p-BMJe4lzg.js";import{S as D}from"./p-BP2sTIQV.js";import{T as C}from"./p-CZfYo5-1.js";import{a as R}from"./p-B09GVew-.js";import{V as S,W as I}from"./p-sA8HBfkI.js";import"./p-BYsgavgS.js";import"./p-DkoufM1t.js";import"./p-CsRppqXL.js";import"./p-yyedWKWX.js";import"./p-CgiDds_u.js";const B={created_at:()=>t("th",{part:S,scope:"col",title:"The date and time each transaction was made"},"Processed On"),type:()=>t("th",{part:S,scope:"col",title:"The type of each transaction"},"Type"),id:()=>t("th",{part:S,scope:"col",title:"The unique identifier of each transaction"},"ID"),amount:()=>t("th",{part:S,scope:"col",title:"The dollar amount of each transaction",class:"text-end"},"Amount"),balance:()=>t("th",{part:S,scope:"col",title:"The running total amount of this payment that belongs to you",class:"text-end"},"Balance"),currency:()=>t("th",{part:S,scope:"col",title:"The currency of each transaction"},"Currency"),financial_transaction_id:()=>t("th",{part:S,scope:"col",title:"The unique identifier of the financial transaction associated with the payment balance transaction"},"Financial Transaction ID"),payment_id:()=>t("th",{part:S,scope:"col",title:"The unique identifier of the payment associated with the payment balance transaction"},"Payment ID"),payment_balance_txn_type:()=>t("th",{part:S,scope:"col",title:"The type of the payment balance transaction"},"Transaction Type"),source_id:()=>t("th",{part:S,scope:"col",title:"The unique identifier of the source object associated with the payment balance transaction"},"Source ID"),source_type:()=>t("th",{part:S,scope:"col",title:"The type of the source object associated with the payment balance transaction"},"Source Type")},F={ach_return:"ACH Return",ach_return_fee:"ACH Return Fee",dispute:"Dispute",dispute_fee:"Dispute Fee",dispute_fee_refund:"Dispute Fee Refund",dispute_refund:"Dispute Refund",payment:"Payment",payment_fee:"Fee",refund:"Refund",fee_refund:"Fee Refund",application_fee_returned:"Application Fee Returned",refund_failure:"Refund Failure",void:"Void"},x={created_at:(e,a)=>t("td",{part:I(a)},t("div",{class:"fw-bold"},R(e.created_at,{showDisplayDate:!0})),t("div",{class:"fw-bold"},R(e.created_at,{showTime:!0}))),type:(e,a)=>t("td",{part:I(a)},F[e.payment_balance_txn_type]),id:(e,a)=>t("td",{part:I(a)},e.id),amount:(e,a)=>t("td",{part:I(a),class:"text-end"},e.formattedPaymentAmount(e.amount)),balance:(e,a)=>t("td",{part:I(a),class:"text-end"},e.formattedPaymentAmount(e.balance)),currency:(e,a)=>t("td",{part:I(a)},e.currency),financial_transaction_id:(e,a)=>t("td",{part:I(a)},e.financial_transaction_id),payment_id:(e,a)=>t("td",{part:I(a)},e.payment_id),payment_balance_txn_type:(e,a)=>t("td",{part:I(a)},e.payment_balance_txn_type),source_id:(e,a)=>t("td",{part:I(a)},e.source_id),source_type:(e,a)=>t("td",{part:I(a)},e.source_type)},q=class{constructor(t){e(this,t),this.clickEvent=a(this,"click-event"),this.errorEvent=a(this,"error-event"),this.balanceTransactions=[],this.isLoading=!0,this.errorMessage=null,this.paging=n,this.pagingParams={},this.columns="created_at,type,id,amount,balance",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,B,x),o(),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.paymentId&&this.authToken?(({id:t,authToken:e,service:a})=>async({params:i,onSuccess:n,onError:o,final:c})=>{var d;try{const c=await a.fetchPaymentTransactions(t,e,i);c.error?o({error:h(c.error),code:p(null===(d=c.error)||void 0===d?void 0:d.code),severity:s.ERROR}):n({balanceTransactions:c.data.map((t=>new r(t))),pagingInfo:Object.assign({},c.page_info)})}catch(t){const e=p(null==t?void 0:t.code);o({error:h(t),code:e,severity:s.ERROR})}finally{c()}})({id:this.paymentId,authToken:this.authToken,service:new d})({params:this.pagingParams,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="payment-id and auth-token props are required",this.handleError(i.MISSING_PROPS,this.errorMessage,s.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}render(){return t(D,{key:"8a307277a1953bea93e7b15d2774700f07319c87"},t(l,{key:"1097f6a329292851cfcdd16240fa5f161f8aa7e4"},t(u,{key:"9ae196b35c90391de0d9a31f79c732e6de991b08"},t(m,{key:"a7eaab567c42bb2676b91259363b9c4bee2683df"},t(y,{key:"461752dafb18db32ef0367d90cb1482980e92187"},this.transactionsTable.columnData.map((t=>t)))),t(b,{key:"5c0ce55bd2ad81de73866c869818820568233422"},t(_,{key:"8a54d3632e2193576a2e5037c9d7b8a614fcd5b6",columnSpan:this.transactionsTable.columnKeys.length,isLoading:this.isLoading}),t(g,{key:"6fab4a7cce6678a30992be71c702fab2259c2b49",isEmpty:this.showEmptyState,columnSpan:this.transactionsTable.columnKeys.length}),t(j,{key:"8ab1c46ecbd0d2ed98dacf9edcd690054a90c081",columnSpan:this.transactionsTable.columnKeys.length,errorMessage:this.errorMessage}),this.showRowData&&this.transactionsTable.rowData.map(((e,a)=>t(k,{"data-test-id":"table-row","data-row-entity-id":this.entityId[a],onClick:this.rowClickHandler},e)))),this.paging&&t(T,{key:"8ff1f32400ae7127af54dc72d7f004f9f47b189d"},t(w,{key:"f61fb96596cfd7fb2b9c8df9abe7b93ca911f92c"},t(v,{key:"609114cbd75f787012c1625e0b197fd5820d054e",colSpan:this.transactionsTable.columnData.length},t("pagination-menu",{key:"54b78b6480f2c7ee718ae9379a62e0961f8b8170",paging:Object.assign(Object.assign({},this.paging),{handleClickPrevious:this.handleClickPrevious,handleClickNext:this.handleClickNext})})))))))}static get watchers(){return{pagingParams:["propChanged"],paymentId:["propChanged"],authToken:["propChanged"]}}};export{q as justifi_payment_transactions_list}
1
+ import{h as t,r as e,c as a}from"./p-DwYM91AU.js";import"./p-tGDdRx0W.js";import"./p-HXpYMWUU.js";import{C as s,a as i}from"./p-Cjcsf8ku.js";import{h as r}from"./p-BrRsgB8S.js";import{p as n}from"./p-CLHwhyvu.js";import"./p-B5rtFhtR.js";import"./p-BH0Xfn-F.js";import{c as o,J as c}from"./p-BEu9YFnf.js";import{g as p,a as h}from"./p-D2muobcE.js";import{P as d}from"./p-DGGjRqDa.js";import{T as f,l,a as u,b as m,c as y,d as b,e as _,f as g,g as j,h as k,i as w,j as T,k as v}from"./p-BMJe4lzg.js";import{S as D}from"./p-BP2sTIQV.js";import{T as C}from"./p-CZfYo5-1.js";import{a as R}from"./p-B09GVew-.js";import{V as S,W as B}from"./p-sA8HBfkI.js";import"./p-BYsgavgS.js";import"./p-DkoufM1t.js";import"./p-Dr8Z8wfP.js";import"./p-yyedWKWX.js";import"./p-CgiDds_u.js";const F={created_at:()=>t("th",{part:S,scope:"col",title:"The date and time each transaction was made"},"Processed On"),type:()=>t("th",{part:S,scope:"col",title:"The type of each transaction"},"Type"),id:()=>t("th",{part:S,scope:"col",title:"The unique identifier of each transaction"},"ID"),amount:()=>t("th",{part:S,scope:"col",title:"The dollar amount of each transaction",class:"text-end"},"Amount"),balance:()=>t("th",{part:S,scope:"col",title:"The running total amount of this payment that belongs to you",class:"text-end"},"Balance"),currency:()=>t("th",{part:S,scope:"col",title:"The currency of each transaction"},"Currency"),financial_transaction_id:()=>t("th",{part:S,scope:"col",title:"The unique identifier of the financial transaction associated with the payment balance transaction"},"Financial Transaction ID"),payment_id:()=>t("th",{part:S,scope:"col",title:"The unique identifier of the payment associated with the payment balance transaction"},"Payment ID"),payment_balance_txn_type:()=>t("th",{part:S,scope:"col",title:"The type of the payment balance transaction"},"Transaction Type"),source_id:()=>t("th",{part:S,scope:"col",title:"The unique identifier of the source object associated with the payment balance transaction"},"Source ID"),source_type:()=>t("th",{part:S,scope:"col",title:"The type of the source object associated with the payment balance transaction"},"Source Type")},I={ach_return:"ACH Return",ach_return_fee:"ACH Return Fee",dispute:"Dispute",dispute_fee:"Dispute Fee",dispute_fee_refund:"Dispute Fee Refund",dispute_refund:"Dispute Refund",payment:"Payment",payment_fee:"Fee",refund:"Refund",fee_refund:"Fee Refund",application_fee_returned:"Application Fee Returned",refund_failure:"Refund Failure",void:"Void"},x={created_at:(e,a)=>t("td",{part:B(a)},t("div",{class:"fw-bold"},R(e.created_at,{showDisplayDate:!0})),t("div",{class:"fw-bold"},R(e.created_at,{showTime:!0}))),type:(e,a)=>t("td",{part:B(a)},I[e.payment_balance_txn_type]),id:(e,a)=>t("td",{part:B(a)},e.id),amount:(e,a)=>t("td",{part:B(a),class:"text-end"},e.formattedPaymentAmount(e.amount)),balance:(e,a)=>t("td",{part:B(a),class:"text-end"},e.formattedPaymentAmount(e.balance)),currency:(e,a)=>t("td",{part:B(a)},e.currency),financial_transaction_id:(e,a)=>t("td",{part:B(a)},e.financial_transaction_id),payment_id:(e,a)=>t("td",{part:B(a)},e.payment_id),payment_balance_txn_type:(e,a)=>t("td",{part:B(a)},e.payment_balance_txn_type),source_id:(e,a)=>t("td",{part:B(a)},e.source_id),source_type:(e,a)=>t("td",{part:B(a)},e.source_type)},E=class{constructor(t){e(this,t),this.clickEvent=a(this,"click-event"),this.errorEvent=a(this,"error-event"),this.balanceTransactions=[],this.isLoading=!0,this.errorMessage=null,this.paging=n,this.pagingParams={},this.columns="created_at,type,id,amount,balance",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,x),o(),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.paymentId&&this.authToken?(({id:t,authToken:e,service:a})=>async({params:i,onSuccess:n,onError:o,final:c})=>{var d;try{const c=await a.fetchPaymentTransactions(t,e,i);c.error?o({error:h(c.error),code:p(null===(d=c.error)||void 0===d?void 0:d.code),severity:s.ERROR}):n({balanceTransactions:c.data.map((t=>new r(t))),pagingInfo:Object.assign({},c.page_info)})}catch(t){const e=p(null==t?void 0:t.code);o({error:h(t),code:e,severity:s.ERROR})}finally{c()}})({id:this.paymentId,authToken:this.authToken,service:new d})({params:this.pagingParams,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="payment-id and auth-token props are required",this.handleError(i.MISSING_PROPS,this.errorMessage,s.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}render(){return t(D,{key:"8a307277a1953bea93e7b15d2774700f07319c87"},t(l,{key:"1097f6a329292851cfcdd16240fa5f161f8aa7e4"},t(u,{key:"9ae196b35c90391de0d9a31f79c732e6de991b08"},t(m,{key:"a7eaab567c42bb2676b91259363b9c4bee2683df"},t(y,{key:"461752dafb18db32ef0367d90cb1482980e92187"},this.transactionsTable.columnData.map((t=>t)))),t(b,{key:"5c0ce55bd2ad81de73866c869818820568233422"},t(_,{key:"8a54d3632e2193576a2e5037c9d7b8a614fcd5b6",columnSpan:this.transactionsTable.columnKeys.length,isLoading:this.isLoading}),t(g,{key:"6fab4a7cce6678a30992be71c702fab2259c2b49",isEmpty:this.showEmptyState,columnSpan:this.transactionsTable.columnKeys.length}),t(j,{key:"8ab1c46ecbd0d2ed98dacf9edcd690054a90c081",columnSpan:this.transactionsTable.columnKeys.length,errorMessage:this.errorMessage}),this.showRowData&&this.transactionsTable.rowData.map(((e,a)=>t(k,{"data-test-id":"table-row","data-row-entity-id":this.entityId[a],onClick:this.rowClickHandler},e)))),this.paging&&t(w,{key:"8ff1f32400ae7127af54dc72d7f004f9f47b189d"},t(T,{key:"f61fb96596cfd7fb2b9c8df9abe7b93ca911f92c"},t(v,{key:"609114cbd75f787012c1625e0b197fd5820d054e",colSpan:this.transactionsTable.columnData.length},t("pagination-menu",{key:"54b78b6480f2c7ee718ae9379a62e0961f8b8170",paging:Object.assign(Object.assign({},this.paging),{handleClickPrevious:this.handleClickPrevious,handleClickNext:this.handleClickNext})})))))))}static get watchers(){return{pagingParams:["propChanged"],paymentId:["propChanged"],authToken:["propChanged"]}}};export{E as justifi_payment_transactions_list}
@@ -1 +1 @@
1
- import{h as t,r as s,c as e}from"./p-DwYM91AU.js";import{c as r,a as i,F as o}from"./p-DiJD6Iqx.js";import{f as n}from"./p-B09GVew-.js";import"./p-tGDdRx0W.js";import{C as a,a as u}from"./p-Cjcsf8ku.js";import{R as l,l as h}from"./p-BrRsgB8S.js";import"./p-CLHwhyvu.js";import"./p-B5rtFhtR.js";import"./p-BH0Xfn-F.js";import{B as m}from"./p-Ty7R7tsw.js";import{S as p}from"./p-BP2sTIQV.js";import"./p-CZfYo5-1.js";import{P as c}from"./p-DGGjRqDa.js";import{m as d}from"./p-DATDsXcA.js";import{c as f,J as v}from"./p-DISrhs4v.js";import{g as j,a as y}from"./p-D2muobcE.js";import{A as b}from"./p-yyedWKWX.js";import{S as w}from"./p-CsgUIrv8.js";import"./p-BFTU3MAI.js";import"./p-HXpYMWUU.js";import"./p-BYsgavgS.js";import"./p-DkoufM1t.js";import"./p-sA8HBfkI.js";import"./p-CsRppqXL.js";const g=t=>{const s=+t;return i().required("Amount is required").test("max-amount",`Refund amount cannot be more than payment amount: ${n(s)}`,(function(t){return+t<=+s})).test("min-amount","Refund amount must be greater than 0",(function(t){return+t>0}))},R=t=>{if(t)return r({amount:g(t),description:i().optional(),reason:i().optional().oneOf([l.customerRequest,l.duplicate,l.fraudulent],"Select a reason")})},A=[{label:"Select a reason",value:""},{label:"Customer requested a refund",value:"customer_request"},{label:"Customer was double-charged",value:"duplicate"},{label:"Payment was reported as fraud",value:"fraudulent"}],x=b();class B{async postRefund(t,s,e,r){return x.post({endpoint:`payments/${t}/refunds`,headers:{"Sub-Account":s},body:r,authToken:e})}}const D=()=>t("div",{class:"row gap-3"},t("div",{class:"col-12"},t(w,{width:"100%",height:"40px"}))),I=()=>t(p,null,t("div",{class:"row gap-5"},t(D,null),t(D,null),t(D,null))),T=class{constructor(t){s(this,t),this.errorEvent=e(this,"error-event"),this.submitEvent=e(this,"submit-event"),this.refundPayload={},this.displayAmount="",this.errors={},this.paymentLoading=!0,this.refundLoading=!1,this.hideSubmitButton=!1,this.inputHandler=(t,s)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[t]:s}))}}componentWillLoad(){f(),this.analytics=new v(this),this.initializeApi(),this.formController=new o(R())}handleError(t,s,e){this.errorEvent.emit({errorCode:t,message:s,severity:e})}checkAmount(t){return t>0}handleInvalidAmount(){this.submitDisabled=!0,this.handleError(u.INVALID_REFUND_AMOUNT,"Refund amount must be greater than 0",a.ERROR)}initializeFormController(){const t=this.refundPayload.amount,s=t?t.toString():"0";this.formController=new o(R(s)),this.formController.setInitialValues({amount:s}),this.formController.values.subscribe((t=>{this.refundPayload=Object.assign({},t)})),this.formController.errors.subscribe((t=>{this.errors=Object.assign({},t)}))}initializeApi(){this.paymentId&&this.authToken?d({id:this.paymentId,authToken:this.authToken,service:new c})({onSuccess:({payment:t})=>{this.refundPayload=new h({amount:t.amount_refundable})},onError:({error:t,code:s,severity:e})=>{this.handleError(s,t,e)},final:()=>{this.checkAmount(this.refundPayload.amount)?this.initializeFormController():this.handleInvalidAmount(),this.paymentLoading=!1}}):this.handleError(u.MISSING_PROPS,"Payment ID and Auth Token are required",a.ERROR)}async refundPayment(t){if(t&&t.preventDefault(),!await this.formController.validate())return;const s=(({authToken:t,accountId:s,paymentId:e,service:r})=>async({refundBody:i,onSuccess:o,onError:n,final:u})=>{var l;try{const u=await r.postRefund(e,s,t,i);if(u.error)return n({error:y(u.error),code:j(null===(l=u.error)||void 0===l?void 0:l.code),severity:a.ERROR});o(u)}catch(t){const s=j(null==t?void 0:t.code);return n({error:t.message||t,code:s,severity:a.ERROR})}finally{return u()}})({authToken:this.authToken,accountId:this.accountId,paymentId:this.paymentId,service:new B}),e=this.formController.values.getValue();return this.refundLoading=!0,new Promise((t=>{let r;s({refundBody:e,onSuccess:t=>{r=t},onError:({error:t,code:s,severity:e})=>{r=t,this.handleError(t,s,e)},final:()=>{this.submitEvent.emit({response:r}),this.submitDisabled=!0,this.refundLoading=!1,t(r.data)}})}))}render(){if(this.paymentLoading)return t(I,null);const s=this.formController.getInitialValues(),e=this.refundPayload.amount;return t(p,null,t("form",null,t("fieldset",null,t("div",{class:"row gy-3"},t("div",{class:"col-12"},t("form-control-monetary",{name:"amount",label:"Refund Amount",defaultValue:s.amount,inputHandler:this.inputHandler,errorText:this.errors.amount})),t("div",{class:"col-12"},t("form-control-select",{name:"reason",label:"Reason for refund (optional)",defaultValue:s.reason,inputHandler:this.inputHandler,options:A,errorText:this.errors.reason})),t("div",{class:"col-12"},t("form-control-textarea",{name:"description",label:"Note (optional)",defaultValue:s.description,inputHandler:this.inputHandler,maxLength:250,errorText:this.errors.description})),t("div",{class:"form-group d-flex flex-row-reverse"},t(m,{variant:"primary",type:"submit",onClick:this.refundPayment.bind(this),isLoading:this.paymentLoading||this.refundLoading,hidden:this.hideSubmitButton,disabled:this.submitDisabled},`Refund ${n(+e)}`))))))}};export{T as justifi_refund_payment}
1
+ import{h as t,r as s,c as e}from"./p-DwYM91AU.js";import{c as r,a as i,F as o}from"./p-DiJD6Iqx.js";import{f as n}from"./p-B09GVew-.js";import"./p-tGDdRx0W.js";import{C as a,a as u}from"./p-Cjcsf8ku.js";import{R as l,l as m}from"./p-BrRsgB8S.js";import"./p-CLHwhyvu.js";import"./p-B5rtFhtR.js";import"./p-BH0Xfn-F.js";import{B as h}from"./p-Ty7R7tsw.js";import{S as p}from"./p-BP2sTIQV.js";import"./p-CZfYo5-1.js";import{P as c}from"./p-DGGjRqDa.js";import{m as d}from"./p-DATDsXcA.js";import{c as f,J as v}from"./p-BEu9YFnf.js";import{g as j,a as y}from"./p-D2muobcE.js";import{A as b}from"./p-yyedWKWX.js";import{S as w}from"./p-CsgUIrv8.js";import"./p-BFTU3MAI.js";import"./p-HXpYMWUU.js";import"./p-BYsgavgS.js";import"./p-DkoufM1t.js";import"./p-sA8HBfkI.js";import"./p-Dr8Z8wfP.js";const g=t=>{const s=+t;return i().required("Amount is required").test("max-amount",`Refund amount cannot be more than payment amount: ${n(s)}`,(function(t){return+t<=+s})).test("min-amount","Refund amount must be greater than 0",(function(t){return+t>0}))},A=t=>{if(t)return r({amount:g(t),description:i().optional(),reason:i().optional().oneOf([l.customerRequest,l.duplicate,l.fraudulent],"Select a reason")})},B=[{label:"Select a reason",value:""},{label:"Customer requested a refund",value:"customer_request"},{label:"Customer was double-charged",value:"duplicate"},{label:"Payment was reported as fraud",value:"fraudulent"}],R=b();class x{async postRefund(t,s,e,r){return R.post({endpoint:`payments/${t}/refunds`,headers:{"Sub-Account":s},body:r,authToken:e})}}const D=()=>t("div",{class:"row gap-3"},t("div",{class:"col-12"},t(w,{width:"100%",height:"40px"}))),T=()=>t(p,null,t("div",{class:"row gap-5"},t(D,null),t(D,null),t(D,null))),I=class{constructor(t){s(this,t),this.errorEvent=e(this,"error-event"),this.submitEvent=e(this,"submit-event"),this.refundPayload={},this.displayAmount="",this.errors={},this.paymentLoading=!0,this.refundLoading=!1,this.hideSubmitButton=!1,this.inputHandler=(t,s)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[t]:s}))}}componentWillLoad(){f(),this.analytics=new v(this),this.initializeApi(),this.formController=new o(A())}handleError(t,s,e){this.errorEvent.emit({errorCode:t,message:s,severity:e})}checkAmount(t){return t>0}handleInvalidAmount(){this.submitDisabled=!0,this.handleError(u.INVALID_REFUND_AMOUNT,"Refund amount must be greater than 0",a.ERROR)}initializeFormController(){const t=this.refundPayload.amount,s=t?t.toString():"0";this.formController=new o(A(s)),this.formController.setInitialValues({amount:s}),this.formController.values.subscribe((t=>{this.refundPayload=Object.assign({},t)})),this.formController.errors.subscribe((t=>{this.errors=Object.assign({},t)}))}initializeApi(){this.paymentId&&this.authToken?d({id:this.paymentId,authToken:this.authToken,service:new c})({onSuccess:({payment:t})=>{this.refundPayload=new m({amount:t.amount_refundable})},onError:({error:t,code:s,severity:e})=>{this.handleError(s,t,e)},final:()=>{this.checkAmount(this.refundPayload.amount)?this.initializeFormController():this.handleInvalidAmount(),this.paymentLoading=!1}}):this.handleError(u.MISSING_PROPS,"Payment ID and Auth Token are required",a.ERROR)}async refundPayment(t){if(t&&t.preventDefault(),!await this.formController.validate())return;const s=(({authToken:t,accountId:s,paymentId:e,service:r})=>async({refundBody:i,onSuccess:o,onError:n,final:u})=>{var l;try{const u=await r.postRefund(e,s,t,i);if(u.error)return n({error:y(u.error),code:j(null===(l=u.error)||void 0===l?void 0:l.code),severity:a.ERROR});o(u)}catch(t){const s=j(null==t?void 0:t.code);return n({error:t.message||t,code:s,severity:a.ERROR})}finally{return u()}})({authToken:this.authToken,accountId:this.accountId,paymentId:this.paymentId,service:new x}),e=this.formController.values.getValue();return this.refundLoading=!0,new Promise((t=>{let r;s({refundBody:e,onSuccess:t=>{r=t},onError:({error:t,code:s,severity:e})=>{r=t,this.handleError(t,s,e)},final:()=>{this.submitEvent.emit({response:r}),this.submitDisabled=!0,this.refundLoading=!1,t(r.data)}})}))}render(){if(this.paymentLoading)return t(T,null);const s=this.formController.getInitialValues(),e=this.refundPayload.amount;return t(p,null,t("form",null,t("fieldset",null,t("div",{class:"row gy-3"},t("div",{class:"col-12"},t("form-control-monetary",{name:"amount",label:"Refund Amount",defaultValue:s.amount,inputHandler:this.inputHandler,errorText:this.errors.amount})),t("div",{class:"col-12"},t("form-control-select",{name:"reason",label:"Reason for refund (optional)",defaultValue:s.reason,inputHandler:this.inputHandler,options:B,errorText:this.errors.reason})),t("div",{class:"col-12"},t("form-control-textarea",{name:"description",label:"Note (optional)",defaultValue:s.description,inputHandler:this.inputHandler,maxLength:250,errorText:this.errors.description})),t("div",{class:"form-group d-flex flex-row-reverse"},t(h,{variant:"primary",type:"submit",onClick:this.refundPayment.bind(this),isLoading:this.paymentLoading||this.refundLoading,hidden:this.hideSubmitButton,disabled:this.submitDisabled},`Refund ${n(+e)}`))))))}};export{I as justifi_refund_payment}
@@ -0,0 +1 @@
1
+ import{h as t,r as e,c as i,H as n,g as s}from"./p-DwYM91AU.js";import{A as o}from"./p-yyedWKWX.js";import{A as a,o as r,p as l,q as c,r as h,s as d,c as p,t as u,G as y,u as g,v as b,w as f,x as m,y as v,z as M,B as w,D as k,I as P,F as x,H as E}from"./p-BrRsgB8S.js";import{S as j}from"./p-BP2sTIQV.js";import"./p-CZfYo5-1.js";import{S as A}from"./p-CsgUIrv8.js";import{G as T,v as N}from"./p-sA8HBfkI.js";import{f as I}from"./p-B09GVew-.js";import{P as C,a as D,b as S}from"./p-DkoufM1t.js";import{H as L}from"./p-DmdEjScI.js";import{H as O,b as z,h as R,i as _}from"./p-BhqSAzpT.js";import{H as B}from"./p-CQGIjIgZ.js";import{J as U,c as G}from"./p-BEu9YFnf.js";import"./p-tGDdRx0W.js";import"./p-HXpYMWUU.js";import{C as Y,a as F,b as Q}from"./p-Cjcsf8ku.js";import"./p-CLHwhyvu.js";import"./p-B5rtFhtR.js";import"./p-BH0Xfn-F.js";import{g as V,a as H}from"./p-D2muobcE.js";import{C as q}from"./p-VRubcA-q.js";import{C as Z}from"./p-ZpPDShvP.js";import"./p-BYsgavgS.js";import"./p-Dr8Z8wfP.js";var W;!function(t){t.UNAVAILABLE="UNAVAILABLE",t.SESSION_ERROR="SESSION_ERROR",t.MERCHANT_VALIDATION_ERROR="MERCHANT_VALIDATION_ERROR",t.PAYMENT_PROCESSING_ERROR="PAYMENT_PROCESSING_ERROR",t.USER_CANCELLED="USER_CANCELLED"}(W||(W={}));class J{constructor(){this.api=o()}initialize(t){if(this.applePayConfig=new a(t),!this.applePayConfig.isValid)throw new Error("Invalid Apple Pay configuration provided")}async validateMerchant(t,e){try{return await this.api.post({endpoint:"apple_pay/merchant_session",authToken:t,headers:{"Sub-Account":e},body:{domain:window.location.host,display_name:this.applePayConfig.displayName}})}catch(t){throw console.error("Backend validation failed:",t),new Error("Merchant validation failed")}}async processPayment(t,e,i){const n=await this.api.post({endpoint:"apple_pay/process_token",authToken:t,body:i,headers:{"Sub-Account":e}});return{success:n.id&&!!n.data.token,data:n}}isAvailable(){return r.isApplePaySupported()&&r.canMakePayments()}async canMakePaymentsWithActiveCard(){if(!this.applePayConfig)throw new Error("Apple Pay not initialized. Call initialize() first.");return await r.canMakePaymentsWithActiveCard(this.applePayConfig.merchantIdentifier)}async startPaymentSession(t,e,i){if(!this.applePayConfig)throw console.error("[ApplePayService] Missing applePayConfig. Did you call initialize()?"),new Error("Apple Pay not initialized. Call initialize() first.");const n=new l(t);if(!n.isValid){const t=[];throw n.countryCode||t.push("countryCode"),n.currencyCode||t.push("currencyCode"),n.merchantCapabilities&&0!==n.merchantCapabilities.length||t.push("merchantCapabilities"),n.supportedNetworks&&0!==n.supportedNetworks.length||t.push("supportedNetworks"),n.total&&n.total.label&&n.total.amount||t.push("total"),console.error("[ApplePayService] Payment request is invalid. Missing/invalid:",t),new Error("Invalid payment request provided")}return this.currentPaymentRequest=n,new Promise(((t,s)=>{try{if("undefined"==typeof window||!("ApplePaySession"in window))return console.error("[ApplePayService] ApplePaySession not available on window"),s({success:!1,error:{code:W.UNAVAILABLE,message:"ApplePaySession API is not available in this environment"}});this.currentSession=new window.ApplePaySession(3,n),this.setupSessionEventHandlers(t,s,e,i),this.currentSession.begin()}catch(t){console.error("[ApplePayService] Exception while starting session:",t),s({success:!1,error:{code:W.SESSION_ERROR,message:t instanceof Error?t.message:"Failed to start Apple Pay session"}})}}))}abortPaymentSession(){this.currentSession&&(this.currentSession.abort(),this.currentSession=void 0,this.currentPaymentRequest=void 0)}setupSessionEventHandlers(t,e,i,n){this.currentSession&&this.applePayConfig&&this.currentPaymentRequest?(this.currentSession.onvalidatemerchant=async()=>{try{if(!i)throw console.error("[ApplePayService] Missing authToken for merchant validation"),new Error("Authentication token not provided.");const t=await this.validateMerchant(i,n);try{this.currentSession.completeMerchantValidation(t)}catch(t){throw console.error("Error calling completeMerchantValidation:",t),t}}catch(t){console.error("=== MERCHANT VALIDATION ERROR ==="),console.error("Error during merchant validation:",t),t&&t.stack&&console.error("Error stack:",t.stack),this.currentSession.abort(),e({success:!1,error:{code:W.MERCHANT_VALIDATION_ERROR,message:t instanceof Error?t.message:"Merchant validation failed"}})}},this.currentSession.onpaymentauthorized=async s=>{try{const o=s.payment,a=Object.assign(Object.assign({},o.token),{product_details:{name:this.currentPaymentRequest.total.label,price:r.parseAmount(this.currentPaymentRequest.total.amount),description:this.currentPaymentRequest.total.label}}),l=await this.processPayment(i,n,a);l.success?(this.currentSession.completePayment({status:c.STATUS_SUCCESS}),t({success:!0,token:o.token,paymentMethodId:l.data.id})):(console.error("PSP reported payment failure:",l.data),this.currentSession.completePayment({status:c.STATUS_FAILURE}),e({success:!1,error:{code:W.PAYMENT_PROCESSING_ERROR,message:"Payment processing failed"}}))}catch(t){console.error("=== PAYMENT PROCESSING ERROR ==="),console.error("Error processing payment:",t),t&&t.stack&&console.error("Error stack:",t.stack),this.currentSession.completePayment({status:c.STATUS_FAILURE}),e({success:!1,error:{code:W.PAYMENT_PROCESSING_ERROR,message:t instanceof Error?t.message:"Payment processing failed"}})}finally{this.currentSession=void 0,this.currentPaymentRequest=void 0}},this.currentSession.onpaymentmethodselected=()=>{const t={newTotal:this.currentPaymentRequest.total,newLineItems:this.currentPaymentRequest.lineItems||[]};try{this.currentSession.completePaymentMethodSelection(t)}catch(t){console.error("Error completing payment method selection:",t),this.currentSession.abort()}},this.currentSession.onshippingmethodselected=()=>{this.currentSession.completeShippingMethodSelection({status:c.STATUS_SUCCESS,newTotal:this.currentPaymentRequest.total,newLineItems:this.currentPaymentRequest.lineItems||[]})},this.currentSession.oncancel=t=>{if(t.sessionError)switch(console.error(t.sessionError),t.sessionError.code){case"unknown":console.error("Unknown error - likely merchant validation issue"),console.error("This usually means:"),console.error("1. Merchant certificate is invalid or expired"),console.error("2. Merchant identifier mismatch"),console.error("3. Backend validation endpoint issues");break;case"invalidMerchantSession":console.error("Invalid merchant session provided"),console.error("Check that the merchant session from backend is valid");break;case"userCancel":console.error("User cancelled the payment");break;default:console.error("Other error code:",t.sessionError.code)}this.currentSession=void 0,this.currentPaymentRequest=void 0,e({success:!1,error:{code:W.USER_CANCELLED,message:"User cancelled the Apple Pay session"}})},"onerror"in this.currentSession&&(this.currentSession.onerror=t=>{console.error("=== APPLE PAY SESSION ERROR ==="),console.error("Session error:",t),this.currentSession=void 0,this.currentPaymentRequest=void 0,e({success:!1,error:{code:W.SESSION_ERROR,message:"Apple Pay session error occurred"}})})):console.error("[ApplePayService] setupSessionEventHandlers called without required state",{hasSession:Boolean(this.currentSession),hasConfig:Boolean(this.applePayConfig),hasPaymentRequest:Boolean(this.currentPaymentRequest)})}static createPaymentRequest(t,e,i="US",n="USD"){return{countryCode:i,currencyCode:n,merchantCapabilities:r.getDefaultMerchantCapabilities(),supportedNetworks:r.getDefaultSupportedNetworks(),total:r.createLineItem(e,t)}}getApplePayConfig(){return this.applePayConfig}}const X=e=>{const{isLoading:i}=e;return i?t("div",{class:"container-fluid p-0"},t("div",{class:"row mb-3"},t("div",{class:"col-12 align-content-center"},t(A,{height:"44px",width:"100%",styles:{borderRadius:"8px"}})))):null},K=e=>t("div",{class:"apple-pay-button-container"},t("button",Object.assign({class:(()=>{let t="apple-pay-button";switch(e.buttonStyle){case h.WHITE:t+=" apple-pay-button-white";break;case h.WHITE_OUTLINE:t+=" apple-pay-button-white-outline";break;default:t+=" apple-pay-button-black"}switch(e.buttonType){case d.BUY:t+=" apple-pay-button-type-buy";break;case d.DONATE:t+=" apple-pay-button-type-donate";break;default:t+=" apple-pay-button-type-plain"}return(e.disabled||e.isProcessing||!e.isAvailable)&&(t+=" disabled"),t})(),style:{width:e.width,height:e.height},onClick:()=>{!e.disabled&&!e.isProcessing&&e.isAvailable&&e.clickHandler&&e.clickHandler()},disabled:e.disabled||e.isProcessing||!e.isAvailable,"aria-label":"Pay with Apple Pay",type:"button"},e),e.isProcessing&&t("div",{class:"processing-overlay"},t("div",{class:"spinner"}),t("span",null,"Processing..."))),t("style",null,"\n .apple-pay-button-container {\n display: block;\n position: relative;\n width: 100%;\n }\n\n /* Apple Pay CSS classes - these are the official Apple Pay button styles */\n .apple-pay-button {\n display: inline-block;\n -webkit-appearance: -apple-pay-button;\n -apple-pay-button-type: plain; /* default */\n -apple-pay-button-style: black; /* default */\n border-radius: 8px;\n cursor: pointer;\n border: none;\n outline: none;\n transition: opacity 0.2s ease;\n position: relative;\n }\n\n /* Button styles */\n .apple-pay-button.apple-pay-button-black {\n -apple-pay-button-style: black;\n }\n\n .apple-pay-button.apple-pay-button-white {\n -apple-pay-button-style: white;\n }\n\n .apple-pay-button.apple-pay-button-white-outline {\n -apple-pay-button-style: white-outline;\n }\n\n /* Button types */\n .apple-pay-button.apple-pay-button-type-plain {\n -apple-pay-button-type: plain;\n }\n\n .apple-pay-button.apple-pay-button-type-buy {\n -apple-pay-button-type: buy;\n }\n\n .apple-pay-button.apple-pay-button-type-donate {\n -apple-pay-button-type: donate;\n }\n\n /* Hover and disabled states */\n .apple-pay-button:hover:not(.disabled) {\n opacity: 0.9;\n }\n\n .apple-pay-button.disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n /* Processing overlay */\n .processing-overlay {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 8px;\n background: rgba(0, 0, 0, 0.8);\n color: white;\n border-radius: 8px;\n font-size: 14px;\n font-weight: 500;\n }\n\n .spinner {\n width: 16px;\n height: 16px;\n border: 2px solid rgba(255, 255, 255, 0.3);\n border-top: 2px solid #fff;\n border-radius: 50%;\n animation: spin 1s linear infinite;\n }\n\n @keyframes spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n }\n\n /* Responsive design */\n @media (max-width: 480px) {\n .apple-pay-button {\n width: 100% !important;\n min-width: 200px;\n }\n }\n ")),$=class{constructor(t){e(this,t),this.applePayStarted=i(this,"applePayStarted"),this.applePayCompleted=i(this,"applePayCompleted"),this.applePayCancelled=i(this,"applePayCancelled"),this.applePayError=i(this,"applePayError"),this.countryCode="US",this.merchantIdentifier="merchant.com.staging-justifi.checkout-dev",this.merchantDisplayName="JustiFi Checkout",this.initiativeContext="dev-checkout.justifi-staging.com",this.buttonType=d.PLAIN,this.buttonStyle=h.BLACK,this.disabled=!1,this.showSkeleton=!0,this.width="100%",this.height="48px",this.isLoading=!0,this.isProcessing=!1,this.isAvailable=!1,this.canMakePayments=!1,this.isConfigValid=!0,this.error=null,this.handleApplePayClick=async()=>{var t,e;if(!this.isProcessing&&!this.disabled&&this.isAvailable)try{this.isProcessing=!0,this.error=null,this.applePayStarted.emit();const i={countryCode:this.countryCode,currencyCode:p.paymentCurrency,merchantCapabilities:[u.SUPPORTS_3DS,u.SUPPORTS_CREDIT,u.SUPPORTS_DEBIT],supportedNetworks:r.getDefaultSupportedNetworks(),total:r.createLineItem(p.paymentDescription,p.paymentAmount)},n=await this.applePayService.startPaymentSession(i,p.authToken,p.accountId);n.success?this.applePayCompleted.emit({success:!0,token:n.token,paymentMethodId:n.paymentMethodId}):(this.applePayCompleted.emit({success:!1,error:n.error}),this.applePayError.emit({error:(null===(t=n.error)||void 0===t?void 0:t.message)||"Payment failed",code:(null===(e=n.error)||void 0===e?void 0:e.code)||$.ErrorCode.PAYMENT_FAILED}))}catch(t){const e=t instanceof Error?t.message:"Payment failed";this.error=e,this.applePayError.emit({error:e,code:$.ErrorCode.PAYMENT_FAILED}),this.applePayCompleted.emit({success:!1,error:e})}finally{this.isProcessing=!1}}}async initializeApplePay(){try{if(this.isLoading=!0,this.error=null,this.isConfigValid=!0,!(Boolean(p.paymentAmount)&&Boolean(p.paymentCurrency)&&Boolean(p.authToken)))return this.error="Missing required Apple Pay configuration",this.isConfigValid=!1,console.error("Apple Pay config error: missing required values",{paymentAmount:p.paymentAmount,paymentCurrency:p.paymentCurrency,hasAuthToken:Boolean(p.authToken),accountId:p.accountId}),this.applePayError.emit({error:this.error,code:$.ErrorCode.CONFIG_ERROR}),void(this.isLoading=!1);if(this.isAvailable=r.isApplePaySupported(),this.canMakePayments=r.canMakePayments(),!this.isAvailable)return this.error="Apple Pay is not supported on this device",console.error(this.error),this.applePayError.emit({error:this.error,code:$.ErrorCode.NOT_SUPPORTED}),void(this.isLoading=!1);if(!this.canMakePayments)return this.error="Apple Pay is not available",console.error(this.error),this.applePayError.emit({error:this.error,code:$.ErrorCode.NOT_AVAILABLE}),void(this.isLoading=!1);const t={merchantIdentifier:this.merchantIdentifier,displayName:this.merchantDisplayName,initiative:"web",initiativeContext:this.initiativeContext,buttonType:this.buttonType,buttonStyle:this.buttonStyle};this.applePayService=new J,this.applePayService.initialize(t),await this.applePayService.canMakePaymentsWithActiveCard()||console.warn("No Apple Pay cards available, but continuing...")}catch(t){console.error("Apple Pay initialization error:",t),this.error=t instanceof Error?t.message:"Failed to initialize Apple Pay",this.applePayError.emit({error:this.error,code:$.ErrorCode.INITIALIZATION_ERROR})}finally{this.isLoading=!1}}async isSupported(){return this.isAvailable&&this.canMakePayments}async getPaymentMethods(){return this.isAvailable?r.getDefaultSupportedNetworks():[]}async abort(){this.applePayService.abortPaymentSession(),this.isProcessing=!1,this.applePayCancelled.emit()}render(){if(!p.applePayEnabled)return null;const e=!this.isLoading&&this.isAvailable&&this.canMakePayments&&this.isConfigValid;return t(j,null,p.checkoutLoaded&&t("script",{async:!0,src:"https://applepay.cdn-apple.com/jsapi/1.latest/apple-pay-sdk.js",onLoad:()=>{this.initializeApplePay()}}),t("div",{class:"apple-pay-container"},t(X,{isLoading:this.isLoading}),e&&t(K,{buttonType:this.buttonType,buttonStyle:this.buttonStyle,disabled:this.disabled,isProcessing:this.isProcessing,isAvailable:this.isAvailable,clickHandler:this.handleApplePayClick,width:this.width,height:this.height})),t("style",null,"\n .apple-pay-container {\n width: 100%;\n }\n "))}};$.ErrorCode={CONFIG_ERROR:"CONFIG_ERROR",NOT_SUPPORTED:"NOT_SUPPORTED",NOT_AVAILABLE:"NOT_AVAILABLE",INITIALIZATION_ERROR:"INITIALIZATION_ERROR",PAYMENT_FAILED:"PAYMENT_FAILED"};const tt=class{constructor(t){e(this,t)}render(){return t(j,{key:"38b0a855a7ad68b4c979d045a41efa20937cf476"},t("section",{key:"bbe4a0d26a95b0abd108370070fb861311724df8"},t("div",{key:"f322ecda85700c1e232b3f620b672f4eef103e97"},t("div",{key:"e59c6b19e0f27f7ab99380ead3f734a7e45cc1f1",part:T},null==p?void 0:p.paymentDescription),t("div",{key:"2fae7125889051d87571d9fb7c42ad3646e3ce07"},t("span",{key:"757941148dccea14941f6216f90af8721fbe6cb9",part:T},"Total")," ",t("span",{key:"ee50f026f64df4f73e0f6b087470a2154f4d0b4b",part:T},I(+(null==p?void 0:p.totalAmount)))))))}};class et{constructor(){this.api=o()}initialize(t){if(this.googlePayConfig=new y(t),!this.googlePayConfig.isValid)throw new Error("Invalid Google Pay configuration provided");if(this.googlePayClient=g.createGooglePayClient(this.googlePayConfig.environment),!this.googlePayClient)throw new Error("Failed to create Google Pay client")}async processPayment(t,e,i){try{const n=await this.api.post({endpoint:"google_pay/process_token",authToken:t,body:i,headers:{"sub-account":e}});return{success:n.id&&!!n.data.token,data:n}}catch(t){throw new Error("Google Pay payment processing failed")}}isAvailable(){return g.isGooglePaySupported()&&!!this.googlePayClient}async canMakePayments(){if(!this.googlePayClient||!this.googlePayConfig)return!1;try{const t=g.createBasePaymentDataRequest();return(await this.googlePayClient.isReadyToPay(t)).result}catch(t){return!1}}async startPaymentSession(t,e,i){var n;if(!this.googlePayConfig||!this.googlePayClient)throw new Error("Google Pay not initialized. Call initialize() first.");if(!this.isAvailable())throw new Error("Google Pay is not available on this device/browser");const s=new b(t);if(!s.isValid)throw new Error("Invalid payment data request provided");try{const t=await this.googlePayClient.loadPaymentData(s),o=null===(n=null==t?void 0:t.paymentMethodData)||void 0===n?void 0:n.tokenizationData,a=(()=>{if((null==o?void 0:o.token)&&"string"==typeof o.token)try{return JSON.parse(o.token)}catch(t){return o}return o})(),r={protocolVersion:null==a?void 0:a.protocolVersion,signature:null==a?void 0:a.signature,intermediateSigningKey:(null==a?void 0:a.intermediateSigningKey)?{signedKey:a.intermediateSigningKey.signedKey,signatures:a.intermediateSigningKey.signatures}:void 0,signedMessage:null==a?void 0:a.signedMessage},l=await this.processPayment(e,i,r);return l.success?{success:!0,paymentData:t,paymentMethodId:l.data.id}:{success:!1,error:{code:"PAYMENT_PROCESSING_ERROR",message:"Payment processing failed"}}}catch(t){if(t&&"object"==typeof t&&"statusCode"in t){const e=t;switch(e.statusCode){case"CANCELED":return{success:!1,error:{code:"USER_CANCELLED",message:"User cancelled the Google Pay session"}};case"DEVELOPER_ERROR":return{success:!1,error:{code:"DEVELOPER_ERROR",message:"Google Pay configuration error"}};default:return{success:!1,error:{code:"PAYMENT_ERROR",message:e.statusMessage||"Google Pay payment failed"}}}}return{success:!1,error:{code:"PAYMENT_ERROR",message:t instanceof Error?t.message:"Google Pay payment failed"}}}}createButton(t){if(!this.googlePayClient||!this.googlePayConfig)return null;try{return this.googlePayClient.createButton({onClick:t.onClick,buttonType:t.buttonType,buttonSizeMode:t.buttonSizeMode,buttonColor:t.buttonColor,buttonLocale:t.buttonLocale})}catch(t){return null}}prefetchPaymentData(t){if(!this.googlePayClient)return;const e=new b(t);if(e.isValid)try{this.googlePayClient.prefetchPaymentData(e)}catch(t){}}static createPaymentDataRequest(t,e,i="US",n="USD",s,o){return{apiVersion:2,apiVersionMinor:0,allowedPaymentMethods:[g.createPaymentMethodData()],transactionInfo:{countryCode:i,currencyCode:n,totalPriceStatus:"FINAL",totalPrice:g.formatAmount(t),totalPriceLabel:e},merchantInfo:{merchantName:s,merchantId:o}}}getGooglePayConfig(){return this.googlePayConfig}getGooglePayClient(){return this.googlePayClient}}const it=e=>{const{isLoading:i}=e;return i?t("div",{class:"container-fluid p-0"},t("div",{class:"row mb-3"},t("div",{class:"col-12 align-content-center"},t(A,{height:"44px",width:"100%",styles:{borderRadius:"8px"}})))):null},nt=e=>t("div",{class:"google-pay-button-container"},t("button",Object.assign({class:(()=>{let t="google-pay-button";switch(t+=e.buttonStyle===m.WHITE?" google-pay-button-white":" google-pay-button-black",e.buttonType){case v.BUY:t+=" google-pay-button-type-buy";break;case v.BOOK:t+=" google-pay-button-type-book";break;case v.CHECKOUT:t+=" google-pay-button-type-checkout";break;case v.DONATE:t+=" google-pay-button-type-donate";break;case v.ORDER:t+=" google-pay-button-type-order";break;case v.PAY:t+=" google-pay-button-type-pay";break;case v.SUBSCRIBE:t+=" google-pay-button-type-subscribe";break;default:t+=" google-pay-button-type-plain"}return t+=e.buttonSizeMode===f.FILL?" google-pay-button-fill":" google-pay-button-static",(e.disabled||e.isProcessing||!e.isAvailable)&&(t+=" disabled"),t})(),style:(()=>{const t={};return e.buttonSizeMode===f.FILL?(t.width="100%",t.minWidth="200px"):t.width=e.width||"200px",t.height=e.height||"48px",t})(),onClick:()=>{!e.disabled&&!e.isProcessing&&e.isAvailable&&e.clickHandler&&e.clickHandler()},disabled:e.disabled||e.isProcessing||!e.isAvailable,"aria-label":"Google Pay",type:"button"},e),e.isProcessing&&t("div",{class:"processing-overlay"},t("div",{class:"spinner"}),t("span",null,"Processing...")),t("div",{class:"google-pay-button-content"},t("svg",{width:"41",height:"17",xmlns:"http://www.w3.org/2000/svg"},t("g",{fill:"none","fill-rule":"evenodd"},t("path",{d:"M19.526 2.635v4.083h2.518c.6 0 1.096-.202 1.488-.605.403-.402.605-.882.605-1.437 0-.544-.202-1.018-.605-1.422-.392-.413-.888-.62-1.488-.62h-2.518zm0 5.52v4.736h-1.504V1.198h3.99c1.013 0 1.873.337 2.582 1.012.72.675 1.08 1.497 1.08 2.466 0 .991-.36 1.819-1.08 2.482-.697.665-1.559.996-2.583.996h-2.485v.001zm7.668 2.287c0 .392.166.718.499.98.332.26.722.391 1.168.391.633 0 1.196-.234 1.692-.701.497-.469.744-1.019.744-1.65-.469-.37-1.123-.555-1.962-.555-.61 0-1.12.148-1.528.442-.409.294-.613.657-.613 1.093m1.946-5.815c1.112 0 1.989.297 2.633.89.642.594.964 1.408.964 2.442v4.932h-1.439v-1.11h-.065c-.622.914-1.45 1.372-2.486 1.372-.882 0-1.621-.262-2.215-.784-.594-.523-.891-1.176-.891-1.96 0-.828.313-1.486.94-1.976s1.463-.735 2.51-.735c.892 0 1.629.163 2.206.49v-.344c0-.522-.207-.966-.621-1.33a2.132 2.132 0 0 0-1.455-.547c-.84 0-1.504.353-1.995 1.062l-1.324-.834c.73-1.045 1.81-1.568 3.238-1.568m11.853.262l-5.02 11.53H34.42l1.864-4.034-3.302-7.496h1.635l2.387 5.749h.032l2.322-5.75z",fill:"#FFF"}),t("path",{d:"M13.448 7.134c0-.473-.04-.93-.116-1.366H6.988v2.588h3.634a3.11 3.11 0 0 1-1.344 2.042v1.68h2.169c1.27-1.17 2.001-2.9 2.001-4.944",fill:"#4285F4"}),t("path",{d:"M6.988 13.7c1.816 0 3.344-.595 4.459-1.621l-2.169-1.681c-.603.406-1.38.643-2.29.643-1.754 0-3.244-1.182-3.776-2.774H.978v1.731a6.728 6.728 0 0 0 6.01 3.703",fill:"#34A853"}),t("path",{d:"M3.212 8.267a4.034 4.034 0 0 1 0-2.572V3.964H.978A6.678 6.678 0 0 0 .261 6.98c0 1.085.26 2.11.717 3.017l2.234-1.731z",fill:"#FABB05"}),t("path",{d:"M6.988 2.921c.992 0 1.88.34 2.58 1.008v.001l1.92-1.918C10.324.928 8.804.262 6.989.262a6.728 6.728 0 0 0-6.01 3.702l2.234 1.731c.532-1.592 2.022-2.774 3.776-2.774",fill:"#E94235"}))))),t("style",null,"\n .google-pay-button-container {\n display: block;\n position: relative;\n }\n\n .google-pay-button {\n display: flex;\n align-items: center;\n justify-content: center;\n border: none;\n border-radius: 4px;\n cursor: pointer;\n font-size: 14px;\n font-weight: 500;\n letter-spacing: 0.25px;\n line-height: 16px;\n outline: none;\n padding: 0 20px;\n position: relative;\n min-width: 140px;\n min-height: 48px;\n }\n\n /* Button styles */\n .google-pay-button.google-pay-button-black {\n background-color: #000;\n color: #fff;\n }\n\n .google-pay-button.google-pay-button-white {\n background-color: #fff;\n color: #3c4043;\n }\n\n /* Button content */\n .google-pay-button-content {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 8px;\n white-space: nowrap;\n }\n\n .google-g-logo {\n width: 20px;\n height: 20px;\n flex-shrink: 0;\n }\n\n .pay-text {\n font-family: 'Google Sans', arial, sans-serif;\n font-size: 14px;\n font-weight: 500;\n margin-left: 8px;\n }\n\n /* Button types - text content handled by ::before pseudo-element */\n .google-pay-button-type-buy .google-pay-button-content::before {\n content: 'Buy with';\n margin-right: 8px;\n }\n\n .google-pay-button-type-book .google-pay-button-content::before {\n content: 'Book with';\n margin-right: 8px;\n }\n\n .google-pay-button-type-checkout .google-pay-button-content::before {\n content: 'Checkout with';\n margin-right: 8px;\n }\n\n .google-pay-button-type-donate .google-pay-button-content::before {\n content: 'Donate with';\n margin-right: 8px;\n }\n\n .google-pay-button-type-order .google-pay-button-content::before {\n content: 'Order with';\n margin-right: 8px;\n }\n\n .google-pay-button-type-pay .google-pay-button-content::before {\n content: 'Pay with';\n margin-right: 8px;\n }\n\n .google-pay-button-type-subscribe .google-pay-button-content::before {\n content: 'Subscribe with';\n margin-right: 8px;\n }\n\n /* Size modes */\n .google-pay-button.google-pay-button-fill {\n width: 100%;\n min-width: 200px;\n }\n\n .google-pay-button.google-pay-button-static {\n width: auto;\n }\n\n /* Hover and focus states */\n .google-pay-button:hover:not(.disabled) {\n box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.15), 0 1px 3px 1px rgba(0, 0, 0, 0.30);\n }\n\n .google-pay-button:focus:not(.disabled) {\n box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.15), 0 1px 3px 1px rgba(0, 0, 0, 0.30);\n }\n\n .google-pay-button:active:not(.disabled) {\n box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.15), 0 1px 3px 1px rgba(0, 0, 0, 0.30);\n transform: translateY(1px);\n }\n\n /* Disabled state */\n .google-pay-button.disabled {\n opacity: 0.5;\n cursor: not-allowed;\n box-shadow: none;\n }\n\n .google-pay-button.disabled:hover,\n .google-pay-button.disabled:focus,\n .google-pay-button.disabled:active {\n box-shadow: none;\n transform: none;\n }\n\n /* Processing overlay */\n .processing-overlay {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 8px;\n background: rgba(0, 0, 0, 0.8);\n color: white;\n border-radius: 4px;\n font-size: 14px;\n font-weight: 500;\n }\n\n .spinner {\n width: 16px;\n height: 16px;\n border: 2px solid rgba(255, 255, 255, 0.3);\n border-top: 2px solid #fff;\n border-radius: 50%;\n animation: spin 1s linear infinite;\n }\n\n @keyframes spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n }\n\n /* Responsive design */\n @media (max-width: 480px) {\n .google-pay-button {\n width: 100% !important;\n min-width: 200px;\n }\n }\n ")),st=class{constructor(t){e(this,t),this.googlePayCancelled=i(this,"googlePayCancelled"),this.googlePayCompleted=i(this,"googlePayCompleted"),this.googlePayStarted=i(this,"googlePayStarted"),this.unsubscribes=[],this.canMakePayments=!1,this.error=null,this.isAvailable=!1,this.isLoading=!0,this.isProcessing=!1,this.buttonSizeMode=f.FILL,this.buttonStyle=m.BLACK,this.buttonType=v.PLAIN,this.countryCode="US",this.disabled=!1,this.environment=M.PRODUCTION,this.merchantId="gateway:justifi",this.merchantName="justifi",this.showSkeleton=!0,this.handleGooglePayClick=async()=>{var t;if(!this.isProcessing&&!this.disabled&&this.isAvailable&&this.canMakePayments)try{this.isProcessing=!0,this.error=null,this.googlePayStarted.emit();const e=this.createPaymentDataRequest(),i=await this.googlePayService.startPaymentSession(e,p.authToken,p.accountId);i.success?this.googlePayCompleted.emit({success:!0,paymentData:i.paymentData,paymentMethodId:i.paymentMethodId}):(this.googlePayCompleted.emit({success:!1,error:i.error}),"USER_CANCELLED"===(null===(t=i.error)||void 0===t?void 0:t.code)&&this.googlePayCancelled.emit())}catch(t){const e=t instanceof Error?t.message:"Payment failed";this.error=e,this.googlePayCompleted.emit({success:!1,error:e})}finally{this.isProcessing=!1}}}watchConfigChange(){this.initializeGooglePay()}componentWillLoad(){this.googlePayService=new et}componentDidLoad(){const t=w("paymentAmount",(()=>{this.prefetchPaymentData()}));"function"==typeof t&&this.unsubscribes.push(t);const e=w("paymentCurrency",(()=>{this.prefetchPaymentData()}));"function"==typeof e&&this.unsubscribes.push(e);const i=w("paymentDescription",(()=>{this.prefetchPaymentData()}));"function"==typeof i&&this.unsubscribes.push(i)}disconnectedCallback(){this.unsubscribes.forEach((t=>{try{t()}catch(t){}})),this.unsubscribes=[]}async getSupportedAuthMethods(){return this.isAvailable?g.getDefaultAuthMethods():[]}async getSupportedNetworks(){return this.isAvailable?g.getDefaultSupportedNetworks():[]}async handleSelectionClick(){p.selectedPaymentMethod={type:C.GOOGLE_PAY}}async isSupported(){return this.isAvailable&&this.canMakePayments}async prefetchPaymentData(){if(!this.isAvailable||!this.canMakePayments)return;const t=this.createPaymentDataRequest();this.googlePayService.prefetchPaymentData(t)}async initializeGooglePay(){try{if(this.isLoading=!0,this.error=null,!p.paymentAmount)return this.error="Missing required Google Pay configuration",void(this.isLoading=!1);if(this.googlePayService.initialize({environment:this.environment,merchantId:this.merchantId,merchantName:this.merchantName,buttonType:this.buttonType,buttonStyle:this.buttonStyle,buttonSizeMode:this.buttonSizeMode}),this.isAvailable=this.googlePayService.isAvailable(),!this.isAvailable)return this.error="Google Pay is not supported on this device",void(this.isLoading=!1);if(this.canMakePayments=await this.googlePayService.canMakePayments(),!this.canMakePayments)return this.error="Google Pay is not available for payments",void(this.isLoading=!1);const t=this.createPaymentDataRequest();this.googlePayService.prefetchPaymentData(t)}catch(t){this.error=t instanceof Error?t.message:"Failed to initialize Google Pay"}finally{this.isLoading=!1}}createPaymentDataRequest(){return et.createPaymentDataRequest(p.paymentAmount,p.paymentDescription,this.countryCode,p.paymentCurrency,this.merchantName,this.merchantId)}render(){const e=!this.isLoading&&!!this.error,i=!this.isLoading&&!this.error&&!this.isAvailable,n=!this.isLoading&&!this.error&&this.isAvailable&&!this.canMakePayments,s=!this.isLoading&&!this.error&&this.isAvailable&&this.canMakePayments;return t(j,{key:"ee9d21e776e2a5c48d3fa2fb505290020707897d"},p.checkoutLoaded&&t("script",{key:"72bd5be9e6b80a42e219082cb248927aa6e1154b",async:!0,src:"https://pay.google.com/gp/p/js/pay.js",onLoad:()=>{this.initializeGooglePay()}}),t("div",{key:"f0c2c019b80589e69c159e78b18e37fc5b1f5b21",class:"google-pay-container"},t(it,{key:"d2b1f727aec121ce5e71afcd4306df92a4b5dd3b",isLoading:this.isLoading}),e&&t("div",{key:"257df18492bff1609b864b69e2fffbacfc751ead",class:"google-pay-error",role:"alert","data-testid":"gp-error"},t("span",{key:"f0ece1f1ceeb2fd957ab577f848741a377c7375d",class:"error-icon"},"⚠️"),t("span",{key:"9139e3824de300b51b2f577fbfa77ab200b0afa5",class:"error-message"},this.error)),i&&t("div",{key:"f1bf0002a82aec202b168130729c16caeb254119",class:"google-pay-unavailable","data-testid":"gp-device-unavailable"},t("span",{key:"de42cef5e7fd8df4f84c6b2d9429672b97e9e805",class:"unavailable-message"},"Google Pay is not available on this device")),n&&t("div",{key:"a4738f6c36240efee000560acc775e431b517588",class:"google-pay-unavailable","data-testid":"gp-payments-unavailable"},t("span",{key:"6987a5208a702c15081660b09bfc10360eeef922",class:"unavailable-message"},"Google Pay is not available for payments")),s&&t(nt,{key:"de09f6693db4dc60ba6529e683dc213bec8492a5","data-testid":"gp-button",buttonType:this.buttonType,buttonStyle:this.buttonStyle,buttonSizeMode:this.buttonSizeMode,disabled:this.disabled,isProcessing:this.isProcessing,isAvailable:this.isAvailable,clickHandler:this.handleGooglePayClick})),t("style",{key:"ed3249a9b1f55720f6f4f29b3923ae2c6eda3431"},"\n .google-pay-container {\n width: 100%;\n }\n\n .google-pay-error {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 12px;\n background: #fef2f2;\n border: 1px solid #fecaca;\n border-radius: 8px;\n color: #dc2626;\n font-size: 14px;\n }\n\n .google-pay-unavailable {\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 12px;\n background: #f9fafb;\n border: 1px solid #e5e7eb;\n border-radius: 8px;\n color: #6b7280;\n font-size: 14px;\n }\n\n .error-icon {\n font-size: 16px;\n }\n \n "))}static get watchers(){return{merchantId:["watchConfigChange"],environment:["watchConfigChange"]}}},ot=class{constructor(t){e(this,t),this.levels={h1:L,h2:O,h3:B},this.level="h1"}render(){return t(j,{key:"e448c85b2268df923662a0ff71bf4d178dcfc910"},t(this.levels[this.level],{key:"c76766a1ab006ea4b5eb7e0ad8a6b294d52283a0",text:this.text,class:this.class}))}},at=o();class rt{async getLinkToken(t,e,i,n){return at.post({endpoint:`plaid/${e}/link`,body:{checkout_id:i},authToken:t,signal:n})}async tokenizeBankAccount(t,e,i,n,s,o){const a=`plaid/${e}/tokenize`,r={public_token:i};return n&&(r.link_token_id=n),s&&(r.payment_method_group_id=s),at.post({endpoint:a,body:r,authToken:t,signal:o})}}const lt=class{constructor(t){e(this,t),this.errorEvent=i(this,"error-event"),this.submitEvent=i(this,"submit-event"),this.checkoutChangedEvent=i(this,"checkout-changed"),this.plaidService=new rt,this.handleGooglePayCompleted=t=>{const{success:e,paymentMethodId:i,error:n}=t.detail||{};e&&i?(p.paymentToken=i,p.selectedPaymentMethod={type:C.GOOGLE_PAY},this.submitCheckout()):this.errorEvent.emit({message:n&&n.message||"Google Pay payment failed",errorCode:F.TOKENIZE_ERROR,severity:Y.ERROR})},this.handleGooglePayCancelled=()=>{p.paymentToken=void 0,p.selectedPaymentMethod=void 0},this.handleApplePayCompleted=t=>{const{success:e,token:i,paymentMethodId:n,error:s}=t.detail;e&&i?(p.paymentToken=n,p.selectedPaymentMethod={type:C.APPLE_PAY},this.submitCheckout()):(console.error("Apple Pay completed but failed:",s),this.errorEvent.emit({message:(null==s?void 0:s.message)||"Apple Pay payment failed",errorCode:F.TOKENIZE_ERROR,severity:Y.ERROR}))},this.handleApplePayError=t=>{const{error:e,code:i}=t.detail;console.error("Apple Pay error:",e),this.errorEvent.emit({message:e||"Apple Pay error occurred",errorCode:`APPLE_PAY_${i}`,severity:Y.ERROR})},this.handleApplePayCancelled=()=>{p.paymentToken=void 0,p.selectedPaymentMethod=void 0}}connectedCallback(){this.observer=new MutationObserver((()=>{this.queryFormRefs(),this.setupApplePayListeners(),this.setupGooglePayListeners()})),this.observer.observe(this.hostEl,{childList:!0,subtree:!0}),p.checkoutId=this.checkoutId;const t={authToken:this.authToken,checkoutId:this.checkoutId,service:new q};this.getCheckout=(({authToken:t,checkoutId:e,service:i})=>async({onSuccess:n,onError:s})=>{var o;try{const a=await i.fetchCheckout(t,e);if(a.error)return s({error:H(a.error),code:V(null===(o=a.error)||void 0===o?void 0:o.code),severity:Y.ERROR});n({checkout:a.data})}catch(t){const e=V(null==t?void 0:t.code);return s({error:t.message||t,code:e,severity:Y.ERROR})}})(t),this.completeCheckout=(({authToken:t,checkoutId:e,service:i})=>async({payment:n,onSuccess:s,onError:o})=>{var a;try{const r=await i.complete(t,e,n);if(r.error)return o({error:H(r.error),code:V(null===(a=r.error)||void 0===a?void 0:a.code),severity:Y.ERROR});s({checkout:r.data})}catch(t){const e=V(null==t?void 0:t.code);return o({error:t.message||t,code:e,severity:Y.ERROR})}})(t),k((()=>{this.emitCheckoutChanged()}))}componentWillLoad(){this.analytics=new U(this),G(),p.authToken=this.authToken,this.fetchCheckout(),z("set",(t=>{const e=_[t];void 0!==e&&R(t,e)&&this.fetchCheckout()}))}componentDidLoad(){this.queryFormRefs(),this.setupApplePayListeners(),this.setupGooglePayListeners()}disconnectedCallback(){var t;null===(t=this.observer)||void 0===t||t.disconnect(),this.removeApplePayListeners(),this.removeGooglePayListeners()}fetchCheckout(){this.authToken&&this.checkoutId?this.getCheckout&&this.getCheckout({onSuccess:({checkout:t})=>{this.updateStore(t),t.status!==P.completed?t.status!==P.expired||this.errorEvent.emit({message:Q.CHECKOUT_EXPIRED,errorCode:F.CHECKOUT_EXPIRED,severity:Y.ERROR}):this.errorEvent.emit({message:Q.CHECKOUT_ALREADY_COMPLETED,errorCode:F.CHECKOUT_ALREADY_COMPLETED,severity:Y.ERROR})},onError:t=>{this.errorEvent.emit({message:t.message,errorCode:t.code,severity:t.severity})}}):this.errorEvent.emit({message:Q.NOT_AUTHENTICATED,errorCode:F.NOT_AUTHENTICATED,severity:Y.ERROR})}updateStore(t){var e,i,n,s,o,a,r;p.accountId=t.account_id,p.checkoutLoaded=!0,p.paymentMethods=t.payment_methods.map((t=>new D(t))),p.paymentMethodGroupId=t.payment_method_group_id,p.paymentDescription=t.payment_description,p.totalAmount=t.total_amount,p.paymentAmount=t.payment_amount,p.bnplEnabled=t.payment_settings.bnpl_payments,p.insuranceEnabled=t.payment_settings.insurance_payments,p.bankAccountVerification=null===(e=t.payment_settings)||void 0===e?void 0:e.bank_account_verification,p.applePayEnabled=null===(i=t.payment_settings)||void 0===i?void 0:i.apple_payments,p.googlePayEnabled=null===(n=t.payment_settings)||void 0===n?void 0:n.google_payments,p.bnplProviderClientId=null===(s=null==t?void 0:t.bnpl)||void 0===s?void 0:s.provider_client_id,p.bnplProviderMode=null===(o=null==t?void 0:t.bnpl)||void 0===o?void 0:o.provider_mode,p.bnplProviderApiVersion=null===(a=null==t?void 0:t.bnpl)||void 0===a?void 0:a.provider_api_version,p.bnplProviderCheckoutUrl=null===(r=null==t?void 0:t.bnpl)||void 0===r?void 0:r.provider_checkout_url}emitCheckoutChanged(){const t={availablePaymentMethodTypes:x(),selectedPaymentMethod:p.selectedPaymentMethod,savedPaymentMethods:p.paymentMethods};this.checkoutChangedEvent.emit(t)}queryFormRefs(){this.billingFormRef=this.hostEl.querySelector("justifi-billing-form, justifi-bank-account-billing-form-simple, justifi-card-billing-form-simple, justifi-billing-form-full"),this.applePayRef=this.hostEl.querySelector("justifi-apple-pay"),this.googlePayRef=this.hostEl.querySelector("justifi-google-pay"),this.paymentMethodFormRef=this.hostEl.querySelector("justifi-card-form, justifi-bank-account-form, justifi-tokenize-payment-method"),this.insuranceFormRef=this.hostEl.querySelector("justifi-season-interruption-insurance")}setupApplePayListeners(){this.applePayRef&&(this.applePayRef.addEventListener("applePayCompleted",this.handleApplePayCompleted),this.applePayRef.addEventListener("applePayError",this.handleApplePayError),this.applePayRef.addEventListener("applePayCancelled",this.handleApplePayCancelled))}removeApplePayListeners(){this.applePayRef&&(this.applePayRef.removeEventListener("applePayCompleted",this.handleApplePayCompleted),this.applePayRef.removeEventListener("applePayError",this.handleApplePayError),this.applePayRef.removeEventListener("applePayCancelled",this.handleApplePayCancelled))}setupGooglePayListeners(){this.googlePayRef&&(this.googlePayRef.addEventListener("googlePayCompleted",this.handleGooglePayCompleted),this.googlePayRef.addEventListener("googlePayCancelled",this.handleGooglePayCancelled))}removeGooglePayListeners(){this.googlePayRef&&(this.googlePayRef.removeEventListener("googlePayCompleted",this.handleGooglePayCompleted),this.googlePayRef.removeEventListener("googlePayCancelled",this.handleGooglePayCancelled))}async tokenizePaymentMethod(t){var e,i,n;const s=null!==(i=await(null===(e=this.billingFormRef)||void 0===e?void 0:e.getValues()))&&void 0!==i?i:{},o=Object.assign(Object.assign({},t),s),a=Object.assign({accountId:p.accountId,payment_method_group_id:void 0},o);p.savePaymentMethod&&(a.payment_method_group_id=p.paymentMethodGroupId);const r=await(null===(n=this.paymentMethodFormRef)||void 0===n?void 0:n.tokenize({clientId:this.authToken,paymentMethodMetadata:a,account:p.accountId}));return r.error?r:(p.paymentToken=r.id,r.id)}async setSelectedPaymentMethod(t){p.selectedPaymentMethod=t,p.paymentToken=t.id||void 0}async validate(){var t,e;const i=[];p.insuranceEnabled&&this.insuranceFormRef&&i.push(this.insuranceFormRef.validate());const n=(null===(t=p.selectedPaymentMethod)||void 0===t?void 0:t.type)===C.NEW_CARD,s=(null===(e=p.selectedPaymentMethod)||void 0===e?void 0:e.type)===C.NEW_BANK_ACCOUNT;if((n||s)&&(this.paymentMethodFormRef&&i.push(this.paymentMethodFormRef.validate()),this.billingFormRef&&i.push(this.billingFormRef.validate())),0===i.length)return!0;try{return!!(await Promise.all(i)).every((t=>"boolean"==typeof t?t:!1!==(null==t?void 0:t.isValid)))||(this.errorEvent.emit({message:"Validation error",errorCode:F.VALIDATION_ERROR,severity:Y.ERROR}),!1)}catch(t){return!1}}async submitCheckout(t){var e,i,n,s,o;const a=await this.validate();if(!p.selectedPaymentMethod)return void this.errorEvent.emit({message:"No payment method selected.",errorCode:F.VALIDATION_ERROR,severity:Y.ERROR});const r=(null===(e=p.selectedPaymentMethod)||void 0===e?void 0:e.type)===C.NEW_CARD,l=(null===(i=p.selectedPaymentMethod)||void 0===i?void 0:i.type)===C.NEW_BANK_ACCOUNT,c=(null===(n=p.selectedPaymentMethod)||void 0===n?void 0:n.type)===C.PLAID;if(r||l){const e=await this.tokenizePaymentMethod(t);if(null==e?void 0:e.error)return void this.errorEvent.emit({message:e.error.message,errorCode:F.TOKENIZE_ERROR,severity:Y.ERROR})}if(c&&!p.paymentToken){const t=p.plaidPublicToken,e=p.plaidLinkTokenId;if(!t)return void this.errorEvent.emit({message:"Missing Plaid public token. Please connect your bank.",errorCode:F.TOKENIZE_ERROR,severity:Y.ERROR});try{const i=await this.plaidService.tokenizeBankAccount(p.authToken,p.accountId,t,e||void 0,p.savePaymentMethod?p.paymentMethodGroupId:void 0);if(null==i?void 0:i.error)return void this.errorEvent.emit({message:"string"==typeof i.error?i.error:i.error.message||"Failed to tokenize bank account",errorCode:F.TOKENIZE_ERROR,severity:Y.ERROR});const n=null==i?void 0:i.data,o=(null===(s=null==n?void 0:n.bank_account)||void 0===s?void 0:s.token)||(null==n?void 0:n.token)||(null==n?void 0:n.id);p.paymentToken=o}catch(t){return void this.errorEvent.emit({message:(null==t?void 0:t.message)||"Plaid exchange error",errorCode:F.TOKENIZE_ERROR,severity:Y.ERROR})}}if(!a)return void this.errorEvent.emit({message:"Please fill in all required fields.",errorCode:F.VALIDATION_ERROR,severity:Y.ERROR});if(!p.paymentToken)return void this.errorEvent.emit({message:"Payment token not found.",errorCode:F.TOKENIZE_ERROR,severity:Y.ERROR});let h;if(h={payment_mode:(t=>{switch(t){case C.NEW_CARD:case C.SAVED_CARD:case C.NEW_BANK_ACCOUNT:case C.SAVED_BANK_ACCOUNT:case C.PLAID:return S.ECOM;case C.SEZZLE:return S.BNPL;case C.APPLE_PAY:return S.APPLE_PAY;case C.GOOGLE_PAY:return S.GOOGLE_PAY;default:return}})(null===(o=p.selectedPaymentMethod)||void 0===o?void 0:o.type),payment_token:p.paymentToken},this.preCompleteHook){const t=E();try{await new Promise(((e,i)=>{this.preCompleteHook(t,(()=>e()),(()=>i()))}))}catch(t){return}}this.completeCheckout({payment:h,onSuccess:({checkout:t})=>{this.submitEvent.emit({checkout:t,message:"Checkout completed successfully"})},onError:t=>{this.errorEvent.emit({message:t.message,errorCode:F.COMPLETE_CHECKOUT_ERROR,severity:Y.ERROR})}})}render(){return t(n,{key:"e771926ee79c47b09145bd44b47cbba3c21be3eb"})}get hostEl(){return s(this)}};var ct;!function(t){t.PLAID_SDK_LOAD_FAILED="plaid-sdk-load-failed",t.PLAID_LINK_INIT_FAILED="plaid-link-init-failed",t.PLAID_LINK_TOKEN_FAILED="plaid-link-token-failed",t.PLAID_AUTHENTICATION_FAILED="plaid-authentication-failed",t.PLAID_BANK_NOT_SUPPORTED="plaid-bank-not-supported",t.PLAID_TOKEN_EXPIRED="plaid-token-expired",t.PLAID_NETWORK_ERROR="plaid-network-error",t.PLAID_USER_CANCELLED="plaid-user-cancelled",t.PLAID_TIMEOUT="plaid-timeout",t.PLAID_INVALID_CREDENTIALS="plaid-invalid-credentials",t.PLAID_ACCOUNT_LOCKED="plaid-account-locked",t.PLAID_MAINTENANCE="plaid-maintenance",t.PLAID_RATE_LIMITED="plaid-rate-limited"}(ct||(ct={}));const ht={[ct.PLAID_SDK_LOAD_FAILED]:"Unable to load Plaid. Please refresh the page and try again.",[ct.PLAID_LINK_INIT_FAILED]:"Unable to initialize bank connection. Please try again.",[ct.PLAID_LINK_TOKEN_FAILED]:"Unable to connect to bank service. Please try again.",[ct.PLAID_AUTHENTICATION_FAILED]:"Bank authentication failed. Please try again.",[ct.PLAID_BANK_NOT_SUPPORTED]:"Your bank is not currently supported. Please try a different payment method.",[ct.PLAID_TOKEN_EXPIRED]:"Your bank session has expired. Please reconnect your account.",[ct.PLAID_NETWORK_ERROR]:"Network connection issue. Please check your internet connection and try again.",[ct.PLAID_USER_CANCELLED]:"Bank connection was cancelled. Click to try again.",[ct.PLAID_TIMEOUT]:"Bank connection timed out. Please try again.",[ct.PLAID_INVALID_CREDENTIALS]:"Invalid bank credentials. Please check your username and password.",[ct.PLAID_ACCOUNT_LOCKED]:"Your bank account is temporarily locked. Please contact your bank.",[ct.PLAID_MAINTENANCE]:"Bank service is temporarily unavailable. Please try again later.",[ct.PLAID_RATE_LIMITED]:"Too many connection attempts. Please wait a moment and try again."},dt={[ct.PLAID_SDK_LOAD_FAILED]:Y.ERROR,[ct.PLAID_LINK_INIT_FAILED]:Y.ERROR,[ct.PLAID_LINK_TOKEN_FAILED]:Y.ERROR,[ct.PLAID_AUTHENTICATION_FAILED]:Y.ERROR,[ct.PLAID_BANK_NOT_SUPPORTED]:Y.WARNING,[ct.PLAID_TOKEN_EXPIRED]:Y.WARNING,[ct.PLAID_NETWORK_ERROR]:Y.WARNING,[ct.PLAID_USER_CANCELLED]:Y.INFO,[ct.PLAID_TIMEOUT]:Y.WARNING,[ct.PLAID_INVALID_CREDENTIALS]:Y.ERROR,[ct.PLAID_ACCOUNT_LOCKED]:Y.ERROR,[ct.PLAID_MAINTENANCE]:Y.WARNING,[ct.PLAID_RATE_LIMITED]:Y.WARNING},pt=class{constructor(t){e(this,t),this.paymentMethodOptionSelected=i(this,"paymentMethodOptionSelected"),this.plaidError=i(this,"plaidError"),this.plaidErrorRecovered=i(this,"plaidErrorRecovered"),this.isAuthenticating=!1,this.publicToken=null,this.linkToken=null,this.linkTokenId=null,this.error=null,this.plaidLink=null,this.isSelected=!1,this.retryCount=0,this.isRetrying=!1,this.plaidService=new rt,this.maxRetries=3,this.retryDelay=2e3,this.timeoutId=null,this.abortController=null,this.hasLoggedDisabledWarning=!1,this.waitForStoreAndInitialize=()=>{p.authToken&&p.accountId&&p.checkoutId?this.initializePlaidLink():setTimeout((()=>{this.waitForStoreAndInitialize()}),100)},this.initializePlaidLink=async()=>{try{if(void 0===window.Plaid)return void this.handleError({code:ct.PLAID_SDK_LOAD_FAILED,message:ht[ct.PLAID_SDK_LOAD_FAILED],severity:dt[ct.PLAID_SDK_LOAD_FAILED],retryable:!0,userAction:"Refresh the page and try again"});if(await this.getLinkToken(),!this.linkToken)return void this.handleError({code:ct.PLAID_LINK_TOKEN_FAILED,message:ht[ct.PLAID_LINK_TOKEN_FAILED],severity:dt[ct.PLAID_LINK_TOKEN_FAILED],retryable:!0,userAction:"Click to try again"});const t=window.Plaid;this.plaidLink=t.create({token:this.linkToken,onSuccess:this.handlePlaidSuccess,onExit:this.handlePlaidExit,onEvent:this.handlePlaidEvent,onLoad:this.handlePlaidLoad})}catch(t){this.handleError({code:ct.PLAID_LINK_INIT_FAILED,message:ht[ct.PLAID_LINK_INIT_FAILED],severity:dt[ct.PLAID_LINK_INIT_FAILED],originalError:t,retryable:!0,userAction:"Click to try again"})}},this.getLinkToken=async()=>{var t,e,i,n,s;try{if(!p.authToken||!p.accountId)return void this.handleError({code:ct.PLAID_LINK_TOKEN_FAILED,message:"Missing authentication. Please refresh the page and try again.",severity:Y.ERROR,retryable:!1,userAction:"Refresh the page"});this.abortController=new AbortController,this.timeoutId=setTimeout((()=>{var t;null===(t=this.abortController)||void 0===t||t.abort()}),3e4);const e=await this.plaidService.getLinkToken(p.authToken,p.accountId,p.checkoutId,this.abortController.signal);if(this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null),e.error)throw new Error("string"==typeof e.error?e.error:e.error.message||"Failed to get link token");this.linkToken=e.data.link_token,this.linkTokenId=(null==e?void 0:e.id)||(null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.id)||null,this.linkTokenId&&(p.plaidLinkTokenId=this.linkTokenId)}catch(t){this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null);let o=ct.PLAID_LINK_TOKEN_FAILED,a=ht[o],r=!0;"AbortError"===t.name?(o=ct.PLAID_TIMEOUT,a=ht[o],r=!0):(null===(e=t.message)||void 0===e?void 0:e.includes("network"))||(null===(i=t.message)||void 0===i?void 0:i.includes("fetch"))?(o=ct.PLAID_NETWORK_ERROR,a=ht[o],r=!0):((null===(n=t.message)||void 0===n?void 0:n.includes("401"))||(null===(s=t.message)||void 0===s?void 0:s.includes("unauthorized")))&&(o=ct.PLAID_INVALID_CREDENTIALS,a="Authentication failed. Please refresh the page and try again.",r=!1),this.handleError({code:o,message:a,severity:dt[o],originalError:t,retryable:r,userAction:r?"Click to try again":"Refresh the page"})}},this.mapApiErrorToPlaidError=t=>{if("string"==typeof t){if(t.includes("rate_limit"))return ct.PLAID_RATE_LIMITED;if(t.includes("maintenance"))return ct.PLAID_MAINTENANCE;if(t.includes("not_authenticated"))return ct.PLAID_INVALID_CREDENTIALS}if(null==t?void 0:t.code)switch(t.code){case"rate_limited":return ct.PLAID_RATE_LIMITED;case"maintenance":return ct.PLAID_MAINTENANCE;case"not_authenticated":return ct.PLAID_INVALID_CREDENTIALS;default:return ct.PLAID_LINK_TOKEN_FAILED}return ct.PLAID_LINK_TOKEN_FAILED},this.openPlaidLink=()=>{this.plaidLink&&this.linkToken&&(this.isAuthenticating=!0,this.clearError(),this.plaidLink.open())},this.handlePlaidSuccess=t=>{this.publicToken=t,this.isAuthenticating=!1,this.clearError(),this.retryCount=0,this.isSelected||(this.isSelected=!0,p.selectedPaymentMethod={type:C.PLAID}),this.plaidErrorRecovered.emit({code:"plaid-success",message:"Bank account connected successfully",severity:Y.INFO}),p.plaidPublicToken=t},this.handlePlaidExit=t=>{this.isAuthenticating=!1,t&&this.handlePlaidError(t)},this.handlePlaidEvent=(t,e)=>{switch(t){case"OPEN":this.isAuthenticating=!0;break;case"CLOSE":this.isAuthenticating=!1;break;case"ERROR":this.handlePlaidError(e)}},this.handlePlaidLoad=()=>{},this.handlePlaidError=t=>{let e=ct.PLAID_AUTHENTICATION_FAILED,i=ht[e],n=!0,s="Click to try again";if(t.error_code)switch(t.error_code){case"INVALID_CREDENTIALS":e=ct.PLAID_INVALID_CREDENTIALS,i=ht[e],n=!0;break;case"ITEM_LOGIN_REQUIRED":e=ct.PLAID_INVALID_CREDENTIALS,i="Your bank requires re-authentication. Please try again.",n=!0;break;case"ITEM_LOCKED":e=ct.PLAID_ACCOUNT_LOCKED,i=ht[e],n=!1,s="Contact your bank";break;case"INSTITUTION_NOT_RESPONDING":e=ct.PLAID_MAINTENANCE,i=ht[e],n=!0;break;case"RATE_LIMIT_EXCEEDED":e=ct.PLAID_RATE_LIMITED,i=ht[e],n=!0;break;case"INVALID_REQUEST":e=ct.PLAID_AUTHENTICATION_FAILED,i="Invalid request. Please try again.",n=!0;break;case"PLAID_ERROR":e=ct.PLAID_AUTHENTICATION_FAILED,i=t.error_message||"Bank authentication failed. Please try again.",n=!0;break;default:t.error_message&&(i=t.error_message)}if(t.error_message){const o=t.error_message.toLowerCase();o.includes("not supported")||o.includes("unsupported")?(e=ct.PLAID_BANK_NOT_SUPPORTED,i=ht[e],n=!1,s="Try a different payment method"):(o.includes("expired")||o.includes("timeout"))&&(e=ct.PLAID_TOKEN_EXPIRED,i=ht[e],n=!0)}this.handleError({code:e,message:i,severity:dt[e],originalError:t,retryable:n,userAction:s}),this.isAuthenticating=!1},this.handleError=t=>{this.error=t,this.plaidError.emit({code:t.code,message:t.message,severity:t.severity,data:{originalError:t.originalError,retryable:t.retryable,userAction:t.userAction,retryCount:this.retryCount}}),console.error("Plaid error:",t),t.retryable&&this.retryCount<this.maxRetries&&this.scheduleRetry()},this.scheduleRetry=()=>{this.isRetrying||(this.isRetrying=!0,this.retryCount++,setTimeout((()=>{this.isRetrying=!1,this.clearError(),this.waitForStoreAndInitialize()}),this.retryDelay*this.retryCount))},this.clearError=()=>{this.error&&(this.error=null,this.retryCount=0)},this.syncWithStore=()=>{var t;const e=(null===(t=p.selectedPaymentMethod)||void 0===t?void 0:t.type)===C.PLAID;this.isSelected!==e&&(this.isSelected=e)}}onSelectionChange(t){var e;t&&(null===(e=p.selectedPaymentMethod)||void 0===e?void 0:e.type)!==C.PLAID&&(p.selectedPaymentMethod={type:C.PLAID}),!t||!this.plaidLink||this.publicToken||this.isAuthenticating||this.error||this.openPlaidLink()}componentDidRender(){this.scriptRef&&(this.scriptRef.onload=()=>{this.waitForStoreAndInitialize()},this.scriptRef.onerror=()=>{this.handleError({code:ct.PLAID_SDK_LOAD_FAILED,message:ht[ct.PLAID_SDK_LOAD_FAILED],severity:dt[ct.PLAID_SDK_LOAD_FAILED],retryable:!0,userAction:"Refresh the page and try again"})})}componentWillLoad(){var t;this.isSelected=(null===(t=p.selectedPaymentMethod)||void 0===t?void 0:t.type)===C.PLAID}async resolvePaymentMethod(){return this.publicToken?{token:this.publicToken,data:{type:"bank_account",plaid_public_token:this.publicToken}}:{validationError:!0}}async getPaymentToken(){return p.paymentToken}async handleSelectionClick(){if(this.isSelected=!0,p.selectedPaymentMethod={type:C.PLAID},this.error)return this.clearError(),void this.waitForStoreAndInitialize();!this.plaidLink||this.publicToken||this.isAuthenticating||this.openPlaidLink()}async setSelected(t){this.isSelected=t,t&&(p.selectedPaymentMethod={type:C.PLAID})}async isCurrentlySelected(){return this.isSelected}async deselect(){this.isSelected=!1}async reset(){this.publicToken=null,this.clearError(),this.isAuthenticating=!1,this.linkToken=null,this.plaidLink=null,this.retryCount=0,this.isRetrying=!1,this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null),this.abortController&&(this.abortController.abort(),this.abortController=null)}async isReadyForAuthentication(){return!(!this.plaidLink||!this.linkToken||this.isAuthenticating)}async retry(){this.error&&this.error.retryable&&(this.clearError(),this.waitForStoreAndInitialize())}async getErrorInfo(){return this.error}componentDidLoad(){const t=w("selectedPaymentMethod",this.syncWithStore);this.unsubscribeFromStore=t}disconnectedCallback(){this.unsubscribeFromStore&&this.unsubscribeFromStore(),this.timeoutId&&clearTimeout(this.timeoutId),this.abortController&&this.abortController.abort()}render(){if(!0!==p.bankAccountVerification)return this.hasLoggedDisabledWarning||(console.warn("[PlaidPaymentMethod] bank_account_verification is disabled. Component will not render."),this.hasLoggedDisabledWarning=!0),null;const e=t("img",{class:"plaid-logo-img",src:"data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ4IiB2aWV3Qm94PSIwIDAgMjggMjkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgY2xhc3M9ImNzcy0xcmRhajhtIj48ZyBmaWxsPSIjMTExIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPjxwYXRoIGQ9Ik0yNS43NjI5IDI2LjI2MjhMMjggMTcuNTMwOUwyNC45NjkxIDE0LjUwMDFMMjcuOTk5OSAxMS40NjkxTDI1Ljc2MjggMi43MzcwNkwxNy4wMzA5IDAuNUwxNC4wMDAxIDMuNTMxTDEwLjk2OSAwLjUwMDE0TDIuMjM3MDYgMi43MzczNEwwIDExLjQ2OTFMMy4wMzEyOCAxNC40OTk5TDAuMDAwMTQgMTcuNTMxTDIuMjM3MiAyNi4yNjI5TDEwLjk2OTEgMjguNUwxNC4wMDAxIDI1LjQ2OUwxNy4wMzEgMjguNDk5OUwyNS43NjI5IDI2LjI2MjhaTTE1LjczMjEgMjMuNzM3MUwxOC42MTg2IDIwLjg1MDVMMjIuMjkxMiAyNC41MjMzTDE3LjY5NTYgMjUuNzAwN0wxNS43MzIxIDIzLjczNzFaTTExLjExMzYgOS44ODE1NEwxNC4wMDAzIDYuOTk1MDJMMTYuODg2OCA5Ljg4MTRMMTQuMDAwMSAxMi43Njc5TDExLjExMzYgOS44ODE1NFpNMTIuMjY4MiAxNC41TDkuMzgxNTQgMTcuMzg2NUw2LjQ5NTAyIDE0LjVMOS4zODE1NCAxMS42MTM1TDEyLjI2ODIgMTQuNVpNMTguNjE4NyAxMS42MTMzTDIxLjUwNTMgMTQuNUwxOC42MTg2IDE3LjM4NjVMMTUuNzMyMSAxNC41TDE4LjYxODcgMTEuNjEzM1pNMTYuODg2NyAxOS4xMTg2TDE0LjAwMDEgMjIuMDA1MUwxMS4xMTM1IDE5LjExODVMMTQuMDAwMSAxNi4yMzE5TDE2Ljg4NjcgMTkuMTE4NlpNMTAuMzA0NCAyNS43MDA3TDUuNzA4NjQgMjQuNTIzM0w5LjM4MTU0IDIwLjg1MDRMMTIuMjY4MiAyMy43MzcxTDEwLjMwNDQgMjUuNzAwN1pNNC43NjMwOCAxNi4yMzE5TDcuNjQ5NiAxOS4xMTg1TDMuOTc2NyAyMi43OTE0TDIuNzk5MyAxOC4xOTU3TDQuNzYzMDggMTYuMjMxOVpNMy45NzY3IDYuMjA4MzZMNy42NDk3NCA5Ljg4MTRMNC43NjMwOCAxMi43NjgxTDIuNzk5MyAxMC44MDQxTDMuOTc2NyA2LjIwODM2Wk0xMi4yNjgzIDUuMjYyOTRMOS4zODE2OCA4LjE0OTZMNS43MDg5MiA0LjQ3NjdMMTAuMzA0NyAzLjI5OTNMMTIuMjY4MyA1LjI2Mjk0Wk0xNy42OTU5IDMuMjk5M0wyMi4yOTE1IDQuNDc2N0wxOC42MTg2IDguMTQ5NDZMMTUuNzMyMSA1LjI2Mjk0TDE3LjY5NTkgMy4yOTkzWk0yMy4yMzcyIDEyLjc2ODFMMjAuMzUwNSA5Ljg4MTRMMjQuMDIzMyA2LjIwODc4TDI1LjIwMDcgMTAuODA0NkwyMy4yMzcyIDEyLjc2ODFaTTI0LjAyMzMgMjIuNzkxNEwyMC4zNTA1IDE5LjExODZMMjMuMjM3MiAxNi4yMzIxTDI1LjIwMDcgMTguMTk1N0wyNC4wMjMzIDIyLjc5MTRaIj48L3BhdGg+PC9nPjwvc3ZnPgo=",alt:"Plaid",title:"Plaid",style:{display:"inline",width:"20px",height:"20px",marginLeft:"5px",marginTop:"-2px"}});return t(j,{class:"payment-method"},t("script",{src:"https://cdn.plaid.com/link/v2/stable/link-initialize.js",async:!0,ref:t=>this.scriptRef=t}),t("div",{title:"Pay with Plaid"},t("div",{onClick:t=>{t.preventDefault(),this.handleSelectionClick()}},"Pay with Bank Account ",e," "),(()=>this.error?t("div",{class:(this.error.severity===Y.ERROR?"text-danger":this.error.severity===Y.WARNING?"text-warning":"text-info")+" mt-2"},t("small",null,this.error.message),t("br",null),t("small",{class:"text-muted"},this.error.userAction,this.error.retryable&&this.retryCount<this.maxRetries&&t("span",null," • Auto-retry in progress..."))):null)(),(()=>this.error?null:this.isAuthenticating?t("div",{class:"text-info mt-2"},t("small",null,"Connecting to your bank...")):this.publicToken?t("div",{class:"text-success mt-2"},t("small",null,"✓ Bank account connected successfully")):!this.isSelected||this.publicToken||this.error||this.isAuthenticating?null:t("div",{class:"text-muted mt-2"},t("small",null,"Click to connect your bank account")))()))}static get watchers(){return{isSelected:["onSelectionChange"]}}},ut=class{constructor(t){e(this,t),this.onPaymentMethodOptionClick=t=>e=>{e.preventDefault(),p.selectedPaymentMethod={id:t.id,type:t.type},p.paymentToken=t.id},this.isAllowedPaymentMethod=t=>!(t===C.SAVED_CARD&&p.disableCreditCard||t===C.SAVED_BANK_ACCOUNT&&p.disableBankAccount)}componentWillLoad(){p.paymentMethods.length||console.warn("No saved payment methods available."),p.disablePaymentMethodGroup&&console.warn("Payment method group is disabled.")}render(){return p.disablePaymentMethodGroup?null:t(j,null,t("div",{class:"saved-payment-methods"},p.paymentMethods.length?p.paymentMethods.filter((t=>this.isAllowedPaymentMethod(t.type))).map((e=>t("div",{class:"radio-list-item p-3",part:N,onClick:this.onPaymentMethodOptionClick(e)},t("form-control-radio",{name:"paymentMethodType",value:null==e?void 0:e.id,checked:p.paymentToken===(null==e?void 0:e.id),label:`${Z[null==e?void 0:e.brand]||""} *${null==e?void 0:e.acct_last_four}`})))):null))}},yt=t("img",{class:"sezzle-smart-button-logo-img",src:"https://media.sezzle.com/branding/2.0/Sezzle_Logo_FullColor.svg",alt:"Sezzle",style:{display:"inline",width:"80px",marginLeft:"5px",marginTop:"-5px"}}),gt=class{constructor(t){e(this,t),this.paymentMethodOptionSelected=i(this,"paymentMethodOptionSelected"),this.paymentMethodOptionId=C.SEZZLE,this.initializeSezzleCheckout=()=>{let t;this.sezzlePromise=new Promise((e=>{t=e}));const e=Number(p.paymentAmount),i=new(0,window.Checkout)({mode:"popup",publicKey:p.bnplProviderClientId,apiMode:p.bnplProviderMode,apiVersion:p.bnplProviderApiVersion});i.sezzleButtonElement=this.sezzleButtonRef,i.init({onClick:function(t){t.preventDefault(),i.startCheckout({checkout_url:p.bnplProviderCheckoutUrl})},onComplete:e=>t({bnpl:e.data}),onCancel:e=>t({bnpl:e.data}),onFailure:e=>t({bnpl:e.data})}),this.sezzleCheckout=i,this.installmentPlan=this.sezzleCheckout.getInstallmentPlan(e)}}componentDidRender(){this.scriptRef&&(this.scriptRef.onload=()=>{this.sezzleButtonRef=document.createElement("button"),this.initializeSezzleCheckout()})}async resolvePaymentMethod(t){return t.isValid?(this.sezzleButtonRef.click(),this.sezzlePromise):{validationError:!0}}async handleSelectionClick(){p.selectedPaymentMethod={type:C.SEZZLE},this.paymentMethodOptionSelected.emit(this.paymentMethodOptionId)}render(){var e,i;return p.bnplEnabled?t(j,{class:"payment-method"},t("script",{src:"https://checkout-sdk.sezzle.com/checkout.min.js",async:!0,ref:t=>this.scriptRef=t}),t("div",null,t("div",null,"Buy now, pay later with ",yt),this.installmentPlan&&t("small",null,t("span",null,null===(e=this.installmentPlan)||void 0===e?void 0:e.installments.length)," ",t("span",null,this.installmentPlan.schedule," payments of")," ",t("span",{class:"fw-bold"},I(null===(i=this.installmentPlan)||void 0===i?void 0:i.installments[0].amountInCents))))):(console.warn("justifi-sezzle-payment-method: BNPL is not enabled for this account."),null)}};export{$ as justifi_apple_pay,tt as justifi_checkout_summary,st as justifi_google_pay,ot as justifi_header,lt as justifi_modular_checkout,pt as justifi_plaid_payment_method,ut as justifi_saved_payment_methods,gt as justifi_sezzle_payment_method}
@@ -1 +1 @@
1
- import{h as s,r as t,c as i}from"./p-DwYM91AU.js";import{A as e}from"./p-yyedWKWX.js";import{C as r,a as o}from"./p-Cjcsf8ku.js";import{c as a}from"./p-BrRsgB8S.js";import"./p-CLHwhyvu.js";import"./p-B5rtFhtR.js";import"./p-BH0Xfn-F.js";import{g as n,a as c}from"./p-D2muobcE.js";import{c as h,J as l}from"./p-DISrhs4v.js";import{p as d,f as p,r as u,j as v}from"./p-B09GVew-.js";import{v as m,i as y,a as f,H as j}from"./p-BhqSAzpT.js";import{G as g,H as _}from"./p-sA8HBfkI.js";import{S as k}from"./p-BP2sTIQV.js";import"./p-CZfYo5-1.js";import{S as w}from"./p-CsgUIrv8.js";import"./p-tGDdRx0W.js";import"./p-BYsgavgS.js";import"./p-DkoufM1t.js";import"./p-CsRppqXL.js";import"./p-HXpYMWUU.js";const b=e();class C{async fetchQuote(s,t){return b.post({endpoint:"insurance/quotes",body:t,authToken:s})}async toggleCoverage(s,t,i){return b.post({endpoint:`insurance/quotes/${t}/toggle`,body:i,authToken:s})}}const T=()=>s("div",{class:"row gap-3"},s("div",{class:"col-12"},s(w,{width:"35%",height:"30px"})),s("div",{class:"col-12"},s(w,{width:"70%"})),s("div",{class:"col-12"},s(w,{width:"40%"})),s("div",{class:"col-12"},s(w,{width:"40%"})),s("div",{class:"col-12"},s(w,{width:"100%"})),s("div",{class:"col-12"},s(w,{width:"80%"}))),H=class{constructor(s){t(this,s),this.insuranceUpdated=i(this,"insurance-updated"),this.errorEvent=i(this,"error-event"),this.isLoading=!0}async validate(){return m()}processHTMLContent(s){return d(s,[s=>u(s,"style"),s=>v(s,"a","part",g),s=>v(s,"p","part",g)])}componentWillLoad(){h(),this.analytics=new l(this),this.initializeServiceMethods(),this.getQuote&&this.fetchData()}disconnectedCallback(){var s;null===(s=this.analytics)||void 0===s||s.cleanup()}initializeServiceMethods(){const s=this.authToken||a.authToken;if(!s)return void this.errorEvent.emit({errorCode:o.MISSING_PROPS,message:"Missing authToken",severity:r.ERROR});const t={authToken:s,service:new C};this.getQuote=(({authToken:s,service:t})=>async({payload:i,onSuccess:e,onError:o})=>{var a;try{const h=await t.fetchQuote(s,i);if(h.error)return o({error:c(h.error),code:n(null===(a=h.error)||void 0===a?void 0:a.code),severity:r.ERROR});e({quote:h.data})}catch(s){const t=n(null==s?void 0:s.code);return o({error:s.message||s,code:t,severity:r.ERROR})}})(t),this.toggleCoverage=(({authToken:s,service:t})=>async({quoteId:i,payload:e,onSuccess:o,onError:a})=>{var h;try{const l=await t.toggleCoverage(s,i,e);if(l.error)return a({error:c(l.error),code:n(null===(h=l.error)||void 0===h?void 0:h.code),severity:r.ERROR});o({quote:l.data})}catch(s){const t=n(null==s?void 0:s.code);return a({error:s.message||s,code:t,severity:r.ERROR})}})(t)}fetchData(){this.isLoading=!0,this.getQuote({payload:{checkout_id:this.checkoutId||a.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:s})=>{this.quote=s,this.quote.product.description=this.processHTMLContent(this.quote.product.description),this.quote.product.legal_disclaimer=this.processHTMLContent(this.quote.product.legal_disclaimer),y[s.policy_type]=s.accepted,this.isLoading=!1},onError:({error:s,code:t,severity:i})=>{this.isLoading=!1,this.errorEvent.emit({errorCode:t,message:s,severity:i})}})}onChangeHandler(s,t){this.accepted=t,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:s,code:t,severity:i})=>{this.errorEvent.emit({errorCode:t,message:s,severity:i})}})}get error(){var s;return f[null===(s=this.quote)||void 0===s?void 0:s.policy_type]}render(){var t,i,e,r;return a&&!1===a.insuranceEnabled?(console.warn("[justifi-season-interruption-insurance] Insurance is disabled for this checkout (payment_settings.insurance_payments=false)."),null):s(k,null,this.isLoading?s(T,null):s("div",null,s(j,{text:null===(t=this.quote)||void 0===t?void 0:t.product.title,class:"fs-5 fw-bold pb-3"}),s("small",{part:g,innerHTML:null===(i=this.quote)||void 0===i?void 0:i.product.description}),s("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}),s("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}),s("div",{class:"invalid-feedback",style:{display:this.error?"block":"none"},part:_},"Please select an option"),s("small",{part:g,innerHTML:null===(r=this.quote)||void 0===r?void 0:r.product.legal_disclaimer})))}};export{H as justifi_season_interruption_insurance}
1
+ import{h as s,r as t,c as i}from"./p-DwYM91AU.js";import{A as e}from"./p-yyedWKWX.js";import{C as r,a as o}from"./p-Cjcsf8ku.js";import{c as a}from"./p-BrRsgB8S.js";import"./p-CLHwhyvu.js";import"./p-B5rtFhtR.js";import"./p-BH0Xfn-F.js";import{g as n,a as c}from"./p-D2muobcE.js";import{c as l,J as h}from"./p-BEu9YFnf.js";import{p as d,f as p,r as u,j as v}from"./p-B09GVew-.js";import{v as m,i as f,a as y,H as j}from"./p-BhqSAzpT.js";import{G as g,H as _}from"./p-sA8HBfkI.js";import{S as k}from"./p-BP2sTIQV.js";import"./p-CZfYo5-1.js";import{S as w}from"./p-CsgUIrv8.js";import"./p-tGDdRx0W.js";import"./p-BYsgavgS.js";import"./p-DkoufM1t.js";import"./p-Dr8Z8wfP.js";import"./p-HXpYMWUU.js";const b=e();class T{async fetchQuote(s,t){return b.post({endpoint:"insurance/quotes",body:t,authToken:s})}async toggleCoverage(s,t,i){return b.post({endpoint:`insurance/quotes/${t}/toggle`,body:i,authToken:s})}}const C=()=>s("div",{class:"row gap-3"},s("div",{class:"col-12"},s(w,{width:"35%",height:"30px"})),s("div",{class:"col-12"},s(w,{width:"70%"})),s("div",{class:"col-12"},s(w,{width:"40%"})),s("div",{class:"col-12"},s(w,{width:"40%"})),s("div",{class:"col-12"},s(w,{width:"100%"})),s("div",{class:"col-12"},s(w,{width:"80%"}))),H=class{constructor(s){t(this,s),this.insuranceUpdated=i(this,"insurance-updated"),this.errorEvent=i(this,"error-event"),this.isLoading=!0}async validate(){return m()}processHTMLContent(s){return d(s,[s=>u(s,"style"),s=>v(s,"a","part",g),s=>v(s,"p","part",g)])}componentWillLoad(){l(),this.analytics=new h(this),this.initializeServiceMethods(),this.getQuote&&this.fetchData()}disconnectedCallback(){var s;null===(s=this.analytics)||void 0===s||s.cleanup()}initializeServiceMethods(){const s=this.authToken||a.authToken;if(!s)return void this.errorEvent.emit({errorCode:o.MISSING_PROPS,message:"Missing authToken",severity:r.ERROR});const t={authToken:s,service:new T};this.getQuote=(({authToken:s,service:t})=>async({payload:i,onSuccess:e,onError:o})=>{var a;try{const l=await t.fetchQuote(s,i);if(l.error)return o({error:c(l.error),code:n(null===(a=l.error)||void 0===a?void 0:a.code),severity:r.ERROR});e({quote:l.data})}catch(s){const t=n(null==s?void 0:s.code);return o({error:s.message||s,code:t,severity:r.ERROR})}})(t),this.toggleCoverage=(({authToken:s,service:t})=>async({quoteId:i,payload:e,onSuccess:o,onError:a})=>{var l;try{const h=await t.toggleCoverage(s,i,e);if(h.error)return a({error:c(h.error),code:n(null===(l=h.error)||void 0===l?void 0:l.code),severity:r.ERROR});o({quote:h.data})}catch(s){const t=n(null==s?void 0:s.code);return a({error:s.message||s,code:t,severity:r.ERROR})}})(t)}fetchData(){this.isLoading=!0,this.getQuote({payload:{checkout_id:this.checkoutId||a.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:s})=>{this.quote=s,this.quote.product.description=this.processHTMLContent(this.quote.product.description),this.quote.product.legal_disclaimer=this.processHTMLContent(this.quote.product.legal_disclaimer),f[s.policy_type]=s.accepted,this.isLoading=!1},onError:({error:s,code:t,severity:i})=>{this.isLoading=!1,this.errorEvent.emit({errorCode:t,message:s,severity:i})}})}onChangeHandler(s,t){this.accepted=t,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:s,code:t,severity:i})=>{this.errorEvent.emit({errorCode:t,message:s,severity:i})}})}get error(){var s;return y[null===(s=this.quote)||void 0===s?void 0:s.policy_type]}render(){var t,i,e,r;return a&&!1===a.insuranceEnabled?(console.warn("[justifi-season-interruption-insurance] Insurance is disabled for this checkout (payment_settings.insurance_payments=false)."),null):s(k,null,this.isLoading?s(C,null):s("div",null,s(j,{text:null===(t=this.quote)||void 0===t?void 0:t.product.title,class:"fs-5 fw-bold pb-3"}),s("small",{part:g,innerHTML:null===(i=this.quote)||void 0===i?void 0:i.product.description}),s("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}),s("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}),s("div",{class:"invalid-feedback",style:{display:this.error?"block":"none"},part:_},"Please select an option"),s("small",{part:g,innerHTML:null===(r=this.quote)||void 0===r?void 0:r.product.legal_disclaimer})))}};export{H as justifi_season_interruption_insurance}
@@ -1 +1 @@
1
- import{r as e,c as t,h as i}from"./p-DwYM91AU.js";import{c as s,J as a}from"./p-DISrhs4v.js";import{c as d}from"./p-BrRsgB8S.js";import{d as c}from"./p-sA8HBfkI.js";import{S as o}from"./p-BP2sTIQV.js";import"./p-CZfYo5-1.js";import{P as h}from"./p-DkoufM1t.js";import"./p-CsRppqXL.js";import"./p-yyedWKWX.js";import"./p-tGDdRx0W.js";import"./p-BYsgavgS.js";import"./p-B09GVew-.js";import"./p-HXpYMWUU.js";import"./p-Cjcsf8ku.js";import"./p-CLHwhyvu.js";import"./p-B5rtFhtR.js";import"./p-BH0Xfn-F.js";const f=class{constructor(i){e(this,i),this.errorEvent=t(this,"error-event"),this.loadedEvent=t(this,"loaded"),this.submitEvent=t(this,"submit-event"),this.availablePaymentMethods=[],this.errorMessage="",this.insuranceToggled=!1,this.isSubmitting=!1,this.disableBankAccount=!1,this.disableBnpl=!1,this.disableCreditCard=!1,this.disablePaymentMethodGroup=!1,this.hideBankAccountBillingForm=!1,this.hideCardBillingForm=!1}propChanged(){this.updateStore()}connectedCallback(){this.authToken&&this.checkoutId&&this.updateStore()}componentWillLoad(){s(),this.analytics=new a(this)}disconnectedCallback(){var e;null===(e=this.analytics)||void 0===e||e.cleanup()}checkoutComplete(e){this.isSubmitting=!1}checkoutError(e){console.error("[justifi-checkout] error-event received",null==e?void 0:e.detail),this.isSubmitting=!1}checkoutChanged(e){this.availablePaymentMethods=this.disableBnpl?e.detail.availablePaymentMethodTypes.filter((e=>e!==h.SEZZLE)):e.detail.availablePaymentMethodTypes}async fillBillingForm(e){var t;d.billingFormFields=e,null===(t=this.tokenizePaymentMethodRef)||void 0===t||t.fillBillingForm(e)}async validate(){var e;return{isValid:await(null===(e=this.modularCheckoutRef)||void 0===e?void 0:e.validate())}}updateStore(){d.checkoutId=this.checkoutId,d.authToken=this.authToken,d.disableCreditCard=this.disableCreditCard,d.disableBankAccount=this.disableBankAccount,d.disablePaymentMethodGroup=this.disablePaymentMethodGroup}async submit(e){var t;this.isSubmitting=!0,null===(t=this.modularCheckoutRef)||void 0===t||t.submitCheckout(d.billingFormFields)}get showPaymentTypeHeader(){return!this.disableCreditCard&&!this.disableBankAccount}render(){var e,t;return i(o,{key:"e9f527c5dd4dc564c4fb00d69b27e07c90e8b552"},i("justifi-modular-checkout",{key:"e80dd4c78282fc428f0e78d6d87f71f262577f01",ref:e=>{this.modularCheckoutRef=e},authToken:this.authToken,checkoutId:this.checkoutId,preCompleteHook:this.preCompleteHook},i("div",{key:"92f3821b2566f6ede351145cafe934bb1b14e970",class:"row gy-3 jfi-checkout-core"},i("div",{key:"ed96eb7b2620df4c8398b36b62e2eb5744de7545",class:"col-12",part:c},i("justifi-header",{key:"a23f3ea139874c80830b9bd62b44bedad2520d89",text:"Summary",level:"h2",class:"fs-5 fw-bold pb-3"}),i("section",{key:"45f903ebb6cee7d382414fd04656b605fb5f9e91"},i("justifi-checkout-summary",{key:"7a6ba74f821aed6aee12682626bd1f304a90cc4b"}))),i("div",{key:"3930d68c41aa3a1b99371bbea285b2de4d734766",class:"col-12 mt-4"},i("slot",{key:"8cb5f1ef64ae6ecd25edf861b555dc6f20abd0ec",name:"insurance"})),i("div",{key:"3f8b4dae6eb90999927070027a77bfa9a4b09442",class:"col-12 mt-4"},i("justifi-header",{key:"4335e04295005071b061391d27a5cc4677519e71",text:"Payment",level:"h2",class:"fs-5 fw-bold pb-3"}),this.showPaymentTypeHeader&&i("justifi-header",{key:"1ca763ef15405ee55bf763bd7760f36e2925bbe1",text:"Select payment type",level:"h3",class:"fs-6 fw-bold lh-lg"}),i("div",{key:"c52c81c4b84fde4168037f06c7d5b6f491d2bea9",class:"d-flex flex-column"},i("section",{key:"3d1981827d98b947e541599582dc1f15bfe3f542"},i("div",{key:"8ddeb4dae00fe55092fba788c9fb2b44ad1a1240"},this.availablePaymentMethods.includes(h.APPLE_PAY)&&i("div",{key:"496486644e4caa90379e20cfb80b20c2670eef0b",class:"mb-3"},i("justifi-apple-pay",{key:"9d360fed1e166d0adf4f97f8b1817fde6a7dc0ec"})),this.availablePaymentMethods.includes(h.GOOGLE_PAY)&&i("div",{key:"e4d440ac6bedf38eb2baab3717d0d1308aaa5b10",class:"mb-3"},i("justifi-google-pay",{key:"9eee94d588e48fc5550cd3965f45612de3aedccb",ref:e=>this.googlePayRef=e})),i("justifi-saved-payment-methods",{key:"244e8877a4ce83ab8c4fff6051957d0ec50deafa"}),this.availablePaymentMethods.includes(h.SEZZLE)&&i("justifi-radio-list-item",{key:"37904744a21eb6f1f96e13831e3b0029aa87d25f",name:"paymentMethodType",value:h.SEZZLE,checked:(null===(e=null==d?void 0:d.selectedPaymentMethod)||void 0===e?void 0:e.type)===h.SEZZLE,label:i("justifi-sezzle-payment-method",{ref:e=>this.sezzlePaymentMethodRef=e}),"onRadio-click":()=>{var e;null===(e=this.sezzlePaymentMethodRef)||void 0===e||e.handleSelectionClick()}}),this.availablePaymentMethods.includes(h.PLAID)&&!this.disableBnpl&&i("justifi-radio-list-item",{key:"d2fc7e88a17372967a64edf57a33ef0758568357",name:"paymentMethodType",value:h.PLAID,checked:(null===(t=null==d?void 0:d.selectedPaymentMethod)||void 0===t?void 0:t.type)===h.PLAID,label:i("justifi-plaid-payment-method",{ref:e=>this.plaidPaymentMethodRef=e}),"onRadio-click":()=>{var e;null===(e=this.plaidPaymentMethodRef)||void 0===e||e.handleSelectionClick()}}),i("internal-tokenize-payment-method",{key:"b2c2b5b2db0970ac8bfb70141f9b0fa4545dddce",ref:e=>this.tokenizePaymentMethodRef=e,authToken:this.authToken,accountId:d.accountId,disableCreditCard:this.disableCreditCard,disableBankAccount:this.disableBankAccount,hideCardBillingForm:this.hideCardBillingForm,hideBankAccountBillingForm:this.hideBankAccountBillingForm,hideSubmitButton:!0,paymentMethodGroupId:d.paymentMethodGroupId}))))),i("div",{key:"e8f3ba632562b2369e6acc8a135647cc74dc0c0d",class:"mt-4"},i("justifi-button",{key:"e34306fed36d84a03a4e6ad3ba92abc276423590",text:"Pay",type:"submit",variant:"primary",clickHandler:e=>this.submit(e),disabled:this.isSubmitting,isLoading:this.isSubmitting,customStyle:{width:"100%",textAlign:"center"}})))))}static get watchers(){return{authToken:["propChanged"],checkoutId:["propChanged"],disableCreditCard:["propChanged"],disableBankAccount:["propChanged"],disablePaymentMethodGroup:["propChanged"]}}};export{f as justifi_checkout}
1
+ import{r as e,c as t,h as i}from"./p-DwYM91AU.js";import{c as a,J as s}from"./p-BEu9YFnf.js";import{c as d}from"./p-BrRsgB8S.js";import{d as c}from"./p-sA8HBfkI.js";import{S as o}from"./p-BP2sTIQV.js";import"./p-CZfYo5-1.js";import{P as h}from"./p-DkoufM1t.js";import"./p-Dr8Z8wfP.js";import"./p-yyedWKWX.js";import"./p-tGDdRx0W.js";import"./p-BYsgavgS.js";import"./p-B09GVew-.js";import"./p-HXpYMWUU.js";import"./p-Cjcsf8ku.js";import"./p-CLHwhyvu.js";import"./p-B5rtFhtR.js";import"./p-BH0Xfn-F.js";const f=class{constructor(i){e(this,i),this.errorEvent=t(this,"error-event"),this.loadedEvent=t(this,"loaded"),this.submitEvent=t(this,"submit-event"),this.availablePaymentMethods=[],this.errorMessage="",this.insuranceToggled=!1,this.isSubmitting=!1,this.disableBankAccount=!1,this.disableBnpl=!1,this.disableCreditCard=!1,this.disablePaymentMethodGroup=!1,this.hideBankAccountBillingForm=!1,this.hideCardBillingForm=!1}propChanged(){this.updateStore()}connectedCallback(){this.authToken&&this.checkoutId&&this.updateStore()}componentWillLoad(){a(),this.analytics=new s(this)}disconnectedCallback(){var e;null===(e=this.analytics)||void 0===e||e.cleanup()}checkoutComplete(e){this.isSubmitting=!1}checkoutError(e){console.error("[justifi-checkout] error-event received",null==e?void 0:e.detail),this.isSubmitting=!1}checkoutChanged(e){this.availablePaymentMethods=this.disableBnpl?e.detail.availablePaymentMethodTypes.filter((e=>e!==h.SEZZLE)):e.detail.availablePaymentMethodTypes}async fillBillingForm(e){var t;d.billingFormFields=e,null===(t=this.tokenizePaymentMethodRef)||void 0===t||t.fillBillingForm(e)}async validate(){var e;return{isValid:await(null===(e=this.modularCheckoutRef)||void 0===e?void 0:e.validate())}}updateStore(){d.checkoutId=this.checkoutId,d.authToken=this.authToken,d.disableCreditCard=this.disableCreditCard,d.disableBankAccount=this.disableBankAccount,d.disablePaymentMethodGroup=this.disablePaymentMethodGroup}async submit(e){var t;this.isSubmitting=!0,null===(t=this.modularCheckoutRef)||void 0===t||t.submitCheckout(d.billingFormFields)}get showPaymentTypeHeader(){return!this.disableCreditCard&&!this.disableBankAccount}render(){var e,t;return i(o,{key:"e9f527c5dd4dc564c4fb00d69b27e07c90e8b552"},i("justifi-modular-checkout",{key:"e80dd4c78282fc428f0e78d6d87f71f262577f01",ref:e=>{this.modularCheckoutRef=e},authToken:this.authToken,checkoutId:this.checkoutId,preCompleteHook:this.preCompleteHook},i("div",{key:"92f3821b2566f6ede351145cafe934bb1b14e970",class:"row gy-3 jfi-checkout-core"},i("div",{key:"ed96eb7b2620df4c8398b36b62e2eb5744de7545",class:"col-12",part:c},i("justifi-header",{key:"a23f3ea139874c80830b9bd62b44bedad2520d89",text:"Summary",level:"h2",class:"fs-5 fw-bold pb-3"}),i("section",{key:"45f903ebb6cee7d382414fd04656b605fb5f9e91"},i("justifi-checkout-summary",{key:"7a6ba74f821aed6aee12682626bd1f304a90cc4b"}))),i("div",{key:"3930d68c41aa3a1b99371bbea285b2de4d734766",class:"col-12 mt-4"},i("slot",{key:"8cb5f1ef64ae6ecd25edf861b555dc6f20abd0ec",name:"insurance"})),i("div",{key:"3f8b4dae6eb90999927070027a77bfa9a4b09442",class:"col-12 mt-4"},i("justifi-header",{key:"4335e04295005071b061391d27a5cc4677519e71",text:"Payment",level:"h2",class:"fs-5 fw-bold pb-3"}),this.showPaymentTypeHeader&&i("justifi-header",{key:"1ca763ef15405ee55bf763bd7760f36e2925bbe1",text:"Select payment type",level:"h3",class:"fs-6 fw-bold lh-lg"}),i("div",{key:"c52c81c4b84fde4168037f06c7d5b6f491d2bea9",class:"d-flex flex-column"},i("section",{key:"3d1981827d98b947e541599582dc1f15bfe3f542"},i("div",{key:"8ddeb4dae00fe55092fba788c9fb2b44ad1a1240"},this.availablePaymentMethods.includes(h.APPLE_PAY)&&i("div",{key:"496486644e4caa90379e20cfb80b20c2670eef0b",class:"mb-3"},i("justifi-apple-pay",{key:"9d360fed1e166d0adf4f97f8b1817fde6a7dc0ec"})),this.availablePaymentMethods.includes(h.GOOGLE_PAY)&&i("div",{key:"e4d440ac6bedf38eb2baab3717d0d1308aaa5b10",class:"mb-3"},i("justifi-google-pay",{key:"9eee94d588e48fc5550cd3965f45612de3aedccb",ref:e=>this.googlePayRef=e})),i("justifi-saved-payment-methods",{key:"244e8877a4ce83ab8c4fff6051957d0ec50deafa"}),this.availablePaymentMethods.includes(h.SEZZLE)&&i("justifi-radio-list-item",{key:"37904744a21eb6f1f96e13831e3b0029aa87d25f",name:"paymentMethodType",value:h.SEZZLE,checked:(null===(e=null==d?void 0:d.selectedPaymentMethod)||void 0===e?void 0:e.type)===h.SEZZLE,label:i("justifi-sezzle-payment-method",{ref:e=>this.sezzlePaymentMethodRef=e}),"onRadio-click":()=>{var e;null===(e=this.sezzlePaymentMethodRef)||void 0===e||e.handleSelectionClick()}}),this.availablePaymentMethods.includes(h.PLAID)&&!this.disableBnpl&&i("justifi-radio-list-item",{key:"d2fc7e88a17372967a64edf57a33ef0758568357",name:"paymentMethodType",value:h.PLAID,checked:(null===(t=null==d?void 0:d.selectedPaymentMethod)||void 0===t?void 0:t.type)===h.PLAID,label:i("justifi-plaid-payment-method",{ref:e=>this.plaidPaymentMethodRef=e}),"onRadio-click":()=>{var e;null===(e=this.plaidPaymentMethodRef)||void 0===e||e.handleSelectionClick()}}),i("internal-tokenize-payment-method",{key:"b2c2b5b2db0970ac8bfb70141f9b0fa4545dddce",ref:e=>this.tokenizePaymentMethodRef=e,authToken:this.authToken,accountId:d.accountId,disableCreditCard:this.disableCreditCard,disableBankAccount:this.disableBankAccount,hideCardBillingForm:this.hideCardBillingForm,hideBankAccountBillingForm:this.hideBankAccountBillingForm,hideSubmitButton:!0,paymentMethodGroupId:d.paymentMethodGroupId}))))),i("div",{key:"e8f3ba632562b2369e6acc8a135647cc74dc0c0d",class:"mt-4"},i("justifi-button",{key:"e34306fed36d84a03a4e6ad3ba92abc276423590",text:"Pay",type:"submit",variant:"primary",clickHandler:e=>this.submit(e),disabled:this.isSubmitting,isLoading:this.isSubmitting,customStyle:{width:"100%",textAlign:"center"}})))))}static get watchers(){return{authToken:["propChanged"],checkoutId:["propChanged"],disableCreditCard:["propChanged"],disableBankAccount:["propChanged"],disablePaymentMethodGroup:["propChanged"]}}};export{f as justifi_checkout}
@@ -0,0 +1 @@
1
+ import{r as t,c as s,h as i}from"./p-DwYM91AU.js";import{C as r,a as o}from"./p-Cjcsf8ku.js";import{c as e,J as a}from"./p-BEu9YFnf.js";import{T as n}from"./p-CCxsFwC4.js";import"./p-tGDdRx0W.js";import"./p-HXpYMWUU.js";import{f as p}from"./p-BrRsgB8S.js";import"./p-CLHwhyvu.js";import"./p-B5rtFhtR.js";import"./p-BH0Xfn-F.js";import{g as c,a as h}from"./p-D2muobcE.js";import{m,S as u}from"./p-C9VmfRis.js";import{S as d}from"./p-BP2sTIQV.js";import"./p-CZfYo5-1.js";import{d as f}from"./p-CV8xqdt6.js";import"./p-Dr8Z8wfP.js";import"./p-yyedWKWX.js";import"./p-B09GVew-.js";import"./p-BYsgavgS.js";import"./p-DkoufM1t.js";import"./p-U3nU15el.js";import"./p-sA8HBfkI.js";const l=class{constructor(i){t(this,i),this.errorEvent=s(this,"error-event"),this.errorMessage=null,this.columns=f,this.handleErrorEvent=t=>{this.errorMessage=t.detail.message,this.errorEvent.emit(t.detail)}}componentWillLoad(){e(),this.analytics=new a(this),this.initializeGetData()}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}propChanged(){this.initializeGetData()}initializeGetData(){this.initializeGetTerminals(),this.initializeGetSubAccounts()}initializeGetTerminals(){this.accountId&&this.authToken?this.getTerminals=(({id:t,authToken:s,service:i})=>async({params:o,onSuccess:e,onError:a})=>{var n,m;try{const u=await i.fetchTerminals(t,s,o);if(u.error)return a({error:h(u.error),code:c(null===(m=u.error)||void 0===m?void 0:m.code),severity:r.ERROR});{const t=Object.assign({},u.page_info);e({terminals:(null===(n=u.data)||void 0===n?void 0:n.map((t=>new p(t))))||[],pagingInfo:t})}}catch(t){const s=c(null==t?void 0:t.code);return a({error:t.message||t,code:s,severity:r.ERROR})}})({id:this.accountId,authToken:this.authToken,service:new n}):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:o.MISSING_PROPS,message:this.errorMessage,severity:r.ERROR}))}initializeGetSubAccounts(){this.accountId&&this.authToken&&(this.getSubAccounts=m({accountId:this.accountId,authToken:this.authToken,service:new u}))}render(){return i(d,{key:"9bf1797fc21c7fdf2b58aedab5819513338e714b"},i("terminals-list-core",{key:"46c5f5cc5a436d47e4813207cce07d28a4f20ef7",getTerminals:this.getTerminals,getSubAccounts:this.getSubAccounts,"onError-event":this.handleErrorEvent,columns:this.columns}))}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"]}}};export{l as justifi_terminals_list}
@@ -1 +1 @@
1
- import{r as t,c as s,h as i}from"./p-DwYM91AU.js";import{P as r}from"./p-DY_3dcgR.js";import"./p-tGDdRx0W.js";import"./p-HXpYMWUU.js";import{C as o,a as e}from"./p-Cjcsf8ku.js";import{e as p}from"./p-BrRsgB8S.js";import"./p-CLHwhyvu.js";import"./p-B5rtFhtR.js";import"./p-BH0Xfn-F.js";import{g as a,a as h}from"./p-D2muobcE.js";import{E as n}from"./p-DUmUUj9r.js";import{c as m,J as c}from"./p-DISrhs4v.js";import{m as d}from"./p-DYGIC0QH.js";import"./p-yyedWKWX.js";import"./p-B09GVew-.js";import"./p-BYsgavgS.js";import"./p-DkoufM1t.js";import"./p-sA8HBfkI.js";import"./p-CsRppqXL.js";const u=class{constructor(i){t(this,i),this.errorEvent=s(this,"error-event"),this.enableRecordClick=!1,this.errorMessage=null,this.handleErrorEvent=t=>{this.errorMessage=t.detail.message,this.errorEvent.emit(t.detail)}}componentWillLoad(){m(),this.analytics=new c(this),this.initializeServices()}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}propChanged(){this.initializeServices()}initializeServices(){this.payoutId&&this.authToken?(this.getPayout=(({id:t,authToken:s,service:i})=>async({onSuccess:r,onError:e})=>{var n;try{const m=await i.fetchPayout(t,s);m.error?e({error:h(m.error),code:a(null===(n=m.error)||void 0===n?void 0:n.code),severity:o.ERROR}):r(new p(m.data))}catch(t){e({error:h(t),code:a(null==t?void 0:t.code),severity:o.ERROR})}})({id:this.payoutId,authToken:this.authToken,service:new r}),this.getPayoutCSV=d({authToken:this.authToken,service:new r})):(this.errorMessage="Failed to load payout details. payoutId or authToken is not provided.",this.errorEvent.emit({message:this.errorMessage,errorCode:e.MISSING_PROPS,severity:o.ERROR}))}render(){return this.errorMessage?n(this.errorMessage):i("payout-details-core",{getPayout:this.getPayout,getPayoutCSV:this.getPayoutCSV,"onError-event":this.handleErrorEvent,enableRecordClick:this.enableRecordClick})}static get watchers(){return{payoutId:["propChanged"],authToken:["propChanged"]}}};export{u as justifi_payout_details}
1
+ import{r as t,c as s,h as i}from"./p-DwYM91AU.js";import{P as r}from"./p-DY_3dcgR.js";import"./p-tGDdRx0W.js";import"./p-HXpYMWUU.js";import{C as o,a as e}from"./p-Cjcsf8ku.js";import{e as p}from"./p-BrRsgB8S.js";import"./p-CLHwhyvu.js";import"./p-B5rtFhtR.js";import"./p-BH0Xfn-F.js";import{g as a,a as h}from"./p-D2muobcE.js";import{E as n}from"./p-DUmUUj9r.js";import{c as m,J as c}from"./p-BEu9YFnf.js";import{m as d}from"./p-DYGIC0QH.js";import"./p-yyedWKWX.js";import"./p-B09GVew-.js";import"./p-BYsgavgS.js";import"./p-DkoufM1t.js";import"./p-sA8HBfkI.js";import"./p-Dr8Z8wfP.js";const u=class{constructor(i){t(this,i),this.errorEvent=s(this,"error-event"),this.enableRecordClick=!1,this.errorMessage=null,this.handleErrorEvent=t=>{this.errorMessage=t.detail.message,this.errorEvent.emit(t.detail)}}componentWillLoad(){m(),this.analytics=new c(this),this.initializeServices()}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}propChanged(){this.initializeServices()}initializeServices(){this.payoutId&&this.authToken?(this.getPayout=(({id:t,authToken:s,service:i})=>async({onSuccess:r,onError:e})=>{var n;try{const m=await i.fetchPayout(t,s);m.error?e({error:h(m.error),code:a(null===(n=m.error)||void 0===n?void 0:n.code),severity:o.ERROR}):r(new p(m.data))}catch(t){e({error:h(t),code:a(null==t?void 0:t.code),severity:o.ERROR})}})({id:this.payoutId,authToken:this.authToken,service:new r}),this.getPayoutCSV=d({authToken:this.authToken,service:new r})):(this.errorMessage="Failed to load payout details. payoutId or authToken is not provided.",this.errorEvent.emit({message:this.errorMessage,errorCode:e.MISSING_PROPS,severity:o.ERROR}))}render(){return this.errorMessage?n(this.errorMessage):i("payout-details-core",{getPayout:this.getPayout,getPayoutCSV:this.getPayoutCSV,"onError-event":this.handleErrorEvent,enableRecordClick:this.enableRecordClick})}static get watchers(){return{payoutId:["propChanged"],authToken:["propChanged"]}}};export{u as justifi_payout_details}
@@ -1 +1 @@
1
- import{r as s,c as t,h as i}from"./p-DwYM91AU.js";import{C as o,a as r}from"./p-Cjcsf8ku.js";import{c as e,J as p}from"./p-DISrhs4v.js";import{P as a}from"./p-DY_3dcgR.js";import"./p-tGDdRx0W.js";import"./p-HXpYMWUU.js";import{e as n}from"./p-BrRsgB8S.js";import"./p-CLHwhyvu.js";import"./p-B5rtFhtR.js";import"./p-BH0Xfn-F.js";import{g as c,a as h}from"./p-D2muobcE.js";import{m}from"./p-DYGIC0QH.js";import{m as u,S as d}from"./p-C9VmfRis.js";import{S as j}from"./p-BP2sTIQV.js";import"./p-CZfYo5-1.js";import{d as f}from"./p-D6bKoyRc.js";import"./p-CsRppqXL.js";import"./p-yyedWKWX.js";import"./p-B09GVew-.js";import"./p-BYsgavgS.js";import"./p-DkoufM1t.js";import"./p-C2Senazf.js";import"./p-U3nU15el.js";import"./p-sA8HBfkI.js";const l=class{constructor(i){s(this,i),this.errorEvent=t(this,"error-event"),this.errorMessage=null,this.columns=f,this.handleOnError=s=>{this.errorMessage=s.detail.message,this.errorEvent.emit(s.detail)}}componentWillLoad(){e(),this.analytics=new p(this),this.initializeGetData()}disconnectedCallback(){var s;null===(s=this.analytics)||void 0===s||s.cleanup()}propChanged(){this.initializeGetData()}initializeGetData(){this.initializePayoutsServices(),this.initializeGetSubAccounts()}initializePayoutsServices(){if(this.accountId&&this.authToken){const s={id:this.accountId,authToken:this.authToken,service:new a};this.getPayouts=(({id:s,authToken:t,service:i})=>async({params:r,onSuccess:e,onError:p})=>{var a,m;try{const u=await i.fetchPayouts(s,t,r);if(u.error)return p({error:h(u.error),code:c(null===(m=u.error)||void 0===m?void 0:m.code),severity:o.ERROR});{const s=Object.assign({},u.page_info);e({payouts:(null===(a=u.data)||void 0===a?void 0:a.map((s=>new n(s))))||[],pagingInfo:s})}}catch(s){const t=c(null==s?void 0:s.code);return p({error:s.message||s,code:t,severity:o.ERROR})}})(s),this.getPayoutCSV=m(s)}else this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:r.MISSING_PROPS,message:this.errorMessage,severity:o.ERROR})}initializeGetSubAccounts(){this.accountId&&this.authToken&&(this.getSubAccounts=u({accountId:this.accountId,authToken:this.authToken,service:new d}))}render(){return i(j,{key:"767b8a3f2407435d86766c1ea947f406246a001d"},i("payouts-list-core",{key:"4e579cf8e2049033bc554319178b42511b164573",getPayouts:this.getPayouts,getPayoutCSV:this.getPayoutCSV,getSubAccounts:this.getSubAccounts,"onError-event":this.handleOnError,columns:this.columns}))}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"]}}};export{l as justifi_payouts_list}
1
+ import{r as t,c as s,h as i}from"./p-DwYM91AU.js";import{C as o,a as r}from"./p-Cjcsf8ku.js";import{c as e,J as p}from"./p-BEu9YFnf.js";import{P as a}from"./p-DY_3dcgR.js";import"./p-tGDdRx0W.js";import"./p-HXpYMWUU.js";import{e as n}from"./p-BrRsgB8S.js";import"./p-CLHwhyvu.js";import"./p-B5rtFhtR.js";import"./p-BH0Xfn-F.js";import{g as c,a as h}from"./p-D2muobcE.js";import{m}from"./p-DYGIC0QH.js";import{m as u,S as d}from"./p-C9VmfRis.js";import{S as j}from"./p-BP2sTIQV.js";import"./p-CZfYo5-1.js";import{d as f}from"./p-D6bKoyRc.js";import"./p-Dr8Z8wfP.js";import"./p-yyedWKWX.js";import"./p-B09GVew-.js";import"./p-BYsgavgS.js";import"./p-DkoufM1t.js";import"./p-C2Senazf.js";import"./p-U3nU15el.js";import"./p-sA8HBfkI.js";const l=class{constructor(i){t(this,i),this.errorEvent=s(this,"error-event"),this.errorMessage=null,this.columns=f,this.handleOnError=t=>{this.errorMessage=t.detail.message,this.errorEvent.emit(t.detail)}}componentWillLoad(){e(),this.analytics=new p(this),this.initializeGetData()}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}propChanged(){this.initializeGetData()}initializeGetData(){this.initializePayoutsServices(),this.initializeGetSubAccounts()}initializePayoutsServices(){if(this.accountId&&this.authToken){const t={id:this.accountId,authToken:this.authToken,service:new a};this.getPayouts=(({id:t,authToken:s,service:i})=>async({params:r,onSuccess:e,onError:p})=>{var a,m;try{const u=await i.fetchPayouts(t,s,r);if(u.error)return p({error:h(u.error),code:c(null===(m=u.error)||void 0===m?void 0:m.code),severity:o.ERROR});{const t=Object.assign({},u.page_info);e({payouts:(null===(a=u.data)||void 0===a?void 0:a.map((t=>new n(t))))||[],pagingInfo:t})}}catch(t){const s=c(null==t?void 0:t.code);return p({error:t.message||t,code:s,severity:o.ERROR})}})(t),this.getPayoutCSV=m(t)}else this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:r.MISSING_PROPS,message:this.errorMessage,severity:o.ERROR})}initializeGetSubAccounts(){this.accountId&&this.authToken&&(this.getSubAccounts=u({accountId:this.accountId,authToken:this.authToken,service:new d}))}render(){return i(j,{key:"767b8a3f2407435d86766c1ea947f406246a001d"},i("payouts-list-core",{key:"4e579cf8e2049033bc554319178b42511b164573",getPayouts:this.getPayouts,getPayoutCSV:this.getPayoutCSV,getSubAccounts:this.getSubAccounts,"onError-event":this.handleOnError,columns:this.columns}))}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"]}}};export{l as justifi_payouts_list}
@@ -1 +1 @@
1
- import{r as t,c as s,h as i}from"./p-DwYM91AU.js";import{C as e,a as r}from"./p-Cjcsf8ku.js";import{c as o,J as p}from"./p-DISrhs4v.js";import{D as n}from"./p-BH0Xfn-F.js";import{g as a,a as h}from"./p-D2muobcE.js";import{D as c}from"./p-Dit3fZpU.js";import"./p-CsRppqXL.js";import"./p-yyedWKWX.js";import"./p-tGDdRx0W.js";import"./p-BYsgavgS.js";import"./p-B09GVew-.js";import"./p-HXpYMWUU.js";import"./p-BrRsgB8S.js";import"./p-DkoufM1t.js";import"./p-CLHwhyvu.js";import"./p-B5rtFhtR.js";const u=class{constructor(i){t(this,i),this.errorEvent=s(this,"error-event"),this.errorMessage=null,this.handleErrorEvent=t=>{this.errorMessage=t.detail.message,this.errorEvent.emit(t.detail)}}componentWillLoad(){o(),this.analytics=new p(this),this.initializeGetDispute()}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}propChanged(){this.initializeGetDispute()}initializeGetDispute(){this.disputeId&&this.authToken?this.getDispute=(({id:t,authToken:s,service:i})=>async({onSuccess:r,onError:o})=>{var p;try{const c=await i.fetchDispute(t,s);if(c.error)return o({error:h(c.error),code:a(null===(p=c.error)||void 0===p?void 0:p.code),severity:e.ERROR});{const t=Object.assign({},c.page_info);r({dispute:new n(c.data),pagingInfo:t})}}catch(t){const s=a(null==t?void 0:t.code);return o({error:t.message||t,code:s,severity:e.ERROR})}})({id:this.disputeId,authToken:this.authToken,service:new c}):(this.errorMessage="Dispute ID and Auth Token are required",this.errorEvent.emit({message:this.errorMessage,errorCode:r.MISSING_PROPS,severity:e.ERROR}))}render(){return i("justifi-dispute-management-core",{key:"e19f33cd7106c3c44fb86faeef743c62ff9004b9",getDispute:this.getDispute,disputeId:this.disputeId,authToken:this.authToken,"onError-event":this.handleErrorEvent})}static get watchers(){return{disputeId:["propChanged"],authToken:["propChanged"]}}};export{u as justifi_dispute_management}
1
+ import{r as t,c as s,h as i}from"./p-DwYM91AU.js";import{C as e,a as r}from"./p-Cjcsf8ku.js";import{c as o,J as p}from"./p-BEu9YFnf.js";import{D as n}from"./p-BH0Xfn-F.js";import{g as a,a as h}from"./p-D2muobcE.js";import{D as c}from"./p-Dit3fZpU.js";import"./p-Dr8Z8wfP.js";import"./p-yyedWKWX.js";import"./p-tGDdRx0W.js";import"./p-BYsgavgS.js";import"./p-B09GVew-.js";import"./p-HXpYMWUU.js";import"./p-BrRsgB8S.js";import"./p-DkoufM1t.js";import"./p-CLHwhyvu.js";import"./p-B5rtFhtR.js";const u=class{constructor(i){t(this,i),this.errorEvent=s(this,"error-event"),this.errorMessage=null,this.handleErrorEvent=t=>{this.errorMessage=t.detail.message,this.errorEvent.emit(t.detail)}}componentWillLoad(){o(),this.analytics=new p(this),this.initializeGetDispute()}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}propChanged(){this.initializeGetDispute()}initializeGetDispute(){this.disputeId&&this.authToken?this.getDispute=(({id:t,authToken:s,service:i})=>async({onSuccess:r,onError:o})=>{var p;try{const c=await i.fetchDispute(t,s);if(c.error)return o({error:h(c.error),code:a(null===(p=c.error)||void 0===p?void 0:p.code),severity:e.ERROR});{const t=Object.assign({},c.page_info);r({dispute:new n(c.data),pagingInfo:t})}}catch(t){const s=a(null==t?void 0:t.code);return o({error:t.message||t,code:s,severity:e.ERROR})}})({id:this.disputeId,authToken:this.authToken,service:new c}):(this.errorMessage="Dispute ID and Auth Token are required",this.errorEvent.emit({message:this.errorMessage,errorCode:r.MISSING_PROPS,severity:e.ERROR}))}render(){return i("justifi-dispute-management-core",{key:"e19f33cd7106c3c44fb86faeef743c62ff9004b9",getDispute:this.getDispute,disputeId:this.disputeId,authToken:this.authToken,"onError-event":this.handleErrorEvent})}static get watchers(){return{disputeId:["propChanged"],authToken:["propChanged"]}}};export{u as justifi_dispute_management}
@@ -1 +1 @@
1
- import{p as t}from"./p-CsRppqXL.js";import{A as s}from"./p-yyedWKWX.js";import"./p-Cjcsf8ku.js";import"./p-BrRsgB8S.js";import"./p-CLHwhyvu.js";import"./p-B5rtFhtR.js";import"./p-BH0Xfn-F.js";const i=s();class e{async record(t){return i.post({endpoint:"analytics",body:t})}}class o{constructor(t){this.handleCustomEvent=async t=>{await this.service.record(t)},window.location.origin.includes("localhost")||window.location.origin.includes("storybook")||(this.service=new e,this.componentInstance=t,this.setUpBasicData(),this.setupLifecycleTracking(),this.trackCustomEvents())}get resourceId(){return this.componentInstance.accountId||this.componentInstance.businessId||this.componentInstance.paymentId||this.componentInstance.payoutId||this.componentInstance.checkoutId}setUpBasicData(){this.basicData={component_name:this.componentInstance.tagName,component_version:t.version,client_user_agent:navigator.userAgent,client_platform:navigator.userAgent,client_origin:window.location.origin,resource_id:this.resourceId}}trackCustomEvents(){this.eventEmitters=["submit-event","error-event"],this.eventEmitters.forEach((t=>{"function"==typeof this.componentInstance.addEventListener&&this.componentInstance.addEventListener(t,(s=>this.handleCustomEvent({event_type:t,data:Object.assign(Object.assign({},this.basicData),{error:s.detail})})))}))}setupLifecycleTracking(){const t=this.componentInstance.componentDidLoad;this.componentInstance.componentDidLoad=()=>{if(this.service.record({event_type:"init",data:this.basicData}),t)return t.apply(this.componentInstance)}}cleanup(){this.eventEmitters&&this.eventEmitters.forEach((t=>{this.componentInstance.removeEventListener(t,this.handleCustomEvent)}))}}const r=async()=>{var s,i;if("undefined"!=typeof process&&("test"===(null===(s=process.env)||void 0===s?void 0:s.NODE_ENV)||(null===(i=process.env)||void 0===i?void 0:i.JEST_WORKER_ID)))return;const e=t.version,o=t.name,r=await(async t=>{const s=await fetch("https://registry.npmjs.org/"+t+"/latest");return(await s.json()).version})(o),n=r.replace(/-rc.*/,""),a=e.split("."),c=r.split(".");a[0]!==c[0]&&console.warn(`The package ${o} is out of date. The latest version is ${n}. Please update.`)};export{o as J,r as c}
1
+ import{p as t}from"./p-Dr8Z8wfP.js";import{A as s}from"./p-yyedWKWX.js";import"./p-Cjcsf8ku.js";import"./p-BrRsgB8S.js";import"./p-CLHwhyvu.js";import"./p-B5rtFhtR.js";import"./p-BH0Xfn-F.js";const i=s();class e{async record(t){return i.post({endpoint:"analytics",body:t})}}class o{constructor(t){this.handleCustomEvent=async t=>{await this.service.record(t)},window.location.origin.includes("localhost")||window.location.origin.includes("storybook")||(this.service=new e,this.componentInstance=t,this.setUpBasicData(),this.setupLifecycleTracking(),this.trackCustomEvents())}get resourceId(){return this.componentInstance.accountId||this.componentInstance.businessId||this.componentInstance.paymentId||this.componentInstance.payoutId||this.componentInstance.checkoutId}setUpBasicData(){this.basicData={component_name:this.componentInstance.tagName,component_version:t.version,client_user_agent:navigator.userAgent,client_platform:navigator.userAgent,client_origin:window.location.origin,resource_id:this.resourceId}}trackCustomEvents(){this.eventEmitters=["submit-event","error-event"],this.eventEmitters.forEach((t=>{"function"==typeof this.componentInstance.addEventListener&&this.componentInstance.addEventListener(t,(s=>this.handleCustomEvent({event_type:t,data:Object.assign(Object.assign({},this.basicData),{error:s.detail})})))}))}setupLifecycleTracking(){const t=this.componentInstance.componentDidLoad;this.componentInstance.componentDidLoad=()=>{if(this.service.record({event_type:"init",data:this.basicData}),t)return t.apply(this.componentInstance)}}cleanup(){this.eventEmitters&&this.eventEmitters.forEach((t=>{this.componentInstance.removeEventListener(t,this.handleCustomEvent)}))}}const r=async()=>{var s,i;if("undefined"!=typeof process&&("test"===(null===(s=process.env)||void 0===s?void 0:s.NODE_ENV)||(null===(i=process.env)||void 0===i?void 0:i.JEST_WORKER_ID)))return;const e=t.version,o=t.name,r=await(async t=>{const s=await fetch("https://registry.npmjs.org/"+t+"/latest");return(await s.json()).version})(o),n=r.replace(/-rc.*/,""),a=e.split("."),c=r.split(".");a[0]!==c[0]&&console.warn(`The package ${o} is out of date. The latest version is ${n}. Please update.`)};export{o as J,r as c}
@@ -0,0 +1 @@
1
+ var e={name:"@justifi/webcomponents",version:"6.7.1"};export{e as p}
@@ -1 +1 @@
1
- import{r as t,c as s,h as i}from"./p-DwYM91AU.js";import{P as r}from"./p-DGGjRqDa.js";import{m as e}from"./p-DATDsXcA.js";import{E as p}from"./p-DUmUUj9r.js";import{C as o,a}from"./p-Cjcsf8ku.js";import{c as h,J as m}from"./p-DISrhs4v.js";import"./p-yyedWKWX.js";import"./p-tGDdRx0W.js";import"./p-BYsgavgS.js";import"./p-B09GVew-.js";import"./p-HXpYMWUU.js";import"./p-BrRsgB8S.js";import"./p-BH0Xfn-F.js";import"./p-DkoufM1t.js";import"./p-CLHwhyvu.js";import"./p-B5rtFhtR.js";import"./p-D2muobcE.js";import"./p-sA8HBfkI.js";import"./p-CsRppqXL.js";const n=class{constructor(i){t(this,i),this.errorEvent=s(this,"error-event"),this.recordClickEvent=s(this,"record-click-event"),this.errorMessage=null,this.paymentService=new r,this.handleErrorEvent=t=>{this.errorMessage=t.detail.message,this.errorEvent.emit(t.detail)},this.handleRecordClickEvent=t=>{this.recordClickEvent.emit({id:t.detail.id,type:t.detail.type})}}componentWillLoad(){h(),this.analytics=new m(this),this.initializeGetPaymentDetails()}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}propChanged(){this.initializeGetPaymentDetails()}initializeGetPaymentDetails(){this.paymentId&&this.authToken?this.getPaymentDetails=e({id:this.paymentId,authToken:this.authToken,service:new r}):(this.errorMessage="Payment ID and Auth Token are required",this.errorEvent.emit({message:this.errorMessage,errorCode:a.MISSING_PROPS,severity:o.ERROR}))}render(){return this.errorMessage?p(this.errorMessage):i("payment-details-core",{getPaymentDetails:this.getPaymentDetails,"onError-event":this.handleErrorEvent,"onRecord-click-event":this.handleRecordClickEvent,"enable-record-click":"true"})}static get watchers(){return{paymentId:["propChanged"],authToken:["propChanged"]}}};export{n as justifi_payment_details}
1
+ import{r as t,c as s,h as i}from"./p-DwYM91AU.js";import{P as r}from"./p-DGGjRqDa.js";import{m as e}from"./p-DATDsXcA.js";import{E as o}from"./p-DUmUUj9r.js";import{C as p,a}from"./p-Cjcsf8ku.js";import{c as h,J as n}from"./p-BEu9YFnf.js";import"./p-yyedWKWX.js";import"./p-tGDdRx0W.js";import"./p-BYsgavgS.js";import"./p-B09GVew-.js";import"./p-HXpYMWUU.js";import"./p-BrRsgB8S.js";import"./p-BH0Xfn-F.js";import"./p-DkoufM1t.js";import"./p-CLHwhyvu.js";import"./p-B5rtFhtR.js";import"./p-D2muobcE.js";import"./p-sA8HBfkI.js";import"./p-Dr8Z8wfP.js";const m=class{constructor(i){t(this,i),this.errorEvent=s(this,"error-event"),this.recordClickEvent=s(this,"record-click-event"),this.errorMessage=null,this.paymentService=new r,this.handleErrorEvent=t=>{this.errorMessage=t.detail.message,this.errorEvent.emit(t.detail)},this.handleRecordClickEvent=t=>{this.recordClickEvent.emit({id:t.detail.id,type:t.detail.type})}}componentWillLoad(){h(),this.analytics=new n(this),this.initializeGetPaymentDetails()}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}propChanged(){this.initializeGetPaymentDetails()}initializeGetPaymentDetails(){this.paymentId&&this.authToken?this.getPaymentDetails=e({id:this.paymentId,authToken:this.authToken,service:new r}):(this.errorMessage="Payment ID and Auth Token are required",this.errorEvent.emit({message:this.errorMessage,errorCode:a.MISSING_PROPS,severity:p.ERROR}))}render(){return this.errorMessage?o(this.errorMessage):i("payment-details-core",{getPaymentDetails:this.getPaymentDetails,"onError-event":this.handleErrorEvent,"onRecord-click-event":this.handleRecordClickEvent,"enable-record-click":"true"})}static get watchers(){return{paymentId:["propChanged"],authToken:["propChanged"]}}};export{m as justifi_payment_details}
@@ -1 +1 @@
1
- import{h as s,r as t,c as i}from"./p-DwYM91AU.js";import{c as r,F as e}from"./p-DiJD6Iqx.js";import{b as o,a,c as h}from"./p-giyZ3C4E.js";import{a as p,b as n,c as l,d as m}from"./p-DOcRWTul.js";import"./p-tGDdRx0W.js";import"./p-HXpYMWUU.js";import{C as c,a as d}from"./p-Cjcsf8ku.js";import"./p-BrRsgB8S.js";import"./p-CLHwhyvu.js";import{C as j,B as u,b as f}from"./p-B5rtFhtR.js";import"./p-BH0Xfn-F.js";import{c as v,J as b}from"./p-DISrhs4v.js";import{B as g}from"./p-Ty7R7tsw.js";import{S as w}from"./p-BP2sTIQV.js";import{H as C}from"./p-DmdEjScI.js";import"./p-CZfYo5-1.js";import{S as y}from"./p-CsgUIrv8.js";import{B}from"./p-XYgDHrVL.js";import{m as D,b as S}from"./p-5aA7gjr5.js";import{B as x}from"./p-Dlrq1iZf.js";import"./p-BFTU3MAI.js";import"./p-D032AB34.js";import"./p-DfKxeSrC.js";import"./p-CPpUGsw5.js";import"./p-BYsgavgS.js";import"./p-B09GVew-.js";import"./p-DkoufM1t.js";import"./p-CsRppqXL.js";import"./p-yyedWKWX.js";import"./p-sA8HBfkI.js";import"./p-D2muobcE.js";const I=r(Object.assign(Object.assign({},o().fields),{legal_address:n(),additional_questions:a(),representative:p("representative")}));r(Object.assign(Object.assign({},h().fields),{legal_address:m(),additional_questions:a(),representative:l("representative")}));const k=I,O=()=>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%"}))),q=()=>s("div",{class:"row gap-5"},s("div",{class:"col-12"},s(y,{width:"40%",height:"40px"})),s(O,null),s(O,null),s(O,null)),A=class{constructor(s){t(this,s),this.submitEvent=i(this,"submit-event"),this.clickEvent=i(this,"click-event"),this.errorEvent=i(this,"error-event"),this.isLoading=!1,this.isSaving=!1,this.country=j.USA,this.hideErrors=!1,this.formTitle="Business Information",this.removeTitle=!1,this.instantiateBusiness=s=>{const t=new u(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 u(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(){v(),this.analytics=new b(this),this.formController=new e(k),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=D({authToken:this.authToken,businessId:this.businessId,service:new x}),this.patchBusiness=S({authToken:this.authToken,businessId:this.businessId,service:new x}),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:d.MISSING_PROPS,severity:c.ERROR})}handleReponse(s){s.error&&(this.errorMessage=f.patchData),this.submitEvent.emit({response:s}),this.instantiateBusiness(s.data)}render(){return s(w,null,this.isLoading?s(q,null):s("form",{onSubmit:this.validateAndSubmit},s("div",{class:"row gap-3"},s(C,{text:this.title}),s("form-alert",{text:this.errorMessage,hideAlert:this.hideErrors}),s("div",{class:"col-12 mb-4"},s("justifi-business-core-info",{formController:this.formController,country:this.country})),s("div",{class:"col-12 mb-4"},s("justifi-legal-address-form",{formController:this.formController,country:this.country})),s("div",{class:"col-12 mb-4"},s("justifi-additional-questions",{formController:this.formController})),s("div",{class:"col-12 mb-4"},s("justifi-business-representative",{formController:this.formController,country:this.country})),s("div",{class:"col-12 d-flex flex-row-reverse"},s(g,{type:"submit",disabled:this.disabledState,variant:"primary",onClick:()=>this.clickEvent.emit({name:B.submit}),isLoading:this.isSaving},"Submit")))))}};export{A as justifi_business_form}
1
+ import{h as s,r as t,c as i}from"./p-DwYM91AU.js";import{c as r,F as e}from"./p-DiJD6Iqx.js";import{b as o,a,c as h}from"./p-giyZ3C4E.js";import{a as n,b as p,c as l,d as m}from"./p-DOcRWTul.js";import"./p-tGDdRx0W.js";import"./p-HXpYMWUU.js";import{C as c,a as d}from"./p-Cjcsf8ku.js";import"./p-BrRsgB8S.js";import"./p-CLHwhyvu.js";import{C as u,B as j,b as f}from"./p-B5rtFhtR.js";import"./p-BH0Xfn-F.js";import{c as v,J as b}from"./p-BEu9YFnf.js";import{B as g}from"./p-Ty7R7tsw.js";import{S as w}from"./p-BP2sTIQV.js";import{H as C}from"./p-DmdEjScI.js";import"./p-CZfYo5-1.js";import{S as y}from"./p-CsgUIrv8.js";import{B}from"./p-XYgDHrVL.js";import{m as D,b as x}from"./p-5aA7gjr5.js";import{B as S}from"./p-Dlrq1iZf.js";import"./p-BFTU3MAI.js";import"./p-D032AB34.js";import"./p-DfKxeSrC.js";import"./p-CPpUGsw5.js";import"./p-BYsgavgS.js";import"./p-B09GVew-.js";import"./p-DkoufM1t.js";import"./p-Dr8Z8wfP.js";import"./p-yyedWKWX.js";import"./p-sA8HBfkI.js";import"./p-D2muobcE.js";const k=r(Object.assign(Object.assign({},o().fields),{legal_address:p(),additional_questions:a(),representative:n("representative")}));r(Object.assign(Object.assign({},h().fields),{legal_address:m(),additional_questions:a(),representative:l("representative")}));const I=k,O=()=>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%"}))),A=()=>s("div",{class:"row gap-5"},s("div",{class:"col-12"},s(y,{width:"40%",height:"40px"})),s(O,null),s(O,null),s(O,null)),E=class{constructor(s){t(this,s),this.submitEvent=i(this,"submit-event"),this.clickEvent=i(this,"click-event"),this.errorEvent=i(this,"error-event"),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(){v(),this.analytics=new b(this),this.formController=new e(I),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=D({authToken:this.authToken,businessId:this.businessId,service:new S}),this.patchBusiness=x({authToken:this.authToken,businessId:this.businessId,service:new S}),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:d.MISSING_PROPS,severity:c.ERROR})}handleReponse(s){s.error&&(this.errorMessage=f.patchData),this.submitEvent.emit({response:s}),this.instantiateBusiness(s.data)}render(){return s(w,null,this.isLoading?s(A,null):s("form",{onSubmit:this.validateAndSubmit},s("div",{class:"row gap-3"},s(C,{text:this.title}),s("form-alert",{text:this.errorMessage,hideAlert:this.hideErrors}),s("div",{class:"col-12 mb-4"},s("justifi-business-core-info",{formController:this.formController,country:this.country})),s("div",{class:"col-12 mb-4"},s("justifi-legal-address-form",{formController:this.formController,country:this.country})),s("div",{class:"col-12 mb-4"},s("justifi-additional-questions",{formController:this.formController})),s("div",{class:"col-12 mb-4"},s("justifi-business-representative",{formController:this.formController,country:this.country})),s("div",{class:"col-12 d-flex flex-row-reverse"},s(g,{type:"submit",disabled:this.disabledState,variant:"primary",onClick:()=>this.clickEvent.emit({name:B.submit}),isLoading:this.isSaving},"Submit")))))}};export{E as justifi_business_form}
@@ -1 +1 @@
1
- import{r as s,c as t,h as r}from"./p-DwYM91AU.js";import{A as o}from"./p-yyedWKWX.js";import{C as i,a as e}from"./p-Cjcsf8ku.js";import"./p-BrRsgB8S.js";import"./p-CLHwhyvu.js";import"./p-B5rtFhtR.js";import"./p-BH0Xfn-F.js";import{g as a,a as p}from"./p-D2muobcE.js";import{E as n}from"./p-DUmUUj9r.js";import{c as h,J as c}from"./p-DISrhs4v.js";import"./p-tGDdRx0W.js";import"./p-BYsgavgS.js";import"./p-B09GVew-.js";import"./p-HXpYMWUU.js";import"./p-DkoufM1t.js";import"./p-sA8HBfkI.js";import"./p-CsRppqXL.js";const m=o();class u{async fetchGrossVolumeChartData(s,t){return m.get({endpoint:`account/${s}/reports/gross_volume`,authToken:t})}}const d=class{constructor(r){s(this,r),this.errorEvent=t(this,"error-event"),this.errorMessage=null,this.handleErrorEvent=s=>{this.errorMessage=s.detail.message,this.errorEvent.emit(s.detail)}}componentWillLoad(){h(),this.analytics=new c(this),this.initializeGetGrossPayment()}disconnectedCallback(){var s;null===(s=this.analytics)||void 0===s||s.cleanup()}propChanged(){this.initializeGetGrossPayment()}initializeGetGrossPayment(){this.accountId&&this.authToken?this.getGrossPayment=(({id:s,authToken:t,service:r})=>async({onSuccess:o,onError:e})=>{var n;try{const h=await r.fetchGrossVolumeChartData(s,t);h.error?e({error:p(h.error),code:a(null===(n=h.error)||void 0===n?void 0:n.code),severity:i.ERROR}):o(h.data)}catch(s){const t=a(null==s?void 0:s.code);e({error:p(s),code:t,severity:i.ERROR})}})({id:this.accountId,authToken:this.authToken,service:new u}):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:e.MISSING_PROPS,message:this.errorMessage,severity:i.ERROR}))}render(){return this.errorMessage?n(this.errorMessage):r("gross-payment-chart-core",{getGrossPayment:this.getGrossPayment,"onError-event":this.handleErrorEvent})}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"]}}};export{d as justifi_gross_payment_chart}
1
+ import{r as s,c as t,h as r}from"./p-DwYM91AU.js";import{A as o}from"./p-yyedWKWX.js";import{C as i,a as e}from"./p-Cjcsf8ku.js";import"./p-BrRsgB8S.js";import"./p-CLHwhyvu.js";import"./p-B5rtFhtR.js";import"./p-BH0Xfn-F.js";import{g as a,a as n}from"./p-D2muobcE.js";import{E as p}from"./p-DUmUUj9r.js";import{c as h,J as c}from"./p-BEu9YFnf.js";import"./p-tGDdRx0W.js";import"./p-BYsgavgS.js";import"./p-B09GVew-.js";import"./p-HXpYMWUU.js";import"./p-DkoufM1t.js";import"./p-sA8HBfkI.js";import"./p-Dr8Z8wfP.js";const m=o();class u{async fetchGrossVolumeChartData(s,t){return m.get({endpoint:`account/${s}/reports/gross_volume`,authToken:t})}}const d=class{constructor(r){s(this,r),this.errorEvent=t(this,"error-event"),this.errorMessage=null,this.handleErrorEvent=s=>{this.errorMessage=s.detail.message,this.errorEvent.emit(s.detail)}}componentWillLoad(){h(),this.analytics=new c(this),this.initializeGetGrossPayment()}disconnectedCallback(){var s;null===(s=this.analytics)||void 0===s||s.cleanup()}propChanged(){this.initializeGetGrossPayment()}initializeGetGrossPayment(){this.accountId&&this.authToken?this.getGrossPayment=(({id:s,authToken:t,service:r})=>async({onSuccess:o,onError:e})=>{var p;try{const h=await r.fetchGrossVolumeChartData(s,t);h.error?e({error:n(h.error),code:a(null===(p=h.error)||void 0===p?void 0:p.code),severity:i.ERROR}):o(h.data)}catch(s){const t=a(null==s?void 0:s.code);e({error:n(s),code:t,severity:i.ERROR})}})({id:this.accountId,authToken:this.authToken,service:new u}):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:e.MISSING_PROPS,message:this.errorMessage,severity:i.ERROR}))}render(){return this.errorMessage?p(this.errorMessage):r("gross-payment-chart-core",{getGrossPayment:this.getGrossPayment,"onError-event":this.handleErrorEvent})}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"]}}};export{d as justifi_gross_payment_chart}
@@ -0,0 +1 @@
1
+ import{r as t,c as s,h as r}from"./p-DwYM91AU.js";import{P as i}from"./p-DGGjRqDa.js";import"./p-tGDdRx0W.js";import"./p-HXpYMWUU.js";import{C as o,a as e}from"./p-Cjcsf8ku.js";import{P as p}from"./p-BrRsgB8S.js";import"./p-CLHwhyvu.js";import"./p-B5rtFhtR.js";import"./p-BH0Xfn-F.js";import{g as a,a as n}from"./p-D2muobcE.js";import{c as m,J as c}from"./p-BEu9YFnf.js";import{S as h}from"./p-BP2sTIQV.js";import"./p-CZfYo5-1.js";import{d as f}from"./p-RTAZ4tdd.js";import"./p-yyedWKWX.js";import"./p-B09GVew-.js";import"./p-BYsgavgS.js";import"./p-DkoufM1t.js";import"./p-Dr8Z8wfP.js";import"./p-W9WWoLzT.js";import"./p-U3nU15el.js";import"./p-sA8HBfkI.js";const d=class{constructor(r){t(this,r),this.errorEvent=s(this,"error-event"),this.errorMessage=null,this.columns=f,this.handleErrorEvent=t=>{this.errorMessage=t.detail.message,this.errorEvent.emit(t.detail)}}componentWillLoad(){m(),this.analytics=new c(this),this.initializeGetPayments()}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}propChanged(){this.initializeGetPayments()}initializeGetPayments(){this.accountId&&this.authToken?this.getPayments=(({id:t,authToken:s,service:r})=>async({params:i,onSuccess:e,onError:m,final:c})=>{var h,f;try{const c=await r.fetchPayments(t,s,i);if(c.error)return m({error:n(c.error),code:a(null===(f=c.error)||void 0===f?void 0:f.code),severity:o.ERROR});{const t=Object.assign({},c.page_info);e({payments:(null===(h=c.data)||void 0===h?void 0:h.map((t=>new p(t))))||[],pagingInfo:t})}}catch(t){const s=a(null==t?void 0:t.code);return m({error:t.message||t,code:s,severity:o.ERROR})}finally{return c()}})({id:this.accountId,authToken:this.authToken,service:new i}):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:e.MISSING_PROPS,message:this.errorMessage,severity:o.ERROR}))}render(){return r(h,{key:"171935cc29253ff76262498183fd0f3a0f4a7eef"},r("payments-list-core",{key:"71be865f5035b6db46f4b97a3a36f08391de4f58",getPayments:this.getPayments,"onError-event":this.handleErrorEvent,columns:this.columns}))}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"]}}};export{d as justifi_payments_list}
@@ -1 +1 @@
1
- import{r as e,c as t,h as s}from"./p-DwYM91AU.js";import{f as i}from"./p-B09GVew-.js";import{G as a,am as r}from"./p-sA8HBfkI.js";import{B as d}from"./p-Ty7R7tsw.js";import{S as o}from"./p-BP2sTIQV.js";import{S as c}from"./p-CsgUIrv8.js";import"./p-CZfYo5-1.js";import{C as n,a as h}from"./p-Cjcsf8ku.js";import{g as p,a as f}from"./p-D2muobcE.js";import{D as l}from"./p-Dit3fZpU.js";import{D as u}from"./p-Bg2SZArf.js";import{c as b,J as y}from"./p-DISrhs4v.js";import"./p-HXpYMWUU.js";import"./p-yyedWKWX.js";import"./p-tGDdRx0W.js";import"./p-BYsgavgS.js";import"./p-BrRsgB8S.js";import"./p-BH0Xfn-F.js";import"./p-DkoufM1t.js";import"./p-CLHwhyvu.js";import"./p-B5rtFhtR.js";import"./p-CsRppqXL.js";const v=({authToken:e,disputeId:t,service:s})=>async({payload:i,onSuccess:a,onError:r,final:d=()=>{}})=>{var o;try{const d=await s.submitDisputeResponse(t,e,i);if(d.error){return r({error:f(d.error),code:p(null===(o=d.error)||void 0===o?void 0:o.code),severity:n.ERROR})}a(d)}catch(e){const t=p(null==e?void 0:e.code);return r({error:e.message||e,code:t,severity:n.ERROR})}finally{return d()}},m=class{constructor(s){e(this,s),this.clickEvent=t(this,"click-event"),this.errorEvent=t(this,"error-event"),this.submitEvent=t(this,"submit-event")}acceptDispute(){v({disputeId:this.dispute.id,authToken:this.authToken,service:new l})({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:u.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,n,h,p,f,l,u,b;return s(o,{key:"366e2c66e1a31395f1b4a0c0e88173e06eb93313"},this.isLoading&&s("div",{key:"979832175e729da612028cff34fdf59dc280c677",style:{marginBottom:"8px"}},s(c,{key:"f7fc26c781f2a1f8aef343166eaaca261b72d32c",height:"28px",width:"70%",styles:{marginBottom:"16px"}}),s(c,{key:"56e792538dd93b77964f7d21300ef45f8da4f7c1",height:"18px",styles:{marginBottom:"8px"}}),s(c,{key:"94ca86077eef5aebd5b6e402ac2fdd9a980ad4c5",height:"18px",styles:{marginBottom:"8px"}})),(null===(e=this.dispute)||void 0===e?void 0:e.needsResponse)&&this.isDueDatePassed()&&s("div",{key:"7482cc041236218c16ebf12c0799b2dc62266065",part:a},s("h1",{key:"a592932abcab4a1f3563cb044fbd37611c8dd20f",class:"h4",part:r},"The due date (",null===(t=this.dispute)||void 0===t?void 0:t.due_date,") for this dispute has passed"),s("p",{key:"65f41565018e74b20a224789f28a4b0c8c39eb76"},"You can no longer submit evidence to counter this dispute.")),(null===(n=this.dispute)||void 0===n?void 0:n.needsResponse)&&!this.isDueDatePassed()&&s("div",{key:"a135934182715a851d5d25d5d1485094454d0a4e",part:a},s("h1",{key:"61d6842599de3d87c833aa58b237490e4a686e4a",class:"h4",part:r},"This payment is disputed"),s("p",{key:"72c6f7e3639cbd19d25f1aa120d22b3ca56547e1"},"The cardholder is disputing this payment. You may accept this dispute, or proceed to provide evidence in a counter dispute."),s("h2",{key:"1565a02a4ff6c3e777f08c3c55f5adb52ead464b",class:"h5"},"Dispute details"),s("div",{key:"73e88ae55460c62a22609de5bc7144485741efd8",class:"d-table gap-2"},s("div",{key:"9ad5b6375dc161072b9a4a6ed02c845380fad0f9",class:"d-table-row gap-2"},s("span",{key:"50fc59fd8a3159990d97f4817c4ae4f0ff237a6f",part:"detail-section-item-title",class:"fw-bold d-table-cell pe-4"},"Amount"),s("span",{key:"2295ed0988667f0d9b4a5c7d1574549909e83512",part:"detail-section-item-data",class:"flex-1 d-table-cell text-wrap"},i(null===(h=this.dispute)||void 0===h?void 0:h.amount))),s("div",{key:"3019fb0949177ac697347e1e5156d980073b5fe6",class:"d-table-row gap-2"},s("span",{key:"6bb9bd0549246e1545244a1c1d6ba6a2763115e8",part:"detail-section-item-title",class:"fw-bold d-table-cell pe-4"},"Reason"),s("span",{key:"e21ffcb4db63cc336f8417a5f23a95ec9a22e07d",part:"detail-section-item-data",class:"flex-1 d-table-cell text-wrap"},null===(p=this.dispute)||void 0===p?void 0:p.reason)),s("div",{key:"8ea8d1734de9014d6eaa40698b7370f2579b1686",class:"d-table-row gap-2"},s("span",{key:"6f1c114ad77e46c67c661e8a7e0da9404a699afb",part:"detail-section-item-title",class:"fw-bold d-table-cell pe-4"},"Due Date"),s("span",{key:"f702aff5516a6fe4de66982214019aa23757e5dd",part:"detail-section-item-data",class:"flex-1 d-table-cell text-wrap"},null===(f=this.dispute)||void 0===f?void 0:f.due_date))),s("div",{key:"9b37b4ca1651c6f5654c284e154a8610491082eb",class:"d-flex gap-2 mt-4 justify-content-end"},s(d,{key:"7764276dee017b3802c8e5a099c7a14809a5a9e2",variant:"secondary",onClick:()=>this.acceptDispute()},"Accept dispute"),s(d,{key:"7d359a4379403683a1ace0a47eded0e6859e198a",variant:"primary",onClick:()=>this.initiateRespondToDispute()},"Counter dispute"))),(null===(l=this.dispute)||void 0===l?void 0:l.underReview)&&s("div",{key:"95357ab08560983952ef5dbbaecbd61a686d627e"},s("h1",{key:"dee2b2342d93f970ea42313a67bf7134c980c2c9",class:"h4"},"This payment is disputed and under review"),s("p",{key:"19c9ad659f69e844c06ca5a235f21265635e9d5b"},"The cardholder is disputing this payment. A counter dispute has been submitted and is under review.")),(null===(u=this.dispute)||void 0===u?void 0:u.won)&&s("div",{key:"7149f82646d7e06bb5355cdb5fab79e1a1c6d67e"},s("h1",{key:"eb074d8a3bff90cbca27a836dc959ae115103896",class:"h4"},"This payment was disputed"),s("p",{key:"a7c8ca180bfa9c6421f05f9014d1e10f35b2fdf8"},"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:"66a1b25a142f78e1d5b0e234232c32f7addbd203"},s("h1",{key:"7688608c03db8d4d2e1443b39e21ca39e48fdef2",class:"h4"},"This payment was disputed"),s("p",{key:"0ba1cc45f3b5cbf9c96456a05ba1e781efeb8e2e"},"The cardholder disputed this payment and the card issuer has settled it in their favor.")))}},k=class{constructor(s){e(this,s),this.errorEvent=t(this,"error-event"),this.errorMessage=null,this.apiOrigin="https://wc-proxy.justifi.ai",this.handleErrorEvent=e=>{this.errorMessage=e.detail.message,this.errorEvent.emit(e.detail)}}componentWillLoad(){b(),this.analytics=new y(this),this.initializeDisputeServiceMethods()}disconnectedCallback(){var e;null===(e=this.analytics)||void 0===e||e.cleanup()}propChanged(){this.initializeDisputeServiceMethods()}initializeDisputeServiceMethods(){this.disputeId&&this.authToken?(this.updateDisputeResponse=(({authToken:e,disputeId:t,service:s})=>async({payload:i,onSuccess:a,onError:r,final:d=()=>{}})=>{var o;try{const d=await s.updateDisputeResponse(t,e,i);if(d.error)return r({error:f(d.error),code:p(null===(o=d.error)||void 0===o?void 0:o.code),severity:n.ERROR});a(d)}catch(e){const t=p(null==e?void 0:e.code);return r({error:e.message||e,code:t,severity:n.ERROR})}finally{return d()}})({disputeId:this.disputeId,authToken:this.authToken,service:new l}),this.createDisputeEvidence=(({authToken:e,disputeId:t,service:s})=>async({payload:i,onSuccess:a,onError:r,final:d=()=>{}})=>{var o;try{const d=await s.createDisputeEvidence(t,e,i);if(d.error)return r({error:f(d.error),code:p(null===(o=d.error)||void 0===o?void 0:o.code),severity:n.ERROR});a(d)}catch(e){const t=p(null==e?void 0:e.code);return r({error:e.message||e,code:t,severity:n.ERROR})}finally{return d()}})({disputeId:this.disputeId,authToken:this.authToken,service:new l}),this.submitDisputeResponse=v({disputeId:this.disputeId,authToken:this.authToken,service:new l})):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:h.MISSING_PROPS,message:this.errorMessage,severity:n.ERROR}))}render(){return s(o,{key:"c9a7035e6f28c32602fcb19b4026805d87aa54de"},s("justifi-dispute-response-core",{key:"9acfee140646d1ed8b46771b353b9d0d71af2c14","onError-event":this.handleErrorEvent,"dispute-id":this.disputeId,disputeResponse:this.disputeResponse,createDisputeEvidence:this.createDisputeEvidence,updateDisputeResponse:this.updateDisputeResponse,submitDisputeResponse:this.submitDisputeResponse}))}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"]}}},w=class{constructor(i){e(this,i),this.clickEvent=t(this,"click-event"),this.errorEvent=t(this,"error-event"),this.stepCompleteEvent=t(this,"complete-form-step-event"),this.submitEvent=t(this,"submit-event"),this.disputeResponse={},this.isLoading=!1,this.documentList=[],this.documentErrors={},this.currentStep=0,this.componentStepMapping=[()=>s("justifi-product-or-service",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("justifi-customer-details",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("justifi-cancellation-policy",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("justifi-refund-policy",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("justifi-duplicate-charge",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("justifi-electronic-evidence",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("justifi-shipping-details",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("justifi-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:u.cancelDispute})},this.onBack=async()=>{await this.currentStepComponentRef.validateAndSubmit((async(e,t,s)=>{this.clickEvent.emit({name:u.previousStep}),await this.handleSubmit(e,t,s),this.currentStep--}))},this.onNext=async()=>{await this.currentStepComponentRef.validateAndSubmit((async(e,t,s)=>{this.clickEvent.emit({name:u.nextStep}),await this.handleSubmit(e,t,s),this.currentStep++}))},this.onSubmit=async()=>{await this.currentStepComponentRef.validateAndSubmit((async(e,t,s)=>{this.clickEvent.emit({name:u.submit});const i=Object.assign(Object.assign({},e),{forfeit:!1});await this.handleSubmit(i,t,s)}))}}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:"123cd5e2c03ac23f591c7c0b70c768acdd9e4932",class:"row gy-3"},s("div",{key:"22d3cf94fddc2bdc52a122d49c35efb6b94d3670",class:"col-12"},s("h1",{key:"16e6361626153b51b2d958203419752b65c211e3",class:"h4",part:r},"Counter dispute")),s("div",{key:"fef2a0e7d8baa24652d487dc11406fc1678d0beb",class:"col-12"},this.currentStepComponent),s("div",{key:"5c5fbe7839898450d12a08dc857bfda3471f8478",class:"col-12"},s("div",{key:"ee1eec3a34d161706418a2be5cbbf149b3a2cadc",class:"d-flex gap-2 mt-4 justify-content-end"},this.isFirstStep?s(d,{variant:"secondary",onClick:()=>this.onCancel(),disabled:this.isLoading,isLoading:this.isLoading},"Cancel"):s(d,{variant:"secondary",onClick:()=>this.onBack(),disabled:this.isLoading,isLoading:this.isLoading},"Back"),this.isLastStep?s(d,{variant:"primary",onClick:()=>this.onSubmit(),disabled:this.isLoading,isLoading:this.isLoading},"Submit Counter Dispute"):s(d,{variant:"primary",onClick:()=>this.onNext(),disabled:this.isLoading,isLoading:this.isLoading},"Next"))))}};export{m as justifi_dispute_notification,k as justifi_dispute_response,w as justifi_dispute_response_core}
1
+ import{r as e,c as t,h as s}from"./p-DwYM91AU.js";import{f as i}from"./p-B09GVew-.js";import{G as a,am as r}from"./p-sA8HBfkI.js";import{B as d}from"./p-Ty7R7tsw.js";import{S as o}from"./p-BP2sTIQV.js";import{S as c}from"./p-CsgUIrv8.js";import"./p-CZfYo5-1.js";import{C as n,a as h}from"./p-Cjcsf8ku.js";import{g as p,a as f}from"./p-D2muobcE.js";import{D as u}from"./p-Dit3fZpU.js";import{D as l}from"./p-Bg2SZArf.js";import{c as b,J as y}from"./p-BEu9YFnf.js";import"./p-HXpYMWUU.js";import"./p-yyedWKWX.js";import"./p-tGDdRx0W.js";import"./p-BYsgavgS.js";import"./p-BrRsgB8S.js";import"./p-BH0Xfn-F.js";import"./p-DkoufM1t.js";import"./p-CLHwhyvu.js";import"./p-B5rtFhtR.js";import"./p-Dr8Z8wfP.js";const v=({authToken:e,disputeId:t,service:s})=>async({payload:i,onSuccess:a,onError:r,final:d=()=>{}})=>{var o;try{const d=await s.submitDisputeResponse(t,e,i);if(d.error){return r({error:f(d.error),code:p(null===(o=d.error)||void 0===o?void 0:o.code),severity:n.ERROR})}a(d)}catch(e){const t=p(null==e?void 0:e.code);return r({error:e.message||e,code:t,severity:n.ERROR})}finally{return d()}},m=class{constructor(s){e(this,s),this.clickEvent=t(this,"click-event"),this.errorEvent=t(this,"error-event"),this.submitEvent=t(this,"submit-event")}acceptDispute(){v({disputeId:this.dispute.id,authToken:this.authToken,service:new u})({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,n,h,p,f,u,l,b;return s(o,{key:"366e2c66e1a31395f1b4a0c0e88173e06eb93313"},this.isLoading&&s("div",{key:"979832175e729da612028cff34fdf59dc280c677",style:{marginBottom:"8px"}},s(c,{key:"f7fc26c781f2a1f8aef343166eaaca261b72d32c",height:"28px",width:"70%",styles:{marginBottom:"16px"}}),s(c,{key:"56e792538dd93b77964f7d21300ef45f8da4f7c1",height:"18px",styles:{marginBottom:"8px"}}),s(c,{key:"94ca86077eef5aebd5b6e402ac2fdd9a980ad4c5",height:"18px",styles:{marginBottom:"8px"}})),(null===(e=this.dispute)||void 0===e?void 0:e.needsResponse)&&this.isDueDatePassed()&&s("div",{key:"7482cc041236218c16ebf12c0799b2dc62266065",part:a},s("h1",{key:"a592932abcab4a1f3563cb044fbd37611c8dd20f",class:"h4",part:r},"The due date (",null===(t=this.dispute)||void 0===t?void 0:t.due_date,") for this dispute has passed"),s("p",{key:"65f41565018e74b20a224789f28a4b0c8c39eb76"},"You can no longer submit evidence to counter this dispute.")),(null===(n=this.dispute)||void 0===n?void 0:n.needsResponse)&&!this.isDueDatePassed()&&s("div",{key:"a135934182715a851d5d25d5d1485094454d0a4e",part:a},s("h1",{key:"61d6842599de3d87c833aa58b237490e4a686e4a",class:"h4",part:r},"This payment is disputed"),s("p",{key:"72c6f7e3639cbd19d25f1aa120d22b3ca56547e1"},"The cardholder is disputing this payment. You may accept this dispute, or proceed to provide evidence in a counter dispute."),s("h2",{key:"1565a02a4ff6c3e777f08c3c55f5adb52ead464b",class:"h5"},"Dispute details"),s("div",{key:"73e88ae55460c62a22609de5bc7144485741efd8",class:"d-table gap-2"},s("div",{key:"9ad5b6375dc161072b9a4a6ed02c845380fad0f9",class:"d-table-row gap-2"},s("span",{key:"50fc59fd8a3159990d97f4817c4ae4f0ff237a6f",part:"detail-section-item-title",class:"fw-bold d-table-cell pe-4"},"Amount"),s("span",{key:"2295ed0988667f0d9b4a5c7d1574549909e83512",part:"detail-section-item-data",class:"flex-1 d-table-cell text-wrap"},i(null===(h=this.dispute)||void 0===h?void 0:h.amount))),s("div",{key:"3019fb0949177ac697347e1e5156d980073b5fe6",class:"d-table-row gap-2"},s("span",{key:"6bb9bd0549246e1545244a1c1d6ba6a2763115e8",part:"detail-section-item-title",class:"fw-bold d-table-cell pe-4"},"Reason"),s("span",{key:"e21ffcb4db63cc336f8417a5f23a95ec9a22e07d",part:"detail-section-item-data",class:"flex-1 d-table-cell text-wrap"},null===(p=this.dispute)||void 0===p?void 0:p.reason)),s("div",{key:"8ea8d1734de9014d6eaa40698b7370f2579b1686",class:"d-table-row gap-2"},s("span",{key:"6f1c114ad77e46c67c661e8a7e0da9404a699afb",part:"detail-section-item-title",class:"fw-bold d-table-cell pe-4"},"Due Date"),s("span",{key:"f702aff5516a6fe4de66982214019aa23757e5dd",part:"detail-section-item-data",class:"flex-1 d-table-cell text-wrap"},null===(f=this.dispute)||void 0===f?void 0:f.due_date))),s("div",{key:"9b37b4ca1651c6f5654c284e154a8610491082eb",class:"d-flex gap-2 mt-4 justify-content-end"},s(d,{key:"7764276dee017b3802c8e5a099c7a14809a5a9e2",variant:"secondary",onClick:()=>this.acceptDispute()},"Accept dispute"),s(d,{key:"7d359a4379403683a1ace0a47eded0e6859e198a",variant:"primary",onClick:()=>this.initiateRespondToDispute()},"Counter dispute"))),(null===(u=this.dispute)||void 0===u?void 0:u.underReview)&&s("div",{key:"95357ab08560983952ef5dbbaecbd61a686d627e"},s("h1",{key:"dee2b2342d93f970ea42313a67bf7134c980c2c9",class:"h4"},"This payment is disputed and under review"),s("p",{key:"19c9ad659f69e844c06ca5a235f21265635e9d5b"},"The cardholder is disputing this payment. A counter dispute has been submitted and is under review.")),(null===(l=this.dispute)||void 0===l?void 0:l.won)&&s("div",{key:"7149f82646d7e06bb5355cdb5fab79e1a1c6d67e"},s("h1",{key:"eb074d8a3bff90cbca27a836dc959ae115103896",class:"h4"},"This payment was disputed"),s("p",{key:"a7c8ca180bfa9c6421f05f9014d1e10f35b2fdf8"},"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:"66a1b25a142f78e1d5b0e234232c32f7addbd203"},s("h1",{key:"7688608c03db8d4d2e1443b39e21ca39e48fdef2",class:"h4"},"This payment was disputed"),s("p",{key:"0ba1cc45f3b5cbf9c96456a05ba1e781efeb8e2e"},"The cardholder disputed this payment and the card issuer has settled it in their favor.")))}},k=class{constructor(s){e(this,s),this.errorEvent=t(this,"error-event"),this.errorMessage=null,this.apiOrigin="https://wc-proxy.justifi.ai",this.handleErrorEvent=e=>{this.errorMessage=e.detail.message,this.errorEvent.emit(e.detail)}}componentWillLoad(){b(),this.analytics=new y(this),this.initializeDisputeServiceMethods()}disconnectedCallback(){var e;null===(e=this.analytics)||void 0===e||e.cleanup()}propChanged(){this.initializeDisputeServiceMethods()}initializeDisputeServiceMethods(){this.disputeId&&this.authToken?(this.updateDisputeResponse=(({authToken:e,disputeId:t,service:s})=>async({payload:i,onSuccess:a,onError:r,final:d=()=>{}})=>{var o;try{const d=await s.updateDisputeResponse(t,e,i);if(d.error)return r({error:f(d.error),code:p(null===(o=d.error)||void 0===o?void 0:o.code),severity:n.ERROR});a(d)}catch(e){const t=p(null==e?void 0:e.code);return r({error:e.message||e,code:t,severity:n.ERROR})}finally{return d()}})({disputeId:this.disputeId,authToken:this.authToken,service:new u}),this.createDisputeEvidence=(({authToken:e,disputeId:t,service:s})=>async({payload:i,onSuccess:a,onError:r,final:d=()=>{}})=>{var o;try{const d=await s.createDisputeEvidence(t,e,i);if(d.error)return r({error:f(d.error),code:p(null===(o=d.error)||void 0===o?void 0:o.code),severity:n.ERROR});a(d)}catch(e){const t=p(null==e?void 0:e.code);return r({error:e.message||e,code:t,severity:n.ERROR})}finally{return d()}})({disputeId:this.disputeId,authToken:this.authToken,service:new u}),this.submitDisputeResponse=v({disputeId:this.disputeId,authToken:this.authToken,service:new u})):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:h.MISSING_PROPS,message:this.errorMessage,severity:n.ERROR}))}render(){return s(o,{key:"c9a7035e6f28c32602fcb19b4026805d87aa54de"},s("justifi-dispute-response-core",{key:"9acfee140646d1ed8b46771b353b9d0d71af2c14","onError-event":this.handleErrorEvent,"dispute-id":this.disputeId,disputeResponse:this.disputeResponse,createDisputeEvidence:this.createDisputeEvidence,updateDisputeResponse:this.updateDisputeResponse,submitDisputeResponse:this.submitDisputeResponse}))}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"]}}},w=class{constructor(i){e(this,i),this.clickEvent=t(this,"click-event"),this.errorEvent=t(this,"error-event"),this.stepCompleteEvent=t(this,"complete-form-step-event"),this.submitEvent=t(this,"submit-event"),this.disputeResponse={},this.isLoading=!1,this.documentList=[],this.documentErrors={},this.currentStep=0,this.componentStepMapping=[()=>s("justifi-product-or-service",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("justifi-customer-details",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("justifi-cancellation-policy",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("justifi-refund-policy",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("justifi-duplicate-charge",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("justifi-electronic-evidence",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("justifi-shipping-details",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("justifi-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)}))}}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:"123cd5e2c03ac23f591c7c0b70c768acdd9e4932",class:"row gy-3"},s("div",{key:"22d3cf94fddc2bdc52a122d49c35efb6b94d3670",class:"col-12"},s("h1",{key:"16e6361626153b51b2d958203419752b65c211e3",class:"h4",part:r},"Counter dispute")),s("div",{key:"fef2a0e7d8baa24652d487dc11406fc1678d0beb",class:"col-12"},this.currentStepComponent),s("div",{key:"5c5fbe7839898450d12a08dc857bfda3471f8478",class:"col-12"},s("div",{key:"ee1eec3a34d161706418a2be5cbbf149b3a2cadc",class:"d-flex gap-2 mt-4 justify-content-end"},this.isFirstStep?s(d,{variant:"secondary",onClick:()=>this.onCancel(),disabled:this.isLoading,isLoading:this.isLoading},"Cancel"):s(d,{variant:"secondary",onClick:()=>this.onBack(),disabled:this.isLoading,isLoading:this.isLoading},"Back"),this.isLastStep?s(d,{variant:"primary",onClick:()=>this.onSubmit(),disabled:this.isLoading,isLoading:this.isLoading},"Submit Counter Dispute"):s(d,{variant:"primary",onClick:()=>this.onNext(),disabled:this.isLoading,isLoading:this.isLoading},"Next"))))}};export{m as justifi_dispute_notification,k as justifi_dispute_response,w as justifi_dispute_response_core}
@@ -0,0 +1 @@
1
+ import{r as t,c as s,h as i}from"./p-DwYM91AU.js";import"./p-tGDdRx0W.js";import"./p-HXpYMWUU.js";import{C as o,a as r}from"./p-Cjcsf8ku.js";import{C as e}from"./p-BrRsgB8S.js";import"./p-CLHwhyvu.js";import"./p-B5rtFhtR.js";import"./p-BH0Xfn-F.js";import{g as a,a as c}from"./p-D2muobcE.js";import{c as p,J as n}from"./p-BEu9YFnf.js";import{C as h}from"./p-VRubcA-q.js";import{m as u,S as m}from"./p-C9VmfRis.js";import{S as d}from"./p-BP2sTIQV.js";import"./p-CZfYo5-1.js";import{d as f}from"./p-CBbwdoSa.js";import"./p-BYsgavgS.js";import"./p-B09GVew-.js";import"./p-DkoufM1t.js";import"./p-Dr8Z8wfP.js";import"./p-yyedWKWX.js";import"./p-U3nU15el.js";import"./p-sA8HBfkI.js";const j=class{constructor(i){t(this,i),this.errorEvent=s(this,"error-event"),this.errorMessage=null,this.columns=f,this.handleErrorEvent=t=>{this.errorMessage=t.detail.message,this.errorEvent.emit(t.detail)}}componentWillLoad(){p(),this.analytics=new n(this),this.initializeGetData()}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}propChanged(){this.initializeGetData()}initializeGetData(){this.initializeGetCheckouts(),this.initializeGetSubAccounts()}initializeGetCheckouts(){this.accountId&&this.authToken?this.getCheckouts=(({accountId:t,authToken:s,service:i})=>async({params:r,onSuccess:p,onError:n})=>{var h,u;try{const m=await i.fetchCheckouts(t,s,r);if(m.error)return n({error:c(m.error),code:a(null===(u=m.error)||void 0===u?void 0:u.code),severity:o.ERROR});{const t=Object.assign({},m.page_info);p({checkouts:(null===(h=m.data)||void 0===h?void 0:h.map((t=>new e(t))))||[],pagingInfo:t})}}catch(t){const s=a(null==t?void 0:t.code);return n({error:t.message||t,code:s,severity:o.ERROR})}})({accountId:this.accountId,authToken:this.authToken,service:new h}):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:r.MISSING_PROPS,message:this.errorMessage,severity:o.ERROR}))}initializeGetSubAccounts(){this.accountId&&this.authToken&&(this.getSubAccounts=u({accountId:this.accountId,authToken:this.authToken,service:new m}))}render(){return i(d,{key:"0e9e50e18983dad43cfab19f2271678d3f5e6abd"},i("checkouts-list-core",{key:"6f128cc756477ff64638625d9a9ff9a5b4533948",getCheckouts:this.getCheckouts,getSubAccounts:this.getSubAccounts,"onError-event":this.handleErrorEvent,columns:this.columns}))}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"]}}};export{j as justifi_checkouts_list}
@@ -1 +1 @@
1
- import{r as s,c as i,h as t}from"./p-DwYM91AU.js";import{c as o,J as r}from"./p-DISrhs4v.js";import{C as e,a as p}from"./p-Cjcsf8ku.js";import{m as n,a}from"./p-5aA7gjr5.js";import{B as h}from"./p-Dlrq1iZf.js";import{A as m}from"./p-yyedWKWX.js";import"./p-BrRsgB8S.js";import"./p-CLHwhyvu.js";import"./p-B5rtFhtR.js";import"./p-BH0Xfn-F.js";import"./p-CsRppqXL.js";import"./p-D2muobcE.js";import"./p-tGDdRx0W.js";import"./p-BYsgavgS.js";import"./p-B09GVew-.js";import"./p-HXpYMWUU.js";import"./p-DkoufM1t.js";const d=m();class u{async postProvisioning(s,i,t){return d.post({endpoint:"entities/provisioning",body:{business_id:i,product_category:t},authToken:s})}}const c=class{constructor(t){s(this,t),this.errorEvent=i(this,"error-event"),this.allowOptionalFields=!1,this.formTitle="Business Information"}propChanged(){this.initializeApi()}componentWillLoad(){o(),this.analytics=new r(this),this.initializeApi()}disconnectedCallback(){var s;null===(s=this.analytics)||void 0===s||s.cleanup()}initializeApi(){this.authToken&&this.businessId?(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 u})):this.errorEvent.emit({message:"auth-token and business-id are required",errorCode:p.MISSING_PROPS,severity:e.ERROR})}render(){return t("justifi-payment-provisioning-core",{key:"80baf93d680fd610755fdfb6be030178140568da",businessId:this.businessId,authToken:this.authToken,allowOptionalFields:this.allowOptionalFields,formTitle:this.formTitle,getBusiness:this.getBusiness,postProvisioning:this.postProvisioning})}static get watchers(){return{authToken:["propChanged"],businessId:["propChanged"]}}};export{c as justifi_payment_provisioning}
1
+ import{r as s,c as i,h as t}from"./p-DwYM91AU.js";import{c as o,J as r}from"./p-BEu9YFnf.js";import{C as e,a as n}from"./p-Cjcsf8ku.js";import{m as p,a}from"./p-5aA7gjr5.js";import{B as h}from"./p-Dlrq1iZf.js";import{A as m}from"./p-yyedWKWX.js";import"./p-BrRsgB8S.js";import"./p-CLHwhyvu.js";import"./p-B5rtFhtR.js";import"./p-BH0Xfn-F.js";import"./p-Dr8Z8wfP.js";import"./p-D2muobcE.js";import"./p-tGDdRx0W.js";import"./p-BYsgavgS.js";import"./p-B09GVew-.js";import"./p-HXpYMWUU.js";import"./p-DkoufM1t.js";const u=m();class d{async postProvisioning(s,i,t){return u.post({endpoint:"entities/provisioning",body:{business_id:i,product_category:t},authToken:s})}}const c=class{constructor(t){s(this,t),this.errorEvent=i(this,"error-event"),this.allowOptionalFields=!1,this.formTitle="Business Information"}propChanged(){this.initializeApi()}componentWillLoad(){o(),this.analytics=new r(this),this.initializeApi()}disconnectedCallback(){var s;null===(s=this.analytics)||void 0===s||s.cleanup()}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=p({authToken:this.authToken,businessId:this.businessId,service:new h}),this.postProvisioning=a({authToken:this.authToken,businessId:this.businessId,product:"payment",service:new d})):this.errorEvent.emit({message:"auth-token and business-id are required",errorCode:n.MISSING_PROPS,severity:e.ERROR})}render(){return t("justifi-payment-provisioning-core",{key:"80baf93d680fd610755fdfb6be030178140568da",businessId:this.businessId,authToken:this.authToken,allowOptionalFields:this.allowOptionalFields,formTitle:this.formTitle,getBusiness:this.getBusiness,postProvisioning:this.postProvisioning})}static get watchers(){return{authToken:["propChanged"],businessId:["propChanged"]}}};export{c as justifi_payment_provisioning}
@@ -1 +1 @@
1
- import{r as s,c as i,h as t}from"./p-DwYM91AU.js";import{E as r}from"./p-DUmUUj9r.js";import{B as o}from"./p-Dlrq1iZf.js";import{m as p}from"./p-sCHf--Vc.js";import{C as e,a as m}from"./p-Cjcsf8ku.js";import{c as h,J as n}from"./p-DISrhs4v.js";import"./p-sA8HBfkI.js";import"./p-yyedWKWX.js";import"./p-tGDdRx0W.js";import"./p-BYsgavgS.js";import"./p-B09GVew-.js";import"./p-HXpYMWUU.js";import"./p-BrRsgB8S.js";import"./p-BH0Xfn-F.js";import"./p-DkoufM1t.js";import"./p-CLHwhyvu.js";import"./p-B5rtFhtR.js";import"./p-D2muobcE.js";import"./p-CsRppqXL.js";const a=class{constructor(t){s(this,t),this.errorEvent=i(this,"error-event"),this.errorMessage=null,this.handleErrorEvent=s=>{this.errorMessage=s.detail.message,this.errorEvent.emit(s.detail)}}componentWillLoad(){h(),this.analytics=new n(this),this.initializeGetBusiness()}disconnectedCallback(){var s;null===(s=this.analytics)||void 0===s||s.cleanup()}initializeGetBusiness(){if(!this.businessId||!this.authToken)return this.errorMessage="Invalid business id or auth token",void this.errorEvent.emit({errorCode:m.MISSING_PROPS,message:this.errorMessage,severity:e.ERROR});this.getBusiness=p({id:this.businessId,authToken:this.authToken,service:new o})}render(){return this.errorMessage?r(this.errorMessage):t("business-details-core",{getBusiness:this.getBusiness,"onError-event":this.handleErrorEvent})}};export{a as justifi_business_details}
1
+ import{r as s,c as i,h as t}from"./p-DwYM91AU.js";import{E as r}from"./p-DUmUUj9r.js";import{B as o}from"./p-Dlrq1iZf.js";import{m as p}from"./p-sCHf--Vc.js";import{C as e,a as m}from"./p-Cjcsf8ku.js";import{c as h,J as n}from"./p-BEu9YFnf.js";import"./p-sA8HBfkI.js";import"./p-yyedWKWX.js";import"./p-tGDdRx0W.js";import"./p-BYsgavgS.js";import"./p-B09GVew-.js";import"./p-HXpYMWUU.js";import"./p-BrRsgB8S.js";import"./p-BH0Xfn-F.js";import"./p-DkoufM1t.js";import"./p-CLHwhyvu.js";import"./p-B5rtFhtR.js";import"./p-D2muobcE.js";import"./p-Dr8Z8wfP.js";const a=class{constructor(t){s(this,t),this.errorEvent=i(this,"error-event"),this.errorMessage=null,this.handleErrorEvent=s=>{this.errorMessage=s.detail.message,this.errorEvent.emit(s.detail)}}componentWillLoad(){h(),this.analytics=new n(this),this.initializeGetBusiness()}disconnectedCallback(){var s;null===(s=this.analytics)||void 0===s||s.cleanup()}initializeGetBusiness(){if(!this.businessId||!this.authToken)return this.errorMessage="Invalid business id or auth token",void this.errorEvent.emit({errorCode:m.MISSING_PROPS,message:this.errorMessage,severity:e.ERROR});this.getBusiness=p({id:this.businessId,authToken:this.authToken,service:new o})}render(){return this.errorMessage?r(this.errorMessage):t("business-details-core",{getBusiness:this.getBusiness,"onError-event":this.handleErrorEvent})}};export{a as justifi_business_details}
@@ -0,0 +1 @@
1
+ import{r,c as s,h as t}from"./p-DwYM91AU.js";import{S as i}from"./p-BP2sTIQV.js";import"./p-CZfYo5-1.js";import{c as e,J as o}from"./p-BEu9YFnf.js";import{d as a}from"./p-B4xdk4mG.js";import"./p-tGDdRx0W.js";import"./p-HXpYMWUU.js";import{C as n,a as p}from"./p-Cjcsf8ku.js";import{j as c}from"./p-BrRsgB8S.js";import"./p-CLHwhyvu.js";import"./p-B5rtFhtR.js";import"./p-BH0Xfn-F.js";import{g as m,a as d}from"./p-D2muobcE.js";import{A as h}from"./p-yyedWKWX.js";import"./p-Dr8Z8wfP.js";import"./p-sA8HBfkI.js";import"./p-B09GVew-.js";import"./p-U3nU15el.js";import"./p-BYsgavgS.js";import"./p-DkoufM1t.js";const l=h();class f{async fetchTerminalOrders(r,s,t){return l.get({endpoint:"terminals/orders",params:t,headers:{account:r},authToken:s})}}const u=class{constructor(t){r(this,t),this.errorEvent=s(this,"error-event"),this.errorMessage=null,this.columns=a,this.handleErrorEvent=r=>{this.errorMessage=r.detail.message,this.errorEvent.emit(r.detail)}}componentWillLoad(){e(),this.analytics=new o(this),this.initializeGetData()}disconnectedCallback(){var r;null===(r=this.analytics)||void 0===r||r.cleanup()}initializeGetData(){this.accountId&&this.authToken?this.getTerminalOrders=(({id:r,authToken:s,service:t})=>async({params:i,onSuccess:e,onError:o,final:a})=>{var p,h;try{const a=await t.fetchTerminalOrders(r,s,i);if(a.error)return o({error:d(a.error),code:m(null===(h=a.error)||void 0===h?void 0:h.code),severity:n.ERROR});{const r=Object.assign({},a.page_info);e({terminalOrders:(null===(p=a.data)||void 0===p?void 0:p.map((r=>new c(r))))||[],pagingInfo:r})}}catch(r){const s=m(null==r?void 0:r.code);return o({error:r.message||r,code:s,severity:n.ERROR})}finally{return a()}})({id:this.accountId,authToken:this.authToken,service:new f}):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:p.MISSING_PROPS,message:this.errorMessage,severity:n.ERROR}))}render(){return t(i,{key:"ff51026cc99afbe51442832292c46053ad0c538a"},t("terminal-orders-list-core",{key:"c99fe72d7ab55b4560b4af08b1152cec7a8d663b",getTerminalOrders:this.getTerminalOrders,"onError-event":this.handleErrorEvent,columns:this.columns}))}};export{u as justifi_terminal_orders_list}