@justifi/webcomponents 5.3.0 → 5.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (147) hide show
  1. package/dist/cjs/{Api-b0e4be29.js → Api-089e7501.js} +1 -0
  2. package/dist/cjs/bank-account-form_9.cjs.entry.js +10 -6
  3. package/dist/cjs/billing-form_3.cjs.entry.js +2 -2
  4. package/dist/cjs/{business-additional-questions-schema-2f66f025.js → business-additional-questions-schema-2cc0c6f7.js} +1 -1
  5. package/dist/cjs/{business-identity-schema-be495474.js → business-identity-schema-7d462eb3.js} +1 -1
  6. package/dist/cjs/{business.service-d575b515.js → business.service-33d7c7f2.js} +1 -1
  7. package/dist/cjs/{check-pkg-version-1658df6f.js → check-pkg-version-fe4c6467.js} +2 -2
  8. package/dist/cjs/{checkout.service-057b5a7a.js → checkout.service-d9047ddb.js} +1 -1
  9. package/dist/cjs/{dispute.service-df9e1830.js → dispute.service-739631c7.js} +1 -1
  10. package/dist/cjs/{get-payout-csv-527a238c.js → get-payout-csv-bdaff21b.js} +1 -1
  11. package/dist/cjs/{get-subaccounts-6068c1aa.js → get-subaccounts-2db9fc01.js} +1 -1
  12. package/dist/cjs/justifi-additional-questions-form-step-core_6.cjs.entry.js +3 -3
  13. package/dist/cjs/justifi-additional-questions-form-step_9.cjs.entry.js +2 -2
  14. package/dist/cjs/justifi-business-details.cjs.entry.js +4 -4
  15. package/dist/cjs/justifi-business-form.cjs.entry.js +6 -6
  16. package/dist/cjs/justifi-checkout-core.cjs.entry.js +3 -2
  17. package/dist/cjs/justifi-checkout.cjs.entry.js +7 -6
  18. package/dist/cjs/justifi-checkouts-list.cjs.entry.js +5 -5
  19. package/dist/cjs/justifi-dispute-management.cjs.entry.js +4 -4
  20. package/dist/cjs/justifi-dispute-notification_3.cjs.entry.js +4 -4
  21. package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +3 -3
  22. package/dist/cjs/justifi-owner-form_3.cjs.entry.js +4 -4
  23. package/dist/cjs/justifi-payment-details.cjs.entry.js +4 -4
  24. package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +4 -4
  25. package/dist/cjs/justifi-payments-list.cjs.entry.js +4 -4
  26. package/dist/cjs/justifi-payout-details.cjs.entry.js +4 -4
  27. package/dist/cjs/justifi-payouts-list.cjs.entry.js +5 -5
  28. package/dist/cjs/justifi-refund-form.cjs.entry.js +1 -1
  29. package/dist/cjs/justifi-season-interruption-insurance.cjs.entry.js +3 -3
  30. package/dist/cjs/justifi-terminals-list.cjs.entry.js +4 -4
  31. package/dist/cjs/justifi-tokenize-payment-method.cjs.entry.js +19 -10
  32. package/dist/cjs/loader.cjs.js +1 -1
  33. package/dist/cjs/{package-06419e54.js → package-8b04bef0.js} +1 -1
  34. package/dist/cjs/{payment.service-3eebfe3e.js → payment.service-87924c1a.js} +1 -1
  35. package/dist/cjs/{schema-validations-cc4e6071.js → schema-validations-f948158d.js} +1 -1
  36. package/dist/cjs/webcomponents.cjs.js +1 -1
  37. package/dist/collection/components/business-forms/schemas/schema-validations.js +1 -1
  38. package/dist/collection/components/checkout/bank-account-form/bank-account-form.js +25 -1
  39. package/dist/collection/components/checkout/card-form/card-form.js +25 -1
  40. package/dist/collection/components/checkout/checkout-core.js +20 -2
  41. package/dist/collection/components/checkout/checkout.js +22 -2
  42. package/dist/collection/components/checkout/new-payment-method.js +20 -2
  43. package/dist/collection/components/checkout/payment-method-options.js +20 -2
  44. package/dist/collection/components/tokenize-payment-method/tokenize-payment-method.js +44 -18
  45. package/dist/config.js +1 -0
  46. package/dist/docs.json +176 -20
  47. package/dist/esm/{Api-0cac5b8a.js → Api-97801a4b.js} +1 -0
  48. package/dist/esm/bank-account-form_9.entry.js +10 -6
  49. package/dist/esm/billing-form_3.entry.js +2 -2
  50. package/dist/esm/{business-additional-questions-schema-212a96ed.js → business-additional-questions-schema-60e9b76a.js} +1 -1
  51. package/dist/esm/{business-identity-schema-05bd2a5f.js → business-identity-schema-191d85c2.js} +1 -1
  52. package/dist/esm/{business.service-6a208f8f.js → business.service-45c7df3c.js} +1 -1
  53. package/dist/esm/{check-pkg-version-bac7eb5e.js → check-pkg-version-e2273f4f.js} +2 -2
  54. package/dist/esm/{checkout.service-ac067baa.js → checkout.service-36e3355e.js} +1 -1
  55. package/dist/esm/{dispute.service-26a788a8.js → dispute.service-9b9b87e5.js} +1 -1
  56. package/dist/esm/{get-payout-csv-684fece6.js → get-payout-csv-80210301.js} +1 -1
  57. package/dist/esm/{get-subaccounts-b1bed757.js → get-subaccounts-d3eeb85d.js} +1 -1
  58. package/dist/esm/justifi-additional-questions-form-step-core_6.entry.js +3 -3
  59. package/dist/esm/justifi-additional-questions-form-step_9.entry.js +2 -2
  60. package/dist/esm/justifi-business-details.entry.js +4 -4
  61. package/dist/esm/justifi-business-form.entry.js +6 -6
  62. package/dist/esm/justifi-checkout-core.entry.js +3 -2
  63. package/dist/esm/justifi-checkout.entry.js +7 -6
  64. package/dist/esm/justifi-checkouts-list.entry.js +5 -5
  65. package/dist/esm/justifi-dispute-management.entry.js +4 -4
  66. package/dist/esm/justifi-dispute-notification_3.entry.js +4 -4
  67. package/dist/esm/justifi-gross-payment-chart.entry.js +3 -3
  68. package/dist/esm/justifi-owner-form_3.entry.js +4 -4
  69. package/dist/esm/justifi-payment-details.entry.js +4 -4
  70. package/dist/esm/justifi-payment-provisioning.entry.js +4 -4
  71. package/dist/esm/justifi-payments-list.entry.js +4 -4
  72. package/dist/esm/justifi-payout-details.entry.js +4 -4
  73. package/dist/esm/justifi-payouts-list.entry.js +5 -5
  74. package/dist/esm/justifi-refund-form.entry.js +1 -1
  75. package/dist/esm/justifi-season-interruption-insurance.entry.js +3 -3
  76. package/dist/esm/justifi-terminals-list.entry.js +4 -4
  77. package/dist/esm/justifi-tokenize-payment-method.entry.js +19 -10
  78. package/dist/esm/loader.js +1 -1
  79. package/dist/esm/{package-90ebd343.js → package-a8e8f775.js} +1 -1
  80. package/dist/esm/{payment.service-2e418da1.js → payment.service-c847c1f6.js} +1 -1
  81. package/dist/esm/{schema-validations-ccea6a06.js → schema-validations-38e8bc7b.js} +1 -1
  82. package/dist/esm/webcomponents.js +1 -1
  83. package/dist/module/bank-account-form2.js +3 -1
  84. package/dist/module/card-form2.js +3 -1
  85. package/dist/module/checkout-core.js +4 -2
  86. package/dist/module/config.js +1 -0
  87. package/dist/module/justifi-checkout.js +5 -2
  88. package/dist/module/justifi-tokenize-payment-method.js +17 -8
  89. package/dist/module/new-payment-method.js +4 -2
  90. package/dist/module/package.js +1 -1
  91. package/dist/module/payment-method-options.js +4 -2
  92. package/dist/module/schema-validations.js +1 -1
  93. package/dist/types/components/checkout/bank-account-form/bank-account-form.d.ts +1 -0
  94. package/dist/types/components/checkout/card-form/card-form.d.ts +1 -0
  95. package/dist/types/components/checkout/checkout-core.d.ts +1 -0
  96. package/dist/types/components/checkout/checkout.d.ts +1 -0
  97. package/dist/types/components/checkout/new-payment-method.d.ts +1 -0
  98. package/dist/types/components/checkout/payment-method-options.d.ts +1 -0
  99. package/dist/types/components/tokenize-payment-method/tokenize-payment-method.d.ts +5 -3
  100. package/dist/types/components.d.ts +24 -12
  101. package/dist/types/home/runner/work/web-component-library/web-component-library/packages/webcomponents/.stencil/packages/webcomponents/config.d.ts +1 -0
  102. package/dist/webcomponents/p-02d36485.entry.js +1 -0
  103. package/dist/webcomponents/p-1820fd87.entry.js +1 -0
  104. package/dist/webcomponents/{p-d07c45e6.entry.js → p-1882d7d6.entry.js} +1 -1
  105. package/dist/webcomponents/{p-e0db920c.entry.js → p-25c9c88c.entry.js} +1 -1
  106. package/dist/webcomponents/{p-f5925b1e.entry.js → p-2710884e.entry.js} +1 -1
  107. package/dist/webcomponents/{p-de13f23c.js → p-27c8ffa2.js} +1 -1
  108. package/dist/webcomponents/{p-865733bc.js → p-35b00a0d.js} +1 -1
  109. package/dist/webcomponents/{p-c5ce98b0.entry.js → p-39696abd.entry.js} +1 -1
  110. package/dist/webcomponents/{p-f9728478.entry.js → p-40eabfca.entry.js} +1 -1
  111. package/dist/webcomponents/p-4810f227.entry.js +1 -0
  112. package/dist/webcomponents/{p-ed17e472.entry.js → p-485814d8.entry.js} +1 -1
  113. package/dist/webcomponents/p-4bad3621.js +1 -0
  114. package/dist/webcomponents/p-57206dc4.entry.js +1 -0
  115. package/dist/webcomponents/{p-3d5c8a98.entry.js → p-63a8b08f.entry.js} +1 -1
  116. package/dist/webcomponents/p-67b75e01.entry.js +1 -0
  117. package/dist/webcomponents/{p-21cf557e.entry.js → p-68bf1a1d.entry.js} +1 -1
  118. package/dist/webcomponents/{p-a263a3db.entry.js → p-72992c97.entry.js} +1 -1
  119. package/dist/webcomponents/{p-0277c1b2.js → p-849c68e5.js} +1 -1
  120. package/dist/webcomponents/{p-2a136295.js → p-933537ca.js} +1 -1
  121. package/dist/webcomponents/{p-c470a150.js → p-960a8ec2.js} +1 -1
  122. package/dist/webcomponents/{p-f706d70e.js → p-a2076a0e.js} +1 -1
  123. package/dist/webcomponents/p-a47c14cb.entry.js +1 -0
  124. package/dist/webcomponents/p-b01405ab.entry.js +1 -0
  125. package/dist/webcomponents/{p-c5c03d88.js → p-b0b40bcd.js} +1 -1
  126. package/dist/webcomponents/p-b15ad5df.js +1 -0
  127. package/dist/webcomponents/{p-42047b14.entry.js → p-b2209632.entry.js} +1 -1
  128. package/dist/webcomponents/{p-c845cb7a.js → p-b2edb944.js} +1 -1
  129. package/dist/webcomponents/{p-9235b94e.entry.js → p-c75481bf.entry.js} +1 -1
  130. package/dist/webcomponents/{p-cc4adf97.js → p-dd867d1f.js} +1 -1
  131. package/dist/webcomponents/{p-abb46c6b.entry.js → p-e22df884.entry.js} +1 -1
  132. package/dist/webcomponents/{p-3c0b56cd.entry.js → p-e8d0f978.entry.js} +1 -1
  133. package/dist/webcomponents/{p-f9ac523e.entry.js → p-fbe16023.entry.js} +1 -1
  134. package/dist/webcomponents/p-fdbcd486.js +1 -0
  135. package/dist/webcomponents/{p-f1e01bab.entry.js → p-ff955a18.entry.js} +1 -1
  136. package/dist/webcomponents/webcomponents.esm.js +1 -1
  137. package/package.json +1 -1
  138. package/dist/webcomponents/p-0ef9eae6.entry.js +0 -1
  139. package/dist/webcomponents/p-2d801915.js +0 -1
  140. package/dist/webcomponents/p-56addd0a.entry.js +0 -1
  141. package/dist/webcomponents/p-631d54a2.entry.js +0 -1
  142. package/dist/webcomponents/p-6b0bec46.entry.js +0 -1
  143. package/dist/webcomponents/p-cdb7fa19.entry.js +0 -1
  144. package/dist/webcomponents/p-ea105de3.js +0 -1
  145. package/dist/webcomponents/p-ea5cf135.entry.js +0 -1
  146. package/dist/webcomponents/p-f9d63d9d.js +0 -1
  147. package/dist/webcomponents/p-fe0d245f.entry.js +0 -1
