@justifi/webcomponents 6.12.6-rc.1 → 6.12.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/dist/cjs/{Analytics-CexlbLRl.js → Analytics-CuYtRPw5.js} +2 -2
- package/dist/cjs/{Plaid-KasiL5mp.js → Plaid-BRSyOOuw.js} +19 -14
- package/dist/cjs/{additional-questions-form-step_15.cjs.entry.js → additional-questions-form-step_14.cjs.entry.js} +169 -378
- package/dist/cjs/additional-questions_5.cjs.entry.js +7 -7
- package/dist/cjs/additional-statement_8.cjs.entry.js +1 -1
- package/dist/cjs/bank-account-billing-form-simple_4.cjs.entry.js +4 -4
- package/dist/cjs/bank-account-form.cjs.entry.js +2 -2
- package/dist/cjs/{business-form-options-CnlrfbQ6.js → business-form-options-D_nM7NDk.js} +0 -51
- package/dist/cjs/{business-identity-schema-CC1wOwXd.js → business-identity-schema-DuFGX6_i.js} +7 -11
- package/dist/cjs/{business.service-BBovho58.js → business.service-Z9OACEQL.js} +1 -1
- package/dist/cjs/card-form.cjs.entry.js +2 -2
- package/dist/cjs/{check-pkg-version-jeIQGJ8A.js → check-pkg-version-CPWLIT6P.js} +1 -1
- package/dist/cjs/{checkout.service-C0M9hmsL.js → checkout.service-BZOyqXgW.js} +1 -1
- package/dist/cjs/{country-config-Ck-eEeZZ.js → country-config-aJp8ScEs.js} +0 -2
- package/dist/cjs/dispute-notification_2.cjs.entry.js +6 -6
- package/dist/cjs/{event-types-DDNVjmfR.js → event-types-AU1B76Vm.js} +1 -1
- package/dist/cjs/form-address-fields_3.cjs.entry.js +1 -1
- package/dist/cjs/form-control-number_2.cjs.entry.js +4 -5
- package/dist/cjs/{get-business-Ggw-UjXj.js → get-business-aR-C83KX.js} +2 -2
- package/dist/cjs/{get-payment-details-BVKRwME1.js → get-payment-details-dwhA02Zl.js} +2 -2
- package/dist/cjs/{get-subaccounts-RRmcS9xU.js → get-subaccounts-B1jmSa2d.js} +2 -2
- package/dist/cjs/hidden-input_2.cjs.entry.js +1 -1
- package/dist/cjs/{index.esm-BNETBIV_.js → index.esm-C1ZPG85l.js} +18 -0
- package/dist/cjs/justifi-apple-pay_11.cjs.entry.js +11 -10
- package/dist/cjs/justifi-bank-account-billing-form-simple.cjs.entry.js +5 -5
- package/dist/cjs/justifi-bank-account-form.cjs.entry.js +5 -5
- package/dist/cjs/justifi-billing-form-full.cjs.entry.js +1 -1
- package/dist/cjs/justifi-billing-form.cjs.entry.js +1 -1
- package/dist/cjs/justifi-business-details.cjs.entry.js +8 -8
- package/dist/cjs/justifi-business-form.cjs.entry.js +13 -13
- package/dist/cjs/justifi-card-billing-form-simple.cjs.entry.js +1 -1
- package/dist/cjs/justifi-card-form.cjs.entry.js +5 -5
- package/dist/cjs/justifi-checkout.cjs.entry.js +5 -5
- package/dist/cjs/justifi-checkouts-list-filters.cjs.entry.js +3 -3
- package/dist/cjs/justifi-checkouts-list.cjs.entry.js +8 -8
- package/dist/cjs/justifi-dispute-management.cjs.entry.js +7 -7
- package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +6 -6
- package/dist/cjs/justifi-order-terminals.cjs.entry.js +9 -9
- package/dist/cjs/justifi-payment-details.cjs.entry.js +8 -8
- package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +9 -9
- package/dist/cjs/justifi-payment-transactions-list.cjs.entry.js +7 -7
- package/dist/cjs/justifi-payments-list-filters.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payments-list.cjs.entry.js +7 -7
- package/dist/cjs/justifi-payout-details.cjs.entry.js +8 -8
- package/dist/cjs/justifi-payout-transactions-list.cjs.entry.js +7 -7
- package/dist/cjs/justifi-payouts-list-filters.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payouts-list.cjs.entry.js +9 -9
- package/dist/cjs/justifi-refund-payment.cjs.entry.js +9 -9
- package/dist/cjs/justifi-save-new-payment-method.cjs.entry.js +1 -1
- package/dist/cjs/justifi-season-interruption-insurance.cjs.entry.js +6 -6
- package/dist/cjs/justifi-skeleton.cjs.entry.js +1 -1
- package/dist/cjs/justifi-terminal-orders-list-filters.cjs.entry.js +3 -3
- package/dist/cjs/justifi-terminal-orders-list.cjs.entry.js +6 -6
- package/dist/cjs/justifi-terminals-list-filters.cjs.entry.js +3 -3
- package/dist/cjs/justifi-terminals-list.cjs.entry.js +8 -8
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{lodash-CxSkBibc.js → lodash-C4mGy21w.js} +38 -27
- package/dist/cjs/{package-CDegPd7E.js → package-Dxjq_cJI.js} +1 -1
- package/dist/cjs/payment-method-option.cjs.entry.js +1 -1
- package/dist/cjs/{payment-provisioning-actions-Cn8bgHKu.js → payment-provisioning-actions-BiSpysjW.js} +2 -2
- package/dist/cjs/payment-provisioning-form-buttons_2.cjs.entry.js +2 -3
- package/dist/cjs/{payment.service-CbIxt30x.js → payment.service-ByrgA_QZ.js} +1 -1
- package/dist/cjs/{payout.service-DVMvsdAf.js → payout.service-CnQm_BpU.js} +1 -1
- package/dist/cjs/{payouts-status-CzS2CLGW.js → payouts-status-AuS3Mp0V.js} +2 -2
- package/dist/cjs/{plaid.service-DNT_DX6z.js → plaid.service-Dlb8EUR8.js} +1 -1
- package/dist/cjs/{schema-validations-DackMxv7.js → schema-validations-DNPcvDh5.js} +8 -11
- package/dist/cjs/styled-host-DAi5SuFa.js +11 -0
- package/dist/cjs/{terminal.service-BBHixg-d.js → terminal.service-BdwHQ3Vv.js} +1 -1
- package/dist/cjs/{utils-kDsk4nqH.js → utils-FVGp6se3.js} +1 -1
- package/dist/cjs/webcomponents.cjs.js +1 -1
- package/dist/collection/api/Document.js +7 -14
- package/dist/collection/collection-manifest.json +0 -2
- package/dist/collection/components/business-forms/business-form/business-core-info/business-core-info.js +2 -2
- package/dist/collection/components/business-forms/business-form/business-representative/business-representative.js +3 -5
- package/dist/collection/components/business-forms/owner-form/owner-form-inputs.js +2 -4
- package/dist/collection/components/business-forms/owner-form/owner-form.js +1 -46
- package/dist/collection/components/business-forms/payment-provisioning/additional-questions/additional-questions-form-step.js +1 -1
- package/dist/collection/components/business-forms/payment-provisioning/bank-account/business-bank-account-form-step.js +114 -6
- package/dist/collection/components/business-forms/payment-provisioning/business-core-info/business-core-info-form-step.js +1 -1
- package/dist/collection/components/business-forms/payment-provisioning/business-owners/business-owners-form-step.js +0 -8
- package/dist/collection/components/business-forms/payment-provisioning/business-representative/business-representative-form-inputs.js +2 -4
- package/dist/collection/components/business-forms/payment-provisioning/justifi-payment-provisioning.js +1 -1
- package/dist/collection/components/business-forms/payment-provisioning/payment-provisioning-form-steps.js +2 -3
- package/dist/collection/components/business-forms/schemas/business-bank-account-schema.js +38 -10
- package/dist/collection/components/business-forms/schemas/business-core-info-schema.js +1 -1
- package/dist/collection/components/business-forms/schemas/business-identity-schema.js +3 -7
- package/dist/collection/components/business-forms/schemas/schema-validations.js +5 -8
- package/dist/collection/components/business-forms/utils/business-form-options.js +0 -50
- package/dist/collection/components/business-forms/utils/country-config.js +0 -2
- package/dist/collection/components/modular-checkout/sub-components/justifi-google-pay.js +8 -6
- package/dist/collection/ui-components/form/form-control-file.js +1 -1
- package/dist/docs.json +76 -502
- package/dist/esm/{Analytics-5J6H0ALl.js → Analytics-CwckfiSK.js} +2 -2
- package/dist/esm/{Plaid-BM3JUIG5.js → Plaid-l6nNIjab.js} +19 -15
- package/dist/esm/{additional-questions-form-step_15.entry.js → additional-questions-form-step_14.entry.js} +169 -377
- package/dist/esm/additional-questions_5.entry.js +8 -8
- package/dist/esm/additional-statement_8.entry.js +1 -1
- package/dist/esm/bank-account-billing-form-simple_4.entry.js +4 -4
- package/dist/esm/bank-account-form.entry.js +2 -2
- package/dist/esm/{business-form-options-DXjZp4Rl.js → business-form-options-DRalxlqN.js} +1 -51
- package/dist/esm/{business-identity-schema-D8L_UfWl.js → business-identity-schema-0Q3kck3C.js} +7 -11
- package/dist/esm/{business.service-C4BD3pf7.js → business.service-C31wbMVs.js} +1 -1
- package/dist/esm/card-form.entry.js +2 -2
- package/dist/esm/{check-pkg-version-C7cHTIM0.js → check-pkg-version-Dy2NK3Nn.js} +1 -1
- package/dist/esm/{checkout.service-DmWeKNQs.js → checkout.service-cVdOGDuI.js} +1 -1
- package/dist/esm/{country-config-BW2dUoTJ.js → country-config-CdvhLcnT.js} +0 -2
- package/dist/esm/dispute-notification_2.entry.js +6 -6
- package/dist/esm/{event-types-eIqsrwmW.js → event-types-DalU_6SB.js} +1 -1
- package/dist/esm/form-address-fields_3.entry.js +1 -1
- package/dist/esm/form-control-number_2.entry.js +4 -5
- package/dist/esm/{get-business-DtFHdc37.js → get-business-Gg6qn5on.js} +2 -2
- package/dist/esm/{get-payment-details-26GxiYgv.js → get-payment-details-BiWgSJau.js} +2 -2
- package/dist/esm/{get-subaccounts-xkGMPstt.js → get-subaccounts-CkjZeR9U.js} +2 -2
- package/dist/esm/hidden-input_2.entry.js +1 -1
- package/dist/esm/{index.esm-KCSohgHx.js → index.esm-BHdVU4hV.js} +18 -1
- package/dist/esm/justifi-apple-pay_11.entry.js +11 -10
- package/dist/esm/justifi-bank-account-billing-form-simple.entry.js +5 -5
- package/dist/esm/justifi-bank-account-form.entry.js +5 -5
- package/dist/esm/justifi-billing-form-full.entry.js +1 -1
- package/dist/esm/justifi-billing-form.entry.js +1 -1
- package/dist/esm/justifi-business-details.entry.js +8 -8
- package/dist/esm/justifi-business-form.entry.js +13 -13
- package/dist/esm/justifi-card-billing-form-simple.entry.js +1 -1
- package/dist/esm/justifi-card-form.entry.js +5 -5
- package/dist/esm/justifi-checkout.entry.js +5 -5
- package/dist/esm/justifi-checkouts-list-filters.entry.js +3 -3
- package/dist/esm/justifi-checkouts-list.entry.js +8 -8
- package/dist/esm/justifi-dispute-management.entry.js +7 -7
- package/dist/esm/justifi-gross-payment-chart.entry.js +6 -6
- package/dist/esm/justifi-order-terminals.entry.js +9 -9
- package/dist/esm/justifi-payment-details.entry.js +8 -8
- package/dist/esm/justifi-payment-provisioning.entry.js +9 -9
- package/dist/esm/justifi-payment-transactions-list.entry.js +7 -7
- package/dist/esm/justifi-payments-list-filters.entry.js +2 -2
- package/dist/esm/justifi-payments-list.entry.js +7 -7
- package/dist/esm/justifi-payout-details.entry.js +8 -8
- package/dist/esm/justifi-payout-transactions-list.entry.js +7 -7
- package/dist/esm/justifi-payouts-list-filters.entry.js +2 -2
- package/dist/esm/justifi-payouts-list.entry.js +9 -9
- package/dist/esm/justifi-refund-payment.entry.js +9 -9
- package/dist/esm/justifi-save-new-payment-method.entry.js +1 -1
- package/dist/esm/justifi-season-interruption-insurance.entry.js +6 -6
- package/dist/esm/justifi-skeleton.entry.js +1 -1
- package/dist/esm/justifi-terminal-orders-list-filters.entry.js +3 -3
- package/dist/esm/justifi-terminal-orders-list.entry.js +6 -6
- package/dist/esm/justifi-terminals-list-filters.entry.js +3 -3
- package/dist/esm/justifi-terminals-list.entry.js +8 -8
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{lodash-CrGKVSPp.js → lodash-BF_QgjtL.js} +38 -27
- package/dist/esm/{package-8R9xLun-.js → package-DAZd_gFd.js} +1 -1
- package/dist/esm/payment-method-option.entry.js +1 -1
- package/dist/esm/{payment-provisioning-actions-fWdNDUdq.js → payment-provisioning-actions-cl5xIYnF.js} +2 -2
- package/dist/esm/payment-provisioning-form-buttons_2.entry.js +2 -3
- package/dist/esm/{payment.service-CWR7jF-K.js → payment.service-5_u-UzTY.js} +1 -1
- package/dist/esm/{payout.service-CFU362cH.js → payout.service-D2zS5y8N.js} +1 -1
- package/dist/esm/{payouts-status-D2G7FKu1.js → payouts-status-DCjCGTaa.js} +2 -2
- package/dist/esm/{plaid.service-0hd1i5Ga.js → plaid.service-BiJ65YG8.js} +1 -1
- package/dist/esm/{schema-validations-CjqWFLKt.js → schema-validations-A1o1biOB.js} +8 -11
- package/dist/esm/styled-host-D6byRazK.js +9 -0
- package/dist/esm/{terminal.service-Dr6dERcJ.js → terminal.service-CIxDfM7V.js} +1 -1
- package/dist/esm/{utils-q7KOrlSX.js → utils-C1B2hVAB.js} +1 -1
- package/dist/esm/webcomponents.js +1 -1
- package/dist/module/Plaid.js +19 -15
- package/dist/module/additional-questions-form-step2.js +5 -11
- package/dist/module/bank-account-document-form-inputs.js +1 -55
- package/dist/module/bank-account-document-form-inputs2.js +57 -0
- package/dist/module/business-bank-account-form-step2.js +177 -24
- package/dist/module/business-core-info-form-step2.js +2 -2
- package/dist/module/business-core-info-schema.js +1 -1
- package/dist/module/business-core-info2.js +3 -3
- package/dist/module/business-documents-on-file2.js +1 -1
- package/dist/module/business-form-options.js +1 -51
- package/dist/module/business-identity-schema.js +3 -7
- package/dist/module/business-owners-form-step2.js +0 -8
- package/dist/module/business-representative-form-inputs2.js +3 -5
- package/dist/module/business-representative2.js +5 -6
- package/dist/module/button.js +1 -1
- package/dist/module/country-config.js +0 -2
- package/dist/module/form-control-number2.js +1 -1
- package/dist/module/form-control-textarea2.js +1 -1
- package/dist/module/form.js +18 -1
- package/dist/module/hidden-input2.js +1 -1
- package/dist/module/iframe-input2.js +1 -1
- package/dist/module/justifi-checkouts-list-filters.js +1 -1
- package/dist/module/justifi-checkouts-list.js +2 -2
- package/dist/module/justifi-dispute-management.js +1 -1
- package/dist/module/justifi-google-pay2.js +4 -3
- package/dist/module/justifi-modular-checkout2.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 +27 -33
- package/dist/module/justifi-payment-transactions-list.js +2 -2
- 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 +2 -2
- package/dist/module/justifi-payouts-list-filters.js +1 -1
- package/dist/module/justifi-payouts-list.js +2 -2
- package/dist/module/justifi-refund-payment.js +1 -1
- package/dist/module/justifi-terminal-orders-list-filters.js +1 -1
- package/dist/module/justifi-terminal-orders-list.js +2 -2
- package/dist/module/justifi-terminals-list-filters.js +1 -1
- package/dist/module/justifi-terminals-list.js +2 -2
- package/dist/module/lodash.js +38 -27
- package/dist/module/owner-form-inputs2.js +3 -5
- package/dist/module/owner-form2.js +1 -10
- 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-form-steps2.js +28 -35
- package/dist/module/plaid-verification2.js +1 -1
- package/dist/module/schema-validations.js +5 -8
- package/dist/module/skeleton.js +1 -1
- package/dist/module/styled-host.js +1 -1
- package/dist/module/table.js +1 -1
- package/dist/module/terminal-quantity-selector2.js +1 -1
- package/dist/types/api/Document.d.ts +2 -15
- package/dist/types/components/business-forms/owner-form/owner-form.d.ts +0 -2
- package/dist/types/components/business-forms/payment-provisioning/bank-account/business-bank-account-form-step.d.ts +12 -1
- package/dist/types/components/business-forms/payment-provisioning/payment-provisioning-form-steps.d.ts +0 -1
- package/dist/types/components/business-forms/schemas/business-bank-account-schema.d.ts +4 -4
- package/dist/types/components/business-forms/utils/business-form-options.d.ts +0 -1
- package/dist/types/components/modular-checkout/sub-components/justifi-google-pay.d.ts +1 -1
- package/dist/types/components.d.ts +10 -71
- package/dist/webcomponents/p-034fa691.entry.js +1 -0
- package/dist/webcomponents/{p-086f7eea.entry.js → p-07eaee91.entry.js} +1 -1
- package/dist/webcomponents/{p-2e063c5d.entry.js → p-08ab97ce.entry.js} +1 -1
- package/dist/webcomponents/{p-80fdd013.entry.js → p-1f34b2f7.entry.js} +1 -1
- package/dist/webcomponents/{p-3bcac405.entry.js → p-279c17ac.entry.js} +1 -1
- package/dist/webcomponents/{p-29b82954.entry.js → p-2a5ee558.entry.js} +1 -1
- package/dist/webcomponents/p-2aac2ab6.entry.js +1 -0
- package/dist/webcomponents/p-37254105.entry.js +1 -0
- package/dist/webcomponents/{p-a7e0ab9b.entry.js → p-38209a25.entry.js} +1 -1
- package/dist/webcomponents/{p-4b14b7e7.entry.js → p-3cefb032.entry.js} +1 -1
- package/dist/webcomponents/{p-8ed1bc07.entry.js → p-3ef07f42.entry.js} +1 -1
- package/dist/webcomponents/{p-a5ad9183.entry.js → p-41637e4a.entry.js} +1 -1
- package/dist/webcomponents/{p-92d8a14b.entry.js → p-4b39a470.entry.js} +1 -1
- package/dist/webcomponents/{p-6b21947c.entry.js → p-4ee55e7d.entry.js} +1 -1
- package/dist/webcomponents/p-5G1OMxZz.js +1 -0
- package/dist/webcomponents/p-6904c62c.entry.js +1 -0
- package/dist/webcomponents/{p-5f071ee0.entry.js → p-7377f7d1.entry.js} +1 -1
- package/dist/webcomponents/{p-48a866ae.entry.js → p-78c4668b.entry.js} +1 -1
- package/dist/webcomponents/{p-c2e09203.entry.js → p-8e56430a.entry.js} +1 -1
- package/dist/webcomponents/{p-947950cc.entry.js → p-9153c121.entry.js} +1 -1
- package/dist/webcomponents/p-9b5ca32c.entry.js +1 -0
- package/dist/webcomponents/{p-04d6d725.entry.js → p-9d676f54.entry.js} +1 -1
- package/dist/webcomponents/{p-BrFax4_P.js → p-APOabprT.js} +1 -1
- package/dist/webcomponents/p-Aacb4jqT.js +1 -0
- package/dist/webcomponents/{p-CeW0EPHy.js → p-Axa3cgnH.js} +1 -1
- package/dist/webcomponents/{p-CL8LyqRI.js → p-BJu1-9kE.js} +1 -1
- package/dist/webcomponents/{p-czJ2qSU1.js → p-BXyADlAH.js} +1 -1
- package/dist/webcomponents/{p-xWuaNtJy.js → p-Ba8jdOkX.js} +1 -1
- package/dist/webcomponents/{p-DvnFba1A.js → p-BdpSLMs7.js} +1 -1
- package/dist/webcomponents/p-BqNNwq6C.js +1 -0
- package/dist/webcomponents/{p-BBSnDYJw.js → p-Bt4GjEWL.js} +1 -1
- package/dist/webcomponents/{p-C-zuQNNP.js → p-BxKbnILQ.js} +1 -1
- package/dist/webcomponents/{p-D9sqTVmd.js → p-CKiAlBsU.js} +1 -1
- package/dist/webcomponents/{p-CDu7TeCZ.js → p-Cm9f5fyh.js} +1 -1
- package/dist/webcomponents/p-D8ytux5N.js +1 -0
- package/dist/webcomponents/p-DAZd_gFd.js +1 -0
- package/dist/webcomponents/{p-DdeBubpX.js → p-Dk26hk5T.js} +1 -1
- package/dist/webcomponents/p-DrMJliVY.js +1 -0
- package/dist/webcomponents/{p-Dzv0P2Ly.js → p-NZS8uCtH.js} +1 -1
- package/dist/webcomponents/p-OeJ-3w3l.js +9 -0
- package/dist/webcomponents/p-XIWgia4J.js +1 -0
- package/dist/webcomponents/{p-8db8d7e7.entry.js → p-a2c25cc4.entry.js} +1 -1
- package/dist/webcomponents/{p-de1ccbea.entry.js → p-a56e43a1.entry.js} +1 -1
- package/dist/webcomponents/{p-a3b48ba3.entry.js → p-a7a1b168.entry.js} +1 -1
- package/dist/webcomponents/{p-85c0abdb.entry.js → p-a9e82502.entry.js} +1 -1
- package/dist/webcomponents/{p-BSyTbuZy.js → p-av6jyzyC.js} +1 -1
- package/dist/webcomponents/{p-0b169fac.entry.js → p-b0b6083f.entry.js} +1 -1
- package/dist/webcomponents/{p-86eb32d8.entry.js → p-b21010cb.entry.js} +1 -1
- package/dist/webcomponents/{p-1e34c488.entry.js → p-b62ff001.entry.js} +1 -1
- package/dist/webcomponents/{p-c1b48216.entry.js → p-b8351983.entry.js} +1 -1
- package/dist/webcomponents/{p-3960e6b7.entry.js → p-bc2dddf3.entry.js} +1 -1
- package/dist/webcomponents/{p-3e10a0de.entry.js → p-c4767c7b.entry.js} +1 -1
- package/dist/webcomponents/p-c8bc235f.entry.js +1 -0
- package/dist/webcomponents/{p-0a4fcb15.entry.js → p-ca87c609.entry.js} +1 -1
- package/dist/webcomponents/{p-ba2ab989.entry.js → p-cf3e3394.entry.js} +1 -1
- package/dist/webcomponents/{p-e0e6c2df.entry.js → p-d01a1076.entry.js} +1 -1
- package/dist/webcomponents/{p-a4520dba.entry.js → p-d5edbea3.entry.js} +1 -1
- package/dist/webcomponents/{p-b17ce21d.entry.js → p-d79c5ee4.entry.js} +1 -1
- package/dist/webcomponents/{p-562447ad.entry.js → p-e02d7751.entry.js} +4 -4
- package/dist/webcomponents/{p-c3cc4ad6.entry.js → p-e07506b7.entry.js} +1 -1
- package/dist/webcomponents/{p-cc558e25.entry.js → p-e17b92ec.entry.js} +1 -1
- package/dist/webcomponents/p-ea254f14.entry.js +1 -0
- package/dist/webcomponents/{p-ca1c2048.entry.js → p-ebb7b693.entry.js} +1 -1
- package/dist/webcomponents/{p-0e4cda77.entry.js → p-f1b9cbf0.entry.js} +1 -1
- package/dist/webcomponents/{p-Cz0yhyYu.js → p-fE5A37L5.js} +1 -1
- package/dist/webcomponents/p-ff8cf16c.entry.js +1 -0
- package/dist/webcomponents/p-nb_LhbJq.js +1 -0
- package/dist/webcomponents/{p--RbNhyet.js → p-oTtn8xDw.js} +1 -1
- package/dist/webcomponents/webcomponents.esm.js +1 -1
- package/package.json +14 -14
- package/dist/cjs/bank-account-document-form-inputs.cjs.entry.js +0 -21
- package/dist/cjs/styled-host-Ch0-dxF-.js +0 -11
- package/dist/collection/components/business-forms/payment-provisioning/document-upload/document-upload-form-step.js +0 -435
- package/dist/collection/components/business-forms/payment-provisioning/document-upload/document-upload-list.js +0 -52
- package/dist/collection/components/business-forms/payment-provisioning/document-upload/document-upload-options.js +0 -72
- package/dist/esm/bank-account-document-form-inputs.entry.js +0 -19
- package/dist/esm/styled-host-D84RBv1W.js +0 -9
- package/dist/module/document-upload-form-step.d.ts +0 -11
- package/dist/module/document-upload-form-step.js +0 -6
- package/dist/module/document-upload-form-step2.js +0 -397
- package/dist/module/document-upload-list.d.ts +0 -11
- package/dist/module/document-upload-list.js +0 -6
- package/dist/module/document-upload-list2.js +0 -46
- package/dist/types/components/business-forms/payment-provisioning/document-upload/document-upload-form-step.d.ts +0 -44
- package/dist/types/components/business-forms/payment-provisioning/document-upload/document-upload-list.d.ts +0 -6
- package/dist/types/components/business-forms/payment-provisioning/document-upload/document-upload-options.d.ts +0 -44
- package/dist/webcomponents/p-37676092.entry.js +0 -1
- package/dist/webcomponents/p-54ee2a30.entry.js +0 -1
- package/dist/webcomponents/p-58adef16.entry.js +0 -1
- package/dist/webcomponents/p-8R9xLun-.js +0 -1
- package/dist/webcomponents/p-92e7ce54.entry.js +0 -1
- package/dist/webcomponents/p-9ce2a98a.entry.js +0 -1
- package/dist/webcomponents/p-B1yVkh15.js +0 -1
- package/dist/webcomponents/p-BzXQDB0t.js +0 -1
- package/dist/webcomponents/p-C_ifLmT1.js +0 -9
- package/dist/webcomponents/p-D9ZHVy-j.js +0 -1
- package/dist/webcomponents/p-DV4n8kZd.js +0 -1
- package/dist/webcomponents/p-DzEdYT8R.js +0 -1
- package/dist/webcomponents/p-a2ed63df.entry.js +0 -1
- package/dist/webcomponents/p-a9976353.entry.js +0 -1
- package/dist/webcomponents/p-c9599fc7.entry.js +0 -1
- package/dist/webcomponents/p-cab840bd.entry.js +0 -1
- package/dist/webcomponents/p-n_pmf4AT.js +0 -1
- package/dist/webcomponents/p-vUN_uvAi.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as e,h as s,H as i}from"./p-CV0Pyo1O.js";import{C as a,e as r,z as n,w as o,x as l,y as h}from"./p-Dzv0P2Ly.js";import{m as c,a as d,c as u,d as m,e as b,f as p,g as f}from"./p-BrFax4_P.js";import{B as v,a as y,D as g,I as k}from"./p-CL8LyqRI.js";import{a as w,d as _,b as T,g as C,h as L}from"./p-B1yVkh15.js";import{F as x,c as S,a as O,b as j}from"./p-D9sqTVmd.js";import{A,C as D,e as E,R as I,f as V,O as H}from"./p-BcNb9bVO.js";import{C as P,P as B,I as N}from"./p-CVaOFfrI.js";import{b as M,a0 as R,C as F,x as W,u as q,D as z,aa as U,a6 as Z,aj as Y,am as $,A as G,a1 as Q}from"./p-CPKMvyV_.js";import{P as X}from"./p-DSclFZ32.js";import{a as K,c as J,d as tt,b as et}from"./p-BBSnDYJw.js";import{a as st,B as it}from"./p-XYgDHrVL.js";import{n as at}from"./p-BnjCmwMr.js";import"./p-DVJaoI_m.js";import"./p-HXpYMWUU.js";import"./p-CLHwhyvu.js";import{B as rt,C as nt,v as ot,D as lt,E as ht,F as ct,G as dt}from"./p-DV4n8kZd.js";import{B as ut}from"./p-CHo7TfsM.js";import"./p-CZfYo5-1.js";import{c as mt}from"./p-BzXQDB0t.js";import{s as bt,b as pt,d as ft}from"./p-BRnBHsdq.js";import{S as vt}from"./p-uZ5KAseb.js";import{u as yt,a as gt,b as kt}from"./p-C6o0liMT.js";import{A as wt}from"./p-CYQvLgSs.js";import{S as _t}from"./p-DzEdYT8R.js";import{P as Tt}from"./p-BSyTbuZy.js";import"./p-CDu7TeCZ.js";import"./p-BFTU3MAI.js";import"./p-D8GTwl9v.js";class Ct{constructor(t){this.id=t.id,this.account_owner_name=t.account_owner_name,this.full_name=t.full_name,this.account_type=t.account_type,this.account_number=t.account_number,this.acct_last_four=t.acct_last_four,this.account_number_last4=t.account_number_last4,this.routing_number=t.routing_number,this.institution_number=t.institution_number,this.transit_number=t.transit_number,this.bank_name=t.bank_name,this.country=t.country,this.currency=t.currency,this.nickname=t.nickname,this.metadata=t.metadata,this.business_id=t.business_id,this.platform_account_id=t.platform_account_id,this.created_at=t.created_at,this.updated_at=t.updated_at}get payload(){return{account_owner_name:this.account_owner_name||"",account_type:this.account_type||"",account_number:this.account_number||"",routing_number:this.routing_number||"",institution_number:this.institution_number||"",transit_number:this.transit_number||"",bank_name:this.bank_name||"",nickname:this.nickname||"",business_id:this.business_id||""}}}const Lt=class{constructor(s){t(this,s),this.errorEvent=e(this,"error-event",7),this.stepCompleteEvent=e(this,"complete-form-step-event",7),this.formLoading=e(this,"formLoading",7),this.errors={},this.additional_questions={},this.recurringPayments=!1,this.isLoading=!1,this.getData=()=>{this.formLoading.emit(!0),this.isLoading=!0,this.getBusiness({onSuccess:t=>{this.additional_questions=new A(t.data.additional_questions||{}),this.formController.setInitialValues(Object.assign({},this.additional_questions))},onError:({error:t,code:e,severity:s})=>{this.errorEvent.emit({message:t,errorCode:e,severity:s})},final:()=>{this.formLoading.emit(!1),this.isLoading=!1}})},this.sendData=t=>{let e;this.formLoading.emit(!0),this.patchBusiness({payload:this.patchPayload,onSuccess:s=>{e=s,t()},onError:({error:t,code:s,severity:i})=>{e=t,this.errorEvent.emit({message:t,errorCode:s,severity:i})},final:()=>{this.stepCompleteEvent.emit({response:e,formStep:st.additionalQuestions}),this.formLoading.emit(!1)}})},this.inputHandler=(t,e)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[t]:e})),this.additional_questions=new A(Object.assign(Object.assign({},this.formController.values.getValue()),{[t]:e}))}}propChanged(){this.initializeApi()}recurringPaymentsWatcher(t){this.recurringPayments="Yes"===(null==t?void 0:t.business_recurring_payments)}async validateAndSubmit({onSuccess:t}){this.formController.validateAndSubmit((()=>this.sendData(t)))}get patchPayload(){return{additional_questions:new A(this.formController.values.getValue()).payload}}componentWillLoad(){this.initializeApi(),this.formController=new x(w(this.allowOptionalFields))}componentDidLoad(){this.getBusiness&&this.getData(),this.formController.errors.subscribe((t=>{this.errors=Object.assign({},t)}))}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=c({authToken:this.authToken,businessId:this.businessId,service:new v}),this.patchBusiness=d({authToken:this.authToken,businessId:this.businessId,service:new v})):this.errorEvent.emit({message:"Missing required props",errorCode:r.MISSING_PROPS,severity:a.ERROR})}render(){var t,e,i,a,r;const n=this.formController.getInitialValues();return this.isLoading?s(X,null):s("form",null,s("fieldset",null,s("div",{class:"d-flex align-items-center gap-2"},s("legend",{class:"mb-0",part:M},"Additional Questions"),s("form-control-tooltip",{helpText:"This information helps us understand the business and identify and monitor trends to safeguard you and your customers."})),s("hr",{class:"mt-2"}),s("div",{class:"row gy-3"},s("div",{class:"col-12 col-md-6"},s("form-control-monetary-provisioning",{name:"business_revenue",label:"What is your business' estimated annual revenue from its primary business activities?",inputHandler:this.inputHandler,errorText:null===(t=this.errors)||void 0===t?void 0:t.business_revenue,defaultValue:null==n?void 0:n.business_revenue,maskOptions:P.WHOLE})),s("div",{class:"col-12 col-md-6"},s("form-control-monetary-provisioning",{name:"business_payment_volume",label:"What is your business' annual credit card & ACH volume anticipated to process?",inputHandler:this.inputHandler,errorText:null===(e=this.errors)||void 0===e?void 0:e.business_payment_volume,defaultValue:null==n?void 0:n.business_payment_volume,maskOptions:P.WHOLE})),s("div",{class:"col-12"},s("form-control-number",{name:"business_average_transaction_amount",label:"What is your average transaction size?",inputHandler:this.inputHandler,errorText:null===(i=this.errors)||void 0===i?void 0:i.business_average_transaction_amount,defaultValue:null==n?void 0:n.business_average_transaction_amount})),s("div",{class:"col-12"},s("form-control-select",{name:"business_when_service_received",label:"On average, how long after paying will your customers typically receive their goods or services?",inputHandler:this.inputHandler,errorText:null===(a=this.errors)||void 0===a?void 0:a.business_when_service_received,options:K,defaultValue:null==n?void 0:n.business_when_service_received})),s("div",{class:"col-12"},s("form-control-text",{name:"business_other_payment_details",label:"Is there anything else you would like us to know about how your customers pay the business? (optional)",inputHandler:this.inputHandler,errorText:null===(r=this.errors)||void 0===r?void 0:r.business_other_payment_details,defaultValue:null==n?void 0:n.business_other_payment_details})))))}static get watchers(){return{authToken:["propChanged"],businessId:["propChanged"],additional_questions:["recurringPaymentsWatcher"]}}},xt=class{constructor(e){t(this,e)}render(){var t,e,i,a,r,n;return s("div",{key:"d3445ce89732e19baea2e8f224c42011d5a03998",class:"row gy-3"},s("div",{key:"966e1d8ba6043b4f9b57ae0061ae94c177c12b48",class:"col-12"},this.formDisabled?s("bank-account-read-only-value",{label:"Bank Name",value:null===(t=this.defaultValue)||void 0===t?void 0:t.bank_name}):s("form-control-text",{name:"bank_name",label:"Bank Name",defaultValue:this.defaultValue.bank_name,errorText:this.errors.bank_name,inputHandler:this.inputHandler})),s("div",{key:"314a4f7e181b978b2ff1fdbfdfc8d9484089829a",class:"col-12"},this.formDisabled?s("bank-account-read-only-value",{label:"Nickname",value:null===(e=this.defaultValue)||void 0===e?void 0:e.nickname}):s("form-control-text",{name:"nickname",label:"Nickname",defaultValue:this.defaultValue.nickname,errorText:this.errors.nickname,inputHandler:this.inputHandler})),s("div",{key:"45ac55707ce44b208adaf72e944ea3056810183a",class:"col-12"},this.formDisabled?s("bank-account-read-only-value",{label:"Account Owner Name",value:null===(i=this.defaultValue)||void 0===i?void 0:i.account_owner_name}):s("form-control-text",{name:"account_owner_name",label:"Account Owner Name",defaultValue:this.defaultValue.account_owner_name,errorText:this.errors.account_owner_name,inputHandler:this.inputHandler})),s("div",{key:"74ce58b36eb3a425d900d7bb0858bda18b2e341c",class:"col-12"},this.formDisabled?s("bank-account-read-only-value",{label:"Account Type",value:null===(a=this.defaultValue)||void 0===a?void 0:a.account_type}):s("form-control-select",{name:"account_type",label:"Account Type",options:J,defaultValue:this.defaultValue.account_type,errorText:this.errors.account_type,inputHandler:this.inputHandler})),s("div",{key:"2562105aaaae00d9c46eb61d931a43927d96a8ce",class:"col-6"},this.formDisabled?s("bank-account-read-only-value",{label:"Account Number",value:(null===(r=this.defaultValue)||void 0===r?void 0:r.account_number_last4)?`**** ${this.defaultValue.account_number_last4}`:""}):s("form-control-text",{name:"account_number",label:"Account Number",defaultValue:this.defaultValue.account_number,maxLength:17,errorText:this.errors.account_number,inputHandler:this.inputHandler,keyDownHandler:at,helpText:"Please copy the account number as shown on your statement/check. Do not include spaces or dashes."})),s("div",{key:"4c7e6cba0ee1e2567dc5b608559b13ebd3fddd07",class:"col-6"},this.formDisabled?s("bank-account-read-only-value",{label:"Routing Number",value:(null===(n=this.defaultValue)||void 0===n?void 0:n.routing_number)||""}):s("form-control-text",{name:"routing_number",label:"Routing Number",defaultValue:this.defaultValue.routing_number,maxLength:9,errorText:this.errors.routing_number,inputHandler:this.inputHandler,keyDownHandler:at,helpText:"A valid routing number is nine digits. Please include any leading or trailing zeroes."})))}},St=class{constructor(e){t(this,e)}render(){var t,e,i,a,r,n,o;return s("div",{key:"8de8f05777f72ecb1112328544e75be7cd929e8d",class:"row gy-3"},s("div",{key:"513fb78b434ba3aebe51b636f7494b54e437c65f",class:"col-12"},this.formDisabled?s("bank-account-read-only-value",{label:"Bank Name",value:null===(t=this.defaultValue)||void 0===t?void 0:t.bank_name}):s("form-control-text",{name:"bank_name",label:"Bank Name",defaultValue:this.defaultValue.bank_name,errorText:this.errors.bank_name,inputHandler:this.inputHandler})),s("div",{key:"37a1ef4ac58fbe1633a93020e786d546cd832867",class:"col-12"},this.formDisabled?s("bank-account-read-only-value",{label:"Nickname",value:null===(e=this.defaultValue)||void 0===e?void 0:e.nickname}):s("form-control-text",{name:"nickname",label:"Nickname",defaultValue:this.defaultValue.nickname,errorText:this.errors.nickname,inputHandler:this.inputHandler})),s("div",{key:"fc8820e264d14ac3c5a1c6fd171b381c2b6d99e1",class:"col-12"},this.formDisabled?s("bank-account-read-only-value",{label:"Account Owner Name",value:null===(i=this.defaultValue)||void 0===i?void 0:i.account_owner_name}):s("form-control-text",{name:"account_owner_name",label:"Account Owner Name",defaultValue:this.defaultValue.account_owner_name,errorText:this.errors.account_owner_name,inputHandler:this.inputHandler})),s("div",{key:"f183b1c5f6a8b0f905c916cd1715448f3e02d26f",class:"col-12"},this.formDisabled?s("bank-account-read-only-value",{label:"Account Type",value:null===(a=this.defaultValue)||void 0===a?void 0:a.account_type}):s("form-control-select",{name:"account_type",label:"Account Type",options:J,defaultValue:this.defaultValue.account_type,errorText:this.errors.account_type,inputHandler:this.inputHandler})),s("div",{key:"8366ebde2f319f6d910a34917f57ad43b3ee234f",class:"col-3"},this.formDisabled?s("bank-account-read-only-value",{label:"Transit Number",value:(null===(r=this.defaultValue)||void 0===r?void 0:r.transit_number)||""}):s("form-control-text",{name:"transit_number",label:"Transit Number",defaultValue:this.defaultValue.transit_number,maxLength:5,errorText:this.errors.transit_number,inputHandler:this.inputHandler,keyDownHandler:at,helpText:"5 digits"})),s("div",{key:"c91166337c2984048466014634f5d4e59ce2b40a",class:"col-3"},this.formDisabled?s("bank-account-read-only-value",{label:"Institution Number",value:(null===(n=this.defaultValue)||void 0===n?void 0:n.institution_number)||""}):s("form-control-text",{name:"institution_number",label:"Institution Number",defaultValue:this.defaultValue.institution_number,maxLength:3,errorText:this.errors.institution_number,inputHandler:this.inputHandler,keyDownHandler:at,helpText:"3 digits"})),s("div",{key:"ebce2f50ec265ed2fef7a0b3dae84d33036ad145",class:"col-6"},this.formDisabled?s("bank-account-read-only-value",{label:"Account Number",value:(null===(o=this.defaultValue)||void 0===o?void 0:o.account_number_last4)?`**** ${this.defaultValue.account_number_last4}`:""}):s("form-control-text",{name:"account_number",label:"Account Number",defaultValue:this.defaultValue.account_number,maxLength:17,errorText:this.errors.account_number,inputHandler:this.inputHandler,keyDownHandler:at,helpText:"Please copy the account number as shown on your statement. Do not include spaces or dashes."})))}},Ot=t=>t?{bank_name:ht.nullable(),nickname:lt.nullable(),account_owner_name:ot.nullable(),account_type:nt.nullable(),account_number:rt.nullable()}:{bank_name:ht.required("Enter bank name"),nickname:lt.required("Enter nickname"),account_owner_name:ot.required("Enter account owner name"),account_type:nt.required("Select account type"),account_number:rt.required("Enter account number")},jt={[D.USA]:t=>(t=>{const e=Object.assign(Object.assign({},Ot(t)),(t=>t?{routing_number:dt.nullable()}:{routing_number:dt.required("Enter routing number")})(t));return S().shape(e)})(t),[D.CAN]:t=>(t=>{const e=Object.assign(Object.assign({},Ot(t)),(t=>{const e=O().length(3,"Institution number must be 3 digits").matches(ct,"Enter valid institution number"),s=O().length(5,"Transit number must be 5 digits").matches(ct,"Enter valid transit number");return t?{institution_number:e.nullable(),transit_number:s.nullable()}:{institution_number:e.required("Enter institution number"),transit_number:s.required("Enter transit number")}})(t));return S().shape(e)})(t)},At=class{constructor(s){t(this,s),this.errorEvent=e(this,"error-event",7),this.stepCompleteEvent=e(this,"complete-form-step-event",7),this.formLoading=e(this,"formLoading",7),this.errors={},this.bankAccount={},this.isLoading=!1,this.viewMode="manual",this.bankAccountVerification=!1,this.platformAccountId=null,this.getSchema=()=>(0,jt[this.country])(this.allowOptionalFields),this.initializeFormController=()=>{this.formController=new x(this.getSchema()),this.formController.setInitialValues("readonly"===this.viewMode?Object.assign({},this.bankAccount):{business_id:this.businessId}),this.formController.errors.subscribe((t=>{this.errors=Object.assign({},t)}))},this.inputHandler=(t,e)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[t]:e}))},this.getData=()=>{this.isLoading=!0,this.getBusiness({onSuccess:t=>{this.processBusinessResponse(t.data),this.determineViewMode()},onError:({error:t,code:e,severity:s})=>{this.errorEvent.emit({message:t,errorCode:e,severity:s})},final:()=>{this.initializeFormController(),this.isLoading=!1}})},this.handleChangeBankAccount=()=>{this.viewMode=this.plaidAvailable?"plaid":"manual",this.initializeFormController()},this.handleCancel=()=>{this.viewMode=this.existingBankAccount?"readonly":"plaid",this.initializeFormController()},this.handleToggleToManualEntry=()=>{this.viewMode="manual"},this.handleToggleToPlaidVerification=()=>{this.viewMode="plaid"},this.handleSaveBankAccount=async()=>{this.formController.validateAndSubmit((()=>{this.sendData((()=>{}))}))}}propChanged(){this.initializeApi()}watchHandler(t){this.formLoading.emit(t)}async validateAndSubmit({onSuccess:t}){"readonly"===this.viewMode?this.sendData(t):this.formController.validateAndSubmit((()=>this.sendData(t)))}componentWillLoad(){this.initializeApi(),this.getBusiness&&this.getData(),this.formController=new x(this.getSchema())}componentDidLoad(){this.formController.errors.subscribe((t=>{this.errors=Object.assign({},t)}))}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=c({authToken:this.authToken,businessId:this.businessId,service:new v}),this.postBankAccount=u({authToken:this.authToken,service:new y})):this.errorEvent.emit({message:"Missing required props",errorCode:r.MISSING_PROPS,severity:a.ERROR})}get postPayload(){const t=this.formController.values.getValue();return new Ct(t).payload}get existingBankAccount(){var t;return!!(null===(t=this.bankAccount)||void 0===t?void 0:t.id)}get plaidAvailable(){return this.bankAccountVerification&&!!this.platformAccountId}get showCancel(){return this.bankAccountVerification||this.existingBankAccount}processBusinessResponse(t){const{bank_accounts:e,settings:s,platform_account_id:i}=t;e.length>0?this.bankAccount=new Ct(e[e.length-1]):(this.bankAccount=new Ct({}),this.bankAccount.business_id=this.businessId),this.bankAccountVerification=!0===s.bank_account_verification,this.platformAccountId=i}determineViewMode(){this.viewMode=this.existingBankAccount?"readonly":this.plaidAvailable?"plaid":"manual"}async sendData(t){try{if("manual"===this.viewMode){if(!await this.postBankAccountData())return;this.viewMode="readonly",await this.refreshBankAccountData()}t()}catch(t){this.errorEvent.emit({message:t,errorCode:r.POST_ERROR,severity:a.ERROR})}}async postBankAccountData(){let t;return this.isLoading=!0,new Promise((e=>{let s=!1;this.postBankAccount({payload:this.postPayload,onSuccess:e=>{t=e,s=!0},onError:({error:t,code:e,severity:i})=>{s=!1,this.errorEvent.emit({message:t,errorCode:e,severity:i})},final:()=>{this.stepCompleteEvent.emit({response:t,formStep:st.bankAccount}),this.isLoading=!1,e(s)}})}))}async refreshBankAccountData(){return new Promise((t=>{this.isLoading=!0,this.getBusiness({onSuccess:t=>{this.processBusinessResponse(t.data),this.determineViewMode(),this.initializeFormController()},onError:({error:t,code:e,severity:s})=>{this.errorEvent.emit({message:t,errorCode:e,severity:s})},final:()=>{this.isLoading=!1,t()}})}))}renderBankAccountInputs(t){const e=this.formController.getInitialValues();return s(this.country===D.CAN?"bank-account-form-inputs-canada":"bank-account-form-inputs",{defaultValue:e,errors:this.errors,inputHandler:this.inputHandler,formDisabled:t})}renderReadonlyView(){return s("div",null,this.renderBankAccountInputs(!0),s("div",{class:"mt-3"},s(ut,{variant:"secondary",type:"button",onClick:this.handleChangeBankAccount,disabled:this.isLoading,part:R},"Change Bank Account")))}renderPlaidView(){return s("div",{class:"mt-3"},s("plaid-verification",{authToken:this.authToken,accountId:this.platformAccountId,businessId:this.businessId,onPlaidVerificationSuccess:()=>{this.viewMode="readonly",this.refreshBankAccountData()}}),s("div",{class:"mt-3"},s(ut,{type:"button",variant:"link",className:"p-0",onClick:this.handleToggleToManualEntry,disabled:this.isLoading,part:F},"Enter bank details manually (document upload required)")))}renderManualEntryView(){return s("div",null,this.plaidAvailable&&s("div",{class:"mb-3"},s(ut,{type:"button",variant:"secondary",onClick:this.handleToggleToPlaidVerification,disabled:this.isLoading,part:R},"Link bank account with Plaid instead")),this.renderBankAccountInputs(!1),s("div",{class:"mt-3 d-flex gap-2"},this.showCancel&&s(ut,{variant:"secondary",type:"button",onClick:this.handleCancel,disabled:this.isLoading,part:R},"Cancel"),s(ut,{variant:"primary",type:"button",onClick:this.handleSaveBankAccount,disabled:this.isLoading,isLoading:this.isLoading},"Save Bank Account")))}render(){return this.isLoading?s(X,null):s("form",null,s("fieldset",{class:"mb-4"},s("div",{class:"d-flex align-items-center gap-2"},s("legend",{class:"mb-0",part:M},"Bank Account Info"),s("form-control-tooltip",{helpText:"This direct deposit account is the designated bank account where incoming funds will be deposited. The name of this account must match the registered business name exactly. We are not able to accept personal accounts unless your business is a registered sole proprietorship."})),s("hr",{class:"mt-2"}),"readonly"===this.viewMode&&this.renderReadonlyView(),"plaid"===this.viewMode&&this.renderPlaidView(),"manual"===this.viewMode&&this.renderManualEntryView()))}static get watchers(){return{authToken:["propChanged"],businessId:["propChanged"],isLoading:["watchHandler"]}}},Dt=class{constructor(s){t(this,s),this.errorEvent=e(this,"error-event",7),this.stepCompleteEvent=e(this,"complete-form-step-event",7),this.formLoading=e(this,"formLoading",7),this.errors={},this.coreInfo={},this.isLoading=!1,this.isEditingTaxId=!1,this.getData=()=>{this.getBusiness&&(this.formLoading.emit(!0),this.isLoading=!0,this.getBusiness({onSuccess:t=>{this.coreInfo=new E(t.data),this.formController.setInitialValues(Object.assign({},this.coreInfo))},onError:({error:t,code:e,severity:s})=>{this.errorEvent.emit({message:t,errorCode:e,severity:s})},final:()=>{this.formLoading.emit(!1),this.isLoading=!1}}))},this.sendData=t=>{let e;this.formLoading.emit(!0),this.patchBusiness({payload:this.patchPayload,onSuccess:s=>{e=s,t(),this.isEditingTaxId=!1},onError:({error:t,code:s,severity:i,rawError:a})=>{e=t,a&&"object"==typeof a&&a.param&&this.formController.setFieldError(a.param,a.message),this.errorEvent.emit({message:t,errorCode:s,severity:i})},final:()=>{this.stepCompleteEvent.emit({response:e,formStep:st.businessInfo}),this.formLoading.emit(!1)}})},this.inputHandler=(t,e)=>{this.errors[t]&&this.formController.clearFieldError(t),this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[t]:e}))}}propChanged(){this.initializeApi()}async validateAndSubmit({onSuccess:t}){this.formController.validateAndSubmit((()=>this.sendData(t)))}get patchPayload(){return new E(this.formController.values.getValue()).payload}componentWillLoad(){this.initializeApi();const t=this.country===D.CAN?_(this.allowOptionalFields):T(this.allowOptionalFields);this.formController=new x(t),this.getData()}componentDidLoad(){this.formController.errors.subscribe((t=>{this.errors=Object.assign({},t)}))}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=c({authToken:this.authToken,businessId:this.businessId,service:new v}),this.patchBusiness=d({authToken:this.authToken,businessId:this.businessId,service:new v})):this.errorEvent.emit({message:"Missing required props",errorCode:r.MISSING_PROPS,severity:a.ERROR})}render(){var t,e;const i=this.formController.getInitialValues();return this.isLoading?s(X,null):s("form",null,s("fieldset",null,s("div",{class:"d-flex align-items-center gap-2"},s("legend",{class:"mb-0",part:M},"Business Information")),s("hr",{class:"mt-2"}),s("div",{class:"row gy-3"},s("div",{class:"col-12 col-md-6"},s("form-control-text",{name:"legal_name",label:"Business Name",defaultValue:i.legal_name,errorText:this.errors.legal_name,inputHandler:this.inputHandler,helpText:"Enter this exactly as it appears on your tax records (don't use acronyms or abbreviations unless you registered that way)."})),s("div",{class:"col-12 col-md-6"},s("form-control-text",{name:"doing_business_as",label:"Doing Business As (DBA)",defaultValue:i.doing_business_as,errorText:this.errors.doing_business_as,inputHandler:this.inputHandler,helpText:"Enter this exactly as it appears on your tax records (leave blank if you don't have a registered DBA/trade name)"})),s("div",{class:"col-12 col-md-8"},s("form-control-select",{name:"classification",label:"Business Classification",options:tt,defaultValue:i.classification,errorText:this.errors.classification,inputHandler:this.inputHandler})),s("div",{class:"col-12 col-md-4"},s("form-control-date",{name:"date_of_incorporation",label:"Date of Registration",defaultValue:i.date_of_incorporation,errorText:this.errors.date_of_incorporation,inputHandler:this.inputHandler})),s("div",{class:"col-12 col-md-6"},s("form-control-text",{name:"industry",label:"Industry",defaultValue:i.industry,errorText:this.errors.industry,inputHandler:this.inputHandler,helpText:"Describe what you sell"})),s("div",{class:"col-12 col-md-6"},!(null===(t=this.coreInfo)||void 0===t?void 0:t.tax_id_last4)||this.isEditingTaxId?s("form-control-number-masked",{name:"tax_id",label:mt[this.country].taxIdLabelOptional||mt[this.country].taxIdLabel,defaultValue:this.isEditingTaxId?"":i.tax_id,errorText:this.errors.tax_id,inputHandler:this.inputHandler,mask:"000000000",helpText:mt[this.country].taxIdHelpText}):s("div",null,s("label",{class:"form-label",part:W},mt[this.country].taxIdLabel),s("div",{class:"input-group mb-3"},s("input",{type:"text",class:"form-control",part:q,value:`****${null===(e=this.coreInfo)||void 0===e?void 0:e.tax_id_last4}`,disabled:!0}),s("button",{class:"btn btn-secondary",type:"button",part:R,onClick:()=>{this.isEditingTaxId=!0,this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{tax_id:"",tax_id_last4:null}))}},"Change")))),s("div",{class:"col-12"},s("form-control-text",{name:"website_url",label:"Business Website URL",defaultValue:i.website_url,errorText:this.errors.website_url,inputHandler:this.inputHandler,helpText:"Don't have a live website? You can use your social media business page, app store link, or staging site URL."})),s("div",{class:"col-12 col-md-6"},s("form-control-text",{name:"email",label:"Business Email Address",defaultValue:i.email,errorText:this.errors.email,inputHandler:this.inputHandler})),s("div",{class:"col-12 col-md-6"},s("form-control-number-masked",{name:"phone",label:"Business Phone Number",defaultValue:i.phone,errorText:this.errors.phone,inputHandler:this.inputHandler,mask:B.US})))))}static get watchers(){return{authToken:["propChanged"],businessId:["propChanged"]}}},Et=class{constructor(e){t(this,e),this.documents=[],this.isLoading=!1}render(){return this.isLoading?s(vt,{height:"50px"}):this.documents.length?s(i,null,s("div",{class:"card",part:z},s("div",{class:"card-body"},s("h5",{class:"card-title",part:M},"Documents Already on File"),s("div",{class:"table-responsive"},s("table",{class:"table table-sm table-borderless",part:U},s("thead",null,s("tr",null,s("th",{style:{width:"25%"},part:Z,scope:"col"},"File Name"),s("th",{style:{width:"25%"},part:Z,scope:"col"},"File Type"),s("th",{style:{width:"25%"},part:Z,scope:"col"},"Document Type"),s("th",{style:{width:"25%"},part:Z,scope:"col"},"Date Uploaded"))),s("tbody",null,this.documents.sort(((t,e)=>t.document_type.localeCompare(e.document_type))).map(((t,e)=>s("tr",{class:0===e?"border-bottom border-top":"border-bottom"},s("td",{part:Y},t.file_name),s("td",{part:Y},t.file_type),s("td",{part:Y},bt(t.document_type)),s("td",{part:Y},`${pt(t.created_at)} - ${ft(t.created_at)}`))))))))),s("hr",null)):null}},It=class{constructor(s){t(this,s),this.clickEvent=e(this,"click-event",7),this.stepCompleteEvent=e(this,"complete-form-step-event",7),this.errorEvent=e(this,"error-event",7),this.formLoading=e(this,"formLoading",7),this.ownersPayload=[],this.refs=[],this.isLoading=!1,this.representativeIsOwner=null,this.matchRef=(t,e)=>{if(null===t)return;const s=this.ownersPayload.findIndex((t=>t.id===e));-1!==s&&(this.refs.length!==this.ownersPayload.length&&this.manageRefs(),this.refs[s]=t)},this.getData=()=>{this.formLoading.emit(!0),this.isLoading=!0,this.getBusiness({onSuccess:t=>{this.representative=new I(t.data.representative||{}),t.data.owners.length?this.ownersPayload=t.data.owners.map((t=>({id:t.id}))):this.addOwnerForm()},onError:({error:t,code:e,severity:s})=>{this.errorEvent.emit({message:t,errorCode:e,severity:s})},final:()=>{this.formLoading.emit(!1),this.isLoading=!1,this.manageRefs()}})},this.sendData=async t=>{let e;this.formLoading.emit(!0),this.patchBusiness({payload:{owners:this.ownersPayload},onSuccess:s=>{e=s,t()},onError:({error:t,code:s,severity:i})=>{e=t,this.errorEvent.emit({message:t,errorCode:s,severity:i})},final:()=>{this.stepCompleteEvent.emit({response:e,formStep:st.owners}),this.formLoading.emit(!1)}})},this.addOwnerForm=t=>{this.newFormOpen=!0,this.ownersPayload=[...this.ownersPayload,{id:""}],t&&this.clickEvent.emit({name:it.addOwnerForm})},this.removeOwnerForm=t=>{this.ownersPayload=this.ownersPayload.filter((e=>e.id!==t)),this.newFormOpen&&(this.newFormOpen=!1)},this.handleRepresentativeIsOwnerChange=t=>{this.representativeIsOwner=t,this.representativeIsOwner&&(this.formLoading.emit(!0),this.isLoading=!0,this.ownersPayload=this.ownersPayload.filter((t=>""!==t.id)),this.patchBusiness({payload:{representative:{is_owner:!0},owners:[{id:this.representative.id},...this.ownersPayload]},onSuccess:()=>{this.getData(),this.newFormOpen=!1},finally:()=>{this.isLoading=!1,this.formLoading.emit(!1)}}))}}propChanged(){this.initializeApi()}get showAddOwnerButton(){return this.ownersPayload.length<4&&!this.newFormOpen}manageRefs(){this.refs=this.ownersPayload.map((t=>t.id))}async validateAndSubmit({onSuccess:t}){const e=this.refs.map((t=>t.validate()));if(!(await Promise.all(e)).every((t=>t)))return;if(!this.allowOptionalFields&&100!==(await Promise.all(this.refs.map((t=>t.getOwnershipPercentage())))).reduce(((t,e)=>t+(parseFloat(e)||0)),0))return void await Promise.all(this.refs.map((t=>t.setOwnershipPercentageError("Ownership percentages must total 100%"))));const s=this.refs.map((t=>t.submit()));(await Promise.all(s)).every((t=>t))&&this.sendData(t)}componentWillLoad(){this.initializeApi(),this.getBusiness&&this.getData()}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=c({authToken:this.authToken,businessId:this.businessId,service:new v}),this.patchBusiness=d({authToken:this.authToken,businessId:this.businessId,service:new v})):this.errorEvent.emit({message:"Missing required props",errorCode:r.MISSING_PROPS,severity:a.ERROR})}ownersWatcher(){this.manageRefs()}handleOwnerSubmit(t){const e=t.detail,s=this.ownersPayload.map((t=>t.id===e.id?e:t));s.includes(e)||(s[this.ownersPayload.findIndex((t=>!t.id))]=e,this.newFormOpen&&(this.newFormOpen=!1)),this.ownersPayload=s}render(){if(this.isLoading)return s(i,null,s(X,null));const t=this.ownersPayload.some((t=>t.id===this.representative.id)),e=null===this.representativeIsOwner&&!t;return s(i,null,s("div",null,s("div",{class:"d-flex align-items-center gap-2"},s("legend",{class:"mb-0",part:M},"Owners"),s("form-control-tooltip",{helpText:"For partnerships, LLCs or privately held corporations, the business is required to apply with all individuals with 25% or more ownership to the application. For charities and registered non-profits, the business is required to apply with 1 individual with substantial control over the entity, such as a board member or director."})),s("hr",{class:"mt-2"}),e&&s("div",{class:"alert alert-warning mb-3",part:$},s("div",{class:"card-body"},s("div",{class:"d-flex align-items-center mb-3"},s("strong",null,"Is the representative of this business also an owner?")),s("div",{class:"d-flex gap-2"},s(ut,{variant:"primary",onClick:()=>this.handleRepresentativeIsOwnerChange(!0)},"Yes"),s(ut,{variant:"secondary",onClick:()=>this.handleRepresentativeIsOwnerChange(!1)},"No")))),s("div",{class:"row gy-3"},this.ownersPayload.map((t=>s("owner-form",{key:t.id,authToken:this.authToken,businessId:this.businessId,ownerId:t.id,removeOwner:this.removeOwnerForm,newFormOpen:this.newFormOpen,ownersLength:this.ownersPayload.length,country:this.country,allowOptionalFields:this.allowOptionalFields,ref:e=>this.matchRef(e,t.id)})))),s("div",{class:"d-flex justify-content-start"},s("div",{class:"gap-2"},s(ut,{variant:"primary",onClick:()=>this.addOwnerForm(!0),hidden:!this.showAddOwnerButton},"Add Owner")))))}static get watchers(){return{authToken:["propChanged"],businessId:["propChanged"],ownersPayload:["ownersWatcher"]}}},Vt=class{constructor(e){t(this,e),this.isEditingIdentification=!1,this.inputHandler=(t,e)=>{yt(this.formController,{[t]:e})},this.onAddressFormUpdate=t=>{gt(this.formController,Object.assign(Object.assign({},this.formController.values.getValue().address),t))}}render(){var t,e,i,a,r,n,o,l,h;return s("form",{key:"2346f250e4e2982b5b5b2624d039f551b5b5ed4e"},s("fieldset",{key:"7b496e6157e5eec02ef0d263c68fbd1e001c75ac"},s("div",{key:"b86d993c7fbee2269e48c7d4ea51826f199fecd4",class:"d-flex align-items-center gap-2"},s("legend",{key:"2b013e6068bbbca54a0852093ab4a2fae4ce64d2",class:"mb-0",part:M},"Representative"),s("form-control-tooltip",{key:"01e0f1d6ba2d5ee852593f7015a3ba7e0d980df9",helpText:"The representative for your business needs to be someone who has significant control over managing your business's finance. You will have an opportunity to add owners later in the form."})),s("hr",{key:"4bec34756ec7081e01809175bc3d2b6af0532537",class:"mt-2"}),s("div",{key:"6965720fabb1f12c6bb3c5a81f74ae12f44037b2",class:"row gy-3"},s("div",{key:"efbb768ba1e66d5ef47f792c39a17921b40e0eba",class:"col-12 col-md-8"},s("form-control-text",{key:"28477d3798ba7d14aee9201e84b276d8e85a21df",name:"name",label:"Full Name",defaultValue:null===(t=this.representativeDefaultValue)||void 0===t?void 0:t.name,errorText:this.errors.name,inputHandler:this.inputHandler})),s("div",{key:"28f17ccbe4da476256acd9c5a4e78a6a641ba6e9",class:"col-12 col-md-4"},s("form-control-select",{key:"dae6a93a0bc057abb97024277be0f10de01514e2",name:"title",label:"Title",options:et,defaultValue:null===(e=this.representativeDefaultValue)||void 0===e?void 0:e.title,errorText:this.errors.title,inputHandler:this.inputHandler})),s("div",{key:"2f9a45774adaa0040df2da1a8000d1ee61e16bf5",class:"col-12 col-md-6"},s("form-control-text",{key:"66a2a1ea8b54c03c012d76a74654ee19a9f958a7",name:"email",label:"Email Address",defaultValue:null===(i=this.representativeDefaultValue)||void 0===i?void 0:i.email,errorText:this.errors.email,inputHandler:this.inputHandler})),s("div",{key:"3b34f0cb11d358db2220c01aac90e8b7ba3cc01b",class:"col-12 col-md-6"},s("form-control-number-masked",{key:"52c62ec653fb917a248a302f7cb5ad46dc7bcc23",name:"phone",label:"Phone Number",defaultValue:null===(a=this.representativeDefaultValue)||void 0===a?void 0:a.phone,errorText:this.errors.phone,inputHandler:this.inputHandler,mask:B.US})),s("div",{key:"d287ec225af1541cca227d3b8bc54466cbb86b07",class:"col-12 col-md-4"},s("form-control-date",{key:"7e1ff6cc40b01dc7f6ad0ad84d73c0e59eea0d6f",name:"dob_full",label:"Birth Date",defaultValue:null===(r=this.representativeDefaultValue)||void 0===r?void 0:r.dob_full,errorText:this.errors.dob_full,inputHandler:this.inputHandler,onFormControlInput:t=>kt(t,this.formController),helpText:"Must be 18 or older."})),s("div",{key:"283b09c845f1a12f4974f82a26fffbf7c5f608ba",class:"col-12 col-md-8"},!(null===(n=this.representativeDefaultValue)||void 0===n?void 0:n.ssn_last4)||this.isEditingIdentification?s("form-control-number-masked",{name:"identification_number",label:this.country===D.CAN?mt[this.country].idNumberLabelOptional:mt[this.country].idNumberLabel,defaultValue:this.isEditingIdentification?"":null===(o=this.representativeDefaultValue)||void 0===o?void 0:o.identification_number,errorText:this.errors.identification_number,inputHandler:this.inputHandler,mask:N[this.country],helpText:mt[this.country].identityHelpText}):s("div",null,s("label",{class:"form-label",part:W},this.country===D.CAN?mt[this.country].idNumberLabelOptional:mt[this.country].idNumberLabel),s("div",{class:"input-group mb-3"},s("input",{type:"text",class:"form-control",part:q,value:`****${null===(l=this.representativeDefaultValue)||void 0===l?void 0:l.ssn_last4}`,disabled:!0}),s("button",{class:"btn btn-secondary",type:"button",part:R,onClick:()=>{this.isEditingIdentification=!0,yt(this.formController,{identification_number:"",ssn_last4:null})}},"Change")))),s("div",{key:"0a40679570df7b85faa7530797ebc21ca8794263",class:"col-12"},s("identity-address-form",{key:"5a1590251365260413ab63ce9a417d3d71c71e84",errors:this.errors.address,defaultValues:null===(h=this.representativeDefaultValue)||void 0===h?void 0:h.address,handleFormUpdate:this.onAddressFormUpdate,country:this.country})))))}},Ht=class{constructor(s){t(this,s),this.errorEvent=e(this,"error-event",7),this.stepCompleteEvent=e(this,"complete-form-step-event",7),this.formLoading=e(this,"formLoading",7),this.errors={},this.representative={},this.isLoading=!1,this.getData=()=>{this.getBusiness&&this.formController&&(this.formLoading.emit(!0),this.isLoading=!0,this.getBusiness({onSuccess:t=>{this.representative=new I(t.data.representative||{}),this.representative.address.country=this.country,this.formController.setInitialValues(Object.assign({},this.representative))},onError:({error:t,code:e,severity:s})=>{this.errorEvent.emit({message:t,errorCode:e,severity:s})},final:()=>{this.formLoading.emit(!1),this.isLoading=!1}}))},this.sendData=t=>{let e;this.formLoading.emit(!0),this.patchBusiness({payload:this.patchPayload,onSuccess:s=>{e=s,t()},onError:({error:t,code:s,severity:i})=>{e=t,this.errorEvent.emit({message:t,errorCode:s,severity:i})},final:()=>{this.stepCompleteEvent.emit({response:e,formStep:st.representative}),this.formLoading.emit(!1)}})}}propChanged(){this.initializeApi(),this.getData()}async validateAndSubmit({onSuccess:t}){this.formController.validateAndSubmit((()=>this.sendData(t)))}componentWillLoad(){this.initializeApi(),this.initializeForm()}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=c({authToken:this.authToken,businessId:this.businessId,service:new v}),this.patchBusiness=d({authToken:this.authToken,businessId:this.businessId,service:new v})):this.errorEvent.emit({message:"Missing required props",errorCode:r.MISSING_PROPS,severity:a.ERROR})}initializeForm(){const t=C[this.country];t?(this.formController=new x(t("representative",this.allowOptionalFields)),this.getData()):this.errorEvent.emit({message:"Missing schema for selected country",errorCode:r.MISSING_PROPS,severity:a.ERROR})}componentDidLoad(){this.formController&&this.formController.errors.subscribe((t=>{this.errors=Object.assign({},t)}))}get patchPayload(){return{representative:new I(this.formController.values.getValue()).payload}}render(){return!this.formController||this.isLoading?s(X,null):s("business-representative-form-inputs",{representativeDefaultValue:this.formController.getInitialValues(),errors:this.errors,formController:this.formController,country:this.country})}static get watchers(){return{authToken:["propChanged"],businessId:["propChanged"]}}},Pt=class{constructor(s){t(this,s),this.stepCompleteEvent=e(this,"complete-form-step-event",7),this.errorEvent=e(this,"error-event",7),this.formLoading=e(this,"formLoading",7),this.formCompleted=e(this,"formCompleted",7),this.errors={},this.fetchData=async()=>{this.formLoading.emit(!0);try{const t=await this.api.get({endpoint:this.businessEndpoint,authToken:this.authToken});this.acceptedTermsBefore=t.data.terms_conditions_accepted}catch(t){this.errorEvent.emit({errorCode:r.FETCH_ERROR,message:t.message,severity:a.ERROR,data:t})}finally{this.formLoading.emit(!1)}},this.sendData=async t=>{this.formLoading.emit(!0);try{const e=this.termsPayload,s=await this.api.post({endpoint:this.termsConditionsEndpoint,body:e,authToken:this.authToken});this.handleResponse(s,t)}catch(t){this.errorEvent.emit({errorCode:r.POST_ERROR,message:t.message,severity:a.ERROR,data:t})}finally{this.formLoading.emit(!1)}},this.inputHandler=(t,e)=>{this.acceptedTerms=e,this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[t]:e}))}}get businessEndpoint(){return`entities/business/${this.businessId}`}get termsConditionsEndpoint(){return"entities/terms_and_conditions"}get formHelperText(){return this.acceptedTermsBefore?"You have already accepted the terms and conditions.":null}get termsPayload(){return{business_id:this.businessId,accepted:this.formController.values.getValue().accepted,user_agent:window.navigator.userAgent}}async componentWillLoad(){this.api=wt(),this.formController=new x((t=>{const e=S({accepted:j().oneOf([!0],"You must agree to the terms and conditions to continue").required("You must agree to the terms and conditions to continue")}),s=S({accepted:j().nullable()});return t?s:e})(this.allowOptionalFields)),this.businessId&&this.authToken&&this.fetchData()}handleResponse(t,e){t.error?this.errorEvent.emit({errorCode:r.POST_ERROR,message:t.error.message,severity:a.ERROR,data:t.error}):e(),this.stepCompleteEvent.emit({response:t,formStep:st.termsAndConditions}),this.formCompleted.emit()}async validateAndSubmit({onSuccess:t}){this.acceptedTermsBefore?(this.stepCompleteEvent.emit({response:null,formStep:st.termsAndConditions,metadata:"no data submitted"}),this.formCompleted.emit(),t()):this.formController.validateAndSubmit((()=>this.sendData(t)))}componentDidLoad(){this.formController.errors.subscribe((t=>{this.errors=Object.assign({},t)}))}get merchantAgreementLink(){return s("a",{href:"https://justifi.tech/merchant-agreement/",target:"_blank",rel:"noopener noreferrer"},"merchant agreement")}render(){return s("form",{key:"24b0a8ff0187894cf5e0f56e9e4b28c378e720cb"},s("fieldset",{key:"26fa9159dd6d61edd28b9443a10eeb981f150308"},s("legend",{key:"103bdecbc51f2cccd9105e2f9b271b60760618ec",part:M},"Terms and Conditions"),s("hr",{key:"dfd29fbe609a57d8160df7980ed0e63e75934a86"}),s("div",{key:"61e06597ec652c1d7c6e7e2bd8c9b653d061d076"},s("p",{key:"cd4def71580cd14d6edb5887221ebf6aa80cc2ea"},"Please read and accept the ",this.merchantAgreementLink," to submit your provisioning request.")),s("br",{key:"e3c64733f11a4f702e686e6c5ae7acd7e6bd1c34"}),s("div",{key:"71bd74de3aee69805a2aa1297356ff8b8db3c76c",class:"row-gy-3"},s("div",{key:"94a28c13e3bbc1c89cd1b5ebde2e1732b48f99ea",class:"col-12"},s("form-control-checkbox",{key:"fee95fa42192fee1bbfd544307b4e1c11c0d97f4",name:"accepted",label:"I agree to the terms and conditions",inputHandler:this.inputHandler,errorText:this.errors.accepted,disabled:this.acceptedTermsBefore,helpText:this.formHelperText,checked:this.acceptedTerms})))))}},Bt=[{label:"Select a document type",value:""},{label:"Voided Check",value:"voided_check"},{label:"Bank Statement",value:"bank_statement"}],Nt=[{label:"Select a document type",value:""},{label:"Canadian Passport",value:"passport"},{label:"Canadian Driver's License",value:"driver_license"},{label:"Canadian Government Issued ID Card",value:"government_id"},{label:"Permanent Resident Card",value:"resident_card"},{label:"Certificate of Indian Status",value:"status_card"},{label:"US State Issued Driver's License",value:"driver_license"}],Mt=[{label:"Select a document type",value:""},{label:"Nexus Card (Photo ID)",value:"nexus_card"},{label:"Canadian Citizenship/Naturalization Card or Certificate",value:"citizenship_card"},{label:"Foreign Passport",value:"foreign_passport"},{label:"Canadian Birth Certificate",value:"birth_certificate"},{label:"Social Insurance Number (SIN) Card",value:"sin_card"},{label:"Social Security Number (SSN) Card",value:"ssn_card"}],Rt=[{label:"Business Document",value:"business_document",docTypeOptions:[{label:"Select a document type",value:""},{label:"Articles of Incorporation",value:"articles_of_incorporation"},{label:"Business Registration",value:"business_registration"}]},{label:"Financial Document",value:"financial_document",docTypeOptions:Bt}];function Ft(t){const e=Nt.filter((t=>""!==t.value)),s=Mt.filter((t=>""!==t.value));return t.map((t=>({label:`${t.name} - Identity Document`,value:`personal_${t.id}`,identityId:t.id,docTypeOptions:[{label:"Select a document type",value:""},{label:"── Group 1 ──",value:"_group1_header"},...e,{label:"── Group 2 ──",value:"_group2_header"},...s]})))}const Wt=[{label:"Financial Document",value:"financial_document",docTypeOptions:Bt}],qt=new Set(Nt.filter((t=>t.value)).map((t=>t.value))),zt=new Set(Mt.filter((t=>t.value)).map((t=>t.value))),Ut=class{constructor(s){t(this,s),this.errorEvent=e(this,"error-event",7),this.stepCompleteEvent=e(this,"complete-form-step-event",7),this.formLoading=e(this,"formLoading",7),this.owners=[],this.existingDocuments=[],this.selectedCategory="",this.selectedDocType="",this.uploadQueue=[],this.isLoading=!1,this.errors={},this.fileInputKey=0,this.categories=[],this.getData=()=>{this.isLoading=!0,this.getBusiness({onSuccess:t=>{const{owners:e,documents:s}=t.data;this.owners=e||[],this.existingDocuments=s||[],this.categories=function(t,e){return e===D.USA?Wt:[...Rt,...Ft(t)]}(this.owners,this.country)},onError:({error:t,code:e,severity:s})=>{this.errorEvent.emit({message:t,errorCode:e,severity:s})},final:()=>{this.isLoading=!1}})},this.handleCategoryChange=(t,e)=>{this.selectedCategory=e,this.selectedDocType=""},this.handleDocTypeChange=(t,e)=>{e.startsWith("_")&&e.endsWith("_header")||(this.selectedDocType=e)},this.handleFileSelected=async t=>{const e=Array.from(t.detail.fileList),s=this.categories.find((t=>t.value===this.selectedCategory));if(!s)return;const i=s.docTypeOptions.find((t=>t.value===this.selectedDocType)),a=(null==i?void 0:i.label)||this.selectedDocType,r=e.map((t=>({categoryLabel:s.label,categoryValue:s.value,docTypeLabel:a,docTypeValue:this.selectedDocType,fileName:t.name,file:t,identityId:s.identityId,status:"uploading"}))),o=this.uploadQueue.length;this.uploadQueue=[...this.uploadQueue,...r],this.selectedCategory="",this.selectedDocType="",this.fileInputKey++,await Promise.all(r.map((async(t,e)=>{const s=o+e;try{const e=new n({file:t.file,document_type:t.docTypeValue},this.businessId,t.identityId);if(!await this.postDocumentRecordData(e))return void(this.uploadQueue=this.uploadQueue.map(((t,e)=>e===s?Object.assign(Object.assign({},t),{status:"error"}):t)));const i=await this.uploadDocument(e);this.uploadQueue=this.uploadQueue.map(((t,e)=>e===s?Object.assign(Object.assign({},t),{status:i?"uploaded":"error"}):t))}catch(t){this.uploadQueue=this.uploadQueue.map(((t,e)=>e===s?Object.assign(Object.assign({},t),{status:"error"}):t))}})))},this.postDocumentRecordData=async t=>{const e=t.record_data;return new Promise((s=>{this.postDocumentRecord({payload:e,onSuccess:e=>{s(this.handleDocRecordResponse(t,e))},onError:({error:t,code:e,severity:i})=>{this.errorEvent.emit({message:t,errorCode:e,severity:i}),s(!1)}})}))},this.handleDocRecordResponse=(t,e)=>e.error?(this.errorEvent.emit({errorCode:r.POST_ERROR,message:e.error.message,severity:a.ERROR,data:e.error}),!1):(t.setPresignedUrl(e.data.presigned_url),!0),this.uploadDocument=async t=>{if(!t.presigned_url)throw new Error("Presigned URL is not set");const e=await t.getFileData();return!!(await fetch(t.presigned_url,{method:"PUT",body:e})).ok||(this.errorEvent.emit({errorCode:r.POST_ERROR,message:"Failed to upload document",severity:a.ERROR}),!1)}}propChanged(){this.initializeApi()}watchHandler(t){this.formLoading.emit(t)}async validateAndSubmit({onSuccess:t}){const e=this.validate();Object.keys(e).length>0?this.errors=e:(this.errors={},this.stepCompleteEvent.emit({response:null,formStep:st.documentUpload}),t())}componentWillLoad(){this.initializeApi(),this.getBusiness&&this.getData()}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=c({authToken:this.authToken,businessId:this.businessId,service:new v}),this.postDocumentRecord=m({authToken:this.authToken,service:new g})):this.errorEvent.emit({message:"Missing required props",errorCode:r.MISSING_PROPS,severity:a.ERROR})}get categoryOptions(){return[{label:"Select a category",value:""},...this.categories.map((t=>({label:t.label,value:t.value})))]}get docTypeOptions(){if(!this.selectedCategory)return[{label:"Select a category first",value:""}];const t=this.categories.find((t=>t.value===this.selectedCategory));return(null==t?void 0:t.docTypeOptions)||[{label:"Select a category first",value:""}]}validate(){if(this.allowOptionalFields)return{};const t={},e=t=>this.existingDocuments.some((e=>t.includes(e.document_type))),s=t=>this.uploadQueue.some((e=>e.categoryValue===t&&"uploaded"===e.status));if(s("financial_document")||e(["voided_check","bank_statement"])||(t.financial_document="Please upload a financial document"),this.country===D.CAN){const i=["articles_of_incorporation","business_registration"];s("business_document")||e(i)||(t.business_document="Please upload a business document");for(const e of this.owners){const s=`personal_${e.id}`,i=this.uploadQueue.filter((t=>t.categoryValue===s&&"uploaded"===t.status)),a=i.some((t=>qt.has(t.docTypeValue))),r=i.some((t=>zt.has(t.docTypeValue)));a||(t[`personal_group1_${e.id}`]=`Please upload a Group 1 identity document for ${e.name}`),r||(t[`personal_group2_${e.id}`]=`Please upload a Group 2 identity document for ${e.name}`)}}return t}render(){return this.isLoading?s(X,null):s("form",null,s("fieldset",null,s("legend",{class:"mb-0",part:M},"Document Uploads"),s("hr",{class:"mt-2"}),s("business-documents-on-file",{documents:this.existingDocuments,isLoading:this.isLoading})),s("fieldset",{class:"mt-4"},s("div",{class:"d-flex align-items-center gap-2"},s("legend",{class:"mb-0",part:M},"Add Document"),s("form-control-tooltip",{helpText:"Upload documents one at a time. Select the category and type, then choose a file. For identity documents, two documents from different groups are required per owner."})),s("hr",{class:"mt-2"}),s("div",{class:"row gy-3"},s("div",{class:"col-12 col-md-6"},s("form-control-select",{name:"document_category",label:"Document Category",options:this.categoryOptions,defaultValue:this.selectedCategory,inputHandler:this.handleCategoryChange})),s("div",{class:"col-12 col-md-6"},s("form-control-select",{name:"document_type",label:"Document Type",options:this.docTypeOptions,defaultValue:this.selectedDocType,inputHandler:this.handleDocTypeChange,disabled:!this.selectedCategory})),s("div",{class:"col-12"},s("form-control-file",{key:this.fileInputKey,name:"document_file",label:"Upload Document",documentType:this.selectedDocType,onFileSelected:this.handleFileSelected,disabled:!this.selectedDocType,multiple:!1})))),s("document-upload-list",{documents:this.uploadQueue}),Object.keys(this.errors).length>0&&s("div",{class:"alert alert-danger mt-3"},s("ul",{class:"mb-0"},Object.values(this.errors).map((t=>s("li",null,t))))))}static get watchers(){return{authToken:["propChanged"],businessId:["propChanged"],isLoading:["watchHandler"]}}},Zt=class{constructor(e){t(this,e),this.documents=[]}renderStatus(t){switch(t){case"uploading":return s("span",{class:"badge bg-info"},"Uploading...");case"uploaded":return s("span",{class:"badge bg-success"},"Uploaded");case"error":return s("span",{class:"badge bg-danger"},"Error")}}render(){return this.documents.length?s("div",{class:"mt-4"},s("div",{class:"card",part:z},s("div",{class:"card-body"},s("h5",{class:"card-title",part:M},"Uploaded Documents"),s("div",{class:"table-responsive"},s("table",{class:"table table-sm table-borderless",part:U},s("thead",null,s("tr",null,s("th",{style:{width:"25%"},part:Z,scope:"col"},"Category"),s("th",{style:{width:"25%"},part:Z,scope:"col"},"Document Type"),s("th",{style:{width:"30%"},part:Z,scope:"col"},"File Name"),s("th",{style:{width:"20%"},part:Z,scope:"col"},"Status"))),s("tbody",null,this.documents.map(((t,e)=>s("tr",{class:0===e?"border-bottom border-top":"border-bottom"},s("td",{part:Y},t.categoryLabel),s("td",{part:Y},t.docTypeLabel),s("td",{part:Y},t.fileName),s("td",{part:Y},this.renderStatus(t.status))))))))))):null}},Yt=class{constructor(s){t(this,s),this.errorEvent=e(this,"error-event",7),this.stepCompleteEvent=e(this,"complete-form-step-event",7),this.formLoading=e(this,"formLoading",7),this.errors={},this.legal_address={},this.isLoading=!1,this.getData=()=>{this.getBusiness&&(this.formLoading.emit(!0),this.isLoading=!0,this.getBusiness({onSuccess:t=>{const e=new V((t.data||{}).legal_address||{});this.legal_address=Object.assign(Object.assign({},e),{country:this.country}),this.formController.setInitialValues(Object.assign({},this.legal_address))},onError:({error:t,code:e,severity:s})=>{this.errorEvent.emit({message:t,errorCode:e,severity:s})},final:()=>{this.formLoading.emit(!1),this.isLoading=!1}}))},this.sendData=t=>{let e;this.formLoading.emit(!0),this.patchBusiness({payload:this.patchPayload,onSuccess:s=>{e=s,t()},onError:({error:t,code:s,severity:i})=>{e=t,this.errorEvent.emit({message:t,errorCode:s,severity:i})},final:()=>{this.stepCompleteEvent.emit({response:e,formStep:st.legalAddress}),this.formLoading.emit(!1)}})},this.inputHandler=(t,e)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[t]:e}))}}propChanged(){this.initializeApi()}async validateAndSubmit({onSuccess:t}){this.formController.validateAndSubmit((()=>this.sendData(t)))}get patchPayload(){return{legal_address:new V(this.formController.values.getValue()).payload}}componentWillLoad(){this.initializeApi(),this.formController=new x((0,L[this.country])(this.allowOptionalFields)),this.getData()}componentDidLoad(){this.formController.errors.subscribe((t=>{this.errors=Object.assign({},t)}))}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=c({authToken:this.authToken,businessId:this.businessId,service:new v}),this.patchBusiness=d({authToken:this.authToken,businessId:this.businessId,service:new v})):this.errorEvent.emit({message:"Missing required props",errorCode:r.MISSING_PROPS,severity:a.ERROR})}render(){var t;const e=null===(t=this.formController)||void 0===t?void 0:t.getInitialValues();return this.isLoading?s(X,null):s("form",null,s("fieldset",null,s("div",{class:"d-flex align-items-center gap-2"},s("legend",{class:"mb-0",part:M},"Legal Address of your Business"),s("form-control-tooltip",{helpText:"No PO Boxes."})),s("hr",{class:"mt-2"}),s("form-address-fields",{country:this.country,errors:this.errors,defaultValues:e,inputHandler:this.inputHandler})))}static get watchers(){return{authToken:["propChanged"],businessId:["propChanged"]}}},$t=class{loadingWatcher(){this.formLoading.emit(this.isLoading)}constructor(s){t(this,s),this.clickEvent=e(this,"click-event",7),this.errorEvent=e(this,"error-event",7),this.formLoading=e(this,"formLoading",7),this.ownerSubmitted=e(this,"ownerSubmitted",7),this.isLoading=!1,this.errors={},this.owner={},this.getData=()=>{this.getOwner&&(this.isLoading=!0,this.getOwner({onSuccess:t=>{this.instantiateOwner(t.data)},onError:({error:t,code:e,severity:s})=>{this.errorEvent.emit({message:t,errorCode:e,severity:s})},final:()=>this.isLoading=!1}))},this.sendData=()=>(this.isLoading=!0,new Promise((t=>{this.ownerId?this.patchOwner({payload:this.payload,onSuccess:e=>{this.ownerSubmitted.emit({id:e.data.id}),this.instantiateOwner(e.data),t(!0)},onError:({error:e,code:s,severity:i})=>{this.errorEvent.emit({message:e,errorCode:s,severity:i}),t(!1)},final:()=>this.isLoading=!1}):this.postOwner({payload:this.payload,onSuccess:e=>{this.ownerSubmitted.emit({id:e.data.id}),this.instantiateOwner(e.data),t(!0)},onError:({error:e,code:s,severity:i})=>{this.errorEvent.emit({message:e,errorCode:s,severity:i}),t(!1)},final:()=>this.isLoading=!1})}))),this.instantiateOwner=async t=>{this.owner=Object.assign({},new H(t)),await this.formController.setInitialValues(this.owner)},this.handleAddOwner=()=>{this.clickEvent.emit({name:this.ownerId?it.updateOwner:it.addOwner})},this.handleRemoveOwner=()=>{this.removeOwner(this.ownerId),this.clickEvent.emit({name:it.removeOwner})},this.validate=this.validate.bind(this),this.submit=this.submit.bind(this),this.validateAndSubmit=this.validateAndSubmit.bind(this)}async returnOwnerData(){return this.ownerId}async getOwnershipPercentage(){var t;return(null===(t=this.formController.values.getValue())||void 0===t?void 0:t.ownership_percentage)||null}async setOwnershipPercentageError(t){this.formController.setFieldError("ownership_percentage",t)}async validate(){return this.formController.validate()}async submit(){if(await this.validate())return this.sendData()}async validateAndSubmit(t){t.preventDefault(),await this.validate()&&this.submit()}get payload(){const t=new H(this.formController.values.getValue()).payload;return this.ownerId?t:Object.assign(Object.assign({},t),{business_id:this.businessId})}get formTitle(){return this.ownerId?"Edit Business Owner":"Add Business Owner"}get submitButtonText(){return this.ownerId?"Update":"Add"}get showRemoveButton(){return!(this.ownersLength<=1)&&(!(this.ownerId||!this.newFormOpen)||!(!this.ownerId||this.newFormOpen)||void 0)}componentWillLoad(){this.formController=new x((0,C[this.country])("owner",this.allowOptionalFields)),this.initializeApi(),this.ownerId&&this.getOwner?this.getData():this.instantiateOwner({})}componentDidLoad(){this.formController.errors.subscribe((t=>this.errors=Object.assign({},t)))}initializeApi(){this.authToken&&(this.getOwner=b({authToken:this.authToken,identityId:this.ownerId,service:new k}),this.patchOwner=p({authToken:this.authToken,identityId:this.ownerId,service:new k}),this.postOwner=f({authToken:this.authToken,service:new k}))}render(){return s(i,{key:"b168e9f5a52416984e6a04ab5f0771b63ee28b2e",style:{display:"block"}},s("form",{key:"d22a6aae3f5debd30d87b3bd37c67390a46c4590",onSubmit:this.validateAndSubmit},s("fieldset",{key:"30597bc1f4983bddbdc0ed45e6be7e715d0b9b8e"},s("legend",{key:"508f2a777bd0422572002053f6c167242252850d",class:"fw-semibold fs-5",part:G},this.formTitle),s("br",{key:"2dd17c21e931a2a9c15489828c7d1d0542ff4de4"}),s("div",{key:"e9d7d7a10546e5e1bdabb0a994d994c47cd77bd6",class:"row gy-3"},s("owner-form-inputs",{key:"e556391c25a05d3f89601f1e0ac3834a5c26becd",ownerDefaultValue:this.formController.getInitialValues(),errors:this.errors,formController:this.formController,country:this.country}),s("div",{key:"48eb9390459f2ca619914e54726c9a0ae1290e31",class:"d-flex gap-2 justify-content-start"},s(ut,{key:"f9ccd8732981cdec9675332cc8f5c14d4938cbad",variant:"secondary",type:"button",onClick:this.handleRemoveOwner,hidden:!this.showRemoveButton},"Remove"),s(ut,{key:"607a54ce6c4c0af42f3f8c7cbe1374a69752eca3",variant:"primary",type:"submit",onClick:this.handleAddOwner,disabled:this.isLoading},this.submitButtonText))),s("hr",{key:"9ec1f815d8c3335daf2a4f98c2679930e22956e3"}))))}static get watchers(){return{isLoading:["loadingWatcher"]}}},Gt=class{constructor(s){t(this,s),this.plaidVerificationSuccess=e(this,"plaidVerificationSuccess",7),this.plaidVerificationError=e(this,"plaidVerificationError",7),this.linkToken=null,this.linkTokenId=null,this.plaidLink=null,this.isAuthenticating=!1,this.isSuccess=!1,this.error=null,this.isLoading=!1,this.plaidService=new Tt,this.abortController=null,this.timeoutId=null,this.initializePlaidLink=async()=>{try{if(void 0===window.Plaid)return void this.handleError({code:h.PLAID_SDK_LOAD_FAILED,message:l[h.PLAID_SDK_LOAD_FAILED],severity:o[h.PLAID_SDK_LOAD_FAILED],retryable:!0,userAction:"Refresh the page and try again"});if(await this.getLinkToken(),!this.linkToken)return void this.handleError({code:h.PLAID_LINK_TOKEN_FAILED,message:l[h.PLAID_LINK_TOKEN_FAILED],severity:o[h.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:h.PLAID_LINK_INIT_FAILED,message:l[h.PLAID_LINK_INIT_FAILED],severity:o[h.PLAID_LINK_INIT_FAILED],originalError:t,retryable:!0,userAction:"Click to try again"})}},this.getLinkToken=async()=>{var t,e,s,i;try{if(!this.authToken||!this.accountId)return void this.handleError({code:h.PLAID_LINK_TOKEN_FAILED,message:"Missing authentication. Please provide authToken and accountId.",severity:a.ERROR,retryable:!1,userAction:"Provide required props"});this.abortController=new AbortController,this.timeoutId=setTimeout((()=>{var t;null===(t=this.abortController)||void 0===t||t.abort()}),3e4);const t=await this.plaidService.getLinkTokenForVerification(this.authToken,this.businessId,this.abortController.signal);if(this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null),t.error)throw new Error("string"==typeof t.error?t.error:t.error.message||"Failed to get link token");this.linkToken=t.data.link_token,this.linkTokenId=t.data.id}catch(a){this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null);let r=h.PLAID_LINK_TOKEN_FAILED,n=l[r],c=!0;"AbortError"===a.name?(r=h.PLAID_TIMEOUT,n=l[r],c=!0):(null===(t=a.message)||void 0===t?void 0:t.includes("network"))||(null===(e=a.message)||void 0===e?void 0:e.includes("fetch"))?(r=h.PLAID_NETWORK_ERROR,n=l[r],c=!0):((null===(s=a.message)||void 0===s?void 0:s.includes("401"))||(null===(i=a.message)||void 0===i?void 0:i.includes("unauthorized")))&&(r=h.PLAID_INVALID_CREDENTIALS,n="Authentication failed. Please check your credentials.",c=!1),this.handleError({code:r,message:n,severity:o[r],originalError:a,retryable:c,userAction:c?"Click to try again":"Check your credentials"})}},this.openPlaidLink=()=>{this.plaidLink&&this.linkToken&&(this.isAuthenticating=!0,this.clearError(),this.plaidLink.open())},this.handlePlaidSuccess=async t=>{var e;this.isAuthenticating=!1,this.isLoading=!0,this.clearError();try{const s=await this.plaidService.postPlaidVerifiedBankAccountData(this.authToken,this.businessId,{public_token:t,link_token_id:this.linkTokenId},null===(e=this.abortController)||void 0===e?void 0:e.signal);if(s.error)throw new Error("string"==typeof s.error?s.error:s.error.message||"Failed to verify bank account");this.isSuccess=!0,this.isLoading=!1,this.plaidVerificationSuccess.emit({publicToken:t,bankAccount:s.data})}catch(t){this.isLoading=!1,this.handleError({code:h.PLAID_AUTHENTICATION_FAILED,message:(null==t?void 0:t.message)||"Failed to verify bank account",severity:o[h.PLAID_AUTHENTICATION_FAILED],originalError:t,retryable:!0,userAction:"Click to try again"})}},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=h.PLAID_AUTHENTICATION_FAILED,s=l[e],i=!0,a="Click to try again";if(t.error_code)switch(t.error_code){case"INVALID_CREDENTIALS":e=h.PLAID_INVALID_CREDENTIALS,s=l[e],i=!0;break;case"ITEM_LOGIN_REQUIRED":e=h.PLAID_INVALID_CREDENTIALS,s="Your bank requires re-authentication. Please try again.",i=!0;break;case"ITEM_LOCKED":e=h.PLAID_ACCOUNT_LOCKED,s=l[e],i=!1,a="Contact your bank";break;case"INSTITUTION_NOT_RESPONDING":e=h.PLAID_MAINTENANCE,s=l[e],i=!0;break;case"RATE_LIMIT_EXCEEDED":e=h.PLAID_RATE_LIMITED,s=l[e],i=!0;break;default:t.error_message&&(s=t.error_message)}this.handleError({code:e,message:s,severity:o[e],originalError:t,retryable:i,userAction:a}),this.isAuthenticating=!1},this.handleError=t=>{this.error=t,this.isLoading=!1,this.plaidVerificationError.emit(t),console.error("Plaid verification error:",t)},this.clearError=()=>{this.error&&(this.error=null)}}componentDidRender(){this.scriptRef&&(this.scriptRef.onload=()=>{this.initializePlaidLink()},this.scriptRef.onerror=()=>{this.handleError({code:h.PLAID_SDK_LOAD_FAILED,message:l[h.PLAID_SDK_LOAD_FAILED],severity:o[h.PLAID_SDK_LOAD_FAILED],retryable:!0,userAction:"Refresh the page and try again"})})}disconnectedCallback(){this.timeoutId&&clearTimeout(this.timeoutId),this.abortController&&this.abortController.abort()}render(){const t=s("svg",{class:"plaid-logo-img",height:"20",width:"20",viewBox:"0 0 28 29",xmlns:"http://www.w3.org/2000/svg",style:{display:"inline",marginLeft:"5px",marginRight:"5px",marginTop:"-2px"}},s("g",{fill:"#fff","fill-rule":"evenodd"},s("path",{d:"M25.7629 26.2628L28 17.5309L24.9691 14.5001L27.9999 11.4691L25.7628 2.73706L17.0309 0.5L14.0001 3.531L10.969 0.50014L2.23706 2.73734L0 11.4691L3.03128 14.4999L0.00014 17.531L2.2372 26.2629L10.9691 28.5L14.0001 25.469L17.031 28.4999L25.7629 26.2628ZM15.7321 23.7371L18.6186 20.8505L22.2912 24.5233L17.6956 25.7007L15.7321 23.7371ZM11.1136 9.88154L14.0003 6.99502L16.8868 9.8814L14.0001 12.7679L11.1136 9.88154ZM12.2682 14.5L9.38154 17.3865L6.49502 14.5L9.38154 11.6135L12.2682 14.5ZM18.6187 11.6133L21.5053 14.5L18.6186 17.3865L15.7321 14.5L18.6187 11.6133ZM16.8867 19.1186L14.0001 22.0051L11.1135 19.1185L14.0001 16.2319L16.8867 19.1186ZM10.3044 25.7007L5.70864 24.5233L9.38154 20.8504L12.2682 23.7371L10.3044 25.7007ZM4.76308 16.2319L7.6496 19.1185L3.9767 22.7914L2.7993 18.1957L4.76308 16.2319ZM3.9767 6.20836L7.64974 9.8814L4.76308 12.7681L2.7993 10.8041L3.9767 6.20836ZM12.2683 5.26294L9.38168 8.1496L5.70892 4.4767L10.3047 3.2993L12.2683 5.26294ZM17.6959 3.2993L22.2915 4.4767L18.6186 8.14946L15.7321 5.26294L17.6959 3.2993ZM23.2372 12.7681L20.3505 9.8814L24.0233 6.20878L25.2007 10.8046L23.2372 12.7681ZM24.0233 22.7914L20.3505 19.1186L23.2372 16.2321L25.2007 18.1957L24.0233 22.7914Z"})));return s(_t,null,s("script",{src:"https://cdn.plaid.com/link/v2/stable/link-initialize.js",async:!0,ref:t=>this.scriptRef=t}),s("div",null,s("div",{class:"mb-3"},s(ut,{variant:"primary",type:"button",onClick:t=>{t.preventDefault(),this.openPlaidLink()},disabled:this.isLoading,part:Q},"Connect with Plaid ",t," (instant verification)")),(()=>this.error?s("div",{class:(this.error.severity===a.ERROR?"text-danger":this.error.severity===a.WARNING?"text-warning":"text-info")+" mt-2"},s("small",null,this.error.message),s("br",null),this.error.userAction&&s("small",{class:"text-muted"},this.error.userAction)):null)(),(()=>this.error?null:this.isLoading?s("div",{class:"text-info mt-2"},s("small",null,"Verifying bank account...")):this.isSuccess?s("div",{class:"text-success mt-2"},s("small",null,"✓ Bank account verified successfully")):this.isAuthenticating?s("div",{class:"text-info mt-2"},s("small",null,"Connecting to your bank...")):null)()))}};export{Lt as additional_questions_form_step,xt as bank_account_form_inputs,St as bank_account_form_inputs_canada,At as business_bank_account_form_step,Dt as business_core_info_form_step,Et as business_documents_on_file,It as business_owners_form_step,Vt as business_representative_form_inputs,Ht as business_representative_form_step,Pt as business_terms_conditions_form_step,Ut as document_upload_form_step,Zt as document_upload_list,Yt as legal_address_form_step,$t as owner_form,Gt as plaid_verification}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h as t,r as e,c as a}from"./p-CV0Pyo1O.js";import{c as i}from"./p-DVJaoI_m.js";import"./p-HXpYMWUU.js";import{j as s,C as o,e as r}from"./p-Dzv0P2Ly.js";import{p as c}from"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import{J as n}from"./p-CeW0EPHy.js";import{c as h}from"./p-DvnFba1A.js";import{g as d,a as p}from"./p-CDu7TeCZ.js";import{P as l}from"./p-DdeBubpX.js";import{T as f,a as u,b as m,c as b,d as y,e as _,f as w,g as v,h as T,i as j,j as g,k as C,l as k}from"./p-BICxxa69.js";import{S as D}from"./p-DzEdYT8R.js";import{T as P}from"./p-CZfYo5-1.js";import{a as I}from"./p-BRnBHsdq.js";import{a6 as S,a7 as q}from"./p-CPKMvyV_.js";import"./p-D8GTwl9v.js";import"./p-8R9xLun-.js";import"./p-CYQvLgSs.js";import"./p-CqiVXthx.js";const x={id:()=>t("th",{part:S,scope:"col",title:"The unique identifier of each transaction"},"ID"),account_id:()=>t("th",{part:S,scope:"col",title:"The unique identifier of the account associated with each transaction"},"Account ID"),payout_id:()=>t("th",{part:S,scope:"col",title:"The unique identifier of the payout associated with each transaction"},"Payout ID"),financial_transaction_id:()=>t("th",{part:S,scope:"col",title:"The unique identifier of the financial transaction associated with the payment balance transaction"},"Financial Transaction ID"),amount:()=>t("th",{part:S,scope:"col",title:"The dollar amount of each transaction"},"Amount"),fee:()=>t("th",{part:S,scope:"col",title:"The fee associated with each transaction"},"Fee"),net:()=>t("th",{part:S,scope:"col",title:"The net amount of each transaction"},"Net"),currency:()=>t("th",{part:S,scope:"col",title:"The currency of each transaction"},"Currency"),description:()=>t("th",{part:S,scope:"col",title:"The description of each transaction"},"Description"),source_id:()=>t("th",{part:S,scope:"col",title:"The unique identifier of the source object associated with the payment balance transaction"},"Source ID"),txn_type:()=>t("th",{part:S,scope:"col",title:"The type of each transaction"},"Type"),created_at:()=>t("th",{part:S,scope:"col",title:"The date and time each transaction was made"},"Processed On"),available_on:()=>t("th",{part:S,scope:"col",title:"The date and time each transaction will be available"},"Available On"),updated_at:()=>t("th",{part:S,scope:"col",title:"The date and time each transaction was last updated"},"Updated On")},O={fee:"Fee",payment:"Payment",payout:"Payout",seller_payment_refund:"Seller Payment Refund",dispute_amount_collected:"Dispute Amount Collected",dispute_fee_collected:"Dispute Fee Collected",seller_payment:"Seller Payment",transfer:"Transfer",partner_platform_proceeds_credit:"Partner Platform Proceeds Credit"},E={id:e=>t("td",{part:q(e.id)},e.id),account_id:e=>t("td",{part:q(e.account_id)},e.account_id),payout_id:e=>t("td",{part:q(e.payout_id)},e.payout_id),financial_transaction_id:e=>t("td",{part:q(e.financial_transaction_id)},e.financial_transaction_id),amount:e=>t("td",{part:q(e.amount)},e.formattedPaymentAmount(e.amount)),fee:e=>t("td",{part:q(e.fee)},e.formattedPaymentAmount(e.fee)),net:e=>t("td",{part:q(e.net)},e.formattedPaymentAmount(e.net)),currency:e=>t("td",{part:q(e.currency)},e.currency),description:e=>t("td",{part:q(e.description)},e.description),source_id:e=>t("td",{part:q(e.source_id)},e.source_id),txn_type:e=>t("td",{part:q(e.txn_type)},O[e.txn_type]),created_at:e=>t("td",{part:q(e.created_at)},t("div",{class:"fw-bold"},I(e.created_at,{showDisplayDate:!0})),t("div",{class:"fw-bold"},I(e.created_at,{showTime:!0}))),available_on:e=>t("td",{part:q(e.available_on)},t("div",{class:"fw-bold"},I(e.available_on,{showDisplayDate:!0})),t("div",{class:"fw-bold"},I(e.available_on,{showTime:!0}))),updated_at:e=>t("td",{part:q(e.updated_at)},t("div",{class:"fw-bold"},I(e.updated_at,{showDisplayDate:!0})),t("div",{class:"fw-bold"},I(e.updated_at,{showTime:!0})))},A=class{constructor(t){e(this,t),this.clickEvent=a(this,"click-event",7),this.errorEvent=a(this,"error-event",7),this.balanceTransactions=[],this.isLoading=!0,this.errorMessage=null,this.paging=c,this.pagingParams={},this.columns="created_at,txn_type,description,amount,fee,net",this.handleClickPrevious=t=>{this.pagingParams={before_cursor:t},this.clickEvent.emit({name:P.previous})},this.handleClickNext=t=>{this.pagingParams={after_cursor:t},this.clickEvent.emit({name:P.next})},this.rowClickHandler=t=>{const e=t.target.closest("tr").dataset.rowEntityId;if(!e)return;const a=this.balanceTransactions.find((t=>t.id===e));this.clickEvent.emit({name:P.row,data:a})}}componentWillLoad(){this.transactionsTable=new f(this.balanceTransactions,this.columns,x,E),h(),this.analytics=new n(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.payoutId&&this.authToken?(({accountId:t,authToken:e,service:a})=>async({params:i,onSuccess:r,onError:c,final:n})=>{var h;try{const n=await a.fetchPayoutTransactions(t,e,i);n.error?c({error:p(n.error),code:d(null===(h=n.error)||void 0===h?void 0:h.code),severity:o.ERROR}):r({balanceTransactions:n.data.map((t=>new s(t))),pagingInfo:Object.assign({},n.page_info)})}catch(t){const e=d(null==t?void 0:t.code);c({error:p(t),code:e,severity:o.ERROR})}finally{n()}})({accountId:i.accountId,authToken:this.authToken,service:new l})({params:this.requestParams,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="payout-id and auth-token props are required",this.handleError(r.MISSING_PROPS,this.errorMessage,o.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}get requestParams(){return Object.assign({payout_id:this.payoutId,limit:"15"},this.pagingParams)}render(){return t(D,{key:"f60ae9206262ae4b7f8852ac0d6e7089b4838c81"},t(u,{key:"39d31f954e05e6c941e6064a994193cc3b45cd14"},t(m,{key:"007b157cc0b2c41f81cb4af0c7d72964b309ad68"},t(b,{key:"b23c5ea0497058cb8e8c48f7c44290e22e0014b7"},t(y,{key:"0ee5a4b9099853cdd4dbad93774d01f691ebe4f0"},this.transactionsTable.columnData.map((t=>t)))),t(_,{key:"3ded164da6ca49b74ab137386b5ff2c364b4e569"},t(w,{key:"e22ea675edfbe08f6f75e3649d598b6bf1f76c44",columnSpan:this.transactionsTable.columnKeys.length,isLoading:this.isLoading}),t(v,{key:"4f64b72463bebfb7c93351379f29e8321744309a",isEmpty:this.showEmptyState,columnSpan:this.transactionsTable.columnKeys.length}),t(T,{key:"62dccb5e3dabceb85f27da6d1e7837bf20eb0a1c",columnSpan:this.transactionsTable.columnKeys.length,errorMessage:this.errorMessage}),this.showRowData&&this.transactionsTable.rowData.map(((e,a)=>t(j,{"data-test-id":"table-row","data-row-entity-id":this.entityId[a],onClick:this.rowClickHandler},e)))),this.paging&&t(g,{key:"a3633714d3d8ca82c40ad3f7eac5bbc92ee9b7a3"},t(C,{key:"97753d854fbeea88174fdf2c8a3abdbf5068a4ca"},t(k,{key:"fb1f2991c433824e404711c38891580d58079278",colSpan:this.transactionsTable.columnData.length},t("pagination-menu",{key:"077b2fa6ebe37283e39c7061682cd52653694b2c",paging:Object.assign(Object.assign({},this.paging),{handleClickPrevious:this.handleClickPrevious,handleClickNext:this.handleClickNext})})))))))}static get watchers(){return{pagingParams:["propChanged"],payoutId:["propChanged"],authToken:["propChanged"]}}};export{A as justifi_payout_transactions_list}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e={name:"@justifi/webcomponents",version:"6.12.6-rc.1"};export{e as p}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h as i,r as s,c as t}from"./p-CV0Pyo1O.js";import{a9 as e,a8 as r,a1 as o,t as l}from"./p-CPKMvyV_.js";import{S as d}from"./p-DzEdYT8R.js";import"./p-CZfYo5-1.js";import{c as n}from"./p-DvnFba1A.js";import{J as a}from"./p-CeW0EPHy.js";import{m as h,C as c,n as v,c as u,e as p}from"./p-Dzv0P2Ly.js";import{B as m}from"./p-CL8LyqRI.js";import{B as f}from"./p-BcNb9bVO.js";import{m as y}from"./p-D9ZHVy-j.js";import{S as w}from"./p-uZ5KAseb.js";import"./p-DVJaoI_m.js";import"./p-HXpYMWUU.js";import"./p-CLHwhyvu.js";import{g as b,a as x}from"./p-CDu7TeCZ.js";import{T as g}from"./p-xWuaNtJy.js";import{l as j}from"./p-BRnBHsdq.js";import"./p-8R9xLun-.js";import"./p-CYQvLgSs.js";import"./p-D8GTwl9v.js";const C=()=>i("div",{class:"row gap-3"},i("div",{class:"col-12"},i(w,{width:"25%"})),i("div",{class:"col-12"},i(w,{width:"100%"})),i("div",{class:"col-12 d-flex gap-3"},i(w,{width:"50%"}),i(w,{width:"50%"})),i("div",{class:"col-12 d-flex gap-3"},i(w,{width:"65%"}),i(w,{width:"35%"}))),S=()=>i("div",{class:"row gap-5"},i("div",{class:"col-12"},i(w,{width:"40%",height:"40px"})),i(C,null)),k=()=>i("div",{class:"terminal-selector-skeleton mt-4 rounded shadow-sm"},i("div",{class:"d-flex align-items-center gap-3"},i(w,{width:"125px",height:"125px",styles:{borderRadius:"8px"}}),i("div",{class:"flex-grow-1"},i("div",{class:"d-flex row flex-row"},i("div",{class:"col-6 flex-column"},i(w,null),i(w,{width:"60%"})),i("div",{class:"d-flex justify-content-end align-items-center gap-2 col-6"},i(w,{width:"32px",height:"32px",styles:{borderRadius:"50%"}}),i(w,{width:"80px",height:"32px"}),i(w,{width:"32px",height:"32px",styles:{borderRadius:"50%"}}))),i("div",{class:"mt-4"},i("div",{class:"d-flex flex-column gap-2"},i(w,null),i(w,null)))))),T=class{constructor(i){s(this,i),this.errorEvent=t(this,"error-event",7),this.submitted=t(this,"submit-event",7),this.shipping=!1,this.submitButtonText="Submit Order",this.loading={business:!0,terminals:!0},this.submitting=!1,this.error=null,this.totalQuantity=0}componentWillLoad(){this.order=new v({business_id:this.businessId,sub_account_id:this.accountId,order_type:this.shipping?u.boardingShipping:u.boardingOnly}),n(),this.analytics=new a(this),this.loadData()}disconnectedCallback(){var i;null===(i=this.analytics)||void 0===i||i.cleanup()}handleError(i,s,t){this.error={message:i,code:s,severity:t},this.errorEvent.emit({errorCode:s,message:i,severity:t})}loadData(){this.businessId&&this.authToken?(this.initializeGetBusiness(),this.initializeGetTerminalModels()):this.handleError("Invalid business id or auth token",p.MISSING_PROPS,c.ERROR)}initializeGetBusiness(){y({id:this.businessId,authToken:this.authToken,service:new m})({onSuccess:({business:i})=>{this.business=new f(i)},onError:({error:i,code:s,severity:t})=>{this.handleError(i,s,t)},final:()=>{this.loading.business=!1}})}initializeGetTerminalModels(){(({id:i,authToken:s,service:t})=>async({onSuccess:e,onError:r})=>{var o,l,d,n;try{const a=await t.fetchTerminalModels(i,s);if(a.error)return r({error:x(a.error),code:b(null===(n=a.error)||void 0===n?void 0:n.code),severity:c.ERROR});e({terminals:(null===(l=null===(o=a.data)||void 0===o?void 0:o.terminal_order_models)||void 0===l?void 0:l.map((i=>new h(i))))||[],orderLimit:null===(d=a.data)||void 0===d?void 0:d.order_limit})}catch(i){const s=b(null==i?void 0:i.code);return r({error:i.message||i,code:s,severity:c.ERROR})}})({id:this.accountId,authToken:this.authToken,service:new g})({onSuccess:({terminals:i,orderLimit:s})=>{this.terminalModels=i,this.orderLimit=s,this.loading.terminals=!1},onError:({error:i,code:s,severity:t})=>{this.handleError(i,s,t),this.loading.terminals=!1}})}submitOrder(){const i=(({authToken:i,service:s,apiOrigin:t="https://wc-proxy.justifi.ai"})=>async({terminalOrder:e,onSuccess:r,onError:o})=>{var l;try{const d=await s.orderTerminals(i,e,t);if(d.error)return o({error:x(d.error),code:b(null===(l=d.error)||void 0===l?void 0:l.code),severity:c.ERROR});{const{data:i}=d;r({data:i})}}catch(i){const s=b(null==i?void 0:i.code);return o({error:i.message||i,code:s,severity:c.ERROR})}})({authToken:this.authToken,service:new g});this.submitting=!0,i({terminalOrder:this.order.payload,onSuccess:({data:i})=>{this.submitted.emit(i),this.submitting=!1},onError:({error:i,code:s,severity:t})=>{this.handleError(i,s,t),this.submitting=!1}})}onSelectedQuantityChange(i){this.order.updateTerminal(i.detail.modelName,i.detail.quantity),this.totalQuantity=this.order.totalQuantity}renderLoading(){return i("div",null,this.loading.business&&i(S,null),this.loading.terminals&&i("div",{class:"mt-5"},i(k,null),i(k,null),i(k,null)))}renderBusinessDetails(){var s,t,o,l,d,n,a,h;if(!this.loading.business&&this.business)return i("div",{class:"d-flex flex-column gap-4 mb-5 pt-5"},i("div",{class:"row"},i("div",{class:"col-12"},i("h2",{part:r},this.business.legal_name))),i("div",{class:"row"},i("div",{class:"col-6"},i("h5",{part:e},"Representative:"),i("div",null,i("div",null,null===(t=null===(s=this.business)||void 0===s?void 0:s.representative)||void 0===t?void 0:t.name),i("div",null,null===(l=null===(o=this.business)||void 0===o?void 0:o.representative)||void 0===l?void 0:l.title),i("div",null,null===(n=null===(d=this.business)||void 0===d?void 0:d.representative)||void 0===n?void 0:n.email),i("div",null,j(null===(h=null===(a=this.business)||void 0===a?void 0:a.representative)||void 0===h?void 0:h.phone)))),i("div",{class:"col-6"},i("h5",{part:e},this.shipping?"Shipping Address:":"Business Address:"),i("div",null,this.business.legal_address.line1,this.business.legal_address.line2?`, ${this.business.legal_address.line2}`:"",i("br",null),this.business.legal_address.city,", ",this.business.legal_address.state," ",this.business.legal_address.postal_code))))}renderTerminals(){if(!this.loading.terminals&&this.terminalModels)return i("div",{class:"d-flex flex-column gap-2 mt-5"},this.terminalModels.map((s=>i("terminal-quantity-selector",{modelName:s.model_name,description:s.description,imageUrl:s.image_url,helpUrl:s.help_url,limit:this.orderLimit-this.order.totalQuantity,onSelectedQuantityChange:this.onSelectedQuantityChange.bind(this)}))))}renderOrderSection(){return i("div",{class:"mt-3"},i("div",{class:"text-end"},"Order limit: ",this.orderLimit),i("div",{class:"d-flex justify-content-end mt-3"},i("button",{class:"btn btn-primary submit-btn",onClick:this.submitOrder.bind(this),disabled:0===this.order.totalQuantity||this.submitting,part:o},this.submitting?"Submitting...":this.submitButtonText)))}render(){return i(d,{key:"a6d128c8f7075ba4bf6dc033e357dac187cdb965"},i("div",{key:"9e726c70efc7e9b9163ded2ca1e88dc4303b2f21",part:l},this.renderLoading(),this.renderBusinessDetails(),this.renderTerminals(),this.renderOrderSection()))}};export{T as justifi_order_terminals}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as e,h as i,H as s,g as n}from"./p-CV0Pyo1O.js";import{A as a}from"./p-CYQvLgSs.js";import{A as o,p as r,q as h,r as l,s as c,t as d,u,C as p,e as y,v as m,I as v,w as f,x as g,y as M}from"./p-Dzv0P2Ly.js";import{S as b}from"./p-DzEdYT8R.js";import"./p-CZfYo5-1.js";import{S as k}from"./p-uZ5KAseb.js";import{c as w,o as j,a as P,g as T,b as A}from"./p-BArmtmkq.js";import{t as N,r as C}from"./p-CPKMvyV_.js";import{f as I}from"./p-BRnBHsdq.js";import{w as E,c as D}from"./p-DVJaoI_m.js";import{H as S}from"./p-jIDKmNHy.js";import{H as L,b as O,h as x,i as z}from"./p-D-zwk1J3.js";import{H as _}from"./p-DYHjzFnJ.js";import{J as R}from"./p-CeW0EPHy.js";import{c as U}from"./p-DvnFba1A.js";import"./p-HXpYMWUU.js";import"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import{g as B,a as Y}from"./p-CDu7TeCZ.js";import{C as F}from"./p-Cz0yhyYu.js";import{P as Q}from"./p-BSyTbuZy.js";import{P as V,a as H,b as Z}from"./p-DkoufM1t.js";import{C as G}from"./p-ZpPDShvP.js";import"./p-D8GTwl9v.js";import"./p-8R9xLun-.js";const W=class{constructor(i){t(this,i),this.radioClick=e(this,"radio-click",7),this.checked=!1,this.hidden=!1}render(){return i(b,{key:"02955940079320bd9c6bf94e239545385ac36458"},i("radio-list-item",{key:"fc6b98e456e4326b843b2b3248b7327436767cf4",name:this.name,value:this.value,label:this.label,checked:this.checked,hidden:this.hidden,class:this.class,"onRadio-click":t=>this.radioClick.emit(t.detail)}))}};var q;!function(t){t.UNAVAILABLE="UNAVAILABLE",t.SESSION_ERROR="SESSION_ERROR",t.MERCHANT_VALIDATION_ERROR="MERCHANT_VALIDATION_ERROR",t.PAYMENT_PROCESSING_ERROR="PAYMENT_PROCESSING_ERROR",t.USER_CANCELLED="USER_CANCELLED"}(q||(q={}));class J{constructor(){this.api=a()}initialize(t){if(this.applePayConfig=new o(t),!this.applePayConfig.isValid)throw new Error("Invalid Apple Pay configuration provided")}async validateMerchant(t,e){try{return await this.api.post({endpoint:"apple_pay/merchant_session",authToken:t,headers:{"Sub-Account":e},body:{domain:window.location.hostname,display_name:this.applePayConfig.displayName}})}catch(t){throw console.error("Backend validation failed:",t),new Error("Merchant validation failed")}}async processPayment(t,e,i){const s=await this.api.post({endpoint:"apple_pay/process_token",authToken:t,body:i,headers:{"Sub-Account":e}});return{success:s.id&&!!s.data.token,data:s}}isAvailable(){return r.isApplePaySupported()&&r.canMakePayments()}async canMakePaymentsWithActiveCard(){if(!this.applePayConfig)throw new Error("Apple Pay not initialized. Call initialize() first.");return await r.canMakePaymentsWithActiveCard(this.applePayConfig.merchantIdentifier)}async startPaymentSession(t,e,i){if(!this.applePayConfig)throw console.error("[ApplePayService] Missing applePayConfig. Did you call initialize()?"),new Error("Apple Pay not initialized. Call initialize() first.");const s=new h(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:q.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:q.SESSION_ERROR,message:t instanceof Error?t.message:"Failed to start Apple Pay session"}})}}))}abortPaymentSession(){this.currentSession&&(this.currentSession.abort(),this.currentSession=void 0,this.currentPaymentRequest=void 0)}setupSessionEventHandlers(t,e,i,s){this.currentSession&&this.applePayConfig&&this.currentPaymentRequest?(this.currentSession.onvalidatemerchant=async()=>{try{if(!i)throw console.error("[ApplePayService] Missing authToken for merchant validation"),new Error("Authentication token not provided.");const t=await this.validateMerchant(i,s);try{this.currentSession.completeMerchantValidation(t)}catch(t){throw console.error("Error calling completeMerchantValidation:",t),t}}catch(t){console.error("=== MERCHANT VALIDATION ERROR ==="),console.error("Error during merchant validation:",t),t&&t.stack&&console.error("Error stack:",t.stack),this.currentSession.abort(),e({success:!1,error:{code:q.MERCHANT_VALIDATION_ERROR,message:t instanceof Error?t.message:"Merchant validation failed"}})}},this.currentSession.onpaymentauthorized=async n=>{try{const a=n.payment,o=Object.assign(Object.assign({},a.token),{product_details:{name:this.currentPaymentRequest.total.label,price:r.parseAmount(this.currentPaymentRequest.total.amount),description:this.currentPaymentRequest.total.label}}),h=await this.processPayment(i,s,o);h.success?(this.currentSession.completePayment({status:l.STATUS_SUCCESS}),t({success:!0,token:a.token,paymentMethodId:h.data.id})):(console.error("PSP reported payment failure:",h.data),this.currentSession.completePayment({status:l.STATUS_FAILURE}),e({success:!1,error:{code:q.PAYMENT_PROCESSING_ERROR,message:"Payment processing failed"}}))}catch(t){console.error("=== PAYMENT PROCESSING ERROR ==="),console.error("Error processing payment:",t),t&&t.stack&&console.error("Error stack:",t.stack),this.currentSession.completePayment({status:l.STATUS_FAILURE}),e({success:!1,error:{code:q.PAYMENT_PROCESSING_ERROR,message:t instanceof Error?t.message:"Payment processing failed"}})}finally{this.currentSession=void 0,this.currentPaymentRequest=void 0}},this.currentSession.onpaymentmethodselected=()=>{const t={newTotal:this.currentPaymentRequest.total,newLineItems:this.currentPaymentRequest.lineItems||[]};try{this.currentSession.completePaymentMethodSelection(t)}catch(t){console.error("Error completing payment method selection:",t),this.currentSession.abort()}},this.currentSession.onshippingmethodselected=()=>{this.currentSession.completeShippingMethodSelection({status: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:q.USER_CANCELLED,message:"User cancelled the Apple Pay session"}})},"onerror"in this.currentSession&&(this.currentSession.onerror=t=>{console.error("=== APPLE PAY SESSION ERROR ==="),console.error("Session error:",t),this.currentSession=void 0,this.currentPaymentRequest=void 0,e({success:!1,error:{code:q.SESSION_ERROR,message:"Apple Pay session error occurred"}})})):console.error("[ApplePayService] setupSessionEventHandlers called without required state",{hasSession:Boolean(this.currentSession),hasConfig:Boolean(this.applePayConfig),hasPaymentRequest:Boolean(this.currentPaymentRequest)})}static createPaymentRequest(t,e,i="US",s="USD"){return{countryCode:i,currencyCode:s,merchantCapabilities:r.getDefaultMerchantCapabilities(),supportedNetworks:r.getDefaultSupportedNetworks(),total:r.createLineItem(e,t)}}getApplePayConfig(){return this.applePayConfig}}const K=t=>{const{isLoading:e}=t;return e?i("div",{class:"container-fluid p-0"},i("div",{class:"row mb-3"},i("div",{class:"col-12 align-content-center"},i(k,{height:"44px",width:"100%",styles:{borderRadius:"8px"}})))):null},X=t=>i("div",{class:"apple-pay-button-container"},i("button",Object.assign({class:(()=>{let e="apple-pay-button";switch(t.buttonStyle){case c.WHITE:e+=" apple-pay-button-white";break;case c.WHITE_OUTLINE:e+=" apple-pay-button-white-outline";break;default:e+=" apple-pay-button-black"}switch(t.buttonType){case d.BUY:e+=" apple-pay-button-type-buy";break;case d.DONATE:e+=" apple-pay-button-type-donate";break;default:e+=" apple-pay-button-type-plain"}return(t.disabled||t.isProcessing||!t.isAvailable)&&(e+=" disabled"),e})(),style:{width:t.width,height:t.height},onClick:()=>{!t.disabled&&!t.isProcessing&&t.isAvailable&&t.clickHandler&&t.clickHandler()},disabled:t.disabled||t.isProcessing||!t.isAvailable,"aria-label":"Pay with Apple Pay",type:"button"},t),t.isProcessing&&i("div",{class:"processing-overlay"},i("div",{class:"spinner"}),i("span",null,"Processing..."))),i("style",null,"\n .apple-pay-button-container {\n display: block;\n position: relative;\n width: 100%;\n }\n\n /* Apple Pay CSS classes - these are the official Apple Pay button styles */\n .apple-pay-button {\n display: inline-block;\n -webkit-appearance: -apple-pay-button;\n -apple-pay-button-type: plain; /* default */\n -apple-pay-button-style: black; /* default */\n border-radius: 8px;\n cursor: pointer;\n border: none;\n outline: none;\n transition: opacity 0.2s ease;\n position: relative;\n }\n\n /* Button styles */\n .apple-pay-button.apple-pay-button-black {\n -apple-pay-button-style: black;\n }\n\n .apple-pay-button.apple-pay-button-white {\n -apple-pay-button-style: white;\n }\n\n .apple-pay-button.apple-pay-button-white-outline {\n -apple-pay-button-style: white-outline;\n }\n\n /* Button types */\n .apple-pay-button.apple-pay-button-type-plain {\n -apple-pay-button-type: plain;\n }\n\n .apple-pay-button.apple-pay-button-type-buy {\n -apple-pay-button-type: buy;\n }\n\n .apple-pay-button.apple-pay-button-type-donate {\n -apple-pay-button-type: donate;\n }\n\n /* Hover and disabled states */\n .apple-pay-button:hover:not(.disabled) {\n opacity: 0.9;\n }\n\n .apple-pay-button.disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n /* Processing overlay */\n .processing-overlay {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 8px;\n background: rgba(0, 0, 0, 0.8);\n color: white;\n border-radius: 8px;\n font-size: 14px;\n font-weight: 500;\n }\n\n .spinner {\n width: 16px;\n height: 16px;\n border: 2px solid rgba(255, 255, 255, 0.3);\n border-top: 2px solid #fff;\n border-radius: 50%;\n animation: spin 1s linear infinite;\n }\n\n @keyframes spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n }\n\n /* Responsive design */\n @media (max-width: 480px) {\n .apple-pay-button {\n width: 100% !important;\n min-width: 200px;\n }\n }\n ")),$=class{constructor(i){t(this,i),this.applePayStarted=e(this,"applePayStarted",7),this.applePayCompleted=e(this,"applePayCompleted",7),this.applePayCancelled=e(this,"applePayCancelled",7),this.applePayError=e(this,"applePayError",7),this.sdkLoaded=!1,this.countryCode="US",this.merchantIdentifier="merchant.com.staging-justifi.checkout-dev",this.merchantDisplayName="JustiFi Checkout",this.initiativeContext="dev-checkout.justifi-staging.com",this.buttonType=d.PLAIN,this.buttonStyle=c.BLACK,this.disabled=!1,this.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,i;if(!this.isProcessing&&!this.disabled&&this.isAvailable)try{this.isProcessing=!0,this.error=null,this.applePayStarted.emit();const i={countryCode:this.countryCode,currencyCode:w.paymentCurrency,merchantCapabilities:[u.SUPPORTS_3DS,u.SUPPORTS_CREDIT,u.SUPPORTS_DEBIT],supportedNetworks:r.getDefaultSupportedNetworks(),total:r.createLineItem(w.paymentDescription,w.paymentAmount)},s=await this.applePayService.startPaymentSession(i,w.authToken,w.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)||$.ErrorCode.PAYMENT_FAILED}))}catch(t){if((null===(i=null==t?void 0:t.error)||void 0===i?void 0:i.code)===q.USER_CANCELLED)this.applePayCancelled.emit();else{const e=t instanceof Error?t.message:"Payment failed";this.error=e,this.applePayError.emit({error:e,code:$.ErrorCode.PAYMENT_FAILED}),this.applePayCompleted.emit({success:!1,error:e})}}finally{this.isProcessing=!1}}}componentWillLoad(){this.isAvailable=r.isApplePaySupported(),this.isAvailable?w.checkoutLoaded?this.loadApplePaySDK():j("checkoutLoaded",(t=>{t&&this.loadApplePaySDK()})):this.isLoading=!1}loadApplePaySDK(){if(this.sdkLoaded)return;this.sdkLoaded=!0;const t=document.createElement("script");t.src="https://applepay.cdn-apple.com/jsapi/1.latest/apple-pay-sdk.js",t.async=!0,t.onload=()=>this.initializeApplePay(),document.head.appendChild(t)}async initializeApplePay(){try{if(this.isLoading=!0,this.error=null,this.isConfigValid=!0,!(Boolean(w.paymentAmount)&&Boolean(w.paymentCurrency)&&Boolean(w.authToken)))return this.error="Missing required Apple Pay configuration",this.isConfigValid=!1,this.applePayError.emit({error:this.error,code:$.ErrorCode.CONFIG_ERROR}),void(this.isLoading=!1);if(this.isAvailable=r.isApplePaySupported(),this.canMakePayments=r.canMakePayments(),!this.isAvailable)return this.error="Apple Pay is not supported on this device",this.applePayError.emit({error:this.error,code:$.ErrorCode.NOT_SUPPORTED}),void(this.isLoading=!1);if(!this.canMakePayments)return this.error="Apple Pay is not available",this.applePayError.emit({error:this.error,code:$.ErrorCode.NOT_AVAILABLE}),void(this.isLoading=!1);const t={merchantIdentifier:this.merchantIdentifier,displayName:this.merchantDisplayName,initiative:"web",initiativeContext:this.initiativeContext,buttonType:this.buttonType,buttonStyle:this.buttonStyle};this.applePayService=new J,this.applePayService.initialize(t),await this.applePayService.canMakePaymentsWithActiveCard()||console.warn("No Apple Pay cards available, but continuing...")}catch(t){this.error=t instanceof Error?t.message:"Failed to initialize Apple Pay",this.applePayError.emit({error:this.error,code:$.ErrorCode.INITIALIZATION_ERROR})}finally{this.isLoading=!1}}async isSupported(){return this.isAvailable&&this.canMakePayments}async getPaymentMethods(){return this.isAvailable?r.getDefaultSupportedNetworks():[]}async abort(){var t;null===(t=this.applePayService)||void 0===t||t.abortPaymentSession(),this.isProcessing=!1,this.applePayCancelled.emit()}render(){if(!w.applePayEnabled)return null;if(!this.isAvailable)return null;const t=!this.isLoading&&this.isAvailable&&this.canMakePayments&&this.isConfigValid;return i(b,null,i("div",{class:"apple-pay-container"},i(K,{isLoading:this.isLoading}),t&&i(X,{buttonType:this.buttonType,buttonStyle:this.buttonStyle,disabled:this.disabled,isProcessing:this.isProcessing,isAvailable:this.isAvailable,clickHandler:this.handleApplePayClick,width:this.width,height:this.height})),i("style",null,"\n .apple-pay-container {\n width: 100%;\n }\n "))}};$.ErrorCode={CONFIG_ERROR:"CONFIG_ERROR",NOT_SUPPORTED:"NOT_SUPPORTED",NOT_AVAILABLE:"NOT_AVAILABLE",INITIALIZATION_ERROR:"INITIALIZATION_ERROR",PAYMENT_FAILED:"PAYMENT_FAILED"};const tt=class{constructor(e){t(this,e),this.variant="primary",this.type="button"}render(){return i(b,{key:"f1ac17863df571d72e7db9b748b1980218145322"},i("internal-button",{key:"0b7052d216fb79ed5d9f90aacff97d39dce87473",text:this.text,variant:this.variant,isLoading:this.isLoading,clickHandler:this.clickHandler,type:this.type,disabled:this.disabled,class:this.class,customStyle:this.customStyle,hidden:this.hidden}))}},et=class{constructor(e){t(this,e)}render(){return i(b,{key:"4dda3e1e4f81cfda61011706c2f4e3104815d97c"},i("section",{key:"f8bbdeb389afbfc906e6cc956a68f9a3485ed43c"},i("div",{key:"2f8019ae43d5d4a5835ec6d5674304bd321d34b7"},i("div",{key:"67626fe735d0c0372fe638960198592027fb24f5",part:N},null==w?void 0:w.paymentDescription),i("div",{key:"48d8b4b930d2f3b199bc0a59c93ef4f1339f7649"},i("span",{key:"ca6413ce719ae81eaa4654911cdfc09d63f9a9db",part:N},"Total")," ",i("span",{key:"9ed165b192efa2ecf2f77a129d33161e36b1594f",part:N},I(+(null==w?void 0:w.totalAmount)))))))}},it=t=>{const{isLoading:e}=t;return e?i("div",{class:"container-fluid p-0"},i("div",{class:"row mb-3"},i("div",{class:"col-12 align-content-center"},i(k,{height:"44px",width:"100%",styles:{borderRadius:"8px"}})))):null};var st;!function(t){t.initialize="justifi.googlePay.initialize",t.ready="justifi.googlePay.ready",t.sdkLoaded="justifi.googlePay.sdkLoaded",t.initializeResult="justifi.googlePay.initializeResult",t.error="justifi.googlePay.error",t.buttonClicked="justifi.googlePay.buttonClicked",t.startPayment="justifi.googlePay.startPayment",t.paymentSuccess="justifi.googlePay.paymentSuccess",t.paymentCanceled="justifi.googlePay.paymentCanceled",t.paymentError="justifi.googlePay.paymentError"}(st||(st={}));const nt=class{constructor(i){t(this,i),this.googlePayStarted=e(this,"googlePayStarted",7),this.googlePayCompleted=e(this,"googlePayCompleted",7),this.googlePayCancelled=e(this,"googlePayCancelled",7),this.environment="TEST",this.iframeReady=!1,this.sdkLoaded=!1,this.isReadyToPay=!1,this.handleMessage=t=>{if(t.origin!==this.iframeOrigin)return;const{eventType:e,data:i}=t.data||{};switch(e){case st.ready:this.iframeReady=!0;break;case st.sdkLoaded:this.sdkLoaded=!0,this.sendInitialize();break;case st.initializeResult:this.isReadyToPay=i.isReadyToPay,i.error&&console.error("Init error:",i.error);break;case st.error:console.error("Google Pay error:",i);break;case st.buttonClicked:this.googlePayStarted.emit(),this.sendStartPayment();break;case st.paymentSuccess:this.googlePayCompleted.emit({success:!0,paymentMethodId:i.paymentMethodId,cardNetwork:i.cardNetwork,cardDetails:i.cardDetails});break;case st.paymentCanceled:this.googlePayCancelled.emit();break;case st.paymentError:this.googlePayCompleted.emit({success:!1,error:{code:i.code,message:i.message}})}}}async componentWillLoad(){await E(),this.iframeOrigin=D.iframeOrigin}componentDidLoad(){window.addEventListener("message",this.handleMessage)}disconnectedCallback(){window.removeEventListener("message",this.handleMessage)}sendInitialize(){var t;(null===(t=this.iframeElement)||void 0===t?void 0:t.contentWindow)&&this.iframeElement.contentWindow.postMessage({eventType:st.initialize,data:{environment:this.environment,gatewayMerchantId:w.accountId,merchantName:this.merchantName,authToken:w.authToken,accountId:w.accountId}},this.iframeOrigin)}sendStartPayment(){var t;if(!(null===(t=this.iframeElement)||void 0===t?void 0:t.contentWindow))return;const e={totalPrice:String(w.paymentAmount/100),totalPriceStatus:"FINAL",currencyCode:w.paymentCurrency||"USD"};this.iframeElement.contentWindow.postMessage({eventType:st.startPayment,data:e},this.iframeOrigin)}render(){return w.checkoutLoaded?w.googlePayEnabled?i(s,null,i(it,{isLoading:!this.isReadyToPay}),i("iframe",{ref:t=>this.iframeElement=t,src:`${this.iframeOrigin}/v2/googlePay`,allow:"payment",style:{border:"none",width:"100%",height:"48px",display:this.isReadyToPay?"block":"none"}})):(console.warn("Google Pay is not enabled for this checkout"),null):null}},at=class{constructor(e){t(this,e),this.levels={h1:S,h2:L,h3:_},this.level="h1"}render(){return i(b,{key:"879e301ec35e7cc536dec135e11daf140c67eeed"},i(this.levels[this.level],{key:"1766cb9a4d84bee1b3365b4df93515274cf31565",text:this.text,class:this.class}))}},ot=class{constructor(i){t(this,i),this.errorEvent=e(this,"error-event",7),this.submitEvent=e(this,"submit-event",7),this.checkoutChangedEvent=e(this,"checkout-changed",7),this.plaidService=new Q,this.handleApplePayStarted=()=>{w.isWalletProcessing=!0},this.handleGooglePayStarted=()=>{w.isWalletProcessing=!0},this.handleGooglePayCompleted=t=>{const{success:e,paymentMethodId:i,error:s}=t.detail||{};e&&i?(w.isWalletProcessing=!1,w.paymentToken=i,w.selectedPaymentMethod={type:V.GOOGLE_PAY},this.submitCheckout()):(w.isWalletProcessing=!1,this.errorEvent.emit({message:s&&s.message||"Google Pay payment failed",errorCode:y.TOKENIZE_ERROR,severity:p.ERROR}))},this.handleGooglePayCancelled=()=>{w.isWalletProcessing=!1,w.paymentToken=void 0,w.selectedPaymentMethod=void 0},this.handleApplePayCompleted=t=>{const{success:e,token:i,paymentMethodId:s,error:n}=t.detail;e&&i?(w.isWalletProcessing=!1,w.paymentToken=s,w.selectedPaymentMethod={type:V.APPLE_PAY},this.submitCheckout()):(w.isWalletProcessing=!1,console.error("Apple Pay completed but failed:",n),this.errorEvent.emit({message:(null==n?void 0:n.message)||"Apple Pay payment failed",errorCode:y.TOKENIZE_ERROR,severity:p.ERROR}))},this.handleApplePayError=t=>{w.isWalletProcessing=!1;const{error:e,code:i}=t.detail;console.error("Apple Pay error:",e),this.errorEvent.emit({message:e||"Apple Pay error occurred",errorCode:`APPLE_PAY_${i}`,severity:p.ERROR})},this.handleApplePayCancelled=()=>{w.isWalletProcessing=!1,w.paymentToken=void 0,w.selectedPaymentMethod=void 0}}connectedCallback(){this.observer=new MutationObserver((()=>{this.queryFormRefs(),this.setupApplePayListeners(),this.setupGooglePayListeners()})),this.observer.observe(this.hostEl,{childList:!0,subtree:!0}),w.checkoutId=this.checkoutId;const t={authToken:this.authToken,checkoutId:this.checkoutId,service:new F};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:Y(o.error),code:B(null===(a=o.error)||void 0===a?void 0:a.code),severity:p.ERROR});s({checkout:o.data})}catch(t){const e=B(null==t?void 0:t.code);return n({error:t.message||t,code:e,severity:p.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:Y(r.error),code:B(null===(o=r.error)||void 0===o?void 0:o.code),severity:p.ERROR});n({checkout:r.data})}catch(t){const e=B(null==t?void 0:t.code);return a({error:t.message||t,code:e,severity:p.ERROR})}})(t),P((()=>{this.emitCheckoutChanged()}))}componentWillLoad(){this.analytics=new R(this),U(),w.authToken=this.authToken,this.fetchCheckout(),O("set",(t=>{const e=z[t];void 0!==e&&x(t,e)&&this.fetchCheckout()}))}componentDidLoad(){this.queryFormRefs(),this.setupApplePayListeners(),this.setupGooglePayListeners()}disconnectedCallback(){var t;null===(t=this.observer)||void 0===t||t.disconnect(),this.removeApplePayListeners(),this.removeGooglePayListeners()}fetchCheckout(){this.authToken&&this.checkoutId?this.getCheckout&&this.getCheckout({onSuccess:({checkout:t})=>{this.updateStore(t),t.status!==v.completed?t.status!==v.expired||this.errorEvent.emit({message:m.CHECKOUT_EXPIRED,errorCode:y.CHECKOUT_EXPIRED,severity:p.ERROR}):this.errorEvent.emit({message:m.CHECKOUT_ALREADY_COMPLETED,errorCode:y.CHECKOUT_ALREADY_COMPLETED,severity:p.ERROR})},onError:t=>{this.errorEvent.emit({message:t.message,errorCode:t.code,severity:t.severity})}}):this.errorEvent.emit({message:m.NOT_AUTHENTICATED,errorCode:y.NOT_AUTHENTICATED,severity:p.ERROR})}updateStore(t){var e,i,s,n,a,o,r;w.accountId=t.account_id,w.checkoutLoaded=!0,w.paymentMethods=t.payment_methods.map((t=>new H(t))),w.paymentMethodGroupId=t.payment_method_group_id,w.paymentDescription=t.payment_description,w.totalAmount=t.total_amount,w.paymentAmount=t.payment_amount,w.bnplEnabled=t.payment_settings.bnpl_payments,w.insuranceEnabled=t.payment_settings.insurance_payments,w.bankAccountVerification=null===(e=t.payment_settings)||void 0===e?void 0:e.bank_account_verification,w.applePayEnabled=null===(i=t.payment_settings)||void 0===i?void 0:i.apple_payments,w.googlePayEnabled=null===(s=t.payment_settings)||void 0===s?void 0:s.google_payments,w.bnplProviderClientId=null===(n=null==t?void 0:t.bnpl)||void 0===n?void 0:n.provider_client_id,w.bnplProviderMode=null===(a=null==t?void 0:t.bnpl)||void 0===a?void 0:a.provider_mode,w.bnplProviderApiVersion=null===(o=null==t?void 0:t.bnpl)||void 0===o?void 0:o.provider_api_version,w.bnplProviderCheckoutUrl=null===(r=null==t?void 0:t.bnpl)||void 0===r?void 0:r.provider_checkout_url}emitCheckoutChanged(){const t={availablePaymentMethodTypes:T(),selectedPaymentMethod:w.selectedPaymentMethod,savedPaymentMethods:w.paymentMethods};this.checkoutChangedEvent.emit(t)}queryFormRefs(){if(this.billingFormRef=this.hostEl.querySelector("justifi-billing-form, justifi-bank-account-billing-form-simple, justifi-card-billing-form-simple, justifi-billing-form-full, justifi-tokenize-payment-method"),this.applePayRef=this.hostEl.querySelector("justifi-apple-pay"),this.googlePayRef=this.hostEl.querySelector("justifi-google-pay"),this.paymentMethodFormRef=this.hostEl.querySelector("justifi-card-form, justifi-bank-account-form, justifi-tokenize-payment-method"),!w.selectedPaymentMethod&&this.paymentMethodFormRef){const t=this.paymentMethodFormRef.tagName.toLowerCase();"justifi-card-form"===t?w.selectedPaymentMethod={type:V.NEW_CARD}:"justifi-bank-account-form"===t&&(w.selectedPaymentMethod={type:V.NEW_BANK_ACCOUNT})}this.insuranceFormRef=this.hostEl.querySelector("justifi-season-interruption-insurance")}setupApplePayListeners(){this.applePayRef&&(this.applePayRef.addEventListener("applePayStarted",this.handleApplePayStarted),this.applePayRef.addEventListener("applePayCompleted",this.handleApplePayCompleted),this.applePayRef.addEventListener("applePayError",this.handleApplePayError),this.applePayRef.addEventListener("applePayCancelled",this.handleApplePayCancelled))}removeApplePayListeners(){this.applePayRef&&(this.applePayRef.removeEventListener("applePayStarted",this.handleApplePayStarted),this.applePayRef.removeEventListener("applePayCompleted",this.handleApplePayCompleted),this.applePayRef.removeEventListener("applePayError",this.handleApplePayError),this.applePayRef.removeEventListener("applePayCancelled",this.handleApplePayCancelled))}setupGooglePayListeners(){this.googlePayRef&&(this.googlePayRef.addEventListener("googlePayStarted",this.handleGooglePayStarted),this.googlePayRef.addEventListener("googlePayCompleted",this.handleGooglePayCompleted),this.googlePayRef.addEventListener("googlePayCancelled",this.handleGooglePayCancelled))}removeGooglePayListeners(){this.googlePayRef&&(this.googlePayRef.removeEventListener("googlePayStarted",this.handleGooglePayStarted),this.googlePayRef.removeEventListener("googlePayCompleted",this.handleGooglePayCompleted),this.googlePayRef.removeEventListener("googlePayCancelled",this.handleGooglePayCancelled))}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:w.accountId,payment_method_group_id:void 0},a);w.savePaymentMethod&&(o.payment_method_group_id=w.paymentMethodGroupId);const r=await(null===(s=this.paymentMethodFormRef)||void 0===s?void 0:s.tokenize({clientId:this.authToken,paymentMethodMetadata:o,account:w.accountId}));return r.error?r:(w.paymentToken=r.id,r.id)}async fillBillingForm(t){w.billingFormFields=t}async setSelectedPaymentMethod(t){w.selectedPaymentMethod=t,w.paymentToken=t.id||void 0}async validate(){var t,e;const i=[];w.insuranceEnabled&&this.insuranceFormRef&&i.push(this.insuranceFormRef.validate());const s=(null===(t=w.selectedPaymentMethod)||void 0===t?void 0:t.type)===V.NEW_CARD,n=(null===(e=w.selectedPaymentMethod)||void 0===e?void 0:e.type)===V.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:y.VALIDATION_ERROR,severity:p.ERROR}),!1)}catch(t){return!1}}async submitCheckout(t){var e,i,s,n,a;if(w.isSubmitting)return;w.isSubmitting=!0;const o=await this.validate();if(!w.selectedPaymentMethod)return w.isSubmitting=!1,void this.errorEvent.emit({message:"No payment method selected.",errorCode:y.VALIDATION_ERROR,severity:p.ERROR});const r=(null===(e=w.selectedPaymentMethod)||void 0===e?void 0:e.type)===V.NEW_CARD,h=(null===(i=w.selectedPaymentMethod)||void 0===i?void 0:i.type)===V.NEW_BANK_ACCOUNT,l=(null===(s=w.selectedPaymentMethod)||void 0===s?void 0:s.type)===V.PLAID;if(r||h){const e=await this.tokenizePaymentMethod(t);if(null==e?void 0:e.error)return w.isSubmitting=!1,void this.errorEvent.emit({message:e.error.message,errorCode:y.TOKENIZE_ERROR,severity:p.ERROR})}if(l&&!w.paymentToken){const t=w.plaidPublicToken,e=w.plaidLinkTokenId;if(!t)return w.isSubmitting=!1,void this.errorEvent.emit({message:"Missing Plaid public token. Please connect your bank.",errorCode:y.TOKENIZE_ERROR,severity:p.ERROR});try{const i=await this.plaidService.tokenizeBankAccount(w.authToken,w.accountId,t,e||void 0,w.savePaymentMethod?w.paymentMethodGroupId:void 0);if(null==i?void 0:i.error)return w.isSubmitting=!1,void this.errorEvent.emit({message:"string"==typeof i.error?i.error:i.error.message||"Failed to tokenize bank account",errorCode:y.TOKENIZE_ERROR,severity:p.ERROR});const s=null==i?void 0:i.data,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);w.paymentToken=a}catch(t){return w.isSubmitting=!1,void this.errorEvent.emit({message:(null==t?void 0:t.message)||"Plaid exchange error",errorCode:y.TOKENIZE_ERROR,severity:p.ERROR})}}if(!o)return w.isSubmitting=!1,void this.errorEvent.emit({message:"Please fill in all required fields.",errorCode:y.VALIDATION_ERROR,severity:p.ERROR});if(!w.paymentToken)return w.isSubmitting=!1,void this.errorEvent.emit({message:"Payment token not found.",errorCode:y.TOKENIZE_ERROR,severity:p.ERROR});let c;if(c={payment_mode:(t=>{switch(t){case V.NEW_CARD:case V.SAVED_CARD:case V.NEW_BANK_ACCOUNT:case V.SAVED_BANK_ACCOUNT:case V.PLAID:return Z.ECOM;case V.SEZZLE:return Z.BNPL;case V.APPLE_PAY:return Z.APPLE_PAY;case V.GOOGLE_PAY:return Z.GOOGLE_PAY;default:return}})(null===(a=w.selectedPaymentMethod)||void 0===a?void 0:a.type),payment_token:w.paymentToken},this.preCompleteHook){const t=A();try{await new Promise(((e,i)=>{this.preCompleteHook(t,(()=>e()),(()=>i()))}))}catch(t){return w.isSubmitting=!1,void console.log("Checkout cancelled by preCompleteHook",t)}}this.completeCheckout({payment:c,onSuccess:({checkout:t})=>{w.isSubmitting=!1,this.submitEvent.emit({checkout:t,message:"Checkout completed successfully"})},onError:t=>{w.isSubmitting=!1,this.errorEvent.emit({message:t.message,errorCode:y.COMPLETE_CHECKOUT_ERROR,severity:p.ERROR})}})}render(){return i(s,{key:"c3de4a4b90c599a374678d98c324a6b24dbec50d"})}get hostEl(){return n(this)}},rt=class{constructor(i){t(this,i),this.paymentMethodOptionSelected=e(this,"paymentMethodOptionSelected",7),this.plaidError=e(this,"plaidError",7),this.plaidErrorRecovered=e(this,"plaidErrorRecovered",7),this.isAuthenticating=!1,this.publicToken=null,this.linkToken=null,this.linkTokenId=null,this.error=null,this.plaidLink=null,this.isSelected=!1,this.retryCount=0,this.isRetrying=!1,this.sdkLoaded=!1,this.plaidService=new Q,this.maxRetries=3,this.retryDelay=2e3,this.timeoutId=null,this.abortController=null,this.hasLoggedDisabledWarning=!1,this.waitForStoreAndInitialize=()=>{w.authToken&&w.accountId&&w.checkoutId?this.initializePlaidLink():setTimeout((()=>{this.waitForStoreAndInitialize()}),100)},this.initializePlaidLink=async()=>{try{if(void 0===window.Plaid)return void this.handleError({code:M.PLAID_SDK_LOAD_FAILED,message:g[M.PLAID_SDK_LOAD_FAILED],severity:f[M.PLAID_SDK_LOAD_FAILED],retryable:!0,userAction:"Refresh the page and try again"});if(await this.getLinkToken(),!this.linkToken)return void this.handleError({code:M.PLAID_LINK_TOKEN_FAILED,message:g[M.PLAID_LINK_TOKEN_FAILED],severity:f[M.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:M.PLAID_LINK_INIT_FAILED,message:g[M.PLAID_LINK_INIT_FAILED],severity:f[M.PLAID_LINK_INIT_FAILED],originalError:t,retryable:!0,userAction:"Click to try again"})}},this.getLinkToken=async()=>{var t,e,i,s,n;try{if(!w.authToken||!w.accountId)return void this.handleError({code:M.PLAID_LINK_TOKEN_FAILED,message:"Missing authentication. Please refresh the page and try again.",severity:p.ERROR,retryable:!1,userAction:"Refresh the page"});this.abortController=new AbortController,this.timeoutId=setTimeout((()=>{var t;null===(t=this.abortController)||void 0===t||t.abort()}),3e4);const e=await this.plaidService.getLinkToken(w.authToken,w.accountId,w.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&&(w.plaidLinkTokenId=this.linkTokenId)}catch(t){this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null);let a=M.PLAID_LINK_TOKEN_FAILED,o=g[a],r=!0;"AbortError"===t.name?(a=M.PLAID_TIMEOUT,o=g[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=M.PLAID_NETWORK_ERROR,o=g[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=M.PLAID_INVALID_CREDENTIALS,o="Authentication failed. Please refresh the page and try again.",r=!1),this.handleError({code:a,message:o,severity:f[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 M.PLAID_RATE_LIMITED;if(t.includes("maintenance"))return M.PLAID_MAINTENANCE;if(t.includes("not_authenticated"))return M.PLAID_INVALID_CREDENTIALS}if(null==t?void 0:t.code)switch(t.code){case"rate_limited":return M.PLAID_RATE_LIMITED;case"maintenance":return M.PLAID_MAINTENANCE;case"not_authenticated":return M.PLAID_INVALID_CREDENTIALS;default:return M.PLAID_LINK_TOKEN_FAILED}return M.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,w.selectedPaymentMethod={type:V.PLAID}),this.plaidErrorRecovered.emit({code:"plaid-success",message:"Bank account connected successfully",severity:p.INFO}),w.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=M.PLAID_AUTHENTICATION_FAILED,i=g[e],s=!0,n="Click to try again";if(t.error_code)switch(t.error_code){case"INVALID_CREDENTIALS":e=M.PLAID_INVALID_CREDENTIALS,i=g[e],s=!0;break;case"ITEM_LOGIN_REQUIRED":e=M.PLAID_INVALID_CREDENTIALS,i="Your bank requires re-authentication. Please try again.",s=!0;break;case"ITEM_LOCKED":e=M.PLAID_ACCOUNT_LOCKED,i=g[e],s=!1,n="Contact your bank";break;case"INSTITUTION_NOT_RESPONDING":e=M.PLAID_MAINTENANCE,i=g[e],s=!0;break;case"RATE_LIMIT_EXCEEDED":e=M.PLAID_RATE_LIMITED,i=g[e],s=!0;break;case"INVALID_REQUEST":e=M.PLAID_AUTHENTICATION_FAILED,i="Invalid request. Please try again.",s=!0;break;case"PLAID_ERROR":e=M.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=M.PLAID_BANK_NOT_SUPPORTED,i=g[e],s=!1,n="Try a different payment method"):(a.includes("expired")||a.includes("timeout"))&&(e=M.PLAID_TOKEN_EXPIRED,i=g[e],s=!0)}this.handleError({code:e,message:i,severity:f[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=w.selectedPaymentMethod)||void 0===t?void 0:t.type)===V.PLAID;this.isSelected!==e&&(this.isSelected=e)}}onSelectionChange(t){var e;t&&(null===(e=w.selectedPaymentMethod)||void 0===e?void 0:e.type)!==V.PLAID&&(w.selectedPaymentMethod={type:V.PLAID}),!t||!this.plaidLink||this.publicToken||this.isAuthenticating||this.error||this.openPlaidLink()}componentWillLoad(){var t;this.isSelected=(null===(t=w.selectedPaymentMethod)||void 0===t?void 0:t.type)===V.PLAID,!0===w.bankAccountVerification&&(w.checkoutLoaded?this.loadPlaidSDK():j("checkoutLoaded",(t=>{t&&!0===w.bankAccountVerification&&this.loadPlaidSDK()})))}loadPlaidSDK(){if(this.sdkLoaded)return;this.sdkLoaded=!0;const t=document.createElement("script");t.src="https://cdn.plaid.com/link/v2/stable/link-initialize.js",t.async=!0,t.onload=()=>this.initializePlaidLink(),t.onerror=()=>{this.handleError({code:M.PLAID_SDK_LOAD_FAILED,message:g[M.PLAID_SDK_LOAD_FAILED],severity:f[M.PLAID_SDK_LOAD_FAILED],retryable:!0,userAction:"Refresh the page and try again"})},document.head.appendChild(t)}async resolvePaymentMethod(){return this.publicToken?{token:this.publicToken,data:{type:"bank_account",plaid_public_token:this.publicToken}}:{validationError:!0}}async getPaymentToken(){return w.paymentToken}async handleSelectionClick(){if(this.isSelected=!0,w.selectedPaymentMethod={type:V.PLAID},this.error)return this.clearError(),void this.waitForStoreAndInitialize();!this.plaidLink||this.publicToken||this.isAuthenticating||this.openPlaidLink()}async setSelected(t){this.isSelected=t,t&&(w.selectedPaymentMethod={type:V.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=j("selectedPaymentMethod",this.syncWithStore);this.unsubscribeFromStore=t}disconnectedCallback(){this.unsubscribeFromStore&&this.unsubscribeFromStore(),this.timeoutId&&clearTimeout(this.timeoutId),this.abortController&&this.abortController.abort()}render(){if(!0!==w.bankAccountVerification)return this.hasLoggedDisabledWarning||(console.warn("[JustifiPlaidPaymentMethod] bank_account_verification is disabled. Component will not render."),this.hasLoggedDisabledWarning=!0),null;const t=i("img",{class:"plaid-logo-img",src:"data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ4IiB2aWV3Qm94PSIwIDAgMjggMjkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgY2xhc3M9ImNzcy0xcmRhajhtIj48ZyBmaWxsPSIjMTExIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPjxwYXRoIGQ9Ik0yNS43NjI5IDI2LjI2MjhMMjggMTcuNTMwOUwyNC45NjkxIDE0LjUwMDFMMjcuOTk5OSAxMS40NjkxTDI1Ljc2MjggMi43MzcwNkwxNy4wMzA5IDAuNUwxNC4wMDAxIDMuNTMxTDEwLjk2OSAwLjUwMDE0TDIuMjM3MDYgMi43MzczNEwwIDExLjQ2OTFMMy4wMzEyOCAxNC40OTk5TDAuMDAwMTQgMTcuNTMxTDIuMjM3MiAyNi4yNjI5TDEwLjk2OTEgMjguNUwxNC4wMDAxIDI1LjQ2OUwxNy4wMzEgMjguNDk5OUwyNS43NjI5IDI2LjI2MjhaTTE1LjczMjEgMjMuNzM3MUwxOC42MTg2IDIwLjg1MDVMMjIuMjkxMiAyNC41MjMzTDE3LjY5NTYgMjUuNzAwN0wxNS43MzIxIDIzLjczNzFaTTExLjExMzYgOS44ODE1NEwxNC4wMDAzIDYuOTk1MDJMMTYuODg2OCA5Ljg4MTRMMTQuMDAwMSAxMi43Njc5TDExLjExMzYgOS44ODE1NFpNMTIuMjY4MiAxNC41TDkuMzgxNTQgMTcuMzg2NUw2LjQ5NTAyIDE0LjVMOS4zODE1NCAxMS42MTM1TDEyLjI2ODIgMTQuNVpNMTguNjE4NyAxMS42MTMzTDIxLjUwNTMgMTQuNUwxOC42MTg2IDE3LjM4NjVMMTUuNzMyMSAxNC41TDE4LjYxODcgMTEuNjEzM1pNMTYuODg2NyAxOS4xMTg2TDE0LjAwMDEgMjIuMDA1MUwxMS4xMTM1IDE5LjExODVMMTQuMDAwMSAxNi4yMzE5TDE2Ljg4NjcgMTkuMTE4NlpNMTAuMzA0NCAyNS43MDA3TDUuNzA4NjQgMjQuNTIzM0w5LjM4MTU0IDIwLjg1MDRMMTIuMjY4MiAyMy43MzcxTDEwLjMwNDQgMjUuNzAwN1pNNC43NjMwOCAxNi4yMzE5TDcuNjQ5NiAxOS4xMTg1TDMuOTc2NyAyMi43OTE0TDIuNzk5MyAxOC4xOTU3TDQuNzYzMDggMTYuMjMxOVpNMy45NzY3IDYuMjA4MzZMNy42NDk3NCA5Ljg4MTRMNC43NjMwOCAxMi43NjgxTDIuNzk5MyAxMC44MDQxTDMuOTc2NyA2LjIwODM2Wk0xMi4yNjgzIDUuMjYyOTRMOS4zODE2OCA4LjE0OTZMNS43MDg5MiA0LjQ3NjdMMTAuMzA0NyAzLjI5OTNMMTIuMjY4MyA1LjI2Mjk0Wk0xNy42OTU5IDMuMjk5M0wyMi4yOTE1IDQuNDc2N0wxOC42MTg2IDguMTQ5NDZMMTUuNzMyMSA1LjI2Mjk0TDE3LjY5NTkgMy4yOTkzWk0yMy4yMzcyIDEyLjc2ODFMMjAuMzUwNSA5Ljg4MTRMMjQuMDIzMyA2LjIwODc4TDI1LjIwMDcgMTAuODA0NkwyMy4yMzcyIDEyLjc2ODFaTTI0LjAyMzMgMjIuNzkxNEwyMC4zNTA1IDE5LjExODZMMjMuMjM3MiAxNi4yMzIxTDI1LjIwMDcgMTguMTk1N0wyNC4wMjMzIDIyLjc5MTRaIj48L3BhdGg+PC9nPjwvc3ZnPgo=",alt:"Plaid",title:"Plaid",style:{display:"inline",width:"20px",height:"20px",marginLeft:"5px",marginTop:"-2px"}});return i(b,{class:"payment-method"},i("div",{title:"Pay with Plaid"},i("div",{onClick:t=>{t.preventDefault(),this.handleSelectionClick()}},"Pay with Bank Account ",t," "),(()=>this.error?i("div",{class:(this.error.severity===p.ERROR?"text-danger":this.error.severity===p.WARNING?"text-warning":"text-info")+" mt-2"},i("small",null,this.error.message),i("br",null),i("small",{class:"text-muted"},this.error.userAction,this.error.retryable&&this.retryCount<this.maxRetries&&i("span",null," • Auto-retry in progress..."))):null)(),(()=>this.error?null:this.isAuthenticating?i("div",{class:"text-info mt-2"},i("small",null,"Connecting to your bank...")):this.publicToken?i("div",{class:"text-success mt-2"},i("small",null,"✓ Bank account connected successfully")):!this.isSelected||this.publicToken||this.error||this.isAuthenticating?null:i("div",{class:"text-muted mt-2"},i("small",null,"Click to connect your bank account")))()))}static get watchers(){return{isSelected:["onSelectionChange"]}}},ht=class{constructor(e){t(this,e),this.onPaymentMethodOptionClick=t=>e=>{e.preventDefault(),w.selectedPaymentMethod={id:t.id,type:t.type},w.paymentToken=t.id},this.isAllowedPaymentMethod=t=>!(t===V.SAVED_CARD&&w.disableCreditCard||t===V.SAVED_BANK_ACCOUNT&&w.disableBankAccount)}componentWillLoad(){w.checkoutLoaded&&(w.paymentMethods.length||console.warn("No saved payment methods available."),w.disablePaymentMethodGroup&&console.warn("Payment method group is disabled."))}render(){return w.disablePaymentMethodGroup?null:i(b,null,i("div",{class:"saved-payment-methods"},w.paymentMethods.length?w.paymentMethods.filter((t=>this.isAllowedPaymentMethod(t.type))).map((t=>i("div",{class:"radio-list-item p-3",part:C,onClick:this.onPaymentMethodOptionClick(t)},i("form-control-radio",{name:"paymentMethodType",value:null==t?void 0:t.id,checked:w.paymentToken===(null==t?void 0:t.id),label:`${G[null==t?void 0:t.brand]||""} *${null==t?void 0:t.acct_last_four}`})))):null))}},lt=i("img",{class:"sezzle-smart-button-logo-img",src:"https://media.sezzle.com/branding/2.0/Sezzle_Logo_FullColor.svg",alt:"Sezzle",style:{display:"inline",width:"80px",marginLeft:"5px",marginTop:"-5px"}}),ct=class{constructor(i){t(this,i),this.paymentMethodOptionSelected=e(this,"paymentMethodOptionSelected",7),this.paymentMethodOptionId=V.SEZZLE,this.initializeSezzleCheckout=()=>{let t;this.sezzlePromise=new Promise((e=>{t=e}));const e=Number(w.paymentAmount),i=new(0,window.Checkout)({mode:"popup",publicKey:w.bnplProviderClientId,apiMode:w.bnplProviderMode,apiVersion:w.bnplProviderApiVersion});i.sezzleButtonElement=this.sezzleButtonRef,i.init({onClick:function(t){t.preventDefault(),i.startCheckout({checkout_url:w.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(){w.selectedPaymentMethod={type:V.SEZZLE},this.paymentMethodOptionSelected.emit(this.paymentMethodOptionId)}render(){var t,e;return w.bnplEnabled?i(b,{class:"payment-method"},i("script",{src:"https://checkout-sdk.sezzle.com/checkout.min.js",async:!0,ref:t=>this.scriptRef=t}),i("div",null,i("div",null,"Buy now, pay later with ",lt),this.installmentPlan&&i("small",null,i("span",null,null===(t=this.installmentPlan)||void 0===t?void 0:t.installments.length)," ",i("span",null,this.installmentPlan.schedule," payments of")," ",i("span",{class:"fw-bold"},I(null===(e=this.installmentPlan)||void 0===e?void 0:e.installments[0].amountInCents))))):(console.warn("justifi-sezzle-payment-method: BNPL is not enabled for this account."),null)}},dt={[V.NEW_BANK_ACCOUNT]:"New bank account",[V.NEW_CARD]:"New credit or debit card"},ut="Payment form not ready",pt="Validation error",yt=class{constructor(i){t(this,i),this.errorEvent=e(this,"error-event",7),this.submitEvent=e(this,"submit-event",7),this.computedHideSubmitButton=!1,this.isLoading=!1,this.submitButtonText="Submit"}paymentMethodsChanged(){this.setDefaultSelectedPaymentMethod()}connectedCallback(){this.setDefaultSelectedPaymentMethod(),this.setComputedHideSubmitButton()}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup(),this.unsubscribeFromStore&&this.unsubscribeFromStore()}componentWillLoad(){U(),this.analytics=new R(this)}handleRadioClick(t){this.selectedPaymentMethod=t.detail,w.selectedPaymentMethod={type:t.detail}}async tokenizePaymentMethod(t){null==t||t.preventDefault(),this.validateRequiredProps(),this.isLoading=!0;try{if(!(await this.validate()).isValid)return this.errorEvent.emit({errorCode:y.TOKENIZE_ERROR,message:pt}),void(this.isLoading=!1);const t=await this.resolvePaymentMethod({isValid:!0});return t.error&&this.emitError({errorCode:t.error.code,message:t.error.message}),this.submitEvent.emit({response:t}),t}catch(t){const e=this.createErrorResponse(y.TOKENIZE_ERROR,t.message);return this.emitError({errorCode:y.TOKENIZE_ERROR,message:t.message}),this.submitEvent.emit({response:e}),e}finally{this.isLoading=!1}}async fillBillingForm(t){w.billingFormFields=t}async validate(){if(!this.areFormsReady())return{isValid:!1,errors:{general:ut}};const[t,e]=await Promise.all([this.billingFormRef.validate(),this.paymentMethodFormRef.validate()]);return{isValid:t.isValid&&e.isValid,errors:Object.assign(Object.assign({},t.errors),e.errors)}}async getValues(){return this.billingFormRef.getValues()}async tokenize(){try{const t=await this.billingFormRef.getValues(),e={clientId:this.authToken||w.authToken,account:this.accountId||w.accountId,paymentMethodMetadata:this.buildPaymentMethodMetadata(t)};return await this.paymentMethodFormRef.tokenize(e)}catch(t){return t}}validateRequiredProps(){this.authToken||w.authToken||this.emitError({errorCode:y.TOKENIZE_ERROR,message:"Auth token is required when using the tokenize-payment-method component not slotted in justifi-modular-checkout"}),this.accountId||w.accountId||this.emitError({errorCode:y.TOKENIZE_ERROR,message:"Account ID is required when using the tokenize-payment-method component not slotted in justifi-modular-checkout"})}setDefaultSelectedPaymentMethod(){this.selectedPaymentMethod||(this.disableCreditCard?this.disableBankAccount||(this.selectedPaymentMethod=V.NEW_BANK_ACCOUNT,w.selectedPaymentMethod={type:V.NEW_BANK_ACCOUNT}):(this.selectedPaymentMethod=V.NEW_CARD,w.selectedPaymentMethod={type:V.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(V.NEW_CARD),this.disableBankAccount||t.push(V.NEW_BANK_ACCOUNT),t}areFormsReady(){return!(!this.billingFormRef||!this.paymentMethodFormRef)}emitError(t){this.errorEvent.emit(Object.assign(Object.assign({},t),{severity:p.ERROR}))}createErrorResponse(t,e){return{error:{code:t,message:e,decline_code:void 0}}}async resolvePaymentMethod(t){if(!this.areFormsReady())return this.createErrorResponse("form_not_ready",ut);try{const e=await this.validate();if(!e.isValid||!t.isValid){const t=Object.values(e.errors)[0]||pt;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||w.paymentMethodGroupId}get shouldSavePaymentMethod(){return!(!this.paymentMethodGroupId&&!w.savePaymentMethod)}get shouldHideRadioInput(){return this.disableCreditCard||this.disableBankAccount}renderPaymentMethodOption(t){const e=this.selectedPaymentMethod===t&&void 0===w.selectedPaymentMethod.id;return i("div",{class:"payment-method"},i("radio-list-item",{name:"paymentMethodType",value:t,checked:e,label:dt[t],hidden:this.shouldHideRadioInput}),e&&this.renderSelectedPaymentMethodForm(t))}renderSelectedPaymentMethodForm(t){return i("div",{class:"mt-4 pb-4"},this.renderPaymentMethodForm(t),i("div",{class:"mt-4"},i("billing-form",{ref:t=>{t&&(this.billingFormRef=t)},hideCardBillingForm:this.hideCardBillingForm,hideBankAccountBillingForm:this.hideBankAccountBillingForm,paymentMethodType:t})),i("div",{class:"mt-4"},i("save-new-payment-method",{hidden:!this.paymentMethodGroupID,label:this.savePaymentMethodLabel})))}renderPaymentMethodForm(t){return i(t===V.NEW_CARD?"card-form":"bank-account-form",{ref:t=>{t&&(this.paymentMethodFormRef=t)}})}render(){return i(b,{key:"2d4349f3e5ad632981cdeb14dbe4e483f79379da"},i("form",{key:"754afee2c5229cf016bd8fc0cf81041cf37270a8"},i("fieldset",{key:"01867151a09d384e1258ef7f62fbc88c526706cc"},i("div",{key:"7ba453d4629a0c2ef583daddcb9cf02ac5eee265",class:"row gy-3"},i("div",{key:"4148f2269c738a00f2684d69d4a83a4ab2424f2b",class:"col-12"},this.availablePaymentMethods.map((t=>this.renderPaymentMethodOption(t)))),i("div",{key:"e67b09357571aadfb3d2712f55954506748b3826",class:"col-12"},i("internal-button",{key:"c2e805060ff7e9e97144533ffad3b4a02433e792",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{$ as justifi_apple_pay,tt as justifi_button,et as justifi_checkout_summary,nt as justifi_google_pay,at as justifi_header,ot as justifi_modular_checkout,rt as justifi_plaid_payment_method,W as justifi_radio_list_item,ht as justifi_saved_payment_methods,ct as justifi_sezzle_payment_method,yt as justifi_tokenize_payment_method}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as e,a as s}from"./p-D9sqTVmd.js";import{m as n,d as t,i as a,b as i,a as r,p as o,e as l,w as _,c,t as d,o as u,f as m,r as p,g as b,h as E,l as h,j as f,k as g,n as v,s as w,q as y,u as $,v as x,x as S}from"./p-DV4n8kZd.js";import{C as j}from"./p-BcNb9bVO.js";import{c as B}from"./p-BzXQDB0t.js";const D=s=>{const n=e({legal_name:c.required("Enter legal name"),website_url:_.required("Enter business website url"),email:l.required("Enter business email"),phone:o.required("Enter phone number"),doing_business_as:r.nullable(),classification:i.required("Select business classification"),industry:a.required("Enter a business industry"),date_of_incorporation:t.required("Enter date of registration")}),u=e({legal_name:c.required("Enter legal name"),website_url:_.nullable(),email:l.nullable(),phone:o.nullable(),doing_business_as:r.nullable(),classification:i.nullable(),industry:a.nullable(),tax_id:d.nullable(),date_of_incorporation:t.nullable()});return s?u:n},V=t=>D(t).concat(e({classification:s().required("Select business classification"),tax_id:n(j.USA).when("tax_id_last4",{is:e=>!e,then:e=>e.required(`Enter valid ${B.USA.taxIdLabel} without dashes`),otherwise:e=>e.nullable()})})),k=t=>D(t).concat(e({classification:s().required("Select business classification"),tax_id:n(j.CAN).when("tax_id_last4",{is:e=>!e,then:e=>e.notRequired().nullable(),otherwise:e=>e.nullable()})})),q=s=>{const n=e({business_revenue:p.required("Enter business revenue"),business_payment_volume:b.required("Enter business payment volume"),business_average_transaction_amount:p.required("Enter average transaction amount"),business_when_service_received:m.required("Select when service is received"),business_other_payment_details:u.nullable()}),t=e({business_revenue:p.nullable(),business_payment_volume:b.nullable(),business_average_transaction_amount:p.nullable(),business_when_service_received:m.nullable(),business_other_payment_details:u.nullable()});return s?t:n},z=n=>e(n?{line1:f.nullable(),line2:h.nullable(),city:E.nullable(),state:s().nullable(),postal_code:s().nullable()}:{line1:f.required("Enter street address"),line2:h.nullable(),city:E.required("Enter city"),state:s().required("Select state"),postal_code:g(j.USA).required("Enter postal code")}),C=n=>e(n?{line1:f.nullable(),line2:h.nullable(),city:E.nullable(),state:s().nullable(),postal_code:s().nullable()}:{line1:f.required("Enter street address"),line2:h.nullable(),city:E.required("Enter city"),state:s().required("Select province"),postal_code:g(j.CAN).required("Enter postal code")}),N={[j.USA]:z,[j.CAN]:C},O=(n,t)=>t?(n=>e({name:x.required(`Enter ${n} name`),title:$.nullable(),email:l.nullable(),phone:o.nullable(),dob_full:y(n).nullable(),ssn_last4:s().nullable(),identification_number:w.nullable(),ownership_percentage:v.nullable(),address:z(!0)}))(n):(n=>e({name:x.required(`Enter ${n} name`),title:$.required(`Enter ${n} title`),email:l.required(`Enter ${n} email`),phone:o.required("Enter phone number"),dob_full:y(n).required("Enter date of birth"),ssn_last4:s().nullable(),identification_number:w,ownership_percentage:"owner"===n?v.required("Enter ownership percentage"):v.nullable(),address:z(!1)}))(n),Q=(n,t)=>t?(n=>e({name:x.required(`Enter ${n} name`),title:$.nullable(),email:l.nullable(),phone:o.nullable(),dob_full:y(n).nullable(),ssn_last4:s().nullable(),identification_number:S(j.CAN).nullable(),ownership_percentage:v.nullable(),address:C(!0)}))(n):(n=>e({name:x.required(`Enter ${n} name`),title:$.required(`Enter ${n} title`),email:l.required(`Enter ${n} email`),phone:o.required("Enter phone number"),dob_full:y(n).required("Enter date of birth"),ssn_last4:s().nullable(),identification_number:S(j.CAN).nullable(),ownership_percentage:"owner"===n?v.required("Enter ownership percentage"):v.nullable(),address:C(!1)}))(n),T={[j.USA]:O,[j.CAN]:Q};export{q as a,V as b,z as c,k as d,Q as e,C as f,T as g,N as h,O as i}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{S as e}from"./p-BcNb9bVO.js";const a=[{label:"Choose province",value:""},{label:"Alberta",value:"AB"},{label:"British Columbia",value:"BC"},{label:"Manitoba",value:"MB"},{label:"New Brunswick",value:"NB"},{label:"Newfoundland and Labrador",value:"NL"},{label:"Northwest Territories",value:"NT"},{label:"Nova Scotia",value:"NS"},{label:"Nunavut",value:"NU"},{label:"Ontario",value:"ON"},{label:"Prince Edward Island",value:"PE"},{label:"Quebec",value:"QC"},{label:"Saskatchewan",value:"SK"},{label:"Yukon",value:"YT"}],l={USA:{stateLabel:"State",postalLabel:"Zip Code",idNumberLabel:"SSN",idNumberLabelOptional:"SSN (optional)",identityHelpText:"Enter your full Social Security Number. It is required for Federal OFAC check.",taxIdLabel:"Tax ID (EIN or SSN)",taxIdLabelOptional:"",taxIdHelpText:"Employer Identification Numbers (EINs) are nine digits. The federal tax identification number/EIN issued to you by the IRS. It can be found on your tax returns. Enter value without dashes."},CAN:{stateLabel:"Province",postalLabel:"Postal Code",idNumberLabel:"SIN",idNumberLabelOptional:"SIN (optional)",identityHelpText:"Enter your full Social Insurance Number.",taxIdLabel:"Business Number (BN)",taxIdLabelOptional:"Business Number (BN) (optional)",taxIdHelpText:"Business Numbers (BN) are nine digits. Enter value without spaces or dashes."}},t={USA:{stateOptions:e},CAN:{stateOptions:a}},i={USA:{postalRegex:/^[0-9]{5}(-[0-9]{4})?$/,identityDigits:9,taxIdDigits:9},CAN:{postalRegex:/^[A-Za-z]\d[A-Za-z][ -]?\d[A-Za-z]\d$/,identityDigits:9,taxIdDigits:9}};export{a as P,i as a,t as b,l as c}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import{c as n}from"./p-BFTU3MAI.js";var r,t,u,e={exports:{}},i=(r||(r=1,t=e,u=e.exports,function(){var r,e="Expected a function",i="__lodash_hash_undefined__",f="__lodash_placeholder__",o=32,c=128,a=1/0,v=9007199254740991,l=NaN,s=4294967295,h=[["ary",c],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",o],["partialRight",64],["rearg",256]],p="[object Arguments]",y="[object Array]",w="[object Boolean]",b="[object Date]",g="[object Error]",_="[object Function]",d="[object GeneratorFunction]",j="[object Map]",x="[object Number]",m="[object Object]",A="[object Promise]",R="[object RegExp]",E="[object Set]",$="[object String]",U="[object Symbol]",k="[object WeakMap]",I="[object ArrayBuffer]",S="[object DataView]",O="[object Float32Array]",D="[object Float64Array]",F="[object Int8Array]",T="[object Int16Array]",z="[object Int32Array]",L="[object Uint8Array]",C="[object Uint8ClampedArray]",M="[object Uint16Array]",N="[object Uint32Array]",Z=/\b__p \+= '';/g,W=/\b(__p \+=) '' \+/g,P=/(__e\(.*?\)|\b__t\)) \+\n'';/g,B=/&(?:amp|lt|gt|quot|#39);/g,G=/[&<>"']/g,q=RegExp(B.source),V=RegExp(G.source),H=/<%-([\s\S]+?)%>/g,K=/<%([\s\S]+?)%>/g,Y=/<%=([\s\S]+?)%>/g,J=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Q=/^\w*$/,X=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,nn=/[\\^$.*+?()[\]{}|]/g,rn=RegExp(nn.source),tn=/^\s+/,un=/\s/,en=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,fn=/\{\n\/\* \[wrapped with (.+)\] \*/,on=/,? & /,cn=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,an=/[()=,{}\[\]\/\s]/,vn=/\\(\\)?/g,ln=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,sn=/\w*$/,hn=/^[-+]0x[0-9a-f]+$/i,pn=/^0b[01]+$/i,yn=/^\[object .+?Constructor\]$/,wn=/^0o[0-7]+$/i,bn=/^(?:0|[1-9]\d*)$/,gn=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,_n=/($^)/,dn=/['\n\r\u2028\u2029\\]/g,jn="\\ud800-\\udfff",xn="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",mn="\\u2700-\\u27bf",An="a-z\\xdf-\\xf6\\xf8-\\xff",Rn="A-Z\\xc0-\\xd6\\xd8-\\xde",En="\\ufe0e\\ufe0f",$n="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Un="["+jn+"]",kn="["+$n+"]",In="["+xn+"]",Sn="\\d+",On="["+mn+"]",Dn="["+An+"]",Fn="[^"+jn+$n+Sn+mn+An+Rn+"]",Tn="\\ud83c[\\udffb-\\udfff]",zn="[^"+jn+"]",Ln="(?:\\ud83c[\\udde6-\\uddff]){2}",Cn="[\\ud800-\\udbff][\\udc00-\\udfff]",Mn="["+Rn+"]",Nn="\\u200d",Zn="(?:"+Dn+"|"+Fn+")",Wn="(?:"+Mn+"|"+Fn+")",Pn="(?:['’](?:d|ll|m|re|s|t|ve))?",Bn="(?:['’](?:D|LL|M|RE|S|T|VE))?",Gn="(?:"+In+"|"+Tn+")?",qn="["+En+"]?",Vn=qn+Gn+"(?:"+Nn+"(?:"+[zn,Ln,Cn].join("|")+")"+qn+Gn+")*",Hn="(?:"+[On,Ln,Cn].join("|")+")"+Vn,Kn="(?:"+[zn+In+"?",In,Ln,Cn,Un].join("|")+")",Yn=RegExp("['’]","g"),Jn=RegExp(In,"g"),Qn=RegExp(Tn+"(?="+Tn+")|"+Kn+Vn,"g"),Xn=RegExp([Mn+"?"+Dn+"+"+Pn+"(?="+[kn,Mn,"$"].join("|")+")",Wn+"+"+Bn+"(?="+[kn,Mn+Zn,"$"].join("|")+")",Mn+"?"+Zn+"+"+Pn,Mn+"+"+Bn,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Sn,Hn].join("|"),"g"),nr=RegExp("["+Nn+jn+xn+En+"]"),rr=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,tr=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],ur=-1,er={};er[O]=er[D]=er[F]=er[T]=er[z]=er[L]=er[C]=er[M]=er[N]=!0,er[p]=er[y]=er[I]=er[w]=er[S]=er[b]=er[g]=er[_]=er[j]=er[x]=er[m]=er[R]=er[E]=er[$]=er[k]=!1;var ir={};ir[p]=ir[y]=ir[I]=ir[S]=ir[w]=ir[b]=ir[O]=ir[D]=ir[F]=ir[T]=ir[z]=ir[j]=ir[x]=ir[m]=ir[R]=ir[E]=ir[$]=ir[U]=ir[L]=ir[C]=ir[M]=ir[N]=!0,ir[g]=ir[_]=ir[k]=!1;var fr={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},or=parseFloat,cr=parseInt,ar="object"==typeof n&&n&&n.Object===Object&&n,vr="object"==typeof self&&self&&self.Object===Object&&self,lr=ar||vr||Function("return this")(),sr=u&&!u.nodeType&&u,hr=sr&&t&&!t.nodeType&&t,pr=hr&&hr.exports===sr,yr=pr&&ar.process,wr=function(){try{return hr&&hr.require&&hr.require("util").types||yr&&yr.binding&&yr.binding("util")}catch(n){}}(),br=wr&&wr.isArrayBuffer,gr=wr&&wr.isDate,_r=wr&&wr.isMap,dr=wr&&wr.isRegExp,jr=wr&&wr.isSet,xr=wr&&wr.isTypedArray;function mr(n,r,t){switch(t.length){case 0:return n.call(r);case 1:return n.call(r,t[0]);case 2:return n.call(r,t[0],t[1]);case 3:return n.call(r,t[0],t[1],t[2])}return n.apply(r,t)}function Ar(n,r,t,u){for(var e=-1,i=null==n?0:n.length;++e<i;){var f=n[e];r(u,f,t(f),n)}return u}function Rr(n,r){for(var t=-1,u=null==n?0:n.length;++t<u&&!1!==r(n[t],t,n););return n}function Er(n,r){for(var t=null==n?0:n.length;t--&&!1!==r(n[t],t,n););return n}function $r(n,r){for(var t=-1,u=null==n?0:n.length;++t<u;)if(!r(n[t],t,n))return!1;return!0}function Ur(n,r){for(var t=-1,u=null==n?0:n.length,e=0,i=[];++t<u;){var f=n[t];r(f,t,n)&&(i[e++]=f)}return i}function kr(n,r){return!(null==n||!n.length)&&Mr(n,r,0)>-1}function Ir(n,r,t){for(var u=-1,e=null==n?0:n.length;++u<e;)if(t(r,n[u]))return!0;return!1}function Sr(n,r){for(var t=-1,u=null==n?0:n.length,e=Array(u);++t<u;)e[t]=r(n[t],t,n);return e}function Or(n,r){for(var t=-1,u=r.length,e=n.length;++t<u;)n[e+t]=r[t];return n}function Dr(n,r,t,u){var e=-1,i=null==n?0:n.length;for(u&&i&&(t=n[++e]);++e<i;)t=r(t,n[e],e,n);return t}function Fr(n,r,t,u){var e=null==n?0:n.length;for(u&&e&&(t=n[--e]);e--;)t=r(t,n[e],e,n);return t}function Tr(n,r){for(var t=-1,u=null==n?0:n.length;++t<u;)if(r(n[t],t,n))return!0;return!1}var zr=Pr("length");function Lr(n,r,t){var u;return t(n,(function(n,t,e){if(r(n,t,e))return u=t,!1})),u}function Cr(n,r,t,u){for(var e=n.length,i=t+(u?1:-1);u?i--:++i<e;)if(r(n[i],i,n))return i;return-1}function Mr(n,r,t){return r==r?function(n,r,t){for(var u=t-1,e=n.length;++u<e;)if(n[u]===r)return u;return-1}(n,r,t):Cr(n,Zr,t)}function Nr(n,r,t,u){for(var e=t-1,i=n.length;++e<i;)if(u(n[e],r))return e;return-1}function Zr(n){return n!=n}function Wr(n,r){var t=null==n?0:n.length;return t?qr(n,r)/t:l}function Pr(n){return function(t){return null==t?r:t[n]}}function Br(n){return function(t){return null==n?r:n[t]}}function Gr(n,r,t,u,e){return e(n,(function(n,e,i){t=u?(u=!1,n):r(t,n,e,i)})),t}function qr(n,t){for(var u,e=-1,i=n.length;++e<i;){var f=t(n[e]);f!==r&&(u=u===r?f:u+f)}return u}function Vr(n,r){for(var t=-1,u=Array(n);++t<n;)u[t]=r(t);return u}function Hr(n){return n?n.slice(0,lt(n)+1).replace(tn,""):n}function Kr(n){return function(r){return n(r)}}function Yr(n,r){return Sr(r,(function(r){return n[r]}))}function Jr(n,r){return n.has(r)}function Qr(n,r){for(var t=-1,u=n.length;++t<u&&Mr(r,n[t],0)>-1;);return t}function Xr(n,r){for(var t=n.length;t--&&Mr(r,n[t],0)>-1;);return t}var nt=Br({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),rt=Br({"&":"&","<":"<",">":">",'"':""","'":"'"});function tt(n){return"\\"+fr[n]}function ut(n){return nr.test(n)}function et(n){var r=-1,t=Array(n.size);return n.forEach((function(n,u){t[++r]=[u,n]})),t}function it(n,r){return function(t){return n(r(t))}}function ft(n,r){for(var t=-1,u=n.length,e=0,i=[];++t<u;){var o=n[t];o!==r&&o!==f||(n[t]=f,i[e++]=t)}return i}function ot(n){var r=-1,t=Array(n.size);return n.forEach((function(n){t[++r]=n})),t}function ct(n){var r=-1,t=Array(n.size);return n.forEach((function(n){t[++r]=[n,n]})),t}function at(n){return ut(n)?function(n){for(var r=Qn.lastIndex=0;Qn.test(n);)++r;return r}(n):zr(n)}function vt(n){return ut(n)?function(n){return n.match(Qn)||[]}(n):function(n){return n.split("")}(n)}function lt(n){for(var r=n.length;r--&&un.test(n.charAt(r)););return r}var st=Br({"&":"&","<":"<",">":">",""":'"',"'":"'"}),ht=function n(t){var u,un=(t=null==t?lr:ht.defaults(lr.Object(),t,ht.pick(lr,tr))).Array,jn=t.Date,xn=t.Error,mn=t.Function,An=t.Math,Rn=t.Object,En=t.RegExp,$n=t.String,Un=t.TypeError,kn=un.prototype,In=Rn.prototype,Sn=t["__core-js_shared__"],On=mn.prototype.toString,Dn=In.hasOwnProperty,Fn=0,Tn=(u=/[^.]+$/.exec(Sn&&Sn.keys&&Sn.keys.IE_PROTO||""))?"Symbol(src)_1."+u:"",zn=In.toString,Ln=On.call(Rn),Cn=lr._,Mn=En("^"+On.call(Dn).replace(nn,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Nn=pr?t.Buffer:r,Zn=t.Symbol,Wn=t.Uint8Array,Pn=Nn?Nn.allocUnsafe:r,Bn=it(Rn.getPrototypeOf,Rn),Gn=Rn.create,qn=In.propertyIsEnumerable,Vn=kn.splice,Hn=Zn?Zn.isConcatSpreadable:r,Kn=Zn?Zn.iterator:r,Qn=Zn?Zn.toStringTag:r,nr=function(){try{var n=oi(Rn,"defineProperty");return n({},"",{}),n}catch(n){}}(),fr=t.clearTimeout!==lr.clearTimeout&&t.clearTimeout,ar=jn&&jn.now!==lr.Date.now&&jn.now,vr=t.setTimeout!==lr.setTimeout&&t.setTimeout,sr=An.ceil,hr=An.floor,yr=Rn.getOwnPropertySymbols,wr=Nn?Nn.isBuffer:r,zr=t.isFinite,Br=kn.join,pt=it(Rn.keys,Rn),yt=An.max,wt=An.min,bt=jn.now,gt=t.parseInt,_t=An.random,dt=kn.reverse,jt=oi(t,"DataView"),xt=oi(t,"Map"),mt=oi(t,"Promise"),At=oi(t,"Set"),Rt=oi(t,"WeakMap"),Et=oi(Rn,"create"),$t=Rt&&new Rt,Ut={},kt=Ti(jt),It=Ti(xt),St=Ti(mt),Ot=Ti(At),Dt=Ti(Rt),Ft=Zn?Zn.prototype:r,Tt=Ft?Ft.valueOf:r,zt=Ft?Ft.toString:r;function Lt(n){if(Xf(n)&&!Wf(n)&&!(n instanceof Zt)){if(n instanceof Nt)return n;if(Dn.call(n,"__wrapped__"))return zi(n)}return new Nt(n)}var Ct=function(){function n(){}return function(t){if(!Qf(t))return{};if(Gn)return Gn(t);n.prototype=t;var u=new n;return n.prototype=r,u}}();function Mt(){}function Nt(n,t){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=r}function Zt(n){this.__wrapped__=n,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=s,this.__views__=[]}function Wt(n){var r=-1,t=null==n?0:n.length;for(this.clear();++r<t;){var u=n[r];this.set(u[0],u[1])}}function Pt(n){var r=-1,t=null==n?0:n.length;for(this.clear();++r<t;){var u=n[r];this.set(u[0],u[1])}}function Bt(n){var r=-1,t=null==n?0:n.length;for(this.clear();++r<t;){var u=n[r];this.set(u[0],u[1])}}function Gt(n){var r=-1,t=null==n?0:n.length;for(this.__data__=new Bt;++r<t;)this.add(n[r])}function qt(n){var r=this.__data__=new Pt(n);this.size=r.size}function Vt(n,r){var t=Wf(n),u=!t&&Zf(n),e=!t&&!u&&qf(n),i=!t&&!u&&!e&&oo(n),f=t||u||e||i,o=f?Vr(n.length,$n):[],c=o.length;for(var a in n)!r&&!Dn.call(n,a)||f&&("length"==a||e&&("offset"==a||"parent"==a)||i&&("buffer"==a||"byteLength"==a||"byteOffset"==a)||pi(a,c))||o.push(a);return o}function Ht(n){var t=n.length;return t?n[Bu(0,t-1)]:r}function Kt(n,r){return Ii(Re(n),eu(r,0,n.length))}function Yt(n){return Ii(Re(n))}function Jt(n,t,u){(u!==r&&!Cf(n[t],u)||u===r&&!(t in n))&&tu(n,t,u)}function Qt(n,t,u){var e=n[t];Dn.call(n,t)&&Cf(e,u)&&(u!==r||t in n)||tu(n,t,u)}function Xt(n,r){for(var t=n.length;t--;)if(Cf(n[t][0],r))return t;return-1}function nu(n,r,t,u){return au(n,(function(n,e,i){r(u,n,t(n),i)})),u}function ru(n,r){return n&&Ee(r,Io(r),n)}function tu(n,r,t){"__proto__"==r&&nr?nr(n,r,{configurable:!0,enumerable:!0,value:t,writable:!0}):n[r]=t}function uu(n,t){for(var u=-1,e=t.length,i=un(e),f=null==n;++u<e;)i[u]=f?r:Ro(n,t[u]);return i}function eu(n,t,u){return n==n&&(u!==r&&(n=n<=u?n:u),t!==r&&(n=n>=t?n:t)),n}function iu(n,t,u,e,i,f){var o,c=1&t,a=2&t,v=4&t;if(u&&(o=i?u(n,e,i,f):u(n)),o!==r)return o;if(!Qf(n))return n;var l=Wf(n);if(l){if(o=function(n){var r=n.length,t=new n.constructor(r);return r&&"string"==typeof n[0]&&Dn.call(n,"index")&&(t.index=n.index,t.input=n.input),t}(n),!c)return Re(n,o)}else{var s=vi(n),h=s==_||s==d;if(qf(n))return _e(n,c);if(s==m||s==p||h&&!i){if(o=a||h?{}:si(n),!c)return a?function(n,r){return Ee(n,ai(n),r)}(n,function(n,r){return n&&Ee(r,So(r),n)}(o,n)):function(n,r){return Ee(n,ci(n),r)}(n,ru(o,n))}else{if(!ir[s])return i?n:{};o=function(n,r,t){var u=n.constructor;switch(r){case I:return de(n);case w:case b:return new u(+n);case S:return function(n,r){var t=r?de(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.byteLength)}(n,t);case O:case D:case F:case T:case z:case L:case C:case M:case N:return je(n,t);case j:return new u;case x:case $:return new u(n);case R:return function(n){var r=new n.constructor(n.source,sn.exec(n));return r.lastIndex=n.lastIndex,r}(n);case E:return new u;case U:return Tt?Rn(Tt.call(n)):{}}}(n,s,c)}}f||(f=new qt);var y=f.get(n);if(y)return y;f.set(n,o),eo(n)?n.forEach((function(r){o.add(iu(r,t,u,r,n,f))})):no(n)&&n.forEach((function(r,e){o.set(e,iu(r,t,u,e,n,f))}));var g=l?r:(v?a?ni:Xe:a?So:Io)(n);return Rr(g||n,(function(r,e){g&&(r=n[e=r]),Qt(o,e,iu(r,t,u,e,n,f))})),o}function fu(n,t,u){var e=u.length;if(null==n)return!e;for(n=Rn(n);e--;){var i=u[e],f=n[i];if(f===r&&!(i in n)||!(0,t[i])(f))return!1}return!0}function ou(n,t,u){if("function"!=typeof n)throw new Un(e);return Ei((function(){n.apply(r,u)}),t)}function cu(n,r,t,u){var e=-1,i=kr,f=!0,o=n.length,c=[],a=r.length;if(!o)return c;t&&(r=Sr(r,Kr(t))),u?(i=Ir,f=!1):r.length>=200&&(i=Jr,f=!1,r=new Gt(r));n:for(;++e<o;){var v=n[e],l=null==t?v:t(v);if(v=u||0!==v?v:0,f&&l==l){for(var s=a;s--;)if(r[s]===l)continue n;c.push(v)}else i(r,l,u)||c.push(v)}return c}Lt.templateSettings={escape:H,evaluate:K,interpolate:Y,variable:"",imports:{_:Lt}},(Lt.prototype=Mt.prototype).constructor=Lt,(Nt.prototype=Ct(Mt.prototype)).constructor=Nt,(Zt.prototype=Ct(Mt.prototype)).constructor=Zt,Wt.prototype.clear=function(){this.__data__=Et?Et(null):{},this.size=0},Wt.prototype.delete=function(n){var r=this.has(n)&&delete this.__data__[n];return this.size-=r?1:0,r},Wt.prototype.get=function(n){var t=this.__data__;if(Et){var u=t[n];return u===i?r:u}return Dn.call(t,n)?t[n]:r},Wt.prototype.has=function(n){var t=this.__data__;return Et?t[n]!==r:Dn.call(t,n)},Wt.prototype.set=function(n,t){var u=this.__data__;return this.size+=this.has(n)?0:1,u[n]=Et&&t===r?i:t,this},Pt.prototype.clear=function(){this.__data__=[],this.size=0},Pt.prototype.delete=function(n){var r=this.__data__,t=Xt(r,n);return!(t<0||(t==r.length-1?r.pop():Vn.call(r,t,1),--this.size,0))},Pt.prototype.get=function(n){var t=this.__data__,u=Xt(t,n);return u<0?r:t[u][1]},Pt.prototype.has=function(n){return Xt(this.__data__,n)>-1},Pt.prototype.set=function(n,r){var t=this.__data__,u=Xt(t,n);return u<0?(++this.size,t.push([n,r])):t[u][1]=r,this},Bt.prototype.clear=function(){this.size=0,this.__data__={hash:new Wt,map:new(xt||Pt),string:new Wt}},Bt.prototype.delete=function(n){var r=ii(this,n).delete(n);return this.size-=r?1:0,r},Bt.prototype.get=function(n){return ii(this,n).get(n)},Bt.prototype.has=function(n){return ii(this,n).has(n)},Bt.prototype.set=function(n,r){var t=ii(this,n),u=t.size;return t.set(n,r),this.size+=t.size==u?0:1,this},Gt.prototype.add=Gt.prototype.push=function(n){return this.__data__.set(n,i),this},Gt.prototype.has=function(n){return this.__data__.has(n)},qt.prototype.clear=function(){this.__data__=new Pt,this.size=0},qt.prototype.delete=function(n){var r=this.__data__,t=r.delete(n);return this.size=r.size,t},qt.prototype.get=function(n){return this.__data__.get(n)},qt.prototype.has=function(n){return this.__data__.has(n)},qt.prototype.set=function(n,r){var t=this.__data__;if(t instanceof Pt){var u=t.__data__;if(!xt||u.length<199)return u.push([n,r]),this.size=++t.size,this;t=this.__data__=new Bt(u)}return t.set(n,r),this.size=t.size,this};var au=ke(bu),vu=ke(gu,!0);function lu(n,r){var t=!0;return au(n,(function(n,u,e){return t=!!r(n,u,e)})),t}function su(n,t,u){for(var e=-1,i=n.length;++e<i;){var f=n[e],o=t(f);if(null!=o&&(c===r?o==o&&!fo(o):u(o,c)))var c=o,a=f}return a}function hu(n,r){var t=[];return au(n,(function(n,u,e){r(n,u,e)&&t.push(n)})),t}function pu(n,r,t,u,e){var i=-1,f=n.length;for(t||(t=hi),e||(e=[]);++i<f;){var o=n[i];r>0&&t(o)?r>1?pu(o,r-1,t,u,e):Or(e,o):u||(e[e.length]=o)}return e}var yu=Ie(),wu=Ie(!0);function bu(n,r){return n&&yu(n,r,Io)}function gu(n,r){return n&&wu(n,r,Io)}function _u(n,r){return Ur(r,(function(r){return Kf(n[r])}))}function du(n,t){for(var u=0,e=(t=ye(t,n)).length;null!=n&&u<e;)n=n[Fi(t[u++])];return u&&u==e?n:r}function ju(n,r,t){var u=r(n);return Wf(n)?u:Or(u,t(n))}function xu(n){return null==n?n===r?"[object Undefined]":"[object Null]":Qn&&Qn in Rn(n)?function(n){var t=Dn.call(n,Qn),u=n[Qn];try{n[Qn]=r;var e=!0}catch(n){}var i=zn.call(n);return e&&(t?n[Qn]=u:delete n[Qn]),i}(n):function(n){return zn.call(n)}(n)}function mu(n,r){return n>r}function Au(n,r){return null!=n&&Dn.call(n,r)}function Ru(n,r){return null!=n&&r in Rn(n)}function Eu(n,t,u){for(var e=u?Ir:kr,i=n[0].length,f=n.length,o=f,c=un(f),a=1/0,v=[];o--;){var l=n[o];o&&t&&(l=Sr(l,Kr(t))),a=wt(l.length,a),c[o]=!u&&(t||i>=120&&l.length>=120)?new Gt(o&&l):r}l=n[0];var s=-1,h=c[0];n:for(;++s<i&&v.length<a;){var p=l[s],y=t?t(p):p;if(p=u||0!==p?p:0,!(h?Jr(h,y):e(v,y,u))){for(o=f;--o;){var w=c[o];if(!(w?Jr(w,y):e(n[o],y,u)))continue n}h&&h.push(y),v.push(p)}}return v}function $u(n,t,u){var e=null==(n=mi(n,t=ye(t,n)))?n:n[Fi(Vi(t))];return null==e?r:mr(e,n,u)}function Uu(n){return Xf(n)&&xu(n)==p}function ku(n,t,u,e,i){return n===t||(null==n||null==t||!Xf(n)&&!Xf(t)?n!=n&&t!=t:function(n,t,u,e,i,f){var o=Wf(n),c=Wf(t),a=o?y:vi(n),v=c?y:vi(t),l=(a=a==p?m:a)==m,s=(v=v==p?m:v)==m,h=a==v;if(h&&qf(n)){if(!qf(t))return!1;o=!0,l=!1}if(h&&!l)return f||(f=new qt),o||oo(n)?Je(n,t,u,e,i,f):function(n,r,t,u,e,i,f){switch(t){case S:if(n.byteLength!=r.byteLength||n.byteOffset!=r.byteOffset)return!1;n=n.buffer,r=r.buffer;case I:return!(n.byteLength!=r.byteLength||!i(new Wn(n),new Wn(r)));case w:case b:case x:return Cf(+n,+r);case g:return n.name==r.name&&n.message==r.message;case R:case $:return n==r+"";case j:var o=et;case E:if(o||(o=ot),n.size!=r.size&&!(1&u))return!1;var c=f.get(n);if(c)return c==r;u|=2,f.set(n,r);var a=Je(o(n),o(r),u,e,i,f);return f.delete(n),a;case U:if(Tt)return Tt.call(n)==Tt.call(r)}return!1}(n,t,a,u,e,i,f);if(!(1&u)){var _=l&&Dn.call(n,"__wrapped__"),d=s&&Dn.call(t,"__wrapped__");if(_||d){var A=_?n.value():n,k=d?t.value():t;return f||(f=new qt),i(A,k,u,e,f)}}return!!h&&(f||(f=new qt),function(n,t,u,e,i,f){var o=1&u,c=Xe(n),a=c.length;if(a!=Xe(t).length&&!o)return!1;for(var v=a;v--;){var l=c[v];if(!(o?l in t:Dn.call(t,l)))return!1}var s=f.get(n),h=f.get(t);if(s&&h)return s==t&&h==n;var p=!0;f.set(n,t),f.set(t,n);for(var y=o;++v<a;){var w=n[l=c[v]],b=t[l];if(e)var g=o?e(b,w,l,t,n,f):e(w,b,l,n,t,f);if(!(g===r?w===b||i(w,b,u,e,f):g)){p=!1;break}y||(y="constructor"==l)}if(p&&!y){var _=n.constructor,d=t.constructor;_==d||!("constructor"in n)||!("constructor"in t)||"function"==typeof _&&_ instanceof _&&"function"==typeof d&&d instanceof d||(p=!1)}return f.delete(n),f.delete(t),p}(n,t,u,e,i,f))}(n,t,u,e,ku,i))}function Iu(n,t,u,e){var i=u.length,f=i,o=!e;if(null==n)return!f;for(n=Rn(n);i--;){var c=u[i];if(o&&c[2]?c[1]!==n[c[0]]:!(c[0]in n))return!1}for(;++i<f;){var a=(c=u[i])[0],v=n[a],l=c[1];if(o&&c[2]){if(v===r&&!(a in n))return!1}else{var s=new qt;if(e)var h=e(v,l,a,n,t,s);if(!(h===r?ku(l,v,3,e,s):h))return!1}}return!0}function Su(n){return!(!Qf(n)||(r=n,Tn&&Tn in r))&&(Kf(n)?Mn:yn).test(Ti(n));var r}function Ou(n){return"function"==typeof n?n:null==n?tc:"object"==typeof n?Wf(n)?Lu(n[0],n[1]):zu(n):lc(n)}function Du(n){if(!_i(n))return pt(n);var r=[];for(var t in Rn(n))Dn.call(n,t)&&"constructor"!=t&&r.push(t);return r}function Fu(n,r){return n<r}function Tu(n,r){var t=-1,u=Bf(n)?un(n.length):[];return au(n,(function(n,e,i){u[++t]=r(n,e,i)})),u}function zu(n){var r=fi(n);return 1==r.length&&r[0][2]?ji(r[0][0],r[0][1]):function(t){return t===n||Iu(t,n,r)}}function Lu(n,t){return wi(n)&&di(t)?ji(Fi(n),t):function(u){var e=Ro(u,n);return e===r&&e===t?Eo(u,n):ku(t,e,3)}}function Cu(n,t,u,e,i){n!==t&&yu(t,(function(f,o){if(i||(i=new qt),Qf(f))!function(n,t,u,e,i,f,o){var c=Ai(n,u),a=Ai(t,u),v=o.get(a);if(v)Jt(n,u,v);else{var l=f?f(c,a,u+"",n,t,o):r,s=l===r;if(s){var h=Wf(a),p=!h&&qf(a),y=!h&&!p&&oo(a);l=a,h||p||y?Wf(c)?l=c:Gf(c)?l=Re(c):p?(s=!1,l=_e(a,!0)):y?(s=!1,l=je(a,!0)):l=[]:to(a)||Zf(a)?(l=c,Zf(c)?l=yo(c):Qf(c)&&!Kf(c)||(l=si(a))):s=!1}s&&(o.set(a,l),i(l,a,e,f,o),o.delete(a)),Jt(n,u,l)}}(n,t,o,u,Cu,e,i);else{var c=e?e(Ai(n,o),f,o+"",n,t,i):r;c===r&&(c=f),Jt(n,o,c)}}),So)}function Mu(n,t){var u=n.length;if(u)return pi(t+=t<0?u:0,u)?n[t]:r}function Nu(n,r,t){r=r.length?Sr(r,(function(n){return Wf(n)?function(r){return du(r,1===n.length?n[0]:n)}:n})):[tc];var u=-1;r=Sr(r,Kr(ei()));var e=Tu(n,(function(n){var t=Sr(r,(function(r){return r(n)}));return{criteria:t,index:++u,value:n}}));return function(n){var r=n.length;for(n.sort((function(n,r){return function(n,r,t){for(var u=-1,e=n.criteria,i=r.criteria,f=e.length,o=t.length;++u<f;){var c=xe(e[u],i[u]);if(c)return u>=o?c:c*("desc"==t[u]?-1:1)}return n.index-r.index}(n,r,t)}));r--;)n[r]=n[r].value;return n}(e)}function Zu(n,r,t){for(var u=-1,e=r.length,i={};++u<e;){var f=r[u],o=du(n,f);t(o,f)&&Ku(i,ye(f,n),o)}return i}function Wu(n,r,t,u){var e=u?Nr:Mr,i=-1,f=r.length,o=n;for(n===r&&(r=Re(r)),t&&(o=Sr(n,Kr(t)));++i<f;)for(var c=0,a=r[i],v=t?t(a):a;(c=e(o,v,c,u))>-1;)o!==n&&Vn.call(o,c,1),Vn.call(n,c,1);return n}function Pu(n,r){for(var t=n?r.length:0,u=t-1;t--;){var e=r[t];if(t==u||e!==i){var i=e;pi(e)?Vn.call(n,e,1):oe(n,e)}}return n}function Bu(n,r){return n+hr(_t()*(r-n+1))}function Gu(n,r){var t="";if(!n||r<1||r>v)return t;do{r%2&&(t+=n),(r=hr(r/2))&&(n+=n)}while(r);return t}function qu(n,r){return $i(xi(n,r,tc),n+"")}function Vu(n){return Ht(Mo(n))}function Hu(n,r){var t=Mo(n);return Ii(t,eu(r,0,t.length))}function Ku(n,t,u,e){if(!Qf(n))return n;for(var i=-1,f=(t=ye(t,n)).length,o=f-1,c=n;null!=c&&++i<f;){var a=Fi(t[i]),v=u;if("__proto__"===a||"constructor"===a||"prototype"===a)return n;if(i!=o){var l=c[a];(v=e?e(l,a,c):r)===r&&(v=Qf(l)?l:pi(t[i+1])?[]:{})}Qt(c,a,v),c=c[a]}return n}var Yu=$t?function(n,r){return $t.set(n,r),n}:tc,Ju=nr?function(n,r){return nr(n,"toString",{configurable:!0,enumerable:!1,value:Xo(r),writable:!0})}:tc;function Qu(n){return Ii(Mo(n))}function Xu(n,r,t){var u=-1,e=n.length;r<0&&(r=-r>e?0:e+r),(t=t>e?e:t)<0&&(t+=e),e=r>t?0:t-r>>>0,r>>>=0;for(var i=un(e);++u<e;)i[u]=n[u+r];return i}function ne(n,r){var t;return au(n,(function(n,u,e){return!(t=r(n,u,e))})),!!t}function re(n,r,t){var u=0,e=null==n?u:n.length;if("number"==typeof r&&r==r&&e<=2147483647){for(;u<e;){var i=u+e>>>1,f=n[i];null!==f&&!fo(f)&&(t?f<=r:f<r)?u=i+1:e=i}return e}return te(n,r,tc,t)}function te(n,t,u,e){var i=0,f=null==n?0:n.length;if(0===f)return 0;for(var o=(t=u(t))!=t,c=null===t,a=fo(t),v=t===r;i<f;){var l=hr((i+f)/2),s=u(n[l]),h=s!==r,p=null===s,y=s==s,w=fo(s);if(o)var b=e||y;else b=v?y&&(e||h):c?y&&h&&(e||!p):a?y&&h&&!p&&(e||!w):!p&&!w&&(e?s<=t:s<t);b?i=l+1:f=l}return wt(f,4294967294)}function ue(n,r){for(var t=-1,u=n.length,e=0,i=[];++t<u;){var f=n[t],o=r?r(f):f;if(!t||!Cf(o,c)){var c=o;i[e++]=0===f?0:f}}return i}function ee(n){return"number"==typeof n?n:fo(n)?l:+n}function ie(n){if("string"==typeof n)return n;if(Wf(n))return Sr(n,ie)+"";if(fo(n))return zt?zt.call(n):"";var r=n+"";return"0"==r&&1/n==-1/0?"-0":r}function fe(n,r,t){var u=-1,e=kr,i=n.length,f=!0,o=[],c=o;if(t)f=!1,e=Ir;else if(i>=200){var a=r?null:Ge(n);if(a)return ot(a);f=!1,e=Jr,c=new Gt}else c=r?[]:o;n:for(;++u<i;){var v=n[u],l=r?r(v):v;if(v=t||0!==v?v:0,f&&l==l){for(var s=c.length;s--;)if(c[s]===l)continue n;r&&c.push(l),o.push(v)}else e(c,l,t)||(c!==o&&c.push(l),o.push(v))}return o}function oe(n,r){var t=-1,u=(r=ye(r,n)).length;if(!u)return!0;for(var e=null==n||"object"!=typeof n&&"function"!=typeof n;++t<u;){var i=r[t];if("string"==typeof i){if("__proto__"===i&&!Dn.call(n,"__proto__"))return!1;if("constructor"===i&&t+1<u&&"string"==typeof r[t+1]&&"prototype"===r[t+1]){if(e&&0===t)continue;return!1}}}var f=mi(n,r);return null==f||delete f[Fi(Vi(r))]}function ce(n,r,t,u){return Ku(n,r,t(du(n,r)),u)}function ae(n,r,t,u){for(var e=n.length,i=u?e:-1;(u?i--:++i<e)&&r(n[i],i,n););return t?Xu(n,u?0:i,u?i+1:e):Xu(n,u?i+1:0,u?e:i)}function ve(n,r){var t=n;return t instanceof Zt&&(t=t.value()),Dr(r,(function(n,r){return r.func.apply(r.thisArg,Or([n],r.args))}),t)}function le(n,r,t){var u=n.length;if(u<2)return u?fe(n[0]):[];for(var e=-1,i=un(u);++e<u;)for(var f=n[e],o=-1;++o<u;)o!=e&&(i[e]=cu(i[e]||f,n[o],r,t));return fe(pu(i,1),r,t)}function se(n,t,u){for(var e=-1,i=n.length,f=t.length,o={};++e<i;)u(o,n[e],e<f?t[e]:r);return o}function he(n){return Gf(n)?n:[]}function pe(n){return"function"==typeof n?n:tc}function ye(n,r){return Wf(n)?n:wi(n,r)?[n]:Di(wo(n))}var we=qu;function be(n,t,u){var e=n.length;return u=u===r?e:u,!t&&u>=e?n:Xu(n,t,u)}var ge=fr||function(n){return lr.clearTimeout(n)};function _e(n,r){if(r)return n.slice();var t=n.length,u=Pn?Pn(t):new n.constructor(t);return n.copy(u),u}function de(n){var r=new n.constructor(n.byteLength);return new Wn(r).set(new Wn(n)),r}function je(n,r){var t=r?de(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.length)}function xe(n,t){if(n!==t){var u=n!==r,e=null===n,i=n==n,f=fo(n),o=t!==r,c=null===t,a=t==t,v=fo(t);if(!c&&!v&&!f&&n>t||f&&o&&a&&!c&&!v||e&&o&&a||!u&&a||!i)return 1;if(!e&&!f&&!v&&n<t||v&&u&&i&&!e&&!f||c&&u&&i||!o&&i||!a)return-1}return 0}function me(n,r,t,u){for(var e=-1,i=n.length,f=t.length,o=-1,c=r.length,a=yt(i-f,0),v=un(c+a),l=!u;++o<c;)v[o]=r[o];for(;++e<f;)(l||e<i)&&(v[t[e]]=n[e]);for(;a--;)v[o++]=n[e++];return v}function Ae(n,r,t,u){for(var e=-1,i=n.length,f=-1,o=t.length,c=-1,a=r.length,v=yt(i-o,0),l=un(v+a),s=!u;++e<v;)l[e]=n[e];for(var h=e;++c<a;)l[h+c]=r[c];for(;++f<o;)(s||e<i)&&(l[h+t[f]]=n[e++]);return l}function Re(n,r){var t=-1,u=n.length;for(r||(r=un(u));++t<u;)r[t]=n[t];return r}function Ee(n,t,u,e){var i=!u;u||(u={});for(var f=-1,o=t.length;++f<o;){var c=t[f],a=e?e(u[c],n[c],c,u,n):r;a===r&&(a=n[c]),i?tu(u,c,a):Qt(u,c,a)}return u}function $e(n,r){return function(t,u){var e=Wf(t)?Ar:nu,i=r?r():{};return e(t,n,ei(u,2),i)}}function Ue(n){return qu((function(t,u){var e=-1,i=u.length,f=i>1?u[i-1]:r,o=i>2?u[2]:r;for(f=n.length>3&&"function"==typeof f?(i--,f):r,o&&yi(u[0],u[1],o)&&(f=i<3?r:f,i=1),t=Rn(t);++e<i;){var c=u[e];c&&n(t,c,e,f)}return t}))}function ke(n,r){return function(t,u){if(null==t)return t;if(!Bf(t))return n(t,u);for(var e=t.length,i=r?e:-1,f=Rn(t);(r?i--:++i<e)&&!1!==u(f[i],i,f););return t}}function Ie(n){return function(r,t,u){for(var e=-1,i=Rn(r),f=u(r),o=f.length;o--;){var c=f[n?o:++e];if(!1===t(i[c],c,i))break}return r}}function Se(n){return function(t){var u=ut(t=wo(t))?vt(t):r,e=u?u[0]:t.charAt(0),i=u?be(u,1).join(""):t.slice(1);return e[n]()+i}}function Oe(n){return function(r){return Dr(Yo(Wo(r).replace(Yn,"")),n,"")}}function De(n){return function(){var r=arguments;switch(r.length){case 0:return new n;case 1:return new n(r[0]);case 2:return new n(r[0],r[1]);case 3:return new n(r[0],r[1],r[2]);case 4:return new n(r[0],r[1],r[2],r[3]);case 5:return new n(r[0],r[1],r[2],r[3],r[4]);case 6:return new n(r[0],r[1],r[2],r[3],r[4],r[5]);case 7:return new n(r[0],r[1],r[2],r[3],r[4],r[5],r[6])}var t=Ct(n.prototype),u=n.apply(t,r);return Qf(u)?u:t}}function Fe(n){return function(t,u,e){var i=Rn(t);if(!Bf(t)){var f=ei(u,3);t=Io(t),u=function(n){return f(i[n],n,i)}}var o=n(t,u,e);return o>-1?i[f?t[o]:o]:r}}function Te(n){return Qe((function(t){var u=t.length,i=u,f=Nt.prototype.thru;for(n&&t.reverse();i--;){var o=t[i];if("function"!=typeof o)throw new Un(e);if(f&&!c&&"wrapper"==ti(o))var c=new Nt([],!0)}for(i=c?i:u;++i<u;){var a=ti(o=t[i]),v="wrapper"==a?ri(o):r;c=v&&bi(v[0])&&424==v[1]&&!v[4].length&&1==v[9]?c[ti(v[0])].apply(c,v[3]):1==o.length&&bi(o)?c[a]():c.thru(o)}return function(){var n=arguments,r=n[0];if(c&&1==n.length&&Wf(r))return c.plant(r).value();for(var e=0,i=u?t[e].apply(this,n):r;++e<u;)i=t[e].call(this,i);return i}}))}function ze(n,t,u,e,i,f,o,a,v,l){var s=t&c,h=1&t,p=2&t,y=24&t,w=512&t,b=p?r:De(n);return function c(){for(var g=arguments.length,_=un(g),d=g;d--;)_[d]=arguments[d];if(y)var j=ui(c),x=function(n,r){for(var t=n.length,u=0;t--;)n[t]===r&&++u;return u}(_,j);if(e&&(_=me(_,e,i,y)),f&&(_=Ae(_,f,o,y)),g-=x,y&&g<l){var m=ft(_,j);return Pe(n,t,ze,c.placeholder,u,_,m,a,v,l-g)}var A=h?u:this,R=p?A[n]:n;return g=_.length,a?_=function(n,t){for(var u=n.length,e=wt(t.length,u),i=Re(n);e--;){var f=t[e];n[e]=pi(f,u)?i[f]:r}return n}(_,a):w&&g>1&&_.reverse(),s&&v<g&&(_.length=v),this&&this!==lr&&this instanceof c&&(R=b||De(R)),R.apply(A,_)}}function Le(n,r){return function(t,u){return function(n,r,t,u){return bu(n,(function(n,e,i){r(u,t(n),e,i)})),u}(t,n,r(u),{})}}function Ce(n,t){return function(u,e){var i;if(u===r&&e===r)return t;if(u!==r&&(i=u),e!==r){if(i===r)return e;"string"==typeof u||"string"==typeof e?(u=ie(u),e=ie(e)):(u=ee(u),e=ee(e)),i=n(u,e)}return i}}function Me(n){return Qe((function(r){return r=Sr(r,Kr(ei())),qu((function(t){var u=this;return n(r,(function(n){return mr(n,u,t)}))}))}))}function Ne(n,t){var u=(t=t===r?" ":ie(t)).length;if(u<2)return u?Gu(t,n):t;var e=Gu(t,sr(n/at(t)));return ut(t)?be(vt(e),0,n).join(""):e.slice(0,n)}function Ze(n){return function(t,u,e){return e&&"number"!=typeof e&&yi(t,u,e)&&(u=e=r),t=lo(t),u===r?(u=t,t=0):u=lo(u),function(n,r,t,u){for(var e=-1,i=yt(sr((r-n)/(t||1)),0),f=un(i);i--;)f[u?i:++e]=n,n+=t;return f}(t,u,e=e===r?t<u?1:-1:lo(e),n)}}function We(n){return function(r,t){return"string"==typeof r&&"string"==typeof t||(r=po(r),t=po(t)),n(r,t)}}function Pe(n,t,u,e,i,f,c,a,v,l){var s=8&t;t|=s?o:64,4&(t&=~(s?64:o))||(t&=-4);var h=[n,t,i,s?f:r,s?c:r,s?r:f,s?r:c,a,v,l],p=u.apply(r,h);return bi(n)&&Ri(p,h),p.placeholder=e,Ui(p,n,t)}function Be(n){var r=An[n];return function(n,t){if(n=po(n),(t=null==t?0:wt(so(t),292))&&zr(n)){var u=(wo(n)+"e").split("e");return+((u=(wo(r(u[0]+"e"+(+u[1]+t)))+"e").split("e"))[0]+"e"+(+u[1]-t))}return r(n)}}var Ge=At&&1/ot(new At([,-0]))[1]==a?function(n){return new At(n)}:oc;function qe(n){return function(r){var t=vi(r);return t==j?et(r):t==E?ct(r):function(n,r){return Sr(r,(function(r){return[r,n[r]]}))}(r,n(r))}}function Ve(n,t,u,i,a,v,l,s){var h=2&t;if(!h&&"function"!=typeof n)throw new Un(e);var p=i?i.length:0;if(p||(t&=-97,i=a=r),l=l===r?l:yt(so(l),0),s=s===r?s:so(s),p-=a?a.length:0,64&t){var y=i,w=a;i=a=r}var b=h?r:ri(n),g=[n,t,u,i,a,y,w,v,l,s];if(b&&function(n,r){var t=n[1],u=r[1],e=t|u;if(!(e<131||(u==c&&8==t||u==c&&256==t&&n[7].length<=r[8]||384==u&&r[7].length<=r[8]&&8==t)))return n;1&u&&(n[2]=r[2],e|=1&t?0:4);var i=r[3];if(i){var o=n[3];n[3]=o?me(o,i,r[4]):i,n[4]=o?ft(n[3],f):r[4]}(i=r[5])&&(n[5]=(o=n[5])?Ae(o,i,r[6]):i,n[6]=o?ft(n[5],f):r[6]),(i=r[7])&&(n[7]=i),u&c&&(n[8]=null==n[8]?r[8]:wt(n[8],r[8])),null==n[9]&&(n[9]=r[9]),n[0]=r[0],n[1]=e}(g,b),n=g[0],t=g[1],u=g[2],i=g[3],a=g[4],!(s=g[9]=g[9]===r?h?0:n.length:yt(g[9]-p,0))&&24&t&&(t&=-25),t&&1!=t)_=8==t||16==t?function(n,t,u){var e=De(n);return function i(){for(var f=arguments.length,o=un(f),c=f,a=ui(i);c--;)o[c]=arguments[c];var v=f<3&&o[0]!==a&&o[f-1]!==a?[]:ft(o,a);return(f-=v.length)<u?Pe(n,t,ze,i.placeholder,r,o,v,r,r,u-f):mr(this&&this!==lr&&this instanceof i?e:n,this,o)}}(n,t,s):t!=o&&33!=t||a.length?ze.apply(r,g):function(n,r,t,u){var e=1&r,i=De(n);return function r(){for(var f=-1,o=arguments.length,c=-1,a=u.length,v=un(a+o),l=this&&this!==lr&&this instanceof r?i:n;++c<a;)v[c]=u[c];for(;o--;)v[c++]=arguments[++f];return mr(l,e?t:this,v)}}(n,t,u,i);else var _=function(n,r,t){var u=1&r,e=De(n);return function r(){return(this&&this!==lr&&this instanceof r?e:n).apply(u?t:this,arguments)}}(n,t,u);return Ui((b?Yu:Ri)(_,g),n,t)}function He(n,t,u,e){return n===r||Cf(n,In[u])&&!Dn.call(e,u)?t:n}function Ke(n,t,u,e,i,f){return Qf(n)&&Qf(t)&&(f.set(t,n),Cu(n,t,r,Ke,f),f.delete(t)),n}function Ye(n){return to(n)?r:n}function Je(n,t,u,e,i,f){var o=1&u,c=n.length,a=t.length;if(c!=a&&!(o&&a>c))return!1;var v=f.get(n),l=f.get(t);if(v&&l)return v==t&&l==n;var s=-1,h=!0,p=2&u?new Gt:r;for(f.set(n,t),f.set(t,n);++s<c;){var y=n[s],w=t[s];if(e)var b=o?e(w,y,s,t,n,f):e(y,w,s,n,t,f);if(b!==r){if(b)continue;h=!1;break}if(p){if(!Tr(t,(function(n,r){if(!Jr(p,r)&&(y===n||i(y,n,u,e,f)))return p.push(r)}))){h=!1;break}}else if(y!==w&&!i(y,w,u,e,f)){h=!1;break}}return f.delete(n),f.delete(t),h}function Qe(n){return $i(xi(n,r,Wi),n+"")}function Xe(n){return ju(n,Io,ci)}function ni(n){return ju(n,So,ai)}var ri=$t?function(n){return $t.get(n)}:oc;function ti(n){for(var r=n.name+"",t=Ut[r],u=Dn.call(Ut,r)?t.length:0;u--;){var e=t[u],i=e.func;if(null==i||i==n)return e.name}return r}function ui(n){return(Dn.call(Lt,"placeholder")?Lt:n).placeholder}function ei(){var n=Lt.iteratee||uc;return n=n===uc?Ou:n,arguments.length?n(arguments[0],arguments[1]):n}function ii(n,r){var t,u,e=n.__data__;return("string"==(u=typeof(t=r))||"number"==u||"symbol"==u||"boolean"==u?"__proto__"!==t:null===t)?e["string"==typeof r?"string":"hash"]:e.map}function fi(n){for(var r=Io(n),t=r.length;t--;){var u=r[t],e=n[u];r[t]=[u,e,di(e)]}return r}function oi(n,t){var u=function(n,t){return null==n?r:n[t]}(n,t);return Su(u)?u:r}var ci=yr?function(n){return null==n?[]:(n=Rn(n),Ur(yr(n),(function(r){return qn.call(n,r)})))}:pc,ai=yr?function(n){for(var r=[];n;)Or(r,ci(n)),n=Bn(n);return r}:pc,vi=xu;function li(n,r,t){for(var u=-1,e=(r=ye(r,n)).length,i=!1;++u<e;){var f=Fi(r[u]);if(!(i=null!=n&&t(n,f)))break;n=n[f]}return i||++u!=e?i:!!(e=null==n?0:n.length)&&Jf(e)&&pi(f,e)&&(Wf(n)||Zf(n))}function si(n){return"function"!=typeof n.constructor||_i(n)?{}:Ct(Bn(n))}function hi(n){return Wf(n)||Zf(n)||!!(Hn&&n&&n[Hn])}function pi(n,r){var t=typeof n;return!!(r=null==r?v:r)&&("number"==t||"symbol"!=t&&bn.test(n))&&n>-1&&n%1==0&&n<r}function yi(n,r,t){if(!Qf(t))return!1;var u=typeof r;return!!("number"==u?Bf(t)&&pi(r,t.length):"string"==u&&r in t)&&Cf(t[r],n)}function wi(n,r){if(Wf(n))return!1;var t=typeof n;return!("number"!=t&&"symbol"!=t&&"boolean"!=t&&null!=n&&!fo(n))||Q.test(n)||!J.test(n)||null!=r&&n in Rn(r)}function bi(n){var r=ti(n),t=Lt[r];if("function"!=typeof t||!(r in Zt.prototype))return!1;if(n===t)return!0;var u=ri(t);return!!u&&n===u[0]}(jt&&vi(new jt(new ArrayBuffer(1)))!=S||xt&&vi(new xt)!=j||mt&&vi(mt.resolve())!=A||At&&vi(new At)!=E||Rt&&vi(new Rt)!=k)&&(vi=function(n){var t=xu(n),u=t==m?n.constructor:r,e=u?Ti(u):"";if(e)switch(e){case kt:return S;case It:return j;case St:return A;case Ot:return E;case Dt:return k}return t});var gi=Sn?Kf:yc;function _i(n){var r=n&&n.constructor;return n===("function"==typeof r&&r.prototype||In)}function di(n){return n==n&&!Qf(n)}function ji(n,t){return function(u){return null!=u&&u[n]===t&&(t!==r||n in Rn(u))}}function xi(n,t,u){return t=yt(t===r?n.length-1:t,0),function(){for(var r=arguments,e=-1,i=yt(r.length-t,0),f=un(i);++e<i;)f[e]=r[t+e];e=-1;for(var o=un(t+1);++e<t;)o[e]=r[e];return o[t]=u(f),mr(n,this,o)}}function mi(n,r){return r.length<2?n:du(n,Xu(r,0,-1))}function Ai(n,r){if(("constructor"!==r||"function"!=typeof n[r])&&"__proto__"!=r)return n[r]}var Ri=ki(Yu),Ei=vr||function(n,r){return lr.setTimeout(n,r)},$i=ki(Ju);function Ui(n,r,t){var u=r+"";return $i(n,function(n,r){var t=r.length;if(!t)return n;var u=t-1;return r[u]=(t>1?"& ":"")+r[u],r=r.join(t>2?", ":" "),n.replace(en,"{\n/* [wrapped with "+r+"] */\n")}(u,function(n,r){return Rr(h,(function(t){var u="_."+t[0];r&t[1]&&!kr(n,u)&&n.push(u)})),n.sort()}(function(n){var r=n.match(fn);return r?r[1].split(on):[]}(u),t)))}function ki(n){var t=0,u=0;return function(){var e=bt(),i=16-(e-u);if(u=e,i>0){if(++t>=800)return arguments[0]}else t=0;return n.apply(r,arguments)}}function Ii(n,t){var u=-1,e=n.length,i=e-1;for(t=t===r?e:t;++u<t;){var f=Bu(u,i),o=n[f];n[f]=n[u],n[u]=o}return n.length=t,n}var Si,Oi,Di=(Si=Of((function(n){var r=[];return 46===n.charCodeAt(0)&&r.push(""),n.replace(X,(function(n,t,u,e){r.push(u?e.replace(vn,"$1"):t||n)})),r}),(function(n){return 500===Oi.size&&Oi.clear(),n})),Oi=Si.cache,Si);function Fi(n){if("string"==typeof n||fo(n))return n;var r=n+"";return"0"==r&&1/n==-1/0?"-0":r}function Ti(n){if(null!=n){try{return On.call(n)}catch(n){}try{return n+""}catch(n){}}return""}function zi(n){if(n instanceof Zt)return n.clone();var r=new Nt(n.__wrapped__,n.__chain__);return r.__actions__=Re(n.__actions__),r.__index__=n.__index__,r.__values__=n.__values__,r}var Li=qu((function(n,r){return Gf(n)?cu(n,pu(r,1,Gf,!0)):[]})),Ci=qu((function(n,t){var u=Vi(t);return Gf(u)&&(u=r),Gf(n)?cu(n,pu(t,1,Gf,!0),ei(u,2)):[]})),Mi=qu((function(n,t){var u=Vi(t);return Gf(u)&&(u=r),Gf(n)?cu(n,pu(t,1,Gf,!0),r,u):[]}));function Ni(n,r,t){var u=null==n?0:n.length;if(!u)return-1;var e=null==t?0:so(t);return e<0&&(e=yt(u+e,0)),Cr(n,ei(r,3),e)}function Zi(n,t,u){var e=null==n?0:n.length;if(!e)return-1;var i=e-1;return u!==r&&(i=so(u),i=u<0?yt(e+i,0):wt(i,e-1)),Cr(n,ei(t,3),i,!0)}function Wi(n){return null!=n&&n.length?pu(n,1):[]}function Pi(n){return n&&n.length?n[0]:r}var Bi=qu((function(n){var r=Sr(n,he);return r.length&&r[0]===n[0]?Eu(r):[]})),Gi=qu((function(n){var t=Vi(n),u=Sr(n,he);return t===Vi(u)?t=r:u.pop(),u.length&&u[0]===n[0]?Eu(u,ei(t,2)):[]})),qi=qu((function(n){var t=Vi(n),u=Sr(n,he);return(t="function"==typeof t?t:r)&&u.pop(),u.length&&u[0]===n[0]?Eu(u,r,t):[]}));function Vi(n){var t=null==n?0:n.length;return t?n[t-1]:r}var Hi=qu(Ki);function Ki(n,r){return n&&n.length&&r&&r.length?Wu(n,r):n}var Yi=Qe((function(n,r){var t=null==n?0:n.length,u=uu(n,r);return Pu(n,Sr(r,(function(n){return pi(n,t)?+n:n})).sort(xe)),u}));function Ji(n){return null==n?n:dt.call(n)}var Qi=qu((function(n){return fe(pu(n,1,Gf,!0))})),Xi=qu((function(n){var t=Vi(n);return Gf(t)&&(t=r),fe(pu(n,1,Gf,!0),ei(t,2))})),nf=qu((function(n){var t=Vi(n);return t="function"==typeof t?t:r,fe(pu(n,1,Gf,!0),r,t)}));function rf(n){if(!n||!n.length)return[];var r=0;return n=Ur(n,(function(n){if(Gf(n))return r=yt(n.length,r),!0})),Vr(r,(function(r){return Sr(n,Pr(r))}))}function tf(n,t){if(!n||!n.length)return[];var u=rf(n);return null==t?u:Sr(u,(function(n){return mr(t,r,n)}))}var uf=qu((function(n,r){return Gf(n)?cu(n,r):[]})),ef=qu((function(n){return le(Ur(n,Gf))})),ff=qu((function(n){var t=Vi(n);return Gf(t)&&(t=r),le(Ur(n,Gf),ei(t,2))})),of=qu((function(n){var t=Vi(n);return t="function"==typeof t?t:r,le(Ur(n,Gf),r,t)})),cf=qu(rf),af=qu((function(n){var t=n.length,u=t>1?n[t-1]:r;return u="function"==typeof u?(n.pop(),u):r,tf(n,u)}));function vf(n){var r=Lt(n);return r.__chain__=!0,r}function lf(n,r){return r(n)}var sf=Qe((function(n){var t=n.length,u=t?n[0]:0,e=this.__wrapped__,i=function(r){return uu(r,n)};return!(t>1||this.__actions__.length)&&e instanceof Zt&&pi(u)?((e=e.slice(u,+u+(t?1:0))).__actions__.push({func:lf,args:[i],thisArg:r}),new Nt(e,this.__chain__).thru((function(n){return t&&!n.length&&n.push(r),n}))):this.thru(i)})),hf=$e((function(n,r,t){Dn.call(n,t)?++n[t]:tu(n,t,1)})),pf=Fe(Ni),yf=Fe(Zi);function wf(n,r){return(Wf(n)?Rr:au)(n,ei(r,3))}function bf(n,r){return(Wf(n)?Er:vu)(n,ei(r,3))}var gf=$e((function(n,r,t){Dn.call(n,t)?n[t].push(r):tu(n,t,[r])})),_f=qu((function(n,r,t){var u=-1,e="function"==typeof r,i=Bf(n)?un(n.length):[];return au(n,(function(n){i[++u]=e?mr(r,n,t):$u(n,r,t)})),i})),df=$e((function(n,r,t){tu(n,t,r)}));function jf(n,r){return(Wf(n)?Sr:Tu)(n,ei(r,3))}var xf=$e((function(n,r,t){n[t?0:1].push(r)}),(function(){return[[],[]]})),mf=qu((function(n,r){if(null==n)return[];var t=r.length;return t>1&&yi(n,r[0],r[1])?r=[]:t>2&&yi(r[0],r[1],r[2])&&(r=[r[0]]),Nu(n,pu(r,1),[])})),Af=ar||function(){return lr.Date.now()};function Rf(n,t,u){return t=u?r:t,Ve(n,c,r,r,r,r,t=n&&null==t?n.length:t)}function Ef(n,t){var u;if("function"!=typeof t)throw new Un(e);return n=so(n),function(){return--n>0&&(u=t.apply(this,arguments)),n<=1&&(t=r),u}}var $f=qu((function(n,r,t){var u=1;if(t.length){var e=ft(t,ui($f));u|=o}return Ve(n,u,r,t,e)})),Uf=qu((function(n,r,t){var u=3;if(t.length){var e=ft(t,ui(Uf));u|=o}return Ve(r,u,n,t,e)}));function kf(n,t,u){var i,f,o,c,a,v,l=0,s=!1,h=!1,p=!0;if("function"!=typeof n)throw new Un(e);function y(t){var u=i,e=f;return i=f=r,l=t,c=n.apply(e,u)}function w(n){var u=n-v;return v===r||u>=t||u<0||h&&n-l>=o}function b(){var n=Af();if(w(n))return g(n);a=Ei(b,function(n){var r=t-(n-v);return h?wt(r,o-(n-l)):r}(n))}function g(n){return a=r,p&&i?y(n):(i=f=r,c)}function _(){var n=Af(),u=w(n);if(i=arguments,f=this,v=n,u){if(a===r)return function(n){return l=n,a=Ei(b,t),s?y(n):c}(v);if(h)return ge(a),a=Ei(b,t),y(v)}return a===r&&(a=Ei(b,t)),c}return t=po(t)||0,Qf(u)&&(s=!!u.leading,o=(h="maxWait"in u)?yt(po(u.maxWait)||0,t):o,p="trailing"in u?!!u.trailing:p),_.cancel=function(){a!==r&&ge(a),l=0,i=v=f=a=r},_.flush=function(){return a===r?c:g(Af())},_}var If=qu((function(n,r){return ou(n,1,r)})),Sf=qu((function(n,r,t){return ou(n,po(r)||0,t)}));function Of(n,r){if("function"!=typeof n||null!=r&&"function"!=typeof r)throw new Un(e);var t=function(){var u=arguments,e=r?r.apply(this,u):u[0],i=t.cache;if(i.has(e))return i.get(e);var f=n.apply(this,u);return t.cache=i.set(e,f)||i,f};return t.cache=new(Of.Cache||Bt),t}function Df(n){if("function"!=typeof n)throw new Un(e);return function(){var r=arguments;switch(r.length){case 0:return!n.call(this);case 1:return!n.call(this,r[0]);case 2:return!n.call(this,r[0],r[1]);case 3:return!n.call(this,r[0],r[1],r[2])}return!n.apply(this,r)}}Of.Cache=Bt;var Ff=we((function(n,r){var t=(r=1==r.length&&Wf(r[0])?Sr(r[0],Kr(ei())):Sr(pu(r,1),Kr(ei()))).length;return qu((function(u){for(var e=-1,i=wt(u.length,t);++e<i;)u[e]=r[e].call(this,u[e]);return mr(n,this,u)}))})),Tf=qu((function(n,t){var u=ft(t,ui(Tf));return Ve(n,o,r,t,u)})),zf=qu((function(n,t){var u=ft(t,ui(zf));return Ve(n,64,r,t,u)})),Lf=Qe((function(n,t){return Ve(n,256,r,r,r,t)}));function Cf(n,r){return n===r||n!=n&&r!=r}var Mf=We(mu),Nf=We((function(n,r){return n>=r})),Zf=Uu(function(){return arguments}())?Uu:function(n){return Xf(n)&&Dn.call(n,"callee")&&!qn.call(n,"callee")},Wf=un.isArray,Pf=br?Kr(br):function(n){return Xf(n)&&xu(n)==I};function Bf(n){return null!=n&&Jf(n.length)&&!Kf(n)}function Gf(n){return Xf(n)&&Bf(n)}var qf=wr||yc,Vf=gr?Kr(gr):function(n){return Xf(n)&&xu(n)==b};function Hf(n){if(!Xf(n))return!1;var r=xu(n);return r==g||"[object DOMException]"==r||"string"==typeof n.message&&"string"==typeof n.name&&!to(n)}function Kf(n){if(!Qf(n))return!1;var r=xu(n);return r==_||r==d||"[object AsyncFunction]"==r||"[object Proxy]"==r}function Yf(n){return"number"==typeof n&&n==so(n)}function Jf(n){return"number"==typeof n&&n>-1&&n%1==0&&n<=v}function Qf(n){var r=typeof n;return null!=n&&("object"==r||"function"==r)}function Xf(n){return null!=n&&"object"==typeof n}var no=_r?Kr(_r):function(n){return Xf(n)&&vi(n)==j};function ro(n){return"number"==typeof n||Xf(n)&&xu(n)==x}function to(n){if(!Xf(n)||xu(n)!=m)return!1;var r=Bn(n);if(null===r)return!0;var t=Dn.call(r,"constructor")&&r.constructor;return"function"==typeof t&&t instanceof t&&On.call(t)==Ln}var uo=dr?Kr(dr):function(n){return Xf(n)&&xu(n)==R},eo=jr?Kr(jr):function(n){return Xf(n)&&vi(n)==E};function io(n){return"string"==typeof n||!Wf(n)&&Xf(n)&&xu(n)==$}function fo(n){return"symbol"==typeof n||Xf(n)&&xu(n)==U}var oo=xr?Kr(xr):function(n){return Xf(n)&&Jf(n.length)&&!!er[xu(n)]},co=We(Fu),ao=We((function(n,r){return n<=r}));function vo(n){if(!n)return[];if(Bf(n))return io(n)?vt(n):Re(n);if(Kn&&n[Kn])return function(n){for(var r,t=[];!(r=n.next()).done;)t.push(r.value);return t}(n[Kn]());var r=vi(n);return(r==j?et:r==E?ot:Mo)(n)}function lo(n){return n?(n=po(n))===a||n===-1/0?17976931348623157e292*(n<0?-1:1):n==n?n:0:0===n?n:0}function so(n){var r=lo(n),t=r%1;return r==r?t?r-t:r:0}function ho(n){return n?eu(so(n),0,s):0}function po(n){if("number"==typeof n)return n;if(fo(n))return l;if(Qf(n)){var r="function"==typeof n.valueOf?n.valueOf():n;n=Qf(r)?r+"":r}if("string"!=typeof n)return 0===n?n:+n;n=Hr(n);var t=pn.test(n);return t||wn.test(n)?cr(n.slice(2),t?2:8):hn.test(n)?l:+n}function yo(n){return Ee(n,So(n))}function wo(n){return null==n?"":ie(n)}var bo=Ue((function(n,r){if(_i(r)||Bf(r))Ee(r,Io(r),n);else for(var t in r)Dn.call(r,t)&&Qt(n,t,r[t])})),go=Ue((function(n,r){Ee(r,So(r),n)})),_o=Ue((function(n,r,t,u){Ee(r,So(r),n,u)})),jo=Ue((function(n,r,t,u){Ee(r,Io(r),n,u)})),xo=Qe(uu),mo=qu((function(n,t){n=Rn(n);var u=-1,e=t.length,i=e>2?t[2]:r;for(i&&yi(t[0],t[1],i)&&(e=1);++u<e;)for(var f=t[u],o=So(f),c=-1,a=o.length;++c<a;){var v=o[c],l=n[v];(l===r||Cf(l,In[v])&&!Dn.call(n,v))&&(n[v]=f[v])}return n})),Ao=qu((function(n){return n.push(r,Ke),mr(Do,r,n)}));function Ro(n,t,u){var e=null==n?r:du(n,t);return e===r?u:e}function Eo(n,r){return null!=n&&li(n,r,Ru)}var $o=Le((function(n,r,t){null!=r&&"function"!=typeof r.toString&&(r=zn.call(r)),n[r]=t}),Xo(tc)),Uo=Le((function(n,r,t){null!=r&&"function"!=typeof r.toString&&(r=zn.call(r)),Dn.call(n,r)?n[r].push(t):n[r]=[t]}),ei),ko=qu($u);function Io(n){return Bf(n)?Vt(n):Du(n)}function So(n){return Bf(n)?Vt(n,!0):function(n){if(!Qf(n))return function(n){var r=[];if(null!=n)for(var t in Rn(n))r.push(t);return r}(n);var r=_i(n),t=[];for(var u in n)("constructor"!=u||!r&&Dn.call(n,u))&&t.push(u);return t}(n)}var Oo=Ue((function(n,r,t){Cu(n,r,t)})),Do=Ue((function(n,r,t,u){Cu(n,r,t,u)})),Fo=Qe((function(n,r){var t={};if(null==n)return t;var u=!1;r=Sr(r,(function(r){return r=ye(r,n),u||(u=r.length>1),r})),Ee(n,ni(n),t),u&&(t=iu(t,7,Ye));for(var e=r.length;e--;)oe(t,r[e]);return t})),To=Qe((function(n,r){return null==n?{}:function(n,r){return Zu(n,r,(function(r,t){return Eo(n,t)}))}(n,r)}));function zo(n,r){if(null==n)return{};var t=Sr(ni(n),(function(n){return[n]}));return r=ei(r),Zu(n,t,(function(n,t){return r(n,t[0])}))}var Lo=qe(Io),Co=qe(So);function Mo(n){return null==n?[]:Yr(n,Io(n))}var No=Oe((function(n,r,t){return r=r.toLowerCase(),n+(t?Zo(r):r)}));function Zo(n){return Ko(wo(n).toLowerCase())}function Wo(n){return(n=wo(n))&&n.replace(gn,nt).replace(Jn,"")}var Po=Oe((function(n,r,t){return n+(t?"-":"")+r.toLowerCase()})),Bo=Oe((function(n,r,t){return n+(t?" ":"")+r.toLowerCase()})),Go=Se("toLowerCase"),qo=Oe((function(n,r,t){return n+(t?"_":"")+r.toLowerCase()})),Vo=Oe((function(n,r,t){return n+(t?" ":"")+Ko(r)})),Ho=Oe((function(n,r,t){return n+(t?" ":"")+r.toUpperCase()})),Ko=Se("toUpperCase");function Yo(n,t,u){return n=wo(n),(t=u?r:t)===r?function(n){return rr.test(n)}(n)?function(n){return n.match(Xn)||[]}(n):function(n){return n.match(cn)||[]}(n):n.match(t)||[]}var Jo=qu((function(n,t){try{return mr(n,r,t)}catch(n){return Hf(n)?n:new xn(n)}})),Qo=Qe((function(n,r){return Rr(r,(function(r){r=Fi(r),tu(n,r,$f(n[r],n))})),n}));function Xo(n){return function(){return n}}var nc=Te(),rc=Te(!0);function tc(n){return n}function uc(n){return Ou("function"==typeof n?n:iu(n,1))}var ec=qu((function(n,r){return function(t){return $u(t,n,r)}})),ic=qu((function(n,r){return function(t){return $u(n,t,r)}}));function fc(n,r,t){var u=Io(r),e=_u(r,u);null!=t||Qf(r)&&(e.length||!u.length)||(t=r,r=n,n=this,e=_u(r,Io(r)));var i=!(Qf(t)&&"chain"in t&&!t.chain),f=Kf(n);return Rr(e,(function(t){var u=r[t];n[t]=u,f&&(n.prototype[t]=function(){var r=this.__chain__;if(i||r){var t=n(this.__wrapped__);return(t.__actions__=Re(this.__actions__)).push({func:u,args:arguments,thisArg:n}),t.__chain__=r,t}return u.apply(n,Or([this.value()],arguments))})})),n}function oc(){}var cc=Me(Sr),ac=Me($r),vc=Me(Tr);function lc(n){return wi(n)?Pr(Fi(n)):function(n){return function(r){return du(r,n)}}(n)}var sc=Ze(),hc=Ze(!0);function pc(){return[]}function yc(){return!1}var wc,bc=Ce((function(n,r){return n+r}),0),gc=Be("ceil"),_c=Ce((function(n,r){return n/r}),1),dc=Be("floor"),jc=Ce((function(n,r){return n*r}),1),xc=Be("round"),mc=Ce((function(n,r){return n-r}),0);return Lt.after=function(n,r){if("function"!=typeof r)throw new Un(e);return n=so(n),function(){if(--n<1)return r.apply(this,arguments)}},Lt.ary=Rf,Lt.assign=bo,Lt.assignIn=go,Lt.assignInWith=_o,Lt.assignWith=jo,Lt.at=xo,Lt.before=Ef,Lt.bind=$f,Lt.bindAll=Qo,Lt.bindKey=Uf,Lt.castArray=function(){if(!arguments.length)return[];var n=arguments[0];return Wf(n)?n:[n]},Lt.chain=vf,Lt.chunk=function(n,t,u){t=(u?yi(n,t,u):t===r)?1:yt(so(t),0);var e=null==n?0:n.length;if(!e||t<1)return[];for(var i=0,f=0,o=un(sr(e/t));i<e;)o[f++]=Xu(n,i,i+=t);return o},Lt.compact=function(n){for(var r=-1,t=null==n?0:n.length,u=0,e=[];++r<t;){var i=n[r];i&&(e[u++]=i)}return e},Lt.concat=function(){var n=arguments.length;if(!n)return[];for(var r=un(n-1),t=arguments[0],u=n;u--;)r[u-1]=arguments[u];return Or(Wf(t)?Re(t):[t],pu(r,1))},Lt.cond=function(n){var r=null==n?0:n.length,t=ei();return n=r?Sr(n,(function(n){if("function"!=typeof n[1])throw new Un(e);return[t(n[0]),n[1]]})):[],qu((function(t){for(var u=-1;++u<r;){var e=n[u];if(mr(e[0],this,t))return mr(e[1],this,t)}}))},Lt.conforms=function(n){return function(n){var r=Io(n);return function(t){return fu(t,n,r)}}(iu(n,1))},Lt.constant=Xo,Lt.countBy=hf,Lt.create=function(n,r){var t=Ct(n);return null==r?t:ru(t,r)},Lt.curry=function n(t,u,e){var i=Ve(t,8,r,r,r,r,r,u=e?r:u);return i.placeholder=n.placeholder,i},Lt.curryRight=function n(t,u,e){var i=Ve(t,16,r,r,r,r,r,u=e?r:u);return i.placeholder=n.placeholder,i},Lt.debounce=kf,Lt.defaults=mo,Lt.defaultsDeep=Ao,Lt.defer=If,Lt.delay=Sf,Lt.difference=Li,Lt.differenceBy=Ci,Lt.differenceWith=Mi,Lt.drop=function(n,t,u){var e=null==n?0:n.length;return e?Xu(n,(t=u||t===r?1:so(t))<0?0:t,e):[]},Lt.dropRight=function(n,t,u){var e=null==n?0:n.length;return e?Xu(n,0,(t=e-(t=u||t===r?1:so(t)))<0?0:t):[]},Lt.dropRightWhile=function(n,r){return n&&n.length?ae(n,ei(r,3),!0,!0):[]},Lt.dropWhile=function(n,r){return n&&n.length?ae(n,ei(r,3),!0):[]},Lt.fill=function(n,t,u,e){var i=null==n?0:n.length;return i?(u&&"number"!=typeof u&&yi(n,t,u)&&(u=0,e=i),function(n,t,u,e){var i=n.length;for((u=so(u))<0&&(u=-u>i?0:i+u),(e=e===r||e>i?i:so(e))<0&&(e+=i),e=u>e?0:ho(e);u<e;)n[u++]=t;return n}(n,t,u,e)):[]},Lt.filter=function(n,r){return(Wf(n)?Ur:hu)(n,ei(r,3))},Lt.flatMap=function(n,r){return pu(jf(n,r),1)},Lt.flatMapDeep=function(n,r){return pu(jf(n,r),a)},Lt.flatMapDepth=function(n,t,u){return u=u===r?1:so(u),pu(jf(n,t),u)},Lt.flatten=Wi,Lt.flattenDeep=function(n){return null!=n&&n.length?pu(n,a):[]},Lt.flattenDepth=function(n,t){return null!=n&&n.length?pu(n,t=t===r?1:so(t)):[]},Lt.flip=function(n){return Ve(n,512)},Lt.flow=nc,Lt.flowRight=rc,Lt.fromPairs=function(n){for(var r=-1,t=null==n?0:n.length,u={};++r<t;){var e=n[r];u[e[0]]=e[1]}return u},Lt.functions=function(n){return null==n?[]:_u(n,Io(n))},Lt.functionsIn=function(n){return null==n?[]:_u(n,So(n))},Lt.groupBy=gf,Lt.initial=function(n){return null!=n&&n.length?Xu(n,0,-1):[]},Lt.intersection=Bi,Lt.intersectionBy=Gi,Lt.intersectionWith=qi,Lt.invert=$o,Lt.invertBy=Uo,Lt.invokeMap=_f,Lt.iteratee=uc,Lt.keyBy=df,Lt.keys=Io,Lt.keysIn=So,Lt.map=jf,Lt.mapKeys=function(n,r){var t={};return r=ei(r,3),bu(n,(function(n,u,e){tu(t,r(n,u,e),n)})),t},Lt.mapValues=function(n,r){var t={};return r=ei(r,3),bu(n,(function(n,u,e){tu(t,u,r(n,u,e))})),t},Lt.matches=function(n){return zu(iu(n,1))},Lt.matchesProperty=function(n,r){return Lu(n,iu(r,1))},Lt.memoize=Of,Lt.merge=Oo,Lt.mergeWith=Do,Lt.method=ec,Lt.methodOf=ic,Lt.mixin=fc,Lt.negate=Df,Lt.nthArg=function(n){return n=so(n),qu((function(r){return Mu(r,n)}))},Lt.omit=Fo,Lt.omitBy=function(n,r){return zo(n,Df(ei(r)))},Lt.once=function(n){return Ef(2,n)},Lt.orderBy=function(n,t,u,e){return null==n?[]:(Wf(t)||(t=null==t?[]:[t]),Wf(u=e?r:u)||(u=null==u?[]:[u]),Nu(n,t,u))},Lt.over=cc,Lt.overArgs=Ff,Lt.overEvery=ac,Lt.overSome=vc,Lt.partial=Tf,Lt.partialRight=zf,Lt.partition=xf,Lt.pick=To,Lt.pickBy=zo,Lt.property=lc,Lt.propertyOf=function(n){return function(t){return null==n?r:du(n,t)}},Lt.pull=Hi,Lt.pullAll=Ki,Lt.pullAllBy=function(n,r,t){return n&&n.length&&r&&r.length?Wu(n,r,ei(t,2)):n},Lt.pullAllWith=function(n,t,u){return n&&n.length&&t&&t.length?Wu(n,t,r,u):n},Lt.pullAt=Yi,Lt.range=sc,Lt.rangeRight=hc,Lt.rearg=Lf,Lt.reject=function(n,r){return(Wf(n)?Ur:hu)(n,Df(ei(r,3)))},Lt.remove=function(n,r){var t=[];if(!n||!n.length)return t;var u=-1,e=[],i=n.length;for(r=ei(r,3);++u<i;){var f=n[u];r(f,u,n)&&(t.push(f),e.push(u))}return Pu(n,e),t},Lt.rest=function(n,t){if("function"!=typeof n)throw new Un(e);return qu(n,t=t===r?t:so(t))},Lt.reverse=Ji,Lt.sampleSize=function(n,t,u){return t=(u?yi(n,t,u):t===r)?1:so(t),(Wf(n)?Kt:Hu)(n,t)},Lt.set=function(n,r,t){return null==n?n:Ku(n,r,t)},Lt.setWith=function(n,t,u,e){return e="function"==typeof e?e:r,null==n?n:Ku(n,t,u,e)},Lt.shuffle=function(n){return(Wf(n)?Yt:Qu)(n)},Lt.slice=function(n,t,u){var e=null==n?0:n.length;return e?(u&&"number"!=typeof u&&yi(n,t,u)?(t=0,u=e):(t=null==t?0:so(t),u=u===r?e:so(u)),Xu(n,t,u)):[]},Lt.sortBy=mf,Lt.sortedUniq=function(n){return n&&n.length?ue(n):[]},Lt.sortedUniqBy=function(n,r){return n&&n.length?ue(n,ei(r,2)):[]},Lt.split=function(n,t,u){return u&&"number"!=typeof u&&yi(n,t,u)&&(t=u=r),(u=u===r?s:u>>>0)?(n=wo(n))&&("string"==typeof t||null!=t&&!uo(t))&&!(t=ie(t))&&ut(n)?be(vt(n),0,u):n.split(t,u):[]},Lt.spread=function(n,r){if("function"!=typeof n)throw new Un(e);return r=null==r?0:yt(so(r),0),qu((function(t){var u=t[r],e=be(t,0,r);return u&&Or(e,u),mr(n,this,e)}))},Lt.tail=function(n){var r=null==n?0:n.length;return r?Xu(n,1,r):[]},Lt.take=function(n,t,u){return n&&n.length?Xu(n,0,(t=u||t===r?1:so(t))<0?0:t):[]},Lt.takeRight=function(n,t,u){var e=null==n?0:n.length;return e?Xu(n,(t=e-(t=u||t===r?1:so(t)))<0?0:t,e):[]},Lt.takeRightWhile=function(n,r){return n&&n.length?ae(n,ei(r,3),!1,!0):[]},Lt.takeWhile=function(n,r){return n&&n.length?ae(n,ei(r,3)):[]},Lt.tap=function(n,r){return r(n),n},Lt.throttle=function(n,r,t){var u=!0,i=!0;if("function"!=typeof n)throw new Un(e);return Qf(t)&&(u="leading"in t?!!t.leading:u,i="trailing"in t?!!t.trailing:i),kf(n,r,{leading:u,maxWait:r,trailing:i})},Lt.thru=lf,Lt.toArray=vo,Lt.toPairs=Lo,Lt.toPairsIn=Co,Lt.toPath=function(n){return Wf(n)?Sr(n,Fi):fo(n)?[n]:Re(Di(wo(n)))},Lt.toPlainObject=yo,Lt.transform=function(n,r,t){var u=Wf(n),e=u||qf(n)||oo(n);if(r=ei(r,4),null==t){var i=n&&n.constructor;t=e?u?new i:[]:Qf(n)&&Kf(i)?Ct(Bn(n)):{}}return(e?Rr:bu)(n,(function(n,u,e){return r(t,n,u,e)})),t},Lt.unary=function(n){return Rf(n,1)},Lt.union=Qi,Lt.unionBy=Xi,Lt.unionWith=nf,Lt.uniq=function(n){return n&&n.length?fe(n):[]},Lt.uniqBy=function(n,r){return n&&n.length?fe(n,ei(r,2)):[]},Lt.uniqWith=function(n,t){return t="function"==typeof t?t:r,n&&n.length?fe(n,r,t):[]},Lt.unset=function(n,r){return null==n||oe(n,r)},Lt.unzip=rf,Lt.unzipWith=tf,Lt.update=function(n,r,t){return null==n?n:ce(n,r,pe(t))},Lt.updateWith=function(n,t,u,e){return e="function"==typeof e?e:r,null==n?n:ce(n,t,pe(u),e)},Lt.values=Mo,Lt.valuesIn=function(n){return null==n?[]:Yr(n,So(n))},Lt.without=uf,Lt.words=Yo,Lt.wrap=function(n,r){return Tf(pe(r),n)},Lt.xor=ef,Lt.xorBy=ff,Lt.xorWith=of,Lt.zip=cf,Lt.zipObject=function(n,r){return se(n||[],r||[],Qt)},Lt.zipObjectDeep=function(n,r){return se(n||[],r||[],Ku)},Lt.zipWith=af,Lt.entries=Lo,Lt.entriesIn=Co,Lt.extend=go,Lt.extendWith=_o,fc(Lt,Lt),Lt.add=bc,Lt.attempt=Jo,Lt.camelCase=No,Lt.capitalize=Zo,Lt.ceil=gc,Lt.clamp=function(n,t,u){return u===r&&(u=t,t=r),u!==r&&(u=(u=po(u))==u?u:0),t!==r&&(t=(t=po(t))==t?t:0),eu(po(n),t,u)},Lt.clone=function(n){return iu(n,4)},Lt.cloneDeep=function(n){return iu(n,5)},Lt.cloneDeepWith=function(n,t){return iu(n,5,t="function"==typeof t?t:r)},Lt.cloneWith=function(n,t){return iu(n,4,t="function"==typeof t?t:r)},Lt.conformsTo=function(n,r){return null==r||fu(n,r,Io(r))},Lt.deburr=Wo,Lt.defaultTo=function(n,r){return null==n||n!=n?r:n},Lt.divide=_c,Lt.endsWith=function(n,t,u){n=wo(n),t=ie(t);var e=n.length,i=u=u===r?e:eu(so(u),0,e);return(u-=t.length)>=0&&n.slice(u,i)==t},Lt.eq=Cf,Lt.escape=function(n){return(n=wo(n))&&V.test(n)?n.replace(G,rt):n},Lt.escapeRegExp=function(n){return(n=wo(n))&&rn.test(n)?n.replace(nn,"\\$&"):n},Lt.every=function(n,t,u){var e=Wf(n)?$r:lu;return u&&yi(n,t,u)&&(t=r),e(n,ei(t,3))},Lt.find=pf,Lt.findIndex=Ni,Lt.findKey=function(n,r){return Lr(n,ei(r,3),bu)},Lt.findLast=yf,Lt.findLastIndex=Zi,Lt.findLastKey=function(n,r){return Lr(n,ei(r,3),gu)},Lt.floor=dc,Lt.forEach=wf,Lt.forEachRight=bf,Lt.forIn=function(n,r){return null==n?n:yu(n,ei(r,3),So)},Lt.forInRight=function(n,r){return null==n?n:wu(n,ei(r,3),So)},Lt.forOwn=function(n,r){return n&&bu(n,ei(r,3))},Lt.forOwnRight=function(n,r){return n&&gu(n,ei(r,3))},Lt.get=Ro,Lt.gt=Mf,Lt.gte=Nf,Lt.has=function(n,r){return null!=n&&li(n,r,Au)},Lt.hasIn=Eo,Lt.head=Pi,Lt.identity=tc,Lt.includes=function(n,r,t,u){n=Bf(n)?n:Mo(n),t=t&&!u?so(t):0;var e=n.length;return t<0&&(t=yt(e+t,0)),io(n)?t<=e&&n.indexOf(r,t)>-1:!!e&&Mr(n,r,t)>-1},Lt.indexOf=function(n,r,t){var u=null==n?0:n.length;if(!u)return-1;var e=null==t?0:so(t);return e<0&&(e=yt(u+e,0)),Mr(n,r,e)},Lt.inRange=function(n,t,u){return t=lo(t),u===r?(u=t,t=0):u=lo(u),function(n,r,t){return n>=wt(r,t)&&n<yt(r,t)}(n=po(n),t,u)},Lt.invoke=ko,Lt.isArguments=Zf,Lt.isArray=Wf,Lt.isArrayBuffer=Pf,Lt.isArrayLike=Bf,Lt.isArrayLikeObject=Gf,Lt.isBoolean=function(n){return!0===n||!1===n||Xf(n)&&xu(n)==w},Lt.isBuffer=qf,Lt.isDate=Vf,Lt.isElement=function(n){return Xf(n)&&1===n.nodeType&&!to(n)},Lt.isEmpty=function(n){if(null==n)return!0;if(Bf(n)&&(Wf(n)||"string"==typeof n||"function"==typeof n.splice||qf(n)||oo(n)||Zf(n)))return!n.length;var r=vi(n);if(r==j||r==E)return!n.size;if(_i(n))return!Du(n).length;for(var t in n)if(Dn.call(n,t))return!1;return!0},Lt.isEqual=function(n,r){return ku(n,r)},Lt.isEqualWith=function(n,t,u){var e=(u="function"==typeof u?u:r)?u(n,t):r;return e===r?ku(n,t,r,u):!!e},Lt.isError=Hf,Lt.isFinite=function(n){return"number"==typeof n&&zr(n)},Lt.isFunction=Kf,Lt.isInteger=Yf,Lt.isLength=Jf,Lt.isMap=no,Lt.isMatch=function(n,r){return n===r||Iu(n,r,fi(r))},Lt.isMatchWith=function(n,t,u){return u="function"==typeof u?u:r,Iu(n,t,fi(t),u)},Lt.isNaN=function(n){return ro(n)&&n!=+n},Lt.isNative=function(n){if(gi(n))throw new xn("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Su(n)},Lt.isNil=function(n){return null==n},Lt.isNull=function(n){return null===n},Lt.isNumber=ro,Lt.isObject=Qf,Lt.isObjectLike=Xf,Lt.isPlainObject=to,Lt.isRegExp=uo,Lt.isSafeInteger=function(n){return Yf(n)&&n>=-9007199254740991&&n<=v},Lt.isSet=eo,Lt.isString=io,Lt.isSymbol=fo,Lt.isTypedArray=oo,Lt.isUndefined=function(n){return n===r},Lt.isWeakMap=function(n){return Xf(n)&&vi(n)==k},Lt.isWeakSet=function(n){return Xf(n)&&"[object WeakSet]"==xu(n)},Lt.join=function(n,r){return null==n?"":Br.call(n,r)},Lt.kebabCase=Po,Lt.last=Vi,Lt.lastIndexOf=function(n,t,u){var e=null==n?0:n.length;if(!e)return-1;var i=e;return u!==r&&(i=(i=so(u))<0?yt(e+i,0):wt(i,e-1)),t==t?function(n,r,t){for(var u=t+1;u--;)if(n[u]===r)return u;return u}(n,t,i):Cr(n,Zr,i,!0)},Lt.lowerCase=Bo,Lt.lowerFirst=Go,Lt.lt=co,Lt.lte=ao,Lt.max=function(n){return n&&n.length?su(n,tc,mu):r},Lt.maxBy=function(n,t){return n&&n.length?su(n,ei(t,2),mu):r},Lt.mean=function(n){return Wr(n,tc)},Lt.meanBy=function(n,r){return Wr(n,ei(r,2))},Lt.min=function(n){return n&&n.length?su(n,tc,Fu):r},Lt.minBy=function(n,t){return n&&n.length?su(n,ei(t,2),Fu):r},Lt.stubArray=pc,Lt.stubFalse=yc,Lt.stubObject=function(){return{}},Lt.stubString=function(){return""},Lt.stubTrue=function(){return!0},Lt.multiply=jc,Lt.nth=function(n,t){return n&&n.length?Mu(n,so(t)):r},Lt.noConflict=function(){return lr._===this&&(lr._=Cn),this},Lt.noop=oc,Lt.now=Af,Lt.pad=function(n,r,t){n=wo(n);var u=(r=so(r))?at(n):0;if(!r||u>=r)return n;var e=(r-u)/2;return Ne(hr(e),t)+n+Ne(sr(e),t)},Lt.padEnd=function(n,r,t){n=wo(n);var u=(r=so(r))?at(n):0;return r&&u<r?n+Ne(r-u,t):n},Lt.padStart=function(n,r,t){n=wo(n);var u=(r=so(r))?at(n):0;return r&&u<r?Ne(r-u,t)+n:n},Lt.parseInt=function(n,r,t){return t||null==r?r=0:r&&(r=+r),gt(wo(n).replace(tn,""),r||0)},Lt.random=function(n,t,u){if(u&&"boolean"!=typeof u&&yi(n,t,u)&&(t=u=r),u===r&&("boolean"==typeof t?(u=t,t=r):"boolean"==typeof n&&(u=n,n=r)),n===r&&t===r?(n=0,t=1):(n=lo(n),t===r?(t=n,n=0):t=lo(t)),n>t){var e=n;n=t,t=e}if(u||n%1||t%1){var i=_t();return wt(n+i*(t-n+or("1e-"+((i+"").length-1))),t)}return Bu(n,t)},Lt.reduce=function(n,r,t){var u=Wf(n)?Dr:Gr,e=arguments.length<3;return u(n,ei(r,4),t,e,au)},Lt.reduceRight=function(n,r,t){var u=Wf(n)?Fr:Gr,e=arguments.length<3;return u(n,ei(r,4),t,e,vu)},Lt.repeat=function(n,t,u){return t=(u?yi(n,t,u):t===r)?1:so(t),Gu(wo(n),t)},Lt.replace=function(){var n=arguments,r=wo(n[0]);return n.length<3?r:r.replace(n[1],n[2])},Lt.result=function(n,t,u){var e=-1,i=(t=ye(t,n)).length;for(i||(i=1,n=r);++e<i;){var f=null==n?r:n[Fi(t[e])];f===r&&(e=i,f=u),n=Kf(f)?f.call(n):f}return n},Lt.round=xc,Lt.runInContext=n,Lt.sample=function(n){return(Wf(n)?Ht:Vu)(n)},Lt.size=function(n){if(null==n)return 0;if(Bf(n))return io(n)?at(n):n.length;var r=vi(n);return r==j||r==E?n.size:Du(n).length},Lt.snakeCase=qo,Lt.some=function(n,t,u){var e=Wf(n)?Tr:ne;return u&&yi(n,t,u)&&(t=r),e(n,ei(t,3))},Lt.sortedIndex=function(n,r){return re(n,r)},Lt.sortedIndexBy=function(n,r,t){return te(n,r,ei(t,2))},Lt.sortedIndexOf=function(n,r){var t=null==n?0:n.length;if(t){var u=re(n,r);if(u<t&&Cf(n[u],r))return u}return-1},Lt.sortedLastIndex=function(n,r){return re(n,r,!0)},Lt.sortedLastIndexBy=function(n,r,t){return te(n,r,ei(t,2),!0)},Lt.sortedLastIndexOf=function(n,r){if(null!=n&&n.length){var t=re(n,r,!0)-1;if(Cf(n[t],r))return t}return-1},Lt.startCase=Vo,Lt.startsWith=function(n,r,t){return n=wo(n),t=null==t?0:eu(so(t),0,n.length),r=ie(r),n.slice(t,t+r.length)==r},Lt.subtract=mc,Lt.sum=function(n){return n&&n.length?qr(n,tc):0},Lt.sumBy=function(n,r){return n&&n.length?qr(n,ei(r,2)):0},Lt.template=function(n,t,u){var e=Lt.templateSettings;u&&yi(n,t,u)&&(t=r),n=wo(n),t=_o({},t,e,He);var i,f,o=_o({},t.imports,e.imports,He),c=Io(o),a=Yr(o,c),v=0,l=t.interpolate||_n,s="__p += '",h=En((t.escape||_n).source+"|"+l.source+"|"+(l===Y?ln:_n).source+"|"+(t.evaluate||_n).source+"|$","g"),p="//# sourceURL="+(Dn.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++ur+"]")+"\n";n.replace(h,(function(r,t,u,e,o,c){return u||(u=e),s+=n.slice(v,c).replace(dn,tt),t&&(i=!0,s+="' +\n__e("+t+") +\n'"),o&&(f=!0,s+="';\n"+o+";\n__p += '"),u&&(s+="' +\n((__t = ("+u+")) == null ? '' : __t) +\n'"),v=c+r.length,r})),s+="';\n";var y=Dn.call(t,"variable")&&t.variable;if(y){if(an.test(y))throw new xn("Invalid `variable` option passed into `_.template`")}else s="with (obj) {\n"+s+"\n}\n";s=(f?s.replace(Z,""):s).replace(W,"$1").replace(P,"$1;"),s="function("+(y||"obj")+") {\n"+(y?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(i?", __e = _.escape":"")+(f?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+s+"return __p\n}";var w=Jo((function(){return mn(c,p+"return "+s).apply(r,a)}));if(w.source=s,Hf(w))throw w;return w},Lt.times=function(n,r){if((n=so(n))<1||n>v)return[];var t=s,u=wt(n,s);r=ei(r),n-=s;for(var e=Vr(u,r);++t<n;)r(t);return e},Lt.toFinite=lo,Lt.toInteger=so,Lt.toLength=ho,Lt.toLower=function(n){return wo(n).toLowerCase()},Lt.toNumber=po,Lt.toSafeInteger=function(n){return n?eu(so(n),-9007199254740991,v):0===n?n:0},Lt.toString=wo,Lt.toUpper=function(n){return wo(n).toUpperCase()},Lt.trim=function(n,t,u){if((n=wo(n))&&(u||t===r))return Hr(n);if(!n||!(t=ie(t)))return n;var e=vt(n),i=vt(t);return be(e,Qr(e,i),Xr(e,i)+1).join("")},Lt.trimEnd=function(n,t,u){if((n=wo(n))&&(u||t===r))return n.slice(0,lt(n)+1);if(!n||!(t=ie(t)))return n;var e=vt(n);return be(e,0,Xr(e,vt(t))+1).join("")},Lt.trimStart=function(n,t,u){if((n=wo(n))&&(u||t===r))return n.replace(tn,"");if(!n||!(t=ie(t)))return n;var e=vt(n);return be(e,Qr(e,vt(t))).join("")},Lt.truncate=function(n,t){var u=30,e="...";if(Qf(t)){var i="separator"in t?t.separator:i;u="length"in t?so(t.length):u,e="omission"in t?ie(t.omission):e}var f=(n=wo(n)).length;if(ut(n)){var o=vt(n);f=o.length}if(u>=f)return n;var c=u-at(e);if(c<1)return e;var a=o?be(o,0,c).join(""):n.slice(0,c);if(i===r)return a+e;if(o&&(c+=a.length-c),uo(i)){if(n.slice(c).search(i)){var v,l=a;for(i.global||(i=En(i.source,wo(sn.exec(i))+"g")),i.lastIndex=0;v=i.exec(l);)var s=v.index;a=a.slice(0,s===r?c:s)}}else if(n.indexOf(ie(i),c)!=c){var h=a.lastIndexOf(i);h>-1&&(a=a.slice(0,h))}return a+e},Lt.unescape=function(n){return(n=wo(n))&&q.test(n)?n.replace(B,st):n},Lt.uniqueId=function(n){var r=++Fn;return wo(n)+r},Lt.upperCase=Ho,Lt.upperFirst=Ko,Lt.each=wf,Lt.eachRight=bf,Lt.first=Pi,fc(Lt,(wc={},bu(Lt,(function(n,r){Dn.call(Lt.prototype,r)||(wc[r]=n)})),wc),{chain:!1}),Lt.VERSION="4.17.23",Rr(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(n){Lt[n].placeholder=Lt})),Rr(["drop","take"],(function(n,t){Zt.prototype[n]=function(u){u=u===r?1:yt(so(u),0);var e=this.__filtered__&&!t?new Zt(this):this.clone();return e.__filtered__?e.__takeCount__=wt(u,e.__takeCount__):e.__views__.push({size:wt(u,s),type:n+(e.__dir__<0?"Right":"")}),e},Zt.prototype[n+"Right"]=function(r){return this.reverse()[n](r).reverse()}})),Rr(["filter","map","takeWhile"],(function(n,r){var t=r+1,u=1==t||3==t;Zt.prototype[n]=function(n){var r=this.clone();return r.__iteratees__.push({iteratee:ei(n,3),type:t}),r.__filtered__=r.__filtered__||u,r}})),Rr(["head","last"],(function(n,r){var t="take"+(r?"Right":"");Zt.prototype[n]=function(){return this[t](1).value()[0]}})),Rr(["initial","tail"],(function(n,r){var t="drop"+(r?"":"Right");Zt.prototype[n]=function(){return this.__filtered__?new Zt(this):this[t](1)}})),Zt.prototype.compact=function(){return this.filter(tc)},Zt.prototype.find=function(n){return this.filter(n).head()},Zt.prototype.findLast=function(n){return this.reverse().find(n)},Zt.prototype.invokeMap=qu((function(n,r){return"function"==typeof n?new Zt(this):this.map((function(t){return $u(t,n,r)}))})),Zt.prototype.reject=function(n){return this.filter(Df(ei(n)))},Zt.prototype.slice=function(n,t){n=so(n);var u=this;return u.__filtered__&&(n>0||t<0)?new Zt(u):(n<0?u=u.takeRight(-n):n&&(u=u.drop(n)),t!==r&&(u=(t=so(t))<0?u.dropRight(-t):u.take(t-n)),u)},Zt.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},Zt.prototype.toArray=function(){return this.take(s)},bu(Zt.prototype,(function(n,t){var u=/^(?:filter|find|map|reject)|While$/.test(t),e=/^(?:head|last)$/.test(t),i=Lt[e?"take"+("last"==t?"Right":""):t],f=e||/^find/.test(t);i&&(Lt.prototype[t]=function(){var t=this.__wrapped__,o=e?[1]:arguments,c=t instanceof Zt,a=o[0],v=c||Wf(t),l=function(n){var r=i.apply(Lt,Or([n],o));return e&&s?r[0]:r};v&&u&&"function"==typeof a&&1!=a.length&&(c=v=!1);var s=this.__chain__,h=f&&!s,p=c&&!this.__actions__.length;if(!f&&v){t=p?t:new Zt(this);var y=n.apply(t,o);return y.__actions__.push({func:lf,args:[l],thisArg:r}),new Nt(y,s)}return h&&p?n.apply(this,o):(y=this.thru(l),h?e?y.value()[0]:y.value():y)})})),Rr(["pop","push","shift","sort","splice","unshift"],(function(n){var r=kn[n],t=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",u=/^(?:pop|shift)$/.test(n);Lt.prototype[n]=function(){var n=arguments;if(u&&!this.__chain__){var e=this.value();return r.apply(Wf(e)?e:[],n)}return this[t]((function(t){return r.apply(Wf(t)?t:[],n)}))}})),bu(Zt.prototype,(function(n,r){var t=Lt[r];if(t){var u=t.name+"";Dn.call(Ut,u)||(Ut[u]=[]),Ut[u].push({name:r,func:t})}})),Ut[ze(r,2).name]=[{name:"wrapper",func:r}],Zt.prototype.clone=function(){var n=new Zt(this.__wrapped__);return n.__actions__=Re(this.__actions__),n.__dir__=this.__dir__,n.__filtered__=this.__filtered__,n.__iteratees__=Re(this.__iteratees__),n.__takeCount__=this.__takeCount__,n.__views__=Re(this.__views__),n},Zt.prototype.reverse=function(){if(this.__filtered__){var n=new Zt(this);n.__dir__=-1,n.__filtered__=!0}else(n=this.clone()).__dir__*=-1;return n},Zt.prototype.value=function(){var n=this.__wrapped__.value(),r=this.__dir__,t=Wf(n),u=r<0,e=t?n.length:0,i=function(n,r,t){for(var u=-1,e=t.length;++u<e;){var i=t[u],f=i.size;switch(i.type){case"drop":n+=f;break;case"dropRight":r-=f;break;case"take":r=wt(r,n+f);break;case"takeRight":n=yt(n,r-f)}}return{start:n,end:r}}(0,e,this.__views__),f=i.start,o=i.end,c=o-f,a=u?o:f-1,v=this.__iteratees__,l=v.length,s=0,h=wt(c,this.__takeCount__);if(!t||!u&&e==c&&h==c)return ve(n,this.__actions__);var p=[];n:for(;c--&&s<h;){for(var y=-1,w=n[a+=r];++y<l;){var b=v[y],g=b.type,_=(0,b.iteratee)(w);if(2==g)w=_;else if(!_){if(1==g)continue n;break n}}p[s++]=w}return p},Lt.prototype.at=sf,Lt.prototype.chain=function(){return vf(this)},Lt.prototype.commit=function(){return new Nt(this.value(),this.__chain__)},Lt.prototype.next=function(){this.__values__===r&&(this.__values__=vo(this.value()));var n=this.__index__>=this.__values__.length;return{done:n,value:n?r:this.__values__[this.__index__++]}},Lt.prototype.plant=function(n){for(var t,u=this;u instanceof Mt;){var e=zi(u);e.__index__=0,e.__values__=r,t?i.__wrapped__=e:t=e;var i=e;u=u.__wrapped__}return i.__wrapped__=n,t},Lt.prototype.reverse=function(){var n=this.__wrapped__;if(n instanceof Zt){var t=n;return this.__actions__.length&&(t=new Zt(this)),(t=t.reverse()).__actions__.push({func:lf,args:[Ji],thisArg:r}),new Nt(t,this.__chain__)}return this.thru(Ji)},Lt.prototype.toJSON=Lt.prototype.valueOf=Lt.prototype.value=function(){return ve(this.__wrapped__,this.__actions__)},Lt.prototype.first=Lt.prototype.head,Kn&&(Lt.prototype[Kn]=function(){return this}),Lt}();hr?((hr.exports=ht)._=ht,sr._=ht):lr._=ht}.call(e.exports)),e.exports);
|
|
2
|
-
/**
|
|
3
|
-
* @license
|
|
4
|
-
* Lodash <https://lodash.com/>
|
|
5
|
-
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
6
|
-
* Released under MIT license <https://lodash.com/license>
|
|
7
|
-
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
8
|
-
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
9
|
-
*/export{i as l}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{B as r}from"./p-BcNb9bVO.js";import{C as o}from"./p-Dzv0P2Ly.js";import{g as s,a as e}from"./p-CDu7TeCZ.js";const i=({id:i,authToken:n,service:t})=>async({onSuccess:a,onError:c,final:u})=>{var v;try{const u=await t.fetchBusiness(i,n);if(u.error){return c({error:e(u.error),code:s(null===(v=u.error)||void 0===v?void 0:v.code),severity:o.ERROR})}a({business:new r(u.data)})}catch(r){const e=s(null==r?void 0:r.code);return c({error:r.message||r,code:e,severity:o.ERROR})}finally{u()}};export{i as m}
|