@justifi/webcomponents 6.2.0 → 6.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/bank-account-document-form-inputs_6.cjs.entry.js +2 -2
- package/dist/cjs/{business-additional-questions-schema-BzHg6qqg.js → business-additional-questions-schema-CE-z5qrr.js} +1 -1
- package/dist/cjs/{business-identity-schema-Di-jf6nr.js → business-identity-schema-rMMiHyPz.js} +2 -2
- package/dist/cjs/{check-pkg-version-Cz6cM3zf.js → check-pkg-version-BVyea38i.js} +1 -1
- package/dist/cjs/{checkout.store-BiT7zKgX.js → checkout.store-BA6h-dp2.js} +2 -0
- package/dist/cjs/custom-popper.cjs.entry.js +2 -2
- package/dist/cjs/form-control-file-v2_2.cjs.entry.js +3 -3
- package/dist/cjs/form-control-monetary.cjs.entry.js +2 -2
- package/dist/cjs/form-control-number-masked_3.cjs.entry.js +2 -2
- package/dist/cjs/form-control-number.cjs.entry.js +2 -2
- package/dist/cjs/form-control-radio.cjs.entry.js +2 -2
- package/dist/cjs/form-control-select_3.cjs.entry.js +2 -2
- package/dist/cjs/hidden-input_2.cjs.entry.js +5 -5
- package/dist/cjs/{justifi-bank-account-billing-form-simple_9.cjs.entry.js → internal-tokenize-payment-method_7.cjs.entry.js} +254 -139
- package/dist/cjs/justifi-additional-questions-form-step-core_6.cjs.entry.js +3 -3
- package/dist/cjs/{justifi-apple-pay_8.cjs.entry.js → justifi-apple-pay_7.cjs.entry.js} +4 -259
- package/dist/cjs/justifi-bank-account-billing-form-simple_3.cjs.entry.js +147 -0
- package/dist/cjs/justifi-business-details.cjs.entry.js +2 -2
- package/dist/cjs/justifi-business-form.cjs.entry.js +5 -5
- package/dist/cjs/justifi-checkout.cjs.entry.js +6 -5
- package/dist/cjs/justifi-checkouts-list.cjs.entry.js +2 -2
- package/dist/cjs/justifi-dispute-management.cjs.entry.js +2 -2
- package/dist/cjs/justifi-dispute-notification_3.cjs.entry.js +2 -2
- package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +2 -2
- package/dist/cjs/justifi-order-terminals.cjs.entry.js +2 -2
- package/dist/cjs/justifi-owner-form_3.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payment-details.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payment-transactions-list.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payments-list.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payout-details.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payout-transactions-list.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payouts-list.cjs.entry.js +2 -2
- package/dist/cjs/justifi-refund-payment.cjs.entry.js +2 -2
- package/dist/cjs/justifi-season-interruption-insurance.cjs.entry.js +3 -3
- package/dist/cjs/justifi-skeleton.cjs.entry.js +1 -1
- package/dist/cjs/justifi-terminal-orders-list.cjs.entry.js +2 -2
- package/dist/cjs/justifi-terminals-list.cjs.entry.js +2 -2
- package/dist/cjs/justifi-tokenize-payment-method.cjs.entry.js +15 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{package-CHe5hX1H.js → package-keJMf4WX.js} +1 -1
- package/dist/cjs/{schema-validations-AxtufX7q.js → schema-validations-BOiGVUHM.js} +1 -1
- package/dist/cjs/webcomponents.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/business-forms/schemas/business-address-schema.js +2 -2
- package/dist/collection/components/business-forms/schemas/schema-validations.js +1 -1
- package/dist/collection/components/checkout/checkout.js +31 -2
- package/dist/collection/components/modular-checkout/sub-components/billing-form-full.js +1 -2
- package/dist/collection/components/modular-checkout/sub-components/card-billing-form-simple.js +1 -2
- package/dist/collection/components/tokenize-payment-method/internal-tokenize-payment-method.js +626 -0
- package/dist/collection/components/tokenize-payment-method/tokenize-payment-method.js +2 -422
- package/dist/collection/store/checkout.store.js +2 -0
- package/dist/collection/ui-components/custom-popper/custom-popper.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/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 +590 -242
- package/dist/esm/additional-questions-details_5.entry.js +2 -2
- package/dist/esm/{badge-BkjjtNUQ.js → badge-Bgosx-DC.js} +1 -1
- package/dist/esm/bank-account-document-form-inputs_6.entry.js +5 -5
- package/dist/esm/bank-account-form.entry.js +2 -2
- package/dist/esm/{business-additional-questions-schema-BCXg6YTP.js → business-additional-questions-schema-QFJEOHF5.js} +1 -1
- package/dist/esm/business-details-core.entry.js +3 -3
- package/dist/esm/{business-identity-schema-CvzdGI9h.js → business-identity-schema-DB_Hhjld.js} +2 -2
- package/dist/esm/{button-DHljyr0K.js → button-DBmjN7Ra.js} +1 -1
- package/dist/esm/card-form.entry.js +2 -2
- package/dist/esm/{check-pkg-version-DrqnlTa_.js → check-pkg-version-BZb5Z6DW.js} +1 -1
- package/dist/esm/{checkout.store-CMsV0tl9.js → checkout.store-CaS_htQd.js} +2 -0
- package/dist/esm/checkouts-list-core.entry.js +5 -5
- package/dist/esm/{checkouts-table-Dn1sFyZs.js → checkouts-table-lgbZpF1o.js} +2 -2
- package/dist/esm/custom-popper.entry.js +2 -2
- package/dist/esm/form-alert_5.entry.js +1 -1
- package/dist/esm/form-control-checkbox.entry.js +3 -3
- package/dist/esm/form-control-date.entry.js +2 -2
- package/dist/esm/{form-control-error-text-Cje0veu2.js → form-control-error-text-B5LSdUXI.js} +1 -1
- package/dist/esm/form-control-file-v2_2.entry.js +5 -5
- package/dist/esm/{form-control-help-text-ClJnecm3.js → form-control-help-text-BK9RNOf-.js} +1 -1
- package/dist/esm/form-control-monetary-provisioning.entry.js +3 -3
- package/dist/esm/form-control-monetary.entry.js +5 -5
- package/dist/esm/form-control-number-masked_3.entry.js +4 -4
- package/dist/esm/form-control-number.entry.js +5 -5
- package/dist/esm/form-control-radio.entry.js +3 -3
- package/dist/esm/form-control-select_3.entry.js +4 -4
- package/dist/esm/gross-payment-chart-core.entry.js +3 -3
- package/dist/esm/{header-1-uiFiNrVs.js → header-1-CPF3S2CC.js} +1 -1
- package/dist/esm/{header-3-BVYYTpLc.js → header-3-Cah707hu.js} +1 -1
- package/dist/esm/hidden-input_2.entry.js +7 -7
- package/dist/esm/{insurance-state-iJs0LRg_.js → insurance-state-DRe0g_wf.js} +1 -1
- package/dist/esm/internal-tokenize-payment-method_7.entry.js +460 -0
- package/dist/esm/justifi-additional-questions-form-step-core_6.entry.js +6 -6
- package/dist/esm/justifi-additional-questions-form-step_9.entry.js +2 -2
- package/dist/esm/justifi-additional-statement_8.entry.js +1 -1
- package/dist/esm/{justifi-apple-pay_8.entry.js → justifi-apple-pay_7.entry.js} +10 -264
- package/dist/esm/justifi-bank-account-billing-form-simple_3.entry.js +143 -0
- package/dist/esm/justifi-business-details.entry.js +4 -4
- package/dist/esm/justifi-business-form.entry.js +9 -9
- package/dist/esm/justifi-business-representative-form-inputs.entry.js +1 -1
- package/dist/esm/justifi-checkout.entry.js +7 -6
- package/dist/esm/justifi-checkouts-list-filters.entry.js +1 -1
- package/dist/esm/justifi-checkouts-list.entry.js +5 -5
- package/dist/esm/justifi-details.entry.js +2 -2
- package/dist/esm/justifi-dispute-management.entry.js +2 -2
- package/dist/esm/justifi-dispute-notification_3.entry.js +5 -5
- package/dist/esm/justifi-gross-payment-chart.entry.js +4 -4
- package/dist/esm/justifi-order-terminals.entry.js +4 -4
- package/dist/esm/justifi-owner-form_3.entry.js +4 -4
- package/dist/esm/justifi-payment-details.entry.js +4 -4
- package/dist/esm/justifi-payment-provisioning-core.entry.js +2 -2
- package/dist/esm/justifi-payment-provisioning.entry.js +2 -2
- package/dist/esm/justifi-payment-transactions-list.entry.js +5 -5
- package/dist/esm/justifi-payments-list-filters.entry.js +1 -1
- package/dist/esm/justifi-payments-list.entry.js +6 -6
- package/dist/esm/justifi-payout-details.entry.js +4 -4
- package/dist/esm/justifi-payout-transactions-list.entry.js +5 -5
- package/dist/esm/justifi-payouts-list-filters.entry.js +1 -1
- package/dist/esm/justifi-payouts-list.entry.js +6 -6
- package/dist/esm/justifi-refund-payment.entry.js +5 -5
- package/dist/esm/justifi-saved-payment-method.entry.js +1 -1
- package/dist/esm/justifi-season-interruption-insurance.entry.js +6 -6
- package/dist/esm/justifi-skeleton.entry.js +3 -3
- package/dist/esm/justifi-terminal-orders-list-filters.entry.js +1 -1
- package/dist/esm/justifi-terminal-orders-list.entry.js +5 -5
- package/dist/esm/justifi-terminals-list-filters.entry.js +1 -1
- package/dist/esm/justifi-terminals-list.entry.js +5 -5
- package/dist/esm/justifi-tokenize-payment-method.entry.js +13 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{package-BjCdImSF.js → package-C19Xk7z3.js} +1 -1
- package/dist/esm/pagination-menu.entry.js +1 -1
- package/dist/esm/{parts-Dj_zevuD.js → parts-wtuY7MT2.js} +1 -1
- package/dist/esm/payment-details-core.entry.js +5 -5
- package/dist/esm/payment-method-option.entry.js +1 -1
- package/dist/esm/payments-list-core.entry.js +6 -6
- package/dist/esm/{payments-status-DK2me5T2.js → payments-status-Dypl6WFL.js} +1 -1
- package/dist/esm/{payments-table-DxRdl7-E.js → payments-table-CK9BRZEz.js} +2 -2
- package/dist/esm/payout-details-core.entry.js +6 -6
- package/dist/esm/payouts-list-core.entry.js +6 -6
- package/dist/esm/{payouts-status-BfEM6F8q.js → payouts-status-hTCBgpLW.js} +1 -1
- package/dist/esm/{payouts-table-C2binjIW.js → payouts-table-Dd8IDBBX.js} +2 -2
- package/dist/esm/{schema-validations-CoIE0a4H.js → schema-validations-B5sfox_4.js} +2 -2
- package/dist/esm/{skeleton-DdynMBnt.js → skeleton-BmRZRW5K.js} +1 -1
- package/dist/esm/{spinner-BRMSkfVc.js → spinner-tU4D9iak.js} +1 -1
- package/dist/esm/{table-DYlsfkCm.js → table-Cjq1A6mO.js} +2 -2
- package/dist/esm/table-filters-menu.entry.js +2 -2
- package/dist/esm/terminal-orders-list-core.entry.js +5 -5
- package/dist/esm/{terminal-orders-table-zf0ASRCr.js → terminal-orders-table-CMWBIr9y.js} +2 -2
- package/dist/esm/terminal-quantity-selector.entry.js +1 -1
- package/dist/esm/terminals-list-core.entry.js +5 -5
- package/dist/esm/{terminals-table-DNUTk3gi.js → terminals-table-D9okETJr.js} +2 -2
- package/dist/esm/{utils-DUz-H1tG.js → utils-BX7Rjm1M.js} +1 -1
- package/dist/esm/webcomponents.js +1 -1
- package/dist/module/Refund.js +1 -1
- package/dist/module/additional-statement.js +1 -1
- package/dist/module/billing-form-full.js +1 -2
- package/dist/module/billing-form-schema.js +1 -1
- package/dist/module/business-additional-questions-form-step.js +1 -1
- package/dist/module/business-additional-questions-schema.js +1 -1
- package/dist/module/business-address-schema.js +2 -2
- package/dist/module/business-bank-account-form-step-core.js +1 -1
- package/dist/module/business-bank-account-form-step.js +1 -1
- package/dist/module/business-core-info-form-step.js +1 -1
- package/dist/module/business-owners-form-step.js +1 -1
- package/dist/module/business-representative-form-step.js +1 -1
- package/dist/module/business-terms-conditions-form-step.js +1 -1
- package/dist/module/button.js +1 -1
- package/dist/module/cancellation-policy.js +1 -1
- package/dist/module/card-billing-form-simple.js +1 -2
- package/dist/module/checkout.store.js +2 -0
- package/dist/module/custom-popper2.js +2 -2
- package/dist/module/customer-details.js +1 -1
- package/dist/module/dispute-response-actions.js +1 -1
- package/dist/module/dispute-response.js +1 -1
- package/dist/module/duplicate-charge.js +1 -1
- package/dist/module/electronic-evidence.js +1 -1
- 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-number.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/get-business.js +1 -1
- package/dist/module/get-payment-details.js +1 -1
- package/dist/module/get-payout-csv.js +1 -1
- package/dist/module/get-subaccounts.js +1 -1
- package/dist/module/hidden-input2.js +1 -1
- package/dist/module/iframe-input2.js +3 -3
- package/dist/module/internal-tokenize-payment-method.d.ts +11 -0
- package/dist/module/internal-tokenize-payment-method.js +6 -0
- package/dist/module/{tokenize-payment-method.js → internal-tokenize-payment-method2.js} +8 -8
- package/dist/module/justifi-business-details.js +1 -1
- package/dist/module/justifi-business-form.js +1 -1
- package/dist/module/justifi-button2.js +1 -1
- package/dist/module/justifi-checkout.js +39 -37
- package/dist/module/justifi-checkouts-list.js +1 -1
- package/dist/module/justifi-dispute-management.js +1 -1
- package/dist/module/justifi-gross-payment-chart.js +1 -1
- package/dist/module/justifi-header2.js +1 -1
- package/dist/module/justifi-order-terminals.js +2 -2
- package/dist/module/justifi-payment-details.js +1 -1
- package/dist/module/justifi-payment-provisioning.js +1 -1
- package/dist/module/justifi-payment-transactions-list.js +1 -1
- package/dist/module/justifi-payments-list.js +1 -1
- package/dist/module/justifi-payout-details.js +1 -1
- package/dist/module/justifi-payout-transactions-list.js +1 -1
- package/dist/module/justifi-payouts-list.js +1 -1
- package/dist/module/justifi-refund-payment.js +1 -1
- package/dist/module/justifi-season-interruption-insurance.js +1 -1
- package/dist/module/justifi-skeleton.js +1 -1
- package/dist/module/justifi-terminal-orders-list.js +1 -1
- package/dist/module/justifi-terminals-list.js +1 -1
- package/dist/module/justifi-tokenize-payment-method.js +154 -1
- package/dist/module/legal-address-form-step.js +1 -1
- package/dist/module/modular-checkout.js +1 -1
- package/dist/module/package.js +1 -1
- package/dist/module/parts.js +1 -1
- package/dist/module/payment-provisioning-actions.js +1 -1
- package/dist/module/payment-provisioning-core.js +1 -1
- package/dist/module/payouts-list-core2.js +1 -1
- package/dist/module/plaid-payment-method.js +1 -1
- package/dist/module/product-or-service.js +1 -1
- package/dist/module/refund-policy.js +1 -1
- package/dist/module/schema-validations.js +2 -2
- package/dist/module/shipping-details.js +1 -1
- package/dist/module/utils4.js +1 -1
- package/dist/types/components/checkout/checkout.d.ts +4 -2
- package/dist/types/components/tokenize-payment-method/internal-tokenize-payment-method.d.ts +60 -0
- package/dist/types/components/tokenize-payment-method/tokenize-payment-method.d.ts +0 -47
- package/dist/types/components.d.ts +97 -56
- package/dist/types/store/checkout.store.d.ts +1 -0
- package/dist/webcomponents/{p-73e766d2.entry.js → p-00e0a745.entry.js} +1 -1
- package/dist/webcomponents/{p-6c2b5d37.entry.js → p-087a81ff.entry.js} +1 -1
- package/dist/webcomponents/{p-56d9a8f1.entry.js → p-0ce046fd.entry.js} +1 -1
- package/dist/webcomponents/{p-62cdb2b1.entry.js → p-1193a1ac.entry.js} +1 -1
- package/dist/webcomponents/{p-e3a41b95.entry.js → p-14d2f6c6.entry.js} +1 -1
- package/dist/webcomponents/{p-264d9183.entry.js → p-1eae32ac.entry.js} +1 -1
- package/dist/webcomponents/{p-198a6ae3.entry.js → p-1edec396.entry.js} +1 -1
- package/dist/webcomponents/{p-065eafc5.entry.js → p-20a8b0c0.entry.js} +1 -1
- package/dist/webcomponents/{p-3cb3a241.entry.js → p-22f74666.entry.js} +1 -1
- package/dist/webcomponents/p-2769f945.entry.js +1 -0
- package/dist/webcomponents/{p-f87b9b86.entry.js → p-2cd5733e.entry.js} +1 -1
- package/dist/webcomponents/p-30f61f44.entry.js +1 -0
- package/dist/webcomponents/{p-5aa27e1b.entry.js → p-37a55eaf.entry.js} +1 -1
- package/dist/webcomponents/p-3c38cec5.entry.js +1 -0
- package/dist/webcomponents/p-40d3a480.entry.js +1 -0
- package/dist/webcomponents/{p-82b13550.entry.js → p-45936490.entry.js} +1 -1
- package/dist/webcomponents/{p-abf2073d.entry.js → p-4761e0aa.entry.js} +1 -1
- package/dist/webcomponents/{p-91f22211.entry.js → p-4c3eea2b.entry.js} +1 -1
- package/dist/webcomponents/{p-27acf7cc.entry.js → p-4dcbc0af.entry.js} +1 -1
- package/dist/webcomponents/{p-46d7ca2f.entry.js → p-4e23116c.entry.js} +4 -4
- package/dist/webcomponents/{p-910af6e1.entry.js → p-5464b902.entry.js} +1 -1
- package/dist/webcomponents/{p-ab1ef223.entry.js → p-54facfdc.entry.js} +1 -1
- package/dist/webcomponents/{p-85336b64.entry.js → p-56a8e07d.entry.js} +1 -1
- package/dist/webcomponents/{p-52cb10a7.entry.js → p-58ae4f9e.entry.js} +1 -1
- package/dist/webcomponents/p-5d1fb433.entry.js +1 -0
- package/dist/webcomponents/p-5f81a3d6.entry.js +1 -0
- package/dist/webcomponents/{p-ccc771d0.entry.js → p-696a5c8e.entry.js} +1 -1
- package/dist/webcomponents/p-6b6003d2.entry.js +1 -0
- package/dist/webcomponents/{p-590290a2.entry.js → p-716ddc27.entry.js} +1 -1
- package/dist/webcomponents/{p-9633fbb8.entry.js → p-7218c312.entry.js} +1 -1
- package/dist/webcomponents/{p-83cd698c.entry.js → p-75c65531.entry.js} +1 -1
- package/dist/webcomponents/{p-d217f6ea.entry.js → p-800660f2.entry.js} +1 -1
- package/dist/webcomponents/p-84e2bd93.entry.js +1 -0
- package/dist/webcomponents/{p-6677f09f.entry.js → p-8681f258.entry.js} +1 -1
- package/dist/webcomponents/{p-98a50760.entry.js → p-87a2a830.entry.js} +1 -1
- package/dist/webcomponents/{p-e788ecc9.entry.js → p-89518b26.entry.js} +1 -1
- package/dist/webcomponents/{p-e549cd33.entry.js → p-95593721.entry.js} +1 -1
- package/dist/webcomponents/{p-e29bdbc2.entry.js → p-9d914297.entry.js} +1 -1
- package/dist/webcomponents/{p-5eb2698f.entry.js → p-9f70ce93.entry.js} +1 -1
- package/dist/webcomponents/p-B-0a8Xqm.js +1 -0
- package/dist/webcomponents/{p-D2DVDmwd.js → p-BNqo3kt0.js} +1 -1
- package/dist/webcomponents/{p-B-7rLJIB.js → p-BTzt8N0l.js} +1 -1
- package/dist/webcomponents/{p-C9Ho60F2.js → p-BitGlMSc.js} +1 -1
- package/dist/webcomponents/p-Bli6WznP.js +1 -0
- package/dist/webcomponents/{p-DkOvNRJs.js → p-Bqlcv3ZV.js} +1 -1
- package/dist/webcomponents/p-BuCKkdLM.js +1 -0
- package/dist/webcomponents/{p-BB3MQDQq.js → p-BydKIJVC.js} +1 -1
- package/dist/webcomponents/p-C-2kW6Al.js +1 -0
- package/dist/webcomponents/p-C19Xk7z3.js +1 -0
- package/dist/webcomponents/{p-D8HCCl2t.js → p-CkN7DFFn.js} +1 -1
- package/dist/webcomponents/p-D1WQG4I7.js +1 -0
- package/dist/webcomponents/{p-Cu1FEdFr.js → p-DOLBAxYf.js} +1 -1
- package/dist/webcomponents/p-DU8dqq9U.js +1 -0
- package/dist/webcomponents/{p-pV1ZX4A8.js → p-DV4RaYYL.js} +1 -1
- package/dist/webcomponents/{p-fDGfMEwy.js → p-DkOiS6Zr.js} +1 -1
- package/dist/webcomponents/{p-BVWZSqCK.js → p-KPmnq8xf.js} +1 -1
- package/dist/webcomponents/{p-28c28c0b.entry.js → p-a655b996.entry.js} +1 -1
- package/dist/webcomponents/{p-ad4900de.entry.js → p-a6e37d4a.entry.js} +1 -1
- package/dist/webcomponents/{p-256a95eb.entry.js → p-a8f7cf9b.entry.js} +1 -1
- package/dist/webcomponents/{p-8993c961.entry.js → p-ae7a027b.entry.js} +1 -1
- package/dist/webcomponents/{p-1414e80b.entry.js → p-aec9185f.entry.js} +1 -1
- package/dist/webcomponents/p-avgjSJ1d.js +1 -0
- package/dist/webcomponents/{p-97bfb8d5.entry.js → p-b07470fa.entry.js} +1 -1
- package/dist/webcomponents/{p-93806238.entry.js → p-b2f969a6.entry.js} +1 -1
- package/dist/webcomponents/p-b4d8a3f6.entry.js +1 -0
- package/dist/webcomponents/{p-q6C7btl0.js → p-bolTb61p.js} +1 -1
- package/dist/webcomponents/p-c0198eef.entry.js +1 -0
- package/dist/webcomponents/{p-2a53a095.entry.js → p-c1831747.entry.js} +1 -1
- package/dist/webcomponents/{p-99af02c9.entry.js → p-c31fe838.entry.js} +1 -1
- package/dist/webcomponents/p-c3b71a1f.entry.js +1 -0
- package/dist/webcomponents/{p-4e90834e.entry.js → p-c7279bc6.entry.js} +1 -1
- package/dist/webcomponents/p-c7MCfTgE.js +1 -0
- package/dist/webcomponents/{p-e06327aa.entry.js → p-c8f40375.entry.js} +1 -1
- package/dist/webcomponents/{p-7f8cd8dd.entry.js → p-d182f489.entry.js} +1 -1
- package/dist/webcomponents/{p-728158a8.entry.js → p-d4b8274f.entry.js} +1 -1
- package/dist/webcomponents/{p-071c1047.entry.js → p-d86b8ce7.entry.js} +1 -1
- package/dist/webcomponents/p-dc0d3484.entry.js +1 -0
- package/dist/webcomponents/{p-24be9ef6.entry.js → p-dfe68bf0.entry.js} +1 -1
- package/dist/webcomponents/{p-BfYkosa4.js → p-dgG_o6wN.js} +1 -1
- package/dist/webcomponents/{p-f02ab3fd.entry.js → p-e2e6c201.entry.js} +1 -1
- package/dist/webcomponents/{p-238859ef.entry.js → p-eb56ba9b.entry.js} +1 -1
- package/dist/webcomponents/{p-0d928de1.entry.js → p-ed55d333.entry.js} +1 -1
- package/dist/webcomponents/p-edcb84bf.entry.js +1 -0
- package/dist/webcomponents/{p-9db64da8.entry.js → p-f1af630f.entry.js} +1 -1
- package/dist/webcomponents/{p-6023553c.entry.js → p-f5fb1af2.entry.js} +1 -1
- package/dist/webcomponents/{p-79cb28bd.entry.js → p-fab28b02.entry.js} +1 -1
- package/dist/webcomponents/p-fda2d53b.entry.js +1 -0
- package/dist/webcomponents/{p-DsR5Dt9w.js → p-jTVpG8Gt.js} +1 -1
- package/dist/webcomponents/{p-DwLZbA7D.js → p-nrZ9yHcl.js} +1 -1
- package/dist/webcomponents/{p-Dj_zevuD.js → p-wtuY7MT2.js} +1 -1
- package/dist/webcomponents/p-zNSPsvs3.js +1 -0
- package/dist/webcomponents/webcomponents.esm.js +1 -1
- package/package.json +2 -1
- package/dist/esm/justifi-bank-account-billing-form-simple_9.entry.js +0 -343
- package/dist/webcomponents/p-20a85390.entry.js +0 -1
- package/dist/webcomponents/p-2859a8e3.entry.js +0 -1
- package/dist/webcomponents/p-336b08de.entry.js +0 -1
- package/dist/webcomponents/p-36259848.entry.js +0 -1
- package/dist/webcomponents/p-568577d4.entry.js +0 -1
- package/dist/webcomponents/p-6b563428.entry.js +0 -1
- package/dist/webcomponents/p-92f0e010.entry.js +0 -1
- package/dist/webcomponents/p-BHe87s0Y.js +0 -1
- package/dist/webcomponents/p-BjCdImSF.js +0 -1
- package/dist/webcomponents/p-C2gAiiwJ.js +0 -1
- package/dist/webcomponents/p-C7m-gAAM.js +0 -1
- package/dist/webcomponents/p-CO8ZJ0jB.js +0 -1
- package/dist/webcomponents/p-CbBTgsKC.js +0 -1
- package/dist/webcomponents/p-CgbXzEbz.js +0 -1
- package/dist/webcomponents/p-Cpp4qrH2.js +0 -1
- package/dist/webcomponents/p-JvWiY69B.js +0 -1
- package/dist/webcomponents/p-VhOlg78I.js +0 -1
- package/dist/webcomponents/p-a49ca7d8.entry.js +0 -1
- package/dist/webcomponents/p-cdf94860.entry.js +0 -1
- package/dist/webcomponents/p-d8fc3996.entry.js +0 -1
- package/dist/webcomponents/p-e77490af.entry.js +0 -1
- package/dist/webcomponents/p-f17188cf.entry.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,c as t,h as i,H as s}from"./p-DwYM91AU.js";import{c as a,F as r}from"./p-DiJD6Iqx.js";import{q as d,H as c,k as n,l,n as o,z as h}from"./p-Cpp4qrH2.js";import{r as f,az as b}from"./p-Dj_zevuD.js";import{S as m}from"./p-BP2sTIQV.js";import"./p-CZfYo5-1.js";import{S as p}from"./p-VhOlg78I.js";import{c as u,J as y}from"./p-pV1ZX4A8.js";import{w as v,c as k}from"./p-tGDdRx0W.js";import{P as g}from"./p-DCIW8z1f.js";import{H as j}from"./p-CO8ZJ0jB.js";import{n as _}from"./p-BnjCmwMr.js";import{S as w}from"./p-B5rtFhtR.js";import{B as x}from"./p-DkOvNRJs.js";import{c as C}from"./p-CbBTgsKC.js";import"./p-BFTU3MAI.js";import"./p-DfKxeSrC.js";import"./p-CPpUGsw5.js";import"./p-BjCdImSF.js";import"./p-C8yN3uBj.js";import"./p-BS7OgSQe.js";import"./p-HXpYMWUU.js";import"./p-Cjcsf8ku.js";import"./p-CPKSE7M4.js";import"./p-BH0Xfn-F.js";import"./p-CLHwhyvu.js";import"./p-BYsgavgS.js";const V=class{constructor(i){e(this,i),this.radioClick=t(this,"radio-click"),this.checked=!1,this.hidden=!1,this.handleClick=()=>{this.radioClick.emit(this.value)}}render(){return i(m,{key:"1ae40f787970160e38b72f917bda96f480d2a890"},i("div",{key:"2130596c8294cc38365e6126806735da0f93ef4a",class:`radio-list-item p-3 ${this.class||""}`,part:f,onClick:this.handleClick,hidden:this.hidden},i("form-control-radio",{key:"7d5524f518430f2bfd1c9863f354318929353cfb",name:this.name,value:this.value,checked:this.checked,label:this.label,inputHandler:()=>null})))}},O=class{constructor(t){e(this,t),this.errors={},this.inputHandler=(e,t)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[e]:t}))}}componentWillLoad(){this.formController=new r(a({name:h.required("Enter full name"),address_line1:o.nullable(),address_line2:l.nullable(),address_city:n.nullable(),address_state:c.nullable(),address_postal_code:d.nullable()}))}componentDidLoad(){this.formController.values.subscribe((e=>this.billingInfo=Object.assign({},e))),this.formController.errors.subscribe((e=>{this.errors=Object.assign({},e)}))}async getValues(){return this.formController.values.getValue()}async fill(e){this.formController.setInitialValues(e)}async validate(){return{isValid:await this.formController.validate(),errors:this.formController.errors.getValue()}}render(){const e=this.formController.getInitialValues();return i(m,{key:"2429d26c0338ec1732337718ca4e7693f30a0f8a"},i("div",{key:"774911ce7d594bc1f44c15060136356acc349cbb",part:b,class:"mt-4"},i("form",{key:"5c93f5a6af372fdf24a20870ef6ae69f554efec4"},i("fieldset",{key:"38ac8adb2592b7799825d63c4a8e9bde61510cd0"},this.legend&&i("legend",{key:"abbce27bb8ae2ef564b8aeef755050fc096cb81f"},this.legend),i("div",{key:"5a0350fe7f635600d746f1f3979757a045cc09f0",class:"row gy-3"},i("div",{key:"71aac995514b7fea7254204df825eb8b381e21c7",class:"col-12"},i("form-control-text",{key:"f33d26eddfc9f3d307e05a48afec9472213b2822",name:"name",label:"Full Name",defaultValue:e.name,errorText:this.errors.name,inputHandler:this.inputHandler})))))))}},H=e=>{const{isReady:t}=e;return t?null:i("div",{class:"container-fluid p-0"},i("div",{class:"row mb-3"},i("div",{class:"col-12 align-content-end"},i(p,{height:"18px",width:"120px"}),i(p,{height:"36px"}))),i("div",{class:"row"},i("div",{class:"col-12 align-content-end"},i(p,{height:"18px",width:"110px"}),i(p,{height:"36px"}))))},S=class{constructor(t){e(this,t),this.isReady=!1}async componentWillLoad(){await v(),this.iframeOrigin=k.iframeOrigin,u(),this.analytics=new y(this)}componentDidRender(){Promise.all([this.accountNumberIframeElement,this.routingNumberIframeElement].map((e=>new Promise((t=>{e.addEventListener("iframeLoaded",(()=>{t()}))}))))).then((()=>{this.isReady=!0}))}disconnectedCallback(){var e;null===(e=this.analytics)||void 0===e||e.cleanup()}async validate(){const e=await this.accountNumberIframeElement.validate(),t=await this.routingNumberIframeElement.validate();return e&&t}async tokenize({clientId:e,paymentMethodMetadata:t,account:i}){return this.accountNumberIframeElement.tokenize(e,t,i)}render(){return i(m,{key:"62431aba939585a8a341942d9847e8d491b0a658"},i(H,{key:"2da8452c73e52a6fc67d80e483c40a2d0dd276f9",isReady:this.isReady}),i("hidden-input",{key:"c34bc48ee7e1925ae272b5fe60fd362ddf2433eb"}),i("div",{key:"3fefe63e9f9c98d7e08e0ceac5df0f8008303aec",class:"container-fluid p-0",style:{opacity:this.isReady?"1":"0",height:this.isReady?"auto":"0"}},i("div",{key:"6c19ea238eb0bff6b245f2f39028d651438c55d0",class:"row mb-3"},i("iframe-input",{key:"b5588dc21d24ec873fecedd91fbcb0344fbe324c",inputId:"accountNumber",ref:e=>this.accountNumberIframeElement=e,label:"Account Number",iframeOrigin:`${this.iframeOrigin}/v2/accountNumber`})),i("div",{key:"910f130a307449a3d60ef76eee6cc27fc86c3fe0",class:"row"},i("iframe-input",{key:"72756b92912c3031cc472dee5bbf945f06c38920",inputId:"routingNumber",ref:e=>this.routingNumberIframeElement=e,label:"Routing Number",iframeOrigin:`${this.iframeOrigin}/v2/routingNumber`}))))}},B=class{constructor(t){e(this,t)}get showSimpleCardBillingForm(){return this.paymentMethodType===g.NEW_CARD&&this.hideCardBillingForm}get showSimpleBankAccountBillingForm(){return this.paymentMethodType===g.NEW_BANK_ACCOUNT&&this.hideBankAccountBillingForm}async getValues(){var e;return null===(e=this.selectedFormRef)||void 0===e?void 0:e.getValues()}async fill(e){var t;null===(t=this.selectedFormRef)||void 0===t||t.fill(e)}async validate(){var e;return null===(e=this.selectedFormRef)||void 0===e?void 0:e.validate()}render(){return i(s,null,i(this.showSimpleBankAccountBillingForm?"justifi-bank-account-billing-form-simple":this.showSimpleCardBillingForm?"justifi-card-billing-form-simple":"justifi-billing-form-full",{legend:this.legend,ref:e=>this.selectedFormRef=e}))}},I=class{constructor(t){e(this,t),this.errors={},this.inputHandler=(e,t)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[e]:t}))}}componentWillLoad(){this.formController=new r(a({name:h.required("Enter full name"),address_line1:o.required("Enter street address"),address_line2:l.nullable(),address_city:n.required("Enter city"),address_state:c.required("Select state"),address_postal_code:d.required("Enter postal code")})),this.formController.values.subscribe((e=>this.billingInfo=Object.assign({},e))),this.formController.errors.subscribe((e=>{this.errors=Object.assign({},e)}))}async getValues(){return this.formController.values.getValue()}async fill(e){this.formController.setInitialValues(e)}async validate(){return{isValid:await this.formController.validate(),errors:this.formController.errors.getValue()}}render(){if(!this.formController)return null;const e=this.formController.getInitialValues();return i(m,null,i("div",{part:b,class:"mt-4"},i(j,{text:"Billing address",class:"fs-6 fw-bold lh-lg mb-4"}),i("form",null,i("fieldset",null,this.legend&&i("legend",null,this.legend),i("div",{class:"row gy-3"},i("div",{class:"col-12"},i("form-control-text",{name:"name",label:"Full Name",defaultValue:e.name,errorText:this.errors.name,inputHandler:this.inputHandler})),i("div",{class:"col-12"},i("form-control-text",{name:"address_line1",label:"Street Address",defaultValue:e.address_line1,errorText:this.errors.address_line1,inputHandler:this.inputHandler})),i("div",{class:"col-12"},i("form-control-text",{name:"address_line2",label:"Apartment, Suite, etc. (optional)",defaultValue:e.address_line2,errorText:this.errors.address_line2,inputHandler:this.inputHandler})),i("div",{class:"col-12"},i("form-control-text",{name:"address_city",label:"City",defaultValue:e.address_city,errorText:this.errors.address_city,inputHandler:this.inputHandler})),i("div",{class:"col-12"},i("form-control-select",{name:"address_state",label:"State",options:w,defaultValue:e.address_state,errorText:this.errors.address_state,inputHandler:this.inputHandler})),i("div",{class:"col-12"},i("form-control-text",{name:"address_postal_code",label:"ZIP",defaultValue:e.address_postal_code,errorText:this.errors.address_postal_code,inputHandler:this.inputHandler,maxLength:5,keyDownHandler:_})))))))}},N=class{constructor(t){e(this,t),this.variant="primary",this.type="button"}render(){return i(m,{key:"4303daf453d356b8111a2a00f821bc83cdd658c5"},i(x,{key:"7c1b0a71ac3274bb03218a8d921d5dc39bc48528",variant:this.variant,isLoading:this.isLoading,clickHandler:this.clickHandler,class:this.class,type:this.type,disabled:this.disabled,style:this.customStyle},this.text))}},D=class{constructor(t){e(this,t),this.errors={},this.inputHandler=(e,t)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[e]:t}))}}componentWillLoad(){this.formController=new r(a({name:h.nullable(),address_line1:o.nullable(),address_line2:l.nullable(),address_city:n.nullable(),address_state:c.nullable(),address_postal_code:d.required("Enter postal code")}))}componentDidLoad(){this.formController.values.subscribe((e=>this.billingInfo=Object.assign({},e))),this.formController.errors.subscribe((e=>{this.errors=Object.assign({},e)}))}async getValues(){return this.formController.values.getValue()}async fill(e){this.formController.setInitialValues(e)}async validate(){return{isValid:await this.formController.validate(),errors:this.formController.errors.getValue()}}render(){const e=this.formController.getInitialValues();return i(m,{key:"2523873a34180694357ab780bd4b9768f9ea267d"},i("div",{key:"30204a976bba8a843830a905cec86d5aaf486f30",part:b},i("form",{key:"479e65b39fbecc80ba6281648bd390c4cd2a688e"},i("fieldset",{key:"93613aa83561aaba46efff4e6d64e240e1ddbc84"},this.legend&&i("legend",{key:"4d6da7c78c5b1a84bc4b37dfca80d9c7f0be462f"},this.legend),i("div",{key:"11259470415c62c15c0ef9217f91f4d6b5c8651b",class:"row gy-3"},i("div",{key:"2b85b5b820991faee8d8b14c121a69ab4974da98",class:"col-12"},i("form-control-text",{key:"d7632e0d32832491bfdf911ae45e67efe0ec6555",name:"address_postal_code",label:"ZIP",defaultValue:e.address_postal_code,errorText:this.errors.address_postal_code,inputHandler:this.inputHandler,maxLength:5,keyDownHandler:_})))))))}},M=e=>{const{isReady:t}=e;return t?null:i("div",{class:"container-fluid p-0"},i("div",{class:"mb-3"},i(p,{height:"18px",width:"100px"}),i(p,{height:"36px"})),i("div",{class:"row"},i("div",{class:"col-4 align-content-end"},i(p,{height:"18px",width:"80px"}),i(p,{height:"36px"})),i("div",{class:"col-4 align-content-end"},i(p,{height:"36px"})),i("div",{class:"col-4 align-content-end"},i(p,{height:"18px",width:"30px"}),i(p,{height:"36px"}))))},L=class{constructor(t){e(this,t),this.isReady=!1}async componentWillLoad(){await v(),this.iframeOrigin=k.iframeOrigin,u(),this.analytics=new y(this)}componentDidRender(){Promise.all([this.cardNumberIframeElement,this.expirationMonthIframeElement,this.expirationYearIframeElement,this.cvvIframeElement].map((e=>new Promise((t=>{e.addEventListener("iframeLoaded",(()=>{t()}))}))))).then((()=>{this.isReady=!0}))}disconnectedCallback(){var e;null===(e=this.analytics)||void 0===e||e.cleanup()}async validate(){const e=await this.cardNumberIframeElement.validate(),t=await this.expirationMonthIframeElement.validate(),i=await this.expirationYearIframeElement.validate(),s=await this.cvvIframeElement.validate();return e&&t&&i&&s}async tokenize({clientId:e,paymentMethodMetadata:t,account:i}){return this.cardNumberIframeElement.tokenize(e,t,i)}render(){return i(m,{key:"0db53b1dace76a8e02bab9f65fdc70e20f440a62"},i(M,{key:"ea756f1799b01b81a678ce5bd2592551edd81211",isReady:this.isReady}),i("hidden-input",{key:"a6203630db26bfbb683e2b45174c79d753154eda"}),i("div",{key:"dbb6328ba3a27106474f6b9af6fc3c347b99ae7d",class:"container-fluid p-0",style:{opacity:this.isReady?"1":"0",height:this.isReady?"auto":"0"}},i("div",{key:"64055e42612ce94da35022d7e8314ed917f90f8a",class:"mb-3"},i("iframe-input",{key:"e99008d298b6ec6e22ff5a4e73042e3e8805f09b",inputId:"cardNumber",ref:e=>this.cardNumberIframeElement=e,label:"Card Number",iframeOrigin:`${this.iframeOrigin}/v2/cardNumber`})),i("div",{key:"34ed1849877a47fe6ec32f443472fa9c913dae67",class:"row"},i("div",{key:"39bfdd5c8dd6271315a09cd3022083fe4b45f5ea",class:"col-4 align-content-end"},i("iframe-input",{key:"981b65ebd142396312d09df8927fd5d08a5dea72",inputId:"expirationMonth",ref:e=>this.expirationMonthIframeElement=e,label:"Expiration",iframeOrigin:`${this.iframeOrigin}/v2/expirationMonth`})),i("div",{key:"a6fee6c1cc609b665b3ba9935190a43a118c5e5c",class:"col-4 align-content-end"},i("iframe-input",{key:"257b738139e182dc6e9f6a6893f8b6a0bc3f6b69",inputId:"expirationYear",ref:e=>this.expirationYearIframeElement=e,label:"",iframeOrigin:`${this.iframeOrigin}/v2/expirationYear`})),i("div",{key:"523316b64f673cdf89b5d01c1ecf4cf25ccef246",class:"col-4 align-content-end"},i("iframe-input",{key:"37305b54e421d759ded57b0f9de7743a07be4b5b",inputId:"CVV",ref:e=>this.cvvIframeElement=e,label:"CVV",iframeOrigin:`${this.iframeOrigin}/v2/CVV`})))))}},P=class{constructor(i){e(this,i),this.checkboxChanged=t(this,"checkboxChanged"),this.label="Save New Payment Method",this.isChecked=!1,this.handleCheckboxChange=(e,t)=>{this.isChecked=t,C.savePaymentMethod=t,this.checkboxChanged.emit(this.isChecked)}}render(){return i(m,{key:"9aa9ce812c0cb2fdc809c47060ed150903ad7cd5"},i("form-control-checkbox",{key:"596bc9a145e363c751c8610f4b9f23ad31dab299",label:this.label||"Save New Payment Method",name:"saveNewPaymentMethod",checked:this.isChecked,inputHandler:this.handleCheckboxChange}))}};export{O as justifi_bank_account_billing_form_simple,S as justifi_bank_account_form,B as justifi_billing_form,I as justifi_billing_form_full,N as justifi_button,D as justifi_card_billing_form_simple,L as justifi_card_form,V as justifi_radio_list_item,P as justifi_save_new_payment_method}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as e,a as t}from"./p-DiJD6Iqx.js";import{k as a,l as s,n,q as i,u as r,v as l,x as o,p as d,e as m,y as p,z as c,A as E}from"./p-Cpp4qrH2.js";import{C as _}from"./p-B5rtFhtR.js";const b=r=>e(r?{line1:n.nullable(),line2:s.nullable(),city:a.nullable(),state:t().nullable(),postal_code:t().nullable()}:{line1:n.required("Enter street address"),line2:s.nullable(),city:a.required("Enter city"),state:t().required("Select state"),postal_code:i.required("Enter postal code")}),f=i=>e(i?{line1:n.nullable(),line2:s.nullable(),city:a.nullable(),state:t().nullable(),postal_code:t().nullable()}:{line1:n.required("Enter street address"),line2:s.nullable(),city:a.required("Enter city"),state:t().required("Select province"),postal_code:r(_.CAN).required("Enter postal code")}),u={[_.USA]:b,[_.CAN]:f},h=(a,s)=>s?(a=>e({name:c.required(`Enter ${a} name`),title:p.nullable(),email:m.nullable(),phone:d.nullable(),dob_full:o(a).nullable(),ssn_last4:t().nullable(),identification_number:l.nullable(),address:b(!0)}))(a):(a=>e({name:c.required(`Enter ${a} name`),title:p.required(`Enter ${a} title`),email:m.required(`Enter ${a} email`),phone:d.required("Enter phone number"),dob_full:o(a).required("Enter date of birth"),ssn_last4:t().nullable(),identification_number:l,address:b(!1)}))(a),$=(a,s)=>s?(a=>e({name:c.required(`Enter ${a} name`),title:p.nullable(),email:m.nullable(),phone:d.nullable(),dob_full:o(a).nullable(),ssn_last4:t().nullable(),identification_number:E(_.CAN).nullable(),address:f(!0)}))(a):(a=>e({name:c.required(`Enter ${a} name`),title:p.required(`Enter ${a} title`),email:m.required(`Enter ${a} email`),phone:d.required("Enter phone number"),dob_full:o(a).required("Enter date of birth"),ssn_last4:t().nullable(),identification_number:E(_.CAN),address:f(!1)}))(a),y={[_.USA]:h,[_.CAN]:$};export{b as a,$ as b,f as c,y as d,u as e,h as i}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e={name:"@justifi/webcomponents",version:"6.2.0"};export{e as p}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h as t}from"./p-DwYM91AU.js";import{D as e}from"./p-Dj_zevuD.js";const r=r=>{const{helpText:m,name:o}=r;return m?t("small",{class:"form-text text-muted",id:`form-help-text-${o}`,part:e},m):null};export{r as F}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h as o}from"./p-DwYM91AU.js";import{F as r}from"./p-Dj_zevuD.js";const s=s=>o("h1",{class:`header-1 ${null==s?void 0:s.class}`,part:r},s.text);export{s as H}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h as o}from"./p-DwYM91AU.js";import{W as r}from"./p-Dj_zevuD.js";const s=s=>o("h3",{class:`header-3 ${null==s?void 0:s.class}`,part:r},s.text);export{s as H}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as e}from"./p-BYsgavgS.js";import{P as n}from"./p-DCIW8z1f.js";const t={accountId:"",authToken:"",billingFormFields:{address_postal_code:""},bnplEnabled:!1,applePayEnabled:!1,insuranceEnabled:!1,bnplProviderApiVersion:"",bnplProviderCheckoutUrl:"",bnplProviderClientId:"",bnplProviderMode:"",checkoutId:"",checkoutLoaded:!1,bankAccountVerification:void 0,disableBankAccount:!1,disableCreditCard:!1,disablePaymentMethodGroup:!1,paymentAmount:0,paymentCurrency:"USD",paymentDescription:"",paymentMethodGroupId:void 0,paymentMethods:[],paymentToken:void 0,savePaymentMethod:!1,selectedPaymentMethod:void 0,totalAmount:0,plaidPublicToken:void 0,plaidLinkTokenId:void 0},{state:a,onChange:o}=e(t);function d(){var e;const t=[];if(!a.disablePaymentMethodGroup&&(null===(e=a.paymentMethods)||void 0===e?void 0:e.length)){const e=a.paymentMethods.some((e=>e.type===n.SAVED_CARD)),o=a.paymentMethods.some((e=>e.type===n.SAVED_BANK_ACCOUNT));e&&!a.disableCreditCard&&t.push(n.SAVED_CARD),o&&!a.disableBankAccount&&t.push(n.SAVED_BANK_ACCOUNT)}return a.disableCreditCard||t.push(n.NEW_CARD),a.disableBankAccount||t.push(n.NEW_BANK_ACCOUNT),a.bnplEnabled&&t.push(n.SEZZLE),a.applePayEnabled&&t.push(n.APPLE_PAY),!0!==a.bankAccountVerification||a.disableBankAccount||t.push(n.PLAID),t}function i(){return{selectedPaymentMethod:a.selectedPaymentMethod,paymentAmount:a.paymentAmount,totalAmount:a.totalAmount,paymentCurrency:a.paymentCurrency,paymentDescription:a.paymentDescription,savedPaymentMethods:a.paymentMethods,savePaymentMethod:a.savePaymentMethod,bnplEnabled:a.bnplEnabled,applePayEnabled:a.applePayEnabled,insuranceEnabled:a.insuranceEnabled,disableBankAccount:a.disableBankAccount,disableCreditCard:a.disableCreditCard,disablePaymentMethodGroup:a.disablePaymentMethodGroup}}function r(e){Object.keys(t).forEach((n=>{o(n,(t=>e(n,t)))}))}Object.keys(t).forEach((e=>{o(e,(n=>{a[e]=n}))}));export{i as a,o as b,a as c,d as g,r as o}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h as s}from"./p-DwYM91AU.js";import{R as r}from"./p-Dj_zevuD.js";const t=()=>s("div",{class:"d-flex justify-content-center"},s("div",{class:"spinner-border",role:"status",part:r},s("span",{class:"visually-hidden"},"Loading...")));export{t as S}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./p-DiJD6Iqx.js";import{S as a,C as t}from"./p-B5rtFhtR.js";import{a as s}from"./p-DfKxeSrC.js";import{b as r,r as n,s as i,a as l}from"./p-CPpUGsw5.js";const u=e=>""===e?null:e,c=/^\d+$/,d=/P\.?\s?O\.?\s?Box|Postal\sBox/i,o=e().email("Enter valid email").transform(u),m=e().matches(/^\d{10}$/,"Enter valid phone number").transform(u),b=e().min(2,"Name must be at least 2 characters").max(100,"Name must be less than 100 characters").transform(u),h=e().min(2,"Name must be at least 2 characters").max(100,"Name must be less than 100 characters").transform(u),v=e().matches(/^(?:http(s)?:\/\/)?(?:www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)$/,"Enter valid website url").transform(u),E=e().transform(u),N=e().min(2,"Industry must be at least 2 characters").max(50,"Industry must be less than 50 characters").transform(u),p=e().matches(c,"Enter valid tax id, SSN, or EIN").test("not-repeat","Enter valid tax id, SSN, or EIN",(e=>!/^(\d)\1+$/.test(e))).test("not-seq","Enter valid tax id, SSN, or EIN",(e=>"123456789"!==e)).transform(u),S=a=>e().matches(s[a].postalRegex,"Enter valid postal code").transform(u),w=a=>a===t.CAN?e().matches(c,"Enter valid SIN").length(s[a].identityDigits,"Enter valid SIN").when("ssn_last4",{is:e=>!e||0===e.length,then:e=>e.required("Enter SIN"),otherwise:e=>e.nullable()}).test("not-repeat","Enter valid SIN",(e=>!/^(\d)\1+$/.test(e))).test("not-seq","Enter valid SIN",(e=>"123456789"!==e)).transform(u):$,g=a=>a===t.CAN?e().matches(c,"Enter valid Business Number (BN)").length(s[a].taxIdDigits,"Enter valid Business Number (BN)").test("not-repeat","Enter valid Business Number (BN)",(e=>!/^(\d)\1+$/.test(e))).test("not-seq","Enter valid Business Number (BN)",(e=>"123456789"!==e)).transform(u):p,y=e().test("not-future","Date of incorporation cannot be in the future",(e=>new Date(e)<=new Date)).transform(u),B=e().min(2,"Name must be at least 2 characters").max(100,"Name must be less than 100 characters").transform(u),x=e().min(2,"Title must be at least 2 characters").max(50,"Title must be less than 50 characters").transform(u),A=a=>e().test("min","Enter a valid date",(e=>new Date(e)>=new Date("1902-01-01"))).test("age",`${a} must be at least 18 years old`,(e=>{const a=new Date(e),t=new Date;return t.setFullYear(t.getFullYear()-18),a<=t})).transform(u),$=e().matches(/^(?!000|666|9\d{2})\d{3}(?!00)\d{2}(?!0000)\d{4}$/,"Enter valid SSN").when("ssn_last4",{is:e=>!e||0===e.length,then:e=>e.required("Enter SSN"),otherwise:e=>e.nullable()}).test("not-repeat","Enter valid SSN",(e=>!/^(\d)\1+$/.test(e))).test("not-seq","Enter valid SSN",(e=>"123456789"!==e)).transform(u),D=e().min(5,"Address must be at least 5 characters").max(100,"Address must be less than 100 characters").test("not-po-box","A PO Box is not a valid address entry",(e=>!d.test(e))).transform(u),I=e().max(100,"Address must be less than 100 characters").test("not-po-box","A PO Box is not a valid address entry",(e=>!d.test(e))).transform(u),f=e().min(2,"City must be at least 2 characters").max(50,"City must be less than 50 characters").transform(u),C=e().oneOf(a.map((e=>e.value)),"Enter a 2-letter state abbreviation, such as CA").transform(u),q=e().matches(/^[0-9]{5}$/,"Enter valid postal code").transform(u),_=e().matches(c,"Enter valid revenue").transform(u),j=e().matches(c,"Enter valid payment volume").transform(u),P=e().oneOf(r.map((e=>e.value)),"Select when service is received").transform(u),z=e().oneOf(n.map((e=>e.value)),"Select recurring payments").transform(u),O=e().when("business_recurring_payments",{is:e=>"Yes"===e,then:e=>e.required("Enter recurring payments percentage"),otherwise:e=>e.nullable()}).transform(u),F=e().oneOf(i.map((e=>e.value)),"Select seasonal business").transform(u),G=e().transform(u),R=e().min(2,"Name must be at least 2 characters").max(50,"Name must be less than 50 characters").transform(u),T=e().min(2,"Name must be at least 2 characters").max(50,"Name must be less than 50 characters").transform(u),Z=e().oneOf(l.map((e=>e.value)),"Select account type").transform(u),k=e().min(4,"Account number must be at least 4 digits").max(17,"Account number must be less than 17 digits").matches(c,"Enter valid account number").test("not-repeat","Enter valid account number",(e=>!/^(\d)\1+$/.test(e))).transform(u),H=e().length(9,"Routing number must be 9 digits").matches(c,"Enter valid routing number").test("not-repeat","Enter valid routing number",(e=>!/^(\d)\1+$/.test(e))).test("valid","Enter valid routing number",(e=>(e=>{if(!e)return!1;const a=Array.from(String(e),Number);return 9===a.length&&0==(3*(a[0]+a[3]+a[6])+7*(a[1]+a[4]+a[7])+(a[2]+a[5]+a[8]))%10})(e))).transform(u);export{w as A,k as B,Z as C,T as D,R as E,c as F,H as G,C as H,h as a,E as b,b as c,y as d,o as e,z as f,P as g,j as h,N as i,_ as j,f as k,I as l,g as m,D as n,G as o,m as p,q,O as r,F as s,p as t,S as u,$ as v,v as w,A as x,x as y,B as z}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h as r}from"./p-DwYM91AU.js";import{E as t}from"./p-Dj_zevuD.js";const e=e=>{const{errorText:o,name:s}=e;return o?r("small",{class:"form-text text-danger",id:`form-error-text-${s}`,part:t},o):null};export{e as F}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h as t}from"./p-DwYM91AU.js";import{C as e}from"./p-Dj_zevuD.js";const s=({component:s="div",height:o,width:r,className:i,styles:a={}})=>{const c=Object.assign(Object.assign({},a),{width:r,height:o});return t(s,{class:`${i} skeleton`,style:c,part:e,"aria-hidden":"true"})};export{s as S}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,h as t}from"./p-DwYM91AU.js";import{B as a}from"./p-DkOvNRJs.js";import{ah as s,ai as r}from"./p-Dj_zevuD.js";const c=e=>{const t=["after_cursor","before_cursor"];return!!Object.keys(e).filter((e=>!t.includes(e))).length},d=class{constructor(t){e(this,t),this.showClearButton=!1}watchParamsHandler(e){this.showClearButton=c(e)}show(){this.menu.classList.add("show")}hide(){this.menu.classList.remove("show")}componentWillLoad(){this.showClearButton=c(this.params)}render(){return t("div",{key:"14b8c9b28e6db7921a0b504cdac9d09cc51e250c",class:"d-flex gap-2"},t("div",{key:"8017069d76200797bb796062c500f5139dd103e1",class:"dropdown pb-3"},t("button",{key:"12e81650b0c2649d3be74f82744ed6195af4bdae",type:"button dropdown-toggle",ref:e=>this.anchorButton=e,class:"btn btn-primary dropdown-toggle",part:s,"data-test-id":"open-filters-button","data-bs-toggle":"dropdown"},"Filters"),t("custom-popper",{key:"f123c078509a97e24499f909457cefa697c3f18d",offset:[20,10],strategy:"fixed",anchorRef:this.anchorButton,trigger:"click"},t("form",{key:"f983f848d4bebd40c734ecc7e44a28fa8bcae060",class:"dropdown-menu",part:r,"data-test-id":"filter-menu",ref:e=>this.menu=e,onSubmit:e=>e.preventDefault()},t("slot",{key:"22ab7f6e07726f2a92008937a7cd1a7dc0b95727"})))),t("div",{key:"51e56c9fea70c03e1738e5baacbdf88432cc78cb"},t(a,{key:"d33af17298a3fa68906ba8b490133db9b294c695",variant:"secondary",onClick:()=>this.clearParams(),hidden:!this.showClearButton,"data-test-id":"clear-filters-button"},"Clear Filters")))}static get watchers(){return{params:["watchParamsHandler"]}}};export{d as table_filters_menu}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as s,h as a,H as e}from"./p-DwYM91AU.js";import{b as i,U as o,a as r,c as h,l as f,V as c}from"./p-Dj_zevuD.js";import{F as n}from"./p-C2gAiiwJ.js";import{F as l}from"./p-JvWiY69B.js";import"./p-CZfYo5-1.js";import{f as p}from"./p-BS7OgSQe.js";import"./p-HXpYMWUU.js";const m=class{constructor(a){t(this,a),this.formControlInput=s(this,"formControlInput"),this.formControlBlur=s(this,"formControlBlur"),this.isFocused=!1,this.defaultValue="0",this.formatRawValue=t=>t.replace(/\D/g,""),this.formatDisplayValue=t=>p(+t,void 0,!0),this.updateInput=t=>{const s=this.formControl.name,a=this.formatRawValue(t);this.formControl.value=this.formatDisplayValue(a),this.inputHandler(s,a),this.formControlInput.emit({name:s,value:a})}}handleDefaultValueChange(t){this.updateInput(t)}componentDidLoad(){this.updateInput(this.defaultValue)}get inputPart(){return this.errorText?i:this.disabled?o:this.isFocused?r:h}render(){return a(e,{key:"ae64aa9000fff01313371b755f0e20925fbd005b"},a("div",{key:"f40ae8e775f4ea3ab811f8f2985e30dca5c37c1e",class:"form-group d-flex flex-column"},a("label",{key:"1f4283cc32579ef12c225ae5a1f1fff1c8142128",part:f,class:"form-label",htmlFor:this.name},this.label),a(n,{key:"f991dae37527a94cc4b98ed766361a7d97b6214b",name:this.name,helpText:this.helpText}),a("div",{key:"86ecd5f81238c8675b59c7a0b6a3629b49a0109c",class:"input-group"},a("span",{key:"04a5576a92c024926f320f7a121c34cf43ebcac8",class:"input-group-text",part:c},"$"),a("input",{key:"76f05aa792ae96d1d3302ef627e35cab538a6fdb",ref:t=>this.formControl=t,id:this.name,name:this.name,onFocus:()=>this.isFocused=!0,onBlur:()=>{this.isFocused=!1,this.formControlBlur.emit()},onInput:t=>this.updateInput(t.target.value),onKeyDown:this.keyDownHandler,onPaste:this.keyDownHandler,maxLength:this.maxLength,part:this.inputPart,class:this.errorText?"form-control is-invalid":"form-control",type:"text",disabled:this.disabled})),a(l,{key:"b28032e69108ff37485080e2e9f284cc30d10697",errorText:this.errorText,name:this.name})))}static get watchers(){return{defaultValue:["handleDefaultValueChange"]}}};export{m as form_control_monetary}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as s,h as e,H as a}from"./p-DwYM91AU.js";import{a5 as i,a6 as h,a7 as r,a8 as c,a9 as o,l as f}from"./p-Dj_zevuD.js";const l=class{constructor(e){t(this,e),this.formControlInput=s(this,"formControlInput"),this.formControlBlur=s(this,"formControlBlur"),this.isFocused=!1,this.handleFormControlInput=t=>{const s=t.target.getAttribute("name");this.inputHandler(s,this.value),this.formControlInput.emit({name:s,value:this.value})}}get part(){return this.errorText?i:this.isFocused&&this.checked?h:this.checked?r:this.isFocused?c:o}render(){return e(a,{key:"0e904c8de95f266bc709f9b3c1fb7c58c303a24c",class:"form-group d-flex flex-column"},e("div",{key:"24dd45066d45495f108aa30262d2e74f257c3d4a",class:"form-check"},e("input",{key:"12b5f8e62d22a4c0a4f54fc6842911c3a6664106",ref:t=>this.radioElement=t,type:"radio",id:`${this.name}-${this.value}`,name:this.name,onFocus:()=>this.isFocused=!0,onBlur:()=>{this.isFocused=!1,this.formControlBlur.emit()},onChange:this.handleFormControlInput,part:this.part,class:this.errorText?"form-check-input is-invalid":"form-check-input",disabled:this.disabled,value:this.value,checked:this.checked}),e("label",{key:"dad68c4bb27faeeb5c94a92d89ed747bbd865e78",class:"form-check-label",htmlFor:`${this.name}-${this.value}`,part:f},this.label)),e("form-control-help-text",{key:"6c3cbe742fb61272e10c7d615c744853151bc5dc",helpText:this.helpText,name:this.name}),e("form-control-error-text",{key:"9e2f85f6065e418f5b8a58bbaae86d44f6da9859",errorText:this.errorText,name:this.name}))}};export{l as form_control_radio}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h as t,r as e,c as a}from"./p-DwYM91AU.js";import"./p-tGDdRx0W.js";import"./p-HXpYMWUU.js";import{C as s,a as i}from"./p-Cjcsf8ku.js";import{g as r}from"./p-CPKSE7M4.js";import{p as n}from"./p-CLHwhyvu.js";import"./p-B5rtFhtR.js";import"./p-BH0Xfn-F.js";import{c as o,J as c}from"./p-pV1ZX4A8.js";import{g as p,a as h}from"./p-D2muobcE.js";import{P as d}from"./p-C9_8N76_.js";import{T as f,l,a as u,b as m,c as y,d as b,e as _,f as j,g,h as T,i as k,j as w,k as v}from"./p-B-7rLJIB.js";import{S as C}from"./p-BP2sTIQV.js";import{T as S}from"./p-CZfYo5-1.js";import{a as D}from"./p-BS7OgSQe.js";import{S as F,T as I}from"./p-Dj_zevuD.js";import"./p-BYsgavgS.js";import"./p-BjCdImSF.js";import"./p-C8yN3uBj.js";import"./p-CgbXzEbz.js";const R={created_at:()=>t("th",{part:F,scope:"col",title:"The date and time each transaction was made"},"Processed On"),type:()=>t("th",{part:F,scope:"col",title:"The type of each transaction"},"Type"),id:()=>t("th",{part:F,scope:"col",title:"The unique identifier of each transaction"},"ID"),amount:()=>t("th",{part:F,scope:"col",title:"The dollar amount of each transaction",class:"text-end"},"Amount"),balance:()=>t("th",{part:F,scope:"col",title:"The running total amount of this payment that belongs to you",class:"text-end"},"Balance"),currency:()=>t("th",{part:F,scope:"col",title:"The currency of each transaction"},"Currency"),financial_transaction_id:()=>t("th",{part:F,scope:"col",title:"The unique identifier of the financial transaction associated with the payment balance transaction"},"Financial Transaction ID"),payment_id:()=>t("th",{part:F,scope:"col",title:"The unique identifier of the payment associated with the payment balance transaction"},"Payment ID"),payment_balance_txn_type:()=>t("th",{part:F,scope:"col",title:"The type of the payment balance transaction"},"Transaction Type"),source_id:()=>t("th",{part:F,scope:"col",title:"The unique identifier of the source object associated with the payment balance transaction"},"Source ID"),source_type:()=>t("th",{part:F,scope:"col",title:"The type of the source object associated with the payment balance transaction"},"Source Type")},B={ach_return:"ACH Return",ach_return_fee:"ACH Return Fee",dispute:"Dispute",dispute_fee:"Dispute Fee",dispute_fee_refund:"Dispute Fee Refund",dispute_refund:"Dispute Refund",payment:"Payment",payment_fee:"Fee",refund:"Refund",fee_refund:"Fee Refund",application_fee_returned:"Application Fee Returned",refund_failure:"Refund Failure",void:"Void"},x={created_at:(e,a)=>t("td",{part:I(a)},t("div",{class:"fw-bold"},D(e.created_at,{showDisplayDate:!0})),t("div",{class:"fw-bold"},D(e.created_at,{showTime:!0}))),type:(e,a)=>t("td",{part:I(a)},B[e.payment_balance_txn_type]),id:(e,a)=>t("td",{part:I(a)},e.id),amount:(e,a)=>t("td",{part:I(a),class:"text-end"},e.formattedPaymentAmount(e.amount)),balance:(e,a)=>t("td",{part:I(a),class:"text-end"},e.formattedPaymentAmount(e.balance)),currency:(e,a)=>t("td",{part:I(a)},e.currency),financial_transaction_id:(e,a)=>t("td",{part:I(a)},e.financial_transaction_id),payment_id:(e,a)=>t("td",{part:I(a)},e.payment_id),payment_balance_txn_type:(e,a)=>t("td",{part:I(a)},e.payment_balance_txn_type),source_id:(e,a)=>t("td",{part:I(a)},e.source_id),source_type:(e,a)=>t("td",{part:I(a)},e.source_type)},E=class{constructor(t){e(this,t),this.clickEvent=a(this,"click-event"),this.errorEvent=a(this,"error-event"),this.balanceTransactions=[],this.isLoading=!0,this.errorMessage=null,this.paging=n,this.pagingParams={},this.columns="created_at,type,id,amount,balance",this.handleClickPrevious=t=>{this.pagingParams={before_cursor:t},this.clickEvent.emit({name:S.previous})},this.handleClickNext=t=>{this.pagingParams={after_cursor:t},this.clickEvent.emit({name:S.next})},this.rowClickHandler=t=>{const e=t.target.closest("tr").dataset.rowEntityId;if(!e)return;const a=this.balanceTransactions.find((t=>t.id===e));this.clickEvent.emit({name:S.row,data:a})}}componentWillLoad(){this.transactionsTable=new f(this.balanceTransactions,this.columns,R,x),o(),this.analytics=new c(this),this.initializeApi()}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}propChanged(){this.initializeApi()}handleError(t,e,a){this.isLoading=!1,this.errorEvent.emit({errorCode:t,message:e,severity:a})}initializeApi(){this.paymentId&&this.authToken?(({id:t,authToken:e,service:a})=>async({params:i,onSuccess:n,onError:o,final:c})=>{var d;try{const c=await a.fetchPaymentTransactions(t,e,i);c.error?o({error:h(c.error),code:p(null===(d=c.error)||void 0===d?void 0:d.code),severity:s.ERROR}):n({balanceTransactions:c.data.map((t=>new r(t))),pagingInfo:Object.assign({},c.page_info)})}catch(t){const e=p(null==t?void 0:t.code);o({error:h(t),code:e,severity:s.ERROR})}finally{c()}})({id:this.paymentId,authToken:this.authToken,service:new d})({params:this.pagingParams,onSuccess:({balanceTransactions:t,pagingInfo:e})=>{this.balanceTransactions=t,this.paging=e,this.transactionsTable.collectionData=this.balanceTransactions},onError:({error:t,code:e,severity:a})=>{this.errorMessage=t.message,this.handleError(t,e,a)},final:()=>{this.isLoading=!1}}):(this.errorMessage="payment-id and auth-token props are required",this.handleError(i.MISSING_PROPS,this.errorMessage,s.ERROR))}get entityId(){return this.balanceTransactions.map((t=>t.id))}get showEmptyState(){return!this.isLoading&&!this.errorMessage&&this.transactionsTable.rowData.length<1}get showErrorState(){return!this.isLoading&&!!this.errorMessage}get showRowData(){return!this.showEmptyState&&!this.showErrorState&&!this.isLoading}render(){return t(C,{key:"ce4fd1549223738580d3a4e9195f535619491f5a"},t(l,{key:"0991e7ca748e75fa42e96be1dd1c9e9d2c876db9"},t(u,{key:"1b5d58cbf6f27fdf2faef658ae6148ee642ad3fe"},t(m,{key:"5eaef864fe0072cd4557a0585a409572f6806969"},t(y,{key:"a9c35dd1c0031da4a82207a4313c9a521729db40"},this.transactionsTable.columnData.map((t=>t)))),t(b,{key:"1ed790fcc17bbb6a93f6eaf18b741fc3b2e80855"},t(_,{key:"64570f5736317dfabc97a7967dfa52dbc0dd384c",columnSpan:this.transactionsTable.columnKeys.length,isLoading:this.isLoading}),t(j,{key:"45d4d52687e203de3c5f45e406862b882c03757c",isEmpty:this.showEmptyState,columnSpan:this.transactionsTable.columnKeys.length}),t(g,{key:"b8c941adc6bad5e40edd33b69231b668f587f16b",columnSpan:this.transactionsTable.columnKeys.length,errorMessage:this.errorMessage}),this.showRowData&&this.transactionsTable.rowData.map(((e,a)=>t(T,{"data-test-id":"table-row","data-row-entity-id":this.entityId[a],onClick:this.rowClickHandler},e)))),this.paging&&t(k,{key:"a76f922158b408ff6a70c35a47531405c012aaae"},t(w,{key:"4cf90633de51f6e9286481300cbbe0f0183f1bfb"},t(v,{key:"c06c168e8ba7c3115eab18c8366362be16582f86",colSpan:this.transactionsTable.columnData.length},t("pagination-menu",{key:"f08aa685537d1ba529f5506d74bdc20d0352dd2b",paging:Object.assign(Object.assign({},this.paging),{handleClickPrevious:this.handleClickPrevious,handleClickNext:this.handleClickNext})})))))))}static get watchers(){return{pagingParams:["propChanged"],paymentId:["propChanged"],authToken:["propChanged"]}}};export{E as justifi_payment_transactions_list}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h as t,r as e,c as i,H as s,g as n}from"./p-DwYM91AU.js";import{A as a}from"./p-C8yN3uBj.js";import{S as o}from"./p-BP2sTIQV.js";import"./p-CZfYo5-1.js";import{S as r}from"./p-VhOlg78I.js";import{c as l,o as c,g as h,a as d,b as u}from"./p-CbBTgsKC.js";import{D as p,r as y}from"./p-Dj_zevuD.js";import{f as m}from"./p-BS7OgSQe.js";import{H as v}from"./p-C7m-gAAM.js";import{H as M,b as f,h as b,i as g}from"./p-DwLZbA7D.js";import{H as k}from"./p-CO8ZJ0jB.js";import{J as w,c as j}from"./p-pV1ZX4A8.js";import"./p-tGDdRx0W.js";import"./p-HXpYMWUU.js";import{C as A,a as T,b as P}from"./p-Cjcsf8ku.js";import{I as N}from"./p-CPKSE7M4.js";import"./p-CLHwhyvu.js";import"./p-B5rtFhtR.js";import"./p-BH0Xfn-F.js";import{g as I,a as C}from"./p-D2muobcE.js";import{C as E}from"./p-BItPr6Gj.js";import{P as D,a as S,b as O}from"./p-DCIW8z1f.js";import{C as x}from"./p-ZpPDShvP.js";import"./p-BYsgavgS.js";import"./p-BjCdImSF.js";var L,z,_,R,U;!function(t){t.STATUS_SUCCESS="STATUS_SUCCESS",t.STATUS_FAILURE="STATUS_FAILURE"}(L||(L={})),function(t){t.PLAIN="plain",t.BUY="buy",t.SET_UP="set-up",t.DONATE="donate",t.CHECK_OUT="check-out",t.BOOK="book",t.SUBSCRIBE="subscribe"}(z||(z={})),function(t){t.BLACK="black",t.WHITE="white",t.WHITE_OUTLINE="white-outline"}(_||(_={})),function(t){t.SUPPORTS_3DS="supports3DS",t.SUPPORTS_EMV="supportsEMV",t.SUPPORTS_CREDIT="supportsCredit",t.SUPPORTS_DEBIT="supportsDebit"}(R||(R={}));class B{constructor(t){this.merchantIdentifier=t.merchantIdentifier,this.displayName=t.displayName,this.initiative=t.initiative,this.initiativeContext=t.initiativeContext,this.buttonType=t.buttonType||z.PLAIN,this.buttonStyle=t.buttonStyle||_.BLACK,this.buttonLocale=t.buttonLocale||"en-US"}get isValid(){return!!(this.merchantIdentifier&&this.displayName&&this.initiative&&this.initiativeContext)}}class Y{constructor(t){this.countryCode=t.countryCode,this.currencyCode=t.currencyCode,this.merchantCapabilities=t.merchantCapabilities,this.supportedNetworks=t.supportedNetworks,this.total=t.total,this.lineItems=t.lineItems,this.shippingMethods=t.shippingMethods,this.applicationData=t.applicationData,this.supportedCountries=t.supportedCountries}get isValid(){var t,e,i,s;return!!(this.countryCode&&this.currencyCode&&(null===(t=this.merchantCapabilities)||void 0===t?void 0:t.length)&&(null===(e=this.supportedNetworks)||void 0===e?void 0:e.length)&&(null===(i=this.total)||void 0===i?void 0:i.label)&&(null===(s=this.total)||void 0===s?void 0:s.amount))}}class F{static isApplePaySupported(){var t;return"undefined"!=typeof window&&"ApplePaySession"in window&&(null===(t=window.ApplePaySession)||void 0===t?void 0:t.supportsVersion(3))}static canMakePayments(){var t;return this.isApplePaySupported()&&(null===(t=window.ApplePaySession)||void 0===t?void 0:t.canMakePayments())||!1}static async canMakePaymentsWithActiveCard(t){var e;if(!this.isApplePaySupported())return!1;try{return await(null===(e=window.ApplePaySession)||void 0===e?void 0:e.canMakePaymentsWithActiveCard(t))||!1}catch(t){return console.error("Error checking Apple Pay active card:",t),!1}}static formatAmount(t){return(t/100).toFixed(2)}static parseAmount(t){return Math.round(100*parseFloat(t))}static createLineItem(t,e,i="final"){return{label:t,amount:this.formatAmount(e),type:i}}static getDefaultSupportedNetworks(){return["amex","discover","masterCard","visa"]}static getDefaultMerchantCapabilities(){return[R.SUPPORTS_3DS,R.SUPPORTS_EMV,R.SUPPORTS_CREDIT,R.SUPPORTS_DEBIT]}}!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"}(U||(U={}));class Q{constructor(){this.api=a()}initialize(t){if(this.applePayConfig=new B(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.host,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 F.isApplePaySupported()&&F.canMakePayments()}async canMakePaymentsWithActiveCard(){if(!this.applePayConfig)throw new Error("Apple Pay not initialized. Call initialize() first.");return await F.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 Y(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,n)=>{try{if("undefined"==typeof window||!("ApplePaySession"in window))return console.error("[ApplePayService] ApplePaySession not available on window"),n({success:!1,error:{code:U.UNAVAILABLE,message:"ApplePaySession API is not available in this environment"}});this.currentSession=new window.ApplePaySession(3,s),this.setupSessionEventHandlers(t,n,e,i),this.currentSession.begin()}catch(t){console.error("[ApplePayService] Exception while starting session:",t),n({success:!1,error:{code:U.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:U.MERCHANT_VALIDATION_ERROR,message:t instanceof Error?t.message:"Merchant validation failed"}})}},this.currentSession.onpaymentauthorized=async n=>{try{const a=n.payment,o=Object.assign(Object.assign({},a.token),{product_details:{name:this.currentPaymentRequest.total.label,price:F.parseAmount(this.currentPaymentRequest.total.amount),description:this.currentPaymentRequest.total.label}}),r=await this.processPayment(i,s,o);r.success?(this.currentSession.completePayment({status:L.STATUS_SUCCESS}),t({success:!0,token:a.token,paymentMethodId:r.data.id})):(console.error("PSP reported payment failure:",r.data),this.currentSession.completePayment({status:L.STATUS_FAILURE}),e({success:!1,error:{code:U.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:L.STATUS_FAILURE}),e({success:!1,error:{code:U.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:L.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:U.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:U.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:F.getDefaultMerchantCapabilities(),supportedNetworks:F.getDefaultSupportedNetworks(),total:F.createLineItem(e,t)}}getApplePayConfig(){return this.applePayConfig}}const V=e=>{const{isLoading:i}=e;return i?t("div",{class:"container-fluid p-0"},t("div",{class:"row mb-3"},t("div",{class:"col-12 align-content-center"},t(r,{height:"44px",width:"100%",styles:{borderRadius:"8px"}})))):null},H=e=>t("div",{class:"apple-pay-button-container"},t("button",Object.assign({class:(()=>{let t="apple-pay-button";switch(e.buttonStyle){case _.WHITE:t+=" apple-pay-button-white";break;case _.WHITE_OUTLINE:t+=" apple-pay-button-white-outline";break;default:t+=" apple-pay-button-black"}switch(e.buttonType){case z.BUY:t+=" apple-pay-button-type-buy";break;case z.DONATE:t+=" apple-pay-button-type-donate";break;default:t+=" apple-pay-button-type-plain"}return(e.disabled||e.isProcessing||!e.isAvailable)&&(t+=" disabled"),t})(),style:{width:e.width,height:e.height},onClick:()=>{!e.disabled&&!e.isProcessing&&e.isAvailable&&e.clickHandler&&e.clickHandler()},disabled:e.disabled||e.isProcessing||!e.isAvailable,"aria-label":"Pay with Apple Pay",type:"button"},e),e.isProcessing&&t("div",{class:"processing-overlay"},t("div",{class:"spinner"}),t("span",null,"Processing..."))),t("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 ")),Z=class{constructor(t){e(this,t),this.applePayStarted=i(this,"applePayStarted"),this.applePayCompleted=i(this,"applePayCompleted"),this.applePayCancelled=i(this,"applePayCancelled"),this.applePayError=i(this,"applePayError"),this.countryCode="US",this.merchantIdentifier="merchant.com.staging-justifi.checkout-dev",this.merchantDisplayName="JustiFi Checkout",this.initiativeContext="dev-checkout.justifi-staging.com",this.buttonType=z.PLAIN,this.buttonStyle=_.BLACK,this.disabled=!1,this.showSkeleton=!0,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;if(!this.isProcessing&&!this.disabled&&this.isAvailable)try{this.isProcessing=!0,this.error=null,this.applePayStarted.emit();const i={countryCode:this.countryCode,currencyCode:l.paymentCurrency,merchantCapabilities:[R.SUPPORTS_3DS,R.SUPPORTS_CREDIT,R.SUPPORTS_DEBIT],supportedNetworks:F.getDefaultSupportedNetworks(),total:F.createLineItem(l.paymentDescription,l.paymentAmount)},s=await this.applePayService.startPaymentSession(i,l.authToken,l.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)||Z.ErrorCode.PAYMENT_FAILED}))}catch(t){const e=t instanceof Error?t.message:"Payment failed";this.error=e,this.applePayError.emit({error:e,code:Z.ErrorCode.PAYMENT_FAILED}),this.applePayCompleted.emit({success:!1,error:e})}finally{this.isProcessing=!1}}}async initializeApplePay(){try{if(this.isLoading=!0,this.error=null,this.isConfigValid=!0,!(Boolean(l.paymentAmount)&&Boolean(l.paymentCurrency)&&Boolean(l.authToken)))return this.error="Missing required Apple Pay configuration",this.isConfigValid=!1,console.error("Apple Pay config error: missing required values",{paymentAmount:l.paymentAmount,paymentCurrency:l.paymentCurrency,hasAuthToken:Boolean(l.authToken),accountId:l.accountId}),this.applePayError.emit({error:this.error,code:Z.ErrorCode.CONFIG_ERROR}),void(this.isLoading=!1);if(this.isAvailable=F.isApplePaySupported(),this.canMakePayments=F.canMakePayments(),!this.isAvailable)return this.error="Apple Pay is not supported on this device",console.error(this.error),this.applePayError.emit({error:this.error,code:Z.ErrorCode.NOT_SUPPORTED}),void(this.isLoading=!1);if(!this.canMakePayments)return this.error="Apple Pay is not available",console.error(this.error),this.applePayError.emit({error:this.error,code:Z.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 Q,this.applePayService.initialize(t),await this.applePayService.canMakePaymentsWithActiveCard()||console.warn("No Apple Pay cards available, but continuing...")}catch(t){console.error("Apple Pay initialization error:",t),this.error=t instanceof Error?t.message:"Failed to initialize Apple Pay",this.applePayError.emit({error:this.error,code:Z.ErrorCode.INITIALIZATION_ERROR})}finally{this.isLoading=!1}}async isSupported(){return this.isAvailable&&this.canMakePayments}async getPaymentMethods(){return this.isAvailable?F.getDefaultSupportedNetworks():[]}async abort(){this.applePayService.abortPaymentSession(),this.isProcessing=!1,this.applePayCancelled.emit()}render(){if(!l.applePayEnabled)return null;const e=!this.isLoading&&this.isAvailable&&this.canMakePayments&&this.isConfigValid;return t(o,null,l.checkoutLoaded&&t("script",{async:!0,src:"https://applepay.cdn-apple.com/jsapi/1.latest/apple-pay-sdk.js",onLoad:()=>{this.initializeApplePay()}}),t("div",{class:"apple-pay-container"},t(V,{isLoading:this.isLoading}),e&&t(H,{buttonType:this.buttonType,buttonStyle:this.buttonStyle,disabled:this.disabled,isProcessing:this.isProcessing,isAvailable:this.isAvailable,clickHandler:this.handleApplePayClick,width:this.width,height:this.height})),t("style",null,"\n .apple-pay-container {\n width: 100%;\n }\n "))}};Z.ErrorCode={CONFIG_ERROR:"CONFIG_ERROR",NOT_SUPPORTED:"NOT_SUPPORTED",NOT_AVAILABLE:"NOT_AVAILABLE",INITIALIZATION_ERROR:"INITIALIZATION_ERROR",PAYMENT_FAILED:"PAYMENT_FAILED"};const W=class{constructor(t){e(this,t)}render(){return t(o,{key:"fd2c61dcafdc800d0064c19d29c6e007aed5adb5"},t("section",{key:"f2abef1233f3ccad3982d10c61ec5765e13e27a5"},t("div",{key:"713d66ef6f7e2fc73135e765069baba6df976f52"},t("div",{key:"b8dd28f257948aa317366fe3ea6d2bc4911ef164",part:p},null==l?void 0:l.paymentDescription),t("div",{key:"675676b40de7dc27d07bfafc0eee77eb855a3d26"},t("span",{key:"cbd47994d9c3f1518741a298de3f5d62a0ad5313",part:p},"Total")," ",t("span",{key:"614748853f666f1b072d4fa9b14ee15ef5717112",part:p},m(+(null==l?void 0:l.totalAmount)))))))}},q=class{constructor(t){e(this,t),this.levels={h1:v,h2:M,h3:k},this.level="h1"}render(){return t(o,{key:"89edcc4c5a478317da615d276af05cac241c1867"},t(this.levels[this.level],{key:"a5c01967f8809fd6b824ddc8730599041ae31822",text:this.text,class:this.class}))}},G=a();class J{async getLinkToken(t,e,i,s){return G.post({endpoint:`plaid/${e}/link`,body:{checkout_id:i},authToken:t,signal:s})}async tokenizeBankAccount(t,e,i,s,n,a){const o=`plaid/${e}/tokenize`,r={public_token:i};return s&&(r.link_token_id=s),n&&(r.payment_method_group_id=n),G.post({endpoint:o,body:r,authToken:t,signal:a})}}const X=class{constructor(t){e(this,t),this.errorEvent=i(this,"error-event"),this.submitEvent=i(this,"submit-event"),this.checkoutChangedEvent=i(this,"checkout-changed"),this.plaidService=new J,this.handleApplePayCompleted=t=>{const{success:e,token:i,paymentMethodId:s,error:n}=t.detail;e&&i?(l.paymentToken=s,l.selectedPaymentMethod={type:D.APPLE_PAY},this.submitCheckout()):(console.error("Apple Pay completed but failed:",n),this.errorEvent.emit({message:(null==n?void 0:n.message)||"Apple Pay payment failed",errorCode:T.TOKENIZE_ERROR,severity:A.ERROR}))},this.handleApplePayError=t=>{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:A.ERROR})},this.handleApplePayCancelled=()=>{l.paymentToken=void 0,l.selectedPaymentMethod=void 0}}connectedCallback(){this.observer=new MutationObserver((()=>{this.queryFormRefs(),this.setupApplePayListeners()})),this.observer.observe(this.hostEl,{childList:!0,subtree:!0}),l.checkoutId=this.checkoutId;const t={authToken:this.authToken,checkoutId:this.checkoutId,service:new E};this.getCheckout=(({authToken:t,checkoutId:e,service:i})=>async({onSuccess:s,onError:n})=>{var a;try{const o=await i.fetchCheckout(t,e);if(o.error)return n({error:C(o.error),code:I(null===(a=o.error)||void 0===a?void 0:a.code),severity:A.ERROR});s({checkout:o.data})}catch(t){const e=I(null==t?void 0:t.code);return n({error:t.message||t,code:e,severity:A.ERROR})}})(t),this.completeCheckout=(({authToken:t,checkoutId:e,service:i})=>async({payment:s,onSuccess:n,onError:a})=>{var o;try{const r=await i.complete(t,e,s);if(r.error)return a({error:C(r.error),code:I(null===(o=r.error)||void 0===o?void 0:o.code),severity:A.ERROR});n({checkout:r.data})}catch(t){const e=I(null==t?void 0:t.code);return a({error:t.message||t,code:e,severity:A.ERROR})}})(t),c((()=>{this.emitCheckoutChanged()}))}componentWillLoad(){this.analytics=new w(this),j(),l.authToken=this.authToken,this.fetchCheckout(),f("set",(t=>{const e=g[t];void 0!==e&&b(t,e)&&this.fetchCheckout()}))}componentDidLoad(){this.queryFormRefs(),this.setupApplePayListeners()}disconnectedCallback(){var t;null===(t=this.observer)||void 0===t||t.disconnect(),this.removeApplePayListeners()}fetchCheckout(){this.authToken&&this.checkoutId?this.getCheckout&&this.getCheckout({onSuccess:({checkout:t})=>{this.updateStore(t),t.status!==N.completed?t.status!==N.expired||this.errorEvent.emit({message:P.CHECKOUT_EXPIRED,errorCode:T.CHECKOUT_EXPIRED,severity:A.ERROR}):this.errorEvent.emit({message:P.CHECKOUT_ALREADY_COMPLETED,errorCode:T.CHECKOUT_ALREADY_COMPLETED,severity:A.ERROR})},onError:t=>{this.errorEvent.emit({message:t.message,errorCode:t.code,severity:t.severity})}}):this.errorEvent.emit({message:P.NOT_AUTHENTICATED,errorCode:T.NOT_AUTHENTICATED,severity:A.ERROR})}updateStore(t){var e,i,s,n,a,o;l.accountId=t.account_id,l.checkoutLoaded=!0,l.paymentMethods=t.payment_methods.map((t=>new S(t))),l.paymentMethodGroupId=t.payment_method_group_id,l.paymentDescription=t.payment_description,l.totalAmount=t.total_amount,l.paymentAmount=t.payment_amount,l.bnplEnabled=t.payment_settings.bnpl_payments,l.insuranceEnabled=t.payment_settings.insurance_payments,l.bankAccountVerification=null===(e=t.payment_settings)||void 0===e?void 0:e.bank_account_verification,l.applePayEnabled=null===(i=t.payment_settings)||void 0===i?void 0:i.apple_payments,l.bnplProviderClientId=null===(s=null==t?void 0:t.bnpl)||void 0===s?void 0:s.provider_client_id,l.bnplProviderMode=null===(n=null==t?void 0:t.bnpl)||void 0===n?void 0:n.provider_mode,l.bnplProviderApiVersion=null===(a=null==t?void 0:t.bnpl)||void 0===a?void 0:a.provider_api_version,l.bnplProviderCheckoutUrl=null===(o=null==t?void 0:t.bnpl)||void 0===o?void 0:o.provider_checkout_url}emitCheckoutChanged(){const t={availablePaymentMethodTypes:h(),selectedPaymentMethod:l.selectedPaymentMethod,savedPaymentMethods:l.paymentMethods};this.checkoutChangedEvent.emit(t)}queryFormRefs(){this.billingFormRef=this.hostEl.querySelector("justifi-billing-form, justifi-bank-account-billing-form-simple, justifi-card-billing-form-simple, justifi-billing-form-full"),this.applePayRef=this.hostEl.querySelector("justifi-apple-pay"),this.paymentMethodFormRef=this.hostEl.querySelector("justifi-card-form, justifi-bank-account-form, justifi-tokenize-payment-method"),this.insuranceFormRef=this.hostEl.querySelector("justifi-season-interruption-insurance")}setupApplePayListeners(){this.applePayRef&&(this.applePayRef.addEventListener("applePayCompleted",this.handleApplePayCompleted),this.applePayRef.addEventListener("applePayError",this.handleApplePayError),this.applePayRef.addEventListener("applePayCancelled",this.handleApplePayCancelled))}removeApplePayListeners(){this.applePayRef&&(this.applePayRef.removeEventListener("applePayCompleted",this.handleApplePayCompleted),this.applePayRef.removeEventListener("applePayError",this.handleApplePayError),this.applePayRef.removeEventListener("applePayCancelled",this.handleApplePayCancelled))}async tokenizePaymentMethod(t){var e,i,s;const n=null!==(i=await(null===(e=this.billingFormRef)||void 0===e?void 0:e.getValues()))&&void 0!==i?i:{},a=Object.assign(Object.assign({},t),n),o=Object.assign({accountId:l.accountId,payment_method_group_id:void 0},a);l.savePaymentMethod&&(o.payment_method_group_id=l.paymentMethodGroupId);const r=await(null===(s=this.paymentMethodFormRef)||void 0===s?void 0:s.tokenize({clientId:this.authToken,paymentMethodMetadata:o,account:l.accountId}));return r.error?r:(l.paymentToken=r.id,r.id)}async setSelectedPaymentMethod(t){l.selectedPaymentMethod=t,l.paymentToken=t.id||void 0}async validate(){var t,e;const i=[];l.insuranceEnabled&&this.insuranceFormRef&&i.push(this.insuranceFormRef.validate());const s=(null===(t=l.selectedPaymentMethod)||void 0===t?void 0:t.type)===D.NEW_CARD,n=(null===(e=l.selectedPaymentMethod)||void 0===e?void 0:e.type)===D.NEW_BANK_ACCOUNT;if((s||n)&&(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:T.VALIDATION_ERROR,severity:A.ERROR}),!1)}catch(t){return!1}}async submitCheckout(t){var e,i,s,n,a;const o=await this.validate();if(!l.selectedPaymentMethod)return void this.errorEvent.emit({message:"No payment method selected.",errorCode:T.VALIDATION_ERROR,severity:A.ERROR});const r=(null===(e=l.selectedPaymentMethod)||void 0===e?void 0:e.type)===D.NEW_CARD,c=(null===(i=l.selectedPaymentMethod)||void 0===i?void 0:i.type)===D.NEW_BANK_ACCOUNT,h=(null===(s=l.selectedPaymentMethod)||void 0===s?void 0:s.type)===D.PLAID;if(r||c){const e=await this.tokenizePaymentMethod(t);if(null==e?void 0:e.error)return void this.errorEvent.emit({message:e.error.message,errorCode:T.TOKENIZE_ERROR,severity:A.ERROR})}if(h&&!l.paymentToken){const t=l.plaidPublicToken,e=l.plaidLinkTokenId;if(!t)return void this.errorEvent.emit({message:"Missing Plaid public token. Please connect your bank.",errorCode:T.TOKENIZE_ERROR,severity:A.ERROR});try{const i=await this.plaidService.tokenizeBankAccount(l.authToken,l.accountId,t,e||void 0,l.savePaymentMethod?l.paymentMethodGroupId:void 0);if(null==i?void 0:i.error)return void this.errorEvent.emit({message:"string"==typeof i.error?i.error:i.error.message||"Failed to tokenize bank account",errorCode:T.TOKENIZE_ERROR,severity:A.ERROR});const s=null==i?void 0:i.data,a=(null===(n=null==s?void 0:s.bank_account)||void 0===n?void 0:n.token)||(null==s?void 0:s.token)||(null==s?void 0:s.id);l.paymentToken=a}catch(t){return void this.errorEvent.emit({message:(null==t?void 0:t.message)||"Plaid exchange error",errorCode:T.TOKENIZE_ERROR,severity:A.ERROR})}}if(!o)return void this.errorEvent.emit({message:"Please fill in all required fields.",errorCode:T.VALIDATION_ERROR,severity:A.ERROR});if(!l.paymentToken)return void this.errorEvent.emit({message:"Payment token not found.",errorCode:T.TOKENIZE_ERROR,severity:A.ERROR});let u;if(u={payment_mode:(t=>{switch(t){case D.NEW_CARD:case D.SAVED_CARD:case D.NEW_BANK_ACCOUNT:case D.SAVED_BANK_ACCOUNT:case D.PLAID:return O.ECOM;case D.SEZZLE:return O.BNPL;case D.APPLE_PAY:return O.APPLE_PAY;default:return}})(null===(a=l.selectedPaymentMethod)||void 0===a?void 0:a.type),payment_token:l.paymentToken},this.preCompleteHook){const t=d();try{await new Promise(((e,i)=>{this.preCompleteHook(t,(()=>e()),(()=>i()))}))}catch(t){return}}this.completeCheckout({payment:u,onSuccess:({checkout:t})=>{this.submitEvent.emit({checkout:t,message:"Checkout completed successfully"})},onError:t=>{this.errorEvent.emit({message:t.message,errorCode:T.COMPLETE_CHECKOUT_ERROR,severity:A.ERROR})}})}render(){return t(s,{key:"56a003ca1e1ac4bdc1baa8f862cdb05b2d8af4b1"})}get hostEl(){return n(this)}};var K;!function(t){t.PLAID_SDK_LOAD_FAILED="plaid-sdk-load-failed",t.PLAID_LINK_INIT_FAILED="plaid-link-init-failed",t.PLAID_LINK_TOKEN_FAILED="plaid-link-token-failed",t.PLAID_AUTHENTICATION_FAILED="plaid-authentication-failed",t.PLAID_BANK_NOT_SUPPORTED="plaid-bank-not-supported",t.PLAID_TOKEN_EXPIRED="plaid-token-expired",t.PLAID_NETWORK_ERROR="plaid-network-error",t.PLAID_USER_CANCELLED="plaid-user-cancelled",t.PLAID_TIMEOUT="plaid-timeout",t.PLAID_INVALID_CREDENTIALS="plaid-invalid-credentials",t.PLAID_ACCOUNT_LOCKED="plaid-account-locked",t.PLAID_MAINTENANCE="plaid-maintenance",t.PLAID_RATE_LIMITED="plaid-rate-limited"}(K||(K={}));const $={[K.PLAID_SDK_LOAD_FAILED]:"Unable to load Plaid. Please refresh the page and try again.",[K.PLAID_LINK_INIT_FAILED]:"Unable to initialize bank connection. Please try again.",[K.PLAID_LINK_TOKEN_FAILED]:"Unable to connect to bank service. Please try again.",[K.PLAID_AUTHENTICATION_FAILED]:"Bank authentication failed. Please try again.",[K.PLAID_BANK_NOT_SUPPORTED]:"Your bank is not currently supported. Please try a different payment method.",[K.PLAID_TOKEN_EXPIRED]:"Your bank session has expired. Please reconnect your account.",[K.PLAID_NETWORK_ERROR]:"Network connection issue. Please check your internet connection and try again.",[K.PLAID_USER_CANCELLED]:"Bank connection was cancelled. Click to try again.",[K.PLAID_TIMEOUT]:"Bank connection timed out. Please try again.",[K.PLAID_INVALID_CREDENTIALS]:"Invalid bank credentials. Please check your username and password.",[K.PLAID_ACCOUNT_LOCKED]:"Your bank account is temporarily locked. Please contact your bank.",[K.PLAID_MAINTENANCE]:"Bank service is temporarily unavailable. Please try again later.",[K.PLAID_RATE_LIMITED]:"Too many connection attempts. Please wait a moment and try again."},tt={[K.PLAID_SDK_LOAD_FAILED]:A.ERROR,[K.PLAID_LINK_INIT_FAILED]:A.ERROR,[K.PLAID_LINK_TOKEN_FAILED]:A.ERROR,[K.PLAID_AUTHENTICATION_FAILED]:A.ERROR,[K.PLAID_BANK_NOT_SUPPORTED]:A.WARNING,[K.PLAID_TOKEN_EXPIRED]:A.WARNING,[K.PLAID_NETWORK_ERROR]:A.WARNING,[K.PLAID_USER_CANCELLED]:A.INFO,[K.PLAID_TIMEOUT]:A.WARNING,[K.PLAID_INVALID_CREDENTIALS]:A.ERROR,[K.PLAID_ACCOUNT_LOCKED]:A.ERROR,[K.PLAID_MAINTENANCE]:A.WARNING,[K.PLAID_RATE_LIMITED]:A.WARNING},et=class{constructor(t){e(this,t),this.paymentMethodOptionSelected=i(this,"paymentMethodOptionSelected"),this.plaidError=i(this,"plaidError"),this.plaidErrorRecovered=i(this,"plaidErrorRecovered"),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.plaidService=new J,this.maxRetries=3,this.retryDelay=2e3,this.timeoutId=null,this.abortController=null,this.hasLoggedDisabledWarning=!1,this.waitForStoreAndInitialize=()=>{l.authToken&&l.accountId&&l.checkoutId?this.initializePlaidLink():setTimeout((()=>{this.waitForStoreAndInitialize()}),100)},this.initializePlaidLink=async()=>{try{if(void 0===window.Plaid)return void this.handleError({code:K.PLAID_SDK_LOAD_FAILED,message:$[K.PLAID_SDK_LOAD_FAILED],severity:tt[K.PLAID_SDK_LOAD_FAILED],retryable:!0,userAction:"Refresh the page and try again"});if(await this.getLinkToken(),!this.linkToken)return void this.handleError({code:K.PLAID_LINK_TOKEN_FAILED,message:$[K.PLAID_LINK_TOKEN_FAILED],severity:tt[K.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:K.PLAID_LINK_INIT_FAILED,message:$[K.PLAID_LINK_INIT_FAILED],severity:tt[K.PLAID_LINK_INIT_FAILED],originalError:t,retryable:!0,userAction:"Click to try again"})}},this.getLinkToken=async()=>{var t,e,i,s,n;try{if(!l.authToken||!l.accountId)return void this.handleError({code:K.PLAID_LINK_TOKEN_FAILED,message:"Missing authentication. Please refresh the page and try again.",severity:A.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(l.authToken,l.accountId,l.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&&(l.plaidLinkTokenId=this.linkTokenId)}catch(t){this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null);let a=K.PLAID_LINK_TOKEN_FAILED,o=$[a],r=!0;"AbortError"===t.name?(a=K.PLAID_TIMEOUT,o=$[a],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"))?(a=K.PLAID_NETWORK_ERROR,o=$[a],r=!0):((null===(s=t.message)||void 0===s?void 0:s.includes("401"))||(null===(n=t.message)||void 0===n?void 0:n.includes("unauthorized")))&&(a=K.PLAID_INVALID_CREDENTIALS,o="Authentication failed. Please refresh the page and try again.",r=!1),this.handleError({code:a,message:o,severity:tt[a],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 K.PLAID_RATE_LIMITED;if(t.includes("maintenance"))return K.PLAID_MAINTENANCE;if(t.includes("not_authenticated"))return K.PLAID_INVALID_CREDENTIALS}if(null==t?void 0:t.code)switch(t.code){case"rate_limited":return K.PLAID_RATE_LIMITED;case"maintenance":return K.PLAID_MAINTENANCE;case"not_authenticated":return K.PLAID_INVALID_CREDENTIALS;default:return K.PLAID_LINK_TOKEN_FAILED}return K.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,l.selectedPaymentMethod={type:D.PLAID}),this.plaidErrorRecovered.emit({code:"plaid-success",message:"Bank account connected successfully",severity:A.INFO}),l.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=K.PLAID_AUTHENTICATION_FAILED,i=$[e],s=!0,n="Click to try again";if(t.error_code)switch(t.error_code){case"INVALID_CREDENTIALS":e=K.PLAID_INVALID_CREDENTIALS,i=$[e],s=!0;break;case"ITEM_LOGIN_REQUIRED":e=K.PLAID_INVALID_CREDENTIALS,i="Your bank requires re-authentication. Please try again.",s=!0;break;case"ITEM_LOCKED":e=K.PLAID_ACCOUNT_LOCKED,i=$[e],s=!1,n="Contact your bank";break;case"INSTITUTION_NOT_RESPONDING":e=K.PLAID_MAINTENANCE,i=$[e],s=!0;break;case"RATE_LIMIT_EXCEEDED":e=K.PLAID_RATE_LIMITED,i=$[e],s=!0;break;case"INVALID_REQUEST":e=K.PLAID_AUTHENTICATION_FAILED,i="Invalid request. Please try again.",s=!0;break;case"PLAID_ERROR":e=K.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 a=t.error_message.toLowerCase();a.includes("not supported")||a.includes("unsupported")?(e=K.PLAID_BANK_NOT_SUPPORTED,i=$[e],s=!1,n="Try a different payment method"):(a.includes("expired")||a.includes("timeout"))&&(e=K.PLAID_TOKEN_EXPIRED,i=$[e],s=!0)}this.handleError({code:e,message:i,severity:tt[e],originalError:t,retryable:s,userAction:n}),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=l.selectedPaymentMethod)||void 0===t?void 0:t.type)===D.PLAID;this.isSelected!==e&&(this.isSelected=e)}}onSelectionChange(t){var e;t&&(null===(e=l.selectedPaymentMethod)||void 0===e?void 0:e.type)!==D.PLAID&&(l.selectedPaymentMethod={type:D.PLAID}),!t||!this.plaidLink||this.publicToken||this.isAuthenticating||this.error||this.openPlaidLink()}componentDidRender(){this.scriptRef&&(this.scriptRef.onload=()=>{this.waitForStoreAndInitialize()},this.scriptRef.onerror=()=>{this.handleError({code:K.PLAID_SDK_LOAD_FAILED,message:$[K.PLAID_SDK_LOAD_FAILED],severity:tt[K.PLAID_SDK_LOAD_FAILED],retryable:!0,userAction:"Refresh the page and try again"})})}componentWillLoad(){var t;this.isSelected=(null===(t=l.selectedPaymentMethod)||void 0===t?void 0:t.type)===D.PLAID}async resolvePaymentMethod(){return this.publicToken?{token:this.publicToken,data:{type:"bank_account",plaid_public_token:this.publicToken}}:{validationError:!0}}async getPaymentToken(){return l.paymentToken}async handleSelectionClick(){if(this.isSelected=!0,l.selectedPaymentMethod={type:D.PLAID},this.error)return this.clearError(),void this.waitForStoreAndInitialize();!this.plaidLink||this.publicToken||this.isAuthenticating||this.openPlaidLink()}async setSelected(t){this.isSelected=t,t&&(l.selectedPaymentMethod={type:D.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=u("selectedPaymentMethod",this.syncWithStore);this.unsubscribeFromStore=t}disconnectedCallback(){this.unsubscribeFromStore&&this.unsubscribeFromStore(),this.timeoutId&&clearTimeout(this.timeoutId),this.abortController&&this.abortController.abort()}render(){if(!0!==l.bankAccountVerification)return this.hasLoggedDisabledWarning||(console.warn("[PlaidPaymentMethod] bank_account_verification is disabled. Component will not render."),this.hasLoggedDisabledWarning=!0),null;const e=t("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 t(o,{class:"payment-method"},t("script",{src:"https://cdn.plaid.com/link/v2/stable/link-initialize.js",async:!0,ref:t=>this.scriptRef=t}),t("div",{title:"Pay with Plaid"},t("div",{onClick:t=>{t.preventDefault(),this.handleSelectionClick()}},"Pay with Bank Account ",e," "),(()=>this.error?t("div",{class:(this.error.severity===A.ERROR?"text-danger":this.error.severity===A.WARNING?"text-warning":"text-info")+" mt-2"},t("small",null,this.error.message),t("br",null),t("small",{class:"text-muted"},this.error.userAction,this.error.retryable&&this.retryCount<this.maxRetries&&t("span",null," • Auto-retry in progress..."))):null)(),(()=>this.error?null:this.isAuthenticating?t("div",{class:"text-info mt-2"},t("small",null,"Connecting to your bank...")):this.publicToken?t("div",{class:"text-success mt-2"},t("small",null,"✓ Bank account connected successfully")):!this.isSelected||this.publicToken||this.error||this.isAuthenticating?null:t("div",{class:"text-muted mt-2"},t("small",null,"Click to connect your bank account")))()))}static get watchers(){return{isSelected:["onSelectionChange"]}}},it=class{constructor(t){e(this,t),this.onPaymentMethodOptionClick=t=>e=>{e.preventDefault(),l.selectedPaymentMethod={id:t.id,type:t.type},l.paymentToken=t.id},this.isAllowedPaymentMethod=t=>!(t===D.SAVED_CARD&&l.disableCreditCard||t===D.SAVED_BANK_ACCOUNT&&l.disableBankAccount)}componentWillLoad(){l.paymentMethods.length||console.warn("No saved payment methods available."),l.disablePaymentMethodGroup&&console.warn("Payment method group is disabled.")}render(){return l.disablePaymentMethodGroup?null:t(o,null,t("div",{class:"saved-payment-methods"},l.paymentMethods.length?l.paymentMethods.filter((t=>this.isAllowedPaymentMethod(t.type))).map((e=>t("div",{class:"radio-list-item p-3",part:y,onClick:this.onPaymentMethodOptionClick(e)},t("form-control-radio",{name:"paymentMethodType",value:null==e?void 0:e.id,checked:l.paymentToken===(null==e?void 0:e.id),label:`${x[null==e?void 0:e.brand]||""} *${null==e?void 0:e.acct_last_four}`})))):null))}},st=t("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"}}),nt=class{constructor(t){e(this,t),this.paymentMethodOptionSelected=i(this,"paymentMethodOptionSelected"),this.paymentMethodOptionId=D.SEZZLE,this.initializeSezzleCheckout=()=>{let t;this.sezzlePromise=new Promise((e=>{t=e}));const e=Number(l.paymentAmount),i=new(0,window.Checkout)({mode:"popup",publicKey:l.bnplProviderClientId,apiMode:l.bnplProviderMode,apiVersion:l.bnplProviderApiVersion});i.sezzleButtonElement=this.sezzleButtonRef,i.init({onClick:function(t){t.preventDefault(),i.startCheckout({checkout_url:l.bnplProviderCheckoutUrl})},onComplete:e=>t({bnpl:e.data}),onCancel:e=>t({bnpl:e.data}),onFailure:e=>t({bnpl:e.data})}),this.sezzleCheckout=i,this.installmentPlan=this.sezzleCheckout.getInstallmentPlan(e)}}componentDidRender(){this.scriptRef&&(this.scriptRef.onload=()=>{this.sezzleButtonRef=document.createElement("button"),this.initializeSezzleCheckout()})}async resolvePaymentMethod(t){return t.isValid?(this.sezzleButtonRef.click(),this.sezzlePromise):{validationError:!0}}async handleSelectionClick(){l.selectedPaymentMethod={type:D.SEZZLE},this.paymentMethodOptionSelected.emit(this.paymentMethodOptionId)}render(){var e,i;return l.bnplEnabled?t(o,{class:"payment-method"},t("script",{src:"https://checkout-sdk.sezzle.com/checkout.min.js",async:!0,ref:t=>this.scriptRef=t}),t("div",null,t("div",null,"Buy now, pay later with ",st),this.installmentPlan&&t("small",null,t("span",null,null===(e=this.installmentPlan)||void 0===e?void 0:e.installments.length)," ",t("span",null,this.installmentPlan.schedule," payments of")," ",t("span",{class:"fw-bold"},m(null===(i=this.installmentPlan)||void 0===i?void 0:i.installments[0].amountInCents))))):(console.warn("justifi-sezzle-payment-method: BNPL is not enabled for this account."),null)}},at={[D.NEW_BANK_ACCOUNT]:"New bank account",[D.NEW_CARD]:"New credit or debit card"},ot="Payment form not ready",rt="Validation error",lt=class{constructor(t){e(this,t),this.errorEvent=i(this,"error-event"),this.submitEvent=i(this,"submit-event"),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(){j(),this.analytics=new w(this)}handleRadioClick(t){this.selectedPaymentMethod=t.detail,l.selectedPaymentMethod={type:t.detail}}async fillBillingForm(t){var e;null===(e=this.billingFormRef)||void 0===e||e.fill(t)}async tokenizePaymentMethod(t){null==t||t.preventDefault(),this.validateRequiredProps(),this.isLoading=!0;try{if(!(await this.validate()).isValid)return this.errorEvent.emit({errorCode:T.TOKENIZE_ERROR,message:rt}),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(T.TOKENIZE_ERROR,t.message);return this.emitError({errorCode:T.TOKENIZE_ERROR,message:t.message}),this.submitEvent.emit({response:e}),e}finally{this.isLoading=!1}}async validate(){if(!this.areFormsReady())return{isValid:!1,errors:{general:ot}};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 tokenize(){try{const t=await this.billingFormRef.getValues(),e={clientId:this.authToken||l.authToken,account:this.accountId||l.accountId,paymentMethodMetadata:this.buildPaymentMethodMetadata(t)};return await this.paymentMethodFormRef.tokenize(e)}catch(t){return t}}validateRequiredProps(){this.authToken||l.authToken||this.emitError({errorCode:T.TOKENIZE_ERROR,message:"Auth token is required when using the tokenize-payment-method component not slotted in justifi-modular-checkout"}),this.accountId||l.accountId||this.emitError({errorCode:T.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||(this.selectedPaymentMethod=D.NEW_BANK_ACCOUNT,l.selectedPaymentMethod={type:D.NEW_BANK_ACCOUNT}):(this.selectedPaymentMethod=D.NEW_CARD,l.selectedPaymentMethod={type:D.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=[];return this.disableCreditCard||t.push(D.NEW_CARD),this.disableBankAccount||t.push(D.NEW_BANK_ACCOUNT),t}areFormsReady(){return!(!this.billingFormRef||!this.paymentMethodFormRef)}emitError(t){this.errorEvent.emit(Object.assign(Object.assign({},t),{severity:A.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",ot);try{const e=await this.validate();if(!e.isValid||!t.isValid){const t=Object.values(e.errors)[0]||rt;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||l.paymentMethodGroupId}get shouldSavePaymentMethod(){return!(!this.paymentMethodGroupId&&!l.savePaymentMethod)}get shouldHideRadioInput(){return this.disableCreditCard||this.disableBankAccount}renderPaymentMethodOption(e){const i=this.selectedPaymentMethod===e&&void 0===l.selectedPaymentMethod.id;return t("div",{class:"payment-method"},t("justifi-radio-list-item",{name:"paymentMethodType",value:e,checked:i,label:at[e],hidden:this.shouldHideRadioInput}),i&&this.renderSelectedPaymentMethodForm(e))}renderSelectedPaymentMethodForm(e){return t("div",{class:"mt-4 pb-4"},this.renderPaymentMethodForm(e),t("div",{class:"mt-4"},t("justifi-billing-form",{ref:t=>this.billingFormRef=t,hideCardBillingForm:this.hideCardBillingForm,hideBankAccountBillingForm:this.hideBankAccountBillingForm,paymentMethodType:e})),t("div",{class:"mt-4"},t("justifi-save-new-payment-method",{hidden:!this.paymentMethodGroupID,label:this.savePaymentMethodLabel})))}renderPaymentMethodForm(e){return t(e===D.NEW_CARD?"justifi-card-form":"justifi-bank-account-form",{ref:t=>this.paymentMethodFormRef=t})}render(){return t(o,{key:"805537f9c210dd7d2cd6fa101659c143d716e187"},t("form",{key:"c05caa0149784c7653021eb58b8eb41e1119e93c"},t("fieldset",{key:"885abce69e70089d9841b9f866b41f9469a84437"},t("div",{key:"0411d66e395077e3442dacab459f6c9150d16d4e",class:"row gy-3"},t("div",{key:"1fa3dd928574a04b22ccca6a1727d4c8d602eea7",class:"col-12"},this.availablePaymentMethods.map((t=>this.renderPaymentMethodOption(t)))),t("div",{key:"ec3db8e32cd0c6205992225df7e7c317e9d2a7b0",class:"col-12"},t("justifi-button",{key:"0eaba5f83caaf693fb110dfabfb78e2898d946df",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 n(this)}static get watchers(){return{disableCreditCard:["paymentMethodsChanged"],disableBankAccount:["paymentMethodsChanged"]}}};export{Z as justifi_apple_pay,W as justifi_checkout_summary,q as justifi_header,X as justifi_modular_checkout,et as justifi_plaid_payment_method,it as justifi_saved_payment_methods,nt as justifi_sezzle_payment_method,lt as justifi_tokenize_payment_method}
|