@@ -1 +1 @@
1
- import{r as t,c as s,h as i}from"./p-2783e363.js";import{C as e,a as o}from"./p-14c91ffd.js";import{c as a,J as r}from"./p-2a136295.js";import{c as n}from"./p-2d801915.js";import{m as p,P as c}from"./p-cc4adf97.js";import"./p-7c31ec70.js";import"./p-56f6ce4c.js";import"./p-9894484a.js";import{P as h}from"./p-01d4e35a.js";import"./p-61f0a2ce.js";import{g as d,a as l}from"./p-8115b2f4.js";import{m,S as b}from"./p-f706d70e.js";import{S as u}from"./p-bfe9748b.js";import{d as f}from"./p-21431a04.js";import"./p-c845cb7a.js";import"./p-2ca5b5e4.js";import"./p-abdbcd8e.js";import"./p-3e716e03.js";import"./p-938993c7.js";import"./p-d8c04275.js";const j=class{constructor(i){t(this,i),this.errorEvent=s(this,"error-event",7),this.handleOnError=t=>{this.errorMessage=t.detail.message,this.errorEvent.emit(t.detail)},this.getPayouts=void 0,this.getPayoutCSV=void 0,this.getSubAccounts=void 0,this.errorMessage=null,this.accountId=void 0,this.authToken=void 0,this.apiOrigin=n.proxyApiOrigin,this.columns=f}componentWillLoad(){a(),this.analytics=new r(this),this.initializeGetData()}disconnectedCallback(){this.analytics.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 c,apiOrigin:this.apiOrigin};this.getPayouts=(({id:t,authToken:s,service:i,apiOrigin:o})=>async({params:a,onSuccess:r,onError:n})=>{var p,c;try{const m=await i.fetchPayouts(t,s,a,o);if(m.error)return n({error:d(m.error),code:l(null===(c=m.error)||void 0===c?void 0:c.code),severity:e.ERROR});{const t=Object.assign({},m.page_info);r({payouts:(null===(p=m.data)||void 0===p?void 0:p.map((t=>new h(t))))||[],pagingInfo:t})}}catch(t){const s=l(null==t?void 0:t.code);return n({error:t.message||t,code:s,severity:e.ERROR})}})(t),this.getPayoutCSV=p(t)}else this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:o.MISSING_PROPS,message:this.errorMessage,severity:e.ERROR})}initializeGetSubAccounts(){this.accountId&&this.authToken&&(this.getSubAccounts=m({accountId:this.accountId,authToken:this.authToken,service:new b,apiOrigin:this.apiOrigin}))}render(){return i(u,{key:"7e8c3bf1df6c6cdffdc7205f84d4b451b331f6db",exportedparts:"\ntable-head,table-head-row,table-head-cell,table-body,table-row,table-row-even,\ntable-row-odd,table-cell,loading-state-cell,loading-state-spinner,error-state,\nempty-state,pagination-bar,page-arrow,page-button,page-button-disabled,page-button-text\n"},i("payouts-list-core",{key:"9ba8af8a562107b8fdc5bece521187ab70b90669",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{j as justifi_payouts_list}
1
+ import{r as t,c as s,h as i}from"./p-2783e363.js";import{C as e,a as o}from"./p-14c91ffd.js";import{c as a,J as r}from"./p-933537ca.js";import{c as n}from"./p-4bad3621.js";import{m as p,P as c}from"./p-dd867d1f.js";import"./p-7c31ec70.js";import"./p-56f6ce4c.js";import"./p-9894484a.js";import{P as h}from"./p-01d4e35a.js";import"./p-61f0a2ce.js";import{g as d,a as l}from"./p-8115b2f4.js";import{m,S as b}from"./p-a2076a0e.js";import{S as u}from"./p-bfe9748b.js";import{d as f}from"./p-21431a04.js";import"./p-b2edb944.js";import"./p-2ca5b5e4.js";import"./p-abdbcd8e.js";import"./p-3e716e03.js";import"./p-938993c7.js";import"./p-d8c04275.js";const j=class{constructor(i){t(this,i),this.errorEvent=s(this,"error-event",7),this.handleOnError=t=>{this.errorMessage=t.detail.message,this.errorEvent.emit(t.detail)},this.getPayouts=void 0,this.getPayoutCSV=void 0,this.getSubAccounts=void 0,this.errorMessage=null,this.accountId=void 0,this.authToken=void 0,this.apiOrigin=n.proxyApiOrigin,this.columns=f}componentWillLoad(){a(),this.analytics=new r(this),this.initializeGetData()}disconnectedCallback(){this.analytics.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 c,apiOrigin:this.apiOrigin};this.getPayouts=(({id:t,authToken:s,service:i,apiOrigin:o})=>async({params:a,onSuccess:r,onError:n})=>{var p,c;try{const m=await i.fetchPayouts(t,s,a,o);if(m.error)return n({error:d(m.error),code:l(null===(c=m.error)||void 0===c?void 0:c.code),severity:e.ERROR});{const t=Object.assign({},m.page_info);r({payouts:(null===(p=m.data)||void 0===p?void 0:p.map((t=>new h(t))))||[],pagingInfo:t})}}catch(t){const s=l(null==t?void 0:t.code);return n({error:t.message||t,code:s,severity:e.ERROR})}})(t),this.getPayoutCSV=p(t)}else this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:o.MISSING_PROPS,message:this.errorMessage,severity:e.ERROR})}initializeGetSubAccounts(){this.accountId&&this.authToken&&(this.getSubAccounts=m({accountId:this.accountId,authToken:this.authToken,service:new b,apiOrigin:this.apiOrigin}))}render(){return i(u,{key:"7e8c3bf1df6c6cdffdc7205f84d4b451b331f6db",exportedparts:"\ntable-head,table-head-row,table-head-cell,table-body,table-row,table-row-even,\ntable-row-odd,table-cell,loading-state-cell,loading-state-spinner,error-state,\nempty-state,pagination-bar,page-arrow,page-button,page-button-disabled,page-button-text\n"},i("payouts-list-core",{key:"9ba8af8a562107b8fdc5bece521187ab70b90669",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{j as justifi_payouts_list}
@@ -0,0 +1 @@
1
+ const n={proxyApiOrigin:"https://wc-proxy.justifi.ai",iFrameOrigin:"https://components.justifi.ai/v2",proxyAuthToken:"eyJraWQiOiJqdXN0aWZpLWUyNDgyMmU3ODE1MmEzZjRkMjU1IiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJpc3MiOiJodHRwczovL2F1dGguanVzdGlmaS5haS8iLCJhenAiOiJvYXNfMmlsWHBqOHQ2WVlEQ0xWU0FiVFczMiIsInN1YiI6Im9hc18yaWxYcGo4dDZZWURDTFZTQWJUVzMyQHNlc3Npb25zIiwiYXVkIjoiaHR0cHM6Ly9hcGkuanVzdGlmaS5haS92MSIsImd0eSI6ImNsaWVudC1jcmVkZW50aWFscyIsInBlcm1pc3Npb25zIjpbeyJyb2xlIjoicmVhZDphY2NvdW50IiwicmVzb3VyY2VfaWQiOiJhY2NfNUV0OWlYclNTQVpSMktTb3VRR0FXaSJ9LHsicm9sZSI6InJlYWQ6YnVzaW5lc3MiLCJyZXNvdXJjZV9pZCI6ImJpel8zYmg2OWJxMXJrM2RtWE5vQUtWb251In1dLCJleHAiOjE3MTE1NTk0MTQsImlhdCI6MTcwMzc4MzQxNCwicGxhdGZvcm1fYWNjb3VudF9pZCI6ImFjY18zcmVOYjRhTll5MmlXRFpRVmN6bXg0In0.oPOoDYxzrnpE8PRUaz-FCU4KqnSuNbFTeDkl3AtMscjUkIctP1OIFh-ZGBjbH5eVH5noXCbaiin0j92dS7jx4gLpxuYT2Q8gpZbuIsT7fa58elvGeRkUUJ-AC5ueZxlv90yPWMm0OIbyrV7XZhuwYyKbV-ZczEbl2JpvBMe40CM-LdClQV66d_-Kw9a23SabBVfYgP5V-5OsagOIESvzZoO-27tGlNkV2a-hxqddDCOZv0HvRYAtp5S7EQrmRdEBu5gCNbf1eRFG424hxZUFVr2LdetYuKQLxJjDdUjf86ZwEUecrEaDSupiN1VC3CitdOwBVf6-R_N0VpN4VLVD5g",exampleAccountId:"acc_5Et9iXrSSAZR2KSouQGAWi",exampleBusinessId:"biz_3bh69bq1rk3dmXNoAKVonu",examplePaymentId:"py_1NNeEnf4FbelxDCQN2RHcE",examplePayoutId:"po_17745yESnHyEgWNeunmhmR",privateApiOrigin:"",privateAuthToken:""};let t;const e=new Uint8Array(16);function i(){if(!t&&(t="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!t))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return t(e)}const o=[];for(let n=0;n<256;++n)o.push((n+256).toString(16).slice(1));const c={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function r(n,t,e){if(c.randomUUID&&!t&&!n)return c.randomUUID();const r=(n=n||{}).random||(n.rng||i)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){e=e||0;for(let n=0;n<16;++n)t[e+n]=r[n];return t}return function(n,t=0){return o[n[t+0]]+o[n[t+1]]+o[n[t+2]]+o[n[t+3]]+"-"+o[n[t+4]]+o[n[t+5]]+"-"+o[n[t+6]]+o[n[t+7]]+"-"+o[n[t+8]]+o[n[t+9]]+"-"+o[n[t+10]]+o[n[t+11]]+o[n[t+12]]+o[n[t+13]]+o[n[t+14]]+o[n[t+15]]}(r)}const a=({authToken:n,apiOrigin:t})=>{async function e(e,i,o,c,a,p){const u=`${t}/v1/${e}`,s=o?`${u}?${new URLSearchParams(o)}`:u,y=await async function(){return n?{Authorization:`Bearer ${n}`,"Idempotency-Key":r(),"Content-Type":"application/json"}:{"Content-Type":"application/json"}}(),d=Object.assign(Object.assign({},y),p),l=await fetch(s,{method:i,headers:d,body:c,signal:a});if(l)return 204===l.status?{}:l.json();!function(n){console.error(`Error fetching from ${n}`)}(s)}return{get:async function(n,t,i,o){return e(n,"GET",t,null,i,o)},post:async function(n,t,i,o){return e(n,"POST",i,JSON.stringify(t),o)},put:async function(n,t,i,o){return e(n,"PUT",i,JSON.stringify(t),o)},patch:async function(n,t,i,o){return e(n,"PATCH",i,JSON.stringify(t),o)},destroy:async function(n,t,i){return e(n,"DELETE",t,null,i)}}};export{a as A,n as c}
@@ -0,0 +1 @@
1
+ import{r as t,h as i,H as e,c as s}from"./p-2783e363.js";import{i as a}from"./p-4cc3c7f9.js";import{i as n,b as o,a as d,c as r,N as h,O as c}from"./p-d8c04275.js";import{H as l}from"./p-d0bde1cb.js";import{a as f}from"./p-9894484a.js";import{j as m,f as u}from"./p-2ca5b5e4.js";import"./p-f20b6ce1.js";import"./p-abdbcd8e.js";const b=class{constructor(i){t(this,i),this.iframeOrigin=void 0}async validate(){const t=await this.accountNumberIframeElement.validate(),i=await this.routingNumberIframeElement.validate();return t&&i}async tokenize(t,i,e){return this.accountNumberIframeElement.tokenize(t,i,e)}render(){return i(e,{key:"e2aa1322935463d5e0c32154ed8af52baad6b241"},i("div",{key:"bf528ad389d4a34762c164440cb946b727ddbfdd",class:"container-fluid p-0"},i("div",{key:"f2004a7223ebb0f2e54ea8c87a813461acb5449a",class:"row mb-3"},i("iframe-input",{key:"27390ec2ac66557c2a12a38f1bc88dab0415fe57",inputId:"accountNumber",ref:t=>this.accountNumberIframeElement=t,label:"Account Number",iframeOrigin:`${this.iframeOrigin}/v2/accountNumber`})),i("div",{key:"59063a5784405bba8800d1595aecd2748ea9a058",class:"row"},i("iframe-input",{key:"fcad3cd545486450882258b86398c2bf84afca74",inputId:"routingNumber",ref:t=>this.routingNumberIframeElement=t,label:"Routing Number",iframeOrigin:`${this.iframeOrigin}/v2/routingNumber`}))))}},p=class{constructor(i){t(this,i),this.iframeOrigin=void 0}async validate(){const t=await this.cardNumberIframeElement.validate(),i=await this.expirationMonthIframeElement.validate(),e=await this.expirationYearIframeElement.validate(),s=await this.cvvIframeElement.validate();return t&&i&&e&&s}async tokenize(t,i,e){return this.cardNumberIframeElement.tokenize(t,i,e)}render(){return i(e,{key:"5dfd2c79d7691744614af89d0919e58db17434b3",class:"container-fluid p-0"},i("div",{key:"307e9a7acd80285a59369e813bb0172627395cf6",class:"mb-3"},i("iframe-input",{key:"42de95d9e8f6b785e0dfd7a9b79b23e8c1aab4ee",inputId:"cardNumber",ref:t=>this.cardNumberIframeElement=t,label:"Card Number",iframeOrigin:`${this.iframeOrigin}/v2/cardNumber`})),i("div",{key:"9ab568a45c652478daa2fdd936cb49258b8bdd18",class:"row"},i("div",{key:"ee106aa794d4fb0bbcab36f6daada68740bb4262",class:"col-4 align-content-end"},i("iframe-input",{key:"c2edb5592c479763a47d399d4d0428d5468f6be5",inputId:"expirationMonth",ref:t=>this.expirationMonthIframeElement=t,label:"Expiration",iframeOrigin:`${this.iframeOrigin}/v2/expirationMonth`})),i("div",{key:"e9577f47e9d3fea9be62fbbde95dc890091c47e0",class:"col-4 align-content-end"},i("iframe-input",{key:"2f623e190959ed454c3016637f90f38c531d9062",inputId:"expirationYear",ref:t=>this.expirationYearIframeElement=t,label:"",iframeOrigin:`${this.iframeOrigin}/v2/expirationYear`})),i("div",{key:"4522288e5e0f1b41dc89a690830bb78063ea4df0",class:"col-4 align-content-end"},i("iframe-input",{key:"9036d997bcd4f8c73e63daa3997111803bc99a36",inputId:"CVV",ref:t=>this.cvvIframeElement=t,label:"CVV",iframeOrigin:`${this.iframeOrigin}/v2/CVV`}))))}},v=class{constructor(i){t(this,i),this.isFocused=!1,this.errorText=""}async componentDidLoad(){const t=await this.getBaseFontStyles();a("fontStyles",t);const i=await this.getFocusedStyles();a("focused",i);const e=await this.getFocusedAndInvalidStyles();a("focusedAndInvalid",e)}async getBaseFontStyles(){return new Promise((t=>{setTimeout((()=>{const i=getComputedStyle(this.hiddenInput);t({fontFamily:i.fontFamily,fontSize:i.fontSize,fontWeight:i.fontWeight,lineHeight:i.lineHeight,margin:i.margin,padding:i.padding,color:i.color})}),500)}))}async getFocusedStyles(){return new Promise((t=>{this.hiddenInput.focus(),setTimeout((()=>{this.hiddenInput.blur();let i=getComputedStyle(this.hiddenInput);t({boxShadow:i.boxShadow,border:i.border})}),500)}))}async getFocusedAndInvalidStyles(){return new Promise((t=>{this.hiddenInput.focus(),this.errorText="Error",setTimeout((()=>{const i=getComputedStyle(this.hiddenInput),e={boxShadow:i.boxShadow,border:i.border};this.hiddenInput.blur(),t(e)}),500)}))}get part(){return this.isFocused&&this.errorText?n:this.errorText?o:this.isFocused?d:r}render(){return i(e,{key:"21c26d386f4e23af0e0ef069ad0263e252c8c15b"},i("input",{key:"70bb1f6c7c5e94a96fddfe82d1831df12771f0af",ref:t=>this.hiddenInput=t,type:"text",class:this.errorText?"form-control is-invalid":"form-control",onFocus:()=>this.isFocused=!0,onBlur:()=>this.isFocused=!1,part:this.part,tabindex:"-1",style:{height:"0",opacity:"0",pointerEvents:"none",animation:"none"}}))}},y=class{constructor(i){t(this,i),this.legend=void 0,this.hideCardBillingForm=void 0,this.paymentMethodType=void 0}get hideFullBillingForm(){return this.hideCardBillingForm&&"card"===this.paymentMethodType}async fill(t){this.hideFullBillingForm?this.postalFormRef.fill(t):this.billingFormRef.fill(t)}async getValues(){return this.hideFullBillingForm?this.postalFormRef.getValues():this.billingFormRef.getValues()}async validate(){return this.hideFullBillingForm?this.postalFormRef.validate():this.billingFormRef.validate()}get renderedForm(){return this.hideFullBillingForm?i("postal-form",{ref:t=>this.postalFormRef=t}):i("div",null,i(l,{text:"Billing address",class:"fs-6 fw-bold lh-lg mb-4"}),i("billing-form",{ref:t=>this.billingFormRef=t}))}render(){return i(e,{key:"585ffd5fea9537675f0df77e1e4697a53dacf56f"},i("div",{key:"fb7cf4c2f763d64512b6f905aa29aded8060374c",part:h},this.renderedForm))}},k={bankAccount:"New bank account",card:"New credit or debit card"},g=class{constructor(i){t(this,i),this.paymentMethodOptionSelected=s(this,"paymentMethodOptionSelected",7),this.onPaymentMethodOptionClick=t=>{t.preventDefault(),this.paymentMethodOptionSelected.emit(this.paymentMethodOption)},this.authToken=void 0,this.accountId=void 0,this.paymentMethodOption=void 0,this.paymentMethodGroupId=void 0,this.isSelected=void 0,this.hideCardBillingForm=void 0,this.iframeOrigin=void 0,this.saveNewPaymentMethodChecked=!1}handleCheckboxChanged(t){this.saveNewPaymentMethodChecked=t.detail}async fillBillingForm(t){this.billingFormWrapperRef.fill(t)}async resolvePaymentMethod(t){var i,e;if(this.paymentMethodFormRef&&this.billingFormWrapperRef)try{if(!await this.validate()||!t.isValid)return{validationError:!0};const s=await this.tokenize();if(s.error)return{error:s.error};{const t=s.data;return{token:(null===(i=t.card)||void 0===i?void 0:i.token)||(null===(e=t.bank_account)||void 0===e?void 0:e.token),data:t}}}catch(t){return{error:t}}}async validate(){const t=await this.billingFormWrapperRef.validate(),i=await this.paymentMethodFormRef.validate();return t.isValid&&i.isValid}async tokenize(){try{const t=await this.billingFormWrapperRef.getValues();let i;i=this.saveNewPaymentMethodChecked?Object.assign(Object.assign({},t),{payment_method_group_id:this.paymentMethodGroupId}):Object.assign({},t);const e=this.authToken;return await this.paymentMethodFormRef.tokenize(e,i,this.accountId)}catch(t){return t}}showNewPaymentMethodForm(){var t;const e=null===(t=this.paymentMethodOption)||void 0===t?void 0:t.id;return i("div",{class:"mt-4 pb-4"},i("hidden-input",null),i("div",{class:"mb-4"},i("card"===e?"card-form":"bank-account-form",{ref:t=>this.paymentMethodFormRef=t,iframeOrigin:this.iframeOrigin})),i("justifi-billing-form-wrapper",{ref:t=>this.billingFormWrapperRef=t,hideCardBillingForm:this.hideCardBillingForm,paymentMethodType:e}),i("justifi-save-new-payment-method",{hidden:!this.paymentMethodGroupId}))}render(){var t,s;return i(e,{key:"17b922ca3b03d458a0e139be895db31b33c255ed",class:"payment-method"},i("div",{key:"5d1bb3a05e7fc0516d29ade315f13c2f64d3afaf",class:"radio-list-item p-3",part:c,onClick:this.onPaymentMethodOptionClick},i("form-control-radio",{key:"165fd1b54a6d387be307f05ab67078e0d703f0b1",name:"paymentMethodType",value:null===(t=this.paymentMethodOption)||void 0===t?void 0:t.id,checked:this.isSelected,label:k[null===(s=this.paymentMethodOption)||void 0===s?void 0:s.id]})),this.isSelected?this.showNewPaymentMethodForm():null)}};class w{constructor(t){this.id=t.id,this.brand=t.brand,this.acct_last_four=t.acct_last_four,this.type=m(t.type)}}var _;!function(t){t.american_express="American Express",t.diners_club="Diners Club",t.discover="Discover",t.jcb="JCB",t.mastercard="Mastercard",t.china_unionpay="UnionPay",t.visa="Visa",t.unknown="Unknown"}(_||(_={}));const C=class{constructor(i){t(this,i),this.showCard=void 0,this.showAch=void 0,this.showBnpl=void 0,this.showSavedPaymentMethods=void 0,this.paymentMethodGroupId=void 0,this.bnpl=void 0,this.insuranceToggled=void 0,this.authToken=void 0,this.accountId=void 0,this.savedPaymentMethods=[],this.paymentAmount=void 0,this.hideCardBillingForm=void 0,this.iframeOrigin=void 0,this.selectedPaymentMethodId=void 0,this.paymentMethodOptions=[]}async fillBillingForm(t){const i=this.selectedPaymentMethodOptionRef;i.fillBillingForm&&i.fillBillingForm(t)}connectedCallback(){this.paymentMethodsChanged()}paymentMethodsChanged(){var t,i;this.paymentMethodOptions=this.savedPaymentMethods.map((t=>new w(t))).filter((t=>(this.showCard||t.type!==f.card)&&(this.showAch||t.type!==f.bankAccount))),this.showBnpl&&"sezzle"===(null===(t=this.bnpl)||void 0===t?void 0:t.provider)&&!this.insuranceToggled&&this.paymentMethodOptions.push(new w({id:f.sezzle})),this.showCard&&this.paymentMethodOptions.push(new w({id:f.card})),this.showAch&&this.paymentMethodOptions.push(new w({id:f.bankAccount})),this.selectedPaymentMethodId||(this.selectedPaymentMethodId=null===(i=this.paymentMethodOptions[0])||void 0===i?void 0:i.id)}paymentMethodOptionSelected(t){this.selectedPaymentMethodId=t.detail.id}async resolvePaymentMethod(t){var i;return await(null===(i=this.selectedPaymentMethodOptionRef)||void 0===i?void 0:i.resolvePaymentMethod(t))}render(){var t;return i(e,{key:"24e7d418958eb61f9582317e615502e77b4090d0"},null===(t=this.paymentMethodOptions)||void 0===t?void 0:t.map((t=>{const e=this.selectedPaymentMethodId===t.id,s=t.id===f.sezzle;return t.id===f.card||t.id===f.bankAccount?i("justifi-new-payment-method",{paymentMethodOption:t,authToken:this.authToken,"account-id":this.accountId,"is-selected":e,paymentMethodGroupId:this.paymentMethodGroupId,hideCardBillingForm:this.hideCardBillingForm,iframeOrigin:this.iframeOrigin,ref:t=>{e&&(this.selectedPaymentMethodOptionRef=t)}}):s?i("justifi-sezzle-payment-method",{paymentMethodOption:t,"is-selected":e,paymentAmount:this.paymentAmount,bnpl:this.bnpl,ref:t=>{e&&(this.selectedPaymentMethodOptionRef=t)}}):this.showSavedPaymentMethods?i("justifi-saved-payment-method",{paymentMethodOption:t,"is-selected":e,ref:t=>{e&&(this.selectedPaymentMethodOptionRef=t)}}):void 0})))}static get watchers(){return{savedPaymentMethods:["paymentMethodsChanged"]}}},M=class{constructor(i){t(this,i),this.checkboxChanged=s(this,"checkboxChanged",7),this.isChecked=!1}handleCheckboxChange(t,i){this.isChecked=i,this.checkboxChanged.emit(this.isChecked)}render(){return i("div",{key:"86520e5820d9e6ef19946566b31912c5b1050bf6",class:"mt-4 form-check"},i("form-control-checkbox",{key:"cc87b708b88aaf4b1f1a93f6b6ebfdd030f87bc0",label:"Save new payment method",name:"saveNewPaymentMethod",checked:this.isChecked,inputHandler:this.handleCheckboxChange.bind(this)}))}},j=class{constructor(i){t(this,i),this.paymentMethodOptionSelected=s(this,"paymentMethodOptionSelected",7),this.onPaymentMethodOptionClick=t=>{t.preventDefault(),this.paymentMethodOptionSelected.emit(this.paymentMethodOption)},this.paymentMethodOption=void 0,this.isSelected=void 0}async resolvePaymentMethod(t){var i;return t.isValid?{token:null===(i=this.paymentMethodOption)||void 0===i?void 0:i.id}:{validationError:!0}}render(){var t,s,a;return i(e,{key:"34d26fc514053e2fe028a4a3ba0cbdeb8aa835f1",class:"payment-method"},i("div",{key:"da373a524b97bb91a0bc0849f0670c440f5cf5a8",class:"radio-list-item p-3",part:c,onClick:this.onPaymentMethodOptionClick},i("form-control-radio",{key:"824ebc566a018e342dd7f128c69fca873bbded45",name:"paymentMethodType",value:null===(t=this.paymentMethodOption)||void 0===t?void 0:t.id,checked:this.isSelected,label:`${_[null===(s=this.paymentMethodOption)||void 0===s?void 0:s.brand]||""} *${null===(a=this.paymentMethodOption)||void 0===a?void 0:a.acct_last_four}`})))}},z=i("img",{class:"sezzle-smart-button-logo-img",src:"https://media.sezzle.com/branding/2.0/Sezzle_Logo_FullColor.svg",alt:"Sezzle",style:{display:"inline",width:"80px",marginLeft:"5px",marginTop:"-5px"}}),x=class{constructor(i){t(this,i),this.paymentMethodOptionSelected=s(this,"paymentMethodOptionSelected",7),this.onPaymentMethodOptionClick=t=>{t.preventDefault(),this.paymentMethodOptionSelected.emit(this.paymentMethodOption)},this.initializeSezzleCheckout=()=>{let t;this.sezzlePromise=new Promise((i=>{t=i}));const i=this.bnpl,e=+this.paymentAmount,s=new(0,window.Checkout)({mode:"popup",publicKey:i.provider_client_id,apiMode:i.provider_mode,apiVersion:i.provider_api_version});s.sezzleButtonElement=this.sezzleButtonRef,s.init({onClick:function(t){t.preventDefault(),s.startCheckout({checkout_url:i.provider_checkout_url})},onComplete:i=>t({bnpl:i.data}),onCancel:i=>t({bnpl:i.data}),onFailure:i=>t({bnpl:i.data})}),this.sezzleCheckout=s,this.installmentPlan=this.sezzleCheckout.getInstallmentPlan(e)},this.bnpl=void 0,this.clientId=void 0,this.accountId=void 0,this.paymentMethodOption=void 0,this.isSelected=void 0,this.paymentAmount=void 0,this.installmentPlan=void 0,this.sezzleCheckout=void 0,this.sezzlePromise=void 0}componentDidRender(){this.scriptRef.onload=()=>{this.sezzleButtonRef=document.createElement("button"),this.initializeSezzleCheckout()}}async resolvePaymentMethod(t){return t.isValid?(this.sezzleButtonRef.click(),this.sezzlePromise):{validationError:!0}}render(){var t,s,a;return i(e,{key:"696051d9a48f0127013dcc84a25053f85ad92145",class:"payment-method"},i("script",{key:"0dec4821a85dbef872494885c32c26719423b761",src:"https://checkout-sdk.sezzle.com/checkout.min.js",async:!0,ref:t=>this.scriptRef=t}),i("div",{key:"fb9812691532a49f5c8093a989f6277d4755e531",class:"radio-list-item p-3",part:c,onClick:this.onPaymentMethodOptionClick},i("form-control-radio",{key:"3ae4c03b30a32b860231789d2f541fbfbea37bef",name:"paymentMethodType",value:null===(t=this.paymentMethodOption)||void 0===t?void 0:t.id,checked:this.isSelected,label:i("div",null,i("div",null,"Buy now, pay later with ",z),this.installmentPlan&&i("small",null,i("span",null,null===(s=this.installmentPlan)||void 0===s?void 0:s.installments.length)," ",i("span",null,this.installmentPlan.schedule," payments of")," ",i("span",{class:"fw-bold"},u(null===(a=this.installmentPlan)||void 0===a?void 0:a.installments[0].amountInCents))))})))}};export{b as bank_account_form,p as card_form,v as hidden_input,y as justifi_billing_form_wrapper,g as justifi_new_payment_method,C as justifi_payment_method_options,M as justifi_save_new_payment_method,j as justifi_saved_payment_method,x as justifi_sezzle_payment_method}
@@ -1 +1 @@
1
- import{r as e,c as t,h as s}from"./p-2783e363.js";import{f as i}from"./p-2ca5b5e4.js";import{t as a,M as d}from"./p-d8c04275.js";import{B as r}from"./p-298e290e.js";import{S as c}from"./p-bfe9748b.js";import{S as o}from"./p-aa02cf71.js";import{C as n,a as h}from"./p-14c91ffd.js";import{g as p,a as f}from"./p-8115b2f4.js";import{D as l}from"./p-c470a150.js";import{D as u}from"./p-667ebd79.js";import{c as b,J as y}from"./p-2a136295.js";import{c as v}from"./p-2d801915.js";import"./p-7c31ec70.js";import"./p-56f6ce4c.js";import"./p-9894484a.js";import"./p-abdbcd8e.js";import"./p-01d4e35a.js";import"./p-61f0a2ce.js";import"./p-c845cb7a.js";const m=({authToken:e,disputeId:t,service:s})=>async({payload:i,onSuccess:a,onError:d,final:r=(()=>{})})=>{var c;try{const r=await s.submitDisputeResponse(t,e,i);if(r.error){return d({error:p(r.error),code:f(null===(c=r.error)||void 0===c?void 0:c.code),severity:n.ERROR})}a(r)}catch(e){const t=f(null==e?void 0:e.code);return d({error:e.message||e,code:t,severity:n.ERROR})}finally{return r()}},k=class{constructor(s){e(this,s),this.clickEvent=t(this,"click-event",7),this.errorEvent=t(this,"error-event",7),this.submitEvent=t(this,"submit-event",7),this.dispute=void 0,this.authToken=void 0,this.isLoading=void 0}acceptDispute(){m({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})}render(){var e,t,n,h,p,f,l;return s(c,{key:"90d2506d5bde2ea478fa3575fc162bb356b67fac"},this.isLoading&&s("div",{key:"4877ae22d3d8e312640b122c9107b6bdd8f924cb",style:{marginBottom:"8px"}},s(o,{key:"31fa0717949bbc6aa49db1c6ae0e324099ae1de2",height:"28px",width:"70%",styles:{marginBottom:"16px"}}),s(o,{key:"ac5179232cb9ee33d3f3e16d9f93536ecfbf46a5",height:"18px",styles:{marginBottom:"8px"}}),s(o,{key:"c22a5e3b257d01f92de7f6188fa0758861abc747",height:"18px",styles:{marginBottom:"8px"}})),(null===(e=this.dispute)||void 0===e?void 0:e.needsResponse)&&s("div",{key:"be331b1a5e2fa0baf46bc593ef7ce4f5872abcff",part:a},s("h1",{key:"8094c16d3b375f28ffe314613f21ae25b63e59ef",class:"h4",part:d},"This payment is disputed"),s("p",{key:"d89ae665e1f9bd99c9338e2132c1dc56e5386696"},"The cardholder is disputing this payment. You may accept this dispute, or proceed to provide evidence in a counter dispute."),s("h2",{key:"2786733eac76628019993e13473d1f43c0c395ed",class:"h5"},"Dispute details"),s("div",{key:"663c28c46136bd56889b6ad0b9bfce9e5adbb590",class:"d-table gap-2"},s("div",{key:"dc688fad875d1591dcb7f31d423b61a3df2ff954",class:"d-table-row gap-2"},s("span",{key:"442db7a6e95524ca6b092794c7a4a4d987c9866e",part:"detail-section-item-title",class:"fw-bold d-table-cell pe-4"},"Amount"),s("span",{key:"0a31de8692c9b00f43fcf3c0508e4d00a221d096",part:"detail-section-item-data",class:"flex-1 d-table-cell text-wrap"},i(null===(t=this.dispute)||void 0===t?void 0:t.amount))),s("div",{key:"9fe0c1a3d3350c36fca190ae748dafe24d41b5fc",class:"d-table-row gap-2"},s("span",{key:"12165cb6671519130a5f2e0d8938aaa55e7e3ead",part:"detail-section-item-title",class:"fw-bold d-table-cell pe-4"},"Reason"),s("span",{key:"4a37ca8a7d64b97142997bb50ec11d737ac6a882",part:"detail-section-item-data",class:"flex-1 d-table-cell text-wrap"},null===(n=this.dispute)||void 0===n?void 0:n.reason)),s("div",{key:"4d9cf74a8ed26dd84e4ce7325d4b8703352362a4",class:"d-table-row gap-2"},s("span",{key:"8c0eaa24ebec7703eb18384b0b1f2eae8a684b55",part:"detail-section-item-title",class:"fw-bold d-table-cell pe-4"},"Dispute ID"),s("span",{key:"238813abf2ea0848e1fe817d5798b9b0d0b78ffc",part:"detail-section-item-data",class:"flex-1 d-table-cell text-wrap"},null===(h=this.dispute)||void 0===h?void 0:h.id))),s("div",{key:"d156a7e9bf0e7214ff2164fc09b12c0b8f1d2b36",class:"d-flex gap-2 mt-4 justify-content-end"},s(r,{key:"7822fd12dfc39bd2aced043956d012fd34cc1b01",variant:"secondary",onClick:()=>this.acceptDispute()},"Accept dispute"),s(r,{key:"05132b3a6d1fc3d136dc227008ea1999330cdb96",variant:"primary",onClick:()=>this.initiateRespondToDispute()},"Counter dispute"))),(null===(p=this.dispute)||void 0===p?void 0:p.underReview)&&s("div",{key:"b04dd0c34f608b75ea3997a9c28ce948fa9dba5c"},s("h1",{key:"ac2a13373315703e86247b6707097af7cf2e6757",class:"h4"},"This payment is disputed and under review"),s("p",{key:"203aed553e01bbaebe44bb370a1d088c149cda06"},"The cardholder is disputing this payment. A counter dispute has been submitEvent and is under review.")),(null===(f=this.dispute)||void 0===f?void 0:f.won)&&s("div",{key:"68411e62bb5c8048e995906a5f30ef1001a0bc5b"},s("h1",{key:"565feeac6e7aca35a0b72c9128c1edcb0d6a85b6",class:"h4"},"This payment was disputed"),s("p",{key:"68371d393c1f4053f19827c6e46978b3d73d2873"},"The cardholder disputed this payment and the card issuer has settled it in your favor.")),(null===(l=this.dispute)||void 0===l?void 0:l.lost)&&s("div",{key:"99d10bf25e730dda4f4596efa100b4cff7ddc0c8"},s("h1",{key:"d5c6252c4236f2e5b93925db8c9a40bab6c0253a",class:"h4"},"This payment was disputed"),s("p",{key:"773d083786d795fee7f7818f34414a7d1459925c"},"The cardholder disputed this payment and the card issuer has settled it their favor.")))}},w=class{constructor(s){e(this,s),this.errorEvent=t(this,"error-event",7),this.handleErrorEvent=e=>{this.errorMessage=e.detail.message,this.errorEvent.emit(e.detail)},this.updateDisputeResponse=void 0,this.submitDisputeResponse=void 0,this.createDisputeEvidence=void 0,this.errorMessage=null,this.authToken=void 0,this.disputeId=void 0,this.disputeResponse=void 0,this.apiOrigin=v.proxyApiOrigin}componentWillLoad(){b(),this.analytics=new y(this),this.initializeDisputeServiceMethods()}disconnectedCallback(){this.analytics.cleanup()}propChanged(){this.initializeDisputeServiceMethods()}initializeDisputeServiceMethods(){this.disputeId&&this.authToken?(this.updateDisputeResponse=(({authToken:e,disputeId:t,service:s})=>async({payload:i,onSuccess:a,onError:d,final:r=(()=>{})})=>{var c;try{const r=await s.updateDisputeResponse(t,e,i);if(r.error)return d({error:p(r.error),code:f(null===(c=r.error)||void 0===c?void 0:c.code),severity:n.ERROR});a(r)}catch(e){const t=f(null==e?void 0:e.code);return d({error:e.message||e,code:t,severity:n.ERROR})}finally{return r()}})({disputeId:this.disputeId,authToken:this.authToken,service:new l}),this.createDisputeEvidence=(({authToken:e,disputeId:t,service:s})=>async({payload:i,onSuccess:a,onError:d,final:r=(()=>{})})=>{var c;try{const r=await s.createDisputeEvidence(t,e,i);if(r.error)return d({error:p(r.error),code:f(null===(c=r.error)||void 0===c?void 0:c.code),severity:n.ERROR});a(r)}catch(e){const t=f(null==e?void 0:e.code);return d({error:e.message||e,code:t,severity:n.ERROR})}finally{return r()}})({disputeId:this.disputeId,authToken:this.authToken,service:new l}),this.submitDisputeResponse=m({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(c,{key:"f45d96fd372763ebc3f786c1d2f7e06e25185afc"},s("justifi-dispute-response-core",{key:"8b551f97d8cb40f3f9e702a35b221faa8873e642","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"]}}},j=class{constructor(i){e(this,i),this.clickEvent=t(this,"click-event",7),this.errorEvent=t(this,"error-event",7),this.stepCompleteEvent=t(this,"complete-form-step-event",7),this.submitEvent=t(this,"submit-event",7),this.componentStepMapping=[()=>s("justifi-product-or-service",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse}),()=>s("justifi-customer-details",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse}),()=>s("justifi-cancellation-policy",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse}),()=>s("justifi-refund-policy",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse}),()=>s("justifi-duplicate-charge",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse}),()=>s("justifi-electronic-evidence",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse}),()=>s("justifi-shipping-details",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse}),()=>s("justifi-additional-statement",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse})],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,this.isLoading=!1},onError:({error:e,code:t,severity:s})=>{this.errorEvent.emit({errorCode:t,message:e,severity:s}),this.isLoading=!1}}),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.onCancel=()=>{this.clickEvent.emit({name:u.cancelDispute})},this.handleSubmit=async(e,t,s)=>{this.isLoading=!0,t.length&&(this.documentList=t,await this.initializeMakePresignedURLs(),await this.initializeFileUploads()),await this.saveData(e,s),this.isLoading=!1},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)}))},this.updateDisputeResponse=void 0,this.submitDisputeResponse=void 0,this.createDisputeEvidence=void 0,this.disputeResponse={},this.isLoading=!1,this.documentList=[],this.currentStep=0,this.currentStepComponentRef=void 0}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:"672d92a8ac0fb7f28ab9f412ae4f3516a29824dc",class:"row gy-3"},s("div",{key:"32113215c9eb6393d8d816f88715390fb5d9d604",class:"col-12"},s("h1",{key:"f224caa363ebd00d678485fd4cd2d1c646d6d8f5",class:"h4",part:d},"Counter dispute")),s("div",{key:"49e6046f57a9b30e6746f28512cf311f1999bcc3",class:"col-12"},this.currentStepComponent),s("div",{key:"6d843d19c9bf7ee026981bdc2ffd5108c25c741a",class:"col-12"},s("div",{key:"dd52a249cc37b3cfc912e04502caf96218cade78",class:"d-flex gap-2 mt-4 justify-content-end"},this.isFirstStep?s(r,{variant:"secondary",onClick:()=>this.onCancel(),disabled:this.isLoading,isLoading:this.isLoading},"Cancel"):s(r,{variant:"secondary",onClick:()=>this.onBack(),disabled:this.isLoading,isLoading:this.isLoading},"Back"),this.isLastStep?s(r,{variant:"primary",onClick:()=>this.onSubmit(),disabled:this.isLoading,isLoading:this.isLoading},"Submit Counter Dispute"):s(r,{variant:"primary",onClick:()=>this.onNext(),disabled:this.isLoading,isLoading:this.isLoading},"Next"))))}};export{k as justifi_dispute_notification,w as justifi_dispute_response,j as justifi_dispute_response_core}
1
+ import{r as e,c as t,h as s}from"./p-2783e363.js";import{f as i}from"./p-2ca5b5e4.js";import{t as a,M as d}from"./p-d8c04275.js";import{B as r}from"./p-298e290e.js";import{S as c}from"./p-bfe9748b.js";import{S as o}from"./p-aa02cf71.js";import{C as n,a as h}from"./p-14c91ffd.js";import{g as p,a as f}from"./p-8115b2f4.js";import{D as l}from"./p-960a8ec2.js";import{D as u}from"./p-667ebd79.js";import{c as b,J as y}from"./p-933537ca.js";import{c as v}from"./p-4bad3621.js";import"./p-7c31ec70.js";import"./p-56f6ce4c.js";import"./p-9894484a.js";import"./p-abdbcd8e.js";import"./p-01d4e35a.js";import"./p-61f0a2ce.js";import"./p-b2edb944.js";const m=({authToken:e,disputeId:t,service:s})=>async({payload:i,onSuccess:a,onError:d,final:r=(()=>{})})=>{var c;try{const r=await s.submitDisputeResponse(t,e,i);if(r.error){return d({error:p(r.error),code:f(null===(c=r.error)||void 0===c?void 0:c.code),severity:n.ERROR})}a(r)}catch(e){const t=f(null==e?void 0:e.code);return d({error:e.message||e,code:t,severity:n.ERROR})}finally{return r()}},k=class{constructor(s){e(this,s),this.clickEvent=t(this,"click-event",7),this.errorEvent=t(this,"error-event",7),this.submitEvent=t(this,"submit-event",7),this.dispute=void 0,this.authToken=void 0,this.isLoading=void 0}acceptDispute(){m({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})}render(){var e,t,n,h,p,f,l;return s(c,{key:"90d2506d5bde2ea478fa3575fc162bb356b67fac"},this.isLoading&&s("div",{key:"4877ae22d3d8e312640b122c9107b6bdd8f924cb",style:{marginBottom:"8px"}},s(o,{key:"31fa0717949bbc6aa49db1c6ae0e324099ae1de2",height:"28px",width:"70%",styles:{marginBottom:"16px"}}),s(o,{key:"ac5179232cb9ee33d3f3e16d9f93536ecfbf46a5",height:"18px",styles:{marginBottom:"8px"}}),s(o,{key:"c22a5e3b257d01f92de7f6188fa0758861abc747",height:"18px",styles:{marginBottom:"8px"}})),(null===(e=this.dispute)||void 0===e?void 0:e.needsResponse)&&s("div",{key:"be331b1a5e2fa0baf46bc593ef7ce4f5872abcff",part:a},s("h1",{key:"8094c16d3b375f28ffe314613f21ae25b63e59ef",class:"h4",part:d},"This payment is disputed"),s("p",{key:"d89ae665e1f9bd99c9338e2132c1dc56e5386696"},"The cardholder is disputing this payment. You may accept this dispute, or proceed to provide evidence in a counter dispute."),s("h2",{key:"2786733eac76628019993e13473d1f43c0c395ed",class:"h5"},"Dispute details"),s("div",{key:"663c28c46136bd56889b6ad0b9bfce9e5adbb590",class:"d-table gap-2"},s("div",{key:"dc688fad875d1591dcb7f31d423b61a3df2ff954",class:"d-table-row gap-2"},s("span",{key:"442db7a6e95524ca6b092794c7a4a4d987c9866e",part:"detail-section-item-title",class:"fw-bold d-table-cell pe-4"},"Amount"),s("span",{key:"0a31de8692c9b00f43fcf3c0508e4d00a221d096",part:"detail-section-item-data",class:"flex-1 d-table-cell text-wrap"},i(null===(t=this.dispute)||void 0===t?void 0:t.amount))),s("div",{key:"9fe0c1a3d3350c36fca190ae748dafe24d41b5fc",class:"d-table-row gap-2"},s("span",{key:"12165cb6671519130a5f2e0d8938aaa55e7e3ead",part:"detail-section-item-title",class:"fw-bold d-table-cell pe-4"},"Reason"),s("span",{key:"4a37ca8a7d64b97142997bb50ec11d737ac6a882",part:"detail-section-item-data",class:"flex-1 d-table-cell text-wrap"},null===(n=this.dispute)||void 0===n?void 0:n.reason)),s("div",{key:"4d9cf74a8ed26dd84e4ce7325d4b8703352362a4",class:"d-table-row gap-2"},s("span",{key:"8c0eaa24ebec7703eb18384b0b1f2eae8a684b55",part:"detail-section-item-title",class:"fw-bold d-table-cell pe-4"},"Dispute ID"),s("span",{key:"238813abf2ea0848e1fe817d5798b9b0d0b78ffc",part:"detail-section-item-data",class:"flex-1 d-table-cell text-wrap"},null===(h=this.dispute)||void 0===h?void 0:h.id))),s("div",{key:"d156a7e9bf0e7214ff2164fc09b12c0b8f1d2b36",class:"d-flex gap-2 mt-4 justify-content-end"},s(r,{key:"7822fd12dfc39bd2aced043956d012fd34cc1b01",variant:"secondary",onClick:()=>this.acceptDispute()},"Accept dispute"),s(r,{key:"05132b3a6d1fc3d136dc227008ea1999330cdb96",variant:"primary",onClick:()=>this.initiateRespondToDispute()},"Counter dispute"))),(null===(p=this.dispute)||void 0===p?void 0:p.underReview)&&s("div",{key:"b04dd0c34f608b75ea3997a9c28ce948fa9dba5c"},s("h1",{key:"ac2a13373315703e86247b6707097af7cf2e6757",class:"h4"},"This payment is disputed and under review"),s("p",{key:"203aed553e01bbaebe44bb370a1d088c149cda06"},"The cardholder is disputing this payment. A counter dispute has been submitEvent and is under review.")),(null===(f=this.dispute)||void 0===f?void 0:f.won)&&s("div",{key:"68411e62bb5c8048e995906a5f30ef1001a0bc5b"},s("h1",{key:"565feeac6e7aca35a0b72c9128c1edcb0d6a85b6",class:"h4"},"This payment was disputed"),s("p",{key:"68371d393c1f4053f19827c6e46978b3d73d2873"},"The cardholder disputed this payment and the card issuer has settled it in your favor.")),(null===(l=this.dispute)||void 0===l?void 0:l.lost)&&s("div",{key:"99d10bf25e730dda4f4596efa100b4cff7ddc0c8"},s("h1",{key:"d5c6252c4236f2e5b93925db8c9a40bab6c0253a",class:"h4"},"This payment was disputed"),s("p",{key:"773d083786d795fee7f7818f34414a7d1459925c"},"The cardholder disputed this payment and the card issuer has settled it their favor.")))}},w=class{constructor(s){e(this,s),this.errorEvent=t(this,"error-event",7),this.handleErrorEvent=e=>{this.errorMessage=e.detail.message,this.errorEvent.emit(e.detail)},this.updateDisputeResponse=void 0,this.submitDisputeResponse=void 0,this.createDisputeEvidence=void 0,this.errorMessage=null,this.authToken=void 0,this.disputeId=void 0,this.disputeResponse=void 0,this.apiOrigin=v.proxyApiOrigin}componentWillLoad(){b(),this.analytics=new y(this),this.initializeDisputeServiceMethods()}disconnectedCallback(){this.analytics.cleanup()}propChanged(){this.initializeDisputeServiceMethods()}initializeDisputeServiceMethods(){this.disputeId&&this.authToken?(this.updateDisputeResponse=(({authToken:e,disputeId:t,service:s})=>async({payload:i,onSuccess:a,onError:d,final:r=(()=>{})})=>{var c;try{const r=await s.updateDisputeResponse(t,e,i);if(r.error)return d({error:p(r.error),code:f(null===(c=r.error)||void 0===c?void 0:c.code),severity:n.ERROR});a(r)}catch(e){const t=f(null==e?void 0:e.code);return d({error:e.message||e,code:t,severity:n.ERROR})}finally{return r()}})({disputeId:this.disputeId,authToken:this.authToken,service:new l}),this.createDisputeEvidence=(({authToken:e,disputeId:t,service:s})=>async({payload:i,onSuccess:a,onError:d,final:r=(()=>{})})=>{var c;try{const r=await s.createDisputeEvidence(t,e,i);if(r.error)return d({error:p(r.error),code:f(null===(c=r.error)||void 0===c?void 0:c.code),severity:n.ERROR});a(r)}catch(e){const t=f(null==e?void 0:e.code);return d({error:e.message||e,code:t,severity:n.ERROR})}finally{return r()}})({disputeId:this.disputeId,authToken:this.authToken,service:new l}),this.submitDisputeResponse=m({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(c,{key:"f45d96fd372763ebc3f786c1d2f7e06e25185afc"},s("justifi-dispute-response-core",{key:"8b551f97d8cb40f3f9e702a35b221faa8873e642","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"]}}},j=class{constructor(i){e(this,i),this.clickEvent=t(this,"click-event",7),this.errorEvent=t(this,"error-event",7),this.stepCompleteEvent=t(this,"complete-form-step-event",7),this.submitEvent=t(this,"submit-event",7),this.componentStepMapping=[()=>s("justifi-product-or-service",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse}),()=>s("justifi-customer-details",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse}),()=>s("justifi-cancellation-policy",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse}),()=>s("justifi-refund-policy",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse}),()=>s("justifi-duplicate-charge",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse}),()=>s("justifi-electronic-evidence",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse}),()=>s("justifi-shipping-details",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse}),()=>s("justifi-additional-statement",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse})],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,this.isLoading=!1},onError:({error:e,code:t,severity:s})=>{this.errorEvent.emit({errorCode:t,message:e,severity:s}),this.isLoading=!1}}),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.onCancel=()=>{this.clickEvent.emit({name:u.cancelDispute})},this.handleSubmit=async(e,t,s)=>{this.isLoading=!0,t.length&&(this.documentList=t,await this.initializeMakePresignedURLs(),await this.initializeFileUploads()),await this.saveData(e,s),this.isLoading=!1},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)}))},this.updateDisputeResponse=void 0,this.submitDisputeResponse=void 0,this.createDisputeEvidence=void 0,this.disputeResponse={},this.isLoading=!1,this.documentList=[],this.currentStep=0,this.currentStepComponentRef=void 0}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:"672d92a8ac0fb7f28ab9f412ae4f3516a29824dc",class:"row gy-3"},s("div",{key:"32113215c9eb6393d8d816f88715390fb5d9d604",class:"col-12"},s("h1",{key:"f224caa363ebd00d678485fd4cd2d1c646d6d8f5",class:"h4",part:d},"Counter dispute")),s("div",{key:"49e6046f57a9b30e6746f28512cf311f1999bcc3",class:"col-12"},this.currentStepComponent),s("div",{key:"6d843d19c9bf7ee026981bdc2ffd5108c25c741a",class:"col-12"},s("div",{key:"dd52a249cc37b3cfc912e04502caf96218cade78",class:"d-flex gap-2 mt-4 justify-content-end"},this.isFirstStep?s(r,{variant:"secondary",onClick:()=>this.onCancel(),disabled:this.isLoading,isLoading:this.isLoading},"Cancel"):s(r,{variant:"secondary",onClick:()=>this.onBack(),disabled:this.isLoading,isLoading:this.isLoading},"Back"),this.isLastStep?s(r,{variant:"primary",onClick:()=>this.onSubmit(),disabled:this.isLoading,isLoading:this.isLoading},"Submit Counter Dispute"):s(r,{variant:"primary",onClick:()=>this.onNext(),disabled:this.isLoading,isLoading:this.isLoading},"Next"))))}};export{k as justifi_dispute_notification,w as justifi_dispute_response,j as justifi_dispute_response_core}
@@ -0,0 +1 @@
1
+ import{r as s,c as i,h as t}from"./p-2783e363.js";import{c as e,J as o}from"./p-933537ca.js";import{a as r,C as n}from"./p-14c91ffd.js";import{m as a,a as h}from"./p-f2f2e20e.js";import{B as p}from"./p-35b00a0d.js";import{A as d,c}from"./p-4bad3621.js";import"./p-b2edb944.js";import"./p-8115b2f4.js";class u{async postProvisioning(s,i,t){const e={business_id:i,product_category:t};return d({authToken:s,apiOrigin:c.proxyApiOrigin}).post("entities/provisioning",e)}}const m=class{constructor(t){s(this,t),this.errorEvent=i(this,"error-event",7),this.postProvisioning=void 0,this.getBusiness=void 0,this.businessId=void 0,this.authToken=void 0,this.allowOptionalFields=!1,this.formTitle="Business Information"}propChanged(){this.initializeApi()}componentWillLoad(){e(),this.analytics=new o(this),this.initializeApi()}disconnectedCallback(){this.analytics.cleanup()}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=a({authToken:this.authToken,businessId:this.businessId,service:new p}),this.postProvisioning=h({authToken:this.authToken,businessId:this.businessId,product:"payment",service:new u})):this.errorEvent.emit({message:"auth-token and business-id are required",errorCode:r.MISSING_PROPS,severity:n.ERROR})}render(){return t("justifi-payment-provisioning-core",{key:"ca4b13afe923312bd51d477eae50099876991599",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{m as justifi_payment_provisioning}
@@ -1 +1 @@
1
- import{r as t,c as i,h as s}from"./p-2783e363.js";import{C as e,a as r}from"./p-14c91ffd.js";import{c as o,J as a}from"./p-2a136295.js";import{a as p}from"./p-abdbcd8e.js";import{g as n,a as c}from"./p-8115b2f4.js";import{D as h}from"./p-c470a150.js";import{c as d}from"./p-2d801915.js";import"./p-c845cb7a.js";import"./p-7c31ec70.js";import"./p-2ca5b5e4.js";import"./p-56f6ce4c.js";import"./p-9894484a.js";import"./p-01d4e35a.js";import"./p-61f0a2ce.js";const m=class{constructor(s){t(this,s),this.errorEvent=i(this,"error-event",7),this.handleErrorEvent=t=>{this.errorMessage=t.detail.message,this.errorEvent.emit(t.detail)},this.disputeId=void 0,this.authToken=void 0,this.apiOrigin=d.proxyApiOrigin,this.getDispute=void 0,this.errorMessage=null}componentWillLoad(){o(),this.analytics=new a(this),this.initializeGetDispute()}disconnectedCallback(){this.analytics.cleanup()}propChanged(){this.initializeGetDispute()}initializeGetDispute(){this.disputeId&&this.authToken?this.getDispute=(({id:t,authToken:i,service:s,apiOrigin:r})=>async({onSuccess:o,onError:a})=>{var h;try{const d=await s.fetchDispute(t,i,r);if(d.error)return a({error:n(d.error),code:c(null===(h=d.error)||void 0===h?void 0:h.code),severity:e.ERROR});{const t=Object.assign({},d.page_info);o({dispute:new p(d.data),pagingInfo:t})}}catch(t){const i=c(null==t?void 0:t.code);return a({error:t.message||t,code:i,severity:e.ERROR})}})({id:this.disputeId,authToken:this.authToken,service:new h,apiOrigin:this.apiOrigin}):(this.errorMessage="Dispute ID and Auth Token are required",this.errorEvent.emit({message:this.errorMessage,errorCode:r.MISSING_PROPS,severity:e.ERROR}))}render(){return s("justifi-dispute-management-core",{key:"ac225c68cd03070f60bf00bef92ddcc8d5fe4e47",getDispute:this.getDispute,disputeId:this.disputeId,authToken:this.authToken,"onError-event":this.handleErrorEvent})}static get watchers(){return{disputeId:["propChanged"],authToken:["propChanged"]}}};export{m as justifi_dispute_management}
1
+ import{r as t,c as i,h as s}from"./p-2783e363.js";import{C as e,a as r}from"./p-14c91ffd.js";import{c as o,J as a}from"./p-933537ca.js";import{a as p}from"./p-abdbcd8e.js";import{g as n,a as c}from"./p-8115b2f4.js";import{D as h}from"./p-960a8ec2.js";import{c as d}from"./p-4bad3621.js";import"./p-b2edb944.js";import"./p-7c31ec70.js";import"./p-2ca5b5e4.js";import"./p-56f6ce4c.js";import"./p-9894484a.js";import"./p-01d4e35a.js";import"./p-61f0a2ce.js";const m=class{constructor(s){t(this,s),this.errorEvent=i(this,"error-event",7),this.handleErrorEvent=t=>{this.errorMessage=t.detail.message,this.errorEvent.emit(t.detail)},this.disputeId=void 0,this.authToken=void 0,this.apiOrigin=d.proxyApiOrigin,this.getDispute=void 0,this.errorMessage=null}componentWillLoad(){o(),this.analytics=new a(this),this.initializeGetDispute()}disconnectedCallback(){this.analytics.cleanup()}propChanged(){this.initializeGetDispute()}initializeGetDispute(){this.disputeId&&this.authToken?this.getDispute=(({id:t,authToken:i,service:s,apiOrigin:r})=>async({onSuccess:o,onError:a})=>{var h;try{const d=await s.fetchDispute(t,i,r);if(d.error)return a({error:n(d.error),code:c(null===(h=d.error)||void 0===h?void 0:h.code),severity:e.ERROR});{const t=Object.assign({},d.page_info);o({dispute:new p(d.data),pagingInfo:t})}}catch(t){const i=c(null==t?void 0:t.code);return a({error:t.message||t,code:i,severity:e.ERROR})}})({id:this.disputeId,authToken:this.authToken,service:new h,apiOrigin:this.apiOrigin}):(this.errorMessage="Dispute ID and Auth Token are required",this.errorEvent.emit({message:this.errorMessage,errorCode:r.MISSING_PROPS,severity:e.ERROR}))}render(){return s("justifi-dispute-management-core",{key:"ac225c68cd03070f60bf00bef92ddcc8d5fe4e47",getDispute:this.getDispute,disputeId:this.disputeId,authToken:this.authToken,"onError-event":this.handleErrorEvent})}static get watchers(){return{disputeId:["propChanged"],authToken:["propChanged"]}}};export{m as justifi_dispute_management}
@@ -1 +1 @@
1
- import{r as s,c as i,h as t,H as e}from"./p-2783e363.js";import{a as o,C as h}from"./p-14c91ffd.js";import{m as n,b as r,c as a,d}from"./p-f2f2e20e.js";import{B as c,a as u,D as p}from"./p-865733bc.js";import"./p-7c31ec70.js";import"./p-56f6ce4c.js";import"./p-9894484a.js";import"./p-01d4e35a.js";import"./p-61f0a2ce.js";import{c as f,e as l,F as b}from"./p-5844a0f0.js";import{A as m,c as v}from"./p-2d801915.js";import{h as g}from"./p-d8c04275.js";import"./p-275f2154.js";import{a as k,B as y}from"./p-73f9be7c.js";import{B as j}from"./p-298e290e.js";import"./p-8115b2f4.js";import"./p-2ca5b5e4.js";import"./p-abdbcd8e.js";import"./p-1ff8810b.js";import"./p-6078a370.js";const w=class{constructor(t){s(this,t),this.errorEvent=i(this,"error-event",7),this.getBusiness=void 0,this.patchBusiness=void 0,this.authToken=void 0,this.businessId=void 0,this.allowOptionalFields=void 0}propChanged(){this.initializeApi()}async validateAndSubmit({onSuccess:s}){this.coreComponent.validateAndSubmit({onSuccess:s})}componentWillLoad(){this.initializeApi()}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=n({authToken:this.authToken,businessId:this.businessId,service:new c}),this.patchBusiness=r({authToken:this.authToken,businessId:this.businessId,service:new c})):this.errorEvent.emit({message:"Missing required props",errorCode:o.MISSING_PROPS,severity:h.ERROR})}render(){return t("justifi-additional-questions-form-step-core",{key:"ecc4bb3b51a4b6cb48e38230826784c5af623d88",getBusiness:this.getBusiness,patchBusiness:this.patchBusiness,allowOptionalFields:this.allowOptionalFields,ref:s=>this.coreComponent=s})}static get watchers(){return{authToken:["propChanged"],businessId:["propChanged"]}}},_=class{constructor(t){s(this,t),this.errorEvent=i(this,"error-event",7),this.getBusiness=void 0,this.postBankAccount=void 0,this.postDocumentRecord=void 0,this.postDocument=void 0,this.authToken=void 0,this.businessId=void 0,this.allowOptionalFields=void 0}propChanged(){this.initializeApi()}async validateAndSubmit({onSuccess:s}){this.coreComponent.validateAndSubmit({onSuccess:s})}componentWillLoad(){this.initializeApi()}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=n({authToken:this.authToken,businessId:this.businessId,service:new c}),this.postBankAccount=a({authToken:this.authToken,service:new u}),this.postDocumentRecord=d({authToken:this.authToken,service:new p})):this.errorEvent.emit({message:"Missing required props",errorCode:o.MISSING_PROPS,severity:h.ERROR})}render(){return t("justifi-business-bank-account-form-step-core",{key:"e60dff98e072aeb0eb351cd746c9c05e0adf903c",businessId:this.businessId,getBusiness:this.getBusiness,postBankAccount:this.postBankAccount,postDocumentRecord:this.postDocumentRecord,allowOptionalFields:this.allowOptionalFields,ref:s=>this.coreComponent=s})}static get watchers(){return{authToken:["propChanged"],businessId:["propChanged"]}}},C=class{constructor(t){s(this,t),this.errorEvent=i(this,"error-event",7),this.getBusiness=void 0,this.patchBusiness=void 0,this.authToken=void 0,this.businessId=void 0,this.allowOptionalFields=void 0}propChanged(){this.initializeApi()}async validateAndSubmit({onSuccess:s}){this.coreComponent.validateAndSubmit({onSuccess:s})}componentWillLoad(){this.initializeApi()}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=n({authToken:this.authToken,businessId:this.businessId,service:new c}),this.patchBusiness=r({authToken:this.authToken,businessId:this.businessId,service:new c})):this.errorEvent.emit({message:"Missing required props",errorCode:o.MISSING_PROPS,severity:h.ERROR})}render(){return t("justifi-business-core-info-form-step-core",{key:"c9f93be3e48527f5ae799cf736fc9ca86ece736c",businessId:this.businessId,getBusiness:this.getBusiness,patchBusiness:this.patchBusiness,allowOptionalFields:this.allowOptionalFields,ref:s=>this.coreComponent=s})}static get watchers(){return{authToken:["propChanged"],businessId:["propChanged"]}}},T=class{constructor(t){s(this,t),this.errorEvent=i(this,"error-event",7),this.getBusiness=void 0,this.patchBusiness=void 0,this.authToken=void 0,this.businessId=void 0,this.allowOptionalFields=void 0}propChanged(){this.initializeApi()}async validateAndSubmit({onSuccess:s}){this.coreComponent.validateAndSubmit({onSuccess:s})}componentWillLoad(){this.initializeApi()}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=n({authToken:this.authToken,businessId:this.businessId,service:new c}),this.patchBusiness=r({authToken:this.authToken,businessId:this.businessId,service:new c})):this.errorEvent.emit({message:"Missing required props",errorCode:o.MISSING_PROPS,severity:h.ERROR})}render(){return t(e,{key:"d3010f8f811d93d7ee0983e92aa3c87a1fab0466"},t("justifi-business-owners-form-step-core",{key:"7eed1a3ebda94badba81f22011efbb23cee7bf12",authToken:this.authToken,businessId:this.businessId,getBusiness:this.getBusiness,patchBusiness:this.patchBusiness,allowOptionalFields:this.allowOptionalFields,ref:s=>this.coreComponent=s}))}static get watchers(){return{authToken:["propChanged"],businessId:["propChanged"]}}},I=class{constructor(t){s(this,t),this.errorEvent=i(this,"error-event",7),this.getBusiness=void 0,this.patchBusiness=void 0,this.authToken=void 0,this.businessId=void 0,this.allowOptionalFields=void 0}propChanged(){this.initializeApi()}async validateAndSubmit({onSuccess:s}){this.coreComponent.validateAndSubmit({onSuccess:s})}componentWillLoad(){this.initializeApi()}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=n({authToken:this.authToken,businessId:this.businessId,service:new c}),this.patchBusiness=r({authToken:this.authToken,businessId:this.businessId,service:new c})):this.errorEvent.emit({message:"Missing required props",errorCode:o.MISSING_PROPS,severity:h.ERROR})}render(){return t("justifi-business-representative-form-step-core",{key:"1a7dc9bc4901d5a2bb3da7a06c63952ee45b7843",getBusiness:this.getBusiness,patchBusiness:this.patchBusiness,allowOptionalFields:this.allowOptionalFields,ref:s=>this.coreComponent=s})}static get watchers(){return{authToken:["propChanged"],businessId:["propChanged"]}}},S=class{constructor(t){s(this,t),this.stepCompleteEvent=i(this,"complete-form-step-event",7),this.errorEvent=i(this,"error-event",7),this.formLoading=i(this,"formLoading",7),this.formCompleted=i(this,"formCompleted",7),this.fetchData=async()=>{this.formLoading.emit(!0);try{const s=await this.api.get(this.businessEndpoint);this.acceptedTermsBefore=s.data.terms_conditions_accepted}catch(s){this.errorEvent.emit({errorCode:o.FETCH_ERROR,message:s.message,severity:h.ERROR,data:s})}finally{this.formLoading.emit(!1)}},this.sendData=async s=>{this.formLoading.emit(!0);try{const i=this.termsPayload,t=await this.api.post(this.termsConditionsEndpoint,i);this.handleResponse(t,s)}catch(s){this.errorEvent.emit({errorCode:o.POST_ERROR,message:s.message,severity:h.ERROR,data:s})}finally{this.formLoading.emit(!1)}},this.inputHandler=(s,i)=>{this.acceptedTerms=i,this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[s]:i}))},this.formController=void 0,this.errors={},this.acceptedTermsBefore=void 0,this.acceptedTerms=void 0,this.authToken=void 0,this.businessId=void 0,this.allowOptionalFields=void 0}get businessEndpoint(){return`entities/business/${this.businessId}`}get termsConditionsEndpoint(){return"entities/terms_and_conditions"}get formHelperText(){return this.acceptedTermsBefore?"You have already accepted the terms and conditions.":null}get termsPayload(){return{business_id:this.businessId,accepted:this.formController.values.getValue().accepted,user_agent:window.navigator.userAgent}}async componentWillLoad(){this.api=m({authToken:this.authToken,apiOrigin:v.proxyApiOrigin}),this.formController=new b((s=>{const i=f({accepted:l().oneOf([!0],"You must agree to the terms and conditions to continue").required("You must agree to the terms and conditions to continue")}),t=f({accepted:l().nullable()});return s?t:i})(this.allowOptionalFields)),this.businessId&&this.authToken&&this.fetchData()}handleResponse(s,i){s.error?this.errorEvent.emit({errorCode:o.POST_ERROR,message:s.error.message,severity:h.ERROR,data:s.error}):i(),this.stepCompleteEvent.emit({response:s,formStep:k.termsAndConditions}),this.formCompleted.emit()}async validateAndSubmit({onSuccess:s}){this.acceptedTermsBefore?(this.stepCompleteEvent.emit({response:null,formStep:k.termsAndConditions,metadata:"no data submitted"}),this.formCompleted.emit(),s()):this.formController.validateAndSubmit((()=>this.sendData(s)))}componentDidLoad(){this.formController.errors.subscribe((s=>{this.errors=Object.assign({},s)}))}get merchantAgreementLink(){return t("a",{href:"https://justifi.tech/merchant-agreement/",target:"_blank",rel:"noopener noreferrer"},"merchant agreement")}render(){return t("form",{key:"643d1122e14cb32e62e4406c7a375d196ce310e9"},t("fieldset",{key:"a002f8bfa7d35b840cf01f5381e1895af3744810"},t("legend",{key:"2ec353fe730c33c0dc2a103ef08666790343eba7",part:g},"Terms and Conditions"),t("hr",{key:"ae538e42c49040ca41a83e9ff8664db89ae5bb03"}),t("div",{key:"2887706d30dad94180792be4c252e20cbf03cef6"},t("p",{key:"b1c3a9322ce96ac5265a50da6997228fe1666e9b"},"Please read and accept the ",this.merchantAgreementLink," to submit your provisioning request.")),t("br",{key:"e78c021fa44eeddb5a963cfde3e5f2fa8d5066c5"}),t("div",{key:"888a15369bea1244f338fb6062090889f6de5aa1",class:"row-gy-3"},t("div",{key:"510074fb20d80909cbe93fc44ad6918e214e8334",class:"col-12"},t("form-control-checkbox",{key:"dcaf2efb889a72335b1204b075a84ec9ff367bf5",name:"accepted",label:"I agree to the terms and conditions",inputHandler:this.inputHandler,errorText:this.errors.accepted,disabled:this.acceptedTermsBefore,helpText:this.formHelperText,checked:this.acceptedTerms})))))}},B=class{constructor(t){s(this,t),this.errorEvent=i(this,"error-event",7),this.getBusiness=void 0,this.patchBusiness=void 0,this.authToken=void 0,this.businessId=void 0,this.allowOptionalFields=void 0}propChanged(){this.initializeApi()}async validateAndSubmit({onSuccess:s}){this.coreComponent.validateAndSubmit({onSuccess:s})}componentWillLoad(){this.initializeApi()}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=n({authToken:this.authToken,businessId:this.businessId,service:new c}),this.patchBusiness=r({authToken:this.authToken,businessId:this.businessId,service:new c})):this.errorEvent.emit({message:"Missing required props",errorCode:o.MISSING_PROPS,severity:h.ERROR})}render(){return t("justifi-legal-address-form-step-core",{key:"70241ec94d2519d675e3831dfb13840e0f9ea6ca",getBusiness:this.getBusiness,patchBusiness:this.patchBusiness,allowOptionalFields:this.allowOptionalFields,ref:s=>this.coreComponent=s})}static get watchers(){return{authToken:["propChanged"],businessId:["propChanged"]}}},O=class{constructor(i){s(this,i),this.currentStep=void 0,this.totalSteps=void 0,this.formLoading=void 0,this.formDisabled=void 0,this.previousStepButtonOnClick=void 0,this.nextStepButtonOnClick=void 0}get showPreviousStepButton(){return this.currentStep>0}get showNextStepButton(){return this.currentStep<this.totalSteps}get showSubmitButton(){return this.currentStep===this.totalSteps}render(){return t("div",{key:"f5b14768cd97673e77c1ee2d9d73221cdee885e6",class:"d-flex gap-2"},t(j,{key:"4726571002718d036c292a41dc216955ba5ec687",variant:"secondary",type:"button",onClick:()=>this.previousStepButtonOnClick(),disabled:this.formDisabled,hidden:!this.showPreviousStepButton},"Previous"),t(j,{key:"3852cfcd4704f5509f22a5c457526fe8475df096",variant:"primary",type:"button",onClick:s=>this.nextStepButtonOnClick(s,y.nextStep),disabled:this.formDisabled,isLoading:this.formLoading,hidden:!this.showNextStepButton},"Next"),t(j,{key:"d62830b61932581071a1a44d872760be0823215a",variant:"primary",type:"submit",onClick:s=>this.nextStepButtonOnClick(s,y.submit),disabled:this.formDisabled,isLoading:this.formLoading,hidden:!this.showSubmitButton},"Submit"))}},A=class{constructor(i){s(this,i),this.componentStepMapping={0:()=>t("justifi-business-core-info-form-step",{businessId:this.businessId,authToken:this.authToken,ref:s=>this.refs[0]=s,allowOptionalFields:this.allowOptionalFields}),1:()=>t("justifi-legal-address-form-step",{businessId:this.businessId,authToken:this.authToken,ref:s=>this.refs[1]=s,allowOptionalFields:this.allowOptionalFields}),2:()=>t("justifi-additional-questions-form-step",{businessId:this.businessId,authToken:this.authToken,ref:s=>this.refs[2]=s,allowOptionalFields:this.allowOptionalFields}),3:()=>t("justifi-business-representative-form-step",{businessId:this.businessId,authToken:this.authToken,ref:s=>this.refs[3]=s,allowOptionalFields:this.allowOptionalFields}),4:()=>t("justifi-business-owners-form-step",{businessId:this.businessId,authToken:this.authToken,ref:s=>this.refs[4]=s,allowOptionalFields:this.allowOptionalFields}),5:()=>t("justifi-business-bank-account-form-step",{businessId:this.businessId,authToken:this.authToken,ref:s=>this.refs[5]=s,allowOptionalFields:this.allowOptionalFields}),6:()=>t("justifi-business-terms-conditions-form-step",{businessId:this.businessId,authToken:this.authToken,ref:s=>this.refs[6]=s,onFormLoading:this.handleFormLoading,allowOptionalFields:this.allowOptionalFields})},this.businessId=void 0,this.authToken=void 0,this.refs=void 0,this.currentStep=void 0,this.allowOptionalFields=!1,this.handleFormLoading=void 0}get currentStepComponent(){return this.componentStepMapping[this.currentStep]()}render(){return t("div",{key:"a83b5ef4442783fe771eef6d6418c97aa0a9026d",class:"col-12 mb-4"},this.currentStepComponent)}};export{w as justifi_additional_questions_form_step,_ as justifi_business_bank_account_form_step,C as justifi_business_core_info_form_step,T as justifi_business_owners_form_step,I as justifi_business_representative_form_step,S as justifi_business_terms_conditions_form_step,B as justifi_legal_address_form_step,O as justifi_payment_provisioning_form_buttons,A as justifi_payment_provisioning_form_steps}
1
+ import{r as s,c as i,h as t,H as e}from"./p-2783e363.js";import{a as o,C as h}from"./p-14c91ffd.js";import{m as n,b as r,c as a,d}from"./p-f2f2e20e.js";import{B as c,a as u,D as p}from"./p-35b00a0d.js";import"./p-7c31ec70.js";import"./p-56f6ce4c.js";import"./p-9894484a.js";import"./p-01d4e35a.js";import"./p-61f0a2ce.js";import{c as f,e as l,F as b}from"./p-5844a0f0.js";import{A as m,c as v}from"./p-4bad3621.js";import{h as g}from"./p-d8c04275.js";import"./p-275f2154.js";import{a as k,B as y}from"./p-73f9be7c.js";import{B as j}from"./p-298e290e.js";import"./p-8115b2f4.js";import"./p-2ca5b5e4.js";import"./p-abdbcd8e.js";import"./p-1ff8810b.js";import"./p-6078a370.js";const w=class{constructor(t){s(this,t),this.errorEvent=i(this,"error-event",7),this.getBusiness=void 0,this.patchBusiness=void 0,this.authToken=void 0,this.businessId=void 0,this.allowOptionalFields=void 0}propChanged(){this.initializeApi()}async validateAndSubmit({onSuccess:s}){this.coreComponent.validateAndSubmit({onSuccess:s})}componentWillLoad(){this.initializeApi()}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=n({authToken:this.authToken,businessId:this.businessId,service:new c}),this.patchBusiness=r({authToken:this.authToken,businessId:this.businessId,service:new c})):this.errorEvent.emit({message:"Missing required props",errorCode:o.MISSING_PROPS,severity:h.ERROR})}render(){return t("justifi-additional-questions-form-step-core",{key:"ecc4bb3b51a4b6cb48e38230826784c5af623d88",getBusiness:this.getBusiness,patchBusiness:this.patchBusiness,allowOptionalFields:this.allowOptionalFields,ref:s=>this.coreComponent=s})}static get watchers(){return{authToken:["propChanged"],businessId:["propChanged"]}}},_=class{constructor(t){s(this,t),this.errorEvent=i(this,"error-event",7),this.getBusiness=void 0,this.postBankAccount=void 0,this.postDocumentRecord=void 0,this.postDocument=void 0,this.authToken=void 0,this.businessId=void 0,this.allowOptionalFields=void 0}propChanged(){this.initializeApi()}async validateAndSubmit({onSuccess:s}){this.coreComponent.validateAndSubmit({onSuccess:s})}componentWillLoad(){this.initializeApi()}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=n({authToken:this.authToken,businessId:this.businessId,service:new c}),this.postBankAccount=a({authToken:this.authToken,service:new u}),this.postDocumentRecord=d({authToken:this.authToken,service:new p})):this.errorEvent.emit({message:"Missing required props",errorCode:o.MISSING_PROPS,severity:h.ERROR})}render(){return t("justifi-business-bank-account-form-step-core",{key:"e60dff98e072aeb0eb351cd746c9c05e0adf903c",businessId:this.businessId,getBusiness:this.getBusiness,postBankAccount:this.postBankAccount,postDocumentRecord:this.postDocumentRecord,allowOptionalFields:this.allowOptionalFields,ref:s=>this.coreComponent=s})}static get watchers(){return{authToken:["propChanged"],businessId:["propChanged"]}}},C=class{constructor(t){s(this,t),this.errorEvent=i(this,"error-event",7),this.getBusiness=void 0,this.patchBusiness=void 0,this.authToken=void 0,this.businessId=void 0,this.allowOptionalFields=void 0}propChanged(){this.initializeApi()}async validateAndSubmit({onSuccess:s}){this.coreComponent.validateAndSubmit({onSuccess:s})}componentWillLoad(){this.initializeApi()}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=n({authToken:this.authToken,businessId:this.businessId,service:new c}),this.patchBusiness=r({authToken:this.authToken,businessId:this.businessId,service:new c})):this.errorEvent.emit({message:"Missing required props",errorCode:o.MISSING_PROPS,severity:h.ERROR})}render(){return t("justifi-business-core-info-form-step-core",{key:"c9f93be3e48527f5ae799cf736fc9ca86ece736c",businessId:this.businessId,getBusiness:this.getBusiness,patchBusiness:this.patchBusiness,allowOptionalFields:this.allowOptionalFields,ref:s=>this.coreComponent=s})}static get watchers(){return{authToken:["propChanged"],businessId:["propChanged"]}}},T=class{constructor(t){s(this,t),this.errorEvent=i(this,"error-event",7),this.getBusiness=void 0,this.patchBusiness=void 0,this.authToken=void 0,this.businessId=void 0,this.allowOptionalFields=void 0}propChanged(){this.initializeApi()}async validateAndSubmit({onSuccess:s}){this.coreComponent.validateAndSubmit({onSuccess:s})}componentWillLoad(){this.initializeApi()}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=n({authToken:this.authToken,businessId:this.businessId,service:new c}),this.patchBusiness=r({authToken:this.authToken,businessId:this.businessId,service:new c})):this.errorEvent.emit({message:"Missing required props",errorCode:o.MISSING_PROPS,severity:h.ERROR})}render(){return t(e,{key:"d3010f8f811d93d7ee0983e92aa3c87a1fab0466"},t("justifi-business-owners-form-step-core",{key:"7eed1a3ebda94badba81f22011efbb23cee7bf12",authToken:this.authToken,businessId:this.businessId,getBusiness:this.getBusiness,patchBusiness:this.patchBusiness,allowOptionalFields:this.allowOptionalFields,ref:s=>this.coreComponent=s}))}static get watchers(){return{authToken:["propChanged"],businessId:["propChanged"]}}},I=class{constructor(t){s(this,t),this.errorEvent=i(this,"error-event",7),this.getBusiness=void 0,this.patchBusiness=void 0,this.authToken=void 0,this.businessId=void 0,this.allowOptionalFields=void 0}propChanged(){this.initializeApi()}async validateAndSubmit({onSuccess:s}){this.coreComponent.validateAndSubmit({onSuccess:s})}componentWillLoad(){this.initializeApi()}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=n({authToken:this.authToken,businessId:this.businessId,service:new c}),this.patchBusiness=r({authToken:this.authToken,businessId:this.businessId,service:new c})):this.errorEvent.emit({message:"Missing required props",errorCode:o.MISSING_PROPS,severity:h.ERROR})}render(){return t("justifi-business-representative-form-step-core",{key:"1a7dc9bc4901d5a2bb3da7a06c63952ee45b7843",getBusiness:this.getBusiness,patchBusiness:this.patchBusiness,allowOptionalFields:this.allowOptionalFields,ref:s=>this.coreComponent=s})}static get watchers(){return{authToken:["propChanged"],businessId:["propChanged"]}}},S=class{constructor(t){s(this,t),this.stepCompleteEvent=i(this,"complete-form-step-event",7),this.errorEvent=i(this,"error-event",7),this.formLoading=i(this,"formLoading",7),this.formCompleted=i(this,"formCompleted",7),this.fetchData=async()=>{this.formLoading.emit(!0);try{const s=await this.api.get(this.businessEndpoint);this.acceptedTermsBefore=s.data.terms_conditions_accepted}catch(s){this.errorEvent.emit({errorCode:o.FETCH_ERROR,message:s.message,severity:h.ERROR,data:s})}finally{this.formLoading.emit(!1)}},this.sendData=async s=>{this.formLoading.emit(!0);try{const i=this.termsPayload,t=await this.api.post(this.termsConditionsEndpoint,i);this.handleResponse(t,s)}catch(s){this.errorEvent.emit({errorCode:o.POST_ERROR,message:s.message,severity:h.ERROR,data:s})}finally{this.formLoading.emit(!1)}},this.inputHandler=(s,i)=>{this.acceptedTerms=i,this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[s]:i}))},this.formController=void 0,this.errors={},this.acceptedTermsBefore=void 0,this.acceptedTerms=void 0,this.authToken=void 0,this.businessId=void 0,this.allowOptionalFields=void 0}get businessEndpoint(){return`entities/business/${this.businessId}`}get termsConditionsEndpoint(){return"entities/terms_and_conditions"}get formHelperText(){return this.acceptedTermsBefore?"You have already accepted the terms and conditions.":null}get termsPayload(){return{business_id:this.businessId,accepted:this.formController.values.getValue().accepted,user_agent:window.navigator.userAgent}}async componentWillLoad(){this.api=m({authToken:this.authToken,apiOrigin:v.proxyApiOrigin}),this.formController=new b((s=>{const i=f({accepted:l().oneOf([!0],"You must agree to the terms and conditions to continue").required("You must agree to the terms and conditions to continue")}),t=f({accepted:l().nullable()});return s?t:i})(this.allowOptionalFields)),this.businessId&&this.authToken&&this.fetchData()}handleResponse(s,i){s.error?this.errorEvent.emit({errorCode:o.POST_ERROR,message:s.error.message,severity:h.ERROR,data:s.error}):i(),this.stepCompleteEvent.emit({response:s,formStep:k.termsAndConditions}),this.formCompleted.emit()}async validateAndSubmit({onSuccess:s}){this.acceptedTermsBefore?(this.stepCompleteEvent.emit({response:null,formStep:k.termsAndConditions,metadata:"no data submitted"}),this.formCompleted.emit(),s()):this.formController.validateAndSubmit((()=>this.sendData(s)))}componentDidLoad(){this.formController.errors.subscribe((s=>{this.errors=Object.assign({},s)}))}get merchantAgreementLink(){return t("a",{href:"https://justifi.tech/merchant-agreement/",target:"_blank",rel:"noopener noreferrer"},"merchant agreement")}render(){return t("form",{key:"643d1122e14cb32e62e4406c7a375d196ce310e9"},t("fieldset",{key:"a002f8bfa7d35b840cf01f5381e1895af3744810"},t("legend",{key:"2ec353fe730c33c0dc2a103ef08666790343eba7",part:g},"Terms and Conditions"),t("hr",{key:"ae538e42c49040ca41a83e9ff8664db89ae5bb03"}),t("div",{key:"2887706d30dad94180792be4c252e20cbf03cef6"},t("p",{key:"b1c3a9322ce96ac5265a50da6997228fe1666e9b"},"Please read and accept the ",this.merchantAgreementLink," to submit your provisioning request.")),t("br",{key:"e78c021fa44eeddb5a963cfde3e5f2fa8d5066c5"}),t("div",{key:"888a15369bea1244f338fb6062090889f6de5aa1",class:"row-gy-3"},t("div",{key:"510074fb20d80909cbe93fc44ad6918e214e8334",class:"col-12"},t("form-control-checkbox",{key:"dcaf2efb889a72335b1204b075a84ec9ff367bf5",name:"accepted",label:"I agree to the terms and conditions",inputHandler:this.inputHandler,errorText:this.errors.accepted,disabled:this.acceptedTermsBefore,helpText:this.formHelperText,checked:this.acceptedTerms})))))}},B=class{constructor(t){s(this,t),this.errorEvent=i(this,"error-event",7),this.getBusiness=void 0,this.patchBusiness=void 0,this.authToken=void 0,this.businessId=void 0,this.allowOptionalFields=void 0}propChanged(){this.initializeApi()}async validateAndSubmit({onSuccess:s}){this.coreComponent.validateAndSubmit({onSuccess:s})}componentWillLoad(){this.initializeApi()}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=n({authToken:this.authToken,businessId:this.businessId,service:new c}),this.patchBusiness=r({authToken:this.authToken,businessId:this.businessId,service:new c})):this.errorEvent.emit({message:"Missing required props",errorCode:o.MISSING_PROPS,severity:h.ERROR})}render(){return t("justifi-legal-address-form-step-core",{key:"70241ec94d2519d675e3831dfb13840e0f9ea6ca",getBusiness:this.getBusiness,patchBusiness:this.patchBusiness,allowOptionalFields:this.allowOptionalFields,ref:s=>this.coreComponent=s})}static get watchers(){return{authToken:["propChanged"],businessId:["propChanged"]}}},O=class{constructor(i){s(this,i),this.currentStep=void 0,this.totalSteps=void 0,this.formLoading=void 0,this.formDisabled=void 0,this.previousStepButtonOnClick=void 0,this.nextStepButtonOnClick=void 0}get showPreviousStepButton(){return this.currentStep>0}get showNextStepButton(){return this.currentStep<this.totalSteps}get showSubmitButton(){return this.currentStep===this.totalSteps}render(){return t("div",{key:"f5b14768cd97673e77c1ee2d9d73221cdee885e6",class:"d-flex gap-2"},t(j,{key:"4726571002718d036c292a41dc216955ba5ec687",variant:"secondary",type:"button",onClick:()=>this.previousStepButtonOnClick(),disabled:this.formDisabled,hidden:!this.showPreviousStepButton},"Previous"),t(j,{key:"3852cfcd4704f5509f22a5c457526fe8475df096",variant:"primary",type:"button",onClick:s=>this.nextStepButtonOnClick(s,y.nextStep),disabled:this.formDisabled,isLoading:this.formLoading,hidden:!this.showNextStepButton},"Next"),t(j,{key:"d62830b61932581071a1a44d872760be0823215a",variant:"primary",type:"submit",onClick:s=>this.nextStepButtonOnClick(s,y.submit),disabled:this.formDisabled,isLoading:this.formLoading,hidden:!this.showSubmitButton},"Submit"))}},A=class{constructor(i){s(this,i),this.componentStepMapping={0:()=>t("justifi-business-core-info-form-step",{businessId:this.businessId,authToken:this.authToken,ref:s=>this.refs[0]=s,allowOptionalFields:this.allowOptionalFields}),1:()=>t("justifi-legal-address-form-step",{businessId:this.businessId,authToken:this.authToken,ref:s=>this.refs[1]=s,allowOptionalFields:this.allowOptionalFields}),2:()=>t("justifi-additional-questions-form-step",{businessId:this.businessId,authToken:this.authToken,ref:s=>this.refs[2]=s,allowOptionalFields:this.allowOptionalFields}),3:()=>t("justifi-business-representative-form-step",{businessId:this.businessId,authToken:this.authToken,ref:s=>this.refs[3]=s,allowOptionalFields:this.allowOptionalFields}),4:()=>t("justifi-business-owners-form-step",{businessId:this.businessId,authToken:this.authToken,ref:s=>this.refs[4]=s,allowOptionalFields:this.allowOptionalFields}),5:()=>t("justifi-business-bank-account-form-step",{businessId:this.businessId,authToken:this.authToken,ref:s=>this.refs[5]=s,allowOptionalFields:this.allowOptionalFields}),6:()=>t("justifi-business-terms-conditions-form-step",{businessId:this.businessId,authToken:this.authToken,ref:s=>this.refs[6]=s,onFormLoading:this.handleFormLoading,allowOptionalFields:this.allowOptionalFields})},this.businessId=void 0,this.authToken=void 0,this.refs=void 0,this.currentStep=void 0,this.allowOptionalFields=!1,this.handleFormLoading=void 0}get currentStepComponent(){return this.componentStepMapping[this.currentStep]()}render(){return t("div",{key:"a83b5ef4442783fe771eef6d6418c97aa0a9026d",class:"col-12 mb-4"},this.currentStepComponent)}};export{w as justifi_additional_questions_form_step,_ as justifi_business_bank_account_form_step,C as justifi_business_core_info_form_step,T as justifi_business_owners_form_step,I as justifi_business_representative_form_step,S as justifi_business_terms_conditions_form_step,B as justifi_legal_address_form_step,O as justifi_payment_provisioning_form_buttons,A as justifi_payment_provisioning_form_steps}
@@ -1 +1 @@
1
- import{c as e,a as t}from"./p-5844a0f0.js";import{l as a,k as n,m as s,n as r,q as o,u as i,v as l,e as c,p as d,x as m,y as p}from"./p-de13f23c.js";const u=i=>{const l=e({line1:a.required("Enter street address"),line2:n.nullable(),city:s.required("Enter city"),state:r.required("Select state"),postal_code:o.required("Enter postal code"),country:t().required("Select country")}),c=e({line1:a.nullable(),line2:n.nullable(),city:s.nullable(),state:r.nullable(),postal_code:o.nullable(),country:t().required("Select country")});return i?c:l},f=(a,n)=>{const s=e({name:i.required(`Enter ${a} name`),title:l.required(`Enter ${a} title`),email:c.required(`Enter ${a} email`),phone:d.required("Enter phone number"),dob_full:m(a).required("Enter date of birth"),ssn_last4:t().nullable(),identification_number:p,address:u(n)}),r=e({name:i.required(`Enter ${a} name`),title:l.nullable(),email:c.nullable(),phone:d.nullable(),dob_full:m(a).nullable(),ssn_last4:t().nullable(),identification_number:p.nullable(),address:u(n)});return n?r:s};export{u as a,f as i}
1
+ import{c as e,a as t}from"./p-5844a0f0.js";import{l as a,k as n,m as s,n as r,q as o,u as i,v as l,e as c,p as m,x as d,y as p}from"./p-27c8ffa2.js";const u=i=>{const l=e({line1:a.required("Enter street address"),line2:n.nullable(),city:s.required("Enter city"),state:r.required("Select state"),postal_code:o.required("Enter postal code"),country:t().required("Select country")}),c=e({line1:a.nullable(),line2:n.nullable(),city:s.nullable(),state:r.nullable(),postal_code:o.nullable(),country:t().required("Select country")});return i?c:l},f=(a,n)=>{const s=e({name:i.required(`Enter ${a} name`),title:l.required(`Enter ${a} title`),email:c.required(`Enter ${a} email`),phone:m.required("Enter phone number"),dob_full:d(a).required("Enter date of birth"),ssn_last4:t().nullable(),identification_number:p,address:u(n)}),r=e({name:i.required(`Enter ${a} name`),title:l.nullable(),email:c.nullable(),phone:m.nullable(),dob_full:d(a).nullable(),ssn_last4:t().nullable(),identification_number:p.nullable(),address:u(n)});return n?r:s};export{u as a,f as i}
@@ -1 +1 @@
1
- import{p as t}from"./p-c845cb7a.js";import{A as s,c as i}from"./p-2d801915.js";class e{async record(t){return s({apiOrigin:i.proxyApiOrigin}).post("analytics",t)}}class a{constructor(t){this.handleCustomEvent=async t=>{await this.service.record(t)},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.forEach((t=>{this.componentInstance.removeEventListener(t,this.handleCustomEvent)}))}}const n=async()=>{const s=t.version,i=t.name,e=await(async t=>{const s=await fetch("https://registry.npmjs.org/"+t+"/latest");return(await s.json()).version})(i),a=e.replace(/-rc.*/,""),n=s.split("."),r=e.split(".");n[0]!==r[0]&&console.warn(`The package ${i} is out of date. The latest version is ${a}. Please update.`)};export{a as J,n as c}
1
+ import{p as t}from"./p-b2edb944.js";import{A as s,c as i}from"./p-4bad3621.js";class e{async record(t){return s({apiOrigin:i.proxyApiOrigin}).post("analytics",t)}}class a{constructor(t){this.handleCustomEvent=async t=>{await this.service.record(t)},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.forEach((t=>{this.componentInstance.removeEventListener(t,this.handleCustomEvent)}))}}const n=async()=>{const s=t.version,i=t.name,e=await(async t=>{const s=await fetch("https://registry.npmjs.org/"+t+"/latest");return(await s.json()).version})(i),a=e.replace(/-rc.*/,""),n=s.split("."),r=e.split(".");n[0]!==r[0]&&console.warn(`The package ${i} is out of date. The latest version is ${a}. Please update.`)};export{a as J,n as c}
@@ -1 +1 @@
1
- import{A as s,c as e}from"./p-2d801915.js";import"./p-14c91ffd.js";import"./p-7c31ec70.js";import"./p-56f6ce4c.js";import"./p-9894484a.js";import"./p-01d4e35a.js";import"./p-61f0a2ce.js";class p{async fetchDispute(p,t){const i=`disputes/${p}`;return s({authToken:t,apiOrigin:e.proxyApiOrigin}).get(i)}async updateDisputeResponse(p,t,i){const n=`disputes/${p}/response`;return s({authToken:t,apiOrigin:e.proxyApiOrigin}).patch(n,i)}async submitDisputeResponse(p,t,i){const n=`disputes/${p}/response`;return s({authToken:t,apiOrigin:e.proxyApiOrigin}).post(n,i)}async createDisputeEvidence(p,t,i){const n=`disputes/${p}/evidence`;return s({authToken:t,apiOrigin:e.proxyApiOrigin}).put(n,i)}}export{p as D}
1
+ import{A as s,c as e}from"./p-4bad3621.js";import"./p-14c91ffd.js";import"./p-7c31ec70.js";import"./p-56f6ce4c.js";import"./p-9894484a.js";import"./p-01d4e35a.js";import"./p-61f0a2ce.js";class p{async fetchDispute(p,t){const i=`disputes/${p}`;return s({authToken:t,apiOrigin:e.proxyApiOrigin}).get(i)}async updateDisputeResponse(p,t,i){const n=`disputes/${p}/response`;return s({authToken:t,apiOrigin:e.proxyApiOrigin}).patch(n,i)}async submitDisputeResponse(p,t,i){const n=`disputes/${p}/response`;return s({authToken:t,apiOrigin:e.proxyApiOrigin}).post(n,i)}async createDisputeEvidence(p,t,i){const n=`disputes/${p}/evidence`;return s({authToken:t,apiOrigin:e.proxyApiOrigin}).put(n,i)}}export{p as D}
@@ -1 +1 @@
1
- import{A as o,c as r}from"./p-2d801915.js";import{C as s}from"./p-14c91ffd.js";import"./p-7c31ec70.js";import"./p-56f6ce4c.js";import"./p-9894484a.js";import{S as c}from"./p-01d4e35a.js";import"./p-61f0a2ce.js";import{g as t,a}from"./p-8115b2f4.js";class n{async fetchSubAccounts(s,c,t,a){a||(a=r.proxyApiOrigin);const n={Account:s};return o({authToken:c,apiOrigin:a}).get("sub_accounts",t,null,n)}}const i=({accountId:o,authToken:r,service:n,apiOrigin:i})=>async({params:e,onSuccess:p,onError:u})=>{var m,f;try{const d=await n.fetchSubAccounts(o,r,e,i);if(d.error){return u({error:t(d.error),code:a(null===(f=d.error)||void 0===f?void 0:f.code),severity:s.ERROR})}{const o=Object.assign({},d.page_info);p({subAccounts:(null===(m=d.data)||void 0===m?void 0:m.map((o=>new c(o))))||[],pagingInfo:o})}}catch(o){const r=a(null==o?void 0:o.code);return u({error:o.message||o,code:r,severity:s.ERROR})}};export{n as S,i as m}
1
+ import{A as o,c as r}from"./p-4bad3621.js";import{C as s}from"./p-14c91ffd.js";import"./p-7c31ec70.js";import"./p-56f6ce4c.js";import"./p-9894484a.js";import{S as c}from"./p-01d4e35a.js";import"./p-61f0a2ce.js";import{g as t,a}from"./p-8115b2f4.js";class n{async fetchSubAccounts(s,c,t,a){a||(a=r.proxyApiOrigin);const n={Account:s};return o({authToken:c,apiOrigin:a}).get("sub_accounts",t,null,n)}}const i=({accountId:o,authToken:r,service:n,apiOrigin:i})=>async({params:e,onSuccess:p,onError:u})=>{var m,f;try{const d=await n.fetchSubAccounts(o,r,e,i);if(d.error){return u({error:t(d.error),code:a(null===(f=d.error)||void 0===f?void 0:f.code),severity:s.ERROR})}{const o=Object.assign({},d.page_info);p({subAccounts:(null===(m=d.data)||void 0===m?void 0:m.map((o=>new c(o))))||[],pagingInfo:o})}}catch(o){const r=a(null==o?void 0:o.code);return u({error:o.message||o,code:r,severity:s.ERROR})}};export{n as S,i as m}
@@ -0,0 +1 @@
1
+ import{r as t,c as e,h as i}from"./p-2783e363.js";import{C as s,a as o}from"./p-14c91ffd.js";import{g as r,a as c}from"./p-8115b2f4.js";import{C as a}from"./p-fdbcd486.js";import{c as h,J as d}from"./p-933537ca.js";import{c as n}from"./p-4bad3621.js";import"./p-7c31ec70.js";import"./p-2ca5b5e4.js";import"./p-56f6ce4c.js";import"./p-9894484a.js";import"./p-abdbcd8e.js";import"./p-01d4e35a.js";import"./p-61f0a2ce.js";import"./p-b2edb944.js";const p=class{constructor(i){t(this,i),this.errorEvent=e(this,"error-event",7),this.loadedEvent=e(this,"loaded",7),this.authToken=void 0,this.checkoutId=void 0,this.disableCreditCard=void 0,this.disableBankAccount=void 0,this.disableBnpl=void 0,this.disablePaymentMethodGroup=void 0,this.hideCardBillingForm=void 0,this.iframeOrigin=n.iFrameOrigin,this.getCheckout=void 0,this.complete=void 0,this.errorMessage=""}componentWillLoad(){h(),this.analytics=new d(this),this.initializeGetCheckout()}disconnectedCallback(){this.analytics.cleanup()}initializeGetCheckout(){this.authToken&&this.checkoutId?(this.getCheckout=(({authToken:t,checkoutId:e,service:i})=>async({onSuccess:o,onError:a})=>{var h;try{const d=await i.fetchCheckout(t,e);if(d.error)return a({error:r(d.error),code:c(null===(h=d.error)||void 0===h?void 0:h.code),severity:s.ERROR});o({checkout:d.data})}catch(t){const e=c(null==t?void 0:t.code);return a({error:t.message||t,code:e,severity:s.ERROR})}})({authToken:this.authToken,checkoutId:this.checkoutId,service:new a}),this.complete=(({authToken:t,checkoutId:e,service:i})=>async({payment:o,onSuccess:a,onError:h})=>{var d;try{const n=await i.complete(t,e,o);if(n.error)return h({error:r(n.error),code:c(null===(d=n.error)||void 0===d?void 0:d.code),severity:s.ERROR});a(n)}catch(t){const e=c(null==t?void 0:t.code);return h({error:t.message||t,code:e,severity:s.ERROR})}})({authToken:this.authToken,checkoutId:this.checkoutId,service:new a})):this.errorEvent.emit({message:"auth-token and checkout-id are required",errorCode:o.MISSING_PROPS,severity:s.ERROR})}propChanged(){this.initializeGetCheckout()}async fillBillingForm(t){this.checkoutCoreRef.fillBillingForm(t)}render(){return i("justifi-checkout-core",{key:"911e807dc0be670c6bfe59e497cacd5399481981",getCheckout:this.getCheckout,authToken:this.authToken,complete:this.complete,disableCreditCard:this.disableCreditCard,disableBankAccount:this.disableBankAccount,disableBnpl:this.disableBnpl,disablePaymentMethodGroup:this.disablePaymentMethodGroup,hideCardBillingForm:this.hideCardBillingForm,iframeOrigin:this.iframeOrigin,ref:t=>{t&&(this.checkoutCoreRef=t)}},i("div",{key:"29bcfd776e4dac5a7686a03488d0f8dad2d01a03",slot:"insurance"},i("slot",{key:"993b8872e8a40dd5111ccaeb586686a396eab2ff",name:"insurance"})))}static get watchers(){return{authToken:["propChanged"],checkoutId:["propChanged"]}}};export{p as justifi_checkout}
@@ -0,0 +1 @@
1
+ import{r as i,c as s,h as t}from"./p-2783e363.js";import{B as e}from"./p-298e290e.js";import{S as a}from"./p-bfe9748b.js";import{c as o,J as r}from"./p-933537ca.js";import{c as d}from"./p-4bad3621.js";import{C as c,a as h}from"./p-14c91ffd.js";import"./p-7c31ec70.js";import"./p-56f6ce4c.js";import"./p-9894484a.js";import"./p-01d4e35a.js";import"./p-61f0a2ce.js";import"./p-d8c04275.js";import"./p-b2edb944.js";import"./p-2ca5b5e4.js";import"./p-abdbcd8e.js";const f=class{constructor(t){i(this,t),this.errorEvent=s(this,"error-event",7),this.submitEvent=s(this,"submit-event",7),this.authToken=void 0,this.accountId=void 0,this.paymentMethodGroupId=void 0,this.submitButtonText=void 0,this.disableCreditCard=void 0,this.disableBankAccount=void 0,this.hideSubmitButton=void 0,this.hideCardBillingForm=void 0,this.iframeOrigin=d.iFrameOrigin,this.isLoading=!1}componentWillLoad(){o(),this.analytics=new r(this)}async tokenizePaymentMethod(i){let s;i&&i.preventDefault(),this.isLoading=!0;try{s=await this.paymentMethodOptionsRef.resolvePaymentMethod({isValid:!0}),s.error&&this.errorEvent.emit({errorCode:s.error.code,message:s.error.message,severity:c.ERROR})}catch(i){this.errorEvent.emit({errorCode:h.TOKENIZE_ERROR,message:i.message,severity:c.ERROR})}finally{return this.submitEvent.emit({response:s}),this.isLoading=!1,s}}async fillBillingForm(i){this.paymentMethodOptionsRef.fillBillingForm(i)}render(){return t(a,{key:"f0efb2ab8f051b0b5dafcb608c9c1b561f6f21bc"},t("form",{key:"b511a1af4e15175d7bec45c66dc030e693820563"},t("fieldset",{key:"53b78e28371b6ed69140774b6b47afcee3cb7edd"},t("div",{key:"e37c7cb04912fac8bf24bae88cfd06fb00d22325",class:"row gy-3"},t("div",{key:"103ef1da7228ab3d74065ca64ea070e1520799ff",class:"col-12"},t("justifi-payment-method-options",{key:"58d614390f0dce90d1ca85b88ce888b841457753",ref:i=>this.paymentMethodOptionsRef=i,"show-card":!this.disableCreditCard,"show-ach":!this.disableBankAccount,"show-bnpl":!1,paymentMethodGroupId:this.paymentMethodGroupId,"show-saved-payment-methods":!1,hideCardBillingForm:this.hideCardBillingForm,authToken:this.authToken,"account-id":this.accountId,iframeOrigin:this.iframeOrigin})),t("div",{key:"727317ff2fafaace929f6667934a649994fe037d",class:"col-12"},t(e,{key:"999ec3e29e37ce5027f6d1c4d75bae31beba6ab1",variant:"primary",type:"submit",onClick:i=>this.tokenizePaymentMethod(i),isLoading:this.isLoading,"data-testid":"submit-button",hidden:this.hideSubmitButton},this.submitButtonText||"Submit"))))))}};export{f as justifi_tokenize_payment_method}
@@ -1 +1 @@
1
- import{c as e}from"./p-5844a0f0.js";import{b as s,w as n,e as a,p as i,d as r,a as t,i as _,t as u,c as o,r as c,f as b,g as l,h as m,j as p,s as d,o as g}from"./p-de13f23c.js";const y=c=>{const b=e({legal_name:s.required("Enter legal name"),website_url:n.required("Enter business website url"),email:a.required("Enter business email"),phone:i.required("Enter phone number"),doing_business_as:r.nullable(),classification:t.required("Select business classification"),industry:_.required("Enter a business industry"),tax_id:u.required("Enter tax id, SSN, or EIN"),date_of_incorporation:o.required("Enter date of incorporation")}),l=e({legal_name:s.required("Enter legal name"),website_url:n.nullable(),email:a.nullable(),phone:i.nullable(),doing_business_as:r.nullable(),classification:t.nullable(),industry:_.nullable(),tax_id:u.nullable(),date_of_incorporation:o.nullable()});return c?l:b},v=s=>{const n=e({business_revenue:c.required("Enter business revenue"),business_payment_volume:b.required("Enter business payment volume"),business_when_service_received:l.required("Select when service is received"),business_recurring_payments:m.required("Select recurring payments"),business_recurring_payments_percentage:p,business_seasonal:d.required("Select business seasonal"),business_other_payment_details:g.nullable()}),a=e({business_revenue:c.nullable(),business_payment_volume:b.nullable(),business_when_service_received:l.nullable(),business_recurring_payments:m.nullable(),business_recurring_payments_percentage:p,business_seasonal:d.nullable(),business_other_payment_details:g.nullable()});return s?a:n};export{v as a,y as b}
1
+ import{c as e}from"./p-5844a0f0.js";import{b as s,w as n,e as a,p as i,d as r,a as t,i as _,t as u,c as o,r as c,f as b,g as l,h as m,j as p,s as d,o as g}from"./p-27c8ffa2.js";const y=c=>{const b=e({legal_name:s.required("Enter legal name"),website_url:n.required("Enter business website url"),email:a.required("Enter business email"),phone:i.required("Enter phone number"),doing_business_as:r.nullable(),classification:t.required("Select business classification"),industry:_.required("Enter a business industry"),tax_id:u.required("Enter tax id, SSN, or EIN"),date_of_incorporation:o.required("Enter date of incorporation")}),l=e({legal_name:s.required("Enter legal name"),website_url:n.nullable(),email:a.nullable(),phone:i.nullable(),doing_business_as:r.nullable(),classification:t.nullable(),industry:_.nullable(),tax_id:u.nullable(),date_of_incorporation:o.nullable()});return c?l:b},f=s=>{const n=e({business_revenue:c.required("Enter business revenue"),business_payment_volume:b.required("Enter business payment volume"),business_when_service_received:l.required("Select when service is received"),business_recurring_payments:m.required("Select recurring payments"),business_recurring_payments_percentage:p,business_seasonal:d.required("Select business seasonal"),business_other_payment_details:g.nullable()}),a=e({business_revenue:c.nullable(),business_payment_volume:b.nullable(),business_when_service_received:l.nullable(),business_recurring_payments:m.nullable(),business_recurring_payments_percentage:p,business_seasonal:d.nullable(),business_other_payment_details:g.nullable()});return s?a:n};export{f as a,y as b}
@@ -0,0 +1 @@
1
+ import{A as t,c as a}from"./p-4bad3621.js";import"./p-14c91ffd.js";import"./p-7c31ec70.js";import"./p-56f6ce4c.js";import"./p-9894484a.js";import"./p-01d4e35a.js";import"./p-61f0a2ce.js";class p{async fetchPayments(p,s,c,e){return e||(e=a.proxyApiOrigin),t({authToken:s,apiOrigin:e}).get(`account/${p}/payments`,c)}async fetchPayment(p,s){const c=`payments/${p}`;return t({authToken:s,apiOrigin:a.proxyApiOrigin}).get(c)}}export{p as P}
@@ -1 +1 @@
1
- import{r as t,c as e,h as i}from"./p-2783e363.js";import{c as s,d as a,F as o}from"./p-5844a0f0.js";import{A as r,c as n}from"./p-2d801915.js";import"./p-14c91ffd.js";import"./p-7c31ec70.js";import"./p-56f6ce4c.js";import"./p-9894484a.js";import"./p-01d4e35a.js";import"./p-61f0a2ce.js";import{C as d}from"./p-525db3e8.js";import{S as c}from"./p-bfe9748b.js";import"./p-2ca5b5e4.js";import"./p-abdbcd8e.js";const f=s().shape({amount:a().required("Amount is required").typeError("Amount must be a number").positive("Amount must be positive").test("amount","Refund amount cannot be more than the original payment amount",(function(t){return t<=this.options.context.amount})).nullable()}),m=class{constructor(i){t(this,i),this.submitted=e(this,"submitted",7),this.authToken=void 0,this.paymentId=void 0,this.amount=0,this.submitButtonText="Submit",this.withButton=void 0,this.refundInfoText=void 0,this.errors={},this.isSubmitting=!1}componentWillLoad(){this.formController=new o(f),this.formController.setInitialValues({amount:this.amount,message:""}),this.initializeApi()}componentDidLoad(){this.formController.errors.subscribe((t=>{this.errors=Object.assign({},t)}))}async handleSubmit(t){t.preventDefault(),this.formController.validateAndSubmit(this.submitRefund.bind(this),{amount:this.amount})}async submitRefund(){this.isSubmitting=!0;const t=this.formController.values.getValue();try{await this.api.post(`payments/${this.paymentId}/refunds`,t),this.submitted.emit(t)}catch(t){console.error("Error submitting refund:",t),this.submitted.emit(t)}finally{this.isSubmitting=!1}}handleInput(t,e){this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[t]:e}))}initializeApi(){this.authToken||console.warn("Warning: Missing auth-token."),this.api=r({authToken:this.authToken,apiOrigin:n.proxyApiOrigin})}render(){var t;return i(c,{key:"21bb5742fac6f75a96b334e2806906e9d9d3a215"},i("h1",{key:"74c81b6918611e8506bcec7ad28080437a435d35"},"Refund"),this.refundInfoText&&i("div",{key:"1cd42cd6bf063fe52b35c9adeccbba366147a8a0",class:"d-flex align-items-center flex-row gap-4 border-top border-bottom my-4 p-3",role:"alert"},i("img",{key:"338b9ffd53bc98da86a0c96eceb4057c235cc524",src:"/info-icon.svg",alt:"Information",height:"30",width:"30"}),i("p",{key:"e8335bcee9ce21198a2104913b5f084e897807d4",class:"m-0",innerHTML:this.refundInfoText})),i("form",{key:"6efdd00f3a96bafb713e2d9f23a77a9cfd88dc21",onSubmit:t=>this.handleSubmit(t),class:"d-grid gap-4"},i("div",{key:"55680d454a42549b8c442f1897455cc6c0f4e973",class:"form-group"},i("form-control-monetary",{key:"c38894006ce18238f1fd7738feea4ca3c710930d",name:"amount",label:"Refund Amount",defaultValue:(null===(t=this.amount)||void 0===t?void 0:t.toString())||"",maskOptions:d.DECIMAL,inputHandler:(t,e)=>this.handleInput(t,e),errorText:this.errors.amount})),i("div",{key:"fe803d97c9b90bdb87fa99dd454859a365901688",class:"form-group"},i("form-control-text",{key:"08a129a72043547fb57ee99a1b3326dbfb03b871",name:"notes",label:"Additional Notes",inputHandler:(t,e)=>this.handleInput(t,e),errorText:this.errors.notes})),this.withButton&&i("div",{key:"08ba9b480faf93f81d5f1396bc42469735fdf46d",class:"form-group d-flex flex-row-reverse"},i("button",{key:"a07f1a85156ef80e87e9d0b5e615c1c08eebd7d2",type:"submit",disabled:!!this.isSubmitting,class:"btn btn-primary ml-auto"},this.submitButtonText))))}};export{m as justifi_refund_form}
1
+ import{r as t,c as e,h as i}from"./p-2783e363.js";import{c as s,d as a,F as o}from"./p-5844a0f0.js";import{A as r,c as n}from"./p-4bad3621.js";import"./p-14c91ffd.js";import"./p-7c31ec70.js";import"./p-56f6ce4c.js";import"./p-9894484a.js";import"./p-01d4e35a.js";import"./p-61f0a2ce.js";import{C as d}from"./p-525db3e8.js";import{S as c}from"./p-bfe9748b.js";import"./p-2ca5b5e4.js";import"./p-abdbcd8e.js";const f=s().shape({amount:a().required("Amount is required").typeError("Amount must be a number").positive("Amount must be positive").test("amount","Refund amount cannot be more than the original payment amount",(function(t){return t<=this.options.context.amount})).nullable()}),m=class{constructor(i){t(this,i),this.submitted=e(this,"submitted",7),this.authToken=void 0,this.paymentId=void 0,this.amount=0,this.submitButtonText="Submit",this.withButton=void 0,this.refundInfoText=void 0,this.errors={},this.isSubmitting=!1}componentWillLoad(){this.formController=new o(f),this.formController.setInitialValues({amount:this.amount,message:""}),this.initializeApi()}componentDidLoad(){this.formController.errors.subscribe((t=>{this.errors=Object.assign({},t)}))}async handleSubmit(t){t.preventDefault(),this.formController.validateAndSubmit(this.submitRefund.bind(this),{amount:this.amount})}async submitRefund(){this.isSubmitting=!0;const t=this.formController.values.getValue();try{await this.api.post(`payments/${this.paymentId}/refunds`,t),this.submitted.emit(t)}catch(t){console.error("Error submitting refund:",t),this.submitted.emit(t)}finally{this.isSubmitting=!1}}handleInput(t,e){this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[t]:e}))}initializeApi(){this.authToken||console.warn("Warning: Missing auth-token."),this.api=r({authToken:this.authToken,apiOrigin:n.proxyApiOrigin})}render(){var t;return i(c,{key:"21bb5742fac6f75a96b334e2806906e9d9d3a215"},i("h1",{key:"74c81b6918611e8506bcec7ad28080437a435d35"},"Refund"),this.refundInfoText&&i("div",{key:"1cd42cd6bf063fe52b35c9adeccbba366147a8a0",class:"d-flex align-items-center flex-row gap-4 border-top border-bottom my-4 p-3",role:"alert"},i("img",{key:"338b9ffd53bc98da86a0c96eceb4057c235cc524",src:"/info-icon.svg",alt:"Information",height:"30",width:"30"}),i("p",{key:"e8335bcee9ce21198a2104913b5f084e897807d4",class:"m-0",innerHTML:this.refundInfoText})),i("form",{key:"6efdd00f3a96bafb713e2d9f23a77a9cfd88dc21",onSubmit:t=>this.handleSubmit(t),class:"d-grid gap-4"},i("div",{key:"55680d454a42549b8c442f1897455cc6c0f4e973",class:"form-group"},i("form-control-monetary",{key:"c38894006ce18238f1fd7738feea4ca3c710930d",name:"amount",label:"Refund Amount",defaultValue:(null===(t=this.amount)||void 0===t?void 0:t.toString())||"",maskOptions:d.DECIMAL,inputHandler:(t,e)=>this.handleInput(t,e),errorText:this.errors.amount})),i("div",{key:"fe803d97c9b90bdb87fa99dd454859a365901688",class:"form-group"},i("form-control-text",{key:"08a129a72043547fb57ee99a1b3326dbfb03b871",name:"notes",label:"Additional Notes",inputHandler:(t,e)=>this.handleInput(t,e),errorText:this.errors.notes})),this.withButton&&i("div",{key:"08ba9b480faf93f81d5f1396bc42469735fdf46d",class:"form-group d-flex flex-row-reverse"},i("button",{key:"a07f1a85156ef80e87e9d0b5e615c1c08eebd7d2",type:"submit",disabled:!!this.isSubmitting,class:"btn btn-primary ml-auto"},this.submitButtonText))))}};export{m as justifi_refund_form}
@@ -1 +1 @@
1
- const e={name:"@justifi/webcomponents",version:"5.3.0",description:"JustiFi Web Components",collection:"dist/collection/collection-manifest.json",main:"dist/index.cjs.js",module:"dist/module/index.js",types:"dist/module/index.d.ts",repository:{type:"git",url:"git+https://github.com/justifi-tech/web-component-library.git"},homepage:"https://storybook.justifi.ai/?path=/docs/introduction--docs",publishConfig:{registry:"https://registry.npmjs.org"},files:["dist/"],scripts:{build:"stencil build --docs",dev:"stencil build --watch",lint:"eslint . --max-warnings 0",clean:"rm -rf .turbo && rm -rf node_modules && rm -rf dist",generate:"stencil generate",test:"TZ=utc stencil test --spec","test:watch":"TZ=utc stencil test --spec --watchAll","test:file":"stencil test --spec --watch --"},dependencies:{"@popperjs/core":"^2.11.8","@stencil/core":"^4.0.5","@stencil/store":"^2.0.8",bootstrap:"^5.2.3","chart.js":"^4.4.1","date-fns":"^2.30.0","dinero.js":"^1.9.1","iframe-resizer":"^4.3.7",imask:"^7.6.0",lodash:"^4.17.21",rxjs:"^7.8.1","ts-dedent":"^2.2.0",uuid:"^9.0.0",yup:"^1.0.0"},devDependencies:{"@babel/preset-env":"^7.21.5","@babel/preset-react":"^7.18.6","@babel/preset-typescript":"^7.21.5","@rollup/plugin-replace":"^6.0.1","@stencil/sass":"^3.0.1","@types/jest":"27.0.3","@types/react":"^18.0.37","@types/react-dom":"^18.0.11",dotenv:"^16.3.1",jest:"^29.7.0","jest-cli":"^29.7.0","jest-environment-node":"^29.7.0","ts-jest":"^29.1.2"},license:"MIT",gitHead:"507bac1d941eae6e1f56e185ecd9bc9d22637783"};export{e as p}
1
+ const e={name:"@justifi/webcomponents",version:"5.3.2",description:"JustiFi Web Components",collection:"dist/collection/collection-manifest.json",main:"dist/index.cjs.js",module:"dist/module/index.js",types:"dist/module/index.d.ts",repository:{type:"git",url:"git+https://github.com/justifi-tech/web-component-library.git"},homepage:"https://storybook.justifi.ai/?path=/docs/introduction--docs",publishConfig:{registry:"https://registry.npmjs.org"},files:["dist/"],scripts:{build:"stencil build --docs",dev:"stencil build --watch",lint:"eslint . --max-warnings 0",clean:"rm -rf .turbo && rm -rf node_modules && rm -rf dist",generate:"stencil generate",test:"TZ=utc stencil test --spec","test:watch":"TZ=utc stencil test --spec --watchAll","test:file":"stencil test --spec --watch --"},dependencies:{"@popperjs/core":"^2.11.8","@stencil/core":"^4.0.5","@stencil/store":"^2.0.8",bootstrap:"^5.2.3","chart.js":"^4.4.1","date-fns":"^2.30.0","dinero.js":"^1.9.1","iframe-resizer":"^4.3.7",imask:"^7.6.0",lodash:"^4.17.21",rxjs:"^7.8.1","ts-dedent":"^2.2.0",uuid:"^9.0.0",yup:"^1.0.0"},devDependencies:{"@babel/preset-env":"^7.21.5","@babel/preset-react":"^7.18.6","@babel/preset-typescript":"^7.21.5","@rollup/plugin-replace":"^6.0.1","@stencil/sass":"^3.0.1","@types/jest":"27.0.3","@types/react":"^18.0.37","@types/react-dom":"^18.0.11",dotenv:"^16.3.1",jest:"^29.7.0","jest-cli":"^29.7.0","jest-environment-node":"^29.7.0","ts-jest":"^29.1.2"},license:"MIT",gitHead:"507bac1d941eae6e1f56e185ecd9bc9d22637783"};export{e as p}
@@ -1 +1 @@
1
- import{r as t,c as s,h as i}from"./p-2783e363.js";import{C as e,a as o}from"./p-14c91ffd.js";import{C as r}from"./p-7c31ec70.js";import"./p-56f6ce4c.js";import"./p-9894484a.js";import"./p-01d4e35a.js";import"./p-61f0a2ce.js";import{g as a,a as c}from"./p-8115b2f4.js";import{c as h,J as n}from"./p-2a136295.js";import{c as p}from"./p-2d801915.js";import{C as d}from"./p-ea105de3.js";import{m,S as u}from"./p-f706d70e.js";import{S as f}from"./p-bfe9748b.js";import{d as j}from"./p-e63fdbca.js";import"./p-2ca5b5e4.js";import"./p-abdbcd8e.js";import"./p-c845cb7a.js";import"./p-938993c7.js";import"./p-d8c04275.js";const l=class{constructor(i){t(this,i),this.errorEvent=s(this,"error-event",7),this.handleErrorEvent=t=>{this.errorMessage=t.detail.message,this.errorEvent.emit(t.detail)},this.getCheckouts=void 0,this.getSubAccounts=void 0,this.errorMessage=null,this.accountId=void 0,this.authToken=void 0,this.apiOrigin=p.proxyApiOrigin,this.columns=j}componentWillLoad(){h(),this.analytics=new n(this),this.initializeGetData()}disconnectedCallback(){this.analytics.cleanup()}propChanged(){this.initializeGetData()}initializeGetData(){this.initializeGetCheckouts(),this.initializeGetSubAccounts()}initializeGetCheckouts(){this.accountId&&this.authToken?this.getCheckouts=(({accountId:t,authToken:s,service:i,apiOrigin:o})=>async({params:h,onSuccess:n,onError:p})=>{var d,m;try{const u=await i.fetchCheckouts(t,s,h,o);if(u.error)return p({error:a(u.error),code:c(null===(m=u.error)||void 0===m?void 0:m.code),severity:e.ERROR});{const t=Object.assign({},u.page_info);n({checkouts:(null===(d=u.data)||void 0===d?void 0:d.map((t=>new r(t))))||[],pagingInfo:t})}}catch(t){const s=c(null==t?void 0:t.code);return p({error:t.message||t,code:s,severity:e.ERROR})}})({accountId:this.accountId,authToken:this.authToken,service:new d,apiOrigin:this.apiOrigin}):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:o.MISSING_PROPS,message:this.errorMessage,severity:e.ERROR}))}initializeGetSubAccounts(){this.accountId&&this.authToken&&(this.getSubAccounts=m({accountId:this.accountId,authToken:this.authToken,service:new u,apiOrigin:this.apiOrigin}))}render(){return i(f,{key:"aae56ec9ac20a6ed740a5180bfedf664d7d1e0ca"},i("checkouts-list-core",{key:"933b8b41aa468c1515b64a8fb6570609454ee361",getCheckouts:this.getCheckouts,getSubAccounts:this.getSubAccounts,"onError-event":this.handleErrorEvent,columns:this.columns}))}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"]}}};export{l as justifi_checkouts_list}
1
+ import{r as t,c as s,h as i}from"./p-2783e363.js";import{C as e,a as o}from"./p-14c91ffd.js";import{C as r}from"./p-7c31ec70.js";import"./p-56f6ce4c.js";import"./p-9894484a.js";import"./p-01d4e35a.js";import"./p-61f0a2ce.js";import{g as a,a as c}from"./p-8115b2f4.js";import{c as h,J as n}from"./p-933537ca.js";import{c as p}from"./p-4bad3621.js";import{C as d}from"./p-fdbcd486.js";import{m,S as u}from"./p-a2076a0e.js";import{S as f}from"./p-bfe9748b.js";import{d as j}from"./p-e63fdbca.js";import"./p-2ca5b5e4.js";import"./p-abdbcd8e.js";import"./p-b2edb944.js";import"./p-938993c7.js";import"./p-d8c04275.js";const b=class{constructor(i){t(this,i),this.errorEvent=s(this,"error-event",7),this.handleErrorEvent=t=>{this.errorMessage=t.detail.message,this.errorEvent.emit(t.detail)},this.getCheckouts=void 0,this.getSubAccounts=void 0,this.errorMessage=null,this.accountId=void 0,this.authToken=void 0,this.apiOrigin=p.proxyApiOrigin,this.columns=j}componentWillLoad(){h(),this.analytics=new n(this),this.initializeGetData()}disconnectedCallback(){this.analytics.cleanup()}propChanged(){this.initializeGetData()}initializeGetData(){this.initializeGetCheckouts(),this.initializeGetSubAccounts()}initializeGetCheckouts(){this.accountId&&this.authToken?this.getCheckouts=(({accountId:t,authToken:s,service:i,apiOrigin:o})=>async({params:h,onSuccess:n,onError:p})=>{var d,m;try{const u=await i.fetchCheckouts(t,s,h,o);if(u.error)return p({error:a(u.error),code:c(null===(m=u.error)||void 0===m?void 0:m.code),severity:e.ERROR});{const t=Object.assign({},u.page_info);n({checkouts:(null===(d=u.data)||void 0===d?void 0:d.map((t=>new r(t))))||[],pagingInfo:t})}}catch(t){const s=c(null==t?void 0:t.code);return p({error:t.message||t,code:s,severity:e.ERROR})}})({accountId:this.accountId,authToken:this.authToken,service:new d,apiOrigin:this.apiOrigin}):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:o.MISSING_PROPS,message:this.errorMessage,severity:e.ERROR}))}initializeGetSubAccounts(){this.accountId&&this.authToken&&(this.getSubAccounts=m({accountId:this.accountId,authToken:this.authToken,service:new u,apiOrigin:this.apiOrigin}))}render(){return i(f,{key:"aae56ec9ac20a6ed740a5180bfedf664d7d1e0ca"},i("checkouts-list-core",{key:"933b8b41aa468c1515b64a8fb6570609454ee361",getCheckouts:this.getCheckouts,getSubAccounts:this.getSubAccounts,"onError-event":this.handleErrorEvent,columns:this.columns}))}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"]}}};export{b as justifi_checkouts_list}
@@ -1 +1 @@
1
- import{A as a,c as t}from"./p-2d801915.js";import{C as o}from"./p-14c91ffd.js";import"./p-7c31ec70.js";import"./p-56f6ce4c.js";import"./p-9894484a.js";import"./p-01d4e35a.js";import"./p-61f0a2ce.js";import{g as r,a as s}from"./p-8115b2f4.js";class p{async fetchPayouts(o,r,s,p){return p||(p=t.proxyApiOrigin),a({authToken:r,apiOrigin:p}).get(`account/${o}/payouts`,s)}async fetchPayout(o,r,s){return s||(s=t.proxyApiOrigin),a({authToken:r,apiOrigin:s}).get(`payouts/${o}`)}async fetchCSV(o,r,s){return s||(s=t.proxyApiOrigin),a({authToken:r,apiOrigin:s}).get(`reports/payouts/${o}`)}}const c=({authToken:a,service:t})=>async({payoutId:p,onError:c})=>{try{const{data:o}=await t.fetchCSV(p,a),r=document.createElement("a");r.href=o.csv_url,r.click()}catch(a){c({error:r(a),code:s(null==a?void 0:a.code),severity:o.ERROR})}};export{p as P,c as m}
1
+ import{A as a,c as t}from"./p-4bad3621.js";import{C as o}from"./p-14c91ffd.js";import"./p-7c31ec70.js";import"./p-56f6ce4c.js";import"./p-9894484a.js";import"./p-01d4e35a.js";import"./p-61f0a2ce.js";import{g as r,a as s}from"./p-8115b2f4.js";class p{async fetchPayouts(o,r,s,p){return p||(p=t.proxyApiOrigin),a({authToken:r,apiOrigin:p}).get(`account/${o}/payouts`,s)}async fetchPayout(o,r,s){return s||(s=t.proxyApiOrigin),a({authToken:r,apiOrigin:s}).get(`payouts/${o}`)}async fetchCSV(o,r,s){return s||(s=t.proxyApiOrigin),a({authToken:r,apiOrigin:s}).get(`reports/payouts/${o}`)}}const c=({authToken:a,service:t})=>async({payoutId:p,onError:c})=>{try{const{data:o}=await t.fetchCSV(p,a),r=document.createElement("a");r.href=o.csv_url,r.click()}catch(a){c({error:r(a),code:s(null==a?void 0:a.code),severity:o.ERROR})}};export{p as P,c as m}
@@ -1 +1 @@
1
- import{r as t,c as s,h as i}from"./p-2783e363.js";import{P as e}from"./p-f9d63d9d.js";import{C as r,a as o}from"./p-14c91ffd.js";import"./p-7c31ec70.js";import"./p-56f6ce4c.js";import{P as a}from"./p-9894484a.js";import"./p-01d4e35a.js";import"./p-61f0a2ce.js";import{g as p,a as n}from"./p-8115b2f4.js";import{E as h}from"./p-8f25f016.js";import{c,J as d}from"./p-2a136295.js";import"./p-2d801915.js";import"./p-2ca5b5e4.js";import"./p-abdbcd8e.js";import"./p-d8c04275.js";import"./p-c845cb7a.js";const m=class{constructor(i){t(this,i),this.errorEvent=s(this,"error-event",7),this.paymentService=new e,this.handleErrorEvent=t=>{this.errorMessage=t.detail.message,this.errorEvent.emit(t.detail)},this.paymentId=void 0,this.authToken=void 0,this.getPaymentDetails=void 0,this.errorMessage=null}componentWillLoad(){c(),this.analytics=new d(this),this.initializeGetPaymentDetails()}disconnectedCallback(){this.analytics.cleanup()}propChanged(){this.initializeGetPaymentDetails()}initializeGetPaymentDetails(){this.paymentId&&this.authToken?this.getPaymentDetails=(({id:t,authToken:s,service:i})=>async({onSuccess:e,onError:o})=>{var h;try{const c=await i.fetchPayment(t,s);c.error?o({error:p(c.error),code:n(null===(h=c.error)||void 0===h?void 0:h.code),severity:r.ERROR}):e({payment:new a(c.data)})}catch(t){const s=n(null==t?void 0:t.code);o({error:p(t),code:s,severity:r.ERROR})}})({id:this.paymentId,authToken:this.authToken,service:new e}):(this.errorMessage="Payment ID and Auth Token are required",this.errorEvent.emit({message:this.errorMessage,errorCode:o.MISSING_PROPS,severity:r.ERROR}))}render(){return this.errorMessage?h(this.errorMessage):i("payment-details-core",{getPaymentDetails:this.getPaymentDetails,"onError-event":this.handleErrorEvent})}static get watchers(){return{paymentId:["propChanged"],authToken:["propChanged"]}}};export{m as justifi_payment_details}
1
+ import{r as t,c as s,h as i}from"./p-2783e363.js";import{P as e}from"./p-b15ad5df.js";import{C as r,a as o}from"./p-14c91ffd.js";import"./p-7c31ec70.js";import"./p-56f6ce4c.js";import{P as a}from"./p-9894484a.js";import"./p-01d4e35a.js";import"./p-61f0a2ce.js";import{g as p,a as n}from"./p-8115b2f4.js";import{E as h}from"./p-8f25f016.js";import{c,J as d}from"./p-933537ca.js";import"./p-4bad3621.js";import"./p-2ca5b5e4.js";import"./p-abdbcd8e.js";import"./p-d8c04275.js";import"./p-b2edb944.js";const m=class{constructor(i){t(this,i),this.errorEvent=s(this,"error-event",7),this.paymentService=new e,this.handleErrorEvent=t=>{this.errorMessage=t.detail.message,this.errorEvent.emit(t.detail)},this.paymentId=void 0,this.authToken=void 0,this.getPaymentDetails=void 0,this.errorMessage=null}componentWillLoad(){c(),this.analytics=new d(this),this.initializeGetPaymentDetails()}disconnectedCallback(){this.analytics.cleanup()}propChanged(){this.initializeGetPaymentDetails()}initializeGetPaymentDetails(){this.paymentId&&this.authToken?this.getPaymentDetails=(({id:t,authToken:s,service:i})=>async({onSuccess:e,onError:o})=>{var h;try{const c=await i.fetchPayment(t,s);c.error?o({error:p(c.error),code:n(null===(h=c.error)||void 0===h?void 0:h.code),severity:r.ERROR}):e({payment:new a(c.data)})}catch(t){const s=n(null==t?void 0:t.code);o({error:p(t),code:s,severity:r.ERROR})}})({id:this.paymentId,authToken:this.authToken,service:new e}):(this.errorMessage="Payment ID and Auth Token are required",this.errorEvent.emit({message:this.errorMessage,errorCode:o.MISSING_PROPS,severity:r.ERROR}))}render(){return this.errorMessage?h(this.errorMessage):i("payment-details-core",{getPaymentDetails:this.getPaymentDetails,"onError-event":this.handleErrorEvent})}static get watchers(){return{paymentId:["propChanged"],authToken:["propChanged"]}}};export{m as justifi_payment_details}
@@ -1 +1 @@
1
- import{r as s,c as t,h as i}from"./p-2783e363.js";import{P as r}from"./p-f9d63d9d.js";import{C as e,a as o}from"./p-14c91ffd.js";import"./p-7c31ec70.js";import"./p-56f6ce4c.js";import{P as a}from"./p-9894484a.js";import"./p-01d4e35a.js";import"./p-61f0a2ce.js";import{g as p,a as n}from"./p-8115b2f4.js";import{c,J as d}from"./p-2a136295.js";import{c as h}from"./p-2d801915.js";import{S as m}from"./p-bfe9748b.js";import{d as f}from"./p-f19f9f61.js";import"./p-2ca5b5e4.js";import"./p-abdbcd8e.js";import"./p-c845cb7a.js";import"./p-94eba309.js";import"./p-938993c7.js";import"./p-d8c04275.js";const j=class{constructor(i){s(this,i),this.errorEvent=t(this,"error-event",7),this.handleErrorEvent=s=>{this.errorMessage=s.detail.message,this.errorEvent.emit(s.detail)},this.getPayments=void 0,this.errorMessage=null,this.accountId=void 0,this.authToken=void 0,this.apiOrigin=h.proxyApiOrigin,this.columns=f}componentWillLoad(){c(),this.analytics=new d(this),this.initializeGetPayments()}disconnectedCallback(){this.analytics.cleanup()}propChanged(){this.initializeGetPayments()}initializeGetPayments(){this.accountId&&this.authToken?this.getPayments=(({id:s,authToken:t,service:i,apiOrigin:r})=>async({params:o,onSuccess:c,onError:d,final:h})=>{var m,f;try{const h=await i.fetchPayments(s,t,o,r);if(h.error)return d({error:p(h.error),code:n(null===(f=h.error)||void 0===f?void 0:f.code),severity:e.ERROR});{const s=Object.assign({},h.page_info);c({payments:(null===(m=h.data)||void 0===m?void 0:m.map((s=>new a(s))))||[],pagingInfo:s})}}catch(s){const t=n(null==s?void 0:s.code);return d({error:s.message||s,code:t,severity:e.ERROR})}finally{return h()}})({id:this.accountId,authToken:this.authToken,service:new r,apiOrigin:this.apiOrigin}):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:o.MISSING_PROPS,message:this.errorMessage,severity:e.ERROR}))}render(){return i(m,{key:"17c610d9339435e5aa7dc6735a0b4cde7e64753a"},i("payments-list-core",{key:"be8ddb8088e17c8966f32705f27c48a7f58fd3f1",getPayments:this.getPayments,"onError-event":this.handleErrorEvent,columns:this.columns}))}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"]}}};export{j as justifi_payments_list}
1
+ import{r as s,c as t,h as i}from"./p-2783e363.js";import{P as r}from"./p-b15ad5df.js";import{C as e,a as o}from"./p-14c91ffd.js";import"./p-7c31ec70.js";import"./p-56f6ce4c.js";import{P as a}from"./p-9894484a.js";import"./p-01d4e35a.js";import"./p-61f0a2ce.js";import{g as p,a as n}from"./p-8115b2f4.js";import{c,J as d}from"./p-933537ca.js";import{c as h}from"./p-4bad3621.js";import{S as m}from"./p-bfe9748b.js";import{d as f}from"./p-f19f9f61.js";import"./p-2ca5b5e4.js";import"./p-abdbcd8e.js";import"./p-b2edb944.js";import"./p-94eba309.js";import"./p-938993c7.js";import"./p-d8c04275.js";const j=class{constructor(i){s(this,i),this.errorEvent=t(this,"error-event",7),this.handleErrorEvent=s=>{this.errorMessage=s.detail.message,this.errorEvent.emit(s.detail)},this.getPayments=void 0,this.errorMessage=null,this.accountId=void 0,this.authToken=void 0,this.apiOrigin=h.proxyApiOrigin,this.columns=f}componentWillLoad(){c(),this.analytics=new d(this),this.initializeGetPayments()}disconnectedCallback(){this.analytics.cleanup()}propChanged(){this.initializeGetPayments()}initializeGetPayments(){this.accountId&&this.authToken?this.getPayments=(({id:s,authToken:t,service:i,apiOrigin:r})=>async({params:o,onSuccess:c,onError:d,final:h})=>{var m,f;try{const h=await i.fetchPayments(s,t,o,r);if(h.error)return d({error:p(h.error),code:n(null===(f=h.error)||void 0===f?void 0:f.code),severity:e.ERROR});{const s=Object.assign({},h.page_info);c({payments:(null===(m=h.data)||void 0===m?void 0:m.map((s=>new a(s))))||[],pagingInfo:s})}}catch(s){const t=n(null==s?void 0:s.code);return d({error:s.message||s,code:t,severity:e.ERROR})}finally{return h()}})({id:this.accountId,authToken:this.authToken,service:new r,apiOrigin:this.apiOrigin}):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:o.MISSING_PROPS,message:this.errorMessage,severity:e.ERROR}))}render(){return i(m,{key:"17c610d9339435e5aa7dc6735a0b4cde7e64753a"},i("payments-list-core",{key:"be8ddb8088e17c8966f32705f27c48a7f58fd3f1",getPayments:this.getPayments,"onError-event":this.handleErrorEvent,columns:this.columns}))}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"]}}};export{j as justifi_payments_list}
@@ -1 +1 @@
1
- import{r as i,c as t,h as s}from"./p-2783e363.js";import{C as r,a as e}from"./p-14c91ffd.js";import{c as o,J as a}from"./p-2a136295.js";import{A as n,c}from"./p-2d801915.js";import"./p-7c31ec70.js";import"./p-56f6ce4c.js";import"./p-9894484a.js";import{T as h}from"./p-01d4e35a.js";import"./p-61f0a2ce.js";import{g as p,a as m}from"./p-8115b2f4.js";import{m as d,S as l}from"./p-f706d70e.js";import{S as u}from"./p-bfe9748b.js";import{d as f}from"./p-5b72bab7.js";import"./p-c845cb7a.js";import"./p-2ca5b5e4.js";import"./p-abdbcd8e.js";import"./p-938993c7.js";import"./p-d8c04275.js";class b{async fetchTerminals(i,t,s,r){r||(r=c.proxyApiOrigin);const e={Account:i};return n({authToken:t,apiOrigin:r}).get("terminals",s,null,e)}async fetchTerminal(i,t,s){s||(s=c.proxyApiOrigin);const r=`terminals/${i}`;return n({authToken:t,apiOrigin:s}).get(r)}}const j=class{constructor(s){i(this,s),this.errorEvent=t(this,"error-event",7),this.handleErrorEvent=i=>{this.errorMessage=i.detail.message,this.errorEvent.emit(i.detail)},this.getTerminals=void 0,this.getSubAccounts=void 0,this.errorMessage=null,this.accountId=void 0,this.authToken=void 0,this.apiOrigin=c.proxyApiOrigin,this.columns=f}componentWillLoad(){o(),this.analytics=new a(this),this.initializeGetData()}disconnectedCallback(){this.analytics.cleanup()}propChanged(){this.initializeGetData()}initializeGetData(){this.initializeGetTerminals(),this.initializeGetSubAccounts()}initializeGetTerminals(){this.accountId&&this.authToken?this.getTerminals=(({id:i,authToken:t,service:s,apiOrigin:e})=>async({params:o,onSuccess:a,onError:n})=>{var c,d;try{const l=await s.fetchTerminals(i,t,o,e);if(l.error)return n({error:p(l.error),code:m(null===(d=l.error)||void 0===d?void 0:d.code),severity:r.ERROR});{const i=Object.assign({},l.page_info);a({terminals:(null===(c=l.data)||void 0===c?void 0:c.map((i=>new h(i))))||[],pagingInfo:i})}}catch(i){const t=m(null==i?void 0:i.code);return n({error:i.message||i,code:t,severity:r.ERROR})}})({id:this.accountId,authToken:this.authToken,service:new b,apiOrigin:this.apiOrigin}):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:e.MISSING_PROPS,message:this.errorMessage,severity:r.ERROR}))}initializeGetSubAccounts(){this.accountId&&this.authToken&&(this.getSubAccounts=d({accountId:this.accountId,authToken:this.authToken,service:new l,apiOrigin:this.apiOrigin}))}render(){return s(u,{key:"79168b27873e1b6e7d6bfded80b646d2a95292e0"},s("terminals-list-core",{key:"2dfbc1d923cb83cc10039b4344629db17f754fbc",getTerminals:this.getTerminals,getSubAccounts:this.getSubAccounts,"onError-event":this.handleErrorEvent,columns:this.columns}))}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"]}}};export{j as justifi_terminals_list}
1
+ import{r as i,c as t,h as s}from"./p-2783e363.js";import{C as e,a as r}from"./p-14c91ffd.js";import{c as o,J as a}from"./p-933537ca.js";import{A as n,c}from"./p-4bad3621.js";import"./p-7c31ec70.js";import"./p-56f6ce4c.js";import"./p-9894484a.js";import{T as h}from"./p-01d4e35a.js";import"./p-61f0a2ce.js";import{g as p,a as m}from"./p-8115b2f4.js";import{m as d,S as l}from"./p-a2076a0e.js";import{S as u}from"./p-bfe9748b.js";import{d as b}from"./p-5b72bab7.js";import"./p-b2edb944.js";import"./p-2ca5b5e4.js";import"./p-abdbcd8e.js";import"./p-938993c7.js";import"./p-d8c04275.js";class f{async fetchTerminals(i,t,s,e){e||(e=c.proxyApiOrigin);const r={Account:i};return n({authToken:t,apiOrigin:e}).get("terminals",s,null,r)}async fetchTerminal(i,t,s){s||(s=c.proxyApiOrigin);const e=`terminals/${i}`;return n({authToken:t,apiOrigin:s}).get(e)}}const j=class{constructor(s){i(this,s),this.errorEvent=t(this,"error-event",7),this.handleErrorEvent=i=>{this.errorMessage=i.detail.message,this.errorEvent.emit(i.detail)},this.getTerminals=void 0,this.getSubAccounts=void 0,this.errorMessage=null,this.accountId=void 0,this.authToken=void 0,this.apiOrigin=c.proxyApiOrigin,this.columns=b}componentWillLoad(){o(),this.analytics=new a(this),this.initializeGetData()}disconnectedCallback(){this.analytics.cleanup()}propChanged(){this.initializeGetData()}initializeGetData(){this.initializeGetTerminals(),this.initializeGetSubAccounts()}initializeGetTerminals(){this.accountId&&this.authToken?this.getTerminals=(({id:i,authToken:t,service:s,apiOrigin:r})=>async({params:o,onSuccess:a,onError:n})=>{var c,d;try{const l=await s.fetchTerminals(i,t,o,r);if(l.error)return n({error:p(l.error),code:m(null===(d=l.error)||void 0===d?void 0:d.code),severity:e.ERROR});{const i=Object.assign({},l.page_info);a({terminals:(null===(c=l.data)||void 0===c?void 0:c.map((i=>new h(i))))||[],pagingInfo:i})}}catch(i){const t=m(null==i?void 0:i.code);return n({error:i.message||i,code:t,severity:e.ERROR})}})({id:this.accountId,authToken:this.authToken,service:new f,apiOrigin:this.apiOrigin}):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:r.MISSING_PROPS,message:this.errorMessage,severity:e.ERROR}))}initializeGetSubAccounts(){this.accountId&&this.authToken&&(this.getSubAccounts=d({accountId:this.accountId,authToken:this.authToken,service:new l,apiOrigin:this.apiOrigin}))}render(){return s(u,{key:"79168b27873e1b6e7d6bfded80b646d2a95292e0"},s("terminals-list-core",{key:"2dfbc1d923cb83cc10039b4344629db17f754fbc",getTerminals:this.getTerminals,getSubAccounts:this.getSubAccounts,"onError-event":this.handleErrorEvent,columns:this.columns}))}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"]}}};export{j as justifi_terminals_list}
@@ -0,0 +1 @@
1
+ import{A as c,c as t}from"./p-4bad3621.js";import"./p-14c91ffd.js";import"./p-7c31ec70.js";import"./p-56f6ce4c.js";import"./p-9894484a.js";import"./p-01d4e35a.js";import"./p-61f0a2ce.js";class e{async fetchCheckout(e,o){const s=`checkouts/${o}`;return c({authToken:e,apiOrigin:t.proxyApiOrigin}).get(s)}async fetchCheckouts(e,o,s,p){p||(p=t.proxyApiOrigin);const a={Account:e};return c({authToken:o,apiOrigin:p}).get("checkouts",s,null,a)}async complete(e,o,s){const p=`checkouts/${o}/complete`,a={payment_mode:s.payment_mode};return s.payment_token&&(a.payment_token=s.payment_token),c({authToken:e,apiOrigin:t.proxyApiOrigin}).post(p,a)}}export{e as C}
@@ -1 +1 @@
1
- import{r as t,c as i,h as e}from"./p-2783e363.js";import{A as s,c as r}from"./p-2d801915.js";import{C as o,a}from"./p-14c91ffd.js";import"./p-7c31ec70.js";import"./p-56f6ce4c.js";import"./p-9894484a.js";import"./p-01d4e35a.js";import"./p-61f0a2ce.js";import{g as n,a as c}from"./p-8115b2f4.js";import{c as d,J as h}from"./p-2a136295.js";import"./p-2ca5b5e4.js";import"./p-abdbcd8e.js";import"./p-c845cb7a.js";class p{async fetchQuote(t,i){return s({authToken:t,apiOrigin:r.proxyApiOrigin}).post("insurance/quotes",i)}async toggleCoverage(t,i,e){const o=`insurance/quotes/${i}/toggle`;return s({authToken:t,apiOrigin:r.proxyApiOrigin}).post(o,e)}}const u=class{constructor(e){t(this,e),this.errorEvent=i(this,"error-event",7),this.authToken=void 0,this.checkoutId=void 0,this.primaryIdentityFirstName=void 0,this.primaryIdentityLastName=void 0,this.primaryIdentityState=void 0,this.primaryIdentityPostalCode=void 0,this.primaryIdentityCountry=void 0,this.primaryIdentityEmailAddress=void 0,this.policyAttributesInsurableAmount=void 0,this.policyAttributesStartDate=void 0,this.policyAttributesEndDate=void 0,this.coveredIdentityFirstName=void 0,this.coveredIdentityLastName=void 0,this.getQuote=void 0,this.toggleCoverage=void 0,this.quote=void 0}async validate(){return this.seasonInterruptionCoreRef.validate()}componentWillLoad(){d(),this.analytics=new h(this),this.initializeServiceMethods()}disconnectedCallback(){this.analytics&&this.analytics.cleanup()}initializeServiceMethods(){this.authToken?(this.getQuote=(({authToken:t,service:i})=>async({payload:e,onSuccess:s,onError:r})=>{var a;try{const d=await i.fetchQuote(t,e);if(d.error)return r({error:n(d.error),code:c(null===(a=d.error)||void 0===a?void 0:a.code),severity:o.ERROR});s({quote:d.data})}catch(t){const i=c(null==t?void 0:t.code);return r({error:t.message||t,code:i,severity:o.ERROR})}})({authToken:this.authToken,service:new p}),this.toggleCoverage=(({authToken:t,service:i})=>async({quoteId:e,payload:s,onSuccess:r,onError:a})=>{var d;try{const h=await i.toggleCoverage(t,e,s);if(h.error)return a({error:n(h.error),code:c(null===(d=h.error)||void 0===d?void 0:d.code),severity:o.ERROR});r({quote:h.data})}catch(t){const i=c(null==t?void 0:t.code);return a({error:t.message||t,code:i,severity:o.ERROR})}})({authToken:this.authToken,service:new p})):this.errorEvent.emit({errorCode:a.MISSING_PROPS,message:"Missing authToken",severity:o.ERROR})}render(){return e("justifi-season-interruption-insurance-core",{key:"50413e347b808cbf350573602701d5e6e7d4def5",ref:t=>this.seasonInterruptionCoreRef=t,"checkout-id":this.checkoutId,getQuote:this.getQuote,toggleCoverage:this.toggleCoverage,"primary-identity-first-name":this.primaryIdentityFirstName,"primary-identity-last-name":this.primaryIdentityLastName,"primary-identity-state":this.primaryIdentityState,"primary-identity-postal-code":this.primaryIdentityPostalCode,"primary-identity-country":this.primaryIdentityCountry,"primary-identity-email-address":this.primaryIdentityEmailAddress,"policy-attributes-insurable-amount":this.policyAttributesInsurableAmount,"policy-attributes-start-date":this.policyAttributesStartDate,"policy-attributes-end-date":this.policyAttributesEndDate,"covered-identity-first-name":this.coveredIdentityFirstName,"covered-identity-last-name":this.coveredIdentityLastName})}};export{u as justifi_season_interruption_insurance}
1
+ import{r as t,c as i,h as e}from"./p-2783e363.js";import{A as s,c as r}from"./p-4bad3621.js";import{C as o,a}from"./p-14c91ffd.js";import"./p-7c31ec70.js";import"./p-56f6ce4c.js";import"./p-9894484a.js";import"./p-01d4e35a.js";import"./p-61f0a2ce.js";import{g as n,a as c}from"./p-8115b2f4.js";import{c as d,J as h}from"./p-933537ca.js";import"./p-2ca5b5e4.js";import"./p-abdbcd8e.js";import"./p-b2edb944.js";class p{async fetchQuote(t,i){return s({authToken:t,apiOrigin:r.proxyApiOrigin}).post("insurance/quotes",i)}async toggleCoverage(t,i,e){const o=`insurance/quotes/${i}/toggle`;return s({authToken:t,apiOrigin:r.proxyApiOrigin}).post(o,e)}}const u=class{constructor(e){t(this,e),this.errorEvent=i(this,"error-event",7),this.authToken=void 0,this.checkoutId=void 0,this.primaryIdentityFirstName=void 0,this.primaryIdentityLastName=void 0,this.primaryIdentityState=void 0,this.primaryIdentityPostalCode=void 0,this.primaryIdentityCountry=void 0,this.primaryIdentityEmailAddress=void 0,this.policyAttributesInsurableAmount=void 0,this.policyAttributesStartDate=void 0,this.policyAttributesEndDate=void 0,this.coveredIdentityFirstName=void 0,this.coveredIdentityLastName=void 0,this.getQuote=void 0,this.toggleCoverage=void 0,this.quote=void 0}async validate(){return this.seasonInterruptionCoreRef.validate()}componentWillLoad(){d(),this.analytics=new h(this),this.initializeServiceMethods()}disconnectedCallback(){this.analytics&&this.analytics.cleanup()}initializeServiceMethods(){this.authToken?(this.getQuote=(({authToken:t,service:i})=>async({payload:e,onSuccess:s,onError:r})=>{var a;try{const d=await i.fetchQuote(t,e);if(d.error)return r({error:n(d.error),code:c(null===(a=d.error)||void 0===a?void 0:a.code),severity:o.ERROR});s({quote:d.data})}catch(t){const i=c(null==t?void 0:t.code);return r({error:t.message||t,code:i,severity:o.ERROR})}})({authToken:this.authToken,service:new p}),this.toggleCoverage=(({authToken:t,service:i})=>async({quoteId:e,payload:s,onSuccess:r,onError:a})=>{var d;try{const h=await i.toggleCoverage(t,e,s);if(h.error)return a({error:n(h.error),code:c(null===(d=h.error)||void 0===d?void 0:d.code),severity:o.ERROR});r({quote:h.data})}catch(t){const i=c(null==t?void 0:t.code);return a({error:t.message||t,code:i,severity:o.ERROR})}})({authToken:this.authToken,service:new p})):this.errorEvent.emit({errorCode:a.MISSING_PROPS,message:"Missing authToken",severity:o.ERROR})}render(){return e("justifi-season-interruption-insurance-core",{key:"50413e347b808cbf350573602701d5e6e7d4def5",ref:t=>this.seasonInterruptionCoreRef=t,"checkout-id":this.checkoutId,getQuote:this.getQuote,toggleCoverage:this.toggleCoverage,"primary-identity-first-name":this.primaryIdentityFirstName,"primary-identity-last-name":this.primaryIdentityLastName,"primary-identity-state":this.primaryIdentityState,"primary-identity-postal-code":this.primaryIdentityPostalCode,"primary-identity-country":this.primaryIdentityCountry,"primary-identity-email-address":this.primaryIdentityEmailAddress,"policy-attributes-insurable-amount":this.policyAttributesInsurableAmount,"policy-attributes-start-date":this.policyAttributesStartDate,"policy-attributes-end-date":this.policyAttributesEndDate,"covered-identity-first-name":this.coveredIdentityFirstName,"covered-identity-last-name":this.coveredIdentityLastName})}};export{u as justifi_season_interruption_insurance}