@justifi/webcomponents 6.13.1 → 6.13.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.
- package/dist/cjs/{Analytics-DMppKXYI.js → Analytics-DusgFP9U.js} +1 -1
- package/dist/cjs/additional-questions-form-step_15.cjs.entry.js +2 -2
- package/dist/cjs/bank-account-billing-form-simple_4.cjs.entry.js +1 -1
- package/dist/cjs/bank-account-form.cjs.entry.js +2 -2
- package/dist/cjs/{business-identity-schema-BA385xf-.js → business-identity-schema-Da3PJrGG.js} +1 -1
- package/dist/cjs/card-form.cjs.entry.js +2 -2
- package/dist/cjs/{check-pkg-version-DcgenUqU.js → check-pkg-version-DD7fjCqn.js} +1 -1
- package/dist/cjs/dispute-notification_2.cjs.entry.js +3 -3
- package/dist/cjs/hidden-input_2.cjs.entry.js +1 -1
- package/dist/cjs/justifi-apple-pay_11.cjs.entry.js +3 -3
- package/dist/cjs/justifi-bank-account-billing-form-simple.cjs.entry.js +3 -3
- package/dist/cjs/justifi-bank-account-form.cjs.entry.js +3 -3
- package/dist/cjs/justifi-business-details.cjs.entry.js +3 -3
- package/dist/cjs/justifi-business-form.cjs.entry.js +5 -5
- package/dist/cjs/justifi-card-form.cjs.entry.js +3 -3
- package/dist/cjs/justifi-checkout-qr-code.cjs.entry.js +3 -3
- package/dist/cjs/justifi-checkout.cjs.entry.js +3 -3
- package/dist/cjs/justifi-checkouts-list.cjs.entry.js +3 -3
- package/dist/cjs/justifi-dispute-management.cjs.entry.js +3 -3
- package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +3 -3
- package/dist/cjs/justifi-order-terminals.cjs.entry.js +3 -3
- package/dist/cjs/justifi-payment-details.cjs.entry.js +3 -3
- package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +3 -3
- package/dist/cjs/justifi-payment-transactions-list.cjs.entry.js +3 -3
- package/dist/cjs/justifi-payments-list.cjs.entry.js +3 -3
- package/dist/cjs/justifi-payout-details.cjs.entry.js +3 -3
- package/dist/cjs/justifi-payout-transactions-list.cjs.entry.js +10 -4
- package/dist/cjs/justifi-payouts-list.cjs.entry.js +3 -3
- package/dist/cjs/justifi-qr-terminal.cjs.entry.js +3 -3
- package/dist/cjs/justifi-refund-payment.cjs.entry.js +3 -3
- package/dist/cjs/justifi-season-interruption-insurance.cjs.entry.js +3 -3
- package/dist/cjs/justifi-terminal-orders-list.cjs.entry.js +3 -3
- package/dist/cjs/justifi-terminals-list.cjs.entry.js +3 -3
- package/dist/cjs/{package-CS22fAzw.js → package-DeCbZvnG.js} +1 -1
- package/dist/cjs/{schema-validations-C2XsZnqK.js → schema-validations-Cs0mSKR7.js} +2 -1
- package/dist/collection/components/business-forms/schemas/schema-validations.js +2 -1
- package/dist/collection/components/payout-transactions-list/payout-transactions-table.js +7 -1
- package/dist/docs.json +1 -1
- package/dist/esm/{Analytics-CTY3Jgn8.js → Analytics-CtVZmAya.js} +1 -1
- package/dist/esm/additional-questions-form-step_15.entry.js +2 -2
- package/dist/esm/bank-account-billing-form-simple_4.entry.js +1 -1
- package/dist/esm/bank-account-form.entry.js +2 -2
- package/dist/esm/{business-identity-schema-Csou60ZC.js → business-identity-schema-C1ot9Zas.js} +1 -1
- package/dist/esm/card-form.entry.js +2 -2
- package/dist/esm/{check-pkg-version-BOQqkWpf.js → check-pkg-version-DcFIDA70.js} +1 -1
- package/dist/esm/dispute-notification_2.entry.js +3 -3
- package/dist/esm/hidden-input_2.entry.js +1 -1
- package/dist/esm/justifi-apple-pay_11.entry.js +3 -3
- package/dist/esm/justifi-bank-account-billing-form-simple.entry.js +3 -3
- package/dist/esm/justifi-bank-account-form.entry.js +3 -3
- package/dist/esm/justifi-business-details.entry.js +3 -3
- package/dist/esm/justifi-business-form.entry.js +5 -5
- package/dist/esm/justifi-card-form.entry.js +3 -3
- package/dist/esm/justifi-checkout-qr-code.entry.js +3 -3
- package/dist/esm/justifi-checkout.entry.js +3 -3
- package/dist/esm/justifi-checkouts-list.entry.js +3 -3
- package/dist/esm/justifi-dispute-management.entry.js +3 -3
- package/dist/esm/justifi-gross-payment-chart.entry.js +3 -3
- package/dist/esm/justifi-order-terminals.entry.js +3 -3
- package/dist/esm/justifi-payment-details.entry.js +3 -3
- package/dist/esm/justifi-payment-provisioning.entry.js +3 -3
- package/dist/esm/justifi-payment-transactions-list.entry.js +3 -3
- package/dist/esm/justifi-payments-list.entry.js +3 -3
- package/dist/esm/justifi-payout-details.entry.js +3 -3
- package/dist/esm/justifi-payout-transactions-list.entry.js +10 -4
- package/dist/esm/justifi-payouts-list.entry.js +3 -3
- package/dist/esm/justifi-qr-terminal.entry.js +3 -3
- package/dist/esm/justifi-refund-payment.entry.js +3 -3
- package/dist/esm/justifi-season-interruption-insurance.entry.js +3 -3
- package/dist/esm/justifi-terminal-orders-list.entry.js +3 -3
- package/dist/esm/justifi-terminals-list.entry.js +3 -3
- package/dist/esm/{package-DNd24RUQ.js → package-Bx2_PW91.js} +1 -1
- package/dist/esm/{schema-validations-CySYE883.js → schema-validations-CHxw3FkH.js} +2 -1
- package/dist/module/justifi-payout-transactions-list.js +7 -1
- package/dist/module/package.js +1 -1
- package/dist/module/schema-validations.js +2 -1
- package/dist/types/components/payout-transactions-list/payout-transactions-table.d.ts +6 -0
- package/dist/webcomponents/{p-2757b61e.entry.js → p-0b9263f3.entry.js} +1 -1
- package/dist/webcomponents/{p-6d1299db.entry.js → p-17f8c3e7.entry.js} +1 -1
- package/dist/webcomponents/{p-f52fe722.entry.js → p-1fced37f.entry.js} +1 -1
- package/dist/webcomponents/{p-ac08992c.entry.js → p-291b9a48.entry.js} +1 -1
- package/dist/webcomponents/{p-c47db9f5.entry.js → p-2a0ab07f.entry.js} +1 -1
- package/dist/webcomponents/{p-5984e9df.entry.js → p-2b64659a.entry.js} +1 -1
- package/dist/webcomponents/{p-0dc3c605.entry.js → p-2c798125.entry.js} +1 -1
- package/dist/webcomponents/{p-ebd1c09f.entry.js → p-3918fb44.entry.js} +1 -1
- package/dist/webcomponents/{p-ec845aa4.entry.js → p-4383dfdc.entry.js} +1 -1
- package/dist/webcomponents/{p-49d9c0a4.entry.js → p-46a06ce6.entry.js} +1 -1
- package/dist/webcomponents/{p-90c5af69.entry.js → p-5ea486b6.entry.js} +1 -1
- package/dist/webcomponents/{p-f60bfe16.entry.js → p-6f71bf5f.entry.js} +1 -1
- package/dist/webcomponents/{p-863daddf.entry.js → p-708aee06.entry.js} +1 -1
- package/dist/webcomponents/{p-32ee9101.entry.js → p-7495aa96.entry.js} +1 -1
- package/dist/webcomponents/{p-b73c5779.entry.js → p-84b643f7.entry.js} +1 -1
- package/dist/webcomponents/{p-a7bd5651.entry.js → p-8771e52a.entry.js} +1 -1
- package/dist/webcomponents/{p-1737a7fc.entry.js → p-8fce7a9c.entry.js} +1 -1
- package/dist/webcomponents/{p-2092b278.entry.js → p-98bbdf10.entry.js} +1 -1
- package/dist/webcomponents/{p-a5913b33.entry.js → p-9d11aaf2.entry.js} +1 -1
- package/dist/webcomponents/p-Bx2_PW91.js +1 -0
- package/dist/webcomponents/p-BxpXvXn-.js +1 -0
- package/dist/webcomponents/{p-_GBnYSuR.js → p-CfIGO7TJ.js} +1 -1
- package/dist/webcomponents/{p-CQqmTKij.js → p-CqOzVXGL.js} +1 -1
- package/dist/webcomponents/{p-C1gr32IS.js → p-DK_bjvk1.js} +1 -1
- package/dist/webcomponents/{p-2ebc862f.entry.js → p-a62ef857.entry.js} +1 -1
- package/dist/webcomponents/{p-fca0ca4d.entry.js → p-b89a5053.entry.js} +1 -1
- package/dist/webcomponents/{p-a5cc55af.entry.js → p-c6eea99e.entry.js} +1 -1
- package/dist/webcomponents/p-db17a828.entry.js +1 -0
- package/dist/webcomponents/{p-2bab43ac.entry.js → p-dde22375.entry.js} +4 -4
- package/dist/webcomponents/{p-5d9d6dd5.entry.js → p-dfe66300.entry.js} +1 -1
- package/dist/webcomponents/{p-e711f221.entry.js → p-e9494d8f.entry.js} +1 -1
- package/dist/webcomponents/{p-fb2e1557.entry.js → p-ebee139f.entry.js} +1 -1
- package/dist/webcomponents/{p-f4de4ac0.entry.js → p-f01fd4ff.entry.js} +1 -1
- package/dist/webcomponents/{p-e8875186.entry.js → p-f4baf684.entry.js} +1 -1
- package/dist/webcomponents/{p-e63cd41f.entry.js → p-f6d49f21.entry.js} +1 -1
- package/dist/webcomponents/webcomponents.esm.js +1 -1
- package/package.json +1 -1
- package/dist/webcomponents/p-70a2f59a.entry.js +0 -1
- package/dist/webcomponents/p-DNd24RUQ.js +0 -1
- package/dist/webcomponents/p-z3RFjy9B.js +0 -1
|
@@ -2,8 +2,8 @@ import { r as registerInstance, c as createEvent, h } from './index-CV0Pyo1O.js'
|
|
|
2
2
|
import { m as makeGetCheckout } from './checkout-actions-D8JS2l5e.js';
|
|
3
3
|
import { C as CheckoutService } from './checkout.service-sHKaW-M0.js';
|
|
4
4
|
import { C as ComponentErrorSeverity, b as ComponentErrorCodes, I as ICheckoutStatus, c as ComponentErrorMessages, d as CompletionStatuses } from './Plaid-C8qoMZLV.js';
|
|
5
|
-
import { J as JustifiAnalytics } from './Analytics-
|
|
6
|
-
import { c as checkPkgVersion } from './check-pkg-version-
|
|
5
|
+
import { J as JustifiAnalytics } from './Analytics-CtVZmAya.js';
|
|
6
|
+
import { c as checkPkgVersion } from './check-pkg-version-DcFIDA70.js';
|
|
7
7
|
import './utils-myniydlM.js';
|
|
8
8
|
import './Api-DjAL73GZ.js';
|
|
9
9
|
import './config-state-kKn89dp1.js';
|
|
@@ -12,7 +12,7 @@ import './utils-CcA8Y5hs.js';
|
|
|
12
12
|
import './dinero-HXpYMWUU.js';
|
|
13
13
|
import './Pagination-CLHwhyvu.js';
|
|
14
14
|
import './Business-BcNb9bVO.js';
|
|
15
|
-
import './package-
|
|
15
|
+
import './package-Bx2_PW91.js';
|
|
16
16
|
|
|
17
17
|
const JustifiQrTerminal = class {
|
|
18
18
|
constructor(hostRef) {
|
|
@@ -10,8 +10,8 @@ import { S as StyledHost } from './styled-host-D84RBv1W.js';
|
|
|
10
10
|
import './event-types-CZfYo5-1.js';
|
|
11
11
|
import { P as PaymentService } from './payment.service-wSNYSRyl.js';
|
|
12
12
|
import { m as makeGetPaymentDetails } from './get-payment-details-Bipad3jX.js';
|
|
13
|
-
import { J as JustifiAnalytics } from './Analytics-
|
|
14
|
-
import { c as checkPkgVersion } from './check-pkg-version-
|
|
13
|
+
import { J as JustifiAnalytics } from './Analytics-CtVZmAya.js';
|
|
14
|
+
import { c as checkPkgVersion } from './check-pkg-version-DcFIDA70.js';
|
|
15
15
|
import { g as getErrorCode, a as getErrorMessage } from './utils-myniydlM.js';
|
|
16
16
|
import { A as Api } from './Api-DjAL73GZ.js';
|
|
17
17
|
import { S as Skeleton } from './skeleton-BEHo2ypu.js';
|
|
@@ -19,7 +19,7 @@ import './_commonjsHelpers-BFTU3MAI.js';
|
|
|
19
19
|
import './dinero-HXpYMWUU.js';
|
|
20
20
|
import './index-cDVGjRkU.js';
|
|
21
21
|
import './parts-CPKMvyV_.js';
|
|
22
|
-
import './package-
|
|
22
|
+
import './package-Bx2_PW91.js';
|
|
23
23
|
|
|
24
24
|
const amountValidation = (maxAmount) => {
|
|
25
25
|
const max = +maxAmount;
|
|
@@ -4,8 +4,8 @@ import { C as ComponentErrorSeverity, b as ComponentErrorCodes } from './Plaid-C
|
|
|
4
4
|
import './Pagination-CLHwhyvu.js';
|
|
5
5
|
import './Business-BcNb9bVO.js';
|
|
6
6
|
import { g as getErrorCode, a as getErrorMessage } from './utils-myniydlM.js';
|
|
7
|
-
import { J as JustifiAnalytics } from './Analytics-
|
|
8
|
-
import { c as checkPkgVersion } from './check-pkg-version-
|
|
7
|
+
import { J as JustifiAnalytics } from './Analytics-CtVZmAya.js';
|
|
8
|
+
import { c as checkPkgVersion } from './check-pkg-version-DcFIDA70.js';
|
|
9
9
|
import { c as checkoutStore } from './checkout.store-DibfdUMm.js';
|
|
10
10
|
import { p as processHTML, f as formatCurrency, r as removeAttribute, j as addAttribute } from './utils-CcA8Y5hs.js';
|
|
11
11
|
import { v as validateInsuranceValues, i as insuranceValues, a as insuranceErrors, H as Header2 } from './insurance-state-C5OZqDCT.js';
|
|
@@ -15,7 +15,7 @@ import './event-types-CZfYo5-1.js';
|
|
|
15
15
|
import { S as Skeleton } from './skeleton-BEHo2ypu.js';
|
|
16
16
|
import './config-state-kKn89dp1.js';
|
|
17
17
|
import './index-cDVGjRkU.js';
|
|
18
|
-
import './package-
|
|
18
|
+
import './package-Bx2_PW91.js';
|
|
19
19
|
import './index-DkoufM1t.js';
|
|
20
20
|
import './dinero-HXpYMWUU.js';
|
|
21
21
|
|
|
@@ -2,7 +2,7 @@ import { h, r as registerInstance, c as createEvent } from './index-CV0Pyo1O.js'
|
|
|
2
2
|
import { S as StyledHost } from './styled-host-D84RBv1W.js';
|
|
3
3
|
import { T as Table, a as TableWrapper, b as TableComponent, c as TableHead, d as TableHeadRow, e as TableBody, f as TableLoadingState, g as TableEmptyState, h as TableErrorState, i as TableRow, j as TableFoot, k as TableFootRow, l as TableFootCell } from './table-DqGfsdys.js';
|
|
4
4
|
import { T as TableClickActions } from './event-types-CZfYo5-1.js';
|
|
5
|
-
import { c as checkPkgVersion } from './check-pkg-version-
|
|
5
|
+
import { c as checkPkgVersion } from './check-pkg-version-DcFIDA70.js';
|
|
6
6
|
import { a6 as tableHeadCell, a7 as getAlternateTableCellPart } from './parts-CPKMvyV_.js';
|
|
7
7
|
import { a as convertToLocal } from './utils-CcA8Y5hs.js';
|
|
8
8
|
import './config-state-kKn89dp1.js';
|
|
@@ -13,10 +13,10 @@ import { B as BadgeVariant, a as Badge } from './badge-Dlcl9qdm.js';
|
|
|
13
13
|
import './dinero-HXpYMWUU.js';
|
|
14
14
|
import { g as getErrorCode, a as getErrorMessage } from './utils-myniydlM.js';
|
|
15
15
|
import { A as Api } from './Api-DjAL73GZ.js';
|
|
16
|
-
import { J as JustifiAnalytics } from './Analytics-
|
|
16
|
+
import { J as JustifiAnalytics } from './Analytics-CtVZmAya.js';
|
|
17
17
|
import { o as onQueryParamsChange, g as getRequestParams } from './terminal-orders-list-params-state-CiGfmyWW.js';
|
|
18
18
|
import './spinner-DIiQZd6_.js';
|
|
19
|
-
import './package-
|
|
19
|
+
import './package-Bx2_PW91.js';
|
|
20
20
|
import './index-cDVGjRkU.js';
|
|
21
21
|
|
|
22
22
|
const MapTerminalOrderStatusToBadge = (status) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { h, r as registerInstance, c as createEvent } from './index-CV0Pyo1O.js';
|
|
2
2
|
import { n as Terminal, C as ComponentErrorSeverity, b as ComponentErrorCodes } from './Plaid-C8qoMZLV.js';
|
|
3
|
-
import { J as JustifiAnalytics } from './Analytics-
|
|
4
|
-
import { c as checkPkgVersion } from './check-pkg-version-
|
|
3
|
+
import { J as JustifiAnalytics } from './Analytics-CtVZmAya.js';
|
|
4
|
+
import { c as checkPkgVersion } from './check-pkg-version-DcFIDA70.js';
|
|
5
5
|
import { T as TerminalService } from './terminal.service-xjfU0mJT.js';
|
|
6
6
|
import './config-state-kKn89dp1.js';
|
|
7
7
|
import './dinero-HXpYMWUU.js';
|
|
@@ -16,7 +16,7 @@ import { B as BadgeVariant, a as Badge } from './badge-Dlcl9qdm.js';
|
|
|
16
16
|
import { a6 as tableHeadCell, a7 as getAlternateTableCellPart } from './parts-CPKMvyV_.js';
|
|
17
17
|
import { k as capitalFirstLetter } from './utils-CcA8Y5hs.js';
|
|
18
18
|
import { o as onQueryParamsChange, g as getRequestParams } from './terminals-list-params-state-CiGfmyWW.js';
|
|
19
|
-
import './package-
|
|
19
|
+
import './package-Bx2_PW91.js';
|
|
20
20
|
import './Api-DjAL73GZ.js';
|
|
21
21
|
import './index-cDVGjRkU.js';
|
|
22
22
|
import './spinner-DIiQZd6_.js';
|
|
@@ -109,8 +109,9 @@ const makeTaxIdValidation = (country) => {
|
|
|
109
109
|
return taxIdValidation;
|
|
110
110
|
};
|
|
111
111
|
const dateOfIncorporationValidation = create$6()
|
|
112
|
-
.test('
|
|
112
|
+
.test('past-date', 'Date of registration must be in the past', (value) => {
|
|
113
113
|
const inputDate = new Date(value);
|
|
114
|
+
inputDate.setDate(inputDate.getDate() + 1);
|
|
114
115
|
const today = new Date();
|
|
115
116
|
return inputDate <= today;
|
|
116
117
|
})
|
|
@@ -76,7 +76,13 @@ const payoutTransactionTypes = {
|
|
|
76
76
|
dispute_fee_collected: "Dispute Fee Collected",
|
|
77
77
|
seller_payment: "Seller Payment",
|
|
78
78
|
transfer: "Transfer",
|
|
79
|
-
partner_platform_proceeds_credit: "Partner Platform Proceeds Credit"
|
|
79
|
+
partner_platform_proceeds_credit: "Partner Platform Proceeds Credit",
|
|
80
|
+
processing_fee: "Processing Fee",
|
|
81
|
+
refund_processing_fee: "Refund Processing Fee",
|
|
82
|
+
fee_rounding_adjustment: "Fee Rounding Adjustment",
|
|
83
|
+
platform_fee: "Platform Fee",
|
|
84
|
+
processing_fee_return: "Processing Fee Return",
|
|
85
|
+
platform_fee_return: "Platform Fee Return"
|
|
80
86
|
};
|
|
81
87
|
const payoutTransactionTableCells = {
|
|
82
88
|
id: (transaction) => (h("td", { part: getAlternateTableCellPart(transaction.id) }, transaction.id)),
|
package/dist/module/package.js
CHANGED
|
@@ -109,8 +109,9 @@ const makeTaxIdValidation = (country) => {
|
|
|
109
109
|
return taxIdValidation;
|
|
110
110
|
};
|
|
111
111
|
const dateOfIncorporationValidation = create$6()
|
|
112
|
-
.test('
|
|
112
|
+
.test('past-date', 'Date of registration must be in the past', (value) => {
|
|
113
113
|
const inputDate = new Date(value);
|
|
114
|
+
inputDate.setDate(inputDate.getDate() + 1);
|
|
114
115
|
const today = new Date();
|
|
115
116
|
return inputDate <= today;
|
|
116
117
|
})
|
|
@@ -26,6 +26,12 @@ export declare const payoutTransactionTypes: {
|
|
|
26
26
|
seller_payment: string;
|
|
27
27
|
transfer: string;
|
|
28
28
|
partner_platform_proceeds_credit: string;
|
|
29
|
+
processing_fee: string;
|
|
30
|
+
refund_processing_fee: string;
|
|
31
|
+
fee_rounding_adjustment: string;
|
|
32
|
+
platform_fee: string;
|
|
33
|
+
processing_fee_return: string;
|
|
34
|
+
platform_fee_return: string;
|
|
29
35
|
};
|
|
30
36
|
export declare const payoutTransactionTableCells: {
|
|
31
37
|
id: (transaction: PayoutBalanceTransaction) => any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,h as a}from"./p-CV0Pyo1O.js";import{J as o}from"./p-
|
|
1
|
+
import{r as t,h as a}from"./p-CV0Pyo1O.js";import{J as o}from"./p-CfIGO7TJ.js";import{c as r}from"./p-CqOzVXGL.js";import{w as s}from"./p-DVJaoI_m.js";import{S as p}from"./p-DzEdYT8R.js";import"./p-CZfYo5-1.js";import"./p-Bx2_PW91.js";import"./p-De4Pig-y.js";import"./p-BSs-2JKu.js";import"./p-HXpYMWUU.js";import"./p-DXTa04jn.js";import"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import"./p-D8GTwl9v.js";const i=class{constructor(a){t(this,a)}async componentWillLoad(){await s(),r(),this.analytics=new o(this)}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}async validate(){return this.cardFormElement.validate()}async tokenize({clientId:t,paymentMethodMetadata:a,account:o}){return this.cardFormElement.tokenize({clientId:t,paymentMethodMetadata:a,account:o})}render(){return a(p,{key:"e8591312a00d22c68812fda0b56a125ffd763e01"},a("card-form",{key:"e987ea9f3bcd2bf0aa8b2c6749bff3b902f20519",ref:t=>this.cardFormElement=t}))}};export{i as justifi_card_form}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as i,h as s}from"./p-CV0Pyo1O.js";import{J as o}from"./p-
|
|
1
|
+
import{r as i,h as s}from"./p-CV0Pyo1O.js";import{J as o}from"./p-CfIGO7TJ.js";import{c as r}from"./p-CqOzVXGL.js";import{w as t}from"./p-DVJaoI_m.js";import{S as p}from"./p-DzEdYT8R.js";import"./p-CZfYo5-1.js";import"./p-Bx2_PW91.js";import"./p-De4Pig-y.js";import"./p-BSs-2JKu.js";import"./p-HXpYMWUU.js";import"./p-DXTa04jn.js";import"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import"./p-D8GTwl9v.js";const a=class{constructor(s){i(this,s)}async componentWillLoad(){await t(),r(),this.analytics=new o(this)}disconnectedCallback(){var i;null===(i=this.analytics)||void 0===i||i.cleanup()}async getValues(){var i,s;return null!==(s=null===(i=this.bankAccountBillingFormSimpleRef)||void 0===i?void 0:i.getValues())&&void 0!==s?s:{}}async validate(){var i,s;return null!==(s=null===(i=this.bankAccountBillingFormSimpleRef)||void 0===i?void 0:i.validate())&&void 0!==s?s:{isValid:!1,errors:{}}}render(){return s(p,{key:"669227ed02e4f0791882b95ed814ea1865db80de"},s("bank-account-billing-form-simple",{key:"97cbe9637d8969023b1f7d3a6b3091a246112032",legend:this.legend,ref:i=>this.bankAccountBillingFormSimpleRef=i}))}};export{a as justifi_bank_account_billing_form_simple}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as i,r as e}from"./p-CV0Pyo1O.js";import{S as a}from"./p-uZ5KAseb.js";import{w as t,c as d}from"./p-DVJaoI_m.js";import{e as c}from"./p-BSs-2JKu.js";import{c as s}from"./p-
|
|
1
|
+
import{h as i,r as e}from"./p-CV0Pyo1O.js";import{S as a}from"./p-uZ5KAseb.js";import{w as t,c as d}from"./p-DVJaoI_m.js";import{e as c}from"./p-BSs-2JKu.js";import{c as s}from"./p-CqOzVXGL.js";import"./p-CPKMvyV_.js";import"./p-D8GTwl9v.js";import"./p-HXpYMWUU.js";import"./p-Bx2_PW91.js";const n=e=>{const{isReady:t}=e;return t?null:i("div",{class:"container-fluid p-0"},i("div",{class:"mb-3"},i(a,{height:"18px",width:"100px"}),i(a,{height:"36px"})),i("div",{class:"row"},i("div",{class:"col-4 align-content-end"},i(a,{height:"18px",width:"80px"}),i(a,{height:"36px"})),i("div",{class:"col-4 align-content-end"},i(a,{height:"36px"})),i("div",{class:"col-4 align-content-end"},i(a,{height:"18px",width:"30px"}),i(a,{height:"36px"}))))},r=class{constructor(i){e(this,i),this.isReady=!1}async componentWillLoad(){await t(),this.iframeOrigin=d.iframeOrigin,this.tabId=c(),s()}componentDidRender(){Promise.all([this.cardNumberIframeElement,this.expirationMonthIframeElement,this.expirationYearIframeElement,this.cvvIframeElement].map((i=>new Promise((e=>{i.addEventListener("iframeLoaded",(()=>{e()}))}))))).then((()=>{this.isReady=!0}))}async validate(){const i=await this.cardNumberIframeElement.validate(),e=await this.expirationMonthIframeElement.validate(),a=await this.expirationYearIframeElement.validate(),t=await this.cvvIframeElement.validate();return i&&e&&a&&t}async tokenize({clientId:i,paymentMethodMetadata:e,account:a}){return await this.cardNumberIframeElement.tokenize(i,e,a)}render(){return i("div",{key:"d3cb1fca6595f60e5f5f122b73d3d6c11a826423"},i(n,{key:"f83dcbbc214d460bb21c015ec051436ed5cf6670",isReady:this.isReady}),i("hidden-input",{key:"5fad0d06303d0ddb55c30c2cd94014255f2a8cec"}),i("div",{key:"68440756a1aad69b5c95245e7a2a5feb16899dca",class:"container-fluid p-0",style:{opacity:this.isReady?"1":"0",height:this.isReady?"auto":"0"}},i("div",{key:"b39eab56c79463935f1a1bb15cc867997f026e7b",class:"mb-3"},i("iframe-input",{key:"25a2390a8c3c92d5e6eceafe6b821202ecb22d76",inputId:"cardNumber",ref:i=>this.cardNumberIframeElement=i,label:"Card Number",iframeOrigin:`${this.iframeOrigin}/v2/cardNumber?tabId=${this.tabId}`})),i("div",{key:"68766798d954a0b3d093ae13c3c2955f819da4f2",class:"row"},i("div",{key:"05539f1ac8ebb0397574d55b4b76d7acdb7d2dca",class:"col-4 align-content-end"},i("iframe-input",{key:"4c437a4384e6c301e18824d799784c1133e70ee3",inputId:"expirationMonth",ref:i=>this.expirationMonthIframeElement=i,label:"Expiration",iframeOrigin:`${this.iframeOrigin}/v2/expirationMonth?tabId=${this.tabId}`})),i("div",{key:"b9a5b8b5dda1d8ab6305c9dc1ef9b655eb02fb3d",class:"col-4 align-content-end"},i("iframe-input",{key:"c1a412c20e75d21c1084a4b93f22362c367c1907",inputId:"expirationYear",ref:i=>this.expirationYearIframeElement=i,label:"",iframeOrigin:`${this.iframeOrigin}/v2/expirationYear?tabId=${this.tabId}`})),i("div",{key:"abdfdbd7eb784871011397a7c5fdf371e3c6baf0",class:"col-4 align-content-end"},i("iframe-input",{key:"08dff072e785846d7543018c194b4df6ce5b343e",inputId:"CVV",ref:i=>this.cvvIframeElement=i,label:"CVV",iframeOrigin:`${this.iframeOrigin}/v2/CVV?tabId=${this.tabId}`})))))}};export{r as card_form}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as t,r as e,c as a}from"./p-CV0Pyo1O.js";import{P as s}from"./p-NzPaWKbY.js";import"./p-DVJaoI_m.js";import"./p-HXpYMWUU.js";import{e as i,C as r,b as o}from"./p-DXTa04jn.js";import{p as n}from"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import{g as c,a as p}from"./p-CdwzNfP1.js";import{J as h}from"./p-
|
|
1
|
+
import{h as t,r as e,c as a}from"./p-CV0Pyo1O.js";import{P as s}from"./p-NzPaWKbY.js";import"./p-DVJaoI_m.js";import"./p-HXpYMWUU.js";import{e as i,C as r,b as o}from"./p-DXTa04jn.js";import{p as n}from"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import{g as c,a as p}from"./p-CdwzNfP1.js";import{J as h}from"./p-CfIGO7TJ.js";import{c as d}from"./p-CqOzVXGL.js";import{S as m}from"./p-DzEdYT8R.js";import{T as f,a as l,b as u,c as y,d as b,e as g,f as v,g as j,h as C,i as _,j as k,k as w,l as T}from"./p-BICxxa69.js";import{T as P}from"./p-CZfYo5-1.js";import{M as D}from"./p-D1_eip6x.js";import{a as O}from"./p-BSs-2JKu.js";import{a6 as S,a7 as I}from"./p-CPKMvyV_.js";import{o as x,g as A}from"./p-Dm07nLGs.js";import"./p-De4Pig-y.js";import"./p-D8GTwl9v.js";import"./p-Bx2_PW91.js";import"./p-CqiVXthx.js";import"./p-CHw7tICr.js";const E={created_at:()=>t("th",{part:S,scope:"col",title:"The date and time each payment was made"},"Date"),amount:()=>t("th",{part:S,scope:"col",title:"The dollar amount of each payment"},"Amount"),status:()=>t("th",{part:S,scope:"col",title:"The current status of each payment"},"Status"),payment_type:()=>t("th",{part:S,scope:"col",title:"The type of each payment"},"Type"),description:()=>t("th",{part:S,scope:"col",title:"The payment description, if you provided one"},"Description"),payers_name:()=>t("th",{part:S,scope:"col",title:"The name associated with the payment method"},"Account Holder"),last_four_digits:()=>t("th",{part:S,scope:"col",title:"The brand and last 4 digits of the payment method"},"Payment Method"),card_brand:()=>t("th",{part:S,scope:"col",title:"The brand of the payment method"},"Card Brand")},V={created_at:(e,a)=>t("td",{part:I(a)},t("div",{class:"fw-bold"},O(e.created_at,{showDisplayDate:!0})),t("div",{class:"fw-bold"},O(e.created_at,{showTime:!0}))),amount:(e,a)=>t("td",{part:I(a)},e.formattedPaymentAmount(e.amount)),status:(e,a)=>t("td",{part:I(a)},D(e.status)),payment_type:(e,a)=>t("td",{part:I(a)},e.payment_type),description:(e,a)=>t("td",{part:I(a)},e.description),payers_name:(e,a)=>t("td",{part:I(a)},e.payers_name),last_four_digits:(e,a)=>t("td",{part:I(a)},e.last_four_digits),card_brand:(e,a)=>{var s,i,r;return t("td",{part:I(a)},(r=(null===(s=e.payment_method.card)||void 0===s?void 0:s.brand)||(null===(i=e.payment_method.bank_account)||void 0===i?void 0:i.brand))?{visa:"VISA",mastercard:"Mastercard",american_express:"American Express",discover:"Discover",diners_club:"Diners Club",jcb:"JCB",china_unionpay:"China UnionPay",unknown:"Unknown"}[r.toLowerCase()]||r:"N/A")}},B=class{constructor(t){e(this,t),this.errorEvent=a(this,"error-event",7),this.clickEvent=a(this,"click-event",7),this.errorMessage=null,this.payments=[],this.loading=!0,this.paging=n,this.pagingParams={},this.columns="created_at,amount,status,payment_type,description,payers_name,last_four_digits,card_brand",this.handleClickPrevious=t=>{this.pagingParams={before_cursor:t},this.clickEvent.emit({name:P.previous})},this.handleClickNext=t=>{this.pagingParams={after_cursor:t},this.clickEvent.emit({name:P.next})},this.rowClickHandler=t=>{const e=t.target.closest("tr").dataset.rowEntityId;if(!e)return;const a=this.payments.find((t=>t.id===e));this.clickEvent.emit({name:P.row,data:a})}}componentWillLoad(){d(),this.analytics=new h(this),this.paymentsTable=new f(this.payments,this.columns,E,V),this.initializeGetPayments(),x("set",(()=>{this.pagingParams={},this.errorMessage=""})),x("reset",(()=>{this.pagingParams={},this.errorMessage=""}))}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}propChanged(){this.initializeGetPayments()}updateOnPropChange(){this.fetchData()}initializeGetPayments(){this.accountId&&this.authToken?this.getPayments=(({id:t,authToken:e,service:a})=>async({params:s,onSuccess:o,onError:n,final:h})=>{var d,m;try{const h=await a.fetchPayments(t,e,s);if(h.error)return n({error:p(h.error),code:c(null===(m=h.error)||void 0===m?void 0:m.code),severity:r.ERROR});{const t=Object.assign({},h.page_info);o({payments:(null===(d=h.data)||void 0===d?void 0:d.map((t=>new i(t))))||[],pagingInfo:t})}}catch(t){const e=c(null==t?void 0:t.code);return n({error:t.message||t,code:e,severity:r.ERROR})}finally{h()}})({id:this.accountId,authToken:this.authToken,service:new s}):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:o.MISSING_PROPS,message:this.errorMessage,severity:r.ERROR}))}fetchData(){this.getPayments&&(this.loading=!0,this.getPayments({params:this.paymentParams,onSuccess:({payments:t,pagingInfo:e})=>{this.payments=t,this.paging=e,this.paymentsTable.collectionData=this.payments},onError:({error:t,code:e,severity:a})=>{this.errorMessage=t,this.errorEvent.emit({errorCode:e,message:t,severity:a})},final:()=>{this.loading=!1}}))}get paymentParams(){const t=A();return Object.assign(Object.assign({},t),this.pagingParams)}get entityId(){return this.payments.map((t=>t.id))}get showEmptyState(){return!this.loading&&!this.errorMessage&&this.paymentsTable.rowData.length<1}get showErrorState(){return!this.loading&&!!this.errorMessage}get showRowData(){return!this.showEmptyState&&!this.showErrorState&&!this.loading}render(){return t(m,{key:"b2c7bd7573c3a2cdc683e6ea0b22bc625eaddbc6"},t(l,{key:"edcc04c18ae762b75aab3cebe31a5aab824843ef"},t(u,{key:"98b6e699948ac65667497b59b0ac23e36d7ea212"},t(y,{key:"06830e440c2f5ea23acd0109f58dd6e11f6495bf"},t(b,{key:"8a29564e85eb5a870c37c58cc57a149327f5405d"},this.paymentsTable.columnData.map((t=>t)))),t(g,{key:"a03ffd7422fbf7f364a6f7545a0158fb0cd38691"},t(v,{key:"6f48d9791c28a3407edddf97fc54a1a92c5e7dbc",columnSpan:this.paymentsTable.columnData.length,isLoading:this.loading}),t(j,{key:"ab948e22cf74e5db93835df17f93c200f0caf698",isEmpty:this.showEmptyState,columnSpan:this.paymentsTable.columnData.length}),t(C,{key:"28064e964a0db825ba7d78bc84e55c88b5c8e0c3",columnSpan:this.paymentsTable.columnData.length,errorMessage:this.errorMessage}),this.showRowData&&this.paymentsTable.rowData.map(((e,a)=>t(_,{"data-test-id":"table-row","data-row-entity-id":this.entityId[a],onClick:this.rowClickHandler},e)))),this.paging&&t(k,{key:"036c71025fb6d150a3bdaa370e84e955ecf79b66"},t(w,{key:"373d7ac9f89a226a32a26a5ee7bb2a2246f8a454"},t(T,{key:"a74ee4a4f5004dfe5e0513cfeea66c3b34b8d610",colSpan:this.paymentsTable.columnData.length},t("pagination-menu",{key:"438d49d2094bb17488b8e2aa90fd0dbce100d920",paging:Object.assign(Object.assign({},this.paging),{handleClickPrevious:this.handleClickPrevious,handleClickNext:this.handleClickNext})})))))))}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"],pagingParams:["updateOnPropChange"],getPayments:["updateOnPropChange"],columns:["updateOnPropChange"]}}};export{B as justifi_payments_list}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as t,r as e,c as s}from"./p-CV0Pyo1O.js";import{S as a}from"./p-DzEdYT8R.js";import{T as r,a as i,b as o,c as d,d as h,e as n,f as c,g as p,h as l,i as m,j as f,k as u,l as b}from"./p-BICxxa69.js";import{T as y}from"./p-CZfYo5-1.js";import{c as g}from"./p-
|
|
1
|
+
import{h as t,r as e,c as s}from"./p-CV0Pyo1O.js";import{S as a}from"./p-DzEdYT8R.js";import{T as r,a as i,b as o,c as d,d as h,e as n,f as c,g as p,h as l,i as m,j as f,k as u,l as b}from"./p-BICxxa69.js";import{T as y}from"./p-CZfYo5-1.js";import{c as g}from"./p-CqOzVXGL.js";import{a6 as v,a7 as C}from"./p-CPKMvyV_.js";import{a as j}from"./p-BSs-2JKu.js";import"./p-DVJaoI_m.js";import{f as w,p as T,C as _,b as k}from"./p-DXTa04jn.js";import{p as O}from"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import{B as D,a as P}from"./p-CHw7tICr.js";import"./p-HXpYMWUU.js";import{g as S,a as x}from"./p-CdwzNfP1.js";import{A as I}from"./p-De4Pig-y.js";import{J as B}from"./p-CfIGO7TJ.js";import{o as E,g as q}from"./p-BPTtWj7E.js";import"./p-CqiVXthx.js";import"./p-Bx2_PW91.js";import"./p-D8GTwl9v.js";const V={created_at:()=>t("th",{part:v,scope:"col",title:"The date and time the order was created"},"Created At"),updated_at:()=>t("th",{part:v,scope:"col",title:"The date and time the order was last updated"},"Updated At"),order_status:()=>t("th",{part:v,scope:"col",title:"The current status of the order"},"Order Status"),business_id:()=>t("th",{part:v,scope:"col",title:"The business ID associated with the order"},"Business ID"),company_name:()=>t("th",{part:v,scope:"col",title:"The business name associated with the order"},"Business Name"),provider:()=>t("th",{part:v,scope:"col",title:"The provider associated with the order"},"Provider"),order_type:()=>t("th",{part:v,scope:"col",title:"The type of order"},"Order Type"),quantity:()=>t("th",{part:v,scope:"col",title:"The number of terminals associated with the order"},"Order Quantity")},A={created_at:(e,s)=>t("td",{part:C(s)},t("div",{class:"fw-bold"},j(e.created_at,{showDisplayDate:!0})),t("div",{class:"fw-bold"},j(e.created_at,{showTime:!0}))),updated_at:(e,s)=>t("td",{part:C(s)},t("div",{class:"fw-bold"},j(e.updated_at,{showDisplayDate:!0})),t("div",{class:"fw-bold"},j(e.updated_at,{showTime:!0}))),order_status:(e,s)=>t("td",{part:C(s)},t(P,Object.assign({},{submitted:{variant:D.PRIMARY,title:"This order is submitted",text:"Submitted"},completed:{variant:D.SUCCESS,title:"This order has been completed",text:"Completed"},created:{variant:D.SECONDARY,title:"This order is created",text:"Created"},in_progress:{variant:D.PRIMARY,title:"This order is in progress",text:"In Progress"},on_hold:{variant:D.WARNING,title:"This order is on hold",text:"On Hold"},canceled:{variant:D.DANGER,title:"This order is canceled",text:"Canceled"}}[e.order_status]))),business_id:(e,s)=>t("td",{part:C(s)},e.business_id),company_name:(e,s)=>t("td",{part:C(s)},e.company_name),provider:(e,s)=>t("td",{part:C(s)},e.provider),order_type:(e,s)=>{let a;return e.order_type===w.boardingOnly?a="Boarding Only":e.order_type===w.boardingShipping&&(a="Boarding & Shipping"),t("td",{part:C(s)},a)},quantity:(e,s)=>t("td",{part:C(s)},e.terminals.length)},z=I();class G{async fetchTerminalOrders(t,e,s){return z.get({endpoint:"terminals/orders",params:s,headers:{account:t},authToken:e})}}const H=class{constructor(t){e(this,t),this.clickEvent=s(this,"click-event",7),this.errorEvent=s(this,"error-event",7),this.columns="created_at,updated_at,order_status,quantity",this.terminalOrders=[],this.loading=!0,this.paging=O,this.pagingParams={},this.handleClickPrevious=t=>{this.pagingParams={before_cursor:t},this.clickEvent.emit({name:y.previous})},this.handleClickNext=t=>{this.pagingParams={after_cursor:t},this.clickEvent.emit({name:y.next})},this.rowClickHandler=t=>{const e=t.target.closest("tr").dataset.rowEntityId;if(!e)return;const s=this.terminalOrders.find((t=>t.id===e));this.clickEvent.emit({name:y.row,data:s})}}componentWillLoad(){g(),this.analytics=new B(this),this.terminalOrdersTable=new r(this.terminalOrders,this.columns,V,A),this.initializeGetData(),this.getTerminalOrders&&this.fetchData(),E("set",(()=>{this.pagingParams={}})),E("reset",(()=>{this.pagingParams={},this.errorMessage=""}))}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}authPropChanged(){this.initializeGetData(),this.getTerminalOrders&&this.fetchData()}pagingOrColumnsChanged(){this.getTerminalOrders&&this.fetchData()}initializeGetData(){this.accountId&&this.authToken?this.getTerminalOrders=(({id:t,authToken:e,service:s})=>async({params:a,onSuccess:r,onError:i,final:o})=>{var d,h;try{const o=await s.fetchTerminalOrders(t,e,a);if(o.error)return i({error:x(o.error),code:S(null===(h=o.error)||void 0===h?void 0:h.code),severity:_.ERROR});{const t=Object.assign({},o.page_info);r({terminalOrders:(null===(d=o.data)||void 0===d?void 0:d.map((t=>new T(t))))||[],pagingInfo:t})}}catch(t){const e=S(null==t?void 0:t.code);return i({error:t.message||t,code:e,severity:_.ERROR})}finally{o()}})({id:this.accountId,authToken:this.authToken,service:new G}):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:k.MISSING_PROPS,message:this.errorMessage,severity:_.ERROR}))}fetchData(){this.getTerminalOrders&&(this.loading=!0,this.getTerminalOrders({params:this.terminalOrderParams,onSuccess:async({terminalOrders:t,pagingInfo:e})=>{this.terminalOrders=t,this.paging=e,this.terminalOrdersTable.collectionData=this.terminalOrders},onError:({error:t,code:e,severity:s})=>{this.errorMessage=t,this.errorEvent.emit({errorCode:e,message:t,severity:s})},final:()=>{this.loading=!1}}))}get terminalOrderParams(){const t=q();return Object.assign(Object.assign({},t),this.pagingParams)}get entityId(){return this.terminalOrders.map((t=>t.id))}get showEmptyState(){return!this.loading&&!this.errorMessage&&this.terminalOrdersTable.rowData.length<1}get showErrorState(){return!this.loading&&!!this.errorMessage}get showRowData(){return!this.showEmptyState&&!this.showErrorState&&!this.loading}render(){return t(a,{key:"14c0dfe45a6833251f4c2d1d27ea49568f7ac01e"},t(i,{key:"7995d0b2ccb002265769804aa112dca1178d14dd"},t(o,{key:"ddfb54945255a1ae601659b5dee46da8e7fbfb52"},t(d,{key:"26958541cd82e414d9b079ac18ff69022969a4b8"},t(h,{key:"1068214ddc3e0003bab2212c0baff74c7e086b96"},this.terminalOrdersTable.columnData.map((t=>t)))),t(n,{key:"7b043e72311e7c956855320b7293a33e41f08da2"},t(c,{key:"b2532063645be1e926cfd7dca5b33414d09e5703",columnSpan:this.terminalOrdersTable.columnKeys.length,isLoading:this.loading}),t(p,{key:"ceec3f0f885e1377afdf36ca2714ebac9b6f7bfc",isEmpty:this.showEmptyState,columnSpan:this.terminalOrdersTable.columnKeys.length}),t(l,{key:"2c35baac2f8902e8bf96844f17f57104ba253986",columnSpan:this.terminalOrdersTable.columnKeys.length,errorMessage:this.errorMessage}),this.showRowData&&this.terminalOrdersTable.rowData.map(((e,s)=>t(m,{"data-test-id":"table-row","data-row-entity-id":this.entityId[s],onClick:this.rowClickHandler},e)))),this.paging&&t(f,{key:"f5e1fe9ba78d5cee96e044c60ffaabe45ff3d19d"},t(u,{key:"ab8c1111b2a1124ba3f0b0bf2deb5893cf4c4ce5"},t(b,{key:"d463b0e2db8c5d093b38816d78c9176e302fe2c0",colSpan:this.terminalOrdersTable.columnData.length},t("pagination-menu",{key:"364dfccaa8480e63e51fa3bbdbf4cbb560e9fbbf",paging:Object.assign(Object.assign({},this.paging),{handleClickPrevious:this.handleClickPrevious,handleClickNext:this.handleClickNext})})))))))}static get watchers(){return{accountId:["authPropChanged"],authToken:["authPropChanged"],pagingParams:["pagingOrColumnsChanged"],columns:["pagingOrColumnsChanged"]}}};export{H as justifi_terminal_orders_list}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as s,r as t,c as i}from"./p-CV0Pyo1O.js";import{A as e}from"./p-De4Pig-y.js";import{C as r,b as o}from"./p-DXTa04jn.js";import"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import{g as a,a as n}from"./p-CdwzNfP1.js";import{J as c}from"./p-
|
|
1
|
+
import{h as s,r as t,c as i}from"./p-CV0Pyo1O.js";import{A as e}from"./p-De4Pig-y.js";import{C as r,b as o}from"./p-DXTa04jn.js";import"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import{g as a,a as n}from"./p-CdwzNfP1.js";import{J as c}from"./p-CfIGO7TJ.js";import{c as l}from"./p-CqOzVXGL.js";import{c as h}from"./p-DyPk4BJt.js";import{p as d,f as p,r as u,j as v}from"./p-BSs-2JKu.js";import{v as m,i as y,a as f,H as j}from"./p-C-Jgmek8.js";import{t as _,z as g}from"./p-CPKMvyV_.js";import{S as b}from"./p-DzEdYT8R.js";import"./p-CZfYo5-1.js";import{S as k}from"./p-uZ5KAseb.js";import"./p-DVJaoI_m.js";import"./p-D8GTwl9v.js";import"./p-Bx2_PW91.js";import"./p-DkoufM1t.js";import"./p-HXpYMWUU.js";const C=e();class w{async fetchQuote(s,t){return C.post({endpoint:"insurance/quotes",body:t,authToken:s})}async toggleCoverage(s,t,i){return C.post({endpoint:`insurance/quotes/${t}/toggle`,body:i,authToken:s})}}const T=()=>s("div",{class:"row gap-3"},s("div",{class:"col-12"},s(k,{width:"35%",height:"30px"})),s("div",{class:"col-12"},s(k,{width:"70%"})),s("div",{class:"col-12"},s(k,{width:"40%"})),s("div",{class:"col-12"},s(k,{width:"40%"})),s("div",{class:"col-12"},s(k,{width:"100%"})),s("div",{class:"col-12"},s(k,{width:"80%"}))),D=class{constructor(s){t(this,s),this.insuranceUpdated=i(this,"insurance-updated",7),this.errorEvent=i(this,"error-event",7),this.isLoading=!0}async validate(){return m()}processHTMLContent(s){return d(s,[s=>u(s,"style"),s=>v(s,"a","part",_),s=>v(s,"p","part",_)])}componentWillLoad(){l(),this.analytics=new c(this),this.initializeServiceMethods(),this.getQuote&&this.fetchData()}disconnectedCallback(){var s;null===(s=this.analytics)||void 0===s||s.cleanup()}initializeServiceMethods(){const s=this.authToken||h.authToken;if(!s)return void this.errorEvent.emit({errorCode:o.MISSING_PROPS,message:"Missing authToken",severity:r.ERROR});const t={authToken:s,service:new w};this.getQuote=(({authToken:s,service:t})=>async({payload:i,onSuccess:e,onError:o})=>{var c;try{const l=await t.fetchQuote(s,i);if(l.error)return o({error:n(l.error),code:a(null===(c=l.error)||void 0===c?void 0:c.code),severity:r.ERROR});e({quote:l.data})}catch(s){const t=a(null==s?void 0:s.code);return o({error:s.message||s,code:t,severity:r.ERROR})}})(t),this.toggleCoverage=(({authToken:s,service:t})=>async({quoteId:i,payload:e,onSuccess:o,onError:c})=>{var l;try{const h=await t.toggleCoverage(s,i,e);if(h.error)return c({error:n(h.error),code:a(null===(l=h.error)||void 0===l?void 0:l.code),severity:r.ERROR});o({quote:h.data})}catch(s){const t=a(null==s?void 0:s.code);return c({error:s.message||s,code:t,severity:r.ERROR})}})(t)}fetchData(){this.isLoading=!0,this.getQuote({payload:{checkout_id:this.checkoutId||h.checkoutId,policy_type:"season_interruption",primary_identity:{state:this.primaryIdentityState,email:this.primaryIdentityEmailAddress,first_name:this.primaryIdentityFirstName,last_name:this.primaryIdentityLastName,postal_code:this.primaryIdentityPostalCode,country:this.primaryIdentityCountry},policy_attributes:{insurable_amount:this.policyAttributesInsurableAmount,start_date:this.policyAttributesStartDate,end_date:this.policyAttributesEndDate,covered_identity:{first_name:this.coveredIdentityFirstName,last_name:this.coveredIdentityLastName}}},onSuccess:({quote:s})=>{this.quote=s,this.quote.product.description=this.processHTMLContent(this.quote.product.description),this.quote.product.legal_disclaimer=this.processHTMLContent(this.quote.product.legal_disclaimer),y[s.policy_type]=s.accepted,this.isLoading=!1},onError:({error:s,code:t,severity:i})=>{this.isLoading=!1,this.errorEvent.emit({errorCode:t,message:s,severity:i})}})}onChangeHandler(s,t){this.accepted=t,f[this.quote.policy_type]=!1,this.toggleCoverage({quoteId:this.quote.id,payload:{accepted:this.accepted},onSuccess:()=>{this.insuranceUpdated.emit(),y[this.quote.policy_type]=this.accepted},onError:({error:s,code:t,severity:i})=>{this.errorEvent.emit({errorCode:t,message:s,severity:i})}})}get error(){var s;return f[null===(s=this.quote)||void 0===s?void 0:s.policy_type]}render(){var t,i,e,r;return h&&!1===h.insuranceEnabled?(console.warn("[justifi-season-interruption-insurance] Insurance is disabled for this checkout (payment_settings.insurance_payments=false)."),null):s(b,null,this.isLoading?s(T,null):s("div",null,s(j,{text:null===(t=this.quote)||void 0===t?void 0:t.product.title,class:"fs-5 fw-bold pb-3"}),s("small",{part:_,innerHTML:null===(i=this.quote)||void 0===i?void 0:i.product.description}),s("form-control-radio",{label:`Accept coverage for ${p(null===(e=this.quote)||void 0===e?void 0:e.total_cents)}`,name:"opt-in",value:"true",checked:"true"===this.accepted,inputHandler:this.onChangeHandler.bind(this),errorText:this.error?" ":void 0}),s("form-control-radio",{label:"Decline coverage",name:"opt-in",value:"false",checked:"false"===this.accepted,inputHandler:this.onChangeHandler.bind(this),errorText:this.error?" ":void 0}),s("div",{class:"invalid-feedback",style:{display:this.error?"block":"none"},part:g},"Please select an option"),s("small",{part:_,innerHTML:null===(r=this.quote)||void 0===r?void 0:r.product.legal_disclaimer})))}};export{D as justifi_season_interruption_insurance}
|