@justifi/webcomponents 4.19.0 → 4.19.1-rc-3

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 (224) hide show
  1. package/dist/cjs/{Analytics-ff013cbc.js → Analytics-1ca4e47e.js} +2 -3
  2. package/dist/cjs/{business.service-f63650f5.js → business.service-6bb7ac82.js} +5 -6
  3. package/dist/cjs/{get-payout-csv-f3aee6d0.js → get-payout-csv-1391ff3e.js} +3 -4
  4. package/dist/cjs/justifi-additional-questions-form-step_10.cjs.entry.js +7 -8
  5. package/dist/cjs/justifi-bank-account-form.cjs.entry.js +4 -5
  6. package/dist/cjs/justifi-business-details.cjs.entry.js +3 -4
  7. package/dist/cjs/justifi-business-form.cjs.entry.js +4 -5
  8. package/dist/cjs/justifi-card-form.cjs.entry.js +4 -5
  9. package/dist/cjs/justifi-checkout-core.cjs.entry.js +3 -3
  10. package/dist/cjs/justifi-checkout.cjs.entry.js +4 -5
  11. package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +3 -4
  12. package/dist/cjs/justifi-new-payment-method_4.cjs.entry.js +11 -9
  13. package/dist/cjs/justifi-owner-form_3.cjs.entry.js +1 -2
  14. package/dist/cjs/justifi-payment-details.cjs.entry.js +3 -4
  15. package/dist/cjs/justifi-payment-form.cjs.entry.js +5 -6
  16. package/dist/cjs/justifi-payment-method-form.cjs.entry.js +1 -1
  17. package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +5 -6
  18. package/dist/cjs/justifi-payments-list.cjs.entry.js +3 -4
  19. package/dist/cjs/justifi-payout-details.cjs.entry.js +3 -4
  20. package/dist/cjs/justifi-payouts-list.cjs.entry.js +3 -4
  21. package/dist/cjs/justifi-refund-form.cjs.entry.js +2 -3
  22. package/dist/cjs/justifi-season-interruption-insurance.cjs.entry.js +4 -5
  23. package/dist/cjs/{package-cb0f8cb1.js → package-bc2632e4.js} +2 -4
  24. package/dist/cjs/{payment.service-0a64f9cd.js → payment.service-dfcfa19b.js} +2 -3
  25. package/dist/collection/api/services/analytics.service.js +1 -2
  26. package/dist/collection/api/services/business.service.js +5 -6
  27. package/dist/collection/api/services/checkout.service.js +2 -3
  28. package/dist/collection/api/services/insurance.service.js +2 -3
  29. package/dist/collection/api/services/payment.service.js +2 -3
  30. package/dist/collection/api/services/payout.service.js +3 -4
  31. package/dist/collection/api/services/provision.service.js +2 -4
  32. package/dist/collection/api/services/reports.service.js +1 -2
  33. package/dist/collection/components/bank-account-form/bank-account-form.js +3 -4
  34. package/dist/collection/components/business-forms/business-form/business-form.js +2 -3
  35. package/dist/collection/components/business-forms/payment-provisioning/bank-account/business-bank-account-form-step.js +2 -3
  36. package/dist/collection/components/business-forms/payment-provisioning/document-uploads/business-document-upload-form-step.js +2 -3
  37. package/dist/collection/components/business-forms/payment-provisioning/terms-and-conditions/business-terms-conditions-form-step.js +2 -3
  38. package/dist/collection/components/card-form/card-form.js +3 -4
  39. package/dist/collection/components/checkout/checkout-core.js +4 -4
  40. package/dist/collection/components/checkout/new-payment-method.js +6 -4
  41. package/dist/collection/components/checkout/payment-method-options.js +3 -4
  42. package/dist/collection/components/checkout/saved-payment-method.js +3 -4
  43. package/dist/collection/components/checkout/sezzle-payment-method.js +3 -4
  44. package/dist/collection/components/payment-form/payment-form.js +3 -4
  45. package/dist/collection/components/refund-form/refund-form.js +2 -3
  46. package/dist/docs.json +8 -8
  47. package/dist/esm/{Analytics-33b8fa8d.js → Analytics-c51439be.js} +2 -3
  48. package/dist/esm/{business.service-74bd1212.js → business.service-f45decfc.js} +5 -6
  49. package/dist/esm/{get-payout-csv-b494abfe.js → get-payout-csv-e784a2ab.js} +3 -4
  50. package/dist/esm/justifi-additional-questions-form-step_10.entry.js +7 -8
  51. package/dist/esm/justifi-bank-account-form.entry.js +4 -5
  52. package/dist/esm/justifi-business-details.entry.js +3 -4
  53. package/dist/esm/justifi-business-form.entry.js +4 -5
  54. package/dist/esm/justifi-card-form.entry.js +4 -5
  55. package/dist/esm/justifi-checkout-core.entry.js +3 -3
  56. package/dist/esm/justifi-checkout.entry.js +4 -5
  57. package/dist/esm/justifi-gross-payment-chart.entry.js +3 -4
  58. package/dist/esm/justifi-new-payment-method_4.entry.js +11 -9
  59. package/dist/esm/justifi-owner-form_3.entry.js +1 -2
  60. package/dist/esm/justifi-payment-details.entry.js +3 -4
  61. package/dist/esm/justifi-payment-form.entry.js +5 -6
  62. package/dist/esm/justifi-payment-method-form.entry.js +1 -1
  63. package/dist/esm/justifi-payment-provisioning.entry.js +5 -6
  64. package/dist/esm/justifi-payments-list.entry.js +3 -4
  65. package/dist/esm/justifi-payout-details.entry.js +3 -4
  66. package/dist/esm/justifi-payouts-list.entry.js +3 -4
  67. package/dist/esm/justifi-refund-form.entry.js +2 -3
  68. package/dist/esm/justifi-season-interruption-insurance.entry.js +4 -5
  69. package/dist/esm/{package-3e407c6d.js → package-09a354e0.js} +2 -4
  70. package/dist/esm/{payment.service-3ca4a492.js → payment.service-dad5153b.js} +2 -3
  71. package/dist/globals.d.ts +2 -0
  72. package/dist/module/Analytics.js +1 -2
  73. package/dist/module/business-bank-account-form-step.js +2 -3
  74. package/dist/module/business-document-upload-form-step.js +2 -3
  75. package/dist/module/business-terms-conditions-form-step.js +2 -3
  76. package/dist/module/business.service.js +5 -6
  77. package/dist/module/checkout-core.js +3 -3
  78. package/dist/module/get-payout-csv.js +3 -4
  79. package/dist/module/justifi-bank-account-form.js +2 -3
  80. package/dist/module/justifi-business-form.js +2 -3
  81. package/dist/module/justifi-card-form.js +2 -3
  82. package/dist/module/justifi-checkout.js +2 -3
  83. package/dist/module/justifi-gross-payment-chart.js +1 -2
  84. package/dist/module/justifi-payment-form.js +3 -4
  85. package/dist/module/justifi-payment-provisioning.js +2 -3
  86. package/dist/module/justifi-refund-form.js +2 -3
  87. package/dist/module/justifi-season-interruption-insurance.js +2 -3
  88. package/dist/module/new-payment-method.js +5 -3
  89. package/dist/module/package.js +2 -4
  90. package/dist/module/payment-method-options.js +2 -3
  91. package/dist/module/payment.service.js +2 -3
  92. package/dist/module/saved-payment-method.js +2 -3
  93. package/dist/module/sezzle-payment-method.js +2 -3
  94. package/dist/types/components/checkout/new-payment-method.d.ts +1 -0
  95. package/dist/webcomponents/index.esm.js +1 -0
  96. package/dist/webcomponents/p-01a404ca.entry.js +44 -0
  97. package/dist/webcomponents/p-03d35880.entry.js +130 -0
  98. package/dist/webcomponents/p-06ff0429.entry.js +65 -0
  99. package/dist/webcomponents/p-08b0fb31.js +41 -1
  100. package/dist/webcomponents/p-14c91ffd.js +20 -1
  101. package/dist/webcomponents/p-1a17ea7d.entry.js +1684 -0
  102. package/dist/webcomponents/p-1ad5995e.js +3599 -1
  103. package/dist/webcomponents/p-1ff8810b.js +29 -1
  104. package/dist/webcomponents/p-21aeb013.entry.js +80 -0
  105. package/dist/webcomponents/p-2338affa.js +213 -1
  106. package/dist/webcomponents/p-258b1ee2.entry.js +149 -0
  107. package/dist/webcomponents/p-25d8cd65.entry.js +102 -0
  108. package/dist/webcomponents/p-29c0b182.js +114 -1
  109. package/dist/webcomponents/p-2b6c9c4f.js +7 -1
  110. package/dist/webcomponents/p-2dabeb5a.js +79 -0
  111. package/dist/webcomponents/p-2eab3c90.js +3052 -1
  112. package/dist/webcomponents/p-33272d05.entry.js +94 -0
  113. package/dist/webcomponents/p-3642ad71.entry.js +145 -0
  114. package/dist/webcomponents/p-387450f6.js +77 -0
  115. package/dist/webcomponents/p-3e9ef4a8.js +28 -0
  116. package/dist/webcomponents/p-3fd13ca3.js +52 -1
  117. package/dist/webcomponents/p-41bc7c5c.entry.js +97 -0
  118. package/dist/webcomponents/p-4d8b45c6.entry.js +98 -0
  119. package/dist/webcomponents/p-525db3e8.js +22 -1
  120. package/dist/webcomponents/p-5482d030.entry.js +21 -0
  121. package/dist/webcomponents/p-56f6ce4c.js +10 -1
  122. package/dist/webcomponents/p-576826b1.entry.js +43 -0
  123. package/dist/webcomponents/p-5968ff8a.js +178 -1
  124. package/dist/webcomponents/p-5bd7b204.entry.js +75 -0
  125. package/dist/webcomponents/p-5cb3f0b2.entry.js +261 -0
  126. package/dist/webcomponents/p-5e70442b.entry.js +74 -0
  127. package/dist/webcomponents/p-5f835b89.entry.js +606 -0
  128. package/dist/webcomponents/p-6078a370.js +244 -1
  129. package/dist/webcomponents/p-68843186.entry.js +73 -0
  130. package/dist/webcomponents/p-70a2aa74.entry.js +76 -0
  131. package/dist/webcomponents/p-7582b554.entry.js +18 -0
  132. package/dist/webcomponents/p-79646550.entry.js +61 -0
  133. package/dist/webcomponents/p-7c76e67c.entry.js +117 -0
  134. package/dist/webcomponents/p-7d85af5c.js +16 -1
  135. package/dist/webcomponents/p-800d31fe.entry.js +162 -0
  136. package/dist/webcomponents/p-8115b2f4.js +28 -1
  137. package/dist/webcomponents/p-83125497.js +4027 -1
  138. package/dist/webcomponents/p-85fc69e5.js +90 -1
  139. package/dist/webcomponents/p-890088fc.entry.js +298 -0
  140. package/dist/webcomponents/p-89887332.js +301 -1
  141. package/dist/webcomponents/p-8df7bde8.js +27 -1
  142. package/dist/webcomponents/p-8eb774df.entry.js +54 -0
  143. package/dist/webcomponents/p-9c9c7dac.js +24 -1
  144. package/dist/webcomponents/p-9f94bbb6.entry.js +118 -0
  145. package/dist/webcomponents/p-a5a225d9.entry.js +125 -0
  146. package/dist/webcomponents/p-a5c5821e.entry.js +101 -0
  147. package/dist/webcomponents/p-a5fb51dc.entry.js +131 -0
  148. package/dist/webcomponents/p-a6d04afc.js +44 -0
  149. package/dist/webcomponents/p-ac086069.entry.js +58 -0
  150. package/dist/webcomponents/p-af244664.js +126 -1
  151. package/dist/webcomponents/p-b82c146f.entry.js +111 -0
  152. package/dist/webcomponents/p-b8a03a4b.entry.js +131 -0
  153. package/dist/webcomponents/p-ba4bae6f.js +12 -1
  154. package/dist/webcomponents/p-ba5fae28.js +90 -1
  155. package/dist/webcomponents/p-c636f563.entry.js +791 -0
  156. package/dist/webcomponents/p-c86c24d2.entry.js +94 -0
  157. package/dist/webcomponents/p-cb26f708.js +18 -0
  158. package/dist/webcomponents/p-ce733539.entry.js +99 -0
  159. package/dist/webcomponents/p-d17aee2b.entry.js +26 -0
  160. package/dist/webcomponents/p-d5095f6c.entry.js +133 -0
  161. package/dist/webcomponents/p-d89bad72.js +39 -1
  162. package/dist/webcomponents/p-dce846bf.js +27 -1
  163. package/dist/webcomponents/p-df21aaad.js +120 -1
  164. package/dist/webcomponents/p-e1255160.js +3 -1
  165. package/dist/webcomponents/p-e333620e.js +34 -1
  166. package/dist/webcomponents/p-e356f280.entry.js +29 -0
  167. package/dist/webcomponents/p-e3fab0e2.js +43 -1
  168. package/dist/webcomponents/p-ec854a3e.entry.js +11053 -0
  169. package/dist/webcomponents/p-f02b75dc.entry.js +96 -0
  170. package/dist/webcomponents/p-fad19d75.js +1638 -2
  171. package/dist/webcomponents/webcomponents.css +362 -4
  172. package/dist/webcomponents/webcomponents.esm.js +20 -1
  173. package/package.json +2 -4
  174. package/dist/cjs/config-ff2dda66.js +0 -15
  175. package/dist/config.js +0 -11
  176. package/dist/esm/config-476c7241.js +0 -13
  177. package/dist/module/config.js +0 -13
  178. package/dist/types/home/runner/work/web-component-library/web-component-library/packages/webcomponents/.stencil/packages/webcomponents/config.d.ts +0 -11
  179. package/dist/webcomponents/p-07109641.entry.js +0 -1
  180. package/dist/webcomponents/p-0f7b9555.entry.js +0 -1
  181. package/dist/webcomponents/p-17e4246f.entry.js +0 -1
  182. package/dist/webcomponents/p-195f92e9.entry.js +0 -1
  183. package/dist/webcomponents/p-1a43e355.entry.js +0 -19
  184. package/dist/webcomponents/p-23014988.entry.js +0 -1
  185. package/dist/webcomponents/p-25dba252.entry.js +0 -1
  186. package/dist/webcomponents/p-27981600.entry.js +0 -1
  187. package/dist/webcomponents/p-301e0493.entry.js +0 -1
  188. package/dist/webcomponents/p-304dd644.entry.js +0 -1
  189. package/dist/webcomponents/p-30a493cd.entry.js +0 -1
  190. package/dist/webcomponents/p-462dc522.entry.js +0 -1
  191. package/dist/webcomponents/p-487b72a8.entry.js +0 -1
  192. package/dist/webcomponents/p-4abc17f0.entry.js +0 -1
  193. package/dist/webcomponents/p-4b4580dd.js +0 -1
  194. package/dist/webcomponents/p-52021fa1.entry.js +0 -1
  195. package/dist/webcomponents/p-53e64f15.entry.js +0 -1
  196. package/dist/webcomponents/p-60a370fc.entry.js +0 -1
  197. package/dist/webcomponents/p-623a4479.entry.js +0 -1
  198. package/dist/webcomponents/p-62b32c4c.entry.js +0 -1
  199. package/dist/webcomponents/p-63acf322.js +0 -1
  200. package/dist/webcomponents/p-6f03b35a.entry.js +0 -1
  201. package/dist/webcomponents/p-75b4daef.js +0 -1
  202. package/dist/webcomponents/p-8603348a.js +0 -1
  203. package/dist/webcomponents/p-8c1e981b.entry.js +0 -1
  204. package/dist/webcomponents/p-8e541a32.entry.js +0 -1
  205. package/dist/webcomponents/p-9279aa49.entry.js +0 -1
  206. package/dist/webcomponents/p-96b42e7d.entry.js +0 -1
  207. package/dist/webcomponents/p-99022846.entry.js +0 -1
  208. package/dist/webcomponents/p-ae263544.js +0 -1
  209. package/dist/webcomponents/p-b16dfd5d.entry.js +0 -1
  210. package/dist/webcomponents/p-bbed6107.entry.js +0 -1
  211. package/dist/webcomponents/p-bc92235c.entry.js +0 -1
  212. package/dist/webcomponents/p-be39c802.entry.js +0 -1
  213. package/dist/webcomponents/p-c4b87db2.entry.js +0 -1
  214. package/dist/webcomponents/p-c9f8f7ec.entry.js +0 -1
  215. package/dist/webcomponents/p-cd7105dd.entry.js +0 -1
  216. package/dist/webcomponents/p-d101c5db.js +0 -1
  217. package/dist/webcomponents/p-d1fbeae5.entry.js +0 -1
  218. package/dist/webcomponents/p-d8355f91.entry.js +0 -1
  219. package/dist/webcomponents/p-e2c88817.entry.js +0 -1
  220. package/dist/webcomponents/p-e31f0f3e.entry.js +0 -1
  221. package/dist/webcomponents/p-e7067ef2.entry.js +0 -1
  222. package/dist/webcomponents/p-f0866375.entry.js +0 -1
  223. package/dist/webcomponents/p-fb58feb5.entry.js +0 -1
  224. package/dist/webcomponents/p-fe33151d.entry.js +0 -1
