@justifi/webcomponents 4.19.1-rc-6 → 4.19.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (244) hide show
  1. package/dist/cjs/{Analytics-54b8e890.js → Analytics-f870b3ee.js} +3 -2
  2. package/dist/cjs/{business-additional-questions-schema-cf545610.js → business-additional-questions-schema-11ce0005.js} +1 -1
  3. package/dist/cjs/{business-form-options-582467fe.js → business-form-options-26f9900c.js} +1 -1
  4. package/dist/cjs/{business.service-6bb7ac82.js → business.service-f63650f5.js} +6 -5
  5. package/dist/cjs/config-ff2dda66.js +15 -0
  6. package/dist/cjs/form-alert_5.cjs.entry.js +1 -1
  7. package/dist/cjs/form-control-checkbox_9.cjs.entry.js +4 -4
  8. package/dist/cjs/{get-payout-csv-1391ff3e.js → get-payout-csv-f3aee6d0.js} +4 -3
  9. package/dist/cjs/justifi-additional-questions-form-step_10.cjs.entry.js +10 -9
  10. package/dist/cjs/justifi-bank-account-form.cjs.entry.js +5 -4
  11. package/dist/cjs/justifi-billing-form_2.cjs.entry.js +2 -2
  12. package/dist/cjs/justifi-business-details.cjs.entry.js +4 -3
  13. package/dist/cjs/justifi-business-form.cjs.entry.js +9 -8
  14. package/dist/cjs/justifi-card-form.cjs.entry.js +5 -4
  15. package/dist/cjs/justifi-checkout-core.cjs.entry.js +3 -3
  16. package/dist/cjs/justifi-checkout.cjs.entry.js +5 -4
  17. package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +4 -3
  18. package/dist/cjs/justifi-new-payment-method_4.cjs.entry.js +9 -11
  19. package/dist/cjs/justifi-owner-form_3.cjs.entry.js +5 -4
  20. package/dist/cjs/justifi-payment-details.cjs.entry.js +4 -3
  21. package/dist/cjs/justifi-payment-form.cjs.entry.js +6 -5
  22. package/dist/cjs/justifi-payment-method-form.cjs.entry.js +1 -1
  23. package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +6 -5
  24. package/dist/cjs/justifi-payments-list.cjs.entry.js +4 -3
  25. package/dist/cjs/justifi-payout-details.cjs.entry.js +4 -3
  26. package/dist/cjs/justifi-payouts-list.cjs.entry.js +4 -3
  27. package/dist/cjs/justifi-refund-form.cjs.entry.js +3 -2
  28. package/dist/cjs/justifi-season-interruption-insurance.cjs.entry.js +5 -4
  29. package/dist/cjs/{package-b75f8267.js → package-1321b070.js} +4 -2
  30. package/dist/cjs/{payload-parsers-1cbc3b57.js → payload-parsers-969ab9b6.js} +1 -1
  31. package/dist/cjs/{payment.service-dfcfa19b.js → payment.service-0a64f9cd.js} +3 -2
  32. package/dist/cjs/{schema-validations-2733de42.js → schema-validations-f3db892c.js} +1 -1
  33. package/dist/collection/api/services/analytics.service.js +2 -1
  34. package/dist/collection/api/services/business.service.js +6 -5
  35. package/dist/collection/api/services/checkout.service.js +3 -2
  36. package/dist/collection/api/services/insurance.service.js +3 -2
  37. package/dist/collection/api/services/payment.service.js +3 -2
  38. package/dist/collection/api/services/payout.service.js +4 -3
  39. package/dist/collection/api/services/provision.service.js +4 -2
  40. package/dist/collection/api/services/reports.service.js +2 -1
  41. package/dist/collection/components/bank-account-form/bank-account-form.js +4 -3
  42. package/dist/collection/components/business-forms/business-form/business-form.js +3 -2
  43. package/dist/collection/components/business-forms/payment-provisioning/bank-account/business-bank-account-form-step.js +3 -2
  44. package/dist/collection/components/business-forms/payment-provisioning/document-uploads/business-document-upload-form-step.js +3 -2
  45. package/dist/collection/components/business-forms/payment-provisioning/terms-and-conditions/business-terms-conditions-form-step.js +3 -2
  46. package/dist/collection/components/business-forms/utils/business-form-options.js +1 -1
  47. package/dist/collection/components/card-form/card-form.js +4 -3
  48. package/dist/collection/components/checkout/checkout-core.js +4 -4
  49. package/dist/collection/components/checkout/new-payment-method.js +4 -6
  50. package/dist/collection/components/checkout/payment-method-options.js +4 -3
  51. package/dist/collection/components/checkout/saved-payment-method.js +4 -3
  52. package/dist/collection/components/checkout/sezzle-payment-method.js +4 -3
  53. package/dist/collection/components/payment-form/payment-form.js +4 -3
  54. package/dist/collection/components/refund-form/refund-form.js +3 -2
  55. package/dist/config.js +11 -0
  56. package/dist/docs.json +8 -8
  57. package/dist/esm/{Analytics-25ef1b60.js → Analytics-262cdde5.js} +3 -2
  58. package/dist/esm/{business-additional-questions-schema-956e3caf.js → business-additional-questions-schema-e39bc781.js} +1 -1
  59. package/dist/esm/{business-form-options-7a9a74fc.js → business-form-options-0b08e08c.js} +1 -1
  60. package/dist/esm/{business.service-f45decfc.js → business.service-74bd1212.js} +6 -5
  61. package/dist/esm/config-476c7241.js +13 -0
  62. package/dist/esm/form-alert_5.entry.js +1 -1
  63. package/dist/esm/form-control-checkbox_9.entry.js +4 -4
  64. package/dist/esm/{get-payout-csv-e784a2ab.js → get-payout-csv-b494abfe.js} +4 -3
  65. package/dist/esm/justifi-additional-questions-form-step_10.entry.js +10 -9
  66. package/dist/esm/justifi-bank-account-form.entry.js +5 -4
  67. package/dist/esm/justifi-billing-form_2.entry.js +2 -2
  68. package/dist/esm/justifi-business-details.entry.js +4 -3
  69. package/dist/esm/justifi-business-form.entry.js +9 -8
  70. package/dist/esm/justifi-card-form.entry.js +5 -4
  71. package/dist/esm/justifi-checkout-core.entry.js +3 -3
  72. package/dist/esm/justifi-checkout.entry.js +5 -4
  73. package/dist/esm/justifi-gross-payment-chart.entry.js +4 -3
  74. package/dist/esm/justifi-new-payment-method_4.entry.js +9 -11
  75. package/dist/esm/justifi-owner-form_3.entry.js +5 -4
  76. package/dist/esm/justifi-payment-details.entry.js +4 -3
  77. package/dist/esm/justifi-payment-form.entry.js +6 -5
  78. package/dist/esm/justifi-payment-method-form.entry.js +1 -1
  79. package/dist/esm/justifi-payment-provisioning.entry.js +6 -5
  80. package/dist/esm/justifi-payments-list.entry.js +4 -3
  81. package/dist/esm/justifi-payout-details.entry.js +4 -3
  82. package/dist/esm/justifi-payouts-list.entry.js +4 -3
  83. package/dist/esm/justifi-refund-form.entry.js +3 -2
  84. package/dist/esm/justifi-season-interruption-insurance.entry.js +5 -4
  85. package/dist/esm/{package-478b028a.js → package-d88677e9.js} +4 -2
  86. package/dist/esm/{payload-parsers-acb719d1.js → payload-parsers-62f443e1.js} +1 -1
  87. package/dist/esm/{payment.service-dad5153b.js → payment.service-3ca4a492.js} +3 -2
  88. package/dist/esm/{schema-validations-a83ff220.js → schema-validations-2f4fdebb.js} +1 -1
  89. package/dist/module/Analytics.js +2 -1
  90. package/dist/module/business-bank-account-form-step.js +3 -2
  91. package/dist/module/business-document-upload-form-step.js +3 -2
  92. package/dist/module/business-form-options.js +1 -1
  93. package/dist/module/business-terms-conditions-form-step.js +3 -2
  94. package/dist/module/business.service.js +6 -5
  95. package/dist/module/checkout-core.js +3 -3
  96. package/dist/module/config.js +13 -0
  97. package/dist/module/get-payout-csv.js +4 -3
  98. package/dist/module/justifi-bank-account-form.js +3 -2
  99. package/dist/module/justifi-business-form.js +3 -2
  100. package/dist/module/justifi-card-form.js +3 -2
  101. package/dist/module/justifi-checkout.js +3 -2
  102. package/dist/module/justifi-gross-payment-chart.js +2 -1
  103. package/dist/module/justifi-payment-form.js +4 -3
  104. package/dist/module/justifi-payment-provisioning.js +3 -2
  105. package/dist/module/justifi-refund-form.js +3 -2
  106. package/dist/module/justifi-season-interruption-insurance.js +3 -2
  107. package/dist/module/new-payment-method.js +3 -5
  108. package/dist/module/package.js +4 -2
  109. package/dist/module/payment-method-options.js +3 -2
  110. package/dist/module/payment.service.js +3 -2
  111. package/dist/module/saved-payment-method.js +3 -2
  112. package/dist/module/sezzle-payment-method.js +3 -2
  113. package/dist/types/components/checkout/new-payment-method.d.ts +0 -1
  114. package/dist/types/home/runner/work/web-component-library/web-component-library/packages/webcomponents/.stencil/packages/webcomponents/config.d.ts +11 -0
  115. package/dist/webcomponents/index.esm.js +0 -1
  116. package/dist/webcomponents/p-04a0dbb6.js +1 -0
  117. package/dist/webcomponents/p-061dcb79.entry.js +1 -0
  118. package/dist/webcomponents/p-07109641.entry.js +1 -0
  119. package/dist/webcomponents/p-08b0fb31.js +1 -41
  120. package/dist/webcomponents/p-0f7b9555.entry.js +1 -0
  121. package/dist/webcomponents/p-14c91ffd.js +1 -20
  122. package/dist/webcomponents/p-198994c0.entry.js +1 -0
  123. package/dist/webcomponents/p-1a43e355.entry.js +19 -0
  124. package/dist/webcomponents/p-1ad5995e.js +1 -3599
  125. package/dist/webcomponents/p-1f70fa27.entry.js +1 -0
  126. package/dist/webcomponents/p-1ff8810b.js +1 -29
  127. package/dist/webcomponents/p-2338affa.js +1 -213
  128. package/dist/webcomponents/p-241b0ed9.js +1 -0
  129. package/dist/webcomponents/p-2799383d.entry.js +1 -0
  130. package/dist/webcomponents/p-29c0b182.js +1 -114
  131. package/dist/webcomponents/p-2b6c9c4f.js +1 -7
  132. package/dist/webcomponents/p-2eab3c90.js +1 -3052
  133. package/dist/webcomponents/p-3affadfc.entry.js +1 -0
  134. package/dist/webcomponents/p-3d4d566d.entry.js +1 -0
  135. package/dist/webcomponents/p-3dd4c6c3.entry.js +1 -0
  136. package/dist/webcomponents/p-462dc522.entry.js +1 -0
  137. package/dist/webcomponents/p-46f679a9.js +1 -0
  138. package/dist/webcomponents/p-487b72a8.entry.js +1 -0
  139. package/dist/webcomponents/p-48ae16e0.entry.js +1 -0
  140. package/dist/webcomponents/p-4abc17f0.entry.js +1 -0
  141. package/dist/webcomponents/p-4bac636e.entry.js +1 -0
  142. package/dist/webcomponents/p-52021fa1.entry.js +1 -0
  143. package/dist/webcomponents/p-525db3e8.js +1 -22
  144. package/dist/webcomponents/p-53948ff8.entry.js +1 -0
  145. package/dist/webcomponents/p-53e64f15.entry.js +1 -0
  146. package/dist/webcomponents/p-554a3c18.js +1 -0
  147. package/dist/webcomponents/p-56f6ce4c.js +1 -10
  148. package/dist/webcomponents/p-5968ff8a.js +1 -178
  149. package/dist/webcomponents/p-6078a370.js +1 -244
  150. package/dist/webcomponents/p-60a370fc.entry.js +1 -0
  151. package/dist/webcomponents/p-62b32c4c.entry.js +1 -0
  152. package/dist/webcomponents/p-65b561da.entry.js +1 -0
  153. package/dist/webcomponents/p-72c9e6b3.entry.js +1 -0
  154. package/dist/webcomponents/p-75b4daef.js +1 -0
  155. package/dist/webcomponents/p-7d85af5c.js +1 -16
  156. package/dist/webcomponents/p-8115b2f4.js +1 -28
  157. package/dist/webcomponents/p-83125497.js +1 -4027
  158. package/dist/webcomponents/p-8603348a.js +1 -0
  159. package/dist/webcomponents/p-890b3254.entry.js +1 -0
  160. package/dist/webcomponents/p-8df7bde8.js +1 -27
  161. package/dist/webcomponents/p-92bb1e5f.entry.js +1 -0
  162. package/dist/webcomponents/p-9c9c7dac.js +1 -24
  163. package/dist/webcomponents/p-9ccfa1c9.entry.js +1 -0
  164. package/dist/webcomponents/p-9dc36f76.entry.js +1 -0
  165. package/dist/webcomponents/p-ad41c8c7.entry.js +1 -0
  166. package/dist/webcomponents/p-ae263544.js +1 -0
  167. package/dist/webcomponents/p-af244664.js +1 -126
  168. package/dist/webcomponents/p-b16dfd5d.entry.js +1 -0
  169. package/dist/webcomponents/p-ba4bae6f.js +1 -12
  170. package/dist/webcomponents/p-bbed6107.entry.js +1 -0
  171. package/dist/webcomponents/p-bc92235c.entry.js +1 -0
  172. package/dist/webcomponents/p-be39c802.entry.js +1 -0
  173. package/dist/webcomponents/p-c9f8f7ec.entry.js +1 -0
  174. package/dist/webcomponents/p-d101c5db.js +1 -0
  175. package/dist/webcomponents/p-d1c8d794.entry.js +1 -0
  176. package/dist/webcomponents/p-d25c2f12.js +1 -0
  177. package/dist/webcomponents/p-d2a5054f.entry.js +1 -0
  178. package/dist/webcomponents/p-d765d638.js +1 -0
  179. package/dist/webcomponents/p-d8355f91.entry.js +1 -0
  180. package/dist/webcomponents/p-d89bad72.js +1 -39
  181. package/dist/webcomponents/p-dce846bf.js +1 -27
  182. package/dist/webcomponents/p-df21aaad.js +1 -120
  183. package/dist/webcomponents/p-e1255160.js +1 -3
  184. package/dist/webcomponents/p-e2c88817.entry.js +1 -0
  185. package/dist/webcomponents/p-e31f0f3e.entry.js +1 -0
  186. package/dist/webcomponents/p-e333620e.js +1 -34
  187. package/dist/webcomponents/p-e3fab0e2.js +1 -43
  188. package/dist/webcomponents/p-f0866375.entry.js +1 -0
  189. package/dist/webcomponents/p-fad19d75.js +2 -1638
  190. package/dist/webcomponents/p-fb58feb5.entry.js +1 -0
  191. package/dist/webcomponents/p-fe33151d.entry.js +1 -0
  192. package/dist/webcomponents/webcomponents.css +4 -362
  193. package/dist/webcomponents/webcomponents.esm.js +1 -20
  194. package/package.json +4 -2
  195. package/dist/globals.d.ts +0 -2
  196. package/dist/webcomponents/p-01a404ca.entry.js +0 -44
  197. package/dist/webcomponents/p-03d35880.entry.js +0 -130
  198. package/dist/webcomponents/p-06ff0429.entry.js +0 -65
  199. package/dist/webcomponents/p-0e2384b5.entry.js +0 -1684
  200. package/dist/webcomponents/p-1bbbf15d.js +0 -79
  201. package/dist/webcomponents/p-20abace7.js +0 -77
  202. package/dist/webcomponents/p-258b1ee2.entry.js +0 -149
  203. package/dist/webcomponents/p-25d8cd65.entry.js +0 -102
  204. package/dist/webcomponents/p-3b5948ea.entry.js +0 -133
  205. package/dist/webcomponents/p-3c50942c.entry.js +0 -94
  206. package/dist/webcomponents/p-3e9ef4a8.js +0 -28
  207. package/dist/webcomponents/p-3fd13ca3.js +0 -52
  208. package/dist/webcomponents/p-40236338.entry.js +0 -80
  209. package/dist/webcomponents/p-5482d030.entry.js +0 -21
  210. package/dist/webcomponents/p-576826b1.entry.js +0 -43
  211. package/dist/webcomponents/p-5cb3f0b2.entry.js +0 -261
  212. package/dist/webcomponents/p-5f835b89.entry.js +0 -606
  213. package/dist/webcomponents/p-70a2aa74.entry.js +0 -76
  214. package/dist/webcomponents/p-73210c03.entry.js +0 -75
  215. package/dist/webcomponents/p-7582b554.entry.js +0 -18
  216. package/dist/webcomponents/p-79646550.entry.js +0 -61
  217. package/dist/webcomponents/p-800d31fe.entry.js +0 -162
  218. package/dist/webcomponents/p-8371f61c.entry.js +0 -94
  219. package/dist/webcomponents/p-85fc69e5.js +0 -90
  220. package/dist/webcomponents/p-890088fc.entry.js +0 -298
  221. package/dist/webcomponents/p-89887332.js +0 -301
  222. package/dist/webcomponents/p-8eb774df.entry.js +0 -54
  223. package/dist/webcomponents/p-9f94bbb6.entry.js +0 -118
  224. package/dist/webcomponents/p-a096bc5b.entry.js +0 -145
  225. package/dist/webcomponents/p-a5a225d9.entry.js +0 -125
  226. package/dist/webcomponents/p-a5c5821e.entry.js +0 -101
  227. package/dist/webcomponents/p-a5fb51dc.entry.js +0 -131
  228. package/dist/webcomponents/p-a64f0ebe.entry.js +0 -117
  229. package/dist/webcomponents/p-a6d04afc.js +0 -44
  230. package/dist/webcomponents/p-ac086069.entry.js +0 -58
  231. package/dist/webcomponents/p-b233d1e2.entry.js +0 -74
  232. package/dist/webcomponents/p-b82c146f.entry.js +0 -111
  233. package/dist/webcomponents/p-ba5fae28.js +0 -90
  234. package/dist/webcomponents/p-ba6661f2.entry.js +0 -73
  235. package/dist/webcomponents/p-c636f563.entry.js +0 -791
  236. package/dist/webcomponents/p-cb26f708.js +0 -18
  237. package/dist/webcomponents/p-d17aee2b.entry.js +0 -26
  238. package/dist/webcomponents/p-e26541b9.entry.js +0 -98
  239. package/dist/webcomponents/p-e356f280.entry.js +0 -29
  240. package/dist/webcomponents/p-e78af6d3.entry.js +0 -97
  241. package/dist/webcomponents/p-e7b8199d.entry.js +0 -131
  242. package/dist/webcomponents/p-ec854a3e.entry.js +0 -11053
  243. package/dist/webcomponents/p-f02b75dc.entry.js +0 -96
  244. package/dist/webcomponents/p-fd7918c2.entry.js +0 -99
