@justifi/webcomponents 6.12.6 → 6.12.7-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{Analytics-CuYtRPw5.js → Analytics-GZGMuFW6.js} +2 -2
- package/dist/cjs/{Plaid-BRSyOOuw.js → Plaid-KasiL5mp.js} +14 -19
- package/dist/cjs/{additional-questions-form-step_14.cjs.entry.js → additional-questions-form-step_15.cjs.entry.js} +378 -169
- 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-document-form-inputs.cjs.entry.js +21 -0
- package/dist/cjs/bank-account-form.cjs.entry.js +2 -2
- package/dist/cjs/{business-form-options-D_nM7NDk.js → business-form-options-CnlrfbQ6.js} +51 -0
- package/dist/cjs/{business-identity-schema-DuFGX6_i.js → business-identity-schema-CC1wOwXd.js} +11 -7
- package/dist/cjs/{business.service-Z9OACEQL.js → business.service-BBovho58.js} +1 -1
- package/dist/cjs/card-form.cjs.entry.js +2 -2
- package/dist/cjs/{check-pkg-version-CPWLIT6P.js → check-pkg-version-FPtenLmp.js} +1 -1
- package/dist/cjs/{checkout.service-BZOyqXgW.js → checkout.service-C0M9hmsL.js} +1 -1
- package/dist/cjs/{country-config-aJp8ScEs.js → country-config-Ck-eEeZZ.js} +2 -0
- package/dist/cjs/dispute-notification_2.cjs.entry.js +6 -6
- package/dist/cjs/{event-types-AU1B76Vm.js → event-types-DDNVjmfR.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 +5 -4
- package/dist/cjs/{get-business-aR-C83KX.js → get-business-Ggw-UjXj.js} +2 -2
- package/dist/cjs/{get-payment-details-dwhA02Zl.js → get-payment-details-BVKRwME1.js} +2 -2
- package/dist/cjs/{get-subaccounts-B1jmSa2d.js → get-subaccounts-RRmcS9xU.js} +2 -2
- package/dist/cjs/hidden-input_2.cjs.entry.js +1 -1
- package/dist/cjs/{index.esm-C1ZPG85l.js → index.esm-BNETBIV_.js} +0 -18
- package/dist/cjs/justifi-apple-pay_11.cjs.entry.js +8 -8
- 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 +2 -2
- 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 +1 -1
- 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 +2 -2
- package/dist/cjs/justifi-terminal-orders-list.cjs.entry.js +6 -6
- package/dist/cjs/justifi-terminals-list-filters.cjs.entry.js +2 -2
- package/dist/cjs/justifi-terminals-list.cjs.entry.js +8 -8
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{package-Dxjq_cJI.js → package-C7Z9XAuc.js} +1 -1
- package/dist/cjs/payment-method-option.cjs.entry.js +1 -1
- package/dist/cjs/{payment-provisioning-actions-BiSpysjW.js → payment-provisioning-actions-Cn8bgHKu.js} +2 -2
- package/dist/cjs/payment-provisioning-form-buttons_2.cjs.entry.js +3 -2
- package/dist/cjs/{payment.service-ByrgA_QZ.js → payment.service-CbIxt30x.js} +1 -1
- package/dist/cjs/{payout.service-CnQm_BpU.js → payout.service-DVMvsdAf.js} +1 -1
- package/dist/cjs/{payouts-status-AuS3Mp0V.js → payouts-status-CzS2CLGW.js} +2 -2
- package/dist/cjs/{plaid.service-Dlb8EUR8.js → plaid.service-DNT_DX6z.js} +1 -1
- package/dist/cjs/{schema-validations-DNPcvDh5.js → schema-validations-DackMxv7.js} +11 -8
- package/dist/cjs/styled-host-Ch0-dxF-.js +11 -0
- package/dist/cjs/{terminal.service-BdwHQ3Vv.js → terminal.service-BBHixg-d.js} +1 -1
- package/dist/cjs/{utils-FVGp6se3.js → utils-kDsk4nqH.js} +1 -1
- package/dist/cjs/webcomponents.cjs.js +1 -1
- package/dist/collection/api/Document.js +14 -7
- package/dist/collection/collection-manifest.json +2 -0
- 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 +5 -3
- package/dist/collection/components/business-forms/owner-form/owner-form-inputs.js +4 -2
- package/dist/collection/components/business-forms/owner-form/owner-form.js +46 -1
- 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 +6 -114
- 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 +8 -0
- package/dist/collection/components/business-forms/payment-provisioning/business-representative/business-representative-form-inputs.js +4 -2
- package/dist/collection/components/business-forms/payment-provisioning/document-upload/document-upload-form-step.js +435 -0
- package/dist/collection/components/business-forms/payment-provisioning/document-upload/document-upload-list.js +52 -0
- package/dist/collection/components/business-forms/payment-provisioning/document-upload/document-upload-options.js +72 -0
- 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 +3 -2
- package/dist/collection/components/business-forms/schemas/business-bank-account-schema.js +10 -38
- 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 +7 -3
- package/dist/collection/components/business-forms/schemas/schema-validations.js +8 -5
- package/dist/collection/components/business-forms/utils/business-form-options.js +50 -0
- package/dist/collection/components/business-forms/utils/country-config.js +2 -0
- package/dist/collection/ui-components/form/form-control-file.js +1 -1
- package/dist/docs.json +496 -64
- package/dist/esm/{Analytics-CwckfiSK.js → Analytics-D-apOWeY.js} +2 -2
- package/dist/esm/{Plaid-l6nNIjab.js → Plaid-BM3JUIG5.js} +15 -19
- package/dist/esm/{additional-questions-form-step_14.entry.js → additional-questions-form-step_15.entry.js} +377 -169
- 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-document-form-inputs.entry.js +19 -0
- package/dist/esm/bank-account-form.entry.js +2 -2
- package/dist/esm/{business-form-options-DRalxlqN.js → business-form-options-DXjZp4Rl.js} +51 -1
- package/dist/esm/{business-identity-schema-0Q3kck3C.js → business-identity-schema-D8L_UfWl.js} +11 -7
- package/dist/esm/{business.service-C31wbMVs.js → business.service-C4BD3pf7.js} +1 -1
- package/dist/esm/card-form.entry.js +2 -2
- package/dist/esm/{check-pkg-version-Dy2NK3Nn.js → check-pkg-version-Bn8HCDRp.js} +1 -1
- package/dist/esm/{checkout.service-cVdOGDuI.js → checkout.service-DmWeKNQs.js} +1 -1
- package/dist/esm/{country-config-CdvhLcnT.js → country-config-BW2dUoTJ.js} +2 -0
- package/dist/esm/dispute-notification_2.entry.js +6 -6
- package/dist/esm/{event-types-DalU_6SB.js → event-types-eIqsrwmW.js} +1 -1
- package/dist/esm/form-address-fields_3.entry.js +1 -1
- package/dist/esm/form-control-number_2.entry.js +5 -4
- package/dist/esm/{get-business-Gg6qn5on.js → get-business-DtFHdc37.js} +2 -2
- package/dist/esm/{get-payment-details-BiWgSJau.js → get-payment-details-26GxiYgv.js} +2 -2
- package/dist/esm/{get-subaccounts-CkjZeR9U.js → get-subaccounts-xkGMPstt.js} +2 -2
- package/dist/esm/hidden-input_2.entry.js +1 -1
- package/dist/esm/{index.esm-BHdVU4hV.js → index.esm-KCSohgHx.js} +1 -18
- package/dist/esm/justifi-apple-pay_11.entry.js +8 -8
- 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 +2 -2
- 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 +1 -1
- 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 +2 -2
- package/dist/esm/justifi-terminal-orders-list.entry.js +6 -6
- package/dist/esm/justifi-terminals-list-filters.entry.js +2 -2
- package/dist/esm/justifi-terminals-list.entry.js +8 -8
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{package-DAZd_gFd.js → package-D6Pw5qJ5.js} +1 -1
- package/dist/esm/payment-method-option.entry.js +1 -1
- package/dist/esm/{payment-provisioning-actions-cl5xIYnF.js → payment-provisioning-actions-fWdNDUdq.js} +2 -2
- package/dist/esm/payment-provisioning-form-buttons_2.entry.js +3 -2
- package/dist/esm/{payment.service-5_u-UzTY.js → payment.service-CWR7jF-K.js} +1 -1
- package/dist/esm/{payout.service-D2zS5y8N.js → payout.service-CFU362cH.js} +1 -1
- package/dist/esm/{payouts-status-DCjCGTaa.js → payouts-status-D2G7FKu1.js} +2 -2
- package/dist/esm/{plaid.service-BiJ65YG8.js → plaid.service-0hd1i5Ga.js} +1 -1
- package/dist/esm/{schema-validations-A1o1biOB.js → schema-validations-CjqWFLKt.js} +11 -8
- package/dist/esm/styled-host-D84RBv1W.js +9 -0
- package/dist/esm/{terminal.service-CIxDfM7V.js → terminal.service-Dr6dERcJ.js} +1 -1
- package/dist/esm/{utils-C1B2hVAB.js → utils-q7KOrlSX.js} +1 -1
- package/dist/esm/webcomponents.js +1 -1
- package/dist/module/Plaid.js +15 -19
- package/dist/module/additional-questions-form-step2.js +11 -5
- package/dist/module/bank-account-document-form-inputs.js +55 -1
- package/dist/module/business-bank-account-form-step2.js +24 -177
- 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 +51 -1
- package/dist/module/business-identity-schema.js +7 -3
- package/dist/module/business-owners-form-step2.js +8 -0
- package/dist/module/business-representative-form-inputs2.js +5 -3
- package/dist/module/business-representative2.js +6 -5
- package/dist/module/button.js +1 -1
- package/dist/module/country-config.js +2 -0
- package/dist/module/document-upload-form-step.d.ts +11 -0
- package/dist/module/document-upload-form-step.js +6 -0
- package/dist/module/document-upload-form-step2.js +397 -0
- package/dist/module/document-upload-list.d.ts +11 -0
- package/dist/module/document-upload-list.js +6 -0
- package/dist/module/document-upload-list2.js +46 -0
- package/dist/module/form-control-number2.js +1 -1
- package/dist/module/form-control-textarea2.js +1 -1
- package/dist/module/form.js +1 -18
- 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-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 +33 -27
- 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/owner-form-inputs2.js +5 -3
- package/dist/module/owner-form2.js +10 -1
- package/dist/module/package.js +1 -1
- package/dist/module/parts.js +1 -1
- package/dist/module/payment-provisioning-actions.js +1 -1
- package/dist/module/payment-provisioning-form-steps2.js +35 -28
- package/dist/module/plaid-verification2.js +1 -1
- package/dist/module/schema-validations.js +8 -5
- 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 +15 -2
- package/dist/types/components/business-forms/owner-form/owner-form.d.ts +2 -0
- package/dist/types/components/business-forms/payment-provisioning/bank-account/business-bank-account-form-step.d.ts +1 -12
- package/dist/types/components/business-forms/payment-provisioning/document-upload/document-upload-form-step.d.ts +44 -0
- package/dist/types/components/business-forms/payment-provisioning/document-upload/document-upload-list.d.ts +6 -0
- package/dist/types/components/business-forms/payment-provisioning/document-upload/document-upload-options.d.ts +44 -0
- package/dist/types/components/business-forms/payment-provisioning/payment-provisioning-form-steps.d.ts +1 -0
- 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 +1 -0
- package/dist/types/components.d.ts +67 -0
- package/dist/webcomponents/{p-oTtn8xDw.js → p--RbNhyet.js} +1 -1
- package/dist/webcomponents/{p-4b39a470.entry.js → p-01ed8fb5.entry.js} +1 -1
- package/dist/webcomponents/{p-07eaee91.entry.js → p-0290ca0f.entry.js} +1 -1
- package/dist/webcomponents/{p-e02d7751.entry.js → p-0a2be2e2.entry.js} +4 -4
- package/dist/webcomponents/{p-ca87c609.entry.js → p-0a4fcb15.entry.js} +1 -1
- package/dist/webcomponents/{p-b0b6083f.entry.js → p-0b169fac.entry.js} +1 -1
- package/dist/webcomponents/{p-f1b9cbf0.entry.js → p-0e4cda77.entry.js} +1 -1
- package/dist/webcomponents/{p-9d676f54.entry.js → p-1006ab39.entry.js} +1 -1
- package/dist/webcomponents/{p-d5edbea3.entry.js → p-164a4e64.entry.js} +1 -1
- package/dist/webcomponents/{p-bc2dddf3.entry.js → p-1841ee76.entry.js} +1 -1
- package/dist/webcomponents/{p-d01a1076.entry.js → p-188a7ebd.entry.js} +1 -1
- package/dist/webcomponents/{p-b62ff001.entry.js → p-1e34c488.entry.js} +1 -1
- package/dist/webcomponents/{p-a56e43a1.entry.js → p-1e5c96f3.entry.js} +1 -1
- package/dist/webcomponents/{p-b21010cb.entry.js → p-233fef57.entry.js} +1 -1
- package/dist/webcomponents/p-2e5ec91e.entry.js +1 -0
- package/dist/webcomponents/{p-41637e4a.entry.js → p-374ce853.entry.js} +1 -1
- package/dist/webcomponents/p-37676092.entry.js +1 -0
- package/dist/webcomponents/{p-78c4668b.entry.js → p-3c3fbcca.entry.js} +1 -1
- package/dist/webcomponents/{p-c4767c7b.entry.js → p-3e10a0de.entry.js} +1 -1
- package/dist/webcomponents/{p-e07506b7.entry.js → p-4673d7d3.entry.js} +1 -1
- package/dist/webcomponents/{p-3cefb032.entry.js → p-4b14b7e7.entry.js} +1 -1
- package/dist/webcomponents/p-54ee2a30.entry.js +1 -0
- package/dist/webcomponents/{p-38209a25.entry.js → p-5ceeaa73.entry.js} +1 -1
- package/dist/webcomponents/{p-a9e82502.entry.js → p-6089f91c.entry.js} +1 -1
- package/dist/webcomponents/{p-b8351983.entry.js → p-60a0bf1e.entry.js} +1 -1
- package/dist/webcomponents/{p-cf3e3394.entry.js → p-63a35210.entry.js} +1 -1
- package/dist/webcomponents/{p-08ab97ce.entry.js → p-641c9bdb.entry.js} +1 -1
- package/dist/webcomponents/{p-8e56430a.entry.js → p-74aeb76a.entry.js} +1 -1
- package/dist/webcomponents/{p-1f34b2f7.entry.js → p-80fdd013.entry.js} +1 -1
- package/dist/webcomponents/{p-3ef07f42.entry.js → p-84aaf298.entry.js} +1 -1
- package/dist/webcomponents/{p-4ee55e7d.entry.js → p-8a5f0d71.entry.js} +1 -1
- package/dist/webcomponents/{p-9153c121.entry.js → p-947950cc.entry.js} +1 -1
- package/dist/webcomponents/p-98476956.entry.js +1 -0
- package/dist/webcomponents/{p-a2c25cc4.entry.js → p-99792da6.entry.js} +1 -1
- package/dist/webcomponents/p-B1yVkh15.js +1 -0
- package/dist/webcomponents/{p-Bt4GjEWL.js → p-BBSnDYJw.js} +1 -1
- package/dist/webcomponents/{p-av6jyzyC.js → p-BSyTbuZy.js} +1 -1
- package/dist/webcomponents/{p-APOabprT.js → p-BrFax4_P.js} +1 -1
- package/dist/webcomponents/p-BzXQDB0t.js +1 -0
- package/dist/webcomponents/{p-BxKbnILQ.js → p-C-zuQNNP.js} +1 -1
- package/dist/webcomponents/{p-Cm9f5fyh.js → p-CDu7TeCZ.js} +1 -1
- package/dist/webcomponents/{p-BJu1-9kE.js → p-CL8LyqRI.js} +1 -1
- package/dist/webcomponents/{p-fE5A37L5.js → p-Cz0yhyYu.js} +1 -1
- package/dist/webcomponents/p-D6Pw5qJ5.js +1 -0
- package/dist/webcomponents/p-D9ZHVy-j.js +1 -0
- package/dist/webcomponents/{p-BdpSLMs7.js → p-D9rCHoO4.js} +1 -1
- package/dist/webcomponents/{p-CKiAlBsU.js → p-D9sqTVmd.js} +1 -1
- package/dist/webcomponents/p-DV4n8kZd.js +1 -0
- package/dist/webcomponents/{p-Dk26hk5T.js → p-DdeBubpX.js} +1 -1
- package/dist/webcomponents/p-DzEdYT8R.js +1 -0
- package/dist/webcomponents/{p-NZS8uCtH.js → p-Dzv0P2Ly.js} +1 -1
- package/dist/webcomponents/{p-Axa3cgnH.js → p-H0ILKMD2.js} +1 -1
- package/dist/webcomponents/{p-a7a1b168.entry.js → p-a3b48ba3.entry.js} +1 -1
- package/dist/webcomponents/{p-ebb7b693.entry.js → p-a3fe126f.entry.js} +1 -1
- package/dist/webcomponents/p-a9976353.entry.js +1 -0
- package/dist/webcomponents/{p-7377f7d1.entry.js → p-ab89cb46.entry.js} +1 -1
- package/dist/webcomponents/{p-d79c5ee4.entry.js → p-b17ce21d.entry.js} +1 -1
- package/dist/webcomponents/{p-2a5ee558.entry.js → p-b5aa3937.entry.js} +1 -1
- package/dist/webcomponents/p-cab840bd.entry.js +1 -0
- package/dist/webcomponents/{p-e17b92ec.entry.js → p-cc558e25.entry.js} +1 -1
- package/dist/webcomponents/{p-BXyADlAH.js → p-czJ2qSU1.js} +1 -1
- package/dist/webcomponents/p-d7ec0b54.entry.js +1 -0
- package/dist/webcomponents/{p-6904c62c.entry.js → p-e737077f.entry.js} +1 -1
- package/dist/webcomponents/p-eb1b4ead.entry.js +1 -0
- package/dist/webcomponents/{p-279c17ac.entry.js → p-f6be288f.entry.js} +1 -1
- package/dist/webcomponents/p-n_pmf4AT.js +1 -0
- package/dist/webcomponents/p-vUN_uvAi.js +1 -0
- package/dist/webcomponents/{p-Ba8jdOkX.js → p-xWuaNtJy.js} +1 -1
- package/dist/webcomponents/webcomponents.esm.js +1 -1
- package/package.json +14 -14
- package/LICENSE +0 -21
- package/dist/cjs/styled-host-DAi5SuFa.js +0 -11
- package/dist/esm/styled-host-D6byRazK.js +0 -9
- package/dist/module/bank-account-document-form-inputs2.js +0 -57
- package/dist/webcomponents/p-034fa691.entry.js +0 -1
- package/dist/webcomponents/p-2aac2ab6.entry.js +0 -1
- package/dist/webcomponents/p-37254105.entry.js +0 -1
- package/dist/webcomponents/p-5G1OMxZz.js +0 -1
- package/dist/webcomponents/p-9b5ca32c.entry.js +0 -1
- package/dist/webcomponents/p-Aacb4jqT.js +0 -1
- package/dist/webcomponents/p-BqNNwq6C.js +0 -1
- package/dist/webcomponents/p-D8ytux5N.js +0 -1
- package/dist/webcomponents/p-DAZd_gFd.js +0 -1
- package/dist/webcomponents/p-DrMJliVY.js +0 -1
- package/dist/webcomponents/p-XIWgia4J.js +0 -1
- package/dist/webcomponents/p-c8bc235f.entry.js +0 -1
- package/dist/webcomponents/p-ea254f14.entry.js +0 -1
- package/dist/webcomponents/p-ff8cf16c.entry.js +0 -1
- package/dist/webcomponents/p-nb_LhbJq.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,E as n,z as o,B as h,w as l,x as c,y as d}from"./p-NZS8uCtH.js";import{m as u,a as m,c as b,d as p,e as f,f as v,g as y}from"./p-APOabprT.js";import{B as g,a as k,D as w,I as _}from"./p-BJu1-9kE.js";import{a as x,d as T,b as L,g as C,h as j}from"./p-DrMJliVY.js";import{F as O,c as A,a as E,b as S,d as V}from"./p-CKiAlBsU.js";import{A as H,C as I,e as D,R as B,f as P,O as N}from"./p-BcNb9bVO.js";import{C as M,P as R,I as F}from"./p-CVaOFfrI.js";import{b as W,a0 as q,C as Z,x as U,u as z,D as Y,aa as $,a6 as G,aj as J,am as X,A as K,a1 as Q}from"./p-CPKMvyV_.js";import{P as tt}from"./p-DSclFZ32.js";import{b as et,a as st,c as it}from"./p-Bt4GjEWL.js";import{a as at,B as rt}from"./p-XYgDHrVL.js";import"./p-DVJaoI_m.js";import"./p-HXpYMWUU.js";import"./p-CLHwhyvu.js";import{n as nt}from"./p-BnjCmwMr.js";import{B as ot,C as ht,v as lt,D as ct,E as dt,F as ut,G as mt}from"./p-XIWgia4J.js";import{B as bt}from"./p-CHo7TfsM.js";import"./p-CZfYo5-1.js";import{c as pt}from"./p-D8ytux5N.js";import{s as ft,b as vt,d as yt}from"./p-BRnBHsdq.js";import{S as gt}from"./p-uZ5KAseb.js";import{u as kt,a as wt,b as _t}from"./p-C6o0liMT.js";import{A as xt}from"./p-CYQvLgSs.js";import{S as Tt}from"./p-BqNNwq6C.js";import{P as Lt}from"./p-av6jyzyC.js";import"./p-Cm9f5fyh.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 jt=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 H(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:at.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 H(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 H(this.formController.values.getValue()).payload}}componentWillLoad(){this.initializeApi(),this.formController=new O(x(this.allowOptionalFields))}componentDidLoad(){this.getBusiness&&this.getData(),this.formController.errors.subscribe((t=>{this.errors=Object.assign({},t)}))}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=u({authToken:this.authToken,businessId:this.businessId,service:new g}),this.patchBusiness=m({authToken:this.authToken,businessId:this.businessId,service:new g})):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(tt,null):s("form",null,s("fieldset",null,s("div",{class:"d-flex align-items-center gap-2"},s("legend",{class:"mb-0",part:W},"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:M.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:M.WHOLE})),s("div",{class:"col-12"},s("form-control-text",{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:et,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"]}}},Ot=class{constructor(e){t(this,e)}render(){return s("div",{key:"d0dacb95d07d3e4ca9bc2c9f23b6c490871da4e9",class:"row gy-3"},s("div",{key:"02ed406f38558badf9f591e076b120d09c71f83b",class:"col-12"},s("form-control-file",{key:"11ff1dc68264b9e5aa561ffe19b423abc1a00c78",name:"voided_check",label:"Voided Check",documentType:n.voidedCheck,inputHandler:this.inputHandler,onFileSelected:this.storeFiles,errorText:this.errors.voided_check,multiple:!0})),s("div",{key:"71d26407522a75a54489155566c18af1a64c1417",class:"col-12"},s("form-control-file",{key:"7ea42e03a44c223a5fedc273e94e635e70d54f4b",name:"bank_statement",label:"Bank Statement",documentType:n.bankStatement,inputHandler:this.inputHandler,onFileSelected:this.storeFiles,errorText:this.errors.bank_statement,multiple:!0})))}},At=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:st,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:nt,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:nt,helpText:"A valid routing number is nine digits. Please include any leading or trailing zeroes."})))}},Et=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:st,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:nt,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:nt,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:nt,helpText:"Please copy the account number as shown on your statement. Do not include spaces or dashes."})))}},St=(t,e)=>t.some((t=>t.document_type===e)),Vt=t=>t?{bank_name:dt.nullable(),nickname:ct.nullable(),account_owner_name:lt.nullable(),account_type:ht.nullable(),account_number:ot.nullable()}:{bank_name:dt.required("Enter bank name"),nickname:ct.required("Enter nickname"),account_owner_name:lt.required("Enter account owner name"),account_type:ht.required("Select account type"),account_number:ot.required("Enter account number")},Ht=(t,e)=>{if(e)return{voided_check:S().nullable(),bank_statement:S().nullable()};const s=St(t,n.voidedCheck),i=St(t,n.bankStatement),a=s||i,r="Please upload either a voided check or a bank statement. Only one is required.";return{voided_check:S().when("bank_statement",{is:t=>!t&&!a,then:t=>t.required(r),otherwise:t=>t.notRequired()}),bank_statement:S().when("voided_check",{is:t=>!t&&!a,then:t=>t.required(r),otherwise:t=>t.notRequired()})}},It={[I.USA]:(t,e=[])=>((t,e)=>{const s=Object.assign(Object.assign(Object.assign({},Vt(e)),(t=>t?{routing_number:mt.nullable()}:{routing_number:mt.required("Enter routing number")})(e)),Ht(t,e));return A().shape(s,[["voided_check","bank_statement"]])})(e,t),[I.CAN]:(t,e=[])=>((t,e)=>{const s=Object.assign(Object.assign(Object.assign({},Vt(e)),(t=>{const e=E().length(3,"Institution number must be 3 digits").matches(ut,"Enter valid institution number"),s=E().length(5,"Transit number must be 5 digits").matches(ut,"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")}})(e)),Ht(t,e));return A().shape(s,[["voided_check","bank_statement"]])})(e,t)},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.bankAccount={},this.existingDocuments=[],this.documentData=new o,this.isLoading=!1,this.viewMode="manual",this.bankAccountVerification=!1,this.platformAccountId=null,this.getSchema=()=>(0,It[this.country])(this.allowOptionalFields,this.existingDocuments),this.initializeFormController=()=>{this.formController=new O(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.storeFiles=t=>{const e=Array.from(t.detail.fileList),s=t.detail.document_type,i=e.map((t=>new h({file:t,document_type:s},this.businessId)));this.documentData[s]=i},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.documentData=new o,this.initializeFormController()},this.handleCancel=()=>{this.viewMode=this.existingBankAccount?"readonly":"plaid",this.documentData=new o,this.initializeFormController()},this.handleToggleToManualEntry=()=>{this.viewMode="manual"},this.handleToggleToPlaidVerification=()=>{this.viewMode="plaid"},this.handleSaveBankAccount=async()=>{this.formController.validateAndSubmit((()=>{this.sendData((()=>{}))}))},this.postDocumentRecordData=async t=>{this.isLoading=!0;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(),s=await fetch(t.presigned_url,{method:"PUT",body:e});return this.handleUploadResponse(s)},this.handleUploadResponse=t=>!t.error||(this.errorEvent.emit({errorCode:r.POST_ERROR,message:t.error.message,severity:a.ERROR,data:t.error}),!1)}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 O(this.getSchema())}componentDidLoad(){this.formController.errors.subscribe((t=>{this.errors=Object.assign({},t)}))}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=u({authToken:this.authToken,businessId:this.businessId,service:new g}),this.postBankAccount=b({authToken:this.authToken,service:new k}),this.postDocumentRecord=p({authToken:this.authToken,service:new w})):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,documents:s,settings:i,platform_account_id:a}=t;e.length>0?this.bankAccount=new Ct(e[e.length-1]):(this.bankAccount=new Ct({}),this.bankAccount.business_id=this.businessId),this.existingDocuments=s,this.bankAccountVerification=!0===i.bank_account_verification,this.platformAccountId=a}determineViewMode(){this.viewMode=this.existingBankAccount?"readonly":this.plaidAvailable?"plaid":"manual"}async sendData(t){try{if("manual"===this.viewMode&&!await this.postBankAccountData())return;if(!await this.postBusinessDocuments())return;"manual"===this.viewMode&&(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:at.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()}})}))}async postBusinessDocuments(){this.isLoading=!0;try{const t=Object.values(this.documentData).flat();return!t.length||!(await Promise.all(t.map((t=>this.postDocumentRecordData(t))))).includes(!1)&&!(await Promise.all(t.map((t=>this.uploadDocument(t))))).includes(!1)}finally{this.isLoading=!1}}renderBankAccountInputs(t){const e=this.formController.getInitialValues();return s(this.country===I.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(bt,{variant:"secondary",type:"button",onClick:this.handleChangeBankAccount,disabled:this.isLoading,part:q},"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(bt,{type:"button",variant:"link",className:"p-0",onClick:this.handleToggleToManualEntry,disabled:this.isLoading,part:Z},"Enter bank details manually (document upload required)")))}renderManualEntryView(){return s("div",null,this.plaidAvailable&&s("div",{class:"mb-3"},s(bt,{type:"button",variant:"secondary",onClick:this.handleToggleToPlaidVerification,disabled:this.isLoading,part:q},"Link bank account with Plaid instead")),this.renderBankAccountInputs(!1),s("div",{class:"mt-3 d-flex gap-2"},this.showCancel&&s(bt,{variant:"secondary",type:"button",onClick:this.handleCancel,disabled:this.isLoading,part:q},"Cancel"),s(bt,{variant:"primary",type:"button",onClick:this.handleSaveBankAccount,disabled:this.isLoading,isLoading:this.isLoading},"Save Bank Account")))}renderDocumentUploads(){return s("fieldset",{class:"mt-4"},s("div",{class:"d-flex align-items-center gap-2"},s("legend",{class:"mb-0",part:W},"Document Uploads"),s("form-control-tooltip",{helpText:"One document (voided check or bank statement) is required for underwriting purposes. It needs to visibly show the name tied to the account and the account number. Various file formats such as PDF, DOC, DOCX, JPEG are accepted. Multiple files can be uploaded for each document category."})),s("hr",{class:"mt-2"}),s("business-documents-on-file",{documents:this.existingDocuments,isLoading:this.isLoading}),s("bank-account-document-form-inputs",{inputHandler:this.inputHandler,errors:this.errors,storeFiles:this.storeFiles}))}render(){return this.isLoading?s(tt,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:W},"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()),"plaid"!==this.viewMode&&this.renderDocumentUploads())}static get watchers(){return{authToken:["propChanged"],businessId:["propChanged"],isLoading:["watchHandler"]}}},Bt=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 D(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:at.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 D(this.formController.values.getValue()).payload}componentWillLoad(){this.initializeApi();const t=this.country===I.CAN?T(this.allowOptionalFields):L(this.allowOptionalFields);this.formController=new O(t),this.getData()}componentDidLoad(){this.formController.errors.subscribe((t=>{this.errors=Object.assign({},t)}))}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=u({authToken:this.authToken,businessId:this.businessId,service:new g}),this.patchBusiness=m({authToken:this.authToken,businessId:this.businessId,service:new g})):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(tt,null):s("form",null,s("fieldset",null,s("div",{class:"d-flex align-items-center gap-2"},s("legend",{class:"mb-0",part:W},"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:it,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:pt[this.country].taxIdLabel,defaultValue:this.isEditingTaxId?"":i.tax_id,errorText:this.errors.tax_id,inputHandler:this.inputHandler,mask:"000000000",helpText:pt[this.country].taxIdHelpText}):s("div",null,s("label",{class:"form-label",part:U},pt[this.country].taxIdLabel),s("div",{class:"input-group mb-3"},s("input",{type:"text",class:"form-control",part:z,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:q,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:R.US})))))}static get watchers(){return{authToken:["propChanged"],businessId:["propChanged"]}}},Pt=class{constructor(e){t(this,e),this.documents=[],this.isLoading=!1}render(){return this.isLoading?s(gt,{height:"50px"}):this.documents.length?s(i,null,s("div",{class:"card",part:Y},s("div",{class:"card-body"},s("h5",{class:"card-title",part:W},"Documents Already on File"),s("div",{class:"table-responsive"},s("table",{class:"table table-sm table-borderless",part:$},s("thead",null,s("tr",null,s("th",{style:{width:"25%"},part:G,scope:"col"},"File Name"),s("th",{style:{width:"25%"},part:G,scope:"col"},"File Type"),s("th",{style:{width:"25%"},part:G,scope:"col"},"Document Type"),s("th",{style:{width:"25%"},part:G,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:J},t.file_name),s("td",{part:J},t.file_type),s("td",{part:J},ft(t.document_type)),s("td",{part:J},`${vt(t.created_at)} - ${yt(t.created_at)}`))))))))),s("hr",null)):null}},Nt=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 B(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:at.owners}),this.formLoading.emit(!1)}})},this.addOwnerForm=t=>{this.newFormOpen=!0,this.ownersPayload=[...this.ownersPayload,{id:""}],t&&this.clickEvent.emit({name:rt.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;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=u({authToken:this.authToken,businessId:this.businessId,service:new g}),this.patchBusiness=m({authToken:this.authToken,businessId:this.businessId,service:new g})):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(tt,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:W},"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:X},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(bt,{variant:"primary",onClick:()=>this.handleRepresentativeIsOwnerChange(!0)},"Yes"),s(bt,{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(bt,{variant:"primary",onClick:()=>this.addOwnerForm(!0),hidden:!this.showAddOwnerButton},"Add Owner")))))}static get watchers(){return{authToken:["propChanged"],businessId:["propChanged"],ownersPayload:["ownersWatcher"]}}},Mt=class{constructor(e){t(this,e),this.isEditingIdentification=!1,this.inputHandler=(t,e)=>{kt(this.formController,{[t]:e})},this.onAddressFormUpdate=t=>{wt(this.formController,Object.assign(Object.assign({},this.formController.values.getValue().address),t))}}render(){var t,e,i,a,r,n,o,h,l;return s("form",{key:"ef49167cc726b3d4efa128503553a77a7627ebee"},s("fieldset",{key:"3714ce7eab6e9cee062911564d1c2635b68dfc8b"},s("div",{key:"4f27236b0438e29d7449bf5e9f71c00c7245effa",class:"d-flex align-items-center gap-2"},s("legend",{key:"adc144da314549264571b245c5388ab56c1dbbf1",class:"mb-0",part:W},"Representative"),s("form-control-tooltip",{key:"bcc76add04febe984427103a594aa63cab17bd27",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:"98bfed19989ee57e451a7005f3e60af16cc5d3b5",class:"mt-2"}),s("div",{key:"8f5e0e3deed2627ecf9f77290f268c0e2ee68bfa",class:"row gy-3"},s("div",{key:"b1205284a54a608b9c3b6be386e134849c9c6b25",class:"col-12 col-md-8"},s("form-control-text",{key:"36fcd91ca263adfd9fb69dc88f15404f93a8bc13",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:"879337d3c6a120f5dc9de3cd3364b34b9c4689df",class:"col-12 col-md-4"},s("form-control-text",{key:"ff2e4d29e76b93693735b35cbaca4416f0cd28a0",name:"title",label:"Title",defaultValue:null===(e=this.representativeDefaultValue)||void 0===e?void 0:e.title,errorText:this.errors.title,inputHandler:this.inputHandler,helpText:"Role at your business, e.g. President, CEO, Treasurer."})),s("div",{key:"2a011b74b4c203ae4a309d7d76ea8fd0631a5f2c",class:"col-12 col-md-6"},s("form-control-text",{key:"1ef20c59829ed3abe81cc53355bbafd5d4894360",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:"460dad175238fdfea8c79666343943a95aac0fd5",class:"col-12 col-md-6"},s("form-control-number-masked",{key:"7bd3ad79f6da1d33e38c2246d9c0378c2ef8b7d7",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:R.US})),s("div",{key:"cda84bfc9f88a35177a42b7f9ec4c58292600c0b",class:"col-12 col-md-4"},s("form-control-date",{key:"5ed66fabc97afc94a5839135add25dbcb5237900",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=>_t(t,this.formController),helpText:"Must be 18 or older."})),s("div",{key:"0e19619fd081ea9dacd0eb25388a4c7b2c993312",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:pt[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:F[this.country],helpText:pt[this.country].identityHelpText}):s("div",null,s("label",{class:"form-label",part:U},pt[this.country].idNumberLabel),s("div",{class:"input-group mb-3"},s("input",{type:"text",class:"form-control",part:z,value:`****${null===(h=this.representativeDefaultValue)||void 0===h?void 0:h.ssn_last4}`,disabled:!0}),s("button",{class:"btn btn-secondary",type:"button",part:q,onClick:()=>{this.isEditingIdentification=!0,kt(this.formController,{identification_number:"",ssn_last4:null})}},"Change")))),s("div",{key:"6647390b209f5a630bf60e8952a7b0e70c92ca8a",class:"col-12"},s("identity-address-form",{key:"9755d0450fc8d83ba0a98a304455df346ff33e7f",errors:this.errors.address,defaultValues:null===(l=this.representativeDefaultValue)||void 0===l?void 0:l.address,handleFormUpdate:this.onAddressFormUpdate,country:this.country})))))}},Rt=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 B(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:at.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=u({authToken:this.authToken,businessId:this.businessId,service:new g}),this.patchBusiness=m({authToken:this.authToken,businessId:this.businessId,service:new g})):this.errorEvent.emit({message:"Missing required props",errorCode:r.MISSING_PROPS,severity:a.ERROR})}initializeForm(){const t=C[this.country];t?(this.formController=new O(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 B(this.formController.values.getValue()).payload}}render(){return!this.formController||this.isLoading?s(tt,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"]}}},Ft=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=xt(),this.formController=new O((t=>{const e=A({accepted:V().oneOf([!0],"You must agree to the terms and conditions to continue").required("You must agree to the terms and conditions to continue")}),s=A({accepted:V().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:at.termsAndConditions}),this.formCompleted.emit()}async validateAndSubmit({onSuccess:t}){this.acceptedTermsBefore?(this.stepCompleteEvent.emit({response:null,formStep:at.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:W},"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})))))}},Wt=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 P((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:at.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 P(this.formController.values.getValue()).payload}}componentWillLoad(){this.initializeApi(),this.formController=new O((0,j[this.country])(this.allowOptionalFields)),this.getData()}componentDidLoad(){this.formController.errors.subscribe((t=>{this.errors=Object.assign({},t)}))}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=u({authToken:this.authToken,businessId:this.businessId,service:new g}),this.patchBusiness=m({authToken:this.authToken,businessId:this.businessId,service:new g})):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(tt,null):s("form",null,s("fieldset",null,s("div",{class:"d-flex align-items-center gap-2"},s("legend",{class:"mb-0",part:W},"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"]}}},qt=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 N(t)),await this.formController.setInitialValues(this.owner)},this.handleAddOwner=()=>{this.clickEvent.emit({name:this.ownerId?rt.updateOwner:rt.addOwner})},this.handleRemoveOwner=()=>{this.removeOwner(this.ownerId),this.clickEvent.emit({name:rt.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 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 N(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 O((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=f({authToken:this.authToken,identityId:this.ownerId,service:new _}),this.patchOwner=v({authToken:this.authToken,identityId:this.ownerId,service:new _}),this.postOwner=y({authToken:this.authToken,service:new _}))}render(){return s(i,{key:"1661676befd63f9308edcb02be179db71b7c9d99",style:{display:"block"}},s("form",{key:"4961f358ca8953156477d455cacb19e4dec3cc29",onSubmit:this.validateAndSubmit},s("fieldset",{key:"27ecfec87ae93a1bdec94f3cc925558dc8f0ff23"},s("legend",{key:"4c194cf9e08e6fab9982b95a4b12c3c3a8cecdc3",class:"fw-semibold fs-5",part:K},this.formTitle),s("br",{key:"ef1f9b184dac866d27cfa245106d90db0954fa51"}),s("div",{key:"2936ecc396220f8b80e5d8454bc6f6f70cb3ae73",class:"row gy-3"},s("owner-form-inputs",{key:"f34d38b718ed7fde67102aa1034b5e6377e001f8",ownerDefaultValue:this.formController.getInitialValues(),errors:this.errors,formController:this.formController,country:this.country}),s("div",{key:"2d5266bc1a7f4aeb12cab8a494107f2668b2fb0e",class:"d-flex gap-2 justify-content-start"},s(bt,{key:"39631fd0364221ac2a274d8aa794a1f3c8d28780",variant:"secondary",type:"button",onClick:this.handleRemoveOwner,hidden:!this.showRemoveButton},"Remove"),s(bt,{key:"120fbae294f8f67bd14fe0be5dc1bcf881ffd489",variant:"primary",type:"submit",onClick:this.handleAddOwner,disabled:this.isLoading},this.submitButtonText))),s("hr",{key:"73eccba19a595b67f64139769a495d5a27e02b2f"}))))}static get watchers(){return{isLoading:["loadingWatcher"]}}},Zt=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 Lt,this.abortController=null,this.timeoutId=null,this.initializePlaidLink=async()=>{try{if(void 0===window.Plaid)return void this.handleError({code:d.PLAID_SDK_LOAD_FAILED,message:c[d.PLAID_SDK_LOAD_FAILED],severity:l[d.PLAID_SDK_LOAD_FAILED],retryable:!0,userAction:"Refresh the page and try again"});if(await this.getLinkToken(),!this.linkToken)return void this.handleError({code:d.PLAID_LINK_TOKEN_FAILED,message:c[d.PLAID_LINK_TOKEN_FAILED],severity:l[d.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:d.PLAID_LINK_INIT_FAILED,message:c[d.PLAID_LINK_INIT_FAILED],severity:l[d.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:d.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=d.PLAID_LINK_TOKEN_FAILED,n=c[r],o=!0;"AbortError"===a.name?(r=d.PLAID_TIMEOUT,n=c[r],o=!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=d.PLAID_NETWORK_ERROR,n=c[r],o=!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=d.PLAID_INVALID_CREDENTIALS,n="Authentication failed. Please check your credentials.",o=!1),this.handleError({code:r,message:n,severity:l[r],originalError:a,retryable:o,userAction:o?"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:d.PLAID_AUTHENTICATION_FAILED,message:(null==t?void 0:t.message)||"Failed to verify bank account",severity:l[d.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=d.PLAID_AUTHENTICATION_FAILED,s=c[e],i=!0,a="Click to try again";if(t.error_code)switch(t.error_code){case"INVALID_CREDENTIALS":e=d.PLAID_INVALID_CREDENTIALS,s=c[e],i=!0;break;case"ITEM_LOGIN_REQUIRED":e=d.PLAID_INVALID_CREDENTIALS,s="Your bank requires re-authentication. Please try again.",i=!0;break;case"ITEM_LOCKED":e=d.PLAID_ACCOUNT_LOCKED,s=c[e],i=!1,a="Contact your bank";break;case"INSTITUTION_NOT_RESPONDING":e=d.PLAID_MAINTENANCE,s=c[e],i=!0;break;case"RATE_LIMIT_EXCEEDED":e=d.PLAID_RATE_LIMITED,s=c[e],i=!0;break;default:t.error_message&&(s=t.error_message)}this.handleError({code:e,message:s,severity:l[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:d.PLAID_SDK_LOAD_FAILED,message:c[d.PLAID_SDK_LOAD_FAILED],severity:l[d.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(Tt,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(bt,{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{jt as additional_questions_form_step,Ot as bank_account_document_form_inputs,At as bank_account_form_inputs,Et as bank_account_form_inputs_canada,Dt as business_bank_account_form_step,Bt as business_core_info_form_step,Pt as business_documents_on_file,Nt as business_owners_form_step,Mt as business_representative_form_inputs,Rt as business_representative_form_step,Ft as business_terms_conditions_form_step,Wt as legal_address_form_step,qt as owner_form,Zt as plaid_verification}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h as s,r as i,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-BqNNwq6C.js";import"./p-CZfYo5-1.js";import{c as n}from"./p-BdpSLMs7.js";import{J as a}from"./p-Axa3cgnH.js";import{m as h,C as c,n as v,c as u,e as p}from"./p-NZS8uCtH.js";import{B as m}from"./p-BJu1-9kE.js";import{B as f}from"./p-BcNb9bVO.js";import{m as w}from"./p-Aacb4jqT.js";import{S as b}from"./p-uZ5KAseb.js";import"./p-DVJaoI_m.js";import"./p-HXpYMWUU.js";import"./p-CLHwhyvu.js";import{g,a as y}from"./p-Cm9f5fyh.js";import{T as x}from"./p-Ba8jdOkX.js";import{l as j}from"./p-BRnBHsdq.js";import"./p-DAZd_gFd.js";import"./p-CYQvLgSs.js";import"./p-D8GTwl9v.js";const S=()=>s("div",{class:"row gap-3"},s("div",{class:"col-12"},s(b,{width:"25%"})),s("div",{class:"col-12"},s(b,{width:"100%"})),s("div",{class:"col-12 d-flex gap-3"},s(b,{width:"50%"}),s(b,{width:"50%"})),s("div",{class:"col-12 d-flex gap-3"},s(b,{width:"65%"}),s(b,{width:"35%"}))),C=()=>s("div",{class:"row gap-5"},s("div",{class:"col-12"},s(b,{width:"40%",height:"40px"})),s(S,null)),k=()=>s("div",{class:"terminal-selector-skeleton mt-4 rounded shadow-sm"},s("div",{class:"d-flex align-items-center gap-3"},s(b,{width:"125px",height:"125px",styles:{borderRadius:"8px"}}),s("div",{class:"flex-grow-1"},s("div",{class:"d-flex row flex-row"},s("div",{class:"col-6 flex-column"},s(b,null),s(b,{width:"60%"})),s("div",{class:"d-flex justify-content-end align-items-center gap-2 col-6"},s(b,{width:"32px",height:"32px",styles:{borderRadius:"50%"}}),s(b,{width:"80px",height:"32px"}),s(b,{width:"32px",height:"32px",styles:{borderRadius:"50%"}}))),s("div",{class:"mt-4"},s("div",{class:"d-flex flex-column gap-2"},s(b,null),s(b,null)))))),B=class{constructor(s){i(this,s),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 s;null===(s=this.analytics)||void 0===s||s.cleanup()}handleError(s,i,t){this.error={message:s,code:i,severity:t},this.errorEvent.emit({errorCode:i,message:s,severity:t})}loadData(){this.businessId&&this.authToken?(this.initializeGetBusiness(),this.initializeGetTerminalModels()):this.handleError("Invalid business id or auth token",p.MISSING_PROPS,c.ERROR)}initializeGetBusiness(){w({id:this.businessId,authToken:this.authToken,service:new m})({onSuccess:({business:s})=>{this.business=new f(s)},onError:({error:s,code:i,severity:t})=>{this.handleError(s,i,t)},final:()=>{this.loading.business=!1}})}initializeGetTerminalModels(){(({id:s,authToken:i,service:t})=>async({onSuccess:e,onError:r})=>{var o,l,d,n;try{const a=await t.fetchTerminalModels(s,i);if(a.error)return r({error:y(a.error),code:g(null===(n=a.error)||void 0===n?void 0:n.code),severity:c.ERROR});e({terminals:(null===(l=null===(o=a.data)||void 0===o?void 0:o.terminal_order_models)||void 0===l?void 0:l.map((s=>new h(s))))||[],orderLimit:null===(d=a.data)||void 0===d?void 0:d.order_limit})}catch(s){const i=g(null==s?void 0:s.code);return r({error:s.message||s,code:i,severity:c.ERROR})}})({id:this.accountId,authToken:this.authToken,service:new x})({onSuccess:({terminals:s,orderLimit:i})=>{this.terminalModels=s,this.orderLimit=i,this.loading.terminals=!1},onError:({error:s,code:i,severity:t})=>{this.handleError(s,i,t),this.loading.terminals=!1}})}submitOrder(){const s=(({authToken:s,service:i,apiOrigin:t="https://wc-proxy.justifi.ai"})=>async({terminalOrder:e,onSuccess:r,onError:o})=>{var l;try{const d=await i.orderTerminals(s,e,t);if(d.error)return o({error:y(d.error),code:g(null===(l=d.error)||void 0===l?void 0:l.code),severity:c.ERROR});{const{data:s}=d;r({data:s})}}catch(s){const i=g(null==s?void 0:s.code);return o({error:s.message||s,code:i,severity:c.ERROR})}})({authToken:this.authToken,service:new x});this.submitting=!0,s({terminalOrder:this.order.payload,onSuccess:({data:s})=>{this.submitted.emit(s),this.submitting=!1},onError:({error:s,code:i,severity:t})=>{this.handleError(s,i,t),this.submitting=!1}})}onSelectedQuantityChange(s){this.order.updateTerminal(s.detail.modelName,s.detail.quantity),this.totalQuantity=this.order.totalQuantity}renderLoading(){return s("div",null,this.loading.business&&s(C,null),this.loading.terminals&&s("div",{class:"mt-5"},s(k,null),s(k,null),s(k,null)))}renderBusinessDetails(){var i,t,o,l,d,n,a,h;if(!this.loading.business&&this.business)return s("div",{class:"d-flex flex-column gap-4 mb-5 pt-5"},s("div",{class:"row"},s("div",{class:"col-12"},s("h2",{part:r},this.business.legal_name))),s("div",{class:"row"},s("div",{class:"col-6"},s("h5",{part:e},"Representative:"),s("div",null,s("div",null,null===(t=null===(i=this.business)||void 0===i?void 0:i.representative)||void 0===t?void 0:t.name),s("div",null,null===(l=null===(o=this.business)||void 0===o?void 0:o.representative)||void 0===l?void 0:l.title),s("div",null,null===(n=null===(d=this.business)||void 0===d?void 0:d.representative)||void 0===n?void 0:n.email),s("div",null,j(null===(h=null===(a=this.business)||void 0===a?void 0:a.representative)||void 0===h?void 0:h.phone)))),s("div",{class:"col-6"},s("h5",{part:e},this.shipping?"Shipping Address:":"Business Address:"),s("div",null,this.business.legal_address.line1,this.business.legal_address.line2?`, ${this.business.legal_address.line2}`:"",s("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 s("div",{class:"d-flex flex-column gap-2 mt-5"},this.terminalModels.map((i=>s("terminal-quantity-selector",{modelName:i.model_name,description:i.description,imageUrl:i.image_url,helpUrl:i.help_url,limit:this.orderLimit-this.order.totalQuantity,onSelectedQuantityChange:this.onSelectedQuantityChange.bind(this)}))))}renderOrderSection(){return s("div",{class:"mt-3"},s("div",{class:"text-end"},"Order limit: ",this.orderLimit),s("div",{class:"d-flex justify-content-end mt-3"},s("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 s(d,{key:"a6d128c8f7075ba4bf6dc033e357dac187cdb965"},s("div",{key:"9e726c70efc7e9b9163ded2ca1e88dc4303b2f21",part:l},this.renderLoading(),this.renderBusinessDetails(),this.renderTerminals(),this.renderOrderSection()))}};export{B as justifi_order_terminals}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,h as t,H as a}from"./p-CV0Pyo1O.js";import{b as s,r as i,s as d,c as l}from"./p-Bt4GjEWL.js";import{C as c,I as o,P as r}from"./p-CVaOFfrI.js";import{b as n,x as b,u as f,a0 as u,ak as h}from"./p-CPKMvyV_.js";import{e as m,d as v}from"./p-BcNb9bVO.js";import{c as p}from"./p-D8ytux5N.js";const y=class{constructor(t){e(this,t),this.errors={},this.additional_questions={},this.inputHandler=this.inputHandler.bind(this)}componentDidLoad(){this.formController.errors.subscribe((e=>this.errors=Object.assign({},e))),this.formController.values.subscribe((e=>this.additional_questions=Object.assign({},e.additional_questions)))}inputHandler(e,t){this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{additional_questions:Object.assign(Object.assign({},this.formController.values.getValue().additional_questions),{[e]:t})}))}render(){var e,l,o,r,b,f,u,h,m,v,p,y,k,x;const j=this.formController.getInitialValues().additional_questions;return t(a,{key:"05b69febfcd1e3901109c2cf64d812ff766b81cc"},t("fieldset",{key:"84f06779dff94622fc7d14fdca53efb84f11e8cd"},t("legend",{key:"3079e5d172c833d8172660f2f66b4d9637bfdb21",part:n},"Additional Questions"),t("div",{key:"cf5155033143279316822237a84a0ad5e292a6cd",class:"row gy-3"},t("div",{key:"e28450dacb0d7040d62a4820c0252d95792d7e87",class:"col-12 col-md-6"},t("form-control-monetary-provisioning",{key:"e2ac8f211ffd9848fab123bc7826fd9f18e109a8",name:"business_revenue",label:"What is the business' estimated annual revenue from its primary business activities?",inputHandler:this.inputHandler,errorText:null===(l=null===(e=this.errors)||void 0===e?void 0:e.additional_questions)||void 0===l?void 0:l.business_revenue,defaultValue:null==j?void 0:j.business_revenue,maskOptions:c.WHOLE})),t("div",{key:"c5de85cd5e7b1501a0667a49d8d4826971e93052",class:"col-12 col-md-6"},t("form-control-monetary-provisioning",{key:"3da3805e4ddbc633f060d36487b46e76e4f6eb04",name:"business_payment_volume",label:"What is the business' annual credit card & ACH volume anticipated to process?",inputHandler:this.inputHandler,errorText:null===(r=null===(o=this.errors)||void 0===o?void 0:o.additional_questions)||void 0===r?void 0:r.business_payment_volume,defaultValue:null==j?void 0:j.business_payment_volume,maskOptions:c.WHOLE})),t("div",{key:"ad62fecba837464fddba48273635bc8ae3a7d7ed",class:"col-12"},t("form-control-select",{key:"9f09093b45c1c8eeb63065402f4b15e31c166d51",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===(f=null===(b=this.errors)||void 0===b?void 0:b.additional_questions)||void 0===f?void 0:f.business_when_service_received,options:s,defaultValue:null==j?void 0:j.business_when_service_received})),t("div",{key:"e2a05cbb74138a554033817e3bb1372933e64b99",class:"col-12"},t("form-control-select",{key:"8a95d74c02f2cf662f6cf0658faeae1a1a8f6a11",name:"business_recurring_payments",label:"Does your business offer recurring payments?",inputHandler:this.inputHandler,errorText:null===(h=null===(u=this.errors)||void 0===u?void 0:u.additional_questions)||void 0===h?void 0:h.business_recurring_payments,options:i,defaultValue:null==j?void 0:j.business_recurring_payments})),t("div",{key:"8d94059b0966237c980b1c1622e1ed3fd5bd8a58",class:"col-12"},t("form-control-text",{key:"320fa784aef300393ddfcca4f2ef4798d207bf30",name:"business_recurring_payments_percentage",label:"What percent of revenue is generated from each recurring payment type offered?",inputHandler:this.inputHandler,errorText:null===(v=null===(m=this.errors)||void 0===m?void 0:m.additional_questions)||void 0===v?void 0:v.business_recurring_payments_percentage,defaultValue:null==j?void 0:j.business_recurring_payments_percentage})),t("div",{key:"8525c21ec91e652737455e7b093ff280800d97c2",class:"col-12"},t("form-control-select",{key:"c2cba23606b03f758ba704c074a65a212e111998",name:"business_seasonal",label:"Is this business seasonal?",inputHandler:this.inputHandler,errorText:null===(y=null===(p=this.errors)||void 0===p?void 0:p.additional_questions)||void 0===y?void 0:y.business_seasonal,options:d,defaultValue:null==j?void 0:j.business_seasonal})),t("div",{key:"c047c43284fbe92952c487544bc8206c98433edc",class:"col-12"},t("form-control-text",{key:"27348b1899f8b8f7f18a0618aa4dcb812a3bef04",name:"business_other_payment_details",label:"Is there anything else you would like us to know about how your customers pay the business?",inputHandler:this.inputHandler,errorText:null===(x=null===(k=this.errors)||void 0===k?void 0:k.additional_questions)||void 0===x?void 0:x.business_other_payment_details,defaultValue:null==j?void 0:j.business_other_payment_details})))))}},k=class{constructor(t){e(this,t),this.errors={},this.coreInfo={},this.isEditingTaxId=!1,this.inputHandler=this.inputHandler.bind(this)}componentDidLoad(){this.formController.values.subscribe((e=>this.coreInfo=Object.assign({},new m(e)))),this.formController.errors.subscribe((e=>{this.errors=Object.assign({},e)}))}inputHandler(e,t){this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[e]:t}))}render(){var e,s;const i=this.formController.getInitialValues();return t(a,{key:"9c73706505c1fa0a56d7eb68fc1c4c0a6fffd1dc"},t("fieldset",{key:"d30bae9bab7ffd0e385ce276e7797cfd606e5a42"},t("legend",{key:"5792db95cbbc080f3c990b4b9cea84484f374ec3",part:n},"General Info"),t("div",{key:"ae7fa3c788d625d60cfc83b270312946dce97f0b",class:"row gy-3"},t("div",{key:"f7e5ab1ec57a8ce8de5ef8591ecad8b2fbd2f030",class:"col-12"},t("form-control-text",{key:"fa96501ceca053263029489a74bddd31222b1462",name:"legal_name",label:"Legal Name",defaultValue:i.legal_name,errorText:this.errors.legal_name,inputHandler:this.inputHandler})),t("div",{key:"21e14d0c13017376d7e74e84169f30fe05fa13af",class:"col-12"},t("form-control-text",{key:"266187ec2209299a4b0ebc4c7d600c670de3b21f",name:"doing_business_as",label:"Doing Business As (DBA)",defaultValue:i.doing_business_as,errorText:this.errors.doing_business_as,inputHandler:this.inputHandler})),t("div",{key:"d9bbb19b4ec15a18a0467444e964512114e74031",class:"col-12 col-md-8"},t("form-control-select",{key:"fe490b4abb4a1e07392db9ad4e4c15b02d928f4c",name:"classification",label:"Business Classification",options:l,defaultValue:i.classification,errorText:this.errors.classification,inputHandler:this.inputHandler})),t("div",{key:"fc5dafdace199fd34d22f22d629d87fc8ff7cc3e",class:"col-12 col-md-4"},t("form-control-date",{key:"0263cdef27d1b36c22bde16dbdb3777ad9ef62e3",name:"date_of_incorporation",label:"Date of Incorporation",defaultValue:i.date_of_incorporation,errorText:this.errors.date_of_incorporation,inputHandler:this.inputHandler})),t("div",{key:"2ae2b710d615e5314d4b836b9a498fc9140b749a",class:"col-12 col-md-6"},t("form-control-text",{key:"f6e738254ff7ead5680b895b6df77dc58efbc393",name:"industry",label:"Industry",defaultValue:i.industry,errorText:this.errors.industry,inputHandler:this.inputHandler})),t("div",{key:"8a01de0514d495b103aa43070d268070f57af62a",class:"col-12 col-md-6"},!(null===(e=this.coreInfo)||void 0===e?void 0:e.tax_id_last4)||this.isEditingTaxId?t("form-control-number-masked",{name:"tax_id",label:p[this.country].taxIdLabel,defaultValue:this.isEditingTaxId?"":i.tax_id,errorText:this.errors.tax_id,inputHandler:this.inputHandler,mask:o[this.country],helpText:p[this.country].taxIdHelpText}):t("div",null,t("label",{class:"form-label",part:b},p[this.country].taxIdLabel),t("div",{class:"input-group mb-3"},t("input",{type:"text",class:"form-control",part:f,value:`****${null===(s=this.coreInfo)||void 0===s?void 0:s.tax_id_last4}`,disabled:!0}),t("button",{class:"btn btn-secondary",type:"button",part:u,onClick:()=>{this.isEditingTaxId=!0,this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{tax_id:""}))}},"Change")))),t("div",{key:"66292d95dd8ead1367c1eef3a96aa1fb9e707810",class:"col-12"},t("form-control-text",{key:"de144c99e186470c37d0d330c8aa480fb00ef037",name:"website_url",label:"Website URL",defaultValue:i.website_url,errorText:this.errors.website_url,inputHandler:this.inputHandler})),t("div",{key:"c43095be28c660a2312c37c6856abeae7f952299",class:"col-12 col-md-6"},t("form-control-text",{key:"e4afa2d37cd5dc26006b116c7d574e1c7dd4a0ef",name:"email",label:"Email Address",defaultValue:i.email,errorText:this.errors.email,inputHandler:this.inputHandler})),t("div",{key:"a68760b724c42da71a93ab7944152a8137d51cc8",class:"col-12 col-md-6"},t("form-control-number-masked",{key:"6532f13f43391e8752f625296fb3685d7d68e084",name:"phone",label:"Phone Number",defaultValue:i.phone,errorText:this.errors.phone,inputHandler:this.inputHandler,mask:r.US})))))}},x=class{constructor(t){e(this,t),this.errors={},this.representative={},this.isEditingIdentification=!1,this.inputHandler=(e,t)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{representative:Object.assign(Object.assign({},this.formController.values.getValue().representative),{[e]:t})}))},this.onAddressFormUpdate=e=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{representative:Object.assign(Object.assign({},this.formController.values.getValue().representative),{address:Object.assign(Object.assign({},this.formController.values.getValue().representative.address),e)})}))},this.onDateOfBirthUpdate=e=>{const t=v(e.detail);this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{representative:Object.assign(Object.assign({},this.formController.values.getValue().representative),{dob_day:t.dob_day,dob_month:t.dob_month,dob_year:t.dob_year})}))}}get identificationNumberLabel(){var e;return(null===(e=this.representative)||void 0===e?void 0:e.ssn_last4)?p[this.country].idNumberLabelOptional:p[this.country].idNumberLabel}componentDidLoad(){this.formController.errors.subscribe((e=>this.errors=Object.assign({},e.representative))),this.formController.values.subscribe((e=>this.representative=Object.assign({},e.representative)))}render(){var e,s;const i=this.formController.getInitialValues().representative;return t(a,{key:"c12be1414101467b72170c101cb3d7792f0fafe0"},t("fieldset",{key:"821c9982121243de546bfe95094402379e704659"},t("legend",{key:"48d43758a4d62dcd977eeb9703bae8ac153b9bf4",part:n},"Representative"),t("div",{key:"458edb00ebc0817623cd0fe70b8221c178cac168",class:"row gy-3"},t("div",{key:"5d6b3fc92d7c6fb6bf729881bf26198ea796cbfa",class:"col-12 col-md-8"},t("form-control-text",{key:"73eb60a383a45664050dd53bbc8b22b1e54ec22f",name:"name",label:"Full Name",defaultValue:null==i?void 0:i.name,errorText:this.errors.name,inputHandler:this.inputHandler})),t("div",{key:"fa4b8c69dc03d7ffeecf98badd5cda52edc370e5",class:"col-12 col-md-4"},t("form-control-text",{key:"3cc743bd85400c30741b6c05c3c098badce49a58",name:"title",label:"Title",defaultValue:null==i?void 0:i.title,errorText:this.errors.title,inputHandler:this.inputHandler})),t("div",{key:"83daa42529e73c5b946830dded92d0d48c95b251",class:"col-12 col-md-6"},t("form-control-text",{key:"046a7537d6a2c5ab90d0069f91cc75f42a925e27",name:"email",label:"Email Address",defaultValue:null==i?void 0:i.email,errorText:this.errors.email,inputHandler:this.inputHandler})),t("div",{key:"9de7ac978409f7d5b6064cbeaa30771a6002fa5b",class:"col-12 col-md-6"},t("form-control-number-masked",{key:"05bd882e8d76b6bc1dbc44fc4e1951d14d6d2649",name:"phone",label:"Phone Number",defaultValue:null==i?void 0:i.phone,errorText:this.errors.phone,inputHandler:this.inputHandler,mask:r.US})),t("div",{key:"b511c08db58c2442746a497c7d784cd0605e9f17",class:"col-12 col-md-4"},t("form-control-date",{key:"46be9d7a916f72c583b0d47a528e6e3d2443ac83",name:"dob_full",label:"Birth Date",defaultValue:null==i?void 0:i.dob_full,errorText:this.errors.dob_full,inputHandler:this.inputHandler,onFormControlInput:this.onDateOfBirthUpdate})),t("div",{key:"ae69c549fdf91314f4be3fa2d922c73bc19253ed",class:"col-12 col-md-8"},!(null===(e=this.representative)||void 0===e?void 0:e.ssn_last4)||this.isEditingIdentification?t("form-control-number-masked",{name:"identification_number",label:this.identificationNumberLabel,defaultValue:this.isEditingIdentification?"":null==i?void 0:i.identification_number,errorText:this.errors.identification_number,inputHandler:this.inputHandler,mask:o[this.country],helpText:p[this.country].identityHelpText}):t("div",null,t("label",{class:"form-label",part:b},this.identificationNumberLabel),t("div",{class:"input-group mb-3"},t("input",{type:"text",class:"form-control",part:f,value:`****${null===(s=this.representative)||void 0===s?void 0:s.ssn_last4}`,disabled:!0}),t("button",{class:"btn btn-secondary",type:"button",part:u,onClick:()=>{this.isEditingIdentification=!0,this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{representative:Object.assign(Object.assign({},this.formController.values.getValue().representative),{ssn_last4:null,identification_number:""})}))}},"Change")))),t("div",{key:"dc7a74fe3641cfb03e682a6170c04efbd15b41d0",class:"col-12"},t("identity-address-form",{key:"3756996788014f46ecfda29a3e5f9212b749a5d8",errors:this.errors.address,defaultValues:null==i?void 0:i.address,handleFormUpdate:this.onAddressFormUpdate,country:this.country})))))}},j=class{constructor(t){e(this,t)}render(){return this.text?this.hideAlert?null:t("div",{class:"alert alert-danger d-flex align-items-center",role:"alert",part:h},t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"currentColor",class:"bi bi-exclamation-triangle-fill flex-shrink-0 me-2",viewBox:"0 0 16 16",role:"img","aria-label":"Warning:"},t("path",{d:"M8.982 1.566a1.13 1.13 0 0 0-1.96 0L.165 13.233c-.457.778.091 1.767.98 1.767h13.713c.889 0 1.438-.99.98-1.767L8.982 1.566zM8 5c.535 0 .954.462.9.995l-.35 3.507a.552.552 0 0 1-1.1 0L7.1 5.995A.905.905 0 0 1 8 5zm.002 6a1 1 0 1 1 0 2 1 1 0 0 1 0-2z"})),t("div",null,this.text)):null}},O=class{constructor(t){e(this,t),this.errors={},this.inputHandler=this.inputHandler.bind(this)}componentDidLoad(){this.formController.errors.subscribe((e=>this.errors=Object.assign({},e))),this.formController.values.subscribe((e=>this.legal_address=Object.assign({},e.legal_address)))}inputHandler(e,t){this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{legal_address:Object.assign(Object.assign({},this.formController.values.getValue().legal_address),{[e]:t})}))}render(){var e;const s=this.formController.getInitialValues().legal_address;return t(a,{key:"856cd25caef521b651b9dd8a40dc6f9f0c727706"},t("fieldset",{key:"150ad1f56747aae80ae8d2610fa08fcabee27c87"},t("legend",{key:"565a46bd0977680e400663ef0590d65e977135be",part:n},"Business Legal Address"),t("form-address-fields",{key:"c2ce05c006ec80c5319b30b40387e400ec52ab86",country:this.country,errors:null===(e=this.errors)||void 0===e?void 0:e.legal_address,defaultValues:s,inputHandler:this.inputHandler})))}};export{y as additional_questions,k as business_core_info,x as business_representative,j as form_alert,O as legal_address_form}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{A as t}from"./p-CYQvLgSs.js";import"./p-NZS8uCtH.js";import"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";const n=t();class a{async fetchPayments(t,a,s){return n.get({endpoint:`account/${t}/payments`,params:s,authToken:a})}async fetchPayment(t,a){return n.get({endpoint:`payments/${t}`,authToken:a})}async fetchPaymentTransactions(t,a,s){return n.get({endpoint:`payments/${t}/payment_balance_transactions`,params:s,authToken:a})}}export{a as P}
|