@@ -0,0 +1,125 @@
1
+ import { r as registerInstance, h, H as Host } from './p-fad19d75.js';
2
+ import { a as businessServiceReceivedOptions, r as recurringPaymentsOptions, s as seasonalBusinessOptions, b as businessClassificationOptions } from './p-ba5fae28.js';
3
+ import { C as CURRENCY_MASK, T as TAX_ID_MASKS, P as PHONE_MASKS, S as SSN_MASK } from './p-525db3e8.js';
4
+ import { C as CoreBusinessInfo } from './p-af244664.js';
5
+ import { d as deconstructDate } from './p-1ff8810b.js';
6
+ import { S as StateOptions } from './p-6078a370.js';
7
+ import { n as numberOnlyHandler } from './p-8df7bde8.js';
8
+
9
+ const FormAlert = class {
10
+ constructor(hostRef) {
11
+ registerInstance(this, hostRef);
12
+ this.text = undefined;
13
+ this.hideAlert = undefined;
14
+ }
15
+ render() {
16
+ if (!this.text) {
17
+ return null;
18
+ }
19
+ if (this.hideAlert) {
20
+ return null;
21
+ }
22
+ return (h("div", { class: 'alert alert-danger d-flex align-items-center', role: 'alert' }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", fill: "currentColor", class: "bi bi-exclamation-triangle-fill flex-shrink-0 me-2", viewBox: "0 0 16 16", role: "img", "aria-label": "Warning:" }, h("path", { d: "M8.982 1.566a1.13 1.13 0 0 0-1.96 0L.165 13.233c-.457.778.091 1.767.98 1.767h13.713c.889 0 1.438-.99.98-1.767L8.982 1.566zM8 5c.535 0 .954.462.9.995l-.35 3.507a.552.552 0 0 1-1.1 0L7.1 5.995A.905.905 0 0 1 8 5zm.002 6a1 1 0 1 1 0 2 1 1 0 0 1 0-2z" })), h("div", null, this.text)));
23
+ }
24
+ };
25
+
26
+ const AdditionalQuestions = class {
27
+ constructor(hostRef) {
28
+ registerInstance(this, hostRef);
29
+ this.formController = undefined;
30
+ this.errors = {};
31
+ this.additional_questions = {};
32
+ this.inputHandler = this.inputHandler.bind(this);
33
+ }
34
+ componentDidLoad() {
35
+ this.formController.errors.subscribe(errors => (this.errors = Object.assign({}, errors)));
36
+ this.formController.values.subscribe(values => (this.additional_questions = Object.assign({}, values.additional_questions)));
37
+ }
38
+ inputHandler(name, value) {
39
+ this.formController.setValues(Object.assign(Object.assign({}, this.formController.values.getValue()), { additional_questions: Object.assign(Object.assign({}, this.formController.values.getValue().additional_questions), { [name]: value }) }));
40
+ }
41
+ render() {
42
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
43
+ const additionalQuestionsDefaultValue = this.formController.getInitialValues().additional_questions;
44
+ return (h(Host, { key: '61cc057bc6c5776e27de37de03fd89c11e222b48', exportparts: "label,input,input-invalid" }, h("fieldset", { key: 'b979a8632db229a28fe4c7e209963d9750cb3af3' }, h("legend", { key: 'f0228638af05f24d265ff3ff08da34d9026b8bc8' }, "Additional Questions"), h("hr", { key: '985908ab74473185e4f63edf8d2ae67d21aa2c4c' }), h("div", { key: '3e5b107b36d8f02d1a7ec7f5be04cc7560dacb9b', class: "row gy-3" }, h("div", { key: '7bca3143f0e7c813b02b08bf685ed7d83a6f17d3', class: "col-12 col-md-6" }, h("form-control-monetary", { key: '7b96fb49733b41cb4a100d9fbdf85054409d46d8', name: "business_revenue", label: "What is the business' estimated annual revenue from its primary business activities?", inputHandler: this.inputHandler, errorText: (_b = (_a = this.errors) === null || _a === void 0 ? void 0 : _a.additional_questions) === null || _b === void 0 ? void 0 : _b.business_revenue, defaultValue: additionalQuestionsDefaultValue === null || additionalQuestionsDefaultValue === void 0 ? void 0 : additionalQuestionsDefaultValue.business_revenue, maskOptions: CURRENCY_MASK.WHOLE })), h("div", { key: '3103b2355eccb404733e25b1a812faf7d33643de', class: "col-12 col-md-6" }, h("form-control-monetary", { key: '2bd4f9de5e18f8e9f7337e09b20ef2027f8efe10', name: "business_payment_volume", label: "What is the business' annual credit card & ACH volume anticipated to process?", inputHandler: this.inputHandler, errorText: (_d = (_c = this.errors) === null || _c === void 0 ? void 0 : _c.additional_questions) === null || _d === void 0 ? void 0 : _d.business_payment_volume, defaultValue: additionalQuestionsDefaultValue === null || additionalQuestionsDefaultValue === void 0 ? void 0 : additionalQuestionsDefaultValue.business_payment_volume, maskOptions: CURRENCY_MASK.WHOLE })), h("div", { key: '3947678da024eacc36a4895dc82133543904ec10', class: "col-12" }, h("form-control-select", { key: 'cb6473c4ca9b410e1f73fb6821a1e6a9c4e8ba3c', name: 'business_when_service_received', label: 'On average, how long after paying will your customers typically receive their goods or services?', inputHandler: this.inputHandler, errorText: (_f = (_e = this.errors) === null || _e === void 0 ? void 0 : _e.additional_questions) === null || _f === void 0 ? void 0 : _f.business_when_service_received, options: businessServiceReceivedOptions, defaultValue: additionalQuestionsDefaultValue === null || additionalQuestionsDefaultValue === void 0 ? void 0 : additionalQuestionsDefaultValue.business_when_service_received })), h("div", { key: '3ba6b5469e8b55fdf9607458ea82db534060b4da', class: "col-12" }, h("form-control-select", { key: '9239ce8bf9b5f54847dcd946b70b84cb2b188476', name: 'business_recurring_payments', label: 'Does your business offer recurring payments?', inputHandler: this.inputHandler, errorText: (_h = (_g = this.errors) === null || _g === void 0 ? void 0 : _g.additional_questions) === null || _h === void 0 ? void 0 : _h.business_recurring_payments, options: recurringPaymentsOptions, defaultValue: additionalQuestionsDefaultValue === null || additionalQuestionsDefaultValue === void 0 ? void 0 : additionalQuestionsDefaultValue.business_recurring_payments })), h("div", { key: '3acb380a8932d9df99c1bec4bf77806d23f16376', class: "col-12" }, h("form-control-text", { key: '71a01a5936b25f95ecd1d7a4ae926c34f0ab8f42', name: 'business_recurring_payments_percentage', label: 'What percent of revenue is generated from each recurring payment type offered?', inputHandler: this.inputHandler, errorText: (_k = (_j = this.errors) === null || _j === void 0 ? void 0 : _j.additional_questions) === null || _k === void 0 ? void 0 : _k.business_recurring_payments_percentage, defaultValue: additionalQuestionsDefaultValue === null || additionalQuestionsDefaultValue === void 0 ? void 0 : additionalQuestionsDefaultValue.business_recurring_payments_percentage })), h("div", { key: 'e31135b0483e5ab0e71ad4126bed49c2ce8e2f2d', class: "col-12" }, h("form-control-select", { key: '00c4567411859e568ac6c8663476d8a35e11dd59', name: 'business_seasonal', label: 'Is this business seasonal?', inputHandler: this.inputHandler, errorText: (_m = (_l = this.errors) === null || _l === void 0 ? void 0 : _l.additional_questions) === null || _m === void 0 ? void 0 : _m.business_seasonal, options: seasonalBusinessOptions, defaultValue: additionalQuestionsDefaultValue === null || additionalQuestionsDefaultValue === void 0 ? void 0 : additionalQuestionsDefaultValue.business_seasonal })), h("div", { key: 'f30fdb514b300844feb0a0c1bb2492d234f5f050', class: "col-12" }, h("form-control-text", { key: '6d7cf0947be6991725bee50c2fcad1298677d5e3', name: 'business_other_payment_details', label: 'Is there anything else you would like us to know about how your customers pay the business?', inputHandler: this.inputHandler, errorText: (_p = (_o = this.errors) === null || _o === void 0 ? void 0 : _o.additional_questions) === null || _p === void 0 ? void 0 : _p.business_other_payment_details, defaultValue: additionalQuestionsDefaultValue === null || additionalQuestionsDefaultValue === void 0 ? void 0 : additionalQuestionsDefaultValue.business_other_payment_details }))))));
45
+ }
46
+ };
47
+
48
+ const BusinessCoreInfo = class {
49
+ constructor(hostRef) {
50
+ registerInstance(this, hostRef);
51
+ this.formController = undefined;
52
+ this.errors = {};
53
+ this.coreInfo = {};
54
+ this.inputHandler = this.inputHandler.bind(this);
55
+ }
56
+ componentDidLoad() {
57
+ this.formController.values.subscribe(values => (this.coreInfo = Object.assign({}, new CoreBusinessInfo(values))));
58
+ this.formController.errors.subscribe(errors => {
59
+ this.errors = Object.assign({}, errors);
60
+ });
61
+ }
62
+ inputHandler(name, value) {
63
+ this.formController.setValues(Object.assign(Object.assign({}, this.formController.values.getValue()), { [name]: value }));
64
+ }
65
+ render() {
66
+ const coreInfoDefaultValue = this.formController.getInitialValues();
67
+ return (h(Host, { key: '59fa8a9a4bef1875845633b66b60ebf2350fe61e', exportparts: "label,input,input-invalid" }, h("fieldset", { key: '7b6c58d55cf2ed0f5020f043e164c63423d9ee4f' }, h("legend", { key: '5be18bc86f27541d7c6bb4ea4e05e3df4c9d87c0' }, "General Info"), h("hr", { key: '33747ac14e24ef2ecf9e84970cd8924b9f5a5c53' }), h("div", { key: '3d550cac878b9676d620fbea3c14dacf4db4e72f', class: "row gy-3" }, h("div", { key: 'd2226f4bdbbd87169d1ef75f9ffc1d7f6a6acba7', class: "col-12" }, h("form-control-text", { key: '4367c1eeec808b9b134c880be587f58327778bb2', name: "legal_name", label: "Legal Name", defaultValue: coreInfoDefaultValue.legal_name, errorText: this.errors.legal_name, inputHandler: this.inputHandler })), h("div", { key: '455cacee1c69e28fc447e893bf648ff30946f66f', class: "col-12" }, h("form-control-text", { key: '1ea37fac67414741edab132c0b8d70c84cb4f1db', name: "doing_business_as", label: "Doing Business As (DBA)", defaultValue: coreInfoDefaultValue.doing_business_as, errorText: this.errors.doing_business_as, inputHandler: this.inputHandler })), h("div", { key: '3da63dd018d2503a9b47a2b0950f95ce887ba38d', class: "col-12 col-md-8" }, h("form-control-select", { key: 'a059c7fda30418c4338ac58630170104d616c0f2', name: "classification", label: "Business Classification", options: businessClassificationOptions, defaultValue: coreInfoDefaultValue.classification, errorText: this.errors.classification, inputHandler: this.inputHandler })), h("div", { key: '9157cac7c6999b25c8acf4e698d082a0fcbffe9d', class: "col-12 col-md-4" }, h("form-control-date", { key: '0726e93b8f6b2bd792102bb131c13e0806717f82', name: "date_of_incorporation", label: "Date of Incorporation", defaultValue: coreInfoDefaultValue.date_of_incorporation, errorText: this.errors.date_of_incorporation, inputHandler: this.inputHandler })), h("div", { key: 'f3391ac0166116ef685c6d26e6d0705d087fa83d', class: "col-12 col-md-6" }, h("form-control-text", { key: '682a18784fab9410002c7949a7cfa606f3ec5784', name: "industry", label: "Industry", defaultValue: coreInfoDefaultValue.industry, errorText: this.errors.industry, inputHandler: this.inputHandler })), h("div", { key: '4a2d95cc422ebc882e2a47237f5b1324a7660b36', class: "col-12 col-md-6" }, h("form-control-number-masked", { key: '0d138b6bafde2b5fc7c45f9d4d51746e5f91baaa', name: "tax_id", label: "Tax ID", defaultValue: coreInfoDefaultValue.tax_id, errorText: this.errors.tax_id, inputHandler: this.inputHandler, mask: TAX_ID_MASKS.US })), h("div", { key: 'a895244496b196804a16931589f6f353c49476e8', class: "col-12" }, h("form-control-text", { key: '68375469c212b97e76861e5b8590dd502533a35a', name: "website_url", label: "Website URL", defaultValue: coreInfoDefaultValue.website_url, errorText: this.errors.website_url, inputHandler: this.inputHandler })), h("div", { key: '84d1a7f2b51b6dae3283bbd6d0f5aca81a0da07b', class: "col-12 col-md-6" }, h("form-control-text", { key: '27f9dd986a431fa14028f1faa3997bbdb623574e', name: "email", label: "Email Address", defaultValue: coreInfoDefaultValue.email, errorText: this.errors.email, inputHandler: this.inputHandler })), h("div", { key: '0902cff0a887d5f19c5326ce135fed5f54d6643a', class: "col-12 col-md-6" }, h("form-control-number-masked", { key: 'bbce92814cbf42f17a0a9e1e1df194d3ea3a15b0', name: "phone", label: "Phone Number", defaultValue: coreInfoDefaultValue.phone, errorText: this.errors.phone, inputHandler: this.inputHandler, mask: PHONE_MASKS.US }))))));
68
+ }
69
+ };
70
+
71
+ const BusinessRepresentative = class {
72
+ constructor(hostRef) {
73
+ registerInstance(this, hostRef);
74
+ this.inputHandler = (name, value) => {
75
+ this.formController.setValues(Object.assign(Object.assign({}, this.formController.values.getValue()), { representative: Object.assign(Object.assign({}, this.formController.values.getValue().representative), { [name]: value }) }));
76
+ };
77
+ this.onAddressFormUpdate = (values) => {
78
+ this.formController.setValues(Object.assign(Object.assign({}, this.formController.values.getValue()), { representative: Object.assign(Object.assign({}, this.formController.values.getValue().representative), { address: Object.assign(Object.assign({}, this.formController.values.getValue().representative.address), values) }) }));
79
+ };
80
+ this.onDateOfBirthUpdate = (event) => {
81
+ const dob_values = deconstructDate(event.detail);
82
+ this.formController.setValues(Object.assign(Object.assign({}, this.formController.values.getValue()), { representative: Object.assign(Object.assign({}, this.formController.values.getValue().representative), { dob_day: dob_values.dob_day, dob_month: dob_values.dob_month, dob_year: dob_values.dob_year }) }));
83
+ };
84
+ this.formController = undefined;
85
+ this.errors = {};
86
+ this.representative = {};
87
+ }
88
+ get identificationNumberLabel() {
89
+ return this.representative.ssn_last4 ? 'Update SSN (optional)' : 'SSN';
90
+ }
91
+ componentDidLoad() {
92
+ this.formController.errors.subscribe(errors => (this.errors = Object.assign({}, errors.representative)));
93
+ this.formController.values.subscribe(values => (this.representative = Object.assign({}, values.representative)));
94
+ }
95
+ render() {
96
+ const representativeDefaultValue = this.formController.getInitialValues().representative;
97
+ return (h(Host, { key: '857634ffd34ea218dce687fb0eaa95830a58bfb1', exportparts: "label,input,input-invalid" }, h("fieldset", { key: 'b3b073dc456e58c4fa67182ea3518581038419e3' }, h("legend", { key: '3c1997f718c340b5dd32e4cdbe9400d64eecf577' }, "Representative"), h("hr", { key: 'd51e5d797106af2050b884fc09802c497a180e1d' }), h("div", { key: '7e5631f8eb5c28f0a5c4193ece3039a3adc35d0a', class: "row gy-3" }, h("div", { key: '399a1f505781ed0b82fa85366ca66580e977f3e5', class: "col-12 col-md-8" }, h("form-control-text", { key: '0820b8e0b6178b997ba1938efc045ad334f061d3', name: "name", label: "Full Name", defaultValue: representativeDefaultValue === null || representativeDefaultValue === void 0 ? void 0 : representativeDefaultValue.name, errorText: this.errors.name, inputHandler: this.inputHandler })), h("div", { key: '2bb15a86304ce8755e1183835c0ed7c310a0e8b2', class: "col-12 col-md-4" }, h("form-control-text", { key: '2cc405cea169ec1bd5d72b110ce403101d029fff', name: "title", label: "Title", defaultValue: representativeDefaultValue === null || representativeDefaultValue === void 0 ? void 0 : representativeDefaultValue.title, errorText: this.errors.title, inputHandler: this.inputHandler })), h("div", { key: 'd2927f863bd374c38b8028a148568068144294d7', class: "col-12 col-md-6" }, h("form-control-text", { key: '0fa24fa492e060978facf23aac2b151595bb129c', name: "email", label: "Email Address", defaultValue: representativeDefaultValue === null || representativeDefaultValue === void 0 ? void 0 : representativeDefaultValue.email, errorText: this.errors.email, inputHandler: this.inputHandler })), h("div", { key: '8c9f75ebc3c5d87fafaff48e489ad5dc091fbca4', class: "col-12 col-md-6" }, h("form-control-number-masked", { key: 'f060196556cd11d9f68dab3aa7e87cba24e38afe', name: "phone", label: "Phone Number", defaultValue: representativeDefaultValue === null || representativeDefaultValue === void 0 ? void 0 : representativeDefaultValue.phone, errorText: this.errors.phone, inputHandler: this.inputHandler, mask: PHONE_MASKS.US })), h("div", { key: '19f7bcd2a18ef1f8c937a90602bdd9f0ac8f91e5', class: "col-12 col-md-4" }, h("form-control-date", { key: '5392a1ce2cbb43a88c2d90981b56ef55ba4fdb31', name: "dob_full", label: "Birth Date", defaultValue: representativeDefaultValue === null || representativeDefaultValue === void 0 ? void 0 : representativeDefaultValue.dob_full, errorText: this.errors.dob_full, inputHandler: this.inputHandler, onFormControlInput: this.onDateOfBirthUpdate })), h("div", { key: '36203f898451d610b34afabc4bac9e20f01e53f7', class: "col-12 col-md-8" }, h("form-control-number-masked", { key: '4d4b9e4dcc0f5829068d4916d7373f6506ee9e74', name: "identification_number", label: this.identificationNumberLabel, defaultValue: representativeDefaultValue === null || representativeDefaultValue === void 0 ? void 0 : representativeDefaultValue.identification_number, errorText: this.errors.identification_number, inputHandler: this.inputHandler, mask: SSN_MASK })), h("div", { key: '560e1dabe186e54a201ad02fb9054505ab5bb84c', class: "col-12" }, h("justifi-identity-address-form", { key: 'b47b48c19ca88248a9609c0e1858ba649f44c2da', errors: this.errors.address, defaultValues: representativeDefaultValue === null || representativeDefaultValue === void 0 ? void 0 : representativeDefaultValue.address, handleFormUpdate: this.onAddressFormUpdate }))))));
98
+ }
99
+ };
100
+
101
+ const LegalAddressForm = class {
102
+ constructor(hostRef) {
103
+ registerInstance(this, hostRef);
104
+ this.formController = undefined;
105
+ this.errors = {};
106
+ this.legal_address = undefined;
107
+ this.inputHandler = this.inputHandler.bind(this);
108
+ }
109
+ componentDidLoad() {
110
+ this.formController.errors.subscribe(errors => (this.errors = Object.assign({}, errors)));
111
+ this.formController.values.subscribe(values => (this.legal_address = Object.assign({}, values.legal_address)));
112
+ }
113
+ inputHandler(name, value) {
114
+ this.formController.setValues(Object.assign(Object.assign({}, this.formController.values.getValue()), { legal_address: Object.assign(Object.assign({}, this.formController.values.getValue().legal_address), { [name]: value }) }));
115
+ }
116
+ render() {
117
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
118
+ const legalAddressDefaultValue = this.formController.getInitialValues().legal_address;
119
+ return (h(Host, { key: '794669fd0c563f54abde94146df007b114c30465', exportparts: "label,input,input-invalid" }, h("fieldset", { key: '34cf40bcf68c4b0af97363700ede8d5ef778c38c' }, h("legend", { key: 'deb0acfa3da0128a9337ddddd76592d7569685c6' }, "Business Legal Address"), h("hr", { key: '1d01aa0b9577c47c24af4e85728828d41164c5ee' }), h("div", { key: '2199ba800c530bb9a5704431103660a39bdf70fb', class: "row gy-3" }, h("div", { key: '811fa71f919e62d6ecf44fd97e5940473bdb2a51', class: "col-12" }, h("form-control-text", { key: '06305b11aecb6b49bc8d3c0b39b8652f3968083e', name: "line1", label: "Legal Address", inputHandler: this.inputHandler, defaultValue: legalAddressDefaultValue === null || legalAddressDefaultValue === void 0 ? void 0 : legalAddressDefaultValue.line1, errorText: (_b = (_a = this.errors) === null || _a === void 0 ? void 0 : _a.legal_address) === null || _b === void 0 ? void 0 : _b.line1 })), h("div", { key: 'c1a2aad7893ac8f5aed57e662ce0704a4e0ed2fa', class: "col-12" }, h("form-control-text", { key: '858e3e7be65828a89b07f954e82033c76f4ab350', name: "line2", label: "Address Line 2", inputHandler: this.inputHandler, defaultValue: legalAddressDefaultValue === null || legalAddressDefaultValue === void 0 ? void 0 : legalAddressDefaultValue.line2, errorText: (_d = (_c = this.errors) === null || _c === void 0 ? void 0 : _c.legal_address) === null || _d === void 0 ? void 0 : _d.line2 })), h("div", { key: '641805ddb44395c77020e708b60ff2a09ffc5d5b', class: "col-12" }, h("form-control-text", { key: '6d881c0aacf9a689305a15f353d376917a6e8aff', name: "city", label: "City", inputHandler: this.inputHandler, defaultValue: legalAddressDefaultValue === null || legalAddressDefaultValue === void 0 ? void 0 : legalAddressDefaultValue.city, errorText: (_f = (_e = this.errors) === null || _e === void 0 ? void 0 : _e.legal_address) === null || _f === void 0 ? void 0 : _f.city })), h("div", { key: '6bab46c2823b9da84ac66496b80a4f98d237ccfe', class: "col-12" }, h("form-control-select", { key: '0cc60022e6862884df786ea7414cf4cae4c45728', name: "state", label: "State", options: StateOptions, inputHandler: this.inputHandler, defaultValue: legalAddressDefaultValue === null || legalAddressDefaultValue === void 0 ? void 0 : legalAddressDefaultValue.state, errorText: (_h = (_g = this.errors) === null || _g === void 0 ? void 0 : _g.legal_address) === null || _h === void 0 ? void 0 : _h.state })), h("div", { key: 'ff349be7524f3b3fc7a3adee03259f7b8bf10390', class: "col-12" }, h("form-control-text", { key: '015277e0bde6a15077744f9d09bc016a0db4b465', name: "postal_code", label: "Postal Code", inputHandler: this.inputHandler, defaultValue: legalAddressDefaultValue === null || legalAddressDefaultValue === void 0 ? void 0 : legalAddressDefaultValue.postal_code, errorText: (_k = (_j = this.errors) === null || _j === void 0 ? void 0 : _j.legal_address) === null || _k === void 0 ? void 0 : _k.postal_code, maxLength: 5, keyDownHandler: numberOnlyHandler })), h("div", { key: 'd6097ef782c0d47a2d93c4624635e7f820dac95d', class: "col-12" }, h("form-control-select", { key: '396a8c6bc10f288bde9289b7177c161e42f60b7e', name: "country", label: "Country", options: [{ label: 'United States', value: 'USA' }], inputHandler: this.inputHandler, defaultValue: legalAddressDefaultValue === null || legalAddressDefaultValue === void 0 ? void 0 : legalAddressDefaultValue.country, errorText: (_m = (_l = this.errors) === null || _l === void 0 ? void 0 : _l.legal_address) === null || _m === void 0 ? void 0 : _m.country,
120
+ // just for now so we skip handling country specificities
121
+ disabled: true }))))));
122
+ }
123
+ };
124
+
125
+ export { FormAlert as form_alert, AdditionalQuestions as justifi_additional_questions, BusinessCoreInfo as justifi_business_core_info, BusinessRepresentative as justifi_business_representative, LegalAddressForm as justifi_legal_address_form };
@@ -0,0 +1,101 @@
1
+ import { r as registerInstance, c as createEvent, h } from './p-fad19d75.js';
2
+ import { c as create$3, d as create$5, F as FormController } from './p-2eab3c90.js';
3
+ import { A as Api } from './p-29c0b182.js';
4
+ import './p-56f6ce4c.js';
5
+ import './p-df21aaad.js';
6
+ import './p-e3fab0e2.js';
7
+ import { C as CURRENCY_MASK } from './p-525db3e8.js';
8
+ import { S as StyledHost } from './p-ba4bae6f.js';
9
+
10
+ const RefundFormSchema = create$3().shape({
11
+ amount: create$5()
12
+ .required('Amount is required')
13
+ .typeError('Amount must be a number')
14
+ .positive('Amount must be positive')
15
+ .test('amount', 'Refund amount cannot be more than the original payment amount', function (value) {
16
+ return value <= this.options.context.amount;
17
+ })
18
+ .nullable(),
19
+ });
20
+
21
+ const refundFormCss = ":host{display:block}*::part(input){font-family:var(--jfi-layout-font-family);background-color:var(--jfi-form-control-background-color);border-color:var(--jfi-form-control-border-color);border-width:var(--jfi-form-control-border-width);border-bottom-width:var(--jfi-form-control-border-bottom-width);border-left-width:var(--jfi-form-control-border-left-width);border-right-width:var(--jfi-form-control-border-right-width);border-top-width:var(--jfi-form-control-border-top-width);border-radius:var(--jfi-form-control-border-radius);border-style:var(--jfi-form-control-border-style);box-shadow:var(--jfi-form-control-box-shadow);color:var(--jfi-form-control-color);font-size:var(--jfi-form-control-font-size);font-weight:var(--jfi-form-control-font-weight);line-height:var(--jfi-form-control-line-height);margin:var(--jfi-form-control-margin);padding:var(--jfi-form-control-padding)}*::part(input):focus{color:var(--jfi-form-control-color-focus);border-color:var(--jfi-form-control-border-color-focus);box-shadow:var(--jfi-form-control-box-shadow-focus)}.btn{font-family:var(--jfi-layout-font-family);color:var(--jfi-submit-button-color);background-color:var(--jfi-submit-button-background-color);border-color:var(--jfi-submit-button-border-color);padding:var(--jfi-submit-button-padding);font-size:var(--jfi-submit-button-font-size);border-radius:var(--jfi-submit-button-border-radius);width:var(--jfi-submit-button-width);box-shadow:var(--jfi-submit-button-box-shadow)}.btn:hover{color:var(--jfi-submit-button-color-hover);background-color:var(--jfi-submit-button-background-color-hover);border-color:var(--jfi-submit-button-border-color-hover)}.btn:focus{color:var(--jfi-submit-button-color-focus);background-color:var(--jfi-submit-button-background-color-focus);border-color:var(--jfi-submit-button-border-color-focus)}.btn:active{color:var(--jfi-submit-button-color-active);background-color:var(--jfi-submit-button-background-color-active);border-color:var(--jfi-submit-button-border-color-active)}";
22
+ const JustifiRefundFormStyle0 = refundFormCss;
23
+
24
+ const RefundForm = class {
25
+ constructor(hostRef) {
26
+ registerInstance(this, hostRef);
27
+ this.submitted = createEvent(this, "submitted", 7);
28
+ this.authToken = undefined;
29
+ this.paymentId = undefined;
30
+ this.amount = 0;
31
+ this.submitButtonText = 'Submit';
32
+ this.withButton = undefined;
33
+ this.refundInfoText = undefined;
34
+ this.errors = {};
35
+ this.isSubmitting = false;
36
+ }
37
+ componentWillLoad() {
38
+ this.formController = new FormController(RefundFormSchema);
39
+ this.formController.setInitialValues({
40
+ amount: this.amount,
41
+ message: '',
42
+ });
43
+ this.initializeApi();
44
+ }
45
+ componentDidLoad() {
46
+ this.formController.errors.subscribe(errors => {
47
+ this.errors = Object.assign({}, errors);
48
+ });
49
+ }
50
+ /**
51
+ * Handles the form submission.
52
+ * Prevents the default form action, validates the form, and emits the 'submitted' event.
53
+ */
54
+ async handleSubmit(event) {
55
+ event.preventDefault();
56
+ this.formController.validateAndSubmit(this.submitRefund.bind(this), {
57
+ amount: this.amount,
58
+ });
59
+ }
60
+ /**
61
+ * Submits the refund request to the API.
62
+ */
63
+ async submitRefund() {
64
+ this.isSubmitting = true;
65
+ const refundFields = this.formController.values.getValue();
66
+ try {
67
+ await this.api.post(`payments/${this.paymentId}/refunds`, refundFields);
68
+ this.submitted.emit(refundFields);
69
+ }
70
+ catch (error) {
71
+ console.error('Error submitting refund:', error);
72
+ this.submitted.emit(error);
73
+ }
74
+ finally {
75
+ this.isSubmitting = false;
76
+ }
77
+ }
78
+ /**
79
+ * Handles input changes, updating the refundFields state.
80
+ */
81
+ handleInput(field, value) {
82
+ this.formController.setValues(Object.assign(Object.assign({}, this.formController.values.getValue()), { [field]: value }));
83
+ }
84
+ /**
85
+ * Initializes the API with the given authentication token.
86
+ * Logs a warning if the auth token is missing.
87
+ */
88
+ initializeApi() {
89
+ if (!this.authToken) {
90
+ console.warn('Warning: Missing auth-token.');
91
+ }
92
+ this.api = Api({ authToken: this.authToken, apiOrigin: undefined });
93
+ }
94
+ render() {
95
+ var _a;
96
+ return (h(StyledHost, { key: '8d31f1a9bf936c9e11f8eca1dc55e614b9fa5939' }, h("h1", { key: 'be589740535ee8a5ab6d4af7151d7ae026f08002' }, "Refund"), this.refundInfoText && (h("div", { key: 'b1d40507dec53bac422f99a3d62678c78c0c2038', class: "d-flex align-items-center flex-row gap-4 border-top border-bottom my-4 p-3", role: "alert" }, h("img", { key: 'cc76014eef0d826bec5ec09355dc5fc747fd2070', src: "/info-icon.svg", alt: "Information", height: "30", width: "30" }), h("p", { key: 'c2efa0f2acdf3faaa6e2974d0535f48799e3cbbd', class: "m-0", innerHTML: this.refundInfoText }))), h("form", { key: '68220114781378f6507651414c87532171bebb31', onSubmit: e => this.handleSubmit(e), class: "d-grid gap-4" }, h("div", { key: '075545e9837316fe160760e0dba9a5104654dd2b', class: "form-group" }, h("form-control-monetary", { key: 'c8ff8a822d2b74b2f80b33cd6cd2b42ceebbff11', name: "amount", label: "Refund Amount", defaultValue: ((_a = this.amount) === null || _a === void 0 ? void 0 : _a.toString()) || '', maskOptions: CURRENCY_MASK.DECIMAL, inputHandler: (name, value) => this.handleInput(name, value), errorText: this.errors.amount })), h("div", { key: '92093284e763466be5138ea6d788145d5d47bd87', class: "form-group" }, h("form-control-text", { key: 'ddf9e221d43d84ad7436261c5755e673224aa82e', name: "notes", label: "Additional Notes", inputHandler: (name, value) => this.handleInput(name, value), errorText: this.errors.notes })), this.withButton && (h("div", { key: '58abbbabce09d82da4032ef0e08e6cfac1433153', class: "form-group d-flex flex-row-reverse" }, h("button", { key: '3e703ef633e0d45ba70425dc6d58bcd2d590ce1b', type: "submit", disabled: !!this.isSubmitting, class: "btn btn-primary ml-auto" }, this.submitButtonText))))));
97
+ }
98
+ };
99
+ RefundForm.style = JustifiRefundFormStyle0;
100
+
101
+ export { RefundForm as justifi_refund_form };
@@ -0,0 +1,131 @@
1
+ import { r as registerInstance, c as createEvent, h } from './p-fad19d75.js';
2
+ import { p as pagingDefaults } from './p-56f6ce4c.js';
3
+ import './p-df21aaad.js';
4
+ import './p-e3fab0e2.js';
5
+ import { b as formatDate, c as formatTime, f as formatCurrency, M as MapPaymentStatusToBadge } from './p-83125497.js';
6
+ import { t as tableExportedParts } from './p-2b6c9c4f.js';
7
+ import { S as StyledHost } from './p-ba4bae6f.js';
8
+ import { T as TableLoadingState, a as TableEmptyState, b as TableErrorState } from './p-e333620e.js';
9
+
10
+ const PaymentsListCore = class {
11
+ constructor(hostRef) {
12
+ registerInstance(this, hostRef);
13
+ this.rowClicked = createEvent(this, "payment-row-clicked", 7);
14
+ this.errorEvent = createEvent(this, "error-event", 7);
15
+ this.handleClickPrevious = (beforeCursor) => {
16
+ const newParams = Object.assign({}, this.params);
17
+ delete newParams.after_cursor;
18
+ this.params = Object.assign(Object.assign({}, newParams), { before_cursor: beforeCursor });
19
+ };
20
+ this.handleClickNext = (afterCursor) => {
21
+ const newParams = Object.assign({}, this.params);
22
+ delete newParams.before_cursor;
23
+ this.params = Object.assign(Object.assign({}, newParams), { after_cursor: afterCursor });
24
+ };
25
+ this.rowClickHandler = (e) => {
26
+ const clickedPaymentID = e.target.closest('tr').dataset.rowEntityId;
27
+ if (!clickedPaymentID)
28
+ return;
29
+ this.rowClicked.emit(this.payments.find((payment) => payment.id === clickedPaymentID));
30
+ };
31
+ this.handleDateChange = (name, value) => {
32
+ this.params = Object.assign(Object.assign({}, this.params), { [name]: value });
33
+ };
34
+ this.getPayments = undefined;
35
+ this.payments = [];
36
+ this.loading = true;
37
+ this.errorMessage = undefined;
38
+ this.paging = pagingDefaults;
39
+ this.params = undefined;
40
+ }
41
+ updateOnPropChange() {
42
+ this.fetchData();
43
+ }
44
+ componentWillLoad() {
45
+ if (this.getPayments) {
46
+ this.fetchData();
47
+ }
48
+ }
49
+ fetchData() {
50
+ this.loading = true;
51
+ this.getPayments({
52
+ params: this.params,
53
+ onSuccess: ({ payments, pagingInfo }) => {
54
+ this.payments = payments;
55
+ this.paging = pagingInfo;
56
+ this.loading = false;
57
+ },
58
+ onError: ({ error, code, severity }) => {
59
+ this.errorMessage = error;
60
+ this.errorEvent.emit({
61
+ errorCode: code,
62
+ message: error,
63
+ severity,
64
+ });
65
+ this.loading = false;
66
+ },
67
+ });
68
+ }
69
+ get entityId() {
70
+ return this.payments.map((payment) => payment.id);
71
+ }
72
+ get columnData() {
73
+ return [
74
+ ['Made On', 'The date and time each payment was made'],
75
+ ['Amount', 'The dollar amount of each payment'],
76
+ ['Description', 'The payment description, if you provided one'],
77
+ ['Cardholder', 'The name associated with the payment method'],
78
+ ['Payment Method', 'The brand and last 4 digits of the payment method'],
79
+ ['Status', 'The current status of each payment'],
80
+ ['Payment ID', 'The unique identifier of each payment'],
81
+ ];
82
+ }
83
+ get rowData() {
84
+ return this.payments.map((payment) => [
85
+ {
86
+ type: 'head',
87
+ value: `
88
+ <div class='fw-bold'>${formatDate(payment.created_at)}</div>
89
+ <div class='fw-bold'>${formatTime(payment.created_at)}</div>
90
+ `,
91
+ },
92
+ formatCurrency(payment.amount),
93
+ payment.description,
94
+ payment.payment_method.payersName,
95
+ payment.payment_method.lastFourDigits,
96
+ {
97
+ type: 'inner',
98
+ value: MapPaymentStatusToBadge(payment.status),
99
+ },
100
+ payment.id,
101
+ ]);
102
+ }
103
+ get showEmptyState() {
104
+ return !this.loading && !this.errorMessage && this.rowData.length < 1;
105
+ }
106
+ get showErrorState() {
107
+ return !this.loading && !!this.errorMessage;
108
+ }
109
+ get showRowData() {
110
+ return !this.showEmptyState && !this.showErrorState;
111
+ }
112
+ render() {
113
+ var _a, _b;
114
+ return (h(StyledHost, { key: 'e4a4b64b2927a009f7ad4e9e2ebb4c020401423c', exportparts: tableExportedParts }, h("div", { key: '6ac1c84338b84972ca9b001ecd2b90134c99de6b', class: "row gy-3 mb-4" }, h("div", { key: '1d279ec66bc0755b876e29f06ac24d51baa77caa', class: "col-2" }, h("form-control-date", { key: '65b29c031021f3f782c9a4597167dc5e3a44e7da', name: "created_after", label: "Start Date", inputHandler: this.handleDateChange })), h("div", { key: 'a032497a94cc8108fda6efbb741069407e1a5afe', class: "col-2" }, h("form-control-date", { key: '5dd62ebdbf3836567a9ccb03dec850ebe675cb79', name: "created_before", label: "End Date", inputHandler: this.handleDateChange }))), h("div", { key: 'be4094afd3aec1d742d9d3245c2f6fc50cb95fa0', class: "table-wrapper" }, h("table", { key: 'ed493e35f2bddd59d1034dffe2bcd8b54a6390d6', class: "table table-hover" }, h("thead", { key: 'fae77bda1ffc35ac5414743ab51c2fe1dfbbc29e', class: "table-head sticky-top", part: "table-head" }, h("tr", { key: '5be3b1e9883d337046c386046565fb6ac3366324', class: "table-light text-nowrap", part: "table-head-row" }, (_a = this.columnData) === null || _a === void 0 ? void 0 : _a.map((column) => (h("th", { part: "table-head-cell", scope: "col", title: Array.isArray(column) ? column[1] : '' }, !Array.isArray(column) ? column : column[0]))))), h("tbody", { key: 'ba950a1da1ec0dffd7bc8457cdb3ce65d0f8b69b', class: "table-body", part: "table-body" }, h(TableLoadingState, { key: '8d13d8f6b64377f560d06410c09d24293708b6a8', columnSpan: this.columnData.length, isLoading: this.loading }), h(TableEmptyState, { key: 'c75d61977b26ca5d4aa3711bae1ce6e571b3e3b2', isEmpty: this.showEmptyState, columnSpan: this.columnData.length }), h(TableErrorState, { key: '08e3f88116de5783f018a0c06d21d0d9cc4f5feb', columnSpan: this.columnData.length, errorMessage: this.errorMessage }), this.showRowData &&
115
+ this.rowData.map((data, index) => (h("tr", { "data-test-id": "table-row", "data-row-entity-id": this.entityId[index], onClick: this.rowClickHandler, part: `table-row ${index % 2 ? 'table-row-even' : 'table-row-odd'}` }, data.map((dataEntry) => {
116
+ let nestedHtml = dataEntry === null || dataEntry === void 0 ? void 0 : dataEntry.type;
117
+ if (nestedHtml) {
118
+ return h("td", { part: "table-cell", innerHTML: dataEntry.value });
119
+ }
120
+ else {
121
+ return h("td", { part: "table-cell" }, dataEntry);
122
+ }
123
+ }))))), this.paging && (h("tfoot", { key: '728f671ab03923c90e11901a0d3aac4bc30e72a7', class: "sticky-bottom" }, h("tr", { key: 'd0df9b7c857287eec9568157ecf8f547a01f2fc5', class: "table-light align-middle" }, h("td", { key: 'e0de54912240b3e812f37ea675b2eef50d9545c4', part: "pagination-bar", colSpan: (_b = this.columnData) === null || _b === void 0 ? void 0 : _b.length }, h("pagination-menu", { key: 'f2d7846030a5aaa0c2311cad61f4d5865440a904', paging: Object.assign(Object.assign({}, this.paging), { handleClickPrevious: this.handleClickPrevious, handleClickNext: this.handleClickNext }), params: this.params })))))))));
124
+ }
125
+ static get watchers() { return {
126
+ "params": ["updateOnPropChange"],
127
+ "getPayments": ["updateOnPropChange"]
128
+ }; }
129
+ };
130
+
131
+ export { PaymentsListCore as payments_list_core };
@@ -0,0 +1,44 @@
1
+ import { A as Api } from './p-29c0b182.js';
2
+ import './p-56f6ce4c.js';
3
+ import './p-df21aaad.js';
4
+ import './p-e3fab0e2.js';
5
+ import { C as ComponentErrorSeverity } from './p-14c91ffd.js';
6
+ import { g as getErrorMessage, a as getErrorCode } from './p-8115b2f4.js';
7
+
8
+ class PayoutService {
9
+ async fetchPayouts(accountId, authToken, params) {
10
+ const api = Api({ authToken, apiOrigin: undefined });
11
+ const endpoint = `account/${accountId}/payouts`;
12
+ return api.get(endpoint, params);
13
+ }
14
+ async fetchPayout(payoutId, authToken) {
15
+ const api = Api({ authToken, apiOrigin: undefined });
16
+ const endpoint = `payouts/${payoutId}`;
17
+ return api.get(endpoint);
18
+ }
19
+ async fetchCSV(payoutId, authToken) {
20
+ const api = Api({ authToken, apiOrigin: undefined });
21
+ const endpoint = `reports/payouts/${payoutId}`;
22
+ return api.get(endpoint);
23
+ }
24
+ }
25
+
26
+ const makeGetPayoutCSV = ({ authToken, service }) => async ({ payoutId, onError }) => {
27
+ try {
28
+ const { data } = await service.fetchCSV(payoutId, authToken);
29
+ const a = document.createElement('a');
30
+ a.href = data.csv_url;
31
+ a.click();
32
+ }
33
+ catch (error) {
34
+ const errorMessage = getErrorMessage(error);
35
+ const code = getErrorCode(error === null || error === void 0 ? void 0 : error.code);
36
+ onError({
37
+ error: errorMessage,
38
+ code,
39
+ severity: ComponentErrorSeverity.ERROR,
40
+ });
41
+ }
42
+ };
43
+
44
+ export { PayoutService as P, makeGetPayoutCSV as m };
@@ -0,0 +1,58 @@
1
+ import { r as registerInstance, c as createEvent, h } from './p-fad19d75.js';
2
+ import { M as MapPaymentStatusToBadge, f as formatCurrency, b as formatDate, c as formatTime, s as snakeCaseToHumanReadable } from './p-83125497.js';
3
+ import { a as EntityHeadInfo, b as EntityHeadInfoItem, D as DetailSectionTitle, c as DetailItem, C as CodeBlock, E as ErrorState, L as LoadingState } from './p-dce846bf.js';
4
+ import { S as StyledHost } from './p-ba4bae6f.js';
5
+
6
+ const PaymentDetailsCore = class {
7
+ constructor(hostRef) {
8
+ registerInstance(this, hostRef);
9
+ this.errorEvent = createEvent(this, "error-event", 7);
10
+ this.getPaymentDetails = undefined;
11
+ this.payment = undefined;
12
+ this.loading = true;
13
+ this.errorMessage = undefined;
14
+ }
15
+ componentWillLoad() {
16
+ if (this.getPaymentDetails) {
17
+ this.fetchData();
18
+ }
19
+ }
20
+ updateOnPropChange() {
21
+ this.fetchData();
22
+ }
23
+ fetchData() {
24
+ this.loading = true;
25
+ this.getPaymentDetails({
26
+ onSuccess: ({ payment }) => {
27
+ this.payment = payment;
28
+ this.loading = false;
29
+ this.errorMessage = null;
30
+ },
31
+ onError: ({ error, code, severity }) => {
32
+ this.errorMessage = error;
33
+ this.errorEvent.emit({
34
+ errorCode: code,
35
+ message: error,
36
+ severity,
37
+ });
38
+ this.loading = false;
39
+ },
40
+ });
41
+ }
42
+ render() {
43
+ var _a;
44
+ return (h(StyledHost, { key: 'aaaea4076938af5a74197256dba1093265f0e2d6' }, this.loading && LoadingState(), !this.loading && this.errorMessage && ErrorState(this.errorMessage), !this.loading && !this.errorMessage &&
45
+ this.payment && (h("justifi-details", { key: '12f06fa05915380403e244cbed053d0c04bfa1d4', "error-message": this.errorMessage }, h(EntityHeadInfo, { key: '4d496def6abfc728e6f184fb0729ac648fb2deaf', slot: "head-info", badge: h("span", { slot: 'badge', innerHTML: MapPaymentStatusToBadge(this.payment.status) }), title: `${formatCurrency(this.payment.amount)} ${(_a = this.payment) === null || _a === void 0 ? void 0 : _a.currency.toUpperCase()}` }, h(EntityHeadInfoItem, { key: '78dcff13206646d594bdc80f6297d45dc9932694', classes: "border-1 border-end", title: "Updated At", value: `${formatDate(this.payment.updated_at)} ${formatTime(this.payment.updated_at)}` }), h(EntityHeadInfoItem, { key: 'dfa0de667ebd28efd217b6bdf548b9b1b728b57e', classes: "border-1 border-end", title: "Created At", value: `${formatDate(this.payment.created_at)} ${formatTime(this.payment.created_at)}` }), h(EntityHeadInfoItem, { key: 'b449b180034f28504007a9c2fb0598607dc00efb', title: "ID", value: this.payment.id })), h("div", { key: '62af84e244e38b24b32f791d13f1b21b49942597', slot: 'detail-sections' }, h(DetailSectionTitle, { key: '0ddb0366b4ab737c7b08a37764b8ce2f7ec4a1e9', sectionTitle: "Details" }), h("div", { key: 'cb699194db16cb8608834779f560e882f6f9da7c', class: "d-table gap-2 w-100" }, h(DetailItem, { key: '3b6eb4a8b782668951bba90be3b5d522f3f7c69b', title: "Amount", value: formatCurrency(this.payment.amount) }), h(DetailItem, { key: '7a59ab0b12a263c38c40a98acbff6492d370b28b', title: "Fees", value: formatCurrency(this.payment.fee_amount) }), h(DetailItem, { key: 'a9eaa5d1959425205c144dc2aa7c7fad77014290', title: "Refunded", value: formatCurrency(this.payment.amount_refunded) }), h(DetailItem, { key: 'd70c3a4bf48c9c69625d5f27f1095f9b0744a71e', title: "Net", value: formatCurrency(this.payment.balance) }), h(DetailItem, { key: '28f526b1adcd475c2ae88a8bf09ae4aea7935df6', title: "Status", value: MapPaymentStatusToBadge(this.payment.status) }), h(DetailItem, { key: '700f51d787f20f575e3e11aa72a8da29a9587c2a', title: "Payment ID", value: this.payment.id }), h(DetailItem, { key: 'ea72ecc9c2f5055d4b0f6b37cd16cb318f9a797c', title: "Processing Fees", value: formatCurrency(this.payment.fee_amount) }), h(DetailItem, { key: '9d66af2c0c0baef4e8b7b021daf0b4d6adb267d2', title: "Statement Descriptor", value: this.payment.statement_descriptor }), h(DetailItem, { key: '3f21501c1e08feeee1e7427a42faf1c5d1d9c84d', title: "Description", value: this.payment.description })), this.payment.payment_method.card && [
46
+ h(DetailSectionTitle, { key: 'b7767b93e090c0195aca6c99b66b48d61b6134b3', sectionTitle: "Payment Method" }),
47
+ h("div", { key: 'a363c7a7e69932a8ffeddb5e0d53f7df13119a9a', class: "d-table gap-2 w-100" }, h(DetailItem, { key: 'fb0e1f64fcec23e513590b3048593565685d8400', title: "ID", value: this.payment.payment_method.card.id }), h(DetailItem, { key: 'bc181b1b94039e1aad341a8e563ba923976c806b', title: "Payment Type", value: "Card" }), h(DetailItem, { key: '88b21dd2368b88232cd0f464c381d4423fe3c774', title: "Last 4 Numbers", value: this.payment.payment_method.lastFourDigits }), h(DetailItem, { key: '040fd71315ead633f9c89e9a9dad906889759d77', title: "Brand", value: snakeCaseToHumanReadable(this.payment.payment_method.card.brand) }), h(DetailItem, { key: '35ebc74de2c5c8fafd95fc5b15ff4f2ca85220cc', title: "Cardholder", value: this.payment.payment_method.payersName }))
48
+ ], this.payment.payment_method.bank_account && [
49
+ h(DetailSectionTitle, { key: 'f10eef0b4e4067fb78dbff16719a6f266f4e6bab', sectionTitle: "Payment Method" }),
50
+ h("div", { key: '6c1ef713b5dcabba5b516f3cbbd088d098873303', class: "d-table gap-2 w-100" }, h(DetailItem, { key: '8880fd0fb2b16ee6f177aba15d6f4485c95af252', title: "ID", value: this.payment.payment_method.bank_account.id }), h(DetailItem, { key: 'baa70304d2972f69ce8a5d077a076b16f986745b', title: "Last 4 Numbers", value: this.payment.payment_method.lastFourDigits }), h(DetailItem, { key: 'dcb63b9258bea698bf2d165c611dfa05cb320f30', title: "Bank Name", value: this.payment.payment_method.bank_account.brand }), h(DetailItem, { key: '806696c15aa5ef242c230d9c9aea642ddfdfd93d', title: "Account Owner", value: this.payment.payment_method.payersName }))
51
+ ], h(DetailSectionTitle, { key: '83289d8f2cf57a624678260555f00af4ea96a566', sectionTitle: 'Metadata' }), h("div", { key: '02e248b962e0c06f4d83bae75a5759b234fea36b', class: "d-table gap-2 w-100" }, h(CodeBlock, { key: '5d81879c7815102219ed010dab9f573ad6b7985d', metadata: this.payment.metadata })))))));
52
+ }
53
+ static get watchers() { return {
54
+ "getPaymentDetails": ["updateOnPropChange"]
55
+ }; }
56
+ };
57
+
58
+ export { PaymentDetailsCore as payment_details_core };
@@ -1 +1,126 @@
1
- import{f as s,c as t,g as i}from"./p-1ff8810b.js";class h{constructor(i){this.address=Object.assign({},new r(i.address||{})),this.created_at=i.created_at,this.dob_day=s(i.dob_day),this.dob_month=s(i.dob_month),this.dob_year=i.dob_year,this.dob_full=t(this.dob_year,this.dob_month,this.dob_day)||"",this.documents=i.documents,this.email=i.email,this.id=i.id,this.business_id=i.business_id,this.is_owner=i.is_owner,this.metadata=i.metadata,this.name=i.name,this.phone=i.phone,this.platform_account_id=i.platform_account_id,this.identification_number=i.identification_number,this.ssn_last4=i.ssn_last4,this.title=i.title,this.updated_at=i.updated_at}}class c{constructor(i){this.address=Object.assign({},new r(i.address||{})),this.created_at=i.created_at,this.dob_day=s(i.dob_day),this.dob_month=s(i.dob_month),this.dob_year=i.dob_year,this.dob_full=t(this.dob_year,this.dob_month,this.dob_day)||"",this.documents=i.documents,this.email=i.email,this.id=i.id,this.business_id=i.business_id,this.is_owner=i.is_owner,this.metadata=i.metadata,this.name=i.name,this.phone=i.phone,this.platform_account_id=i.platform_account_id,this.identification_number=i.identification_number,this.ssn_last4=i.ssn_last4,this.title=i.title,this.updated_at=i.updated_at}}var o;!function(s){s.sole_proprietor="sole_proprietor",s.partnership="partnership",s.corporation="corporation",s.public_company="public_company",s.limited="limited",s.non_profit="non_profit",s.government="government"}(o||(o={}));class r{constructor(s){this.id=s.id,this.platform_account_id=s.platform_account_id,this.line1=s.line1,this.line2=s.line2,this.postal_code=s.postal_code,this.city=s.city,this.state=i(s.state),this.country=s.country||"USA",this.created_at=s.created_at,this.updated_at=s.updated_at}}class a{constructor(s){this.business_revenue=s.business_revenue,this.business_payment_volume=s.business_payment_volume,this.business_when_service_received=s.business_when_service_received,this.business_recurring_payments=s.business_recurring_payments,this.business_recurring_payments_percentage=s.business_recurring_payments_percentage,this.business_seasonal=s.business_seasonal,this.business_other_payment_details=s.business_other_payment_details}}class n{constructor(s){this.classification=s.classification,this.legal_name=s.legal_name,this.doing_business_as=s.doing_business_as,this.industry=s.industry,this.tax_id=s.tax_id,this.website_url=s.website_url,this.email=s.email,this.phone=s.phone,this.date_of_incorporation=s.date_of_incorporation}}class e{constructor(s){this.additional_questions=Object.assign({},new a(s.additional_questions||{})),this.associated_accounts=s.associated_accounts,this.classification=s.classification,this.bank_accounts=s.bank_accounts,this.created_at=s.created_at,this.documents=s.documents,this.doing_business_as=s.doing_business_as,this.email=s.email,this.id=s.id,this.industry=s.industry,this.legal_address=Object.assign({},new r(s.legal_address||{})),this.legal_name=s.legal_name,this.metadata=s.metadata,this.owners=s.owners,this.phone=s.phone,this.platform_account_id=s.platform_account_id,this.product_categories=s.product_categories,this.representative=Object.assign({},new c(s.representative||{})),this.tax_id=s.tax_id,this.terms_conditions_accepted=s.terms_conditions_accepted,this.updated_at=s.updated_at,this.website_url=s.website_url,this.date_of_incorporation=s.date_of_incorporation}}export{a as A,e as B,n as C,h as O,c as R,o as a,r as b}
1
+ import { f as filterNumber, c as constructDate, g as getStateAbbreviation } from './p-1ff8810b.js';
2
+
3
+ class Owner {
4
+ constructor(owner) {
5
+ this.address = Object.assign({}, new Address(owner.address || {}));
6
+ this.created_at = owner.created_at;
7
+ this.dob_day = filterNumber(owner.dob_day);
8
+ this.dob_month = filterNumber(owner.dob_month);
9
+ this.dob_year = owner.dob_year;
10
+ this.dob_full = constructDate(this.dob_year, this.dob_month, this.dob_day) || '';
11
+ this.documents = owner.documents;
12
+ this.email = owner.email;
13
+ this.id = owner.id;
14
+ this.business_id = owner.business_id;
15
+ this.is_owner = owner.is_owner;
16
+ this.metadata = owner.metadata;
17
+ this.name = owner.name;
18
+ this.phone = owner.phone;
19
+ this.platform_account_id = owner.platform_account_id;
20
+ this.identification_number = owner.identification_number;
21
+ this.ssn_last4 = owner.ssn_last4;
22
+ this.title = owner.title;
23
+ this.updated_at = owner.updated_at;
24
+ }
25
+ }
26
+ class Representative {
27
+ constructor(representative) {
28
+ this.address = Object.assign({}, new Address(representative.address || {}));
29
+ this.created_at = representative.created_at;
30
+ this.dob_day = filterNumber(representative.dob_day);
31
+ this.dob_month = filterNumber(representative.dob_month);
32
+ this.dob_year = representative.dob_year;
33
+ this.dob_full = constructDate(this.dob_year, this.dob_month, this.dob_day) || '';
34
+ this.documents = representative.documents;
35
+ this.email = representative.email;
36
+ this.id = representative.id;
37
+ this.business_id = representative.business_id;
38
+ this.is_owner = representative.is_owner;
39
+ this.metadata = representative.metadata;
40
+ this.name = representative.name;
41
+ this.phone = representative.phone;
42
+ this.platform_account_id = representative.platform_account_id;
43
+ this.identification_number = representative.identification_number;
44
+ this.ssn_last4 = representative.ssn_last4;
45
+ this.title = representative.title;
46
+ this.updated_at = representative.updated_at;
47
+ }
48
+ }
49
+
50
+ var BusinessClassification;
51
+ (function (BusinessClassification) {
52
+ BusinessClassification["sole_proprietor"] = "sole_proprietor";
53
+ BusinessClassification["partnership"] = "partnership";
54
+ BusinessClassification["corporation"] = "corporation";
55
+ BusinessClassification["public_company"] = "public_company";
56
+ BusinessClassification["limited"] = "limited";
57
+ BusinessClassification["non_profit"] = "non_profit";
58
+ BusinessClassification["government"] = "government";
59
+ })(BusinessClassification || (BusinessClassification = {}));
60
+ class Address {
61
+ constructor(address) {
62
+ this.id = address.id;
63
+ this.platform_account_id = address.platform_account_id;
64
+ this.line1 = address.line1;
65
+ this.line2 = address.line2;
66
+ this.postal_code = address.postal_code;
67
+ this.city = address.city;
68
+ this.state = getStateAbbreviation(address.state);
69
+ this.country = address.country || 'USA';
70
+ this.created_at = address.created_at;
71
+ this.updated_at = address.updated_at;
72
+ }
73
+ }
74
+ class AdditionalQuestions {
75
+ constructor(additionalQuestions) {
76
+ this.business_revenue = additionalQuestions.business_revenue;
77
+ this.business_payment_volume = additionalQuestions.business_payment_volume;
78
+ this.business_when_service_received = additionalQuestions.business_when_service_received;
79
+ this.business_recurring_payments = additionalQuestions.business_recurring_payments;
80
+ this.business_recurring_payments_percentage = additionalQuestions.business_recurring_payments_percentage;
81
+ this.business_seasonal = additionalQuestions.business_seasonal;
82
+ this.business_other_payment_details = additionalQuestions.business_other_payment_details;
83
+ }
84
+ }
85
+ class CoreBusinessInfo {
86
+ constructor(coreBusinessInfo) {
87
+ this.classification = coreBusinessInfo.classification;
88
+ this.legal_name = coreBusinessInfo.legal_name;
89
+ this.doing_business_as = coreBusinessInfo.doing_business_as;
90
+ this.industry = coreBusinessInfo.industry;
91
+ this.tax_id = coreBusinessInfo.tax_id;
92
+ this.website_url = coreBusinessInfo.website_url;
93
+ this.email = coreBusinessInfo.email;
94
+ this.phone = coreBusinessInfo.phone;
95
+ this.date_of_incorporation = coreBusinessInfo.date_of_incorporation;
96
+ }
97
+ }
98
+ class Business {
99
+ constructor(business) {
100
+ this.additional_questions = Object.assign({}, new AdditionalQuestions(business.additional_questions || {}));
101
+ this.associated_accounts = business.associated_accounts;
102
+ this.classification = business.classification;
103
+ this.bank_accounts = business.bank_accounts;
104
+ this.created_at = business.created_at;
105
+ this.documents = business.documents;
106
+ this.doing_business_as = business.doing_business_as;
107
+ this.email = business.email;
108
+ this.id = business.id;
109
+ this.industry = business.industry;
110
+ this.legal_address = Object.assign({}, new Address(business.legal_address || {}));
111
+ this.legal_name = business.legal_name;
112
+ this.metadata = business.metadata;
113
+ this.owners = business.owners;
114
+ this.phone = business.phone;
115
+ this.platform_account_id = business.platform_account_id;
116
+ this.product_categories = business.product_categories;
117
+ this.representative = Object.assign({}, new Representative(business.representative || {}));
118
+ this.tax_id = business.tax_id;
119
+ this.terms_conditions_accepted = business.terms_conditions_accepted;
120
+ this.updated_at = business.updated_at;
121
+ this.website_url = business.website_url;
122
+ this.date_of_incorporation = business.date_of_incorporation;
123
+ }
124
+ }
125
+
126
+ export { AdditionalQuestions as A, Business as B, CoreBusinessInfo as C, Owner as O, Representative as R, BusinessClassification as a, Address as b };