@@ -1,118 +0,0 @@
1
- import { r as registerInstance, c as createEvent, h } from './p-fad19d75.js';
2
- import { f as formatCurrency } from './p-83125497.js';
3
- import { v as validateInsuranceValues, a as insuranceValues, b as insuranceErrors } from './p-2338affa.js';
4
- import { S as StyledHost } from './p-ba4bae6f.js';
5
-
6
- const seasonInterruptionInsuranceCoreCss = ":host{display:block}a{color:var(--jfi-body-color) !important}";
7
- const JustifiSeasonInterruptionInsuranceCoreStyle0 = seasonInterruptionInsuranceCoreCss;
8
-
9
- const formCheckInputCss = ".form-check-input,label{cursor:pointer}.form-check-input{background-color:var(--jfi-radio-button-background-color);border-color:var(--jfi-radio-button-border-color)}.form-check-input:checked,.form-check-input:checked:focus{background-color:var(--jfi-radio-button-background-color-selected);border-color:var(--jfi-radio-button-border-color-selected)}.form-check-input:focus{border-color:var(--jfi-radio-button-border-color-focus);box-shadow:var(--jfi-radio-button-box-shadow-focus)}";
10
- const JustifiSeasonInterruptionInsuranceCoreStyle1 = formCheckInputCss;
11
-
12
- const headerCss = ".jfi-header{color:var(--jfi-header-color);border-bottom:var(--jfi-header-border)}";
13
- const JustifiSeasonInterruptionInsuranceCoreStyle2 = headerCss;
14
-
15
- const SeasonInterruptionInsuranceCore = class {
16
- constructor(hostRef) {
17
- registerInstance(this, hostRef);
18
- this.insuranceUpdated = createEvent(this, "insurance-updated", 7);
19
- this.errorEvent = createEvent(this, "error-event", 7);
20
- this.checkoutId = undefined;
21
- this.getQuote = undefined;
22
- this.toggleCoverage = undefined;
23
- this.primaryIdentityFirstName = undefined;
24
- this.primaryIdentityLastName = undefined;
25
- this.primaryIdentityState = undefined;
26
- this.primaryIdentityPostalCode = undefined;
27
- this.primaryIdentityCountry = undefined;
28
- this.primaryIdentityEmailAddress = undefined;
29
- this.policyAttributesInsurableAmount = undefined;
30
- this.policyAttributesStartDate = undefined;
31
- this.policyAttributesEndDate = undefined;
32
- this.coveredIdentityFirstName = undefined;
33
- this.coveredIdentityLastName = undefined;
34
- this.quote = undefined;
35
- this.isLoading = true;
36
- this.accepted = undefined;
37
- }
38
- async validate() {
39
- return validateInsuranceValues();
40
- }
41
- componentWillLoad() {
42
- if (this.getQuote) {
43
- this.fetchData();
44
- }
45
- }
46
- ;
47
- fetchData() {
48
- this.isLoading = true;
49
- this.getQuote({
50
- payload: {
51
- checkout_id: this.checkoutId,
52
- policy_type: "season_interruption",
53
- primary_identity: {
54
- state: this.primaryIdentityState,
55
- email: this.primaryIdentityEmailAddress,
56
- first_name: this.primaryIdentityFirstName,
57
- last_name: this.primaryIdentityLastName,
58
- postal_code: this.primaryIdentityPostalCode,
59
- country: this.primaryIdentityCountry
60
- },
61
- policy_attributes: {
62
- insurable_amount: this.policyAttributesInsurableAmount,
63
- start_date: this.policyAttributesStartDate,
64
- end_date: this.policyAttributesEndDate,
65
- covered_identity: {
66
- first_name: this.coveredIdentityFirstName,
67
- last_name: this.coveredIdentityLastName
68
- }
69
- }
70
- },
71
- onSuccess: ({ quote }) => {
72
- this.quote = quote;
73
- insuranceValues[quote.policy_type] = quote.accepted;
74
- this.isLoading = false;
75
- },
76
- onError: ({ error, code, severity }) => {
77
- this.isLoading = false;
78
- this.errorEvent.emit({
79
- errorCode: code,
80
- message: error,
81
- severity,
82
- });
83
- }
84
- });
85
- }
86
- ;
87
- onChangeHandler(event) {
88
- this.accepted = event.target.value;
89
- insuranceErrors[this.quote.policy_type] = false;
90
- this.toggleCoverage({
91
- quoteId: this.quote.id,
92
- payload: { accepted: this.accepted },
93
- onSuccess: () => {
94
- this.insuranceUpdated.emit();
95
- insuranceValues[this.quote.policy_type] = this.accepted;
96
- },
97
- onError: ({ error, code, severity }) => {
98
- this.errorEvent.emit({
99
- errorCode: code,
100
- message: error,
101
- severity,
102
- });
103
- }
104
- });
105
- }
106
- get error() {
107
- var _a;
108
- return insuranceErrors[(_a = this.quote) === null || _a === void 0 ? void 0 : _a.policy_type];
109
- }
110
- render() {
111
- var _a, _b, _c, _d;
112
- return (h(StyledHost, { key: '7b1384ddbc83b5f92d3a2c4f8e544c8bd06fa716' }, !this.isLoading &&
113
- h("div", { key: 'd94a61158ceb79c30d81ee5186195d3454c01323' }, h("h2", { key: '05d5b1499cf7de28823ec98ebd2c220eca7471f1', class: "fs-5 fw-bold pb-3 jfi-header" }, (_a = this.quote) === null || _a === void 0 ? void 0 : _a.product.title), h("small", { key: 'fa26cf97a06a9910d7f4cb04d149bbcd9f30d103', innerHTML: (_b = this.quote) === null || _b === void 0 ? void 0 : _b.product.description }), h("div", { key: '287de8ed4ca603b3162b4158d18d7e8a53e3b453' }, h("input", { key: '59adbc8ac892e572bc1aa68f3c626beab76af282', id: "accept", type: "radio", name: "opt-in", value: "true", onChange: (event) => this.onChangeHandler(event), class: this.error ? 'form-check-input me-2 is-invalid' : 'form-check-input me-2' }), h("label", { key: '469ac2622be0c76564de8102a499d3d3790380b2', htmlFor: "accept" }, "Accept coverage for ", formatCurrency((_c = this.quote) === null || _c === void 0 ? void 0 : _c.total_cents))), h("div", { key: '7a8827c4261d5978ecca31fc42397f233b3e37fc', class: "mb-2" }, h("input", { key: 'e25994c491ca5d74d20ec5f5787ff88ee9575ca0', id: "decline", type: "radio", name: "opt-in", value: "false", onChange: (event) => this.onChangeHandler(event), class: this.error ? 'form-check-input me-2 is-invalid' : 'form-check-input me-2' }), h("label", { key: '0a5f13213a19e13258c72ccbbe7a2e148daf1750', htmlFor: "decline" }, "Decline coverage")), h("div", { key: '33a190aa52dfefd6accf77a9e00598563a8f5e6c', class: "invalid-feedback", style: { display: this.error ? 'block' : 'none' } }, "Please select an option"), h("small", { key: 'f10e4ebd9a896fc792bb3d18d6014100013cb0b7', innerHTML: (_d = this.quote) === null || _d === void 0 ? void 0 : _d.product.legal_disclaimer }))));
114
- }
115
- };
116
- SeasonInterruptionInsuranceCore.style = JustifiSeasonInterruptionInsuranceCoreStyle0 + (JustifiSeasonInterruptionInsuranceCoreStyle1 + JustifiSeasonInterruptionInsuranceCoreStyle2);
117
-
118
- export { SeasonInterruptionInsuranceCore as justifi_season_interruption_insurance_core };
@@ -1,145 +0,0 @@
1
- import { r as registerInstance, c as createEvent, h } from './p-fad19d75.js';
2
- import { C as ComponentErrorSeverity, a as ComponentErrorCodes } from './p-14c91ffd.js';
3
- import { g as getErrorMessage, a as getErrorCode } from './p-8115b2f4.js';
4
- import { A as Api } from './p-29c0b182.js';
5
- import './p-56f6ce4c.js';
6
- import './p-df21aaad.js';
7
- import './p-e3fab0e2.js';
8
- import { J as JustifiAnalytics } from './p-20abace7.js';
9
- import './p-1bbbf15d.js';
10
-
11
- const makeGetCheckout = ({ authToken, checkoutId, service }) => async ({ onSuccess, onError }) => {
12
- var _a;
13
- try {
14
- const response = await service.fetchCheckout(authToken, checkoutId);
15
- if (!response.error) {
16
- const checkout = response.data;
17
- onSuccess({ checkout });
18
- }
19
- else {
20
- const responseError = getErrorMessage(response.error);
21
- const code = getErrorCode((_a = response.error) === null || _a === void 0 ? void 0 : _a.code);
22
- return onError({
23
- error: responseError,
24
- code,
25
- severity: ComponentErrorSeverity.ERROR,
26
- });
27
- }
28
- }
29
- catch (error) {
30
- const code = getErrorCode(error === null || error === void 0 ? void 0 : error.code);
31
- return onError({
32
- error: error.message || error,
33
- code,
34
- severity: ComponentErrorSeverity.ERROR,
35
- });
36
- }
37
- };
38
- const makeCheckoutComplete = ({ authToken, checkoutId, service }) => async ({ payment, onSuccess, onError }) => {
39
- var _a;
40
- try {
41
- const response = await service.complete(authToken, checkoutId, payment);
42
- if (!response.error) {
43
- onSuccess(response);
44
- }
45
- else {
46
- const responseError = getErrorMessage(response.error);
47
- const code = getErrorCode((_a = response.error) === null || _a === void 0 ? void 0 : _a.code);
48
- return onError({
49
- error: responseError,
50
- code,
51
- severity: ComponentErrorSeverity.ERROR,
52
- });
53
- }
54
- }
55
- catch (error) {
56
- const code = getErrorCode(error === null || error === void 0 ? void 0 : error.code);
57
- return onError({
58
- error: error.message || error,
59
- code,
60
- severity: ComponentErrorSeverity.ERROR,
61
- });
62
- }
63
- };
64
-
65
- class CheckoutService {
66
- async fetchCheckout(authToken, checkoutId) {
67
- const endpoint = `checkouts/${checkoutId}`;
68
- return Api({ authToken, apiOrigin: undefined }).get(endpoint);
69
- }
70
- async complete(authToken, checkoutId, payment) {
71
- const endpoint = `checkouts/${checkoutId}/complete`;
72
- const payload = {
73
- payment_mode: payment.payment_mode,
74
- };
75
- if (payment.payment_token) {
76
- payload.payment_token = payment.payment_token;
77
- }
78
- return Api({ authToken, apiOrigin: undefined }).post(endpoint, JSON.stringify(payload));
79
- }
80
- }
81
-
82
- const Checkout = class {
83
- constructor(hostRef) {
84
- registerInstance(this, hostRef);
85
- this.errorEvent = createEvent(this, "error-event", 7);
86
- this.loadedEvent = createEvent(this, "loaded", 7);
87
- this.iframeOrigin = undefined;
88
- this.authToken = undefined;
89
- this.checkoutId = undefined;
90
- this.disableCreditCard = undefined;
91
- this.disableBankAccount = undefined;
92
- this.disableBnpl = undefined;
93
- this.disablePaymentMethodGroup = undefined;
94
- this.getCheckout = undefined;
95
- this.complete = undefined;
96
- this.errorMessage = '';
97
- }
98
- componentWillLoad() {
99
- this.analytics = new JustifiAnalytics(this);
100
- this.initializeGetCheckout();
101
- }
102
- disconnectedCallback() {
103
- this.analytics.cleanup();
104
- }
105
- initializeGetCheckout() {
106
- if (this.authToken && this.checkoutId) {
107
- this.getCheckout = makeGetCheckout({
108
- authToken: this.authToken,
109
- checkoutId: this.checkoutId,
110
- service: new CheckoutService()
111
- });
112
- this.complete = makeCheckoutComplete({
113
- authToken: this.authToken,
114
- checkoutId: this.checkoutId,
115
- service: new CheckoutService()
116
- });
117
- }
118
- else {
119
- this.errorEvent.emit({
120
- message: 'auth-token and checkout-id are required',
121
- errorCode: ComponentErrorCodes.MISSING_PROPS,
122
- severity: ComponentErrorSeverity.ERROR,
123
- });
124
- }
125
- }
126
- propChanged() {
127
- this.initializeGetCheckout();
128
- }
129
- async fillBillingForm(fields) {
130
- this.checkoutCoreRef.fillBillingForm(fields);
131
- }
132
- render() {
133
- return (h("justifi-checkout-core", { key: 'd2f6bfed1be767edcf4ba21cddc503ff5efbec1a', getCheckout: this.getCheckout, authToken: this.authToken, complete: this.complete, disableCreditCard: this.disableCreditCard, disableBankAccount: this.disableBankAccount, disableBnpl: this.disableBnpl, disablePaymentMethodGroup: this.disablePaymentMethodGroup, ref: el => {
134
- if (el) {
135
- this.checkoutCoreRef = el;
136
- }
137
- } }, h("div", { key: '45ac1bea74ca8ef7999211b51fe7791225d61f00', slot: "insurance" }, h("slot", { key: '13e051844cc7cb4aed98076ccd64954b2dd68228', name: "insurance" }))));
138
- }
139
- static get watchers() { return {
140
- "authToken": ["propChanged"],
141
- "checkoutId": ["propChanged"]
142
- }; }
143
- };
144
-
145
- export { Checkout as justifi_checkout };
@@ -1,125 +0,0 @@
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 };
@@ -1,101 +0,0 @@
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 };