@justifi/webcomponents 6.15.0-rc.1 → 6.15.0
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/LICENSE +21 -0
- package/dist/cjs/{Analytics-VQGAbMVS.js → Analytics-BjZHa0wt.js} +4 -4
- package/dist/cjs/{Api--EGkA-pT.js → Api-us3AxMRC.js} +1 -1
- package/dist/cjs/{Business-oBifyXkW.js → Business-CNaz-VLa.js} +5 -1
- package/dist/cjs/{Plaid-D85oV9FN.js → Plaid-BcOAKDaU.js} +1 -1
- package/dist/cjs/additional-questions-form-step_15.cjs.entry.js +13 -13
- package/dist/cjs/additional-questions_4.cjs.entry.js +3 -3
- package/dist/cjs/bank-account-billing-form-simple_4.cjs.entry.js +4 -4
- package/dist/cjs/bank-account-document-form-inputs.cjs.entry.js +2 -2
- package/dist/cjs/bank-account-form.cjs.entry.js +4 -4
- package/dist/cjs/{business-form-options-CnlrfbQ6.js → business-form-options-BHBs_yiK.js} +1 -1
- package/dist/cjs/{business-identity-schema-hpDJFnB4.js → business-identity-schema-XiCLzxWM.js} +3 -3
- package/dist/cjs/{business.service-B51fjG_j.js → business.service-_Sl3vWmu.js} +3 -3
- package/dist/cjs/card-form.cjs.entry.js +4 -4
- package/dist/cjs/{check-pkg-version-RMsgKzFc.js → check-pkg-version-CjJab8fX.js} +1 -1
- package/dist/cjs/{checkout-actions-BRQFQ6n-.js → checkout-actions-CQyGpVPe.js} +2 -2
- package/dist/cjs/{checkout.service-BsOwkSNp.js → checkout.service-B_qymeqJ.js} +3 -3
- package/dist/cjs/{country-config-C1bWmF8P.js → country-config-DQQujh5h.js} +1 -1
- package/dist/cjs/custom-popper_2.cjs.entry.js +2 -2
- package/dist/cjs/dispute-notification_2.cjs.entry.js +8 -8
- package/dist/cjs/{event-types-C_LP6UcW.js → event-types-DmY59QXs.js} +3 -3
- package/dist/cjs/form-address-fields_3.cjs.entry.js +4 -4
- package/dist/cjs/form-alert_3.cjs.entry.js +5 -5
- package/dist/cjs/form-control-date.cjs.entry.js +2 -2
- package/dist/cjs/form-control-file-v2_2.cjs.entry.js +3 -3
- package/dist/cjs/form-control-file.cjs.entry.js +2 -2
- package/dist/cjs/form-control-monetary.cjs.entry.js +2 -2
- package/dist/cjs/form-control-number_2.cjs.entry.js +6 -6
- package/dist/cjs/form-control-radio.cjs.entry.js +2 -2
- package/dist/cjs/form-control-select_2.cjs.entry.js +2 -2
- package/dist/cjs/{get-business-BpaRbn5S.js → get-business-BVxtiSDs.js} +3 -3
- package/dist/cjs/{get-payment-details-Cmg8gWvo.js → get-payment-details-DR1GgpyX.js} +3 -3
- package/dist/cjs/{get-subaccounts-d4CUegsn.js → get-subaccounts-BMY2bOFj.js} +4 -4
- package/dist/cjs/{input-handlers-_51J5q7J.js → input-handlers-v9h_2Ysi.js} +1 -1
- package/dist/cjs/internal-button.cjs.entry.js +1 -1
- package/dist/cjs/justifi-apple-pay_12.cjs.entry.js +58 -21
- package/dist/cjs/justifi-bank-account-billing-form-simple.cjs.entry.js +6 -6
- package/dist/cjs/justifi-bank-account-form.cjs.entry.js +6 -6
- package/dist/cjs/justifi-business-details.cjs.entry.js +9 -9
- package/dist/cjs/justifi-business-form.cjs.entry.js +13 -13
- package/dist/cjs/justifi-card-form.cjs.entry.js +6 -6
- package/dist/cjs/justifi-checkout-qr-code.cjs.entry.js +6 -6
- package/dist/cjs/justifi-checkout.cjs.entry.js +6 -6
- package/dist/cjs/justifi-checkouts-list-filters.cjs.entry.js +6 -4
- package/dist/cjs/justifi-checkouts-list.cjs.entry.js +11 -11
- package/dist/cjs/justifi-dispute-management.cjs.entry.js +8 -8
- package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +33 -20
- package/dist/cjs/justifi-order-terminals.cjs.entry.js +11 -11
- package/dist/cjs/justifi-payment-details.cjs.entry.js +17 -17
- package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +9 -9
- package/dist/cjs/justifi-payment-transactions-list.cjs.entry.js +9 -9
- package/dist/cjs/justifi-payments-list-filters.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payments-list.cjs.entry.js +9 -9
- package/dist/cjs/justifi-payout-details.cjs.entry.js +12 -12
- package/dist/cjs/justifi-payout-transactions-list.cjs.entry.js +9 -9
- package/dist/cjs/justifi-payouts-list-filters.cjs.entry.js +4 -4
- package/dist/cjs/justifi-payouts-list.cjs.entry.js +11 -11
- package/dist/cjs/justifi-qr-terminal.cjs.entry.js +9 -9
- package/dist/cjs/justifi-refund-payment.cjs.entry.js +9 -9
- package/dist/cjs/justifi-season-interruption-insurance.cjs.entry.js +7 -7
- package/dist/cjs/justifi-skeleton.cjs.entry.js +1 -1
- package/dist/cjs/justifi-terminal-orders-list-filters.cjs.entry.js +5 -5
- package/dist/cjs/justifi-terminal-orders-list.cjs.entry.js +9 -9
- package/dist/cjs/justifi-terminals-list-filters.cjs.entry.js +3 -3
- package/dist/cjs/justifi-terminals-list.cjs.entry.js +10 -10
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{package-DfwuePUh.js → package-30T__1wH.js} +1 -1
- package/dist/cjs/{payment-provisioning-actions-DDooZhhk.js → payment-provisioning-actions-SVp7B8pR.js} +2 -2
- package/dist/cjs/payment-provisioning-form-buttons_2.cjs.entry.js +1 -1
- package/dist/cjs/{payment.service-Vy_JnuSA.js → payment.service-DRXVT-uB.js} +3 -3
- package/dist/cjs/{payout.service-BEPglFXf.js → payout.service-CuQ-mXKB.js} +3 -3
- package/dist/cjs/{payouts-status-1IUtW-UQ.js → payouts-status-BvHeuy9v.js} +2 -2
- package/dist/cjs/{plaid.service-DXQ7q51E.js → plaid.service-B58nzlUE.js} +3 -3
- package/dist/cjs/radio-list-item.cjs.entry.js +1 -1
- package/dist/cjs/{schema-validations-DehT309E.js → schema-validations-sjRvL4KO.js} +5 -4
- package/dist/cjs/terminal-quantity-selector.cjs.entry.js +1 -1
- package/dist/cjs/{terminal.service-BP2YecQ_.js → terminal.service-CmtSEgTc.js} +3 -3
- package/dist/cjs/{utils-CBriZzRC.js → utils-BScgWJC5.js} +1 -1
- package/dist/cjs/webcomponents.cjs.js +1 -1
- package/dist/collection/api/Business.js +2 -0
- package/dist/collection/api/Checkout.js +1 -1
- package/dist/collection/components/business-forms/schemas/schema-helpers.js +2 -1
- package/dist/collection/components/business-forms/utils/helpers.js +3 -1
- package/dist/collection/components/checkouts-list/checkouts-list-filters.js +4 -2
- package/dist/collection/components/checkouts-list/justifi-checkouts-list.js +3 -3
- package/dist/collection/components/modular-checkout/sub-components/justifi-apple-pay.js +7 -1
- package/dist/collection/components/modular-checkout/sub-components/paypal/justifi-paypal.js +38 -13
- package/dist/collection/components/order-terminals/justifi-order-terminals.js +1 -1
- package/dist/collection/components/order-terminals/terminal-quantity-selector/terminal-quantity-selector.js +1 -1
- package/dist/collection/components/payment-details/justifi-payment-details.js +8 -8
- package/dist/collection/components/payment-transactions-list/justifi-payment-transactions-list.js +1 -1
- package/dist/collection/components/payments-list/justifi-payments-list-filters.js +2 -2
- package/dist/collection/components/payments-list/justifi-payments-list.js +1 -1
- package/dist/collection/components/payout-details/justifi-payout-details.js +3 -3
- package/dist/collection/components/payout-transactions-list/justifi-payout-transactions-list.js +1 -1
- package/dist/collection/components/payouts-list/justifi-payouts-list-filters.js +2 -2
- package/dist/collection/components/payouts-list/justifi-payouts-list.js +1 -1
- package/dist/collection/components/terminal-orders-list/justifi-terminal-orders-list-filters.js +3 -3
- package/dist/collection/components/terminal-orders-list/justifi-terminal-orders-list.js +2 -2
- package/dist/collection/components/terminals-list/justifi-terminals-list-filters.js +1 -1
- package/dist/collection/components/terminals-list/justifi-terminals-list.js +1 -1
- package/dist/collection/components/tokenize-payment-method/justifi-tokenize-payment-method.js +1 -1
- package/dist/collection/ui-components/custom-popper/custom-popper.js +2 -2
- package/dist/collection/ui-components/form/form-control-date.js +2 -2
- package/dist/collection/ui-components/form/form-control-file-v2.js +1 -1
- package/dist/collection/ui-components/form/form-control-file.js +2 -2
- package/dist/collection/ui-components/form/form-control-monetary.js +2 -2
- package/dist/collection/ui-components/form/form-control-number-masked.js +2 -2
- package/dist/collection/ui-components/form/form-control-number.js +2 -2
- package/dist/collection/ui-components/form/form-control-radio.js +2 -2
- package/dist/collection/ui-components/form/form-control-text.js +2 -2
- package/dist/collection/ui-components/form/form-control-textarea.js +2 -2
- package/dist/collection/ui-components/form/hidden-input.js +1 -1
- package/dist/collection/ui-components/form/iframe-input.js +3 -3
- package/dist/collection/ui-components/internal-button.js +1 -1
- package/dist/collection/ui-components/radio-list-item.js +1 -1
- package/dist/collection/ui-components/shadow-dom-components/justifi-button.js +1 -1
- package/dist/collection/ui-components/shadow-dom-components/justifi-header.js +1 -1
- package/dist/collection/ui-components/shadow-dom-components/justifi-skeleton.js +1 -1
- package/dist/docs.json +2 -2
- package/dist/esm/{Analytics-hKJLmoJl.js → Analytics-BtMYbHD0.js} +4 -4
- package/dist/esm/{Api-DAJ9sMMj.js → Api-nVK-rgbk.js} +1 -1
- package/dist/esm/{Business-DaDqgDrb.js → Business-CTtGaVYs.js} +5 -1
- package/dist/esm/{Plaid-BP3xNxQF.js → Plaid-CRcTLeaz.js} +1 -1
- package/dist/esm/additional-questions-form-step_15.entry.js +13 -13
- package/dist/esm/additional-questions_4.entry.js +3 -3
- package/dist/esm/bank-account-billing-form-simple_4.entry.js +4 -4
- package/dist/esm/bank-account-document-form-inputs.entry.js +2 -2
- package/dist/esm/bank-account-form.entry.js +4 -4
- package/dist/esm/{business-form-options-BxVQL9ar.js → business-form-options-DLRkVtee.js} +1 -1
- package/dist/esm/{business-identity-schema-BkmRlnQo.js → business-identity-schema-BP61Unwf.js} +3 -3
- package/dist/esm/{business.service-kmkjOyTm.js → business.service-Cq7H5w1T.js} +3 -3
- package/dist/esm/card-form.entry.js +4 -4
- package/dist/esm/{check-pkg-version-FEAmKlDW.js → check-pkg-version-BW9zgceK.js} +1 -1
- package/dist/esm/{checkout-actions-0ftD0elo.js → checkout-actions-CWnrb317.js} +2 -2
- package/dist/esm/{checkout.service-BVBmNheb.js → checkout.service-JA7oTq5d.js} +3 -3
- package/dist/esm/{country-config-CJwnhkdq.js → country-config-F5YwgHgR.js} +1 -1
- package/dist/esm/custom-popper_2.entry.js +2 -2
- package/dist/esm/dispute-notification_2.entry.js +8 -8
- package/dist/esm/{event-types-B5-lsGjZ.js → event-types-Dsf8IwD6.js} +3 -3
- package/dist/esm/form-address-fields_3.entry.js +4 -4
- package/dist/esm/form-alert_3.entry.js +5 -5
- package/dist/esm/form-control-date.entry.js +2 -2
- package/dist/esm/form-control-file-v2_2.entry.js +3 -3
- package/dist/esm/form-control-file.entry.js +2 -2
- package/dist/esm/form-control-monetary.entry.js +2 -2
- package/dist/esm/form-control-number_2.entry.js +6 -6
- package/dist/esm/form-control-radio.entry.js +2 -2
- package/dist/esm/form-control-select_2.entry.js +2 -2
- package/dist/esm/{get-business-BLCT-zfN.js → get-business-IZpxKRZM.js} +3 -3
- package/dist/esm/{get-payment-details-BokzuPGl.js → get-payment-details-DSI41Pq5.js} +3 -3
- package/dist/esm/{get-subaccounts-By7m_FxO.js → get-subaccounts-B-S2TGRa.js} +4 -4
- package/dist/esm/{input-handlers-Dfuc6aDW.js → input-handlers-Dm8jO-BT.js} +1 -1
- package/dist/esm/internal-button.entry.js +1 -1
- package/dist/esm/justifi-apple-pay_12.entry.js +58 -21
- package/dist/esm/justifi-bank-account-billing-form-simple.entry.js +6 -6
- package/dist/esm/justifi-bank-account-form.entry.js +6 -6
- package/dist/esm/justifi-business-details.entry.js +9 -9
- package/dist/esm/justifi-business-form.entry.js +13 -13
- package/dist/esm/justifi-card-form.entry.js +6 -6
- package/dist/esm/justifi-checkout-qr-code.entry.js +6 -6
- package/dist/esm/justifi-checkout.entry.js +6 -6
- package/dist/esm/justifi-checkouts-list-filters.entry.js +6 -4
- package/dist/esm/justifi-checkouts-list.entry.js +11 -11
- package/dist/esm/justifi-dispute-management.entry.js +8 -8
- package/dist/esm/justifi-gross-payment-chart.entry.js +33 -20
- package/dist/esm/justifi-order-terminals.entry.js +11 -11
- package/dist/esm/justifi-payment-details.entry.js +17 -17
- package/dist/esm/justifi-payment-provisioning.entry.js +9 -9
- package/dist/esm/justifi-payment-transactions-list.entry.js +9 -9
- package/dist/esm/justifi-payments-list-filters.entry.js +2 -2
- package/dist/esm/justifi-payments-list.entry.js +9 -9
- package/dist/esm/justifi-payout-details.entry.js +12 -12
- package/dist/esm/justifi-payout-transactions-list.entry.js +9 -9
- package/dist/esm/justifi-payouts-list-filters.entry.js +4 -4
- package/dist/esm/justifi-payouts-list.entry.js +11 -11
- package/dist/esm/justifi-qr-terminal.entry.js +9 -9
- package/dist/esm/justifi-refund-payment.entry.js +9 -9
- package/dist/esm/justifi-season-interruption-insurance.entry.js +7 -7
- package/dist/esm/justifi-skeleton.entry.js +1 -1
- package/dist/esm/justifi-terminal-orders-list-filters.entry.js +5 -5
- package/dist/esm/justifi-terminal-orders-list.entry.js +9 -9
- package/dist/esm/justifi-terminals-list-filters.entry.js +3 -3
- package/dist/esm/justifi-terminals-list.entry.js +10 -10
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{package-Dn9_7aQh.js → package-BC9n8nB2.js} +1 -1
- package/dist/esm/{payment-provisioning-actions-VRIPjnAQ.js → payment-provisioning-actions-VtleD509.js} +2 -2
- package/dist/esm/payment-provisioning-form-buttons_2.entry.js +1 -1
- package/dist/esm/{payment.service-CMUlMV1Y.js → payment.service-B42sKlQE.js} +3 -3
- package/dist/esm/{payout.service-C0yd0JZS.js → payout.service-BIoAgNJJ.js} +3 -3
- package/dist/esm/{payouts-status-CaiC5qpn.js → payouts-status-CnIf4XDi.js} +2 -2
- package/dist/esm/{plaid.service-CqihCTBS.js → plaid.service-C6Ltk2ef.js} +3 -3
- package/dist/esm/radio-list-item.entry.js +1 -1
- package/dist/esm/{schema-validations-8dbMCACI.js → schema-validations-De7Qe0VU.js} +5 -4
- package/dist/esm/terminal-quantity-selector.entry.js +1 -1
- package/dist/esm/{terminal.service-DuF3uTuA.js → terminal.service-DV3qIwBy.js} +3 -3
- package/dist/esm/{utils-YUOJKtjO.js → utils-DaPywmTI.js} +1 -1
- package/dist/esm/webcomponents.js +1 -1
- package/dist/module/Business.js +5 -1
- package/dist/module/Plaid.js +1 -1
- package/dist/module/custom-popper2.js +2 -2
- package/dist/module/form-control-date2.js +2 -2
- package/dist/module/form-control-file-v22.js +1 -1
- package/dist/module/form-control-file2.js +2 -2
- package/dist/module/form-control-monetary2.js +2 -2
- package/dist/module/form-control-number-masked2.js +2 -2
- package/dist/module/form-control-number2.js +2 -2
- package/dist/module/form-control-radio2.js +2 -2
- package/dist/module/form-control-text2.js +2 -2
- package/dist/module/form-control-textarea2.js +2 -2
- package/dist/module/hidden-input2.js +1 -1
- package/dist/module/iframe-input2.js +3 -3
- package/dist/module/internal-button2.js +1 -1
- package/dist/module/justifi-apple-pay2.js +7 -1
- package/dist/module/justifi-button2.js +1 -1
- package/dist/module/justifi-checkouts-list-filters.js +4 -2
- package/dist/module/justifi-checkouts-list.js +2 -2
- package/dist/module/justifi-gross-payment-chart.js +26 -13
- package/dist/module/justifi-header2.js +1 -1
- package/dist/module/justifi-order-terminals.js +1 -1
- package/dist/module/justifi-payment-details.js +8 -8
- package/dist/module/justifi-payment-transactions-list.js +1 -1
- package/dist/module/justifi-payments-list-filters.js +2 -2
- package/dist/module/justifi-payments-list.js +1 -1
- package/dist/module/justifi-payout-details.js +3 -3
- package/dist/module/justifi-payout-transactions-list.js +1 -1
- package/dist/module/justifi-payouts-list-filters.js +2 -2
- package/dist/module/justifi-payouts-list.js +1 -1
- package/dist/module/justifi-paypal2.js +39 -11
- package/dist/module/justifi-skeleton.js +1 -1
- package/dist/module/justifi-terminal-orders-list-filters.js +3 -3
- package/dist/module/justifi-terminal-orders-list.js +2 -2
- package/dist/module/justifi-terminals-list-filters.js +1 -1
- package/dist/module/justifi-terminals-list.js +1 -1
- package/dist/module/justifi-tokenize-payment-method2.js +1 -1
- package/dist/module/package.js +1 -1
- package/dist/module/radio-list-item2.js +1 -1
- package/dist/module/schema-validations.js +2 -1
- package/dist/module/terminal-quantity-selector2.js +1 -1
- package/dist/types/api/Business.d.ts +2 -0
- package/dist/types/api/Checkout.d.ts +7 -7
- package/dist/types/components/checkouts-list/justifi-checkouts-list.d.ts +1 -1
- package/dist/types/components/modular-checkout/sub-components/justifi-apple-pay.d.ts +1 -0
- package/dist/types/components/modular-checkout/sub-components/paypal/justifi-paypal.d.ts +9 -2
- package/dist/types/components.d.ts +1 -1
- package/dist/webcomponents/p-065b854f.entry.js +1 -0
- package/dist/webcomponents/{p-b98ea26a.entry.js → p-082f912c.entry.js} +1 -1
- package/dist/webcomponents/{p-0d8a256c.entry.js → p-0cd689f4.entry.js} +1 -1
- package/dist/webcomponents/{p-1a55efda.entry.js → p-0e9351c4.entry.js} +1 -1
- package/dist/webcomponents/p-0f7e3515.entry.js +20 -0
- package/dist/webcomponents/p-0fbc806f.entry.js +1 -0
- package/dist/webcomponents/{p-36f05f5f.entry.js → p-10787684.entry.js} +1 -1
- package/dist/webcomponents/{p-86f9d5f6.entry.js → p-1365a46b.entry.js} +1 -1
- package/dist/webcomponents/{p-b9664e84.entry.js → p-13814028.entry.js} +1 -1
- package/dist/webcomponents/{p-bf3866b3.entry.js → p-16261d8a.entry.js} +1 -1
- package/dist/webcomponents/{p-8a5ce8ff.entry.js → p-19cabdaf.entry.js} +1 -1
- package/dist/webcomponents/{p-af728bc6.entry.js → p-1cfa634a.entry.js} +1 -1
- package/dist/webcomponents/p-1fa62eba.entry.js +1 -0
- package/dist/webcomponents/{p-31204dd5.entry.js → p-2b5533a1.entry.js} +1 -1
- package/dist/webcomponents/p-2ef913b8.entry.js +1 -0
- package/dist/webcomponents/p-388082cd.entry.js +1 -0
- package/dist/webcomponents/p-3a1f8c5b.entry.js +1 -0
- package/dist/webcomponents/p-3f2fb856.entry.js +1 -0
- package/dist/webcomponents/{p-d4de565d.entry.js → p-429046e1.entry.js} +1 -1
- package/dist/webcomponents/{p-e0bce67a.entry.js → p-44ff4f2c.entry.js} +1 -1
- package/dist/webcomponents/p-4740601b.entry.js +1 -0
- package/dist/webcomponents/{p-10b91a6c.entry.js → p-59b95eae.entry.js} +1 -1
- package/dist/webcomponents/{p-1cdbe8c1.entry.js → p-5c889829.entry.js} +1 -1
- package/dist/webcomponents/p-6c7fca1a.entry.js +1 -0
- package/dist/webcomponents/p-72bb4aff.entry.js +1 -0
- package/dist/webcomponents/p-735d397e.entry.js +1 -0
- package/dist/webcomponents/p-8432cb42.entry.js +1 -0
- package/dist/webcomponents/{p-aebd2149.entry.js → p-88a44a02.entry.js} +1 -1
- package/dist/webcomponents/{p-d555220f.entry.js → p-89f0c2aa.entry.js} +1 -1
- package/dist/webcomponents/{p-5bdae8c7.entry.js → p-97c6593d.entry.js} +1 -1
- package/dist/webcomponents/p-9b43b90d.entry.js +1 -0
- package/dist/webcomponents/p-9db15fac.entry.js +1 -0
- package/dist/webcomponents/p-9e3e2e32.entry.js +1 -0
- package/dist/webcomponents/p-9eb00966.entry.js +1 -0
- package/dist/webcomponents/p-BAvoKtN2.js +1 -0
- package/dist/webcomponents/p-BC9n8nB2.js +1 -0
- package/dist/webcomponents/p-BDtSw_d-.js +1 -0
- package/dist/webcomponents/{p-Ba0_MQtJ.js → p-B_2zgnvM.js} +1 -1
- package/dist/webcomponents/{p-CLq3Og7o.js → p-BhpaUYtS.js} +1 -1
- package/dist/webcomponents/{p-BHaO3c8W.js → p-BjjKkMO1.js} +1 -1
- package/dist/webcomponents/p-BmaQUnqv.js +1 -0
- package/dist/webcomponents/{p-DZQBPUfH.js → p-Bxc0NRj8.js} +1 -1
- package/dist/webcomponents/p-C60AkJ6a.js +1 -0
- package/dist/webcomponents/{p-Bl00tHyn.js → p-C6Jq8YDT.js} +1 -1
- package/dist/webcomponents/p-C9p1gWAC.js +1 -0
- package/dist/webcomponents/p-CTtGaVYs.js +1 -0
- package/dist/webcomponents/p-CgOgijHy.js +1 -0
- package/dist/webcomponents/{p-OReJ-ZQb.js → p-CtlBL-X6.js} +1 -1
- package/dist/webcomponents/p-D694H6co.js +1 -0
- package/dist/webcomponents/p-D7fNBSlC.js +1 -0
- package/dist/webcomponents/p-D7nyPi2Q.js +1 -0
- package/dist/webcomponents/{p-C-buCQRx.js → p-DC2djVls.js} +1 -1
- package/dist/webcomponents/{p-B0DHIvEj.js → p-DQmijfCN.js} +1 -1
- package/dist/webcomponents/p-Dqxyi-uK.js +1 -0
- package/dist/webcomponents/{p-ByQMBEDC.js → p-_MjmE9YT.js} +1 -1
- package/dist/webcomponents/{p-5348209c.entry.js → p-a10beb26.entry.js} +1 -1
- package/dist/webcomponents/{p-0f7cc07b.entry.js → p-a71cc8e2.entry.js} +1 -1
- package/dist/webcomponents/{p-d446ab68.entry.js → p-a7c594d1.entry.js} +1 -1
- package/dist/webcomponents/{p-c6f85bef.entry.js → p-a8d25057.entry.js} +1 -1
- package/dist/webcomponents/p-acb0b66c.entry.js +1 -0
- package/dist/webcomponents/{p-80a9f84c.entry.js → p-b9ba7c95.entry.js} +1 -1
- package/dist/webcomponents/{p-5a11c49f.entry.js → p-c385f10d.entry.js} +1 -1
- package/dist/webcomponents/p-c55fdbbf.entry.js +1 -0
- package/dist/webcomponents/{p-636c9571.entry.js → p-cec7164e.entry.js} +1 -1
- package/dist/webcomponents/p-d3544e86.entry.js +1 -0
- package/dist/webcomponents/{p-2549c891.entry.js → p-de047614.entry.js} +1 -1
- package/dist/webcomponents/p-f0434a13.entry.js +1 -0
- package/dist/webcomponents/{p-ddba9ab3.entry.js → p-f2b3c7d5.entry.js} +1 -1
- package/dist/webcomponents/{p-e55216fb.entry.js → p-f39889f2.entry.js} +1 -1
- package/dist/webcomponents/{p-f8764c8e.entry.js → p-f40fa614.entry.js} +1 -1
- package/dist/webcomponents/{p-b6ce91f0.entry.js → p-f5cb6a26.entry.js} +1 -1
- package/dist/webcomponents/p-f9f310dc.entry.js +1 -0
- package/dist/webcomponents/p-iA-Amt2z.js +1 -0
- package/dist/webcomponents/p-pueOrhXO.js +1 -0
- package/dist/webcomponents/{p-DnLqZpI1.js → p-rFpPIJgu.js} +1 -1
- package/dist/webcomponents/{p-CawcnSoV.js → p-riZDHN5-.js} +1 -1
- package/dist/webcomponents/webcomponents.esm.js +1 -1
- package/package.json +15 -17
- package/dist/webcomponents/p-1034e83d.entry.js +0 -1
- package/dist/webcomponents/p-18306b40.entry.js +0 -1
- package/dist/webcomponents/p-22a57828.entry.js +0 -1
- package/dist/webcomponents/p-2458de56.entry.js +0 -1
- package/dist/webcomponents/p-27b07530.entry.js +0 -1
- package/dist/webcomponents/p-2e82a488.entry.js +0 -1
- package/dist/webcomponents/p-33281304.entry.js +0 -1
- package/dist/webcomponents/p-3642e189.entry.js +0 -1
- package/dist/webcomponents/p-3c33b3c1.entry.js +0 -1
- package/dist/webcomponents/p-408a4f5f.entry.js +0 -20
- package/dist/webcomponents/p-76e96874.entry.js +0 -1
- package/dist/webcomponents/p-772ab8a3.entry.js +0 -1
- package/dist/webcomponents/p-7e64a668.entry.js +0 -1
- package/dist/webcomponents/p-9c45729d.entry.js +0 -1
- package/dist/webcomponents/p-9ed85832.entry.js +0 -1
- package/dist/webcomponents/p-BFi5l0xt.js +0 -1
- package/dist/webcomponents/p-CKgQN8v0.js +0 -1
- package/dist/webcomponents/p-CXsRwohv.js +0 -1
- package/dist/webcomponents/p-CbyGKcz_.js +0 -1
- package/dist/webcomponents/p-Cy2N3vAg.js +0 -1
- package/dist/webcomponents/p-CyOXIqHo.js +0 -1
- package/dist/webcomponents/p-D6uhYbLo.js +0 -1
- package/dist/webcomponents/p-DNuxxP2B.js +0 -1
- package/dist/webcomponents/p-DaDqgDrb.js +0 -1
- package/dist/webcomponents/p-Dn9_7aQh.js +0 -1
- package/dist/webcomponents/p-Do9dxNjh.js +0 -1
- package/dist/webcomponents/p-DsvK2pes.js +0 -1
- package/dist/webcomponents/p-FWuMPTxn.js +0 -1
- package/dist/webcomponents/p-a891caf8.entry.js +0 -1
- package/dist/webcomponents/p-d05257f9.entry.js +0 -1
- package/dist/webcomponents/p-d2e890a3.entry.js +0 -1
- package/dist/webcomponents/p-d397b38f.entry.js +0 -1
- package/dist/webcomponents/p-dd4eea27.entry.js +0 -1
- package/dist/webcomponents/p-e1e5bddf.entry.js +0 -1
- package/dist/webcomponents/p-fa2e7534.entry.js +0 -1
- package/dist/webcomponents/p-rznJBkm3.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,c as s,h as i,H as e,g as a}from"./p-CV0Pyo1O.js";import{w as o,x as r,q as h,u as f,v as c}from"./p-Bu7gdOaV.js";import{F as l}from"./p-CLZcevBz.js";import"./p-CZfYo5-1.js";const n=class{constructor(i){t(this,i),this.formControlInput=s(this,"formControlInput",7),this.formControlBlur=s(this,"formControlBlur",7),this.fileSelected=s(this,"fileSelected",7),this.isFocused=!1,this.errorText="",this.inputHandler=()=>{},this.disabled=!1,this.handleFormControlInput=t=>{const s=t.target,i=s.getAttribute("name");this.inputHandler(i,s.value),this.formControlInput.emit({name:i,value:s.value})},this.changeHandler=()=>{const t=this.fileInput.files;t&&this.fileSelected.emit({fileList:t,document_type:this.documentType})}}componentDidLoad(){this.fileInput=this.el.querySelector("input")}get part(){let t=o;return this.errorText&&(t=h),this.disabled&&(t=f),this.isFocused&&(t=c),t}render(){return i(e,{key:"9ea17017850bd5e83a213b5247af2fe64f11db6c"},i("div",{key:"6cb7715a542d193a1ef1579dad6889fb0191e195",class:"form-group d-flex flex-column"},i("div",{key:"c643268b004611f98b4d24c341a46d0bce9a8944",class:"d-flex align-items-start gap-2"},i("label",{key:"3541f24060c2279f0cfb604f7bdec355462196a8",part:r,class:"form-label",htmlFor:this.name},this.label),i("form-control-tooltip",{key:"66f62e7d0ab51765fefc92d8674402a439671792",helpText:this.helpText})),i("input",{key:"564819ed2423c923f16329dc4ccb7a96f50e7ddd",ref:t=>this.fileInput=t,type:"file",name:this.name,part:this.part,class:this.errorText?"form-control is-invalid":"form-control",multiple:this.multiple,disabled:this.disabled,onChange:this.changeHandler,onInput:this.handleFormControlInput,onFocus:()=>this.isFocused=!0,onBlur:()=>{this.isFocused=!1,this.formControlBlur.emit()}}),i(l,{key:"2bbc1831fa7aaf773c24860ac47a8318b2eef93d",errorText:this.errorText,name:this.name})))}get el(){return a(this)}};export{n as form_control_file}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as s,h as e}from"./p-CV0Pyo1O.js";import{S as t}from"./p-05AWudQe.js";import{S as r}from"./p-eBK-iWrz.js";import"./p-Bu7gdOaV.js";const i=class{constructor(e){s(this,e)}render(){return e(t,{key:"
|
|
1
|
+
import{r as s,h as e}from"./p-CV0Pyo1O.js";import{S as t}from"./p-05AWudQe.js";import{S as r}from"./p-eBK-iWrz.js";import"./p-Bu7gdOaV.js";const i=class{constructor(e){s(this,e)}render(){return e(t,{key:"aae82594ed1833982d7bb06ea0808e56e06b11f8"},e(r,{key:"52c5680b1dc298b75646e5409b9c5c5b83f53eae",component:this.component,height:this.height,width:this.width,className:this.class,styles:this.customStyle}))}};export{i as justifi_skeleton}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as a,h as e}from"./p-CV0Pyo1O.js";import{f as t,p as s,c as d}from"./p-CGnRD4wF.js";import{f as r,a as l}from"./p-Bu7gdOaV.js";import{S as f}from"./p-05AWudQe.js";import"./p-CZfYo5-1.js";import{c as i,a as c}from"./p-Ds_P-dB8.js";import"./p-B4vLfYnZ.js";import{P as o}from"./p-Dqxyi-uK.js";import"./p-CLHwhyvu.js";import"./p-CTtGaVYs.js";import"./p-DgTOxu8x.js";import"./p-HXpYMWUU.js";const p=class{constructor(e){a(this,e),this.setParamsOnChange=(a,e)=>{t[a]=e},this.handleDateInput=(a,e)=>{const t=i(e,{setEndOfDay:!0});this.setParamsOnChange(a,t)}}componentWillLoad(){Object.entries({status:this.status,created_after:this.createdAfter,created_before:this.createdBefore}).forEach((([a,e])=>{e&&(s[a]=e)}))}get statusOptions(){return[{label:"All",value:""},{label:o.paid,value:"paid"},{label:o.failed,value:"failed"},{label:o.forwarded,value:"forwarded"},{label:o.scheduled,value:"scheduled"},{label:o.in_transit,value:"in_transit"},{label:o.canceled,value:"canceled"}]}render(){const a=Object.assign({},t);return e(f,{key:"b9fee98684dd11dde1a3acb0182b5fa01e243e08"},e("table-filters-menu",{key:"94afefa2154a91b5f3298b871036c1b43390b346",params:a,clearParams:d,part:r},e("div",{key:"92fea66d7ab1a268d98904aeb5feef5dda6ac470",class:"grid-cols-2 gap-3 p-1"},e("div",{key:"c3a6e8a2706cebfbc288dbf6c2416193b111964c",class:"p-2"},e("form-control-select",{key:"c40703185d3ec20f7b53f601c927510dbf5c8f35",name:"status",label:"Status",options:this.statusOptions,inputHandler:this.setParamsOnChange,defaultValue:this.status||t.status||"",disabled:!!this.status,part:l})),e("div",{key:"7d8f007a0206e9a622526acfceed1f1ed67757d7",class:"p-2"},e("form-control-date",{key:"2ca95ac4deaae4fed48b8bc0ba0e73586dcdd0ac",name:"created_after",label:"Created After",inputHandler:this.handleDateInput,defaultValue:c(this.createdAfter,{showInputDate:!0})||c(t.created_after,{showInputDate:!0}),disabled:!!this.createdAfter,part:l})),e("div",{key:"c5aa9f2f5dfb91de4b31efbc1019398a1377d2b1",class:"p-2"},e("form-control-date",{key:"24d4adf0c73e773dfdb60f585c7739112dc46290",name:"created_before",label:"Created Before",inputHandler:this.handleDateInput,defaultValue:c(this.createdBefore,{showInputDate:!0})||c(t.created_before,{showInputDate:!0}),disabled:!!this.createdBefore,part:l})))))}};export{p as justifi_payouts_list_filters}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,c as a,h as t}from"./p-CV0Pyo1O.js";import{B as s,C as c,D as i}from"./p-Bu7gdOaV.js";const d=class{constructor(t){e(this,t),this.selectedQuantityChange=a(this,"selectedQuantityChange",7),this.limit=1/0,this.selectedQuantity=0,this.removeUnit=()=>{this.selectedQuantity>0&&(this.selectedQuantity--,this.selectedQuantityChange.emit({modelName:this.modelName,quantity:this.selectedQuantity}))},this.addUnit=()=>{this.limit>0&&(this.selectedQuantity++,this.selectedQuantityChange.emit({modelName:this.modelName,quantity:this.selectedQuantity}))}}render(){return t("div",{key:"63237aed2228e101ed2a882e4993865afa886a09",class:"rounded shadow-sm card p-2",part:i},t("div",{key:"5dccc2e66eb1555f5d60a5c9b0e4250ff003194f",class:"d-flex gap-3"},t("div",{key:"6da3cf0ddc09d0a80969f4a109320190c9ec26a4",class:"d-flex align-items-center"},t("img",{key:"900fbef983071b6838dc62ef62aeecc7a83c22fc",src:this.imageUrl,alt:this.modelName,height:75,width:75,part:s})),t("div",{key:"9c2f602f486233d1749faaadaa5c5c4a46e2e86b",class:"d-flex flex-column flex-grow-1 gap-3 p-4 justify-content-center"},t("div",{key:"b2f2a90050ad90240c249a62b5dfb353c4a9d6f3",class:"row"},t("div",{key:"816a91666b31568fb7a26e2d34c2894c79d67303",class:"col-6 d-flex gap-2"},this.modelName,t("form-control-tooltip",{key:"48e67406ec6cb6095a5bf0216595800172bd01b7",helpText:this.description})),t("div",{key:"eb8b820f364f724f3deef236c7d0f16a6afa0e10",class:"col-6 d-flex justify-content-end align-items-center"},t("button",{key:"fc01f21c067d963c61b2aeb4ee29b172dec7ab54",class:"p-0 minus btn",onClick:this.removeUnit,part:c},"-"),t("div",{key:"bc61bbe36b0031ba78bfc5789a8359f3848afbca",class:"w-25 text-center"},this.selectedQuantity),t("button",{key:"30061e988706cb075066ebf7876dab5a65d855dd",class:"p-0 plus btn",onClick:this.addUnit,part:c},"+"))))))}};export{d as terminal_quantity_selector}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,h as a}from"./p-CV0Pyo1O.js";import{l as t}from"./p-OeJ-3w3l.js";import{c as s,a as i}from"./p-Ds_P-dB8.js";import{f as r,p as d,c as l}from"./p-BzjgvHHT.js";import{f as c,a as b}from"./p-Bu7gdOaV.js";import{S as o}from"./p-05AWudQe.js";import"./p-CZfYo5-1.js";import"./p-B4vLfYnZ.js";import{g as f}from"./p-Dqxyi-uK.js";import"./p-CLHwhyvu.js";import"./p-CTtGaVYs.js";import"./p-BFTU3MAI.js";import"./p-HXpYMWUU.js";import"./p-DgTOxu8x.js";const n=class{constructor(a){e(this,a),this.setParamsOnChange=(e,a)=>{r[e]=a},this.handleDateInput=(e,a)=>{const t=s(a,{setExactTime:!0});this.setParamsOnChange(e,t)}}componentWillLoad(){this.debouncedSetParamsOnChange=t.debounce(this.setParamsOnChange,300),Object.entries({terminal_id:this.terminalId,status:this.terminalStatus,terminal_order_id:this.terminalOrderId,provider_id:this.providerId,serial_number:this.serialNumber,created_after:this.createdAfter,created_before:this.createdBefore}).forEach((([e,a])=>{a&&(d[e]=a)}))}get terminalStatusOptions(){return[{label:"All",value:""},{label:"Connected",value:f.connected},{label:"Disconnected",value:f.disconnected},{label:"Unknown",value:f.unknown},{label:"Pending Configuration",value:f.pending_configuration},{label:"Archived",value:f.archived}]}render(){const e=Object.assign({},r);return a(o,{key:"a74ed2422b669401402664c77542412f3763ba76"},a("table-filters-menu",{key:"9158ca6884cb610dc712fb1b3a69ca6803a7dce7",params:e,clearParams:l,part:c},a("div",{key:"e24cfc9c7f078f9eb7d5f1f5b4d5cef8374378ce",class:"grid-cols-2 gap-3 p-1"},a("div",{key:"cce1419064f7e7cdc687437416327f7daebe5eae",class:"p-2"},a("form-control-text",{key:"750c30bc7e281f40646bdfaf0a29393d0ce7f72b",name:"terminal_id",label:"Terminal ID",inputHandler:this.debouncedSetParamsOnChange,defaultValue:this.terminalId||r.terminal_id,disabled:!!this.terminalId,part:b})),a("div",{key:"512ccc43edb3aab2ec6ab7d9c76bebf6369df73d",class:"p-2"},a("form-control-text",{key:"6320c75ecd89ad00162c764998c1c703a5965787",name:"terminal_order_id",label:"Terminal Order ID",inputHandler:this.debouncedSetParamsOnChange,defaultValue:this.terminalOrderId||r.terminal_order_id,disabled:!!this.terminalOrderId,part:b})),a("div",{key:"6f0d58b200a36516ede61609aad03ca191f240c2",class:"p-2"},a("form-control-text",{key:"f786e9fbbd7c9604429c5f43935121245f2943d2",name:"provider_id",label:"Device ID",inputHandler:this.debouncedSetParamsOnChange,defaultValue:this.providerId||r.provider_id,disabled:!!this.providerId,part:b})),a("div",{key:"b4d84761c2f5de192669012acc41bb5ba2b76750",class:"p-2"},a("form-control-text",{key:"deb1c3b5cc3b72b2724a296b1024f8f66ae69683",name:"serial_number",label:"Serial Number",inputHandler:this.debouncedSetParamsOnChange,defaultValue:this.serialNumber||r.serial_number,disabled:!!this.serialNumber,part:b})),a("div",{key:"b90c15ba9fa6bbe5eac425152753d1cb508b1710",class:"p-2"},a("form-control-select",{key:"beb78ebcd076b7b26a0cb5115ae9b619584fc307",name:"status",label:"Status",options:this.terminalStatusOptions,inputHandler:this.setParamsOnChange,defaultValue:this.terminalStatus||r.status||"",disabled:!!this.terminalStatus,part:b})),a("div",{key:"e6109b7758b998d41d2ff555bf26ee9de1011c94",class:"p-2"},a("form-control-date",{key:"e407111678baea094666e8789175ce15d40c2ee8",name:"created_after",label:"Created After",inputHandler:this.handleDateInput,defaultValue:i(this.createdAfter||r.created_after,{showInputDateTime:!0}),showTime:!0,disabled:!!this.createdAfter,part:b})),a("div",{key:"edc59eb19b58592803ffba665adae26d34fdfe0c",class:"p-2"},a("form-control-date",{key:"21c995d7eef08082ca7996eaf9286aeaa80fd2e9",name:"created_before",label:"Created Before",inputHandler:this.handleDateInput,defaultValue:i(this.createdBefore||r.created_before,{showInputDateTime:!0}),showTime:!0,disabled:!!this.createdBefore,part:b})))))}};export{n as justifi_terminals_list_filters}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as i,c as s,h as t,H as e}from"./p-CV0Pyo1O.js";import{r as c}from"./p-Bu7gdOaV.js";const a=class{constructor(t){i(this,t),this.radioClick=s(this,"radio-click",7),this.checked=!1,this.hidden=!1,this.handleClick=()=>{this.radioClick.emit(this.value)}}render(){return t(e,{key:"254375c6a1fd52924a84392bfd36d21ac60e4c0b"},t("div",{key:"df0f6abdeb91cbbe3c1b7e91f42cd7950379d8bf",class:`radio-list-item p-3 ${this.class||""}`,part:c,onClick:this.handleClick,hidden:this.hidden},t("form-control-radio",{key:"4c7e8e499b76bc83e83504b0cf22785fe2fdf6ec",name:this.name,value:this.value,checked:this.checked,label:this.label,inputHandler:()=>null})))}};export{a as radio_list_item}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,c as t,h as a,H as s,g as i}from"./p-CV0Pyo1O.js";import{a3 as r,v as l,q as
|
|
1
|
+
import{r as e,c as t,h as a,H as s,g as i}from"./p-CV0Pyo1O.js";import{a3 as r,v as l,q as d,w as o,x as c,u as n,a0 as f}from"./p-Bu7gdOaV.js";import{F as h}from"./p-BTuqVZ6O.js";import{F as b}from"./p-CLZcevBz.js";import"./p-CZfYo5-1.js";import{I as m,P as u}from"./p-CVaOFfrI.js";import{u as p,a as y,b as k}from"./p-CgOgijHy.js";import{C as v}from"./p-CTtGaVYs.js";import{c as x}from"./p-riZDHN5-.js";import{b as V}from"./p-CtlBL-X6.js";const C=class{constructor(a){e(this,a),this.formControlInput=t(this,"formControlInput",7),this.formControlBlur=t(this,"formControlBlur",7),this.isFocused=!1,this.disabled=!1,this.handleFormControlInput=e=>{const t=e.target,a=t.getAttribute("name");this.inputHandler(a,t.value),this.formControlInput.emit({name:a,value:t.value})},this.updateInput=e=>{const t=this.el.querySelector("input");t&&(t.value=e||"")}}handleDefaultValueChange(e){this.updateInput(e)}componentDidLoad(){this.updateInput(this.defaultValue)}get part(){return this.isFocused&&this.errorText?r:this.isFocused?l:this.errorText?d:o}render(){return a(s,{key:"e21694c1c7611df6ede999aa75fece02977f66f3"},a("div",{key:"8ea4a38832865e82ffeebcceaabc704d10403966",class:"form-group d-flex flex-column"},a("label",{key:"396ab2f79a7168080538ae46da735506b0797311",part:c,class:"form-label",htmlFor:this.name},this.label),a("input",{key:"715cb6bfbf439fdd4f659e6d21091b047cbca94d",id:this.name,name:this.name,onFocus:()=>this.isFocused=!0,onBlur:()=>{this.isFocused=!1,this.formControlBlur.emit()},onInput:this.handleFormControlInput,part:this.part,class:this.errorText?"form-control is-invalid":"form-control",type:"number",disabled:this.disabled}),a(h,{key:"f8695d85c9b447644b5bdf02d4df9e1c1e3e5da7",helpText:this.helpText,name:this.name}),a(b,{key:"e736f720d89f5d5aeee6982cb15ea11f63c5dd93",errorText:this.errorText,name:this.name})))}get el(){return i(this)}static get watchers(){return{defaultValue:["handleDefaultValueChange"]}}},g=class{constructor(t){e(this,t),this.isEditingIdentification=!1,this.inputHandler=(e,t)=>{p(this.formController,{[e]:t})},this.onAddressFormUpdate=e=>{y(this.formController,Object.assign(Object.assign({},this.formController.values.getValue().address),e))}}render(){var e,t,s;return a("div",{key:"6f4bb241699db7c16cb99016363cbbc1a4484a4a",class:"row gy-3"},a("div",{key:"fc0317736a62ac34f98f2b7a43a5073d785dfa0d",class:"col-12 col-md-8"},a("form-control-text",{key:"8123035dfd371841e0830d0019c425d25977c160",name:"name",label:"Full Name",defaultValue:this.ownerDefaultValue.name,errorText:this.errors.name,inputHandler:this.inputHandler})),a("div",{key:"a16e9ecc81fd4965d3a42b2569a7ea0615ecbf97",class:"col-12 col-md-4"},a("form-control-select",{key:"bd9b0ee5c7cf45ac3d67da96f951f167c93033e0",name:"title",label:"Title",options:V,defaultValue:this.ownerDefaultValue.title,errorText:this.errors.title,inputHandler:this.inputHandler})),a("div",{key:"5376a38a98ad715a3159ccf4e8c8e54b48fa1c7c",class:"col-12 col-md-6"},a("form-control-text",{key:"7d08e58ae5fc15d5299c8646d5260602a51b9fbf",name:"email",label:"Email Address",defaultValue:this.ownerDefaultValue.email,errorText:this.errors.email,inputHandler:this.inputHandler})),a("div",{key:"6f80f898cb354b40d8d6784110abd5a1c49ff9d9",class:"col-12 col-md-6"},a("form-control-number-masked",{key:"8a7d577c4c1c5b54f733ee51a1970c17de27d0b0",name:"phone",label:"Phone Number",defaultValue:this.ownerDefaultValue.phone,errorText:this.errors.phone,inputHandler:this.inputHandler,mask:u.US})),a("div",{key:"5ace697b3fb38b52dca74ccd49207498b779ade8",class:"col-12 col-md-3"},a("form-control-date",{key:"ec8d614b62fe2913c52fd228e7df1fef1b1d7d83",name:"dob_full",label:"Birth Date",defaultValue:this.ownerDefaultValue.dob_full,errorText:this.errors.dob_full,inputHandler:this.inputHandler,onFormControlInput:e=>k(e,this.formController),helpText:"Must be 18 or older."})),a("div",{key:"8fad1824571295e3464d26191eb23d373591e47d",class:"col-12 col-md-3"},a("form-control-number",{key:"c0ffdbf26ea5d65de8c3e98c2cd7d03430d4a8c2",name:"ownership_percentage",label:"% of Ownership",defaultValue:null===(e=this.ownerDefaultValue)||void 0===e?void 0:e.ownership_percentage,errorText:this.errors.ownership_percentage,inputHandler:this.inputHandler})),a("div",{key:"94d93a03f2513bb69da43bd68c3fddc62dbc18d6",class:"col-12 col-md-6"},!(null===(t=this.ownerDefaultValue)||void 0===t?void 0:t.ssn_last4)||this.isEditingIdentification?a("form-control-number-masked",{name:"identification_number",label:this.country===v.CAN?x[this.country].idNumberLabelOptional:x[this.country].idNumberLabel,defaultValue:this.isEditingIdentification?"":this.ownerDefaultValue.identification_number,errorText:this.errors.identification_number,inputHandler:this.inputHandler,mask:m[this.country],helpText:x[this.country].identityHelpText}):a("div",null,a("label",{class:"form-label",part:c},this.country===v.CAN?x[this.country].idNumberLabelOptional:x[this.country].idNumberLabel),a("div",{class:"input-group mb-3"},a("input",{type:"text",class:"form-control",part:n,value:`****${null===(s=this.ownerDefaultValue)||void 0===s?void 0:s.ssn_last4}`,disabled:!0}),a("button",{class:"btn btn-secondary",type:"button",part:f,onClick:()=>{this.isEditingIdentification=!0,p(this.formController,{ssn_last4:null,identification_number:""})}},"Change")))),a("div",{key:"63d73015c84a1ab370b6686a643797b92096212f",class:"col-12"},a("identity-address-form",{key:"4eff1f856b32e6d31cc18315b5b338c932723cf9",errors:this.errors.address,defaultValues:this.ownerDefaultValue.address,handleFormUpdate:this.onAddressFormUpdate,country:this.country})))}};export{C as form_control_number,g as owner_form_inputs}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,c as t,h as
|
|
1
|
+
import{r as e,c as t,h as i}from"./p-CV0Pyo1O.js";import{J as a}from"./p-BjjKkMO1.js";import{c as s}from"./p-_MjmE9YT.js";import{c as d}from"./p-Fpaf7CLD.js";import{c}from"./p-Bu7gdOaV.js";import{S as o}from"./p-05AWudQe.js";import"./p-CZfYo5-1.js";import{P as f}from"./p-DEx8fQeW.js";import"./p-BC9n8nB2.js";import"./p-C6Jq8YDT.js";import"./p-B4vLfYnZ.js";import"./p-DgTOxu8x.js";import"./p-Ds_P-dB8.js";import"./p-HXpYMWUU.js";import"./p-Dqxyi-uK.js";import"./p-CLHwhyvu.js";import"./p-CTtGaVYs.js";const h=class{constructor(i){e(this,i),this.errorEvent=t(this,"error-event",7),this.loadedEvent=t(this,"loaded",7),this.submitEvent=t(this,"submit-event",7),this.availablePaymentMethods=[],this.errorMessage="",this.insuranceToggled=!1,this.disableBankAccount=!1,this.disableBnpl=!1,this.disableCreditCard=!1,this.disablePaymentMethodGroup=!1,this.hideBankAccountBillingForm=!1,this.hideCardBillingForm=!1}propChanged(){this.updateStore()}connectedCallback(){this.authToken&&this.checkoutId&&this.updateStore()}componentWillLoad(){s(),this.analytics=new a(this)}disconnectedCallback(){var e;null===(e=this.analytics)||void 0===e||e.cleanup()}checkoutComplete(e){d.isSubmitting=!1}checkoutError(e){d.isSubmitting=!1}checkoutChanged(e){this.availablePaymentMethods=e.detail.availablePaymentMethodTypes}async fillBillingForm(e){d.billingFormFields=e}async validate(){var e;return{isValid:await(null===(e=this.modularCheckoutRef)||void 0===e?void 0:e.validate())}}updateStore(){d.checkoutId=this.checkoutId,d.authToken=this.authToken,d.disableCreditCard=this.disableCreditCard,d.disableBankAccount=this.disableBankAccount,d.disablePaymentMethodGroup=this.disablePaymentMethodGroup}async submit(e){var t;null===(t=this.modularCheckoutRef)||void 0===t||t.submitCheckout(d.billingFormFields)}get showPaymentTypeHeader(){return!this.disableCreditCard&&!this.disableBankAccount}render(){var e,t;return i(o,{key:"be64697a74e404e567c718562f72ca6cf644a2a4"},i("justifi-modular-checkout",{key:"49be0912aa949927cb11bde45c6ade0eb25744be",ref:e=>{this.modularCheckoutRef=e},authToken:this.authToken,checkoutId:this.checkoutId,preCompleteHook:this.preCompleteHook},i("div",{key:"7ae8865515c16d119d0c951670b86f53006f5a2f",class:"row gy-3 jfi-checkout-core"},i("div",{key:"697f67f1603f78d852c3900f424fea1559dcbbc7",class:"col-12",part:c},i("justifi-header",{key:"005b320bb2318b6e5a888911fe90aeeeb8ca58f1",text:"Summary",level:"h2",class:"fs-5 fw-bold pb-3"}),i("section",{key:"e6e4e720e0d619aa338b1a64ccc75f6bcfb53129"},i("justifi-checkout-summary",{key:"5bbc4d7223f56fe70bcc9810ebcde55264e17943"}))),i("div",{key:"7c5f714e729c26a8c3589e912100d38e61cb3846",class:"col-12 mt-4"},i("slot",{key:"ae66ebfe4a0e1456aaabd706523ef17e9c2c4b50",name:"insurance"})),i("div",{key:"3d74c4078230299a0d093568f9edf61ddede06d6",class:"col-12 mt-4"},i("justifi-header",{key:"98fad7779ad81e44f56d488f8f9bebb843c8b044",text:"Payment",level:"h2",class:"fs-5 fw-bold pb-3"}),this.showPaymentTypeHeader&&i("justifi-header",{key:"a522e1c11e8412c0df0b272201a9eb929e8f38a5",text:"Select payment type",level:"h3",class:"fs-6 fw-bold lh-lg"}),i("div",{key:"670a875b91e3c4f41cc1f99e159ddb62d5d2cd9d",class:"d-flex flex-column"},i("section",{key:"660a700bfdffa79b3e00da2ae186f98fbefc59de"},i("div",{key:"3c314f058f5a6bf745800790dcad6b0f09ec9fdf"},this.availablePaymentMethods.includes(f.APPLE_PAY)&&i("div",{key:"9b3003bc6a7e2a85c64d28ac1457871297fcb570",class:"mb-3"},i("justifi-apple-pay",{key:"25fb043d7fdd2308ceaf8cef9b8e3db72c276ec8"})),this.availablePaymentMethods.includes(f.GOOGLE_PAY)&&i("div",{key:"62ea38828ed1e7fe795cd92c1523e0a09dbb1249",class:"mb-3"},i("justifi-google-pay",Object.assign({key:"6bf9455e95950766204a4b9a16c51512961dab6d",ref:e=>this.googlePayRef=e},null!=this.googlePayEnv?{environment:this.googlePayEnv}:{}))),this.availablePaymentMethods.includes(f.PAYPAL)&&i("div",{key:"a1af9d7ec013aced03e3eb1e768c0dcb378c8ff2",class:"mb-3"},i("justifi-paypal",{key:"7e0106b73a4844ffc99c353cbc6365cf9c17964c"})),i("justifi-saved-payment-methods",{key:"4f4aae6378928ebd28d1015fd9f4dde7403e20a5"}),this.availablePaymentMethods.includes(f.SEZZLE)&&!this.disableBnpl&&i("justifi-radio-list-item",{key:"ac9a3b1ce4d8dff5c75417ff62aeddbb1aac5aa2",name:"paymentMethodType",value:f.SEZZLE,checked:(null===(e=null==d?void 0:d.selectedPaymentMethod)||void 0===e?void 0:e.type)===f.SEZZLE,label:i("justifi-sezzle-payment-method",{ref:e=>this.sezzlePaymentMethodRef=e}),"onRadio-click":()=>{var e;null===(e=this.sezzlePaymentMethodRef)||void 0===e||e.handleSelectionClick()}}),this.availablePaymentMethods.includes(f.PLAID)&&i("justifi-radio-list-item",{key:"92fa98d5d28cfa4327631238b5fbf58e2a6096c9",name:"paymentMethodType",value:f.PLAID,checked:(null===(t=null==d?void 0:d.selectedPaymentMethod)||void 0===t?void 0:t.type)===f.PLAID,label:i("justifi-plaid-payment-method",{ref:e=>this.plaidPaymentMethodRef=e}),"onRadio-click":()=>{var e;null===(e=this.plaidPaymentMethodRef)||void 0===e||e.handleSelectionClick()}}),i("justifi-tokenize-payment-method",{key:"f40e4195ed8ef1dbff50a870b1d0136968d78fb1",ref:e=>this.tokenizePaymentMethodRef=e,authToken:this.authToken,accountId:d.accountId,disableCreditCard:this.disableCreditCard,disableBankAccount:this.disableBankAccount,hideCardBillingForm:this.hideCardBillingForm,hideBankAccountBillingForm:this.hideBankAccountBillingForm,hideSubmitButton:!0,paymentMethodGroupId:d.paymentMethodGroupId}))))),i("div",{key:"3d6b6108fa078dc2ce7a7048dffd61b5767010be",class:"mt-4"},i("justifi-button",{key:"43370805937c92ad494cce2c493d641066c0b894",text:"Pay",type:"submit",variant:"primary",clickHandler:e=>this.submit(e),disabled:d.isSubmitting||d.isWalletProcessing,isLoading:d.isSubmitting||d.isWalletProcessing,customStyle:{width:"100%",textAlign:"center"}})))))}static get watchers(){return{authToken:["propChanged"],checkoutId:["propChanged"],disableCreditCard:["propChanged"],disableBankAccount:["propChanged"],disablePaymentMethodGroup:["propChanged"]}}};export{h as justifi_checkout}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as t,r as a,c as e}from"./p-CV0Pyo1O.js";import{P as s}from"./p-BmaQUnqv.js";import"./p-B4vLfYnZ.js";import"./p-HXpYMWUU.js";import{e as i,C as r,b as o}from"./p-Dqxyi-uK.js";import{p as n}from"./p-CLHwhyvu.js";import"./p-CTtGaVYs.js";import{g as c,a as h}from"./p-BhpaUYtS.js";import{J as p}from"./p-BjjKkMO1.js";import{c as d}from"./p-_MjmE9YT.js";import{S as m}from"./p-05AWudQe.js";import{T as f,a as l,b as u,c as y,d as b,e as g,f as j,g as v,h as _,i as k,j as C,k as w,l as T}from"./p-DZr0wLGh.js";import{T as D}from"./p-CZfYo5-1.js";import{M as P}from"./p-Bi_GCMx0.js";import{a as O}from"./p-Ds_P-dB8.js";import{a6 as B,a7 as S}from"./p-Bu7gdOaV.js";import{o as M,g as x}from"./p-BLhz_ggG.js";import"./p-C6Jq8YDT.js";import"./p-BC9n8nB2.js";import"./p-DgTOxu8x.js";import"./p-MPer3Rw7.js";import"./p-Dz8KJn2G.js";const A={created_at:()=>t("th",{part:B,scope:"col",title:"The date and time each payment was made"},"Date"),amount:()=>t("th",{part:B,scope:"col",title:"The dollar amount of each payment"},"Amount"),status:()=>t("th",{part:B,scope:"col",title:"The current status of each payment"},"Status"),payment_type:()=>t("th",{part:B,scope:"col",title:"The type of each payment"},"Type"),description:()=>t("th",{part:B,scope:"col",title:"The payment description, if you provided one"},"Description"),payers_name:()=>t("th",{part:B,scope:"col",title:"The name associated with the payment method"},"Account Holder"),last_four_digits:()=>t("th",{part:B,scope:"col",title:"The brand and last 4 digits of the payment method"},"Payment Method"),card_brand:()=>t("th",{part:B,scope:"col",title:"The brand of the payment method"},"Card Brand")},E={created_at:(a,e)=>t("td",{part:S(e)},t("div",{class:"fw-bold"},O(a.created_at,{showDisplayDate:!0})),t("div",{class:"fw-bold"},O(a.created_at,{showTime:!0}))),amount:(a,e)=>t("td",{part:S(e)},a.formattedPaymentAmount(a.amount)),status:(a,e)=>t("td",{part:S(e)},P(a.status)),payment_type:(a,e)=>t("td",{part:S(e)},a.payment_type),description:(a,e)=>t("td",{part:S(e)},a.description),payers_name:(a,e)=>t("td",{part:S(e)},a.payers_name),last_four_digits:(a,e)=>t("td",{part:S(e)},a.last_four_digits),card_brand:(a,e)=>{var s,i,r;return t("td",{part:S(e)},(r=(null===(s=a.payment_method.card)||void 0===s?void 0:s.brand)||(null===(i=a.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")}},Y=class{constructor(t){a(this,t),this.errorEvent=e(this,"error-event",7),this.clickEvent=e(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:D.previous})},this.handleClickNext=t=>{this.pagingParams={after_cursor:t},this.clickEvent.emit({name:D.next})},this.rowClickHandler=t=>{const a=t.target.closest("tr").dataset.rowEntityId;if(!a)return;const e=this.payments.find((t=>t.id===a));this.clickEvent.emit({name:D.row,data:e})}}componentWillLoad(){d(),this.analytics=new p(this),this.paymentsTable=new f(this.payments,this.columns,A,E),this.initializeGetPayments(),M("set",(()=>{this.pagingParams={},this.errorMessage=""})),M("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:a,service:e})=>async({params:s,onSuccess:o,onError:n,final:p})=>{var d,m;try{const p=await e.fetchPayments(t,a,s);if(p.error)return n({error:h(p.error),code:c(null===(m=p.error)||void 0===m?void 0:m.code),severity:r.ERROR});{const t=Object.assign({},p.page_info);o({payments:(null===(d=p.data)||void 0===d?void 0:d.map((t=>new i(t))))||[],pagingInfo:t})}}catch(t){const a=c(null==t?void 0:t.code);return n({error:t.message||t,code:a,severity:r.ERROR})}finally{p()}})({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:a})=>{this.payments=t,this.paging=a,this.paymentsTable.collectionData=this.payments},onError:({error:t,code:a,severity:e})=>{this.errorMessage=t,this.errorEvent.emit({errorCode:a,message:t,severity:e})},final:()=>{this.loading=!1}}))}get paymentParams(){const t=x();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:"eb828891504cbcb38a6d7b73ab2411b23bca30a2"},t(l,{key:"f523dae8af945d79a36734bb35ecca94ea094fff"},t(u,{key:"8a69883c8217fdc36280cc3f2f95c83ad449b621"},t(y,{key:"1b47d5b433eaf0a749f8bdf97afb269518840e10"},t(b,{key:"4a1be7574f03aefd7687f200dc5cdc2b92a47d90"},this.paymentsTable.columnData.map((t=>t)))),t(g,{key:"02ad2f601a923526c2555f598f54e674763c3cc6"},t(j,{key:"274a86633dfbf13395acdfe9725cd14e13c59d8a",columnSpan:this.paymentsTable.columnData.length,isLoading:this.loading}),t(v,{key:"18ceb62121b9387a1bb8a8a74dfa458dba869b01",isEmpty:this.showEmptyState,columnSpan:this.paymentsTable.columnData.length}),t(_,{key:"7cbbc7524f44ac22d16c257c5bdc4998f21d1983",columnSpan:this.paymentsTable.columnData.length,errorMessage:this.errorMessage}),this.showRowData&&this.paymentsTable.rowData.map(((a,e)=>t(k,{"data-test-id":"table-row","data-row-entity-id":this.entityId[e],onClick:this.rowClickHandler},a)))),this.paging&&t(C,{key:"0da01573eaaa7cf98b08f9f5910d536a687dc6a3"},t(w,{key:"402175c67d164d0f6deba109ff11230ef4772675"},t(T,{key:"e2c8b098aacadcf5b0a5587e01f1191e287cd9fa",colSpan:this.paymentsTable.columnData.length},t("pagination-menu",{key:"91bffb1511a93c0b39f7cdc711c1f92e5381f5ec",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{Y as justifi_payments_list}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as t,r as e,c as s}from"./p-CV0Pyo1O.js";import"./p-B4vLfYnZ.js";import"./p-HXpYMWUU.js";import{m as a,C as i,b as
|
|
1
|
+
import{h as t,r as e,c as s}from"./p-CV0Pyo1O.js";import"./p-B4vLfYnZ.js";import"./p-HXpYMWUU.js";import{m as a,C as i,b as c}from"./p-Dqxyi-uK.js";import{p as o}from"./p-CLHwhyvu.js";import"./p-CTtGaVYs.js";import{g as r,a as h}from"./p-BhpaUYtS.js";import{c as n}from"./p-_MjmE9YT.js";import{J as d}from"./p-BjjKkMO1.js";import{C as p}from"./p-D7fNBSlC.js";import{m as u,S as m}from"./p-iA-Amt2z.js";import{S as b}from"./p-05AWudQe.js";import{T as f,a as l,b as y,c as k,d as g,e as j,f as v,g as C,h as _,i as w,j as T,k as S,l as A}from"./p-DZr0wLGh.js";import{T as P}from"./p-CZfYo5-1.js";import{d as O,b as D}from"./p-Ds_P-dB8.js";import{B as x,a as I}from"./p-Dz8KJn2G.js";import{a6 as B,a7 as E}from"./p-Bu7gdOaV.js";import{o as Y,g as G}from"./p-CArdj6i_.js";import"./p-DgTOxu8x.js";import"./p-BC9n8nB2.js";import"./p-C6Jq8YDT.js";import"./p-MPer3Rw7.js";const M={created_at:()=>t("th",{part:B,scope:"col",title:"The date each checkout occurred"},"Processed On"),payment_amount:()=>t("th",{part:B,scope:"col",title:"The dollar amount of each checkout"},"Payment Amount"),payment_description:()=>t("th",{part:B,scope:"col",title:"The description of each checkout"},"Payment Description"),sub_account_name:()=>t("th",{part:B,scope:"col",title:"The sub account associated with the checkout"},"Sub Account"),payment_mode:()=>t("th",{part:B,scope:"col",title:"The payment mode of each checkout"},"Payment Mode"),status:()=>t("th",{part:B,scope:"col",title:"The current status of each checkout"},"Status")},z={created_at:(e,s)=>t("td",{part:E(s)},t("div",{class:"fw-bold"},D(e.created_at)),t("div",{class:"fw-bold"},O(e.created_at))),payment_amount:(e,s)=>t("td",{part:E(s)},e.formattedPaymentAmount(e.payment_amount)),payment_description:(e,s)=>t("td",{part:E(s)},e.payment_description),sub_account_name:(e,s)=>t("td",{part:E(s)},e.sub_account_name),payment_mode:(e,s)=>t("td",{part:E(s)},e.payment_mode),status:(e,s)=>t("td",{part:E(s)},t(I,Object.assign({},{created:{variant:x.PRIMARY,title:"The checkout has been created",text:"Created"},completed:{variant:x.SUCCESS,title:"The checkout has been completed",text:"Completed"},attempted:{variant:x.SECONDARY,title:"The checkout has been attempted",text:"Attempted"},expired:{variant:x.DANGER,title:"The checkout has expired",text:"Expired"}}[e.status])))},L=class{constructor(t){e(this,t),this.clickEvent=s(this,"click-event",7),this.errorEvent=s(this,"error-event",7),this.columns="created_at,payment_amount,payment_description,payment_mode,status",this.checkouts=[],this.subAccounts=[],this.loading=!0,this.paging=o,this.pagingParams={},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 s=this.checkouts.find((t=>t.id===e));this.clickEvent.emit({name:P.row,data:s})}}componentWillLoad(){n(),this.analytics=new d(this),this.checkoutsTable=new f(this.checkouts,this.columns,M,z),this.initializeGetData(),this.getCheckouts&&this.fetchData(),Y("set",(()=>{this.pagingParams={}})),Y("reset",(()=>{this.pagingParams={},this.errorMessage=""}))}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}authPropChanged(){this.initializeGetData(),this.getCheckouts&&this.fetchData()}pagingOrColumnsChanged(){this.getCheckouts&&this.fetchData()}initializeGetData(){this.initializeGetCheckouts(),this.initializeGetSubAccounts()}initializeGetCheckouts(){const t=this.subAccountId||this.accountId;t&&this.authToken?this.getCheckouts=(({accountId:t,authToken:e,service:s})=>async({params:c,onSuccess:o,onError:n})=>{var d,p;try{const u=await s.fetchCheckouts(t,e,c);if(u.error)return n({error:h(u.error),code:r(null===(p=u.error)||void 0===p?void 0:p.code),severity:i.ERROR});{const t=Object.assign({},u.page_info);o({checkouts:(null===(d=u.data)||void 0===d?void 0:d.map((t=>new a(t))))||[],pagingInfo:t})}}catch(t){const e=r(null==t?void 0:t.code);return n({error:t.message||t,code:e,severity:i.ERROR})}})({accountId:t,authToken:this.authToken,service:new p}):(this.errorMessage="Account ID/Sub Account ID and Auth Token are required",this.errorEvent.emit({errorCode:c.MISSING_PROPS,message:this.errorMessage,severity:i.ERROR}))}initializeGetSubAccounts(){this.accountId&&this.authToken&&(this.getSubAccounts=u({primaryAccountId:this.accountId,authToken:this.authToken,service:new m}))}fetchData(){this.getCheckouts&&(this.loading=!0,this.getCheckouts({params:this.checkoutParams,onSuccess:async({checkouts:t,pagingInfo:e})=>{this.checkouts=t,this.paging=e,this.checkoutsTable.collectionData=this.checkouts,this.checkoutsTable.columnKeys.includes("sub_account_name")?await this.fetchSubAccounts():this.loading=!1},onError:({error:t,code:e,severity:s})=>{this.errorMessage=t,this.errorEvent.emit({errorCode:e,message:t,severity:s}),this.loading=!1}}))}async fetchSubAccounts(){this.getSubAccounts?this.getSubAccounts({params:this.subAccountParams,onSuccess:({subAccounts:t})=>{this.subAccounts=t,this.checkouts=this.checkouts.map((t=>{var e;return t.sub_account_name=null===(e=this.subAccounts.find((e=>e.id===t.account_id)))||void 0===e?void 0:e.name,t})),this.loading=!1},onError:({error:t,code:e,severity:s})=>{this.errorMessage=t,this.errorEvent.emit({errorCode:e,message:t,severity:s}),this.loading=!1}}):this.loading=!1}get checkoutParams(){const t=G();return Object.assign(Object.assign({},t),this.pagingParams)}get subAccountParams(){const t=this.checkouts.map((t=>t.account_id));return{sub_account_id:[...new Set(t)].join(",")}}get entityId(){return this.checkouts.map((t=>t.id))}get showEmptyState(){return!this.loading&&!this.errorMessage&&this.checkoutsTable.rowData.length<1}get showErrorState(){return!this.loading&&!!this.errorMessage}get showRowData(){return!this.showEmptyState&&!this.showErrorState&&!this.loading}render(){return t(b,{key:"a7b1654b627bab83958b7247b27c296ee1164cfc"},t(l,{key:"e3dddb238409f778e52ad036b7cd2ec41279f3dc"},t(y,{key:"d0960d893904207989f88685bcc80bc6c1979b47"},t(k,{key:"dc11347964df3a6c5d4adce407e668fd0a7683cf"},t(g,{key:"5c2ee6078f1ff84b273ce843b24d47161097155e"},this.checkoutsTable.columnData.map((t=>t)))),t(j,{key:"6c88b83f5369accef71b05713fa7b1fd43b01862"},t(v,{key:"f463c22c1f6cc7e80a698b0ae751f8ab7fb43cc5",columnSpan:this.checkoutsTable.columnKeys.length,isLoading:this.loading}),t(C,{key:"a9414a60b8c91f87537da7853bfb32264c2c966b",isEmpty:this.showEmptyState,columnSpan:this.checkoutsTable.columnKeys.length}),t(_,{key:"41ebd0d98fe7591a0cc93e1fd37f0a2027d249fb",columnSpan:this.checkoutsTable.columnKeys.length,errorMessage:this.errorMessage}),this.showRowData&&this.checkoutsTable.rowData.map(((e,s)=>t(w,{"data-test-id":"table-row","data-row-entity-id":this.entityId[s],onClick:this.rowClickHandler},e)))),this.paging&&t(T,{key:"e41929553535de5f86ce9b84f5264bb1c3a43796"},t(S,{key:"c4cc91e37335f5ed9b9819364978d3eeecd6f879"},t(A,{key:"7f0fcab1ec2c31c9f82de6b8d524f9a8166c229b",colSpan:this.checkoutsTable.columnData.length},t("pagination-menu",{key:"0949bb91fa20cb78dfb1b7a01c91db713cb92c00",paging:Object.assign(Object.assign({},this.paging),{handleClickPrevious:this.handleClickPrevious,handleClickNext:this.handleClickNext})})))))))}static get watchers(){return{accountId:["authPropChanged"],authToken:["authPropChanged"],subAccountId:["authPropChanged"],pagingParams:["pagingOrColumnsChanged"],columns:["pagingOrColumnsChanged"]}}};export{L as justifi_checkouts_list}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as s,h as t}from"./p-CV0Pyo1O.js";import{C as i}from"./p-
|
|
1
|
+
import{r as s,h as t}from"./p-CV0Pyo1O.js";import{C as i}from"./p-CTtGaVYs.js";import{B as e}from"./p-XYgDHrVL.js";import{B as o}from"./p-CU2Dwa94.js";import"./p-CZfYo5-1.js";import"./p-Bu7gdOaV.js";const n=class{constructor(t){s(this,t)}get showPreviousStepButton(){return this.currentStep>0}get showNextStepButton(){return this.currentStep<this.totalSteps}get showSubmitButton(){return this.currentStep===this.totalSteps}render(){return t("div",{key:"6fac4d1e92b732da3e7e867c091f23e9e3b7d6ab",class:"d-flex gap-2"},t(o,{key:"a96025bed24ade707d7f28561a12a9bcf62401e8",variant:"secondary",type:"button",onClick:()=>this.previousStepButtonOnClick(),disabled:this.formDisabled,hidden:!this.showPreviousStepButton},"Previous"),t(o,{key:"c4bd0d4a7f79942b307a4587e77c73158d4b704d",variant:"primary",type:"button",onClick:s=>this.nextStepButtonOnClick(s,e.nextStep),disabled:this.formDisabled,isLoading:this.formLoading,hidden:!this.showNextStepButton},"Next"),t(o,{key:"5fa56e168646f4fa266fde124c78dc2564a6c311",variant:"primary",type:"submit",onClick:s=>this.nextStepButtonOnClick(s,e.submit),disabled:this.formDisabled,isLoading:this.formLoading,hidden:!this.showSubmitButton},"Submit"))}},r=class{constructor(e){s(this,e),this.allowOptionalFields=!1,this.country=i.USA,this.componentStepMapping={0:()=>t("business-core-info-form-step",{businessId:this.businessId,authToken:this.authToken,ref:s=>this.refs[0]=s,allowOptionalFields:this.allowOptionalFields,country:this.country}),1:()=>t("legal-address-form-step",{businessId:this.businessId,authToken:this.authToken,ref:s=>this.refs[1]=s,allowOptionalFields:this.allowOptionalFields,country:this.country}),2:()=>t("additional-questions-form-step",{businessId:this.businessId,authToken:this.authToken,ref:s=>this.refs[2]=s,allowOptionalFields:this.allowOptionalFields}),3:()=>t("business-representative-form-step",{businessId:this.businessId,authToken:this.authToken,ref:s=>this.refs[3]=s,allowOptionalFields:this.allowOptionalFields,country:this.country}),4:()=>t("business-owners-form-step",{businessId:this.businessId,authToken:this.authToken,ref:s=>this.refs[4]=s,allowOptionalFields:this.allowOptionalFields,country:this.country}),5:()=>t("business-bank-account-form-step",{businessId:this.businessId,authToken:this.authToken,ref:s=>this.refs[5]=s,allowOptionalFields:this.allowOptionalFields,country:this.country}),6:()=>t("document-upload-form-step",{businessId:this.businessId,authToken:this.authToken,ref:s=>this.refs[6]=s,allowOptionalFields:this.allowOptionalFields,country:this.country}),7:()=>t("business-terms-conditions-form-step",{businessId:this.businessId,authToken:this.authToken,ref:s=>this.refs[7]=s,onFormLoading:this.handleFormLoading,allowOptionalFields:this.allowOptionalFields})}}get currentStepComponent(){return this.componentStepMapping[this.currentStep]()}render(){return t("div",{key:"a249d66ac8348900e21998c4cf89bd02cfeec7c1",class:"col-12 mb-4"},this.currentStepComponent)}};export{n as payment_provisioning_form_buttons,r as payment_provisioning_form_steps}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as i,r as s,c as t}from"./p-CV0Pyo1O.js";import{a9 as e,a8 as r,a1 as o,t as l}from"./p-Bu7gdOaV.js";import{S as d}from"./p-05AWudQe.js";import"./p-CZfYo5-1.js";import{c as n}from"./p-_MjmE9YT.js";import{J as a}from"./p-BjjKkMO1.js";import{o as h,C as c,p as u,f as v,b as p}from"./p-Dqxyi-uK.js";import{B as m}from"./p-rFpPIJgu.js";import{B as f}from"./p-CTtGaVYs.js";import{m as w}from"./p-BDtSw_d-.js";import{S as x}from"./p-eBK-iWrz.js";import"./p-B4vLfYnZ.js";import"./p-HXpYMWUU.js";import"./p-CLHwhyvu.js";import{g,a as y}from"./p-BhpaUYtS.js";import{T as j}from"./p-DC2djVls.js";import{k as b}from"./p-Ds_P-dB8.js";import"./p-BC9n8nB2.js";import"./p-C6Jq8YDT.js";import"./p-DgTOxu8x.js";const S=()=>i("div",{class:"row gap-3"},i("div",{class:"col-12"},i(x,{width:"25%"})),i("div",{class:"col-12"},i(x,{width:"100%"})),i("div",{class:"col-12 d-flex gap-3"},i(x,{width:"50%"}),i(x,{width:"50%"})),i("div",{class:"col-12 d-flex gap-3"},i(x,{width:"65%"}),i(x,{width:"35%"}))),B=()=>i("div",{class:"row gap-5"},i("div",{class:"col-12"},i(x,{width:"40%",height:"40px"})),i(S,null)),k=()=>i("div",{class:"terminal-selector-skeleton mt-4 rounded shadow-sm"},i("div",{class:"d-flex align-items-center gap-3"},i(x,{width:"125px",height:"125px",styles:{borderRadius:"8px"}}),i("div",{class:"flex-grow-1"},i("div",{class:"d-flex row flex-row"},i("div",{class:"col-6 flex-column"},i(x,null),i(x,{width:"60%"})),i("div",{class:"d-flex justify-content-end align-items-center gap-2 col-6"},i(x,{width:"32px",height:"32px",styles:{borderRadius:"50%"}}),i(x,{width:"80px",height:"32px"}),i(x,{width:"32px",height:"32px",styles:{borderRadius:"50%"}}))),i("div",{class:"mt-4"},i("div",{class:"d-flex flex-column gap-2"},i(x,null),i(x,null)))))),C=class{constructor(i){s(this,i),this.errorEvent=t(this,"error-event",7),this.submitted=t(this,"submit-event",7),this.shipping=!1,this.submitButtonText="Submit Order",this.loading={business:!0,terminals:!0},this.submitting=!1,this.error=null,this.totalQuantity=0}componentWillLoad(){this.order=new u({business_id:this.businessId,sub_account_id:this.accountId,order_type:this.shipping?v.boardingShipping:v.boardingOnly}),n(),this.analytics=new a(this),this.loadData()}disconnectedCallback(){var i;null===(i=this.analytics)||void 0===i||i.cleanup()}handleError(i,s,t){this.error={message:i,code:s,severity:t},this.errorEvent.emit({errorCode:s,message:i,severity:t})}loadData(){this.businessId&&this.authToken?(this.initializeGetBusiness(),this.initializeGetTerminalModels()):this.handleError("Invalid business id or auth token",p.MISSING_PROPS,c.ERROR)}initializeGetBusiness(){w({id:this.businessId,authToken:this.authToken,service:new m})({onSuccess:({business:i})=>{this.business=new f(i)},onError:({error:i,code:s,severity:t})=>{this.handleError(i,s,t)},final:()=>{this.loading.business=!1}})}initializeGetTerminalModels(){(({id:i,authToken:s,service:t})=>async({onSuccess:e,onError:r})=>{var o,l,d,n;try{const a=await t.fetchTerminalModels(i,s);if(a.error)return r({error:y(a.error),code:g(null===(n=a.error)||void 0===n?void 0:n.code),severity:c.ERROR});e({terminals:(null===(l=null===(o=a.data)||void 0===o?void 0:o.terminal_order_models)||void 0===l?void 0:l.map((i=>new h(i))))||[],orderLimit:null===(d=a.data)||void 0===d?void 0:d.order_limit})}catch(i){const s=g(null==i?void 0:i.code);return r({error:i.message||i,code:s,severity:c.ERROR})}})({id:this.accountId,authToken:this.authToken,service:new j})({onSuccess:({terminals:i,orderLimit:s})=>{this.terminalModels=i,this.orderLimit=s,this.loading.terminals=!1},onError:({error:i,code:s,severity:t})=>{this.handleError(i,s,t),this.loading.terminals=!1}})}submitOrder(){const i=(({authToken:i,service:s,apiOrigin:t="https://wc-proxy.justifi.ai"})=>async({terminalOrder:e,onSuccess:r,onError:o})=>{var l;try{const d=await s.orderTerminals(i,e,t);if(d.error)return o({error:y(d.error),code:g(null===(l=d.error)||void 0===l?void 0:l.code),severity:c.ERROR});{const{data:i}=d;r({data:i})}}catch(i){const s=g(null==i?void 0:i.code);return o({error:i.message||i,code:s,severity:c.ERROR})}})({authToken:this.authToken,service:new j});this.submitting=!0,i({terminalOrder:this.order.payload,onSuccess:({data:i})=>{this.submitted.emit(i),this.submitting=!1},onError:({error:i,code:s,severity:t})=>{this.handleError(i,s,t),this.submitting=!1}})}onSelectedQuantityChange(i){this.order.updateTerminal(i.detail.modelName,i.detail.quantity),this.totalQuantity=this.order.totalQuantity}renderLoading(){return i("div",null,this.loading.business&&i(B,null),this.loading.terminals&&i("div",{class:"mt-5"},i(k,null),i(k,null),i(k,null)))}renderBusinessDetails(){var s,t,o,l,d,n,a,h;if(!this.loading.business&&this.business)return i("div",{class:"d-flex flex-column gap-4 mb-5 pt-5"},i("div",{class:"row"},i("div",{class:"col-12"},i("h2",{part:r},this.business.legal_name))),i("div",{class:"row"},i("div",{class:"col-6"},i("h5",{part:e},"Representative:"),i("div",null,i("div",null,null===(t=null===(s=this.business)||void 0===s?void 0:s.representative)||void 0===t?void 0:t.name),i("div",null,null===(l=null===(o=this.business)||void 0===o?void 0:o.representative)||void 0===l?void 0:l.title),i("div",null,null===(n=null===(d=this.business)||void 0===d?void 0:d.representative)||void 0===n?void 0:n.email),i("div",null,b(null===(h=null===(a=this.business)||void 0===a?void 0:a.representative)||void 0===h?void 0:h.phone)))),i("div",{class:"col-6"},i("h5",{part:e},this.shipping?"Shipping Address:":"Business Address:"),i("div",null,this.business.legal_address.line1,this.business.legal_address.line2?`, ${this.business.legal_address.line2}`:"",i("br",null),this.business.legal_address.city,", ",this.business.legal_address.state," ",this.business.legal_address.postal_code))))}renderTerminals(){if(!this.loading.terminals&&this.terminalModels)return i("div",{class:"d-flex flex-column gap-2 mt-5"},this.terminalModels.map((s=>i("terminal-quantity-selector",{modelName:s.model_name,description:s.description,imageUrl:s.image_url,helpUrl:s.help_url,limit:this.orderLimit-this.order.totalQuantity,onSelectedQuantityChange:this.onSelectedQuantityChange.bind(this)}))))}renderOrderSection(){return i("div",{class:"mt-3"},i("div",{class:"text-end"},"Order limit: ",this.orderLimit),i("div",{class:"d-flex justify-content-end mt-3"},i("button",{class:"btn btn-primary submit-btn",onClick:this.submitOrder.bind(this),disabled:0===this.order.totalQuantity||this.submitting,part:o},this.submitting?"Submitting...":this.submitButtonText)))}render(){return i(d,{key:"54455809df1f26151a5ef7d5935e38a8329cbc2e"},i("div",{key:"6ea3b5336d4c779da65bf2b710aa8fa5757c3b19",part:l},this.renderLoading(),this.renderBusinessDetails(),this.renderTerminals(),this.renderOrderSection()))}};export{C as justifi_order_terminals}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,h as a}from"./p-CV0Pyo1O.js";import{l as t}from"./p-OeJ-3w3l.js";import{f as d,p as s,c as l}from"./p-BLhz_ggG.js";import{f as i,a as c}from"./p-Bu7gdOaV.js";import{S as r}from"./p-05AWudQe.js";import"./p-CZfYo5-1.js";import{c as f,a as o}from"./p-Ds_P-dB8.js";import"./p-BFTU3MAI.js";import"./p-DgTOxu8x.js";import"./p-HXpYMWUU.js";const n=class{constructor(a){e(this,a),this.setParamsOnChange=(e,a)=>{d[e]=a},this.handleDateInput=(e,a)=>{const t=f(a,{setExactTime:!0});this.setParamsOnChange(e,t)}}componentWillLoad(){this.debouncedSetParamsOnChange=t.debounce(this.setParamsOnChange,300),Object.entries({payment_id:this.paymentId,terminal_id:this.terminalId,payment_status:this.paymentStatus,payment_mode:this.paymentMode,checkout_id:this.checkoutId,account_holder:this.accountHolder,created_after:this.createdAfter,created_before:this.createdBefore}).forEach((([e,a])=>{a&&(s[e]=a)}))}get paymentStatusOptions(){return[{label:"All",value:""},{label:"Pending",value:"pending"},{label:"Authorized",value:"authorized"},{label:"Succeeded",value:"succeeded"},{label:"Failed",value:"failed"},{label:"Disputed",value:"disputed"},{label:"Refunded",value:"refunded"}]}get paymentModeOptions(){return[{label:"All",value:""},{label:"E-commerce",value:"ecom"},{label:"ACH",value:"ach"},{label:"Card Present",value:"card_present"}]}render(){const e=Object.assign({},d);return a(r,{key:"e3eaa38735042ba3618a8c042e7e1b351ba3c92d"},a("table-filters-menu",{key:"af5a94add7dcefe868e65d46a38a662b4d7986b3",params:e,clearParams:l,part:i},a("div",{key:"c2c02f915eaf984458b3f99dac4bb9317aac8b7e",class:"grid-cols-2 gap-3 p-1"},a("div",{key:"2130e16ffea403ac5fec93e7d77aba470529264f",class:"p-2"},a("form-control-text",{key:"4e45a57455eed0be81236e1939c2ca5e5d741c81",name:"payment_id",label:"Payment ID",inputHandler:this.debouncedSetParamsOnChange,defaultValue:this.paymentId||d.payment_id,disabled:!!this.paymentId,part:c})),a("div",{key:"fef1849cf8f58c70f0fe8a5604545cabb58901d6",class:"p-2"},a("form-control-text",{key:"f8f076fff19c4a90901e1adacc61023a88d0bbfa",name:"terminal_id",label:"Terminal ID",inputHandler:this.debouncedSetParamsOnChange,defaultValue:this.terminalId||d.terminal_id,disabled:!!this.terminalId,part:c})),a("div",{key:"304d816e47dae74e1d493df5ffd34cef2cd93600",class:"p-2"},a("form-control-select",{key:"265350ed2411acc1bbfe6dec019a79e808713349",name:"payment_status",label:"Status",options:this.paymentStatusOptions,inputHandler:this.setParamsOnChange,defaultValue:this.paymentStatus||d.payment_status||"",disabled:!!this.paymentStatus,part:c})),a("div",{key:"d644bf25f3e524403ee5d7590d4d32fad0e56688",class:"p-2"},a("form-control-select",{key:"871056ad4364d14a18621e4da6e49bda609ef17a",name:"payment_mode",label:"Payment Mode",options:this.paymentModeOptions,inputHandler:this.setParamsOnChange,defaultValue:this.paymentMode||d.payment_mode||"",disabled:!!this.paymentMode,part:c})),a("div",{key:"e568ba09614c66e5a589b745dee36465e5c962b5",class:"p-2"},a("form-control-text",{key:"e58eb1b507c87220437ef0d9b3fcee8643408244",name:"checkout_id",label:"Checkout ID",inputHandler:this.debouncedSetParamsOnChange,defaultValue:this.checkoutId||d.checkout_id,disabled:!!this.checkoutId,part:c})),a("div",{key:"b27cde43483bffbef99f22d707d28bebce514069",class:"p-2"},a("form-control-text",{key:"bf35df034fcb1e3c2e09503b94adca74083ccb7f",name:"account_holder",label:"Account Holder",inputHandler:this.debouncedSetParamsOnChange,defaultValue:this.accountHolder||d.account_holder,disabled:!!this.accountHolder,part:c})),a("div",{key:"3ef0ccf656c147044586a2f88c718a0c833ee6c4",class:"p-2"},a("form-control-date",{key:"c6b2dbfab6749f853ecf54959cd5f94c8db7a9ae",name:"created_after",label:"Created After",inputHandler:this.handleDateInput,defaultValue:o(this.createdAfter,{showInputDateTime:!0})||o(d.created_after,{showInputDateTime:!0}),showTime:!0,disabled:!!this.createdAfter,part:c})),a("div",{key:"02c746e653dac58005381d19eaa5371347e02297",class:"p-2"},a("form-control-date",{key:"dd7d369a655e0f1e10497f45cfa7085c045287d3",name:"created_before",label:"Created Before",inputHandler:this.handleDateInput,defaultValue:o(this.createdBefore,{showInputDateTime:!0})||o(d.created_before,{showInputDateTime:!0}),showTime:!0,disabled:!!this.createdBefore,part:c})))))}};export{n as justifi_payments_list_filters}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,h as a}from"./p-CV0Pyo1O.js";import{l as t}from"./p-OeJ-3w3l.js";import{f as s,p as r,c as d}from"./p-DUtecvro.js";import{f as l,a as i}from"./p-Bu7gdOaV.js";import{S as o}from"./p-05AWudQe.js";import"./p-CZfYo5-1.js";import"./p-B4vLfYnZ.js";import{c as p,a as c}from"./p-Ds_P-dB8.js";import{T as b,f}from"./p-Dqxyi-uK.js";import"./p-CLHwhyvu.js";import"./p-CTtGaVYs.js";import"./p-BFTU3MAI.js";import"./p-DgTOxu8x.js";import"./p-HXpYMWUU.js";const n=class{constructor(a){e(this,a),this.setParamsOnChange=(e,a)=>{s[e]=a},this.handleDateInput=(e,a)=>{const t=p(a,{setExactTime:!0});this.setParamsOnChange(e,t)}}componentWillLoad(){this.debouncedSetParamsOnChange=t.debounce(this.setParamsOnChange,300),Object.entries({order_status:this.orderStatus,order_type:this.orderType,created_after:this.createdAfter,created_before:this.createdBefore,company_name:this.companyName}).forEach((([e,a])=>{a&&(r[e]=a)}))}get terminalOrderStatusOptions(){return[{label:"All",value:""},{label:"Created",value:b.created},{label:"Completed",value:b.completed},{label:"Submitted",value:b.submitted},{label:"In Progress",value:b.in_progress},{label:"On Hold",value:b.on_hold},{label:"Canceled",value:b.canceled}]}get terminalOrderTypeOptions(){return[{label:"All",value:""},{label:"Boarding Only",value:f.boardingOnly},{label:"Boarding Shipping",value:f.boardingShipping}]}render(){const e=Object.assign({},s);return a(o,{key:"4917947c32b986dfd3e03e2194166a22b854c596"},a("table-filters-menu",{key:"7cbdd6699501511839d26e0ecd320838da3d2ea8",params:e,clearParams:d,part:l},a("div",{key:"3a5ed4007f3d9c68f71a31cb7086956f6808d3bd",class:"grid-cols-2 gap-3 p-1"},a("div",{key:"cd50327bf0d34adebab19ac71d2839e33572006c",class:"p-2"},a("form-control-select",{key:"08340399deae9c6445d0bbcbc48c97afa9258e69",name:"order_status",label:"Order Status",options:this.terminalOrderStatusOptions,inputHandler:this.setParamsOnChange,defaultValue:this.orderStatus||s.order_status||"",disabled:!!this.orderStatus,part:i})),a("div",{key:"613cdc6699d667a0b733b1cb90bf336f4595d351",class:"p-2"},a("form-control-select",{key:"8b432626428e64553c2c32a94aa53750474a677d",name:"order_type",label:"Order Type",options:this.terminalOrderTypeOptions,inputHandler:this.setParamsOnChange,defaultValue:this.orderType||s.order_type||"",disabled:!!this.orderType,part:i})),a("div",{key:"3f7f2d2fdf271489ea628eda3c9137ee60cb752f",class:"p-2"},a("form-control-date",{key:"dcf0f4ab51c8511d2877405b0460faa1b272ac61",name:"created_after",label:"Created After",inputHandler:this.handleDateInput,defaultValue:c(this.createdAfter,{showInputDateTime:!0})||c(s.created_after,{showInputDateTime:!0}),showTime:!0,disabled:!!this.createdAfter,part:i})),a("div",{key:"5dca482d9530e6867a13d8f94961b909f243d316",class:"p-2"},a("form-control-date",{key:"1d5fdee06fd5420edcc1b0b5cd75bfc1d4b563e7",name:"created_before",label:"Created Before",inputHandler:this.handleDateInput,defaultValue:c(this.createdBefore,{showInputDateTime:!0})||c(s.created_before,{showInputDateTime:!0}),showTime:!0,disabled:!!this.createdBefore,part:i})),a("div",{key:"38fb2f90de478f0b29b8711ba502fd280e6599ab",class:"p-2"},a("form-control-text",{key:"772e6efb136cfd0edd2a0bfe3810e7616a2541b3",name:"company_name",label:"Company Name",inputHandler:this.debouncedSetParamsOnChange,defaultValue:this.companyName||s.company_name,disabled:!!this.companyName,part:i})))))}};export{n as justifi_terminal_orders_list_filters}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,c as e,h as i,H as s,g as a}from"./p-CV0Pyo1O.js";import{A as n}from"./p-C6Jq8YDT.js";import{A as o,r,s as l,t as h,u as c,v as d,w as u,C as p,b as y,c as m,I as v,x as f,y as g,z as b}from"./p-Dqxyi-uK.js";import{S as M}from"./p-05AWudQe.js";import"./p-CZfYo5-1.js";import{S as w}from"./p-eBK-iWrz.js";import{c as k,o as P,a as j,g as C,b as T}from"./p-Fpaf7CLD.js";import{t as A,r as E}from"./p-Bu7gdOaV.js";import{f as I}from"./p-Ds_P-dB8.js";import{w as N,c as D}from"./p-B4vLfYnZ.js";import{H as S}from"./p-CZk3i5Tu.js";import{H as O,b as L,h as x,i as z}from"./p-x2oNTAWh.js";import{H as _}from"./p-BAB1lPu0.js";import{J as R}from"./p-BjjKkMO1.js";import{c as U}from"./p-_MjmE9YT.js";import"./p-HXpYMWUU.js";import"./p-CLHwhyvu.js";import"./p-CTtGaVYs.js";import{m as B,a as Y}from"./p-D7nyPi2Q.js";import{C as F}from"./p-D7fNBSlC.js";import{P as V}from"./p-C60AkJ6a.js";import{P as Q,a as H,b as W}from"./p-DEx8fQeW.js";import{C as G}from"./p-ZpPDShvP.js";import"./p-BC9n8nB2.js";import"./p-DgTOxu8x.js";import"./p-BhpaUYtS.js";const Z=class{constructor(i){t(this,i),this.radioClick=e(this,"radio-click",7),this.checked=!1,this.hidden=!1}render(){return i(M,{key:"02955940079320bd9c6bf94e239545385ac36458"},i("radio-list-item",{key:"fc6b98e456e4326b843b2b3248b7327436767cf4",name:this.name,value:this.value,label:this.label,checked:this.checked,hidden:this.hidden,class:this.class,"onRadio-click":t=>this.radioClick.emit(t.detail)}))}};var q;!function(t){t.UNAVAILABLE="UNAVAILABLE",t.SESSION_ERROR="SESSION_ERROR",t.MERCHANT_VALIDATION_ERROR="MERCHANT_VALIDATION_ERROR",t.PAYMENT_PROCESSING_ERROR="PAYMENT_PROCESSING_ERROR",t.USER_CANCELLED="USER_CANCELLED"}(q||(q={}));class J{constructor(){this.api=n()}initialize(t){if(this.applePayConfig=new o(t),!this.applePayConfig.isValid)throw new Error("Invalid Apple Pay configuration provided")}async validateMerchant(t,e){try{return await this.api.post({endpoint:"apple_pay/merchant_session",authToken:t,headers:{"Sub-Account":e},body:{domain:window.location.hostname,display_name:this.applePayConfig.displayName}})}catch(t){throw console.error("Backend validation failed:",t),new Error("Merchant validation failed")}}async processPayment(t,e,i){const s=await this.api.post({endpoint:"apple_pay/process_token",authToken:t,body:i,headers:{"Sub-Account":e}});return{success:s.id&&!!s.data.token,data:s}}isAvailable(){return r.isApplePaySupported()&&r.canMakePayments()}async canMakePaymentsWithActiveCard(){if(!this.applePayConfig)throw new Error("Apple Pay not initialized. Call initialize() first.");return await r.canMakePaymentsWithActiveCard(this.applePayConfig.merchantIdentifier)}async startPaymentSession(t,e,i){if(!this.applePayConfig)throw console.error("[ApplePayService] Missing applePayConfig. Did you call initialize()?"),new Error("Apple Pay not initialized. Call initialize() first.");const s=new l(t);if(!s.isValid){const t=[];throw s.countryCode||t.push("countryCode"),s.currencyCode||t.push("currencyCode"),s.merchantCapabilities&&0!==s.merchantCapabilities.length||t.push("merchantCapabilities"),s.supportedNetworks&&0!==s.supportedNetworks.length||t.push("supportedNetworks"),s.total&&s.total.label&&s.total.amount||t.push("total"),console.error("[ApplePayService] Payment request is invalid. Missing/invalid:",t),new Error("Invalid payment request provided")}return this.currentPaymentRequest=s,new Promise(((t,a)=>{try{if("undefined"==typeof window||!("ApplePaySession"in window))return console.error("[ApplePayService] ApplePaySession not available on window"),a({success:!1,error:{code:q.UNAVAILABLE,message:"ApplePaySession API is not available in this environment"}});this.currentSession=new window.ApplePaySession(3,s),this.setupSessionEventHandlers(t,a,e,i),this.currentSession.begin()}catch(t){console.error("[ApplePayService] Exception while starting session:",t),a({success:!1,error:{code:q.SESSION_ERROR,message:t instanceof Error?t.message:"Failed to start Apple Pay session"}})}}))}abortPaymentSession(){this.currentSession&&(this.currentSession.abort(),this.currentSession=void 0,this.currentPaymentRequest=void 0)}setupSessionEventHandlers(t,e,i,s){this.currentSession&&this.applePayConfig&&this.currentPaymentRequest?(this.currentSession.onvalidatemerchant=async()=>{try{if(!i)throw console.error("[ApplePayService] Missing authToken for merchant validation"),new Error("Authentication token not provided.");const t=await this.validateMerchant(i,s);try{this.currentSession.completeMerchantValidation(t)}catch(t){throw console.error("Error calling completeMerchantValidation:",t),t}}catch(t){console.error("=== MERCHANT VALIDATION ERROR ==="),console.error("Error during merchant validation:",t),t&&t.stack&&console.error("Error stack:",t.stack),this.currentSession.abort(),e({success:!1,error:{code:q.MERCHANT_VALIDATION_ERROR,message:t instanceof Error?t.message:"Merchant validation failed"}})}},this.currentSession.onpaymentauthorized=async a=>{try{const n=a.payment,o=Object.assign(Object.assign({},n.token),{product_details:{name:this.currentPaymentRequest.total.label,price:r.parseAmount(this.currentPaymentRequest.total.amount),description:this.currentPaymentRequest.total.label}}),l=await this.processPayment(i,s,o);l.success?(this.currentSession.completePayment({status:h.STATUS_SUCCESS}),t({success:!0,token:n.token,paymentMethodId:l.data.id})):(console.error("PSP reported payment failure:",l.data),this.currentSession.completePayment({status:h.STATUS_FAILURE}),e({success:!1,error:{code:q.PAYMENT_PROCESSING_ERROR,message:"Payment processing failed"}}))}catch(t){console.error("=== PAYMENT PROCESSING ERROR ==="),console.error("Error processing payment:",t),t&&t.stack&&console.error("Error stack:",t.stack),this.currentSession.completePayment({status:h.STATUS_FAILURE}),e({success:!1,error:{code:q.PAYMENT_PROCESSING_ERROR,message:t instanceof Error?t.message:"Payment processing failed"}})}finally{this.currentSession=void 0,this.currentPaymentRequest=void 0}},this.currentSession.onpaymentmethodselected=()=>{const t={newTotal:this.currentPaymentRequest.total,newLineItems:this.currentPaymentRequest.lineItems||[]};try{this.currentSession.completePaymentMethodSelection(t)}catch(t){console.error("Error completing payment method selection:",t),this.currentSession.abort()}},this.currentSession.onshippingmethodselected=()=>{this.currentSession.completeShippingMethodSelection({status:h.STATUS_SUCCESS,newTotal:this.currentPaymentRequest.total,newLineItems:this.currentPaymentRequest.lineItems||[]})},this.currentSession.oncancel=t=>{if(t.sessionError)switch(console.error(t.sessionError),t.sessionError.code){case"unknown":console.error("Unknown error - likely merchant validation issue"),console.error("This usually means:"),console.error("1. Merchant certificate is invalid or expired"),console.error("2. Merchant identifier mismatch"),console.error("3. Backend validation endpoint issues");break;case"invalidMerchantSession":console.error("Invalid merchant session provided"),console.error("Check that the merchant session from backend is valid");break;case"userCancel":console.error("User cancelled the payment");break;default:console.error("Other error code:",t.sessionError.code)}this.currentSession=void 0,this.currentPaymentRequest=void 0,e({success:!1,error:{code:q.USER_CANCELLED,message:"User cancelled the Apple Pay session"}})},"onerror"in this.currentSession&&(this.currentSession.onerror=t=>{console.error("=== APPLE PAY SESSION ERROR ==="),console.error("Session error:",t),this.currentSession=void 0,this.currentPaymentRequest=void 0,e({success:!1,error:{code:q.SESSION_ERROR,message:"Apple Pay session error occurred"}})})):console.error("[ApplePayService] setupSessionEventHandlers called without required state",{hasSession:Boolean(this.currentSession),hasConfig:Boolean(this.applePayConfig),hasPaymentRequest:Boolean(this.currentPaymentRequest)})}static createPaymentRequest(t,e,i="US",s="USD"){return{countryCode:i,currencyCode:s,merchantCapabilities:r.getDefaultMerchantCapabilities(),supportedNetworks:r.getDefaultSupportedNetworks(),total:r.createLineItem(e,t)}}getApplePayConfig(){return this.applePayConfig}}const K=t=>{const{isLoading:e}=t;return e?i("div",{class:"container-fluid p-0"},i("div",{class:"row mb-3"},i("div",{class:"col-12 align-content-center"},i(w,{height:"44px",width:"100%",styles:{borderRadius:"8px"}})))):null},$=t=>i("div",{class:"apple-pay-button-container"},i("button",Object.assign({class:(()=>{let e="apple-pay-button";switch(t.buttonStyle){case c.WHITE:e+=" apple-pay-button-white";break;case c.WHITE_OUTLINE:e+=" apple-pay-button-white-outline";break;default:e+=" apple-pay-button-black"}switch(t.buttonType){case d.BUY:e+=" apple-pay-button-type-buy";break;case d.DONATE:e+=" apple-pay-button-type-donate";break;default:e+=" apple-pay-button-type-plain"}return(t.disabled||t.isProcessing||!t.isAvailable)&&(e+=" disabled"),e})(),style:{width:t.width,height:t.height},onClick:()=>{!t.disabled&&!t.isProcessing&&t.isAvailable&&t.clickHandler&&t.clickHandler()},disabled:t.disabled||t.isProcessing||!t.isAvailable,"aria-label":"Pay with Apple Pay",type:"button"},t),t.isProcessing&&i("div",{class:"processing-overlay"},i("div",{class:"spinner"}),i("span",null,"Processing..."))),i("style",null,"\n .apple-pay-button-container {\n display: block;\n position: relative;\n width: 100%;\n }\n\n /* Apple Pay CSS classes - these are the official Apple Pay button styles */\n .apple-pay-button {\n display: inline-block;\n -webkit-appearance: -apple-pay-button;\n -apple-pay-button-type: plain; /* default */\n -apple-pay-button-style: black; /* default */\n border-radius: 8px;\n cursor: pointer;\n border: none;\n outline: none;\n transition: opacity 0.2s ease;\n position: relative;\n }\n\n /* Button styles */\n .apple-pay-button.apple-pay-button-black {\n -apple-pay-button-style: black;\n }\n\n .apple-pay-button.apple-pay-button-white {\n -apple-pay-button-style: white;\n }\n\n .apple-pay-button.apple-pay-button-white-outline {\n -apple-pay-button-style: white-outline;\n }\n\n /* Button types */\n .apple-pay-button.apple-pay-button-type-plain {\n -apple-pay-button-type: plain;\n }\n\n .apple-pay-button.apple-pay-button-type-buy {\n -apple-pay-button-type: buy;\n }\n\n .apple-pay-button.apple-pay-button-type-donate {\n -apple-pay-button-type: donate;\n }\n\n /* Hover and disabled states */\n .apple-pay-button:hover:not(.disabled) {\n opacity: 0.9;\n }\n\n .apple-pay-button.disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n /* Processing overlay */\n .processing-overlay {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 8px;\n background: rgba(0, 0, 0, 0.8);\n color: white;\n border-radius: 8px;\n font-size: 14px;\n font-weight: 500;\n }\n\n .spinner {\n width: 16px;\n height: 16px;\n border: 2px solid rgba(255, 255, 255, 0.3);\n border-top: 2px solid #fff;\n border-radius: 50%;\n animation: spin 1s linear infinite;\n }\n\n @keyframes spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n }\n\n /* Responsive design */\n @media (max-width: 480px) {\n .apple-pay-button {\n width: 100% !important;\n min-width: 200px;\n }\n }\n ")),X=class{constructor(i){t(this,i),this.applePayStarted=e(this,"applePayStarted",7),this.applePayCompleted=e(this,"applePayCompleted",7),this.applePayCancelled=e(this,"applePayCancelled",7),this.applePayError=e(this,"applePayError",7),this.sdkLoaded=!1,this.countryCode="US",this.merchantIdentifier="merchant.com.staging-justifi.checkout-dev",this.merchantDisplayName="JustiFi Checkout",this.initiativeContext="dev-checkout.justifi-staging.com",this.buttonType=d.PLAIN,this.buttonStyle=c.BLACK,this.disabled=!1,this.width="100%",this.height="48px",this.isLoading=!0,this.isProcessing=!1,this.isAvailable=!1,this.canMakePayments=!1,this.isConfigValid=!0,this.error=null,this.handleApplePayClick=async()=>{var t,e,i;if(!this.isProcessing&&!this.disabled&&this.isAvailable)try{this.isProcessing=!0,this.error=null,this.applePayStarted.emit();const i={countryCode:this.countryCodeForCurrency(k.paymentCurrency),currencyCode:k.paymentCurrency,merchantCapabilities:[u.SUPPORTS_3DS,u.SUPPORTS_CREDIT,u.SUPPORTS_DEBIT],supportedNetworks:r.getDefaultSupportedNetworks(),total:r.createLineItem(k.paymentDescription,k.paymentAmount)},s=await this.applePayService.startPaymentSession(i,k.authToken,k.accountId);s.success?this.applePayCompleted.emit({success:!0,token:s.token,paymentMethodId:s.paymentMethodId}):(this.applePayCompleted.emit({success:!1,error:s.error}),this.applePayError.emit({error:(null===(t=s.error)||void 0===t?void 0:t.message)||"Payment failed",code:(null===(e=s.error)||void 0===e?void 0:e.code)||X.ErrorCode.PAYMENT_FAILED}))}catch(t){if((null===(i=null==t?void 0:t.error)||void 0===i?void 0:i.code)===q.USER_CANCELLED)this.applePayCancelled.emit();else{const e=t instanceof Error?t.message:"Payment failed";this.error=e,this.applePayError.emit({error:e,code:X.ErrorCode.PAYMENT_FAILED}),this.applePayCompleted.emit({success:!1,error:e})}}finally{this.isProcessing=!1}}}componentWillLoad(){this.isAvailable=r.isApplePaySupported(),this.isAvailable?k.checkoutLoaded?this.loadApplePaySDK():P("checkoutLoaded",(t=>{t&&this.loadApplePaySDK()})):this.isLoading=!1}countryCodeForCurrency(t){return"cad"==t.toLowerCase()?"CA":"US"}loadApplePaySDK(){if(this.sdkLoaded)return;this.sdkLoaded=!0;const t=document.createElement("script");t.src="https://applepay.cdn-apple.com/jsapi/1.latest/apple-pay-sdk.js",t.async=!0,t.onload=()=>this.initializeApplePay(),document.head.appendChild(t)}async initializeApplePay(){try{if(this.isLoading=!0,this.error=null,this.isConfigValid=!0,!(Boolean(k.paymentAmount)&&Boolean(k.paymentCurrency)&&Boolean(k.authToken)))return this.error="Missing required Apple Pay configuration",this.isConfigValid=!1,this.applePayError.emit({error:this.error,code:X.ErrorCode.CONFIG_ERROR}),void(this.isLoading=!1);if(this.isAvailable=r.isApplePaySupported(),this.canMakePayments=r.canMakePayments(),!this.isAvailable)return this.error="Apple Pay is not supported on this device",this.applePayError.emit({error:this.error,code:X.ErrorCode.NOT_SUPPORTED}),void(this.isLoading=!1);if(!this.canMakePayments)return this.error="Apple Pay is not available",this.applePayError.emit({error:this.error,code:X.ErrorCode.NOT_AVAILABLE}),void(this.isLoading=!1);const t={merchantIdentifier:this.merchantIdentifier,displayName:this.merchantDisplayName,initiative:"web",initiativeContext:this.initiativeContext,buttonType:this.buttonType,buttonStyle:this.buttonStyle};this.applePayService=new J,this.applePayService.initialize(t),await this.applePayService.canMakePaymentsWithActiveCard()||console.warn("No Apple Pay cards available, but continuing...")}catch(t){this.error=t instanceof Error?t.message:"Failed to initialize Apple Pay",this.applePayError.emit({error:this.error,code:X.ErrorCode.INITIALIZATION_ERROR})}finally{this.isLoading=!1}}async isSupported(){return this.isAvailable&&this.canMakePayments}async getPaymentMethods(){return this.isAvailable?r.getDefaultSupportedNetworks():[]}async abort(){var t;null===(t=this.applePayService)||void 0===t||t.abortPaymentSession(),this.isProcessing=!1,this.applePayCancelled.emit()}render(){if(!k.applePayEnabled)return null;if(!this.isAvailable)return null;const t=!this.isLoading&&this.isAvailable&&this.canMakePayments&&this.isConfigValid;return i(M,null,i("div",{class:"apple-pay-container"},i(K,{isLoading:this.isLoading}),t&&i($,{buttonType:this.buttonType,buttonStyle:this.buttonStyle,disabled:this.disabled,isProcessing:this.isProcessing,isAvailable:this.isAvailable,clickHandler:this.handleApplePayClick,width:this.width,height:this.height})),i("style",null,"\n .apple-pay-container {\n width: 100%;\n }\n "))}};X.ErrorCode={CONFIG_ERROR:"CONFIG_ERROR",NOT_SUPPORTED:"NOT_SUPPORTED",NOT_AVAILABLE:"NOT_AVAILABLE",INITIALIZATION_ERROR:"INITIALIZATION_ERROR",PAYMENT_FAILED:"PAYMENT_FAILED"};const tt=class{constructor(e){t(this,e),this.variant="primary",this.type="button"}render(){return i(M,{key:"1e09a302d064e2e4a860dc4efd9eb9693d4d0055"},i("internal-button",{key:"9ce7819853789c44860de43f26632c62415ebdb5",text:this.text,variant:this.variant,isLoading:this.isLoading,clickHandler:this.clickHandler,type:this.type,disabled:this.disabled,class:this.class,customStyle:this.customStyle,hidden:this.hidden}))}},et=class{constructor(e){t(this,e)}render(){return i(M,{key:"7d3447ff4daa9bf4f603ca381027b3f43cfcc6a1"},i("section",{key:"1c8189ccde6dc986ad2d4c74da2dd10cacfc1c36"},i("div",{key:"45e6d5f47d8a92e0bd4a7bfa427630a96f049b4a"},i("div",{key:"9900b5fd770cd59b00803c3614216c16a803da41",part:A},null==k?void 0:k.paymentDescription),i("div",{key:"16cec140ef6912533a80b1f6341fcc9cb341b478"},i("span",{key:"f8883538c99a524017bb102bfd8cfaea7062e650",part:A},"Total")," ",i("span",{key:"11baa64630a60c56cedfa53548c107ec3fe3c0f5",part:A},I(+(null==k?void 0:k.totalAmount)))))))}},it=t=>{const{isLoading:e}=t;return e?i("div",{class:"container-fluid p-0"},i("div",{class:"row mb-3"},i("div",{class:"col-12 align-content-center"},i(w,{height:"44px",width:"100%",styles:{borderRadius:"8px"}})))):null};var st;!function(t){t.initialize="justifi.googlePay.initialize",t.ready="justifi.googlePay.ready",t.sdkLoaded="justifi.googlePay.sdkLoaded",t.initializeResult="justifi.googlePay.initializeResult",t.error="justifi.googlePay.error",t.buttonClicked="justifi.googlePay.buttonClicked",t.startPayment="justifi.googlePay.startPayment",t.paymentSuccess="justifi.googlePay.paymentSuccess",t.paymentCanceled="justifi.googlePay.paymentCanceled",t.paymentError="justifi.googlePay.paymentError"}(st||(st={}));const at=class{constructor(i){t(this,i),this.googlePayStarted=e(this,"googlePayStarted",7),this.googlePayCompleted=e(this,"googlePayCompleted",7),this.googlePayCancelled=e(this,"googlePayCancelled",7),this.merchantDisplayName="JustiFi Checkout",this.useNativePaymentRequest=!1,this.iframeReady=!1,this.sdkLoaded=!1,this.isReadyToPay=!1,this.handleMessage=t=>{if(t.origin!==this.iframeOrigin)return;const{eventType:e,data:i}=t.data||{};switch(e){case st.ready:this.iframeReady=!0;break;case st.sdkLoaded:this.sdkLoaded=!0,this.sendInitialize();break;case st.initializeResult:this.isReadyToPay=i.isReadyToPay,i.error&&console.error("Init error:",i.error);break;case st.error:console.error("Google Pay error:",i);break;case st.buttonClicked:this.googlePayStarted.emit(),this.sendStartPayment();break;case st.paymentSuccess:this.googlePayCompleted.emit({success:!0,paymentMethodId:i.paymentMethodId,cardNetwork:i.cardNetwork,cardDetails:i.cardDetails});break;case st.paymentCanceled:this.googlePayCancelled.emit();break;case st.paymentError:this.googlePayCompleted.emit({success:!1,error:{code:i.code,message:i.message}})}}}async componentWillLoad(){await N(),this.iframeOrigin=D.iframeOrigin}componentDidLoad(){window.addEventListener("message",this.handleMessage)}disconnectedCallback(){window.removeEventListener("message",this.handleMessage)}googlePayEnvironment(){return void 0!==this.environment?this.environment:"test"===k.checkoutMode?"TEST":"PRODUCTION"}sendInitialize(){var t;if(!(null===(t=this.iframeElement)||void 0===t?void 0:t.contentWindow))return;const e={environment:this.googlePayEnvironment(),gatewayMerchantId:k.accountId,merchantName:this.merchantDisplayName,authToken:k.authToken,accountId:k.accountId,useNativePaymentRequest:this.useNativePaymentRequest};this.iframeElement.contentWindow.postMessage({eventType:st.initialize,data:e},this.iframeOrigin)}sendStartPayment(){var t;if(!(null===(t=this.iframeElement)||void 0===t?void 0:t.contentWindow))return;const e={totalPrice:String(k.paymentAmount/100),totalPriceStatus:"FINAL",currencyCode:k.paymentCurrency||"USD"};this.iframeElement.contentWindow.postMessage({eventType:st.startPayment,data:e},this.iframeOrigin)}render(){return k.checkoutLoaded?k.googlePayEnabled?i(s,null,i(it,{isLoading:!this.isReadyToPay}),i("iframe",{ref:t=>this.iframeElement=t,src:`${this.iframeOrigin}/v2/googlePay`,allow:"payment",style:{border:"none",width:"100%",height:"48px",display:this.isReadyToPay?"block":"none"}})):(console.warn("Google Pay is not enabled for this checkout"),null):null}},nt=class{constructor(e){t(this,e),this.levels={h1:S,h2:O,h3:_},this.level="h1"}render(){return i(M,{key:"1843adabddf7d439036f8ce6f55627b7ca3e4a9f"},i(this.levels[this.level],{key:"b16e5624ce7e092cc8c144a7cdfd9cb6afdf7a83",text:this.text,class:this.class}))}},ot=class{constructor(i){t(this,i),this.errorEvent=e(this,"error-event",7),this.submitEvent=e(this,"submit-event",7),this.checkoutChangedEvent=e(this,"checkout-changed",7),this.plaidService=new V,this.handlePaypalStarted=()=>{k.isWalletProcessing=!0},this.handlePaypalCompleted=t=>{const{success:e,paymentMethodId:i,fundingSource:s}=t.detail||{};k.isWalletProcessing=!1,e&&i?(k.paymentToken=i,k.selectedPaymentMethod={type:"venmo"===s?Q.VENMO:Q.PAYPAL},this.submitCheckout()):this.errorEvent.emit({message:"Paypal payment failed",errorCode:y.TOKENIZE_ERROR,severity:p.ERROR})},this.handlePaypalCancelled=()=>{k.isWalletProcessing=!1,k.paymentToken=void 0,k.selectedPaymentMethod=void 0},this.handlePaypalError=t=>{k.isWalletProcessing=!1;const{error:e,code:i}=t.detail||{};this.errorEvent.emit({message:e||"Paypal error occurred",errorCode:`PAYPAL_${i}`,severity:p.ERROR})},this.handleApplePayStarted=()=>{k.isWalletProcessing=!0},this.handleGooglePayStarted=()=>{k.isWalletProcessing=!0},this.handleGooglePayCompleted=t=>{const{success:e,paymentMethodId:i,error:s}=t.detail||{};e&&i?(k.isWalletProcessing=!1,k.paymentToken=i,k.selectedPaymentMethod={type:Q.GOOGLE_PAY},this.submitCheckout()):(k.isWalletProcessing=!1,this.errorEvent.emit({message:s&&s.message||"Google Pay payment failed",errorCode:y.TOKENIZE_ERROR,severity:p.ERROR}))},this.handleGooglePayCancelled=()=>{k.isWalletProcessing=!1,k.paymentToken=void 0,k.selectedPaymentMethod=void 0},this.handleApplePayCompleted=t=>{const{success:e,token:i,paymentMethodId:s,error:a}=t.detail;e&&i?(k.isWalletProcessing=!1,k.paymentToken=s,k.selectedPaymentMethod={type:Q.APPLE_PAY},this.submitCheckout()):(k.isWalletProcessing=!1,console.error("Apple Pay completed but failed:",a),this.errorEvent.emit({message:(null==a?void 0:a.message)||"Apple Pay payment failed",errorCode:y.TOKENIZE_ERROR,severity:p.ERROR}))},this.handleApplePayError=t=>{k.isWalletProcessing=!1;const{error:e,code:i}=t.detail;console.error("Apple Pay error:",e),this.errorEvent.emit({message:e||"Apple Pay error occurred",errorCode:`APPLE_PAY_${i}`,severity:p.ERROR})},this.handleApplePayCancelled=()=>{k.isWalletProcessing=!1,k.paymentToken=void 0,k.selectedPaymentMethod=void 0}}connectedCallback(){var t;this.observer=new MutationObserver((()=>{this.queryFormRefs(),this.setupApplePayListeners(),this.setupGooglePayListeners(),this.setupPaypalListeners()})),this.observer.observe(this.hostEl,{childList:!0,subtree:!0}),k.checkoutId=this.checkoutId;const e={authToken:this.authToken,checkoutId:this.checkoutId,service:new F};this.getCheckout=B(e),this.completeCheckout=Y(e),null===(t=this.unsubscribeCheckoutChanges)||void 0===t||t.call(this),this.unsubscribeCheckoutChanges=j((()=>{this.emitCheckoutChanged()}))}componentWillLoad(){this.analytics=new R(this),U(),k.authToken=this.authToken,this.fetchCheckout(),L("set",(t=>{const e=z[t];void 0!==e&&x(t,e)&&this.fetchCheckout()}))}componentDidLoad(){this.queryFormRefs(),this.setupApplePayListeners(),this.setupGooglePayListeners(),this.setupPaypalListeners()}disconnectedCallback(){var t,e;null===(t=this.unsubscribeCheckoutChanges)||void 0===t||t.call(this),this.unsubscribeCheckoutChanges=void 0,null===(e=this.observer)||void 0===e||e.disconnect(),this.removeApplePayListeners(),this.removeGooglePayListeners(),this.removePaypalListeners()}fetchCheckout(){this.authToken&&this.checkoutId?this.getCheckout&&this.getCheckout({onSuccess:({checkout:t})=>{this.updateStore(t),t.status!==v.completed?t.status!==v.expired||this.errorEvent.emit({message:m.CHECKOUT_EXPIRED,errorCode:y.CHECKOUT_EXPIRED,severity:p.ERROR}):this.errorEvent.emit({message:m.CHECKOUT_ALREADY_COMPLETED,errorCode:y.CHECKOUT_ALREADY_COMPLETED,severity:p.ERROR})},onError:t=>{this.errorEvent.emit({message:t.message,errorCode:t.code,severity:t.severity})}}):this.errorEvent.emit({message:m.NOT_AUTHENTICATED,errorCode:y.NOT_AUTHENTICATED,severity:p.ERROR})}updateStore(t){var e,i,s,a,n,o,r,l,h,c,d,u,p,y,m;k.accountId=t.account_id;const v=null!=t.mode?String(t.mode).toLowerCase():"";k.checkoutMode="test"===v?"test":"live"===v?"live":null;const f=t.payment_methods.map((t=>new H(t))),g=Boolean(null===(e=t.payment_settings)||void 0===e?void 0:e.ach_payments);k.paymentMethods=f.filter((t=>t.type!==Q.SAVED_BANK_ACCOUNT||g)),k.paymentMethodGroupId=t.payment_method_group_id,k.paymentDescription=t.payment_description,k.totalAmount=t.total_amount,k.paymentAmount=t.payment_amount,k.bnplEnabled=t.payment_settings.bnpl_payments,k.insuranceEnabled=null!==(i=t.payment_settings.insurance_payments)&&void 0!==i&&i,k.bankAccountVerification=null===(s=t.payment_settings)||void 0===s?void 0:s.bank_account_verification,k.applePayEnabled=null!==(n=null===(a=t.payment_settings)||void 0===a?void 0:a.apple_payments)&&void 0!==n&&n,k.googlePayEnabled=null!==(r=null===(o=t.payment_settings)||void 0===o?void 0:o.google_payments)&&void 0!==r&&r,k.paypalEnabled=null!==(h=null===(l=t.payment_settings)||void 0===l?void 0:l.paypal_payments)&&void 0!==h&&h,k.paypalProviderClientId=null!==(d=null===(c=t.paypal)||void 0===c?void 0:c.provider_client_id)&&void 0!==d?d:"",k.achPaymentsEnabled=g,k.bnplProviderClientId=null===(u=null==t?void 0:t.bnpl)||void 0===u?void 0:u.provider_client_id,k.bnplProviderMode=null===(p=null==t?void 0:t.bnpl)||void 0===p?void 0:p.provider_mode,k.bnplProviderApiVersion=null===(y=null==t?void 0:t.bnpl)||void 0===y?void 0:y.provider_api_version,k.bnplProviderCheckoutUrl=null===(m=null==t?void 0:t.bnpl)||void 0===m?void 0:m.provider_checkout_url,k.paymentCurrency=(t.payment_currency||k.paymentCurrency).toUpperCase(),k.checkoutLoaded=!0}emitCheckoutChanged(){const t={availablePaymentMethodTypes:C(),selectedPaymentMethod:k.selectedPaymentMethod,savedPaymentMethods:k.paymentMethods};this.checkoutChangedEvent.emit(t)}queryFormRefs(){if(this.billingFormRef=this.hostEl.querySelector("justifi-billing-form, justifi-bank-account-billing-form-simple, justifi-card-billing-form-simple, justifi-billing-form-full, justifi-tokenize-payment-method"),this.applePayRef=this.hostEl.querySelector("justifi-apple-pay"),this.googlePayRef=this.hostEl.querySelector("justifi-google-pay"),this.paypalRef=this.hostEl.querySelector("justifi-paypal"),this.paymentMethodFormRef=this.hostEl.querySelector("justifi-card-form, justifi-bank-account-form, justifi-tokenize-payment-method"),!k.selectedPaymentMethod&&this.paymentMethodFormRef){const t=this.paymentMethodFormRef.tagName.toLowerCase();"justifi-card-form"===t?k.selectedPaymentMethod={type:Q.NEW_CARD}:"justifi-bank-account-form"!==t||k.checkoutLoaded&&!k.achPaymentsEnabled||(k.selectedPaymentMethod={type:Q.NEW_BANK_ACCOUNT})}this.insuranceFormRef=this.hostEl.querySelector("justifi-season-interruption-insurance")}setupApplePayListeners(){this.applePayRef&&(this.applePayRef.addEventListener("applePayStarted",this.handleApplePayStarted),this.applePayRef.addEventListener("applePayCompleted",this.handleApplePayCompleted),this.applePayRef.addEventListener("applePayError",this.handleApplePayError),this.applePayRef.addEventListener("applePayCancelled",this.handleApplePayCancelled))}removeApplePayListeners(){this.applePayRef&&(this.applePayRef.removeEventListener("applePayStarted",this.handleApplePayStarted),this.applePayRef.removeEventListener("applePayCompleted",this.handleApplePayCompleted),this.applePayRef.removeEventListener("applePayError",this.handleApplePayError),this.applePayRef.removeEventListener("applePayCancelled",this.handleApplePayCancelled))}setupGooglePayListeners(){this.googlePayRef&&(this.googlePayRef.addEventListener("googlePayStarted",this.handleGooglePayStarted),this.googlePayRef.addEventListener("googlePayCompleted",this.handleGooglePayCompleted),this.googlePayRef.addEventListener("googlePayCancelled",this.handleGooglePayCancelled))}removeGooglePayListeners(){this.googlePayRef&&(this.googlePayRef.removeEventListener("googlePayStarted",this.handleGooglePayStarted),this.googlePayRef.removeEventListener("googlePayCompleted",this.handleGooglePayCompleted),this.googlePayRef.removeEventListener("googlePayCancelled",this.handleGooglePayCancelled))}setupPaypalListeners(){this.paypalRef&&(this.paypalRef.addEventListener("paypalStarted",this.handlePaypalStarted),this.paypalRef.addEventListener("paypalCompleted",this.handlePaypalCompleted),this.paypalRef.addEventListener("paypalCancelled",this.handlePaypalCancelled),this.paypalRef.addEventListener("paypalError",this.handlePaypalError))}removePaypalListeners(){this.paypalRef&&(this.paypalRef.removeEventListener("paypalStarted",this.handlePaypalStarted),this.paypalRef.removeEventListener("paypalCompleted",this.handlePaypalCompleted),this.paypalRef.removeEventListener("paypalCancelled",this.handlePaypalCancelled),this.paypalRef.removeEventListener("paypalError",this.handlePaypalError))}async tokenizePaymentMethod(t){var e,i,s;const a=null!==(i=await(null===(e=this.billingFormRef)||void 0===e?void 0:e.getValues()))&&void 0!==i?i:{},n=Object.assign(Object.assign({},t),a),o=Object.assign({accountId:k.accountId,payment_method_group_id:void 0},n);k.savePaymentMethod&&(o.payment_method_group_id=k.paymentMethodGroupId);const r=await(null===(s=this.paymentMethodFormRef)||void 0===s?void 0:s.tokenize({clientId:this.authToken,paymentMethodMetadata:o,account:k.accountId}));return r.error?r:(k.paymentToken=r.id,r.id)}async fillBillingForm(t){k.billingFormFields=t}async setSelectedPaymentMethod(t){k.selectedPaymentMethod=t,k.paymentToken=t.id||void 0}async validate(){var t,e;const i=[];k.insuranceEnabled&&this.insuranceFormRef&&i.push(this.insuranceFormRef.validate());const s=(null===(t=k.selectedPaymentMethod)||void 0===t?void 0:t.type)===Q.NEW_CARD,a=(null===(e=k.selectedPaymentMethod)||void 0===e?void 0:e.type)===Q.NEW_BANK_ACCOUNT;if((s||a)&&(this.paymentMethodFormRef&&i.push(this.paymentMethodFormRef.validate()),this.billingFormRef&&i.push(this.billingFormRef.validate())),0===i.length)return!0;try{return!!(await Promise.all(i)).every((t=>"boolean"==typeof t?t:!1!==(null==t?void 0:t.isValid)))||(this.errorEvent.emit({message:"Validation error",errorCode:y.VALIDATION_ERROR,severity:p.ERROR}),!1)}catch(t){return!1}}async submitCheckout(t){var e,i,s,a,n,o,r,l;if(k.isSubmitting)return;k.isSubmitting=!0;const h=await this.validate();if(!k.selectedPaymentMethod)return k.isSubmitting=!1,void this.errorEvent.emit({message:"No payment method selected.",errorCode:y.VALIDATION_ERROR,severity:p.ERROR});const c=(null===(e=k.selectedPaymentMethod)||void 0===e?void 0:e.type)===Q.NEW_CARD,d=(null===(i=k.selectedPaymentMethod)||void 0===i?void 0:i.type)===Q.NEW_BANK_ACCOUNT,u=(null===(s=k.selectedPaymentMethod)||void 0===s?void 0:s.type)===Q.PLAID;if(c||d){const e=await this.tokenizePaymentMethod(t);if(null==e?void 0:e.error)return k.isSubmitting=!1,void this.errorEvent.emit({message:e.error.message,errorCode:y.TOKENIZE_ERROR,severity:p.ERROR})}if(u&&!k.paymentToken){const t=k.plaidPublicToken,e=k.plaidLinkTokenId;if(!t)return k.isSubmitting=!1,void this.errorEvent.emit({message:"Missing Plaid public token. Please connect your bank.",errorCode:y.TOKENIZE_ERROR,severity:p.ERROR});try{const i=await this.plaidService.tokenizeBankAccount(k.authToken,k.accountId,t,e||void 0,k.savePaymentMethod?k.paymentMethodGroupId:void 0);if(null==i?void 0:i.error)return k.isSubmitting=!1,void this.errorEvent.emit({message:"string"==typeof i.error?i.error:i.error.message||"Failed to tokenize bank account",errorCode:y.TOKENIZE_ERROR,severity:p.ERROR});const s=null==i?void 0:i.data,n=(null===(a=null==s?void 0:s.bank_account)||void 0===a?void 0:a.token)||(null==s?void 0:s.token)||(null==s?void 0:s.id);k.paymentToken=n}catch(t){return k.isSubmitting=!1,void this.errorEvent.emit({message:(null==t?void 0:t.message)||"Plaid exchange error",errorCode:y.TOKENIZE_ERROR,severity:p.ERROR})}}if(!h)return k.isSubmitting=!1,void this.errorEvent.emit({message:"Please fill in all required fields.",errorCode:y.VALIDATION_ERROR,severity:p.ERROR});const m=(null===(n=k.selectedPaymentMethod)||void 0===n?void 0:n.type)===Q.SEZZLE;if(m){const t=this.hostEl.querySelector("justifi-sezzle-payment-method"),e=await(null==t?void 0:t.resolvePaymentMethod({isValid:h}));if("success"!==(null===(o=null==e?void 0:e.bnpl)||void 0===o?void 0:o.status))return k.isSubmitting=!1,void this.errorEvent.emit({message:(null===(r=null==e?void 0:e.error)||void 0===r?void 0:r.message)||"Sezzle checkout was not completed.",errorCode:y.TOKENIZE_ERROR,severity:p.ERROR})}if(!m&&!k.paymentToken)return k.isSubmitting=!1,void this.errorEvent.emit({message:"Payment token not found.",errorCode:y.TOKENIZE_ERROR,severity:p.ERROR});const v={payment_mode:(t=>{switch(t){case Q.NEW_CARD:case Q.SAVED_CARD:case Q.NEW_BANK_ACCOUNT:case Q.SAVED_BANK_ACCOUNT:case Q.PLAID:return W.ECOM;case Q.SEZZLE:return W.BNPL;case Q.APPLE_PAY:return W.APPLE_PAY;case Q.GOOGLE_PAY:return W.GOOGLE_PAY;case Q.PAYPAL:return W.PAYPAL;case Q.VENMO:return W.VENMO;default:return}})(null===(l=k.selectedPaymentMethod)||void 0===l?void 0:l.type),payment_token:m?void 0:k.paymentToken};if(this.preCompleteHook){const t=T();try{await new Promise(((e,i)=>{this.preCompleteHook(t,(()=>e()),(()=>i()))}))}catch(t){return k.isSubmitting=!1,void console.log("Checkout cancelled by preCompleteHook",t)}}this.completeCheckout({payment:v,onSuccess:({checkout:t})=>{k.isSubmitting=!1,this.submitEvent.emit({checkout:t,message:"Checkout completed successfully"})},onError:t=>{k.isSubmitting=!1,this.errorEvent.emit({message:t.message,errorCode:y.COMPLETE_CHECKOUT_ERROR,severity:p.ERROR})}})}render(){return i(s,{key:"127bf2aea6758c7d91e33f252a3db4bc27b066ff"})}get hostEl(){return a(this)}},rt=n();class lt{async createPaypalOrder(t,e,i,s){return rt.post({endpoint:`checkouts/${e}/paypal/orders`,body:{funding_source:i},authToken:t,signal:s})}}const ht="paypal-script",ct=["paypal-payments","venmo-payments"],dt="PAYMENT_FAILED",ut="shown",pt=(t,e)=>{t&&(e?t.classList.add(ut):t.classList.remove(ut))},yt=class{constructor(i){t(this,i),this.paypalStarted=e(this,"paypalStarted",7),this.paypalCompleted=e(this,"paypalCompleted",7),this.paypalCancelled=e(this,"paypalCancelled",7),this.paypalError=e(this,"paypalError",7),this.paypalService=new lt,this.paypalEligible=!1,this.venmoEligible=!1,this.startSession=async(t,e)=>{if(!t)return;this.pendingOrderId=void 0,this.paypalStarted.emit({fundingSource:e});let i=!1;const s=this.createOrder(e).then((t=>({orderId:t.provider_order_id}))).catch((t=>{throw i=!0,this.emitError((null==t?void 0:t.message)||"Could not create the Paypal order","ORDER_ERROR"),t}));s.catch((()=>{}));try{await t.start({presentationMode:"auto"},s)}catch(t){if(i)return;this.emitError((null==t?void 0:t.message)||"Paypal payment failed",dt)}}}componentDidLoad(){k.checkoutLoaded?this.initializePaypal():P("checkoutLoaded",(t=>{t&&this.initializePaypal()}))}componentDidRender(){this.applyVisibility()}get currencyCode(){return(k.paymentCurrency||"USD").toUpperCase()}get showPaypal(){return!!k.paypalEnabled&&this.paypalEligible}get showVenmo(){return!!k.paypalEnabled&&this.venmoEligible&&"USD"===this.currencyCode}applyVisibility(){const{showPaypal:t,showVenmo:e}=this;pt(this.buttonsEl,t||e),pt(this.paypalButtonEl,t),pt(this.venmoButtonEl,e)}emitError(t,e){this.paypalError.emit({error:t,code:e})}loadPaypalScript(){const t=window.paypal;return t?Promise.resolve(t):new Promise(((t,e)=>{let i=document.head.querySelector(`script[data-test-id="${ht}"]`);i||(i=document.createElement("script"),i.src="test"===k.checkoutMode?"https://www.sandbox.paypal.com/web-sdk/v6/core":"https://www.paypal.com/web-sdk/v6/core",i.async=!0,i.setAttribute("data-test-id",ht),document.head.appendChild(i)),i.addEventListener("load",(()=>{const i=window.paypal;i?t(i):e(new Error("Paypal script loaded but window.paypal is undefined"))})),i.addEventListener("error",(()=>e(new Error("Error loading Paypal script"))))}))}metadataId(){return Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15)}async initializePaypal(){const t=k.paypalProviderClientId;if(!t)return this.paypalEligible=!1,this.venmoEligible=!1,this.applyVisibility(),void this.emitError("Missing Paypal client id","CONFIG_ERROR");try{const e=await this.loadPaypalScript();this.sdkInstance=await e.createInstance({clientId:t,components:ct,pageType:"checkout",metadataId:this.metadataId()});const i=await this.sdkInstance.findEligibleMethods({currencyCode:this.currencyCode});this.paypalEligible=i.isEligible("paypal"),this.venmoEligible=i.isEligible("venmo"),this.paypalEligible&&(this.paypalSession=this.sdkInstance.createPayPalOneTimePaymentSession(this.sessionOptions("paypal"))),this.venmoEligible&&(this.venmoSession=this.sdkInstance.createVenmoOneTimePaymentSession(this.sessionOptions("venmo"))),this.applyVisibility()}catch(t){this.paypalEligible=!1,this.venmoEligible=!1,this.applyVisibility(),this.emitError((null==t?void 0:t.message)||"Error initializing Paypal","INITIALIZATION_ERROR")}}sessionOptions(t){return{onApprove:()=>this.paypalCompleted.emit({success:!0,paymentMethodId:this.pendingOrderId,fundingSource:t}),onCancel:()=>this.paypalCancelled.emit({fundingSource:t}),onError:t=>this.emitError((null==t?void 0:t.message)||"Paypal payment failed",dt)}}async createOrder(t){const e=await this.paypalService.createPaypalOrder(k.authToken,k.checkoutId,t);if(null==e?void 0:e.error)throw new Error(("string"==typeof e.error?e.error:e.error.message)||"Could not create the Paypal order");const i=null==e?void 0:e.data;if(!(null==i?void 0:i.provider_order_id))throw new Error("Paypal order is missing a provider order id");return this.pendingOrderId=i.id,i}render(){return i(M,{key:"05c771ae41d3b21da7046e70c7d0e03efc296a0c"},i("div",{key:"8e7a14372ce29b4da284efadb43c27d0c059607e",class:"paypal-buttons",ref:t=>this.buttonsEl=t},i("paypal-button",{key:"aa7fa82c96ca4d41872f445a01e72a18f6f5920a",type:"pay",ref:t=>this.paypalButtonEl=t,onClick:()=>this.startSession(this.paypalSession,"paypal")}),i("venmo-button",{key:"2cb068aa82460068548f133607cebec096028a41",type:"pay",ref:t=>this.venmoButtonEl=t,onClick:()=>this.startSession(this.venmoSession,"venmo")})),i("style",{key:"159cc68f682ed79a9a83be7d1b4c88127f8a2623"},"\n .paypal-buttons {\n display: none;\n gap: 8px;\n width: 100%;\n }\n .paypal-buttons.shown {\n display: flex;\n }\n .paypal-buttons > * {\n display: none;\n flex: 1 1 0;\n min-width: 0;\n }\n .paypal-buttons > .shown {\n display: block;\n }\n "))}},mt=class{constructor(i){t(this,i),this.paymentMethodOptionSelected=e(this,"paymentMethodOptionSelected",7),this.plaidError=e(this,"plaidError",7),this.plaidErrorRecovered=e(this,"plaidErrorRecovered",7),this.isAuthenticating=!1,this.publicToken=null,this.linkToken=null,this.linkTokenId=null,this.error=null,this.plaidLink=null,this.isSelected=!1,this.retryCount=0,this.isRetrying=!1,this.sdkLoaded=!1,this.plaidService=new V,this.maxRetries=3,this.retryDelay=2e3,this.timeoutId=null,this.abortController=null,this.hasLoggedDisabledWarning=!1,this.hasLoggedAchPaymentsDisabledWarning=!1,this.waitForStoreAndInitialize=()=>{k.authToken&&k.accountId&&k.checkoutId?this.initializePlaidLink():setTimeout((()=>{this.waitForStoreAndInitialize()}),100)},this.initializePlaidLink=async()=>{try{if(void 0===window.Plaid)return void this.handleError({code:b.PLAID_SDK_LOAD_FAILED,message:g[b.PLAID_SDK_LOAD_FAILED],severity:f[b.PLAID_SDK_LOAD_FAILED],retryable:!0,userAction:"Refresh the page and try again"});if(await this.getLinkToken(),!this.linkToken)return void this.handleError({code:b.PLAID_LINK_TOKEN_FAILED,message:g[b.PLAID_LINK_TOKEN_FAILED],severity:f[b.PLAID_LINK_TOKEN_FAILED],retryable:!0,userAction:"Click to try again"});const t=window.Plaid;this.plaidLink=t.create({token:this.linkToken,onSuccess:this.handlePlaidSuccess,onExit:this.handlePlaidExit,onEvent:this.handlePlaidEvent,onLoad:this.handlePlaidLoad})}catch(t){this.handleError({code:b.PLAID_LINK_INIT_FAILED,message:g[b.PLAID_LINK_INIT_FAILED],severity:f[b.PLAID_LINK_INIT_FAILED],originalError:t,retryable:!0,userAction:"Click to try again"})}},this.getLinkToken=async()=>{var t,e,i,s,a;try{if(!k.authToken||!k.accountId)return void this.handleError({code:b.PLAID_LINK_TOKEN_FAILED,message:"Missing authentication. Please refresh the page and try again.",severity:p.ERROR,retryable:!1,userAction:"Refresh the page"});this.abortController=new AbortController,this.timeoutId=setTimeout((()=>{var t;null===(t=this.abortController)||void 0===t||t.abort()}),3e4);const e=await this.plaidService.getLinkToken(k.authToken,k.accountId,k.checkoutId,this.abortController.signal);if(this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null),e.error)throw new Error("string"==typeof e.error?e.error:e.error.message||"Failed to get link token");this.linkToken=e.data.link_token,this.linkTokenId=(null==e?void 0:e.id)||(null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.id)||null,this.linkTokenId&&(k.plaidLinkTokenId=this.linkTokenId)}catch(t){this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null);let n=b.PLAID_LINK_TOKEN_FAILED,o=g[n],r=!0;"AbortError"===t.name?(n=b.PLAID_TIMEOUT,o=g[n],r=!0):(null===(e=t.message)||void 0===e?void 0:e.includes("network"))||(null===(i=t.message)||void 0===i?void 0:i.includes("fetch"))?(n=b.PLAID_NETWORK_ERROR,o=g[n],r=!0):((null===(s=t.message)||void 0===s?void 0:s.includes("401"))||(null===(a=t.message)||void 0===a?void 0:a.includes("unauthorized")))&&(n=b.PLAID_INVALID_CREDENTIALS,o="Authentication failed. Please refresh the page and try again.",r=!1),this.handleError({code:n,message:o,severity:f[n],originalError:t,retryable:r,userAction:r?"Click to try again":"Refresh the page"})}},this.mapApiErrorToPlaidError=t=>{if("string"==typeof t){if(t.includes("rate_limit"))return b.PLAID_RATE_LIMITED;if(t.includes("maintenance"))return b.PLAID_MAINTENANCE;if(t.includes("not_authenticated"))return b.PLAID_INVALID_CREDENTIALS}if(null==t?void 0:t.code)switch(t.code){case"rate_limited":return b.PLAID_RATE_LIMITED;case"maintenance":return b.PLAID_MAINTENANCE;case"not_authenticated":return b.PLAID_INVALID_CREDENTIALS;default:return b.PLAID_LINK_TOKEN_FAILED}return b.PLAID_LINK_TOKEN_FAILED},this.openPlaidLink=()=>{this.plaidLink&&this.linkToken&&(this.isAuthenticating=!0,this.clearError(),this.plaidLink.open())},this.handlePlaidSuccess=t=>{this.publicToken=t,this.isAuthenticating=!1,this.clearError(),this.retryCount=0,this.isSelected||(this.isSelected=!0,k.selectedPaymentMethod={type:Q.PLAID}),this.plaidErrorRecovered.emit({code:"plaid-success",message:"Bank account connected successfully",severity:p.INFO}),k.plaidPublicToken=t},this.handlePlaidExit=t=>{this.isAuthenticating=!1,t&&this.handlePlaidError(t)},this.handlePlaidEvent=(t,e)=>{switch(t){case"OPEN":this.isAuthenticating=!0;break;case"CLOSE":this.isAuthenticating=!1;break;case"ERROR":this.handlePlaidError(e)}},this.handlePlaidLoad=()=>{},this.handlePlaidError=t=>{let e=b.PLAID_AUTHENTICATION_FAILED,i=g[e],s=!0,a="Click to try again";if(t.error_code)switch(t.error_code){case"INVALID_CREDENTIALS":e=b.PLAID_INVALID_CREDENTIALS,i=g[e],s=!0;break;case"ITEM_LOGIN_REQUIRED":e=b.PLAID_INVALID_CREDENTIALS,i="Your bank requires re-authentication. Please try again.",s=!0;break;case"ITEM_LOCKED":e=b.PLAID_ACCOUNT_LOCKED,i=g[e],s=!1,a="Contact your bank";break;case"INSTITUTION_NOT_RESPONDING":e=b.PLAID_MAINTENANCE,i=g[e],s=!0;break;case"RATE_LIMIT_EXCEEDED":e=b.PLAID_RATE_LIMITED,i=g[e],s=!0;break;case"INVALID_REQUEST":e=b.PLAID_AUTHENTICATION_FAILED,i="Invalid request. Please try again.",s=!0;break;case"PLAID_ERROR":e=b.PLAID_AUTHENTICATION_FAILED,i=t.error_message||"Bank authentication failed. Please try again.",s=!0;break;default:t.error_message&&(i=t.error_message)}if(t.error_message){const n=t.error_message.toLowerCase();n.includes("not supported")||n.includes("unsupported")?(e=b.PLAID_BANK_NOT_SUPPORTED,i=g[e],s=!1,a="Try a different payment method"):(n.includes("expired")||n.includes("timeout"))&&(e=b.PLAID_TOKEN_EXPIRED,i=g[e],s=!0)}this.handleError({code:e,message:i,severity:f[e],originalError:t,retryable:s,userAction:a}),this.isAuthenticating=!1},this.handleError=t=>{this.error=t,this.plaidError.emit({code:t.code,message:t.message,severity:t.severity,data:{originalError:t.originalError,retryable:t.retryable,userAction:t.userAction,retryCount:this.retryCount}}),console.error("Plaid error:",t),t.retryable&&this.retryCount<this.maxRetries&&this.scheduleRetry()},this.scheduleRetry=()=>{this.isRetrying||(this.isRetrying=!0,this.retryCount++,setTimeout((()=>{this.isRetrying=!1,this.clearError(),this.waitForStoreAndInitialize()}),this.retryDelay*this.retryCount))},this.clearError=()=>{this.error&&(this.error=null,this.retryCount=0)},this.syncWithStore=()=>{var t;const e=(null===(t=k.selectedPaymentMethod)||void 0===t?void 0:t.type)===Q.PLAID;this.isSelected!==e&&(this.isSelected=e)}}onSelectionChange(t){var e;t&&(null===(e=k.selectedPaymentMethod)||void 0===e?void 0:e.type)!==Q.PLAID&&(k.selectedPaymentMethod={type:Q.PLAID}),!t||!this.plaidLink||this.publicToken||this.isAuthenticating||this.error||this.openPlaidLink()}componentWillLoad(){var t;this.isSelected=(null===(t=k.selectedPaymentMethod)||void 0===t?void 0:t.type)===Q.PLAID,!0===k.bankAccountVerification&&(k.checkoutLoaded?k.achPaymentsEnabled&&this.loadPlaidSDK():P("checkoutLoaded",(t=>{t&&!0===k.bankAccountVerification&&k.achPaymentsEnabled&&this.loadPlaidSDK()})))}loadPlaidSDK(){if(this.sdkLoaded)return;this.sdkLoaded=!0;const t=document.createElement("script");t.src="https://cdn.plaid.com/link/v2/stable/link-initialize.js",t.async=!0,t.onload=()=>this.initializePlaidLink(),t.onerror=()=>{this.handleError({code:b.PLAID_SDK_LOAD_FAILED,message:g[b.PLAID_SDK_LOAD_FAILED],severity:f[b.PLAID_SDK_LOAD_FAILED],retryable:!0,userAction:"Refresh the page and try again"})},document.head.appendChild(t)}async resolvePaymentMethod(){return this.publicToken?{token:this.publicToken,data:{type:"bank_account",plaid_public_token:this.publicToken}}:{validationError:!0}}async getPaymentToken(){return k.paymentToken}async handleSelectionClick(){if(this.isSelected=!0,k.selectedPaymentMethod={type:Q.PLAID},this.error)return this.clearError(),void this.waitForStoreAndInitialize();!this.plaidLink||this.publicToken||this.isAuthenticating||this.openPlaidLink()}async setSelected(t){this.isSelected=t,t&&(k.selectedPaymentMethod={type:Q.PLAID})}async isCurrentlySelected(){return this.isSelected}async deselect(){this.isSelected=!1}async reset(){this.publicToken=null,this.clearError(),this.isAuthenticating=!1,this.linkToken=null,this.plaidLink=null,this.retryCount=0,this.isRetrying=!1,this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null),this.abortController&&(this.abortController.abort(),this.abortController=null)}async isReadyForAuthentication(){return!(!this.plaidLink||!this.linkToken||this.isAuthenticating)}async retry(){this.error&&this.error.retryable&&(this.clearError(),this.waitForStoreAndInitialize())}async getErrorInfo(){return this.error}componentDidLoad(){const t=P("selectedPaymentMethod",this.syncWithStore);this.unsubscribeFromStore=t}disconnectedCallback(){this.unsubscribeFromStore&&this.unsubscribeFromStore(),this.timeoutId&&clearTimeout(this.timeoutId),this.abortController&&this.abortController.abort()}render(){if(k.checkoutLoaded&&!k.achPaymentsEnabled)return this.hasLoggedAchPaymentsDisabledWarning||(console.warn("[JustifiPlaidPaymentMethod] ACH payments are disabled for this checkout. Component will not render."),this.hasLoggedAchPaymentsDisabledWarning=!0),null;if(!0!==k.bankAccountVerification)return this.hasLoggedDisabledWarning||(console.warn("[JustifiPlaidPaymentMethod] bank_account_verification is disabled. Component will not render."),this.hasLoggedDisabledWarning=!0),null;const t=i("img",{class:"plaid-logo-img",src:"data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ4IiB2aWV3Qm94PSIwIDAgMjggMjkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgY2xhc3M9ImNzcy0xcmRhajhtIj48ZyBmaWxsPSIjMTExIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPjxwYXRoIGQ9Ik0yNS43NjI5IDI2LjI2MjhMMjggMTcuNTMwOUwyNC45NjkxIDE0LjUwMDFMMjcuOTk5OSAxMS40NjkxTDI1Ljc2MjggMi43MzcwNkwxNy4wMzA5IDAuNUwxNC4wMDAxIDMuNTMxTDEwLjk2OSAwLjUwMDE0TDIuMjM3MDYgMi43MzczNEwwIDExLjQ2OTFMMy4wMzEyOCAxNC40OTk5TDAuMDAwMTQgMTcuNTMxTDIuMjM3MiAyNi4yNjI5TDEwLjk2OTEgMjguNUwxNC4wMDAxIDI1LjQ2OUwxNy4wMzEgMjguNDk5OUwyNS43NjI5IDI2LjI2MjhaTTE1LjczMjEgMjMuNzM3MUwxOC42MTg2IDIwLjg1MDVMMjIuMjkxMiAyNC41MjMzTDE3LjY5NTYgMjUuNzAwN0wxNS43MzIxIDIzLjczNzFaTTExLjExMzYgOS44ODE1NEwxNC4wMDAzIDYuOTk1MDJMMTYuODg2OCA5Ljg4MTRMMTQuMDAwMSAxMi43Njc5TDExLjExMzYgOS44ODE1NFpNMTIuMjY4MiAxNC41TDkuMzgxNTQgMTcuMzg2NUw2LjQ5NTAyIDE0LjVMOS4zODE1NCAxMS42MTM1TDEyLjI2ODIgMTQuNVpNMTguNjE4NyAxMS42MTMzTDIxLjUwNTMgMTQuNUwxOC42MTg2IDE3LjM4NjVMMTUuNzMyMSAxNC41TDE4LjYxODcgMTEuNjEzM1pNMTYuODg2NyAxOS4xMTg2TDE0LjAwMDEgMjIuMDA1MUwxMS4xMTM1IDE5LjExODVMMTQuMDAwMSAxNi4yMzE5TDE2Ljg4NjcgMTkuMTE4NlpNMTAuMzA0NCAyNS43MDA3TDUuNzA4NjQgMjQuNTIzM0w5LjM4MTU0IDIwLjg1MDRMMTIuMjY4MiAyMy43MzcxTDEwLjMwNDQgMjUuNzAwN1pNNC43NjMwOCAxNi4yMzE5TDcuNjQ5NiAxOS4xMTg1TDMuOTc2NyAyMi43OTE0TDIuNzk5MyAxOC4xOTU3TDQuNzYzMDggMTYuMjMxOVpNMy45NzY3IDYuMjA4MzZMNy42NDk3NCA5Ljg4MTRMNC43NjMwOCAxMi43NjgxTDIuNzk5MyAxMC44MDQxTDMuOTc2NyA2LjIwODM2Wk0xMi4yNjgzIDUuMjYyOTRMOS4zODE2OCA4LjE0OTZMNS43MDg5MiA0LjQ3NjdMMTAuMzA0NyAzLjI5OTNMMTIuMjY4MyA1LjI2Mjk0Wk0xNy42OTU5IDMuMjk5M0wyMi4yOTE1IDQuNDc2N0wxOC42MTg2IDguMTQ5NDZMMTUuNzMyMSA1LjI2Mjk0TDE3LjY5NTkgMy4yOTkzWk0yMy4yMzcyIDEyLjc2ODFMMjAuMzUwNSA5Ljg4MTRMMjQuMDIzMyA2LjIwODc4TDI1LjIwMDcgMTAuODA0NkwyMy4yMzcyIDEyLjc2ODFaTTI0LjAyMzMgMjIuNzkxNEwyMC4zNTA1IDE5LjExODZMMjMuMjM3MiAxNi4yMzIxTDI1LjIwMDcgMTguMTk1N0wyNC4wMjMzIDIyLjc5MTRaIj48L3BhdGg+PC9nPjwvc3ZnPgo=",alt:"Plaid",title:"Plaid",style:{display:"inline",width:"20px",height:"20px",marginLeft:"5px",marginTop:"-2px"}});return i(M,{class:"payment-method"},i("div",{title:"Pay with Plaid"},i("div",{onClick:t=>{t.preventDefault(),this.handleSelectionClick()}},"Pay with Bank Account ",t," "),(()=>this.error?i("div",{class:(this.error.severity===p.ERROR?"text-danger":this.error.severity===p.WARNING?"text-warning":"text-info")+" mt-2"},i("small",null,this.error.message),i("br",null),i("small",{class:"text-muted"},this.error.userAction,this.error.retryable&&this.retryCount<this.maxRetries&&i("span",null," • Auto-retry in progress..."))):null)(),(()=>this.error?null:this.isAuthenticating?i("div",{class:"text-info mt-2"},i("small",null,"Connecting to your bank...")):this.publicToken?i("div",{class:"text-success mt-2"},i("small",null,"✓ Bank account connected successfully")):!this.isSelected||this.publicToken||this.error||this.isAuthenticating?null:i("div",{class:"text-muted mt-2"},i("small",null,"Click to connect your bank account")))()))}static get watchers(){return{isSelected:["onSelectionChange"]}}},vt=class{constructor(e){t(this,e),this.onPaymentMethodOptionClick=t=>e=>{e.preventDefault(),k.selectedPaymentMethod={id:t.id,type:t.type},k.paymentToken=t.id},this.isAllowedPaymentMethod=t=>!(t===Q.SAVED_CARD&&k.disableCreditCard||t===Q.SAVED_BANK_ACCOUNT&&k.disableBankAccount)}componentWillLoad(){k.checkoutLoaded&&(k.paymentMethods.length||console.warn("No saved payment methods available."),k.disablePaymentMethodGroup&&console.warn("Payment method group is disabled."))}render(){return k.disablePaymentMethodGroup?null:i(M,null,i("div",{class:"saved-payment-methods"},k.paymentMethods.length?k.paymentMethods.filter((t=>this.isAllowedPaymentMethod(t.type))).map((t=>i("div",{class:"radio-list-item p-3",part:E,onClick:this.onPaymentMethodOptionClick(t)},i("form-control-radio",{name:"paymentMethodType",value:null==t?void 0:t.id,checked:k.paymentToken===(null==t?void 0:t.id),label:`${G[null==t?void 0:t.brand]||""} *${null==t?void 0:t.acct_last_four}`})))):null))}},ft=class{constructor(i){t(this,i),this.paymentMethodOptionSelected=e(this,"paymentMethodOptionSelected",7),this.paymentMethodOptionId=Q.SEZZLE,this.initializeSezzleCheckout=()=>{const t=Number(k.paymentAmount),e=new(0,window.Checkout)({mode:"popup",publicKey:k.bnplProviderClientId,apiMode:k.bnplProviderMode,apiVersion:k.bnplProviderApiVersion});e.sezzleButtonElement=this.sezzleButtonRef,e.init({onClick:function(t){t.preventDefault(),e.startCheckout({checkout_url:k.bnplProviderCheckoutUrl})},onComplete:t=>{var e;return null===(e=this.resolveSezzlePromise)||void 0===e?void 0:e.call(this,{bnpl:t.data})},onCancel:t=>{var e;return null===(e=this.resolveSezzlePromise)||void 0===e?void 0:e.call(this,{bnpl:t.data})},onFailure:t=>{var e;return null===(e=this.resolveSezzlePromise)||void 0===e?void 0:e.call(this,{bnpl:t.data})}}),this.sezzleCheckout=e,this.installmentPlan=this.sezzleCheckout.getInstallmentPlan(t)}}componentDidRender(){this.scriptRef&&(this.scriptRef.onload=()=>{this.sezzleButtonRef=document.createElement("button"),this.initializeSezzleCheckout()})}async resolvePaymentMethod(t){if(!t.isValid)return{validationError:!0};if(!this.sezzleButtonRef)return{error:{code:"sezzle_not_ready",message:"Sezzle is not ready yet. Please try again.",decline_code:""}};const e=new Promise((t=>{this.resolveSezzlePromise=t}));return this.sezzleButtonRef.click(),e}async handleSelectionClick(){k.selectedPaymentMethod={type:Q.SEZZLE},this.paymentMethodOptionSelected.emit(this.paymentMethodOptionId)}render(){var t,e;return k.bnplEnabled?i(M,{class:"payment-method"},i("script",{src:"https://checkout-sdk.sezzle.com/checkout.min.js",async:!0,ref:t=>this.scriptRef=t}),i("div",null,i("div",null,"Buy now, pay later with ",i("img",{class:"sezzle-smart-button-logo-img",src:"https://media.sezzle.com/branding/2.0/Sezzle_Logo_FullColor.svg",alt:"Sezzle",style:{display:"inline",width:"80px",marginLeft:"5px",marginTop:"-5px"}})),this.installmentPlan&&i("small",null,i("span",null,null===(t=this.installmentPlan)||void 0===t?void 0:t.installments.length)," ",i("span",null,this.installmentPlan.schedule," payments of")," ",i("span",{class:"fw-bold"},I(null===(e=this.installmentPlan)||void 0===e?void 0:e.installments[0].amountInCents))))):(console.warn("justifi-sezzle-payment-method: BNPL is not enabled for this account."),null)}},gt={[Q.NEW_BANK_ACCOUNT]:"New bank account",[Q.NEW_CARD]:"New credit or debit card"},bt="Payment form not ready",Mt="Validation error",wt=class{constructor(i){t(this,i),this.errorEvent=e(this,"error-event",7),this.submitEvent=e(this,"submit-event",7),this.computedHideSubmitButton=!1,this.isLoading=!1,this.submitButtonText="Submit"}paymentMethodsChanged(){this.setDefaultSelectedPaymentMethod()}connectedCallback(){this.setDefaultSelectedPaymentMethod(),this.setComputedHideSubmitButton()}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup(),this.unsubscribeFromStore&&this.unsubscribeFromStore()}componentWillLoad(){U(),this.analytics=new R(this)}handleRadioClick(t){this.selectedPaymentMethod=t.detail,k.selectedPaymentMethod={type:t.detail}}async tokenizePaymentMethod(t){null==t||t.preventDefault(),this.validateRequiredProps(),this.isLoading=!0;try{if(!(await this.validate()).isValid)return this.errorEvent.emit({errorCode:y.TOKENIZE_ERROR,message:Mt}),void(this.isLoading=!1);const t=await this.resolvePaymentMethod({isValid:!0});return t.error&&this.emitError({errorCode:t.error.code,message:t.error.message}),this.submitEvent.emit({response:t}),t}catch(t){const e=this.createErrorResponse(y.TOKENIZE_ERROR,t.message);return this.emitError({errorCode:y.TOKENIZE_ERROR,message:t.message}),this.submitEvent.emit({response:e}),e}finally{this.isLoading=!1}}async fillBillingForm(t){k.billingFormFields=t}async validate(){if(!this.areFormsReady())return{isValid:!1,errors:{general:bt}};const[t,e]=await Promise.all([this.billingFormRef.validate(),this.paymentMethodFormRef.validate()]);return{isValid:t.isValid&&e.isValid,errors:Object.assign(Object.assign({},t.errors),e.errors)}}async getValues(){return this.billingFormRef.getValues()}async tokenize(){try{const t=await this.billingFormRef.getValues(),e={clientId:this.authToken||k.authToken,account:this.accountId||k.accountId,paymentMethodMetadata:this.buildPaymentMethodMetadata(t)};return await this.paymentMethodFormRef.tokenize(e)}catch(t){return t}}validateRequiredProps(){this.authToken||k.authToken||this.emitError({errorCode:y.TOKENIZE_ERROR,message:"Auth token is required when using the tokenize-payment-method component not slotted in justifi-modular-checkout"}),this.accountId||k.accountId||this.emitError({errorCode:y.TOKENIZE_ERROR,message:"Account ID is required when using the tokenize-payment-method component not slotted in justifi-modular-checkout"})}setDefaultSelectedPaymentMethod(){this.selectedPaymentMethod||(this.disableCreditCard?this.disableBankAccount||k.checkoutLoaded&&!k.achPaymentsEnabled||(this.selectedPaymentMethod=Q.NEW_BANK_ACCOUNT,k.selectedPaymentMethod={type:Q.NEW_BANK_ACCOUNT}):(this.selectedPaymentMethod=Q.NEW_CARD,k.selectedPaymentMethod={type:Q.NEW_CARD}))}setComputedHideSubmitButton(){if(void 0!==this.hideSubmitButton)return void(this.computedHideSubmitButton=this.hideSubmitButton);const t=this.isSlottedWithinModularCheckout();this.computedHideSubmitButton=t}isSlottedWithinModularCheckout(){var t;let e=null===(t=this.host)||void 0===t?void 0:t.parentElement;for(;e;){if("JUSTIFI-MODULAR-CHECKOUT"===e.tagName)return!0;e=e.parentElement}return!1}get availablePaymentMethods(){const t=[],e=!k.checkoutLoaded||k.achPaymentsEnabled;return this.disableCreditCard||t.push(Q.NEW_CARD),!this.disableBankAccount&&e&&t.push(Q.NEW_BANK_ACCOUNT),t}areFormsReady(){return!(!this.billingFormRef||!this.paymentMethodFormRef)}emitError(t){this.errorEvent.emit(Object.assign(Object.assign({},t),{severity:p.ERROR}))}createErrorResponse(t,e){return{error:{code:t,message:e,decline_code:void 0}}}async resolvePaymentMethod(t){if(!this.areFormsReady())return this.createErrorResponse("form_not_ready",bt);try{const e=await this.validate();if(!e.isValid||!t.isValid){const t=Object.values(e.errors)[0]||Mt;return{validationError:!0,error:{code:"validation_error",message:String(t),decline_code:void 0}}}return await this.performTokenization()}catch(t){return{error:t}}}async performTokenization(){var t,e;const i=await this.tokenize();if(i.error)return{error:i.error};const s=i.data;return{token:(null===(t=s.card)||void 0===t?void 0:t.token)||(null===(e=s.bank_account)||void 0===e?void 0:e.token),data:s}}buildPaymentMethodMetadata(t){return this.shouldSavePaymentMethod?Object.assign(Object.assign({},t),{payment_method_group_id:this.paymentMethodGroupID}):Object.assign({},t)}get paymentMethodGroupID(){return this.paymentMethodGroupId||k.paymentMethodGroupId}get shouldSavePaymentMethod(){return!(!this.paymentMethodGroupId&&!k.savePaymentMethod)}get shouldHideRadioInput(){return this.disableCreditCard||this.disableBankAccount}renderPaymentMethodOption(t){const e=this.selectedPaymentMethod===t&&void 0===k.selectedPaymentMethod.id;return i("div",{class:"payment-method"},i("radio-list-item",{name:"paymentMethodType",value:t,checked:e,label:gt[t],hidden:this.shouldHideRadioInput}),e&&this.renderSelectedPaymentMethodForm(t))}renderSelectedPaymentMethodForm(t){return i("div",{class:"mt-4 pb-4"},this.renderPaymentMethodForm(t),i("div",{class:"mt-4"},i("billing-form",{ref:t=>{t&&(this.billingFormRef=t)},hideCardBillingForm:this.hideCardBillingForm,hideBankAccountBillingForm:this.hideBankAccountBillingForm,paymentMethodType:t})),i("div",{class:"mt-4"},i("save-new-payment-method",{hidden:!this.paymentMethodGroupID,label:this.savePaymentMethodLabel})))}renderPaymentMethodForm(t){return i(t===Q.NEW_CARD?"card-form":"bank-account-form",{ref:t=>{t&&(this.paymentMethodFormRef=t)}})}render(){return i(M,{key:"16a5a47febb09295c95f141ddc96a849e530c477"},i("form",{key:"e1ac3ac80435b32cb0a742198d814778bffd635c"},i("fieldset",{key:"68d0f984d3e66a6abc794e8b2086e27f26ecc809"},i("div",{key:"b1759ec1b9c94a976da992947b06da6d8f48f553",class:"row gy-3"},i("div",{key:"bc1ef82406d3da36c5d4d97b1a10259de87fdd09",class:"col-12"},this.availablePaymentMethods.map((t=>this.renderPaymentMethodOption(t)))),i("div",{key:"ed26f2908aa90daba5ab320a668369566b9dacfa",class:"col-12"},i("internal-button",{key:"094cdacb592825374ad33dd80a05091747bfec4b",text:this.submitButtonText,variant:"primary",type:"submit",clickHandler:t=>this.tokenizePaymentMethod(t),isLoading:this.isLoading,"data-testid":"submit-button",hidden:this.computedHideSubmitButton}))))))}get host(){return a(this)}static get watchers(){return{disableCreditCard:["paymentMethodsChanged"],disableBankAccount:["paymentMethodsChanged"]}}};export{X as justifi_apple_pay,tt as justifi_button,et as justifi_checkout_summary,at as justifi_google_pay,nt as justifi_header,ot as justifi_modular_checkout,yt as justifi_paypal,mt as justifi_plaid_payment_method,Z as justifi_radio_list_item,vt as justifi_saved_payment_methods,ft as justifi_sezzle_payment_method,wt as justifi_tokenize_payment_method}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,c as t,h as s}from"./p-CV0Pyo1O.js";import{f as i}from"./p-Ds_P-dB8.js";import{t as a,a8 as d}from"./p-Bu7gdOaV.js";import{B as r}from"./p-CU2Dwa94.js";import{S as c}from"./p-eBK-iWrz.js";import"./p-CZfYo5-1.js";import{C as o,b as n}from"./p-D6uhYbLo.js";import{g as h,a as p}from"./p-CLq3Og7o.js";import{D as l,a as f}from"./p-Ba0_MQtJ.js";import{c as u}from"./p-ByQMBEDC.js";import{J as b}from"./p-BHaO3c8W.js";import"./p-HXpYMWUU.js";import"./p-Bl00tHyn.js";import"./p-B4vLfYnZ.js";import"./p-DgTOxu8x.js";import"./p-Dn9_7aQh.js";import"./p-CLHwhyvu.js";import"./p-DaDqgDrb.js";const y=({authToken:e,disputeId:t,service:s})=>async({payload:i,onSuccess:a,onError:d,final:r=()=>{}})=>{var c;try{const r=await s.submitDisputeResponse(t,e,i);if(r.error){return d({error:p(r.error),code:h(null===(c=r.error)||void 0===c?void 0:c.code),severity:o.ERROR})}a(r)}catch(e){const t=h(null==e?void 0:e.code);return d({error:e.message||e,code:t,severity:o.ERROR})}finally{r()}},v=class{constructor(s){e(this,s),this.clickEvent=t(this,"click-event",7),this.errorEvent=t(this,"error-event",7),this.submitEvent=t(this,"submit-event",7)}acceptDispute(){y({disputeId:this.dispute.id,authToken:this.authToken,service:new f})({payload:{forfeit:!0},onSuccess:e=>{this.submitEvent.emit({response:e})},onError:({error:e,code:t,severity:s})=>{this.errorEvent.emit({errorCode:t,message:e,severity:s})}})}initiateRespondToDispute(){this.clickEvent.emit({name:l.respondToDispute})}isDueDatePassed(){var e;if(!(null===(e=this.dispute)||void 0===e?void 0:e.due_date))return!1;const t=new Date(this.dispute.due_date.replace(/-/g,"/").replace(/T.+/,"")),s=new Date;return s.setHours(0,0,0,0),t.setHours(0,0,0,0),t<s}render(){var e,t,o,n,h,p,l,f,u;return s("div",{key:"0f4474fa70e6ab3895132b703ab5a3b7f810554a",class:"dispute-notification-root"},this.isLoading&&s("div",{key:"1bd7b07c15e6a88be6215dbca5e41cbcfc6e6e68",style:{marginBottom:"8px"}},s(c,{key:"a4436ec5cc58b0cccdcdc9ae3d25293fdfaeac40",height:"28px",width:"70%",styles:{marginBottom:"16px"}}),s(c,{key:"cda7ba45ed518e762239864b766f65da8488e713",height:"18px",styles:{marginBottom:"8px"}}),s(c,{key:"a0acf3c7c0ae988f8580bfbd8b2ff2b5c349fddb",height:"18px",styles:{marginBottom:"8px"}})),(null===(e=this.dispute)||void 0===e?void 0:e.needsResponse)&&this.isDueDatePassed()&&s("div",{key:"2fd8a28d4c3eefc4a1a881d3bc47422428d4f016",part:a},s("h1",{key:"243ca1a43064800b65fb27e259598ff85746e55b",class:"h4",part:d},"The due date (",null===(t=this.dispute)||void 0===t?void 0:t.due_date,") for this dispute has passed"),s("p",{key:"617f7b87510fee1d64ad121cf15f1ba193f6826c"},"You can no longer submit evidence to counter this dispute.")),(null===(o=this.dispute)||void 0===o?void 0:o.needsResponse)&&!this.isDueDatePassed()&&s("div",{key:"d9ad4c30643e0991c7327a800d8015aa49d227ff",part:a},s("h1",{key:"c6e2b6a4a012ad2ce3d371ac765359f0db018166",class:"h4",part:d},"This payment is disputed"),s("p",{key:"491ca4d83029e8aec16ee745cd3eb78854298d19"},"The cardholder is disputing this payment. You may accept this dispute, or proceed to provide evidence in a counter dispute."),s("h2",{key:"3fd51e33e3440d6fda3fb6f2aa3f83cd783255fc",class:"h5"},"Dispute details"),s("div",{key:"edb7c85ffccd4a1af64cdb61a702ce39c86987a9",class:"d-table gap-2"},s("div",{key:"8d611ad34fa2a40d52f175c6874228254d235bf6",class:"d-table-row gap-2"},s("span",{key:"db4c9c3379b475ddb4c966336a1a9905f286335a",part:"detail-section-item-title",class:"fw-bold d-table-cell pe-4"},"Amount"),s("span",{key:"9c61d28bc602dd3cdeaa0e99923c58fb20fb95bc",part:"detail-section-item-data",class:"flex-1 d-table-cell text-wrap"},i(null===(n=this.dispute)||void 0===n?void 0:n.amount))),s("div",{key:"d7a84cd67c59bfdc2c63b7e847b82d423d3277a4",class:"d-table-row gap-2"},s("span",{key:"e98e2a8a8593b3358ecf6d5b857d2f3cffae1ef5",part:"detail-section-item-title",class:"fw-bold d-table-cell pe-4"},"Reason"),s("span",{key:"61f843068e6bf04d8bab69cefeb148e9b6792a5f",part:"detail-section-item-data",class:"flex-1 d-table-cell text-wrap"},null===(h=this.dispute)||void 0===h?void 0:h.reason)),s("div",{key:"795fd5d907eb2e1456c737a201517dbe5434ea84",class:"d-table-row gap-2"},s("span",{key:"1dae1ba0dd7323756988c8f6d65be1fdf3c155e6",part:"detail-section-item-title",class:"fw-bold d-table-cell pe-4"},"Due Date"),s("span",{key:"b44ff4fcfd0beb70af6468a216eee0489c566a79",part:"detail-section-item-data",class:"flex-1 d-table-cell text-wrap"},null===(p=this.dispute)||void 0===p?void 0:p.due_date))),s("div",{key:"f7e1ac7543ca231cc7904654bfb9fcb3e3f31dc1",class:"d-flex gap-2 mt-4 justify-content-end"},s(r,{key:"35dfa1f4e0a7f02496751dc332a4c52b542fe538",variant:"secondary",onClick:()=>this.acceptDispute()},"Accept dispute"),s(r,{key:"0519e6959a2407315d600384121b6ad466de79eb",variant:"primary",onClick:()=>this.initiateRespondToDispute()},"Counter dispute"))),(null===(l=this.dispute)||void 0===l?void 0:l.underReview)&&s("div",{key:"600db9506bed0de6efc3d0367fb5df63273bba14",part:a},s("h1",{key:"139a034878c8433edb1b936440c1b71d9d1022b2",class:"h4",part:d},"This payment is disputed and under review"),s("p",{key:"bd9b3d46e57ec998e5e1a5bc465d981129fc1fd2"},"The cardholder is disputing this payment. A counter dispute has been submitted and is under review.")),(null===(f=this.dispute)||void 0===f?void 0:f.won)&&s("div",{key:"c03393474cea2a44b864eba0f9e36b1fe63eb256",part:a},s("h1",{key:"3c19db3b8aefd25a363d4cd183eaaa2487d33f8c",class:"h4",part:d},"This payment was disputed"),s("p",{key:"45d95070b59c3a0da28bc5cda5356c2aa171d974"},"The cardholder disputed this payment and the card issuer has settled it in your favor.")),(null===(u=this.dispute)||void 0===u?void 0:u.lost)&&s("div",{key:"a8727df139e8d1eff3e67bc13359534281ceb795",part:a},s("h1",{key:"bb533bb65c20722002bda966782fcc4d165a139e",class:"h4",part:d},"This payment was disputed"),s("p",{key:"5901b10090d20523de1f96630ce7a9b71d9fdcac"},"The cardholder disputed this payment and the card issuer has settled it in their favor.")))}},m=class{constructor(i){e(this,i),this.clickEvent=t(this,"click-event",7),this.errorEvent=t(this,"error-event",7),this.stepCompleteEvent=t(this,"complete-form-step-event",7),this.submitEvent=t(this,"submit-event",7),this.errorMessage=null,this.disputeResponse={},this.apiOrigin="https://wc-proxy.justifi.ai",this.isLoading=!1,this.documentList=[],this.documentErrors={},this.currentStep=0,this.componentStepMapping=[()=>s("product-or-service",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("customer-details",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("cancellation-policy",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("refund-policy",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("duplicate-charge",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("electronic-evidence",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("shipping-details",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("additional-statement",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors})],this.saveData=async(e,t)=>{if(Object.keys(e).length)return this.isLastStep?this.submitDisputeResponse({payload:e,onSuccess:e=>{this.submitEvent.emit({response:e}),this.stepCompleteEvent.emit({response:e,formStep:t})},onError:({error:e,code:t,severity:s})=>{this.errorEvent.emit({errorCode:t,message:e,severity:s})}}):this.updateDisputeResponse({payload:e,onSuccess:e=>{this.disputeResponse=Object.assign({},e.data),this.stepCompleteEvent.emit({response:e,formStep:t})},onError:({error:e,code:t,severity:s})=>{this.errorEvent.emit({errorCode:t,message:e,severity:s})}});this.stepCompleteEvent.emit({response:null,formStep:t})},this.initializeMakePresignedURLs=async()=>{const e=this.documentList.map((e=>this.getPresignedFileUrl(e)));return await Promise.all(e)},this.initializeFileUploads=async()=>{const e=this.documentList.map((e=>this.uploadDocument(e)));return Promise.all(e)},this.getPresignedFileUrl=async e=>this.createDisputeEvidence({payload:{file_name:e.file_name,file_type:e.file_type,dispute_evidence_type:e.dispute_evidence_type},onSuccess:t=>{e.presignedUrl=t.data.presigned_url},onError:({error:t,code:s,severity:i})=>{const a={[e.dispute_evidence_type]:t};this.documentErrors=Object.assign(Object.assign({},this.documentErrors),a),this.errorEvent.emit({errorCode:s,message:t,severity:i})}}),this.uploadDocument=async e=>{const t=await e.getFileString();if(!e.presignedUrl)throw new Error("Presigned URL is not set");return await fetch(e.presignedUrl,{method:"PUT",body:t})},this.handleSubmit=async(e,t,s)=>{if(this.isLoading=!0,t.length){if(this.documentErrors={},this.documentList=t,await this.initializeMakePresignedURLs(),Object.keys(this.documentErrors).length)throw this.isLoading=!1,new Error("Could not presign all documents");await this.initializeFileUploads()}await this.saveData(e,s),this.isLoading=!1},this.onCancel=()=>{this.clickEvent.emit({name:l.cancelDispute})},this.onBack=async()=>{await this.currentStepComponentRef.validateAndSubmit((async(e,t,s)=>{this.clickEvent.emit({name:l.previousStep}),await this.handleSubmit(e,t,s),this.currentStep--}))},this.onNext=async()=>{await this.currentStepComponentRef.validateAndSubmit((async(e,t,s)=>{this.clickEvent.emit({name:l.nextStep}),await this.handleSubmit(e,t,s),this.currentStep++}))},this.onSubmit=async()=>{await this.currentStepComponentRef.validateAndSubmit((async(e,t,s)=>{this.clickEvent.emit({name:l.submit});const i=Object.assign(Object.assign({},e),{forfeit:!1});await this.handleSubmit(i,t,s)}))}}componentWillLoad(){u(),this.analytics=new b(this),this.initializeDisputeServiceMethods()}disconnectedCallback(){var e;null===(e=this.analytics)||void 0===e||e.cleanup()}propChanged(){this.initializeDisputeServiceMethods()}initializeDisputeServiceMethods(){this.disputeId&&this.authToken?(this.updateDisputeResponse=(({authToken:e,disputeId:t,service:s})=>async({payload:i,onSuccess:a,onError:d,final:r=()=>{}})=>{var c;try{const r=await s.updateDisputeResponse(t,e,i);if(r.error)return d({error:p(r.error),code:h(null===(c=r.error)||void 0===c?void 0:c.code),severity:o.ERROR});a(r)}catch(e){const t=h(null==e?void 0:e.code);return d({error:e.message||e,code:t,severity:o.ERROR})}finally{r()}})({disputeId:this.disputeId,authToken:this.authToken,service:new f}),this.createDisputeEvidence=(({authToken:e,disputeId:t,service:s})=>async({payload:i,onSuccess:a,onError:d,final:r=()=>{}})=>{var c;try{const r=await s.createDisputeEvidence(t,e,i);if(r.error)return d({error:p(r.error),code:h(null===(c=r.error)||void 0===c?void 0:c.code),severity:o.ERROR});a(r)}catch(e){const t=h(null==e?void 0:e.code);return d({error:e.message||e,code:t,severity:o.ERROR})}finally{r()}})({disputeId:this.disputeId,authToken:this.authToken,service:new f}),this.submitDisputeResponse=y({disputeId:this.disputeId,authToken:this.authToken,service:new f})):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:n.MISSING_PROPS,message:this.errorMessage,severity:o.ERROR}))}get currentStepComponent(){return this.componentStepMapping[this.currentStep]()}get isLastStep(){return this.currentStep===this.componentStepMapping.length-1}get isFirstStep(){return 0===this.currentStep}render(){return s("div",{key:"57664882c2d3c6833f9a9cbe01452875119c6032",class:"dispute-response-root"},s("div",{key:"92c8e3b3426210b68063ad7474aeb13429fd4c76",class:"row gy-3"},s("div",{key:"0f7e1236d85765054a40a06d864199feba0cad21",class:"col-12"},s("h1",{key:"b12f3840caeb7c17d324829874b8a4089fcb123d",class:"h4",part:d},"Counter dispute")),s("div",{key:"c493a872abb1d058cd98fab46eefa6f68caaa351",class:"col-12"},this.currentStepComponent),s("div",{key:"06f7818c59490ec54c58e9e0a5d7effec11bf0a6",class:"col-12"},s("div",{key:"754852aaab1b5048ed52796a13e169228a6ac2d1",class:"d-flex gap-2 mt-4 justify-content-end"},this.isFirstStep?s(r,{variant:"secondary",onClick:()=>this.onCancel(),disabled:this.isLoading,isLoading:this.isLoading},"Cancel"):s(r,{variant:"secondary",onClick:()=>this.onBack(),disabled:this.isLoading,isLoading:this.isLoading},"Back"),this.isLastStep?s(r,{variant:"primary",onClick:()=>this.onSubmit(),disabled:this.isLoading,isLoading:this.isLoading},"Submit Counter Dispute"):s(r,{variant:"primary",onClick:()=>this.onNext(),disabled:this.isLoading,isLoading:this.isLoading},"Next")))))}static get watchers(){return{disputeId:["propChanged"],authToken:["propChanged"]}}};export{v as dispute_notification,m as dispute_response}
|
|
1
|
+
import{r as e,c as t,h as s}from"./p-CV0Pyo1O.js";import{f as i}from"./p-Ds_P-dB8.js";import{t as a,a8 as d}from"./p-Bu7gdOaV.js";import{B as r}from"./p-CU2Dwa94.js";import{S as c}from"./p-eBK-iWrz.js";import"./p-CZfYo5-1.js";import{C as o,b as n}from"./p-Dqxyi-uK.js";import{g as h,a as p}from"./p-BhpaUYtS.js";import{D as l,a as f}from"./p-B_2zgnvM.js";import{c as u}from"./p-_MjmE9YT.js";import{J as b}from"./p-BjjKkMO1.js";import"./p-HXpYMWUU.js";import"./p-C6Jq8YDT.js";import"./p-B4vLfYnZ.js";import"./p-DgTOxu8x.js";import"./p-BC9n8nB2.js";import"./p-CLHwhyvu.js";import"./p-CTtGaVYs.js";const y=({authToken:e,disputeId:t,service:s})=>async({payload:i,onSuccess:a,onError:d,final:r=()=>{}})=>{var c;try{const r=await s.submitDisputeResponse(t,e,i);if(r.error){return d({error:p(r.error),code:h(null===(c=r.error)||void 0===c?void 0:c.code),severity:o.ERROR})}a(r)}catch(e){const t=h(null==e?void 0:e.code);return d({error:e.message||e,code:t,severity:o.ERROR})}finally{r()}},v=class{constructor(s){e(this,s),this.clickEvent=t(this,"click-event",7),this.errorEvent=t(this,"error-event",7),this.submitEvent=t(this,"submit-event",7)}acceptDispute(){y({disputeId:this.dispute.id,authToken:this.authToken,service:new f})({payload:{forfeit:!0},onSuccess:e=>{this.submitEvent.emit({response:e})},onError:({error:e,code:t,severity:s})=>{this.errorEvent.emit({errorCode:t,message:e,severity:s})}})}initiateRespondToDispute(){this.clickEvent.emit({name:l.respondToDispute})}isDueDatePassed(){var e;if(!(null===(e=this.dispute)||void 0===e?void 0:e.due_date))return!1;const t=new Date(this.dispute.due_date.replace(/-/g,"/").replace(/T.+/,"")),s=new Date;return s.setHours(0,0,0,0),t.setHours(0,0,0,0),t<s}render(){var e,t,o,n,h,p,l,f,u;return s("div",{key:"0f4474fa70e6ab3895132b703ab5a3b7f810554a",class:"dispute-notification-root"},this.isLoading&&s("div",{key:"1bd7b07c15e6a88be6215dbca5e41cbcfc6e6e68",style:{marginBottom:"8px"}},s(c,{key:"a4436ec5cc58b0cccdcdc9ae3d25293fdfaeac40",height:"28px",width:"70%",styles:{marginBottom:"16px"}}),s(c,{key:"cda7ba45ed518e762239864b766f65da8488e713",height:"18px",styles:{marginBottom:"8px"}}),s(c,{key:"a0acf3c7c0ae988f8580bfbd8b2ff2b5c349fddb",height:"18px",styles:{marginBottom:"8px"}})),(null===(e=this.dispute)||void 0===e?void 0:e.needsResponse)&&this.isDueDatePassed()&&s("div",{key:"2fd8a28d4c3eefc4a1a881d3bc47422428d4f016",part:a},s("h1",{key:"243ca1a43064800b65fb27e259598ff85746e55b",class:"h4",part:d},"The due date (",null===(t=this.dispute)||void 0===t?void 0:t.due_date,") for this dispute has passed"),s("p",{key:"617f7b87510fee1d64ad121cf15f1ba193f6826c"},"You can no longer submit evidence to counter this dispute.")),(null===(o=this.dispute)||void 0===o?void 0:o.needsResponse)&&!this.isDueDatePassed()&&s("div",{key:"d9ad4c30643e0991c7327a800d8015aa49d227ff",part:a},s("h1",{key:"c6e2b6a4a012ad2ce3d371ac765359f0db018166",class:"h4",part:d},"This payment is disputed"),s("p",{key:"491ca4d83029e8aec16ee745cd3eb78854298d19"},"The cardholder is disputing this payment. You may accept this dispute, or proceed to provide evidence in a counter dispute."),s("h2",{key:"3fd51e33e3440d6fda3fb6f2aa3f83cd783255fc",class:"h5"},"Dispute details"),s("div",{key:"edb7c85ffccd4a1af64cdb61a702ce39c86987a9",class:"d-table gap-2"},s("div",{key:"8d611ad34fa2a40d52f175c6874228254d235bf6",class:"d-table-row gap-2"},s("span",{key:"db4c9c3379b475ddb4c966336a1a9905f286335a",part:"detail-section-item-title",class:"fw-bold d-table-cell pe-4"},"Amount"),s("span",{key:"9c61d28bc602dd3cdeaa0e99923c58fb20fb95bc",part:"detail-section-item-data",class:"flex-1 d-table-cell text-wrap"},i(null===(n=this.dispute)||void 0===n?void 0:n.amount))),s("div",{key:"d7a84cd67c59bfdc2c63b7e847b82d423d3277a4",class:"d-table-row gap-2"},s("span",{key:"e98e2a8a8593b3358ecf6d5b857d2f3cffae1ef5",part:"detail-section-item-title",class:"fw-bold d-table-cell pe-4"},"Reason"),s("span",{key:"61f843068e6bf04d8bab69cefeb148e9b6792a5f",part:"detail-section-item-data",class:"flex-1 d-table-cell text-wrap"},null===(h=this.dispute)||void 0===h?void 0:h.reason)),s("div",{key:"795fd5d907eb2e1456c737a201517dbe5434ea84",class:"d-table-row gap-2"},s("span",{key:"1dae1ba0dd7323756988c8f6d65be1fdf3c155e6",part:"detail-section-item-title",class:"fw-bold d-table-cell pe-4"},"Due Date"),s("span",{key:"b44ff4fcfd0beb70af6468a216eee0489c566a79",part:"detail-section-item-data",class:"flex-1 d-table-cell text-wrap"},null===(p=this.dispute)||void 0===p?void 0:p.due_date))),s("div",{key:"f7e1ac7543ca231cc7904654bfb9fcb3e3f31dc1",class:"d-flex gap-2 mt-4 justify-content-end"},s(r,{key:"35dfa1f4e0a7f02496751dc332a4c52b542fe538",variant:"secondary",onClick:()=>this.acceptDispute()},"Accept dispute"),s(r,{key:"0519e6959a2407315d600384121b6ad466de79eb",variant:"primary",onClick:()=>this.initiateRespondToDispute()},"Counter dispute"))),(null===(l=this.dispute)||void 0===l?void 0:l.underReview)&&s("div",{key:"600db9506bed0de6efc3d0367fb5df63273bba14",part:a},s("h1",{key:"139a034878c8433edb1b936440c1b71d9d1022b2",class:"h4",part:d},"This payment is disputed and under review"),s("p",{key:"bd9b3d46e57ec998e5e1a5bc465d981129fc1fd2"},"The cardholder is disputing this payment. A counter dispute has been submitted and is under review.")),(null===(f=this.dispute)||void 0===f?void 0:f.won)&&s("div",{key:"c03393474cea2a44b864eba0f9e36b1fe63eb256",part:a},s("h1",{key:"3c19db3b8aefd25a363d4cd183eaaa2487d33f8c",class:"h4",part:d},"This payment was disputed"),s("p",{key:"45d95070b59c3a0da28bc5cda5356c2aa171d974"},"The cardholder disputed this payment and the card issuer has settled it in your favor.")),(null===(u=this.dispute)||void 0===u?void 0:u.lost)&&s("div",{key:"a8727df139e8d1eff3e67bc13359534281ceb795",part:a},s("h1",{key:"bb533bb65c20722002bda966782fcc4d165a139e",class:"h4",part:d},"This payment was disputed"),s("p",{key:"5901b10090d20523de1f96630ce7a9b71d9fdcac"},"The cardholder disputed this payment and the card issuer has settled it in their favor.")))}},m=class{constructor(i){e(this,i),this.clickEvent=t(this,"click-event",7),this.errorEvent=t(this,"error-event",7),this.stepCompleteEvent=t(this,"complete-form-step-event",7),this.submitEvent=t(this,"submit-event",7),this.errorMessage=null,this.disputeResponse={},this.apiOrigin="https://wc-proxy.justifi.ai",this.isLoading=!1,this.documentList=[],this.documentErrors={},this.currentStep=0,this.componentStepMapping=[()=>s("product-or-service",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("customer-details",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("cancellation-policy",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("refund-policy",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("duplicate-charge",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("electronic-evidence",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("shipping-details",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("additional-statement",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors})],this.saveData=async(e,t)=>{if(Object.keys(e).length)return this.isLastStep?this.submitDisputeResponse({payload:e,onSuccess:e=>{this.submitEvent.emit({response:e}),this.stepCompleteEvent.emit({response:e,formStep:t})},onError:({error:e,code:t,severity:s})=>{this.errorEvent.emit({errorCode:t,message:e,severity:s})}}):this.updateDisputeResponse({payload:e,onSuccess:e=>{this.disputeResponse=Object.assign({},e.data),this.stepCompleteEvent.emit({response:e,formStep:t})},onError:({error:e,code:t,severity:s})=>{this.errorEvent.emit({errorCode:t,message:e,severity:s})}});this.stepCompleteEvent.emit({response:null,formStep:t})},this.initializeMakePresignedURLs=async()=>{const e=this.documentList.map((e=>this.getPresignedFileUrl(e)));return await Promise.all(e)},this.initializeFileUploads=async()=>{const e=this.documentList.map((e=>this.uploadDocument(e)));return Promise.all(e)},this.getPresignedFileUrl=async e=>this.createDisputeEvidence({payload:{file_name:e.file_name,file_type:e.file_type,dispute_evidence_type:e.dispute_evidence_type},onSuccess:t=>{e.presignedUrl=t.data.presigned_url},onError:({error:t,code:s,severity:i})=>{const a={[e.dispute_evidence_type]:t};this.documentErrors=Object.assign(Object.assign({},this.documentErrors),a),this.errorEvent.emit({errorCode:s,message:t,severity:i})}}),this.uploadDocument=async e=>{const t=await e.getFileString();if(!e.presignedUrl)throw new Error("Presigned URL is not set");return await fetch(e.presignedUrl,{method:"PUT",body:t})},this.handleSubmit=async(e,t,s)=>{if(this.isLoading=!0,t.length){if(this.documentErrors={},this.documentList=t,await this.initializeMakePresignedURLs(),Object.keys(this.documentErrors).length)throw this.isLoading=!1,new Error("Could not presign all documents");await this.initializeFileUploads()}await this.saveData(e,s),this.isLoading=!1},this.onCancel=()=>{this.clickEvent.emit({name:l.cancelDispute})},this.onBack=async()=>{await this.currentStepComponentRef.validateAndSubmit((async(e,t,s)=>{this.clickEvent.emit({name:l.previousStep}),await this.handleSubmit(e,t,s),this.currentStep--}))},this.onNext=async()=>{await this.currentStepComponentRef.validateAndSubmit((async(e,t,s)=>{this.clickEvent.emit({name:l.nextStep}),await this.handleSubmit(e,t,s),this.currentStep++}))},this.onSubmit=async()=>{await this.currentStepComponentRef.validateAndSubmit((async(e,t,s)=>{this.clickEvent.emit({name:l.submit});const i=Object.assign(Object.assign({},e),{forfeit:!1});await this.handleSubmit(i,t,s)}))}}componentWillLoad(){u(),this.analytics=new b(this),this.initializeDisputeServiceMethods()}disconnectedCallback(){var e;null===(e=this.analytics)||void 0===e||e.cleanup()}propChanged(){this.initializeDisputeServiceMethods()}initializeDisputeServiceMethods(){this.disputeId&&this.authToken?(this.updateDisputeResponse=(({authToken:e,disputeId:t,service:s})=>async({payload:i,onSuccess:a,onError:d,final:r=()=>{}})=>{var c;try{const r=await s.updateDisputeResponse(t,e,i);if(r.error)return d({error:p(r.error),code:h(null===(c=r.error)||void 0===c?void 0:c.code),severity:o.ERROR});a(r)}catch(e){const t=h(null==e?void 0:e.code);return d({error:e.message||e,code:t,severity:o.ERROR})}finally{r()}})({disputeId:this.disputeId,authToken:this.authToken,service:new f}),this.createDisputeEvidence=(({authToken:e,disputeId:t,service:s})=>async({payload:i,onSuccess:a,onError:d,final:r=()=>{}})=>{var c;try{const r=await s.createDisputeEvidence(t,e,i);if(r.error)return d({error:p(r.error),code:h(null===(c=r.error)||void 0===c?void 0:c.code),severity:o.ERROR});a(r)}catch(e){const t=h(null==e?void 0:e.code);return d({error:e.message||e,code:t,severity:o.ERROR})}finally{r()}})({disputeId:this.disputeId,authToken:this.authToken,service:new f}),this.submitDisputeResponse=y({disputeId:this.disputeId,authToken:this.authToken,service:new f})):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:n.MISSING_PROPS,message:this.errorMessage,severity:o.ERROR}))}get currentStepComponent(){return this.componentStepMapping[this.currentStep]()}get isLastStep(){return this.currentStep===this.componentStepMapping.length-1}get isFirstStep(){return 0===this.currentStep}render(){return s("div",{key:"57664882c2d3c6833f9a9cbe01452875119c6032",class:"dispute-response-root"},s("div",{key:"92c8e3b3426210b68063ad7474aeb13429fd4c76",class:"row gy-3"},s("div",{key:"0f7e1236d85765054a40a06d864199feba0cad21",class:"col-12"},s("h1",{key:"b12f3840caeb7c17d324829874b8a4089fcb123d",class:"h4",part:d},"Counter dispute")),s("div",{key:"c493a872abb1d058cd98fab46eefa6f68caaa351",class:"col-12"},this.currentStepComponent),s("div",{key:"06f7818c59490ec54c58e9e0a5d7effec11bf0a6",class:"col-12"},s("div",{key:"754852aaab1b5048ed52796a13e169228a6ac2d1",class:"d-flex gap-2 mt-4 justify-content-end"},this.isFirstStep?s(r,{variant:"secondary",onClick:()=>this.onCancel(),disabled:this.isLoading,isLoading:this.isLoading},"Cancel"):s(r,{variant:"secondary",onClick:()=>this.onBack(),disabled:this.isLoading,isLoading:this.isLoading},"Back"),this.isLastStep?s(r,{variant:"primary",onClick:()=>this.onSubmit(),disabled:this.isLoading,isLoading:this.isLoading},"Submit Counter Dispute"):s(r,{variant:"primary",onClick:()=>this.onNext(),disabled:this.isLoading,isLoading:this.isLoading},"Next")))))}static get watchers(){return{disputeId:["propChanged"],authToken:["propChanged"]}}};export{v as dispute_notification,m as dispute_response}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,h as t,H as s,c as a}from"./p-CV0Pyo1O.js";import{C as i}from"./p-
|
|
1
|
+
import{r as e,h as t,H as s,c as a}from"./p-CV0Pyo1O.js";import{C as i}from"./p-CTtGaVYs.js";import{n as d}from"./p-BnjCmwMr.js";import{b as o,c as r}from"./p-riZDHN5-.js";import{I as l}from"./p-Ce_F4E0f.js";import{q as c,u as h,v as n,w as f,x as b}from"./p-Bu7gdOaV.js";import{F as u}from"./p-CLZcevBz.js";import"./p-CZfYo5-1.js";const m=class{constructor(t){e(this,t),this.country=i.USA}render(){var e,a,l,c,h,n,f,b,u,m;const v=r[this.country],p=o[this.country];return t(s,{key:"9b18ac26cce34bd3008146f106a260d9cb99de12"},t("div",{key:"c234c03bc4a3dbe74a0946af78aaed5992c3406c",class:"row gy-3"},t("div",{key:"0ce04acdf48726866bd6beecc25d0008b754984f",class:"col-12"},t("form-control-text",{key:"4d4b5098ebc39e52d0f17c677c4e92980793f46b",name:"line1",label:"Street Address",inputHandler:this.inputHandler,defaultValue:null===(e=this.defaultValues)||void 0===e?void 0:e.line1,errorText:null===(a=this.errors)||void 0===a?void 0:a.line1,helpText:"No PO Boxes."})),t("div",{key:"4133b38343c52135f2457bd7a9ad91b094422fb5",class:"col-12"},t("form-control-text",{key:"7e60be69dad198d488030ece4296326bb6368f2c",name:"line2",label:"Address Line 2 (optional)",inputHandler:this.inputHandler,defaultValue:null===(l=this.defaultValues)||void 0===l?void 0:l.line2,errorText:null===(c=this.errors)||void 0===c?void 0:c.line2})),t("div",{key:"a34a4e57cbd168bbbe065329bcfb393473b0def1",class:"col-12"},t("form-control-text",{key:"46e3005ef99ec988726ffcc37ec73756f002880d",name:"city",label:"City",inputHandler:this.inputHandler,defaultValue:null===(h=this.defaultValues)||void 0===h?void 0:h.city,errorText:null===(n=this.errors)||void 0===n?void 0:n.city})),t("div",{key:"2bf3389786351f2338cde13cbf87d28260444174",class:"col-12 col-md-6"},t("form-control-select",{key:"18a2a403d20af45965877601fa8d44a5aea48894",name:"state",label:v.stateLabel,options:p.stateOptions,inputHandler:this.inputHandler,defaultValue:null===(f=this.defaultValues)||void 0===f?void 0:f.state,errorText:null===(b=this.errors)||void 0===b?void 0:b.state})),t("div",{key:"1548ad58c0bd3b96067055601a006fc137ca31a3",class:"col-12 col-md-6"},t("form-control-text",{key:"8e8193efa81f1f5d8c626f76d75d15aba60ac921",name:"postal_code",label:v.postalLabel,inputHandler:this.inputHandler,defaultValue:null===(u=this.defaultValues)||void 0===u?void 0:u.postal_code,errorText:null===(m=this.errors)||void 0===m?void 0:m.postal_code,maxLength:this.country===i.USA?5:7,keyDownHandler:this.country===i.USA?d:void 0}))))}},v=class{constructor(t){e(this,t),this.formControlInput=a(this,"formControlInput",7),this.formControlBlur=a(this,"formControlBlur",7),this.imask=null,this.isFocused=!1,this.inputHandler=()=>{},this.disabled=!1,this.initializeIMask=()=>{this.textInput&&(this.imask=l(this.textInput,{mask:this.mask}),this.imask.on("accept",(()=>{var e;const t=null===(e=this.imask)||void 0===e?void 0:e.unmaskedValue;void 0!==t&&this.inputHandler(this.name,t)})),this.textInput.addEventListener("blur",(()=>this.formControlBlur.emit())))},this.handleFormControlInput=e=>{var t;const s=e.target,a=s.getAttribute("name"),i=(null===(t=this.imask)||void 0===t?void 0:t.unmaskedValue)||s.value;this.formControlInput.emit({name:a,value:i})},this.updateInput=e=>{this.imask&&e&&(this.imask.value=String(e))}}handleDefaultValueChange(e){this.initializeIMask(),this.updateInput(e)}disconnectedCallback(){var e;null===(e=this.imask)||void 0===e||e.destroy()}componentDidLoad(){this.textInput&&(this.initializeIMask(),this.updateInput(this.defaultValue))}get part(){return this.errorText?c:this.disabled?h:this.isFocused?n:f}render(){return t(s,{key:"63f9e8fbdf09ad22d7744b074d1646e6ea620b61"},t("div",{key:"a9fb05c711ebd9de3d3022a2ec17a9c666e7e2aa",class:"form-group d-flex flex-column"},t("div",{key:"e726ecfce3bd700fab74b6b3f81bdcba0d43428f",class:"d-flex align-items-start gap-2"},t("label",{key:"7940a4f3d8b3c894d0ee54871935e9989899c894",part:b,class:"form-label",htmlFor:this.name},this.label),t("form-control-tooltip",{key:"5c1782d425686b096e0b91c411e7543b794b969f",helpText:this.helpText})),t("input",{key:"3b8533a7cd4e0fe1907c6d5e01008063cf70d120",ref:e=>this.textInput=e,id:this.name,name:this.name,onFocus:()=>this.isFocused=!0,onBlur:()=>{this.isFocused=!1,this.formControlBlur.emit()},onInput:this.handleFormControlInput,part:this.part,class:this.errorText?"form-control is-invalid":"form-control",type:"text",disabled:this.disabled}),t(u,{key:"085b4f0ee135c12c6ea9293593e4c722091f895e",errorText:this.errorText,name:this.name})))}static get watchers(){return{defaultValue:["handleDefaultValueChange"]}}},p=class{constructor(t){e(this,t),this.address={},this.inputHandler=(e,t)=>{this.address[e]=t,this.address=Object.assign({},this.address)}}handleAddressChange(e){this.handleFormUpdate(e)}render(){return t(s,{key:"71100bc3742c3efaa9c3a948bf3ac5c69281c559"},t("form-address-fields",{key:"e5e5399686aa272a9cbe45d6914ebeda6a1966f4",country:this.country,errors:this.errors,defaultValues:this.defaultValues,inputHandler:this.inputHandler}))}static get watchers(){return{address:["handleAddressChange"]}}};export{m as form_address_fields,v as form_control_number_masked,p as identity_address_form}
|