@justifi/webcomponents 6.10.1 → 6.10.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/bank-account-document-form-inputs_9.cjs.entry.js +1 -1
- package/dist/cjs/{check-pkg-version-PX_ogtrH.js → check-pkg-version-DpY7PKYF.js} +1 -1
- package/dist/cjs/form-control-number-masked_3.cjs.entry.js +1 -1
- package/dist/cjs/hidden-input_2.cjs.entry.js +1 -1
- package/dist/cjs/internal-tokenize-payment-method_7.cjs.entry.js +2 -2
- package/dist/cjs/justifi-additional-questions-form-step_9.cjs.entry.js +14 -3
- package/dist/cjs/justifi-apple-pay_8.cjs.entry.js +15 -10
- package/dist/cjs/justifi-business-details.cjs.entry.js +2 -2
- package/dist/cjs/justifi-business-form.cjs.entry.js +2 -2
- package/dist/cjs/justifi-checkout.cjs.entry.js +2 -2
- package/dist/cjs/justifi-checkouts-list.cjs.entry.js +2 -2
- package/dist/cjs/justifi-dispute-management.cjs.entry.js +2 -2
- package/dist/cjs/justifi-dispute-notification_3.cjs.entry.js +2 -2
- package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +2 -2
- package/dist/cjs/justifi-order-terminals.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payment-details.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payment-transactions-list.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payments-list.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payout-details.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payout-transactions-list.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payouts-list.cjs.entry.js +2 -2
- package/dist/cjs/justifi-refund-payment.cjs.entry.js +2 -2
- package/dist/cjs/justifi-season-interruption-insurance.cjs.entry.js +2 -2
- package/dist/cjs/justifi-terminal-orders-list.cjs.entry.js +2 -2
- package/dist/cjs/justifi-terminals-list.cjs.entry.js +2 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{package-uJFBawLq.js → package-C7-boC1U.js} +1 -1
- package/dist/cjs/webcomponents.cjs.js +1 -1
- package/dist/collection/components/business-forms/payment-provisioning/bank-account/business-bank-account-form-step.js +16 -4
- 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/form-address-fields/form-address-fields.js +1 -1
- package/dist/collection/components/business-forms/payment-provisioning/plaid-verification/plaid-verification.js +2 -2
- package/dist/collection/components/modular-checkout/sub-components/apple-pay.js +14 -9
- package/dist/docs.json +1 -1
- package/dist/esm/bank-account-document-form-inputs_9.entry.js +2 -2
- package/dist/esm/{check-pkg-version-Dun0W_E2.js → check-pkg-version-DKbeTbtv.js} +1 -1
- package/dist/esm/form-control-number-masked_3.entry.js +1 -1
- package/dist/esm/hidden-input_2.entry.js +1 -1
- package/dist/esm/internal-tokenize-payment-method_7.entry.js +2 -2
- package/dist/esm/justifi-additional-questions-form-step_9.entry.js +15 -4
- package/dist/esm/justifi-apple-pay_8.entry.js +15 -10
- package/dist/esm/justifi-business-details.entry.js +2 -2
- package/dist/esm/justifi-business-form.entry.js +2 -2
- package/dist/esm/justifi-checkout.entry.js +2 -2
- package/dist/esm/justifi-checkouts-list.entry.js +2 -2
- package/dist/esm/justifi-dispute-management.entry.js +2 -2
- package/dist/esm/justifi-dispute-notification_3.entry.js +2 -2
- package/dist/esm/justifi-gross-payment-chart.entry.js +2 -2
- package/dist/esm/justifi-order-terminals.entry.js +2 -2
- package/dist/esm/justifi-payment-details.entry.js +2 -2
- package/dist/esm/justifi-payment-provisioning.entry.js +2 -2
- package/dist/esm/justifi-payment-transactions-list.entry.js +2 -2
- package/dist/esm/justifi-payments-list.entry.js +2 -2
- package/dist/esm/justifi-payout-details.entry.js +2 -2
- package/dist/esm/justifi-payout-transactions-list.entry.js +2 -2
- package/dist/esm/justifi-payouts-list.entry.js +2 -2
- package/dist/esm/justifi-refund-payment.entry.js +2 -2
- package/dist/esm/justifi-season-interruption-insurance.entry.js +2 -2
- package/dist/esm/justifi-terminal-orders-list.entry.js +2 -2
- package/dist/esm/justifi-terminals-list.entry.js +2 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{package-CfQ5vkQ3.js → package-C2WozQkF.js} +1 -1
- package/dist/esm/webcomponents.js +1 -1
- package/dist/module/apple-pay.js +13 -8
- package/dist/module/business-bank-account-form-step.js +15 -3
- package/dist/module/business-core-info-form-step.js +2 -2
- package/dist/module/business-core-info.js +1 -1
- package/dist/module/business-owners-form-step.js +1 -1
- package/dist/module/business-representative-form-inputs.js +1 -1
- package/dist/module/business-representative.js +1 -1
- package/dist/module/button.js +1 -1
- package/dist/module/dispute-notification.js +1 -1
- package/dist/module/dispute-response-core.js +1 -1
- package/dist/module/form-address-fields.js +1 -1
- package/dist/module/justifi-order-terminals.js +1 -1
- package/dist/module/owner-form-inputs2.js +1 -1
- package/dist/module/package.js +1 -1
- package/dist/module/parts.js +1 -1
- package/dist/module/plaid-verification2.js +2 -2
- package/dist/module/terminal-quantity-selector2.js +1 -1
- package/dist/types/components/business-forms/payment-provisioning/bank-account/business-bank-account-form-step.d.ts +3 -0
- package/dist/types/ui-components/button.d.ts +1 -1
- package/dist/webcomponents/{p-3798d389.entry.js → p-00ba4cf6.entry.js} +1 -1
- package/dist/webcomponents/{p-b6ffa313.entry.js → p-02dfdc6f.entry.js} +1 -1
- package/dist/webcomponents/{p-32a8b10f.entry.js → p-150a622a.entry.js} +1 -1
- package/dist/webcomponents/{p-917daf31.entry.js → p-163055e3.entry.js} +1 -1
- package/dist/webcomponents/{p-3bbacc8e.entry.js → p-1cd7cdbf.entry.js} +1 -1
- package/dist/webcomponents/p-21b5240d.entry.js +1 -0
- package/dist/webcomponents/p-35d1be0f.entry.js +1 -0
- package/dist/webcomponents/{p-98158303.entry.js → p-39d11c59.entry.js} +1 -1
- package/dist/webcomponents/{p-ab365375.entry.js → p-69c2bbcf.entry.js} +1 -1
- package/dist/webcomponents/{p-3c647db5.entry.js → p-6f2b0469.entry.js} +1 -1
- package/dist/webcomponents/{p-18658148.entry.js → p-7bf586ca.entry.js} +1 -1
- package/dist/webcomponents/{p-d9118b1e.entry.js → p-7e3030c2.entry.js} +1 -1
- package/dist/webcomponents/p-88d6068d.entry.js +1 -0
- package/dist/webcomponents/{p-a141c90b.entry.js → p-9dedad17.entry.js} +1 -1
- package/dist/webcomponents/p-C2WozQkF.js +1 -0
- package/dist/webcomponents/{p-eEJvKFFX.js → p-DX6fcx_0.js} +1 -1
- package/dist/webcomponents/p-a2b016a7.entry.js +1 -0
- package/dist/webcomponents/{p-4116808e.entry.js → p-a959ca16.entry.js} +1 -1
- package/dist/webcomponents/{p-660a04c0.entry.js → p-b0e83a6e.entry.js} +1 -1
- package/dist/webcomponents/{p-ad962b59.entry.js → p-c9ea1b77.entry.js} +1 -1
- package/dist/webcomponents/{p-a87a7fad.entry.js → p-d246e573.entry.js} +1 -1
- package/dist/webcomponents/{p-092653b6.entry.js → p-d35b09bf.entry.js} +1 -1
- package/dist/webcomponents/{p-3caa3604.entry.js → p-e3d03faf.entry.js} +1 -1
- package/dist/webcomponents/{p-5f402409.entry.js → p-e817f8fc.entry.js} +1 -1
- package/dist/webcomponents/{p-f5362ed9.entry.js → p-e8cd3097.entry.js} +1 -1
- package/dist/webcomponents/{p-e8eeb4f1.entry.js → p-eaa9cb8e.entry.js} +1 -1
- package/dist/webcomponents/{p-990d3709.entry.js → p-f55a6397.entry.js} +1 -1
- package/dist/webcomponents/webcomponents.esm.js +1 -1
- package/package.json +1 -1
- package/dist/webcomponents/p-12665340.entry.js +0 -1
- package/dist/webcomponents/p-334beb48.entry.js +0 -1
- package/dist/webcomponents/p-CfQ5vkQ3.js +0 -1
- package/dist/webcomponents/p-a713a90d.entry.js +0 -1
- package/dist/webcomponents/p-d5516a10.entry.js +0 -1
|
@@ -10,7 +10,7 @@ import { B as BusinessService, a as BusinessBankAccountService, D as DocumentRec
|
|
|
10
10
|
import { c as create$3, a as create$6, d as create$8, F as FormController } from './form.js';
|
|
11
11
|
import { A as accountNumberValidation, B as accountTypeValidation, i as identityNameValidation, C as nicknameValidation, D as bankNameValidation, E as numbersOnlyRegex, F as routingNumberValidation } from './schema-validations.js';
|
|
12
12
|
import { B as BusinessFormStep } from './event-types2.js';
|
|
13
|
-
import { h as heading2,
|
|
13
|
+
import { h as heading2, a1 as buttonLink, Z as buttonSecondary } from './parts.js';
|
|
14
14
|
import { P as PaymentProvisioningLoading } from './payment-provisioning-loading.js';
|
|
15
15
|
import { B as Button } from './button.js';
|
|
16
16
|
import './details.js';
|
|
@@ -164,6 +164,7 @@ const BusinessBankAccountFormStep = /*@__PURE__*/ proxyCustomElement(class Busin
|
|
|
164
164
|
this.isAddingNewBankAccount = true;
|
|
165
165
|
this.bankAccountVerification = false;
|
|
166
166
|
this.platformAccountId = null;
|
|
167
|
+
this.usePlaidVerification = true;
|
|
167
168
|
this.getSchema = () => {
|
|
168
169
|
const schema = bankAccountSchemaByCountry[this.country];
|
|
169
170
|
return schema(this.allowOptionalFields, this.existingDocuments);
|
|
@@ -225,13 +226,23 @@ const BusinessBankAccountFormStep = /*@__PURE__*/ proxyCustomElement(class Busin
|
|
|
225
226
|
this.handleChangeBankAccount = () => {
|
|
226
227
|
this.isAddingNewBankAccount = true;
|
|
227
228
|
this.documentData = new EntityDocumentStorage();
|
|
229
|
+
// Reset to Plaid if available when changing bank account
|
|
230
|
+
this.usePlaidVerification = this.bankAccountVerification && !!this.platformAccountId;
|
|
228
231
|
this.initializeFormController();
|
|
229
232
|
};
|
|
230
233
|
this.handleCancel = () => {
|
|
231
234
|
this.isAddingNewBankAccount = false;
|
|
232
235
|
this.documentData = new EntityDocumentStorage();
|
|
236
|
+
// Reset toggle state when canceling
|
|
237
|
+
this.usePlaidVerification = true;
|
|
233
238
|
this.initializeFormController();
|
|
234
239
|
};
|
|
240
|
+
this.handleToggleToManualEntry = () => {
|
|
241
|
+
this.usePlaidVerification = false;
|
|
242
|
+
};
|
|
243
|
+
this.handleToggleToPlaidVerification = () => {
|
|
244
|
+
this.usePlaidVerification = true;
|
|
245
|
+
};
|
|
235
246
|
this.handleSaveBankAccount = async () => {
|
|
236
247
|
this.formController.validateAndSubmit(() => {
|
|
237
248
|
this.sendData(() => {
|
|
@@ -477,11 +488,11 @@ const BusinessBankAccountFormStep = /*@__PURE__*/ proxyCustomElement(class Busin
|
|
|
477
488
|
if (this.isLoading) {
|
|
478
489
|
return h(PaymentProvisioningLoading, null);
|
|
479
490
|
}
|
|
480
|
-
return (h("form", null, h("fieldset", { class: "mb-4" }, h("div", { class: "d-flex align-items-center gap-2" }, h("legend", { class: "mb-0", part: heading2 }, "Bank Account Info"), h("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." })), h("hr", { class: "mt-2" }), shouldShowPlaidVerification && (h("div", { class: "mt-3" }, h("plaid-verification", { authToken: this.authToken, accountId: this.platformAccountId, businessId: this.businessId, onPlaidVerificationSuccess: () => {
|
|
491
|
+
return (h("form", null, h("fieldset", { class: "mb-4" }, h("div", { class: "d-flex align-items-center gap-2" }, h("legend", { class: "mb-0", part: heading2 }, "Bank Account Info"), h("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." })), h("hr", { class: "mt-2" }), shouldShowPlaidVerification && this.usePlaidVerification && !this.showReadOnlyView && (h("div", { class: "mt-3" }, h("plaid-verification", { authToken: this.authToken, accountId: this.platformAccountId, businessId: this.businessId, onPlaidVerificationSuccess: () => {
|
|
481
492
|
// Refresh bank account data after successful Plaid verification
|
|
482
493
|
this.isAddingNewBankAccount = false;
|
|
483
494
|
this.refreshBankAccountData();
|
|
484
|
-
} }))), this.country === CountryCode.CAN ? (h("bank-account-form-inputs-canada", { defaultValue: bankAccountDefaultValue, errors: this.errors, inputHandler: this.inputHandler, formDisabled: this.showReadOnlyView })) : (h("bank-account-form-inputs", { defaultValue: bankAccountDefaultValue, errors: this.errors, inputHandler: this.inputHandler, formDisabled: this.showReadOnlyView })), this.showReadOnlyView && (h("div", { class: "mt-3" }, h(Button, { variant: "secondary", type: "button", onClick: this.handleChangeBankAccount, disabled: this.isLoading, part: buttonSecondary }, "Change Bank Account"))), (!this.existingBankAccount || this.isAddingNewBankAccount) && (h("div", { class: "mt-3 d-flex gap-2" }, this.isAddingNewBankAccount && (h(Button, { variant: "secondary", type: "button", onClick: this.handleCancel, disabled: this.isLoading, part: buttonSecondary }, "Cancel")), h(Button, { variant: "primary", type: "button", onClick: this.handleSaveBankAccount, disabled: this.isLoading, isLoading: this.isLoading }, "Save Bank Account")))), h("fieldset", { class: "mt-4" }, h("div", { class: "d-flex align-items-center gap-2" }, h("legend", { class: "mb-0", part: heading2 }, "Document Uploads"), h("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." })), h("hr", { class: "mt-2" }), h("business-documents-on-file", { documents: this.existingDocuments, isLoading: this.isLoading }), h("bank-account-document-form-inputs", { inputHandler: this.inputHandler, errors: this.errors, storeFiles: this.storeFiles }))));
|
|
495
|
+
} }), h("div", { class: "mt-3" }, h(Button, { type: "button", variant: "link", onClick: this.handleToggleToManualEntry, disabled: this.isLoading, part: buttonLink }, "Enter bank details manually (document upload required)")))), (!this.usePlaidVerification || this.showReadOnlyView) && (h("div", null, shouldShowPlaidVerification && !this.usePlaidVerification && !this.showReadOnlyView && (h("div", { class: "mb-3" }, h(Button, { type: "button", variant: "secondary", onClick: this.handleToggleToPlaidVerification, disabled: this.isLoading, part: buttonSecondary }, "Link bank account with Plaid instead"))), this.country === CountryCode.CAN ? (h("bank-account-form-inputs-canada", { defaultValue: bankAccountDefaultValue, errors: this.errors, inputHandler: this.inputHandler, formDisabled: this.showReadOnlyView })) : (h("bank-account-form-inputs", { defaultValue: bankAccountDefaultValue, errors: this.errors, inputHandler: this.inputHandler, formDisabled: this.showReadOnlyView })))), this.showReadOnlyView && (h("div", { class: "mt-3" }, h(Button, { variant: "secondary", type: "button", onClick: this.handleChangeBankAccount, disabled: this.isLoading, part: buttonSecondary }, "Change Bank Account"))), (!this.existingBankAccount || this.isAddingNewBankAccount) && !this.usePlaidVerification && (h("div", { class: "mt-3 d-flex gap-2" }, this.isAddingNewBankAccount && (h(Button, { variant: "secondary", type: "button", onClick: this.handleCancel, disabled: this.isLoading, part: buttonSecondary }, "Cancel")), h(Button, { variant: "primary", type: "button", onClick: this.handleSaveBankAccount, disabled: this.isLoading, isLoading: this.isLoading }, "Save Bank Account")))), (!this.usePlaidVerification || this.showReadOnlyView) && (h("fieldset", { class: "mt-4" }, h("div", { class: "d-flex align-items-center gap-2" }, h("legend", { class: "mb-0", part: heading2 }, "Document Uploads"), h("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." })), h("hr", { class: "mt-2" }), h("business-documents-on-file", { documents: this.existingDocuments, isLoading: this.isLoading }), h("bank-account-document-form-inputs", { inputHandler: this.inputHandler, errors: this.errors, storeFiles: this.storeFiles })))));
|
|
485
496
|
}
|
|
486
497
|
static get watchers() { return {
|
|
487
498
|
"authToken": ["propChanged"],
|
|
@@ -506,6 +517,7 @@ const BusinessBankAccountFormStep = /*@__PURE__*/ proxyCustomElement(class Busin
|
|
|
506
517
|
"postDocument": [32],
|
|
507
518
|
"bankAccountVerification": [32],
|
|
508
519
|
"platformAccountId": [32],
|
|
520
|
+
"usePlaidVerification": [32],
|
|
509
521
|
"validateAndSubmit": [64]
|
|
510
522
|
}, undefined, {
|
|
511
523
|
"authToken": ["propChanged"],
|
|
@@ -8,7 +8,7 @@ import { F as FormController } from './form.js';
|
|
|
8
8
|
import { c as businessClassificationOptions } from './business-form-options.js';
|
|
9
9
|
import { B as BusinessFormStep } from './event-types2.js';
|
|
10
10
|
import { P as PHONE_MASKS } from './form-input-masks.js';
|
|
11
|
-
import { h as heading2, b as label, d as inputDisabled,
|
|
11
|
+
import { h as heading2, b as label, d as inputDisabled, Z as buttonSecondary } from './parts.js';
|
|
12
12
|
import { P as PaymentProvisioningLoading } from './payment-provisioning-loading.js';
|
|
13
13
|
import { c as countryLabels } from './country-config.js';
|
|
14
14
|
import { d as defineCustomElement$6 } from './custom-popper2.js';
|
|
@@ -142,7 +142,7 @@ const BusinessCoreInfoFormStep = /*@__PURE__*/ proxyCustomElement(class Business
|
|
|
142
142
|
if (this.isLoading) {
|
|
143
143
|
return h(PaymentProvisioningLoading, null);
|
|
144
144
|
}
|
|
145
|
-
return (h("form", null, h("fieldset", null, h("div", { class: "d-flex align-items-center gap-2" }, h("legend", { class: "mb-0", part: heading2 }, "Business Information")), h("hr", { class: "mt-2" }), h("div", { class: "row gy-3" }, h("div", { class: "col-12" }, h("form-control-text", { name: "legal_name", label: "Business Name", defaultValue: coreInfoDefaultValue.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)." })), h("div", { class: "col-12" }, h("form-control-text", { name: "doing_business_as", label: "Doing Business As (DBA)", defaultValue: coreInfoDefaultValue.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)" })), h("div", { class: "col-12 col-md-8" }, h("form-control-select", { name: "classification", label: "Business Classification", options: businessClassificationOptions, defaultValue: coreInfoDefaultValue.classification, errorText: this.errors.classification, inputHandler: this.inputHandler })), h("div", { class: "col-12 col-md-4" }, h("form-control-date", { name: "date_of_incorporation", label: "Date of Registration", defaultValue: coreInfoDefaultValue.date_of_incorporation, errorText: this.errors.date_of_incorporation, inputHandler: this.inputHandler })), h("div", { class: "col-12 col-md-6" }, h("form-control-text", { name: "industry", label: "Industry", defaultValue: coreInfoDefaultValue.industry, errorText: this.errors.industry, inputHandler: this.inputHandler, helpText: "Describe what you sell" })), h("div", { class: "col-12 col-md-6" }, (!((_a = this.coreInfo) === null || _a === void 0 ? void 0 : _a.tax_id_last4) || this.isEditingTaxId) ? (h("form-control-number-masked", { name: "tax_id", label: countryLabels[this.country].taxIdLabel, defaultValue: this.isEditingTaxId ? '' : coreInfoDefaultValue.tax_id, errorText: this.errors.tax_id, inputHandler: this.inputHandler, mask: '000000000', helpText: countryLabels[this.country].taxIdHelpText })) : (h("div", null, h("label", { class: "form-label", part: label }, countryLabels[this.country].taxIdLabel), h("div", { class: "input-group mb-3" }, h("input", { type: "text", class: "form-control", part: inputDisabled, value: `****${(_b = this.coreInfo) === null || _b === void 0 ? void 0 : _b.tax_id_last4}`, disabled: true }), h("button", { class: "btn btn-secondary", type: "button", part: buttonSecondary, onClick: () => {
|
|
145
|
+
return (h("form", null, h("fieldset", null, h("div", { class: "d-flex align-items-center gap-2" }, h("legend", { class: "mb-0", part: heading2 }, "Business Information")), h("hr", { class: "mt-2" }), h("div", { class: "row gy-3" }, h("div", { class: "col-12 col-md-6" }, h("form-control-text", { name: "legal_name", label: "Business Name", defaultValue: coreInfoDefaultValue.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)." })), h("div", { class: "col-12 col-md-6" }, h("form-control-text", { name: "doing_business_as", label: "Doing Business As (DBA)", defaultValue: coreInfoDefaultValue.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)" })), h("div", { class: "col-12 col-md-8" }, h("form-control-select", { name: "classification", label: "Business Classification", options: businessClassificationOptions, defaultValue: coreInfoDefaultValue.classification, errorText: this.errors.classification, inputHandler: this.inputHandler })), h("div", { class: "col-12 col-md-4" }, h("form-control-date", { name: "date_of_incorporation", label: "Date of Registration", defaultValue: coreInfoDefaultValue.date_of_incorporation, errorText: this.errors.date_of_incorporation, inputHandler: this.inputHandler })), h("div", { class: "col-12 col-md-6" }, h("form-control-text", { name: "industry", label: "Industry", defaultValue: coreInfoDefaultValue.industry, errorText: this.errors.industry, inputHandler: this.inputHandler, helpText: "Describe what you sell" })), h("div", { class: "col-12 col-md-6" }, (!((_a = this.coreInfo) === null || _a === void 0 ? void 0 : _a.tax_id_last4) || this.isEditingTaxId) ? (h("form-control-number-masked", { name: "tax_id", label: countryLabels[this.country].taxIdLabel, defaultValue: this.isEditingTaxId ? '' : coreInfoDefaultValue.tax_id, errorText: this.errors.tax_id, inputHandler: this.inputHandler, mask: '000000000', helpText: countryLabels[this.country].taxIdHelpText })) : (h("div", null, h("label", { class: "form-label", part: label }, countryLabels[this.country].taxIdLabel), h("div", { class: "input-group mb-3" }, h("input", { type: "text", class: "form-control", part: inputDisabled, value: `****${(_b = this.coreInfo) === null || _b === void 0 ? void 0 : _b.tax_id_last4}`, disabled: true }), h("button", { class: "btn btn-secondary", type: "button", part: buttonSecondary, onClick: () => {
|
|
146
146
|
this.isEditingTaxId = true;
|
|
147
147
|
// Clear last4-equivalent and current value if any future conditional validation depends on it
|
|
148
148
|
this.formController.setValues(Object.assign(Object.assign({}, this.formController.values.getValue()), { tax_id: '', tax_id_last4: null }));
|
|
@@ -2,7 +2,7 @@ import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal
|
|
|
2
2
|
import { c as businessClassificationOptions } from './business-form-options.js';
|
|
3
3
|
import { I as IDENTITY_MASKS, P as PHONE_MASKS } from './form-input-masks.js';
|
|
4
4
|
import { C as CoreBusinessInfo } from './Business.js';
|
|
5
|
-
import { h as heading2, b as label, d as inputDisabled,
|
|
5
|
+
import { h as heading2, b as label, d as inputDisabled, Z as buttonSecondary } from './parts.js';
|
|
6
6
|
import { c as countryLabels } from './country-config.js';
|
|
7
7
|
import { d as defineCustomElement$6 } from './custom-popper2.js';
|
|
8
8
|
import { d as defineCustomElement$5 } from './form-control-date2.js';
|
|
@@ -3,7 +3,7 @@ import { a as ComponentErrorSeverity, C as ComponentErrorCodes } from './Plaid.j
|
|
|
3
3
|
import { m as makeGetBusiness, a as makePatchBusiness } from './payment-provisioning-actions.js';
|
|
4
4
|
import { B as BusinessService } from './business.service.js';
|
|
5
5
|
import { B as Button } from './button.js';
|
|
6
|
-
import { h as heading2,
|
|
6
|
+
import { h as heading2, _ as alert } from './parts.js';
|
|
7
7
|
import './details.js';
|
|
8
8
|
import './event-types.js';
|
|
9
9
|
import './justifi-radio-list-item2.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
|
|
2
2
|
import { u as updateFormValues, a as updateAddressFormValues, b as updateDateOfBirthFormValues } from './input-handlers.js';
|
|
3
3
|
import { P as PHONE_MASKS, I as IDENTITY_MASKS } from './form-input-masks.js';
|
|
4
|
-
import { h as heading2, b as label, d as inputDisabled,
|
|
4
|
+
import { h as heading2, b as label, d as inputDisabled, Z as buttonSecondary } from './parts.js';
|
|
5
5
|
import { c as countryLabels } from './country-config.js';
|
|
6
6
|
import { d as defineCustomElement$8 } from './custom-popper2.js';
|
|
7
7
|
import { d as defineCustomElement$7 } from './form-control-date2.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
2
|
import { P as PHONE_MASKS, I as IDENTITY_MASKS } from './form-input-masks.js';
|
|
3
3
|
import { d as deconstructDate } from './Business.js';
|
|
4
|
-
import { h as heading2, b as label, d as inputDisabled,
|
|
4
|
+
import { h as heading2, b as label, d as inputDisabled, Z as buttonSecondary } from './parts.js';
|
|
5
5
|
import { c as countryLabels } from './country-config.js';
|
|
6
6
|
import { d as defineCustomElement$8 } from './custom-popper2.js';
|
|
7
7
|
import { d as defineCustomElement$7 } from './form-control-date2.js';
|
package/dist/module/button.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { h } from '@stencil/core/internal/client';
|
|
2
|
-
import {
|
|
2
|
+
import { Z as buttonSecondary, Y as buttonPrimary, a2 as buttonLoading } from './parts.js';
|
|
3
3
|
|
|
4
4
|
const ButtonSpinner = () => (h("div", { class: "spinner-border spinner-border-sm", role: "status", part: "button-spinner" }, h("span", { class: "visually-hidden" }, "Loading...")));
|
|
5
5
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
2
|
import { c as formatCurrency } from './utils2.js';
|
|
3
|
-
import { t as text,
|
|
3
|
+
import { t as text, $ as heading4 } from './parts.js';
|
|
4
4
|
import { B as Button } from './button.js';
|
|
5
5
|
import { S as StyledHost } from './styled-host.js';
|
|
6
6
|
import { S as Skeleton } from './skeleton.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
2
|
import { D as DisputeManagementClickActions } from './event-types3.js';
|
|
3
|
-
import {
|
|
3
|
+
import { $ as heading4 } from './parts.js';
|
|
4
4
|
import { B as Button } from './button.js';
|
|
5
5
|
import { d as defineCustomElement$f } from './custom-popper2.js';
|
|
6
6
|
import { d as defineCustomElement$e } from './form-control-date2.js';
|
|
@@ -19,7 +19,7 @@ const FormAddressFields = /*@__PURE__*/ proxyCustomElement(class FormAddressFiel
|
|
|
19
19
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
20
20
|
const labels = countryLabels[this.country];
|
|
21
21
|
const options = countryOptions[this.country];
|
|
22
|
-
return (h(Host, { key: '8dabbee93e0f319db333ada6c20af49ed6131b8d' }, h("div", { key: '4b308ca9fa92321e5f60f3e4d9ab1c4e60cbd703', class: "row gy-3" }, h("div", { key: '9c25eec2effd7caed70a3f02f6a780513fae930c', class: "col-12" }, h("form-control-text", { key: '6c2ae178c2122d1f6085906690adadf98cb0774b', name: "line1", label: "Street Address", inputHandler: this.inputHandler, defaultValue: (_a = this.defaultValues) === null || _a === void 0 ? void 0 : _a.line1, errorText: (_b = this.errors) === null || _b === void 0 ? void 0 : _b.line1, helpText: "No PO Boxes." })), h("div", { key: 'eba53a69fc4c869014ef8b7bf6ff9b1d8f5be566', class: "col-12" }, h("form-control-text", { key: '11c743ce2388173c41cb16f1865fe58b2015d6bb', name: "line2", label: "Address Line 2 (optional)", inputHandler: this.inputHandler, defaultValue: (_c = this.defaultValues) === null || _c === void 0 ? void 0 : _c.line2, errorText: (_d = this.errors) === null || _d === void 0 ? void 0 : _d.line2 })), h("div", { key: '2025c9bb15286f5c3e4693b596372a7dff730ce8', class: "col-12" }, h("form-control-text", { key: '5e0e40fd028d12b88cb15a38906738320e30aeca', name: "city", label: "City", inputHandler: this.inputHandler, defaultValue: (_e = this.defaultValues) === null || _e === void 0 ? void 0 : _e.city, errorText: (_f = this.errors) === null || _f === void 0 ? void 0 : _f.city })), h("div", { key: '
|
|
22
|
+
return (h(Host, { key: '8dabbee93e0f319db333ada6c20af49ed6131b8d' }, h("div", { key: '4b308ca9fa92321e5f60f3e4d9ab1c4e60cbd703', class: "row gy-3" }, h("div", { key: '9c25eec2effd7caed70a3f02f6a780513fae930c', class: "col-12" }, h("form-control-text", { key: '6c2ae178c2122d1f6085906690adadf98cb0774b', name: "line1", label: "Street Address", inputHandler: this.inputHandler, defaultValue: (_a = this.defaultValues) === null || _a === void 0 ? void 0 : _a.line1, errorText: (_b = this.errors) === null || _b === void 0 ? void 0 : _b.line1, helpText: "No PO Boxes." })), h("div", { key: 'eba53a69fc4c869014ef8b7bf6ff9b1d8f5be566', class: "col-12" }, h("form-control-text", { key: '11c743ce2388173c41cb16f1865fe58b2015d6bb', name: "line2", label: "Address Line 2 (optional)", inputHandler: this.inputHandler, defaultValue: (_c = this.defaultValues) === null || _c === void 0 ? void 0 : _c.line2, errorText: (_d = this.errors) === null || _d === void 0 ? void 0 : _d.line2 })), h("div", { key: '2025c9bb15286f5c3e4693b596372a7dff730ce8', class: "col-12" }, h("form-control-text", { key: '5e0e40fd028d12b88cb15a38906738320e30aeca', name: "city", label: "City", inputHandler: this.inputHandler, defaultValue: (_e = this.defaultValues) === null || _e === void 0 ? void 0 : _e.city, errorText: (_f = this.errors) === null || _f === void 0 ? void 0 : _f.city })), h("div", { key: '407eac6eee8ca33a6648f2d1a45003961353f877', class: "col-12 col-md-6" }, h("form-control-select", { key: 'c598b24e0dc594ae725a7473212a6ed36102ce49', name: "state", label: labels.stateLabel, options: options.stateOptions, inputHandler: this.inputHandler, defaultValue: (_g = this.defaultValues) === null || _g === void 0 ? void 0 : _g.state, errorText: (_h = this.errors) === null || _h === void 0 ? void 0 : _h.state })), h("div", { key: '49861d791272c745f881d19016b93885ce59f724', class: "col-12 col-md-6" }, h("form-control-text", { key: '90b9db4630dd4fad7e86151f2a632cd62b8509f3', name: "postal_code", label: labels.postalLabel, inputHandler: this.inputHandler, defaultValue: (_j = this.defaultValues) === null || _j === void 0 ? void 0 : _j.postal_code, errorText: (_k = this.errors) === null || _k === void 0 ? void 0 : _k.postal_code, maxLength: this.country === CountryCode.USA ? 5 : 7, keyDownHandler: this.country === CountryCode.USA ? numberOnlyHandler : undefined })))));
|
|
23
23
|
}
|
|
24
24
|
}, [256, "justifi-form-address-fields", {
|
|
25
25
|
"country": [1],
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { h, proxyCustomElement, HTMLElement, createEvent } from '@stencil/core/internal/client';
|
|
2
|
-
import {
|
|
2
|
+
import { $ as heading4, a3 as heading5, Y as buttonPrimary, t as text } from './parts.js';
|
|
3
3
|
import { S as StyledHost } from './styled-host.js';
|
|
4
4
|
import './details.js';
|
|
5
5
|
import './event-types.js';
|
|
@@ -2,7 +2,7 @@ import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/clien
|
|
|
2
2
|
import { P as PHONE_MASKS, I as IDENTITY_MASKS } from './form-input-masks.js';
|
|
3
3
|
import { u as updateFormValues, a as updateAddressFormValues, b as updateDateOfBirthFormValues } from './input-handlers.js';
|
|
4
4
|
import { c as countryLabels } from './country-config.js';
|
|
5
|
-
import { b as label, d as inputDisabled,
|
|
5
|
+
import { b as label, d as inputDisabled, Z as buttonSecondary } from './parts.js';
|
|
6
6
|
import { d as defineCustomElement$9 } from './custom-popper2.js';
|
|
7
7
|
import { d as defineCustomElement$8 } from './form-control-date2.js';
|
|
8
8
|
import { d as defineCustomElement$7 } from './form-control-number2.js';
|
package/dist/module/package.js
CHANGED
package/dist/module/parts.js
CHANGED
|
@@ -138,4 +138,4 @@ const orderTypeTerminalOrdersListFilterParam = `${terminalOrdersListFilterParam}
|
|
|
138
138
|
const createdAfterTerminalOrdersListFilterParam = `${terminalOrdersListFilterParam} created-after-terminal-orders-list-filter-param`;
|
|
139
139
|
const createdBeforeTerminalOrdersListFilterParam = `${terminalOrdersListFilterParam} created-before-terminal-orders-list-filter-param`;
|
|
140
140
|
|
|
141
|
-
export {
|
|
141
|
+
export { heading4 as $, paginationButtonIconPrevious as A, paginationButtonText as B, paginationButtonIconNext as C, loadingSpinner as D, badgeDark as E, badgeLight as F, badgeInfo as G, badgeWarning as H, badgeDanger as I, badgeSuccess as J, badgeSecondary as K, badgePrimary as L, badge as M, alertDanger as N, inputCheckboxInvalid as O, inputCheckboxCheckedFocused as P, inputCheckboxFocused as Q, inputCheckboxChecked as R, inputCheckbox as S, inputAdornment as T, inputGroup as U, inputInvalidAndFocused as V, billingForm as W, heading3 as X, buttonPrimary as Y, buttonSecondary as Z, alert as _, heading1 as a, image as a0, buttonLink as a1, buttonLoading as a2, heading5 as a3, checkoutSummary as a4, checkoutsListFilterMenu as a5, checkoutIdCheckoutsListFilterParam as a6, statusCheckoutsListFilterParam as a7, paymentModeCheckoutsListFilterParam as a8, createdAfterCheckoutsListFilterParam as a9, createdAfterTerminalsListFilterParam as aA, createdBeforeTerminalsListFilterParam as aB, tableHead as aC, tableHeadRow as aD, tableRow as aE, tableFoot as aF, tableFootRow as aG, tableFootCell as aH, tableEmpty as aI, tableError as aJ, createdBeforeCheckoutsListFilterParam as aa, dropdownMenuButton as ab, dropdownMenu as ac, getAlternateTableCellPart as ad, paymentsListFilterMenu as ae, paymentIdPaymentsListFilterParam as af, terminalIdPaymentsListFilterParam as ag, paymentStatusPaymentsListFilterParam as ah, paymentModePaymentsListFilterParam as ai, checkoutIdPaymentsListFilterParam as aj, accountHolderPaymentsListFilterParam as ak, createdAfterPaymentsListFilterParam as al, createdBeforePaymentsListFilterParam as am, payoutsListFilterMenu as an, statusPayoutsListFilterParam as ao, createdAfterPayoutsListFilterParam as ap, createdBeforePayoutsListFilterParam as aq, terminalOrdersListFilterMenu as ar, orderStatusTerminalOrdersListFilterParam as as, orderTypeTerminalOrdersListFilterParam as at, createdAfterTerminalOrdersListFilterParam as au, createdBeforeTerminalOrdersListFilterParam as av, terminalsListFilterMenu as aw, terminalIdTerminalsListFilterParam as ax, terminalOrderIdTerminalsListFilterParam as ay, terminalStatusTerminalsListFilterParam as az, label as b, inputInvalid as c, inputDisabled as d, inputFocused as e, tooltipIcon as f, tooltip as g, heading2 as h, input as i, tooltipInner as j, textDanger as k, link as l, inputRadioInvalid as m, inputRadioCheckedFocused as n, inputRadioChecked as o, inputRadioFocused as p, inputRadio as q, radioListItem as r, skeleton as s, text as t, card as u, table as v, tableHeadCell as w, tableCell as x, paginationButton as y, paginationButtonDisabled as z };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
2
|
import { B as Button } from './button.js';
|
|
3
3
|
import { S as StyledHost } from './styled-host.js';
|
|
4
|
-
import { Y as
|
|
4
|
+
import { Y as buttonPrimary } from './parts.js';
|
|
5
5
|
import './details.js';
|
|
6
6
|
import './event-types.js';
|
|
7
7
|
import './justifi-radio-list-item2.js';
|
|
@@ -326,7 +326,7 @@ const PlaidVerification = /*@__PURE__*/ proxyCustomElement(class PlaidVerificati
|
|
|
326
326
|
marginLeft: '5px',
|
|
327
327
|
marginTop: '-2px',
|
|
328
328
|
} }));
|
|
329
|
-
return (h(StyledHost, null, h("script", { src: "https://cdn.plaid.com/link/v2/stable/link-initialize.js", async: true, ref: (el) => (this.scriptRef = el) }), h("div", null, h("div", { class: "mb-3" }, h(Button, { variant: "
|
|
329
|
+
return (h(StyledHost, null, h("script", { src: "https://cdn.plaid.com/link/v2/stable/link-initialize.js", async: true, ref: (el) => (this.scriptRef = el) }), h("div", null, h("div", { class: "mb-3" }, h(Button, { variant: "primary", type: "button", onClick: (event) => { event.preventDefault(); this.openPlaidLink(); }, disabled: this.isLoading, part: buttonPrimary }, "Connect with Plaid ", plaidLogo, " (instant verification)")), renderErrorState(), renderStatusState())));
|
|
330
330
|
}
|
|
331
331
|
}, [256, "plaid-verification", {
|
|
332
332
|
"authToken": [1, "auth-token"],
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
|
-
import { u as card,
|
|
2
|
+
import { u as card, a0 as image, a1 as buttonLink } from './parts.js';
|
|
3
3
|
import { d as defineCustomElement$2 } from './custom-popper2.js';
|
|
4
4
|
import { d as defineCustomElement$1 } from './form-control-tooltip2.js';
|
|
5
5
|
|
|
@@ -16,6 +16,7 @@ export declare class BusinessBankAccountFormStep {
|
|
|
16
16
|
postDocument: Function;
|
|
17
17
|
bankAccountVerification: boolean;
|
|
18
18
|
platformAccountId: string | null;
|
|
19
|
+
usePlaidVerification: boolean;
|
|
19
20
|
authToken: string;
|
|
20
21
|
businessId: string;
|
|
21
22
|
allowOptionalFields?: boolean;
|
|
@@ -54,6 +55,8 @@ export declare class BusinessBankAccountFormStep {
|
|
|
54
55
|
private refreshBankAccountData;
|
|
55
56
|
handleChangeBankAccount: () => void;
|
|
56
57
|
handleCancel: () => void;
|
|
58
|
+
handleToggleToManualEntry: () => void;
|
|
59
|
+
handleToggleToPlaidVerification: () => void;
|
|
57
60
|
handleSaveBankAccount: () => Promise<void>;
|
|
58
61
|
private postBusinessDocuments;
|
|
59
62
|
private postDocumentRecordData;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FunctionalComponent } from '../stencil-public-runtime';
|
|
2
2
|
interface ButtonProps {
|
|
3
|
-
variant: 'primary' | 'secondary';
|
|
3
|
+
variant: 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'light' | 'dark' | 'link';
|
|
4
4
|
isLoading?: boolean;
|
|
5
5
|
}
|
|
6
6
|
type ButtonElementProps = ButtonProps & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as s,c as i,h as t}from"./p-CV0Pyo1O.js";import{c as
|
|
1
|
+
import{r as s,c as i,h as t}from"./p-CV0Pyo1O.js";import{c as o,J as e}from"./p-DX6fcx_0.js";import{C as r,a as n}from"./p-Cjcsf8ku.js";import{m as p,a}from"./p-R0FDNhyd.js";import{B as h}from"./p-DqtDbB8E.js";import{A as m}from"./p-55QcjheA.js";import"./p-BiNakvsa.js";import"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import"./p-BH0Xfn-F.js";import{i as c}from"./p-MeSAYDNh.js";import"./p-C2WozQkF.js";import"./p-D2muobcE.js";import"./p-DVJaoI_m.js";import"./p-D8GTwl9v.js";import"./p-HXpYMWUU.js";const u=m();class d{async postProvisioning(s,i,t){return u.post({endpoint:"entities/provisioning",body:{business_id:i,product_category:t},authToken:s})}}const j=class{constructor(t){s(this,t),this.errorEvent=i(this,"error-event",7),this.allowOptionalFields=!1,this.formTitle="Business Information"}propChanged(){this.initializeApi()}componentWillLoad(){o(),this.analytics=new e(this),this.initializeApi()}disconnectedCallback(){var s;null===(s=this.analytics)||void 0===s||s.cleanup()}initializeApi(){this.authToken&&this.businessId?c(this.authToken)?this.errorEvent.emit({message:"auth-token is expired",errorCode:n.NOT_AUTHENTICATED,severity:r.ERROR}):(this.getBusiness=p({authToken:this.authToken,businessId:this.businessId,service:new h}),this.postProvisioning=a({authToken:this.authToken,businessId:this.businessId,product:"payment",service:new d})):this.errorEvent.emit({message:"auth-token and business-id are required",errorCode:n.MISSING_PROPS,severity:r.ERROR})}render(){return t("justifi-payment-provisioning-core",{key:"8df2a722a6c7150950cbc0a2d923bb1a107170ee",businessId:this.businessId,authToken:this.authToken,allowOptionalFields:this.allowOptionalFields,formTitle:this.formTitle,getBusiness:this.getBusiness,postProvisioning:this.postProvisioning})}static get watchers(){return{authToken:["propChanged"],businessId:["propChanged"]}}};export{j as justifi_payment_provisioning}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as s,h as i}from"./p-CV0Pyo1O.js";import{P as e}from"./p-B_KHnbK8.js";import{m as r}from"./p-CkX7qWsc.js";import{E as o}from"./p-DAZtHA62.js";import{C as p,a}from"./p-Cjcsf8ku.js";import{c as h,J as n}from"./p-
|
|
1
|
+
import{r as t,c as s,h as i}from"./p-CV0Pyo1O.js";import{P as e}from"./p-B_KHnbK8.js";import{m as r}from"./p-CkX7qWsc.js";import{E as o}from"./p-DAZtHA62.js";import{C as p,a}from"./p-Cjcsf8ku.js";import{c as h,J as n}from"./p-DX6fcx_0.js";import"./p-55QcjheA.js";import"./p-DVJaoI_m.js";import"./p-D8GTwl9v.js";import"./p-MeSAYDNh.js";import"./p-HXpYMWUU.js";import"./p-BiNakvsa.js";import"./p-BH0Xfn-F.js";import"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import"./p-D2muobcE.js";import"./p-C4FLe2pT.js";import"./p-C2WozQkF.js";const m=class{constructor(i){t(this,i),this.errorEvent=s(this,"error-event",7),this.recordClickEvent=s(this,"record-click-event",7),this.errorMessage=null,this.paymentService=new e,this.handleErrorEvent=t=>{this.errorMessage=t.detail.message,this.errorEvent.emit(t.detail)},this.handleRecordClickEvent=t=>{this.recordClickEvent.emit({id:t.detail.id,type:t.detail.type})}}componentWillLoad(){h(),this.analytics=new n(this),this.initializeGetPaymentDetails()}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}propChanged(){this.initializeGetPaymentDetails()}initializeGetPaymentDetails(){this.paymentId&&this.authToken?this.getPaymentDetails=r({id:this.paymentId,authToken:this.authToken,service:new e}):(this.errorMessage="Payment ID and Auth Token are required",this.errorEvent.emit({message:this.errorMessage,errorCode:a.MISSING_PROPS,severity:p.ERROR}))}render(){return this.errorMessage?o(this.errorMessage):i("payment-details-core",{getPaymentDetails:this.getPaymentDetails,"onError-event":this.handleErrorEvent,"onRecord-click-event":this.handleRecordClickEvent,"enable-record-click":"true"})}static get watchers(){return{paymentId:["propChanged"],authToken:["propChanged"]}}};export{m as justifi_payment_details}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as s,r as i,c as t}from"./p-CV0Pyo1O.js";import{c as e,F as r}from"./p-CKiAlBsU.js";import{b as o,a,c as h}from"./p-BovgIz83.js";import{i as n,a as p,b as l,c as m}from"./p-D8EGHc_m.js";import"./p-DVJaoI_m.js";import"./p-HXpYMWUU.js";import{C as c,a as d}from"./p-Cjcsf8ku.js";import"./p-BiNakvsa.js";import"./p-CLHwhyvu.js";import{C as j,B as u,b as f}from"./p-BcNb9bVO.js";import"./p-BH0Xfn-F.js";import{c as v,J as b}from"./p-
|
|
1
|
+
import{h as s,r as i,c as t}from"./p-CV0Pyo1O.js";import{c as e,F as r}from"./p-CKiAlBsU.js";import{b as o,a,c as h}from"./p-BovgIz83.js";import{i as n,a as p,b as l,c as m}from"./p-D8EGHc_m.js";import"./p-DVJaoI_m.js";import"./p-HXpYMWUU.js";import{C as c,a as d}from"./p-Cjcsf8ku.js";import"./p-BiNakvsa.js";import"./p-CLHwhyvu.js";import{C as j,B as u,b as f}from"./p-BcNb9bVO.js";import"./p-BH0Xfn-F.js";import{c as v,J as b}from"./p-DX6fcx_0.js";import{B as w}from"./p-DFiTyYE9.js";import{S as C}from"./p-BqNNwq6C.js";import{H as g}from"./p-BoO2BHR_.js";import"./p-CZfYo5-1.js";import{S as y}from"./p-DqVU8ohH.js";import{B}from"./p-XYgDHrVL.js";import{m as D,b as _}from"./p-R0FDNhyd.js";import{B as k}from"./p-DqtDbB8E.js";import"./p-BFTU3MAI.js";import"./p-HT_4DkD0.js";import"./p-_-2E_vYf.js";import"./p-Bt4GjEWL.js";import"./p-D8GTwl9v.js";import"./p-MeSAYDNh.js";import"./p-C2WozQkF.js";import"./p-55QcjheA.js";import"./p-C4FLe2pT.js";import"./p-D2muobcE.js";const O=e(Object.assign(Object.assign({},o().fields),{legal_address:p(),additional_questions:a(),representative:n("representative")}));e(Object.assign(Object.assign({},h().fields),{legal_address:m(),additional_questions:a(),representative:l("representative")}));const x=O,E=()=>s("div",{class:"row gap-3"},s("div",{class:"col-12"},s(y,{width:"25%"})),s("div",{class:"col-12"},s(y,{width:"100%"})),s("div",{class:"col-12 d-flex gap-3"},s(y,{width:"50%"}),s(y,{width:"50%"})),s("div",{class:"col-12 d-flex gap-3"},s(y,{width:"65%"}),s(y,{width:"35%"}))),H=()=>s("div",{class:"row gap-5"},s("div",{class:"col-12"},s(y,{width:"40%",height:"40px"})),s(E,null),s(E,null),s(E,null)),q=class{constructor(s){i(this,s),this.submitEvent=t(this,"submit-event",7),this.clickEvent=t(this,"click-event",7),this.errorEvent=t(this,"error-event",7),this.isLoading=!1,this.isSaving=!1,this.country=j.USA,this.hideErrors=!1,this.formTitle="Business Information",this.removeTitle=!1,this.instantiateBusiness=s=>{const i=new u(s);this.country=i.country_of_establishment,this.formController.setInitialValues(Object.assign({},i))},this.sendData=async()=>{this.isSaving=!0;const s=this.formController.values.getValue(),i=this.formController.getInitialValues(),t=new u(Object.assign(Object.assign({},i),s)).payload;this.patchBusiness({payload:t,onSuccess:s=>{this.handleReponse(s)},onError:({error:s,code:i,severity:t})=>{this.errorMessage=s.message,this.errorEvent.emit({errorCode:i,message:s.message,severity:t})},final:()=>{this.isSaving=!1}})},this.validateAndSubmit=s=>{s.preventDefault(),this.formController.validateAndSubmit(this.sendData)}}componentWillLoad(){v(),this.analytics=new b(this),this.formController=new r(x),this.initializeApi()}disconnectedCallback(){var s;null===(s=this.analytics)||void 0===s||s.cleanup()}get title(){return this.removeTitle?"":this.formTitle}get disabledState(){return this.isSaving}get businessEndpoint(){return`entities/business/${this.businessId}`}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=D({authToken:this.authToken,businessId:this.businessId,service:new k}),this.patchBusiness=_({authToken:this.authToken,businessId:this.businessId,service:new k}),this.getBusiness({onSuccess:s=>{this.instantiateBusiness(s.data)},onError:({error:s,code:i,severity:t})=>{this.errorMessage=s.message,this.errorEvent.emit({errorCode:i,message:s.message,severity:t})},final:()=>{this.isLoading=!1}})):this.errorEvent.emit({message:"auth-token and business-id are required",errorCode:d.MISSING_PROPS,severity:c.ERROR})}handleReponse(s){s.error&&(this.errorMessage=f.patchData),this.submitEvent.emit({response:s}),this.instantiateBusiness(s.data)}render(){return s(C,null,this.isLoading?s(H,null):s("form",{onSubmit:this.validateAndSubmit},s("div",{class:"row gap-3"},s(g,{text:this.title}),s("form-alert",{text:this.errorMessage,hideAlert:this.hideErrors}),s("div",{class:"col-12 mb-4"},s("justifi-business-core-info",{formController:this.formController,country:this.country})),s("div",{class:"col-12 mb-4"},s("justifi-legal-address-form",{formController:this.formController,country:this.country})),s("div",{class:"col-12 mb-4"},s("justifi-additional-questions",{formController:this.formController})),s("div",{class:"col-12 mb-4"},s("justifi-business-representative",{formController:this.formController,country:this.country})),s("div",{class:"col-12 d-flex flex-row-reverse"},s(w,{type:"submit",disabled:this.disabledState,variant:"primary",onClick:()=>this.clickEvent.emit({name:B.submit}),isLoading:this.isSaving},"Submit")))))}};export{q as justifi_business_form}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r,c as s,h as t}from"./p-CV0Pyo1O.js";import{S as i}from"./p-BqNNwq6C.js";import"./p-CZfYo5-1.js";import{c as
|
|
1
|
+
import{r,c as s,h as t}from"./p-CV0Pyo1O.js";import{S as i}from"./p-BqNNwq6C.js";import"./p-CZfYo5-1.js";import{c as o,J as e}from"./p-DX6fcx_0.js";import{d as a}from"./p-CIh-k9yP.js";import"./p-DVJaoI_m.js";import"./p-HXpYMWUU.js";import{C as n,a as p}from"./p-Cjcsf8ku.js";import{j as c}from"./p-BiNakvsa.js";import"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import"./p-BH0Xfn-F.js";import{g as m,a as h}from"./p-D2muobcE.js";import{A as d}from"./p-55QcjheA.js";import"./p-C2WozQkF.js";import"./p-C4FLe2pT.js";import"./p-MeSAYDNh.js";import"./p-DO4RBao8.js";import"./p-D8GTwl9v.js";const l=d();class j{async fetchTerminalOrders(r,s,t){return l.get({endpoint:"terminals/orders",params:t,headers:{account:r},authToken:s})}}const u=class{constructor(t){r(this,t),this.errorEvent=s(this,"error-event",7),this.errorMessage=null,this.columns=a,this.handleErrorEvent=r=>{this.errorMessage=r.detail.message,this.errorEvent.emit(r.detail)}}componentWillLoad(){o(),this.analytics=new e(this),this.initializeGetData()}disconnectedCallback(){var r;null===(r=this.analytics)||void 0===r||r.cleanup()}initializeGetData(){this.accountId&&this.authToken?this.getTerminalOrders=(({id:r,authToken:s,service:t})=>async({params:i,onSuccess:o,onError:e,final:a})=>{var p,d;try{const a=await t.fetchTerminalOrders(r,s,i);if(a.error)return e({error:h(a.error),code:m(null===(d=a.error)||void 0===d?void 0:d.code),severity:n.ERROR});{const r=Object.assign({},a.page_info);o({terminalOrders:(null===(p=a.data)||void 0===p?void 0:p.map((r=>new c(r))))||[],pagingInfo:r})}}catch(r){const s=m(null==r?void 0:r.code);return e({error:r.message||r,code:s,severity:n.ERROR})}finally{return a()}})({id:this.accountId,authToken:this.authToken,service:new j}):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:p.MISSING_PROPS,message:this.errorMessage,severity:n.ERROR}))}render(){return t(i,{key:"19a055907283ae2a126bdb2a509c3a4a991521f2"},t("terminal-orders-list-core",{key:"04df9d1ce1cca14b07e879137abbced011d02486",getTerminalOrders:this.getTerminalOrders,"onError-event":this.handleErrorEvent,columns:this.columns}))}};export{u as justifi_terminal_orders_list}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as s,c as i,h as t}from"./p-CV0Pyo1O.js";import{E as r}from"./p-DAZtHA62.js";import{B as o}from"./p-DqtDbB8E.js";import{m as
|
|
1
|
+
import{r as s,c as i,h as t}from"./p-CV0Pyo1O.js";import{E as r}from"./p-DAZtHA62.js";import{B as o}from"./p-DqtDbB8E.js";import{m as p}from"./p-CMqX6btO.js";import{C as e,a as m}from"./p-Cjcsf8ku.js";import{c as h,J as a}from"./p-DX6fcx_0.js";import"./p-C4FLe2pT.js";import"./p-55QcjheA.js";import"./p-DVJaoI_m.js";import"./p-D8GTwl9v.js";import"./p-MeSAYDNh.js";import"./p-HXpYMWUU.js";import"./p-BiNakvsa.js";import"./p-BH0Xfn-F.js";import"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import"./p-D2muobcE.js";import"./p-C2WozQkF.js";const n=class{constructor(t){s(this,t),this.errorEvent=i(this,"error-event",7),this.errorMessage=null,this.handleErrorEvent=s=>{this.errorMessage=s.detail.message,this.errorEvent.emit(s.detail)}}componentWillLoad(){h(),this.analytics=new a(this),this.initializeGetBusiness()}disconnectedCallback(){var s;null===(s=this.analytics)||void 0===s||s.cleanup()}initializeGetBusiness(){if(!this.businessId||!this.authToken)return this.errorMessage="Invalid business id or auth token",void this.errorEvent.emit({errorCode:m.MISSING_PROPS,message:this.errorMessage,severity:e.ERROR});this.getBusiness=p({id:this.businessId,authToken:this.authToken,service:new o})}render(){return this.errorMessage?r(this.errorMessage):t("business-details-core",{getBusiness:this.getBusiness,"onError-event":this.handleErrorEvent})}};export{n as justifi_business_details}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,h as t,H as a,c as i,g as s}from"./p-CV0Pyo1O.js";import"./p-DVJaoI_m.js";import"./p-HXpYMWUU.js";import{C as l}from"./p-Cjcsf8ku.js";import{E as o,m as n,n as r,o as c}from"./p-BiNakvsa.js";import"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import"./p-BH0Xfn-F.js";import{a as d}from"./p-Bt4GjEWL.js";import"./p-XYgDHrVL.js";import{n as h}from"./p-BnjCmwMr.js";import{H as u,a5 as f,J as b,av as m,V as p,aE as v,_ as y,$ as k,X as g,Y as x,Z as T,am as _,an as w}from"./p-C4FLe2pT.js";import{s as N,e as j,d as E}from"./p-MeSAYDNh.js";import{S as A}from"./p-DqVU8ohH.js";import"./p-CZfYo5-1.js";import{F as C}from"./p--Kvji7o2.js";import{u as H,a as V,b as D}from"./p-C6o0liMT.js";import{P as I,I as O}from"./p-CVaOFfrI.js";import{c as F}from"./p-_-2E_vYf.js";import{c as L,d as P,e as B}from"./p-R0FDNhyd.js";import{I as R}from"./p-DqtDbB8E.js";import{B as S}from"./p-DFiTyYE9.js";import{S as M}from"./p-BqNNwq6C.js";import{P as Y,p as q}from"./p-Jz9qdPhR.js";import"./p-D8GTwl9v.js";import"./p-D2muobcE.js";import"./p-55QcjheA.js";const U=class{constructor(t){e(this,t)}render(){return t("div",{key:"7f9ea576aad16f3c2ea45c987a38878ea65f2df2",class:"row gy-3"},t("div",{key:"316fe3f20df7c7dce2b8903e6073e0fe7920e5e8",class:"col-12"},t("form-control-file",{key:"320d6b7f3de2cfeeb30eb1e08ca4122123854ffd",name:"voided_check",label:"Voided Check",documentType:o.voidedCheck,inputHandler:this.inputHandler,onFileSelected:this.storeFiles,errorText:this.errors.voided_check,multiple:!0})),t("div",{key:"f33a936c61c14c701e40d375e4dfc4c554b8293c",class:"col-12"},t("form-control-file",{key:"1e160d8211a71175d6a45b10590fb2c8774f61e1",name:"bank_statement",label:"Bank Statement",documentType:o.bankStatement,inputHandler:this.inputHandler,onFileSelected:this.storeFiles,errorText:this.errors.bank_statement,multiple:!0})))}},$=class{constructor(t){e(this,t)}render(){var e,a,i,s,l,o;return t("div",{key:"5dc7139f54d11979410d0d67ca29e65b02f30200",class:"row gy-3"},t("div",{key:"118f15bf02855b24baec5ce2a2c3cf5b241b3da4",class:"col-12"},this.formDisabled?t("bank-account-read-only-value",{label:"Bank Name",value:null===(e=this.defaultValue)||void 0===e?void 0:e.bank_name}):t("form-control-text",{name:"bank_name",label:"Bank Name",defaultValue:this.defaultValue.bank_name,errorText:this.errors.bank_name,inputHandler:this.inputHandler})),t("div",{key:"db03eccee03ec4b7d0de637306315982a2cd770d",class:"col-12"},this.formDisabled?t("bank-account-read-only-value",{label:"Nickname",value:null===(a=this.defaultValue)||void 0===a?void 0:a.nickname}):t("form-control-text",{name:"nickname",label:"Nickname",defaultValue:this.defaultValue.nickname,errorText:this.errors.nickname,inputHandler:this.inputHandler})),t("div",{key:"217120e0052b8ee41cac8f901ac4d9742b0c6ea9",class:"col-12"},this.formDisabled?t("bank-account-read-only-value",{label:"Account Owner Name",value:null===(i=this.defaultValue)||void 0===i?void 0:i.account_owner_name}):t("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})),t("div",{key:"f589511545d6262966a6fa2888cb78babacfb770",class:"col-12"},this.formDisabled?t("bank-account-read-only-value",{label:"Account Type",value:null===(s=this.defaultValue)||void 0===s?void 0:s.account_type}):t("form-control-select",{name:"account_type",label:"Account Type",options:d,defaultValue:this.defaultValue.account_type,errorText:this.errors.account_type,inputHandler:this.inputHandler})),t("div",{key:"24df83bb2666cee381c266608c43f3fd729db4cf",class:"col-6"},this.formDisabled?t("bank-account-read-only-value",{label:"Account Number",value:(null===(l=this.defaultValue)||void 0===l?void 0:l.account_number_last4)?`**** ${this.defaultValue.account_number_last4}`:""}):t("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:h,helpText:"Please copy the account number as shown on your statement/check. Do not include spaces or dashes."})),t("div",{key:"75fe11d71e57707d088f8a90a250621fce82647f",class:"col-6"},this.formDisabled?t("bank-account-read-only-value",{label:"Routing Number",value:(null===(o=this.defaultValue)||void 0===o?void 0:o.routing_number)||""}):t("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:h,helpText:"A valid routing number is nine digits. Please include any leading or trailing zeroes."})))}},z=class{constructor(t){e(this,t)}render(){var e,a,i,s,l,o,n;return t("div",{key:"34cbf10449df73748095fd7122d0ae1355a83e13",class:"row gy-3"},t("div",{key:"607cc5cbc70fdd2d5a325bef7002a44740394282",class:"col-12"},this.formDisabled?t("bank-account-read-only-value",{label:"Bank Name",value:null===(e=this.defaultValue)||void 0===e?void 0:e.bank_name}):t("form-control-text",{name:"bank_name",label:"Bank Name",defaultValue:this.defaultValue.bank_name,errorText:this.errors.bank_name,inputHandler:this.inputHandler})),t("div",{key:"f57f4cd733f2dd439d6d83f32078371618f5fa06",class:"col-12"},this.formDisabled?t("bank-account-read-only-value",{label:"Nickname",value:null===(a=this.defaultValue)||void 0===a?void 0:a.nickname}):t("form-control-text",{name:"nickname",label:"Nickname",defaultValue:this.defaultValue.nickname,errorText:this.errors.nickname,inputHandler:this.inputHandler})),t("div",{key:"b92dface0116321ea990bfcaf1b036b5629385db",class:"col-12"},this.formDisabled?t("bank-account-read-only-value",{label:"Account Owner Name",value:null===(i=this.defaultValue)||void 0===i?void 0:i.account_owner_name}):t("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})),t("div",{key:"45d68efa47de76ee420cedfb97e82f498a2de97b",class:"col-12"},this.formDisabled?t("bank-account-read-only-value",{label:"Account Type",value:null===(s=this.defaultValue)||void 0===s?void 0:s.account_type}):t("form-control-select",{name:"account_type",label:"Account Type",options:d,defaultValue:this.defaultValue.account_type,errorText:this.errors.account_type,inputHandler:this.inputHandler})),t("div",{key:"8419925e8470d63d506e1f7e82ccdf1a1132ecc0",class:"col-3"},this.formDisabled?t("bank-account-read-only-value",{label:"Transit Number",value:(null===(l=this.defaultValue)||void 0===l?void 0:l.transit_number)||""}):t("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:h,helpText:"5 digits"})),t("div",{key:"aa6e83c409e0cf93f1903394f63c0b719ec8808e",class:"col-3"},this.formDisabled?t("bank-account-read-only-value",{label:"Institution Number",value:(null===(o=this.defaultValue)||void 0===o?void 0:o.institution_number)||""}):t("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:h,helpText:"3 digits"})),t("div",{key:"029058c023daca9d0488f45478af6edafe359df7",class:"col-6"},this.formDisabled?t("bank-account-read-only-value",{label:"Account Number",value:(null===(n=this.defaultValue)||void 0===n?void 0:n.account_number_last4)?`**** ${this.defaultValue.account_number_last4}`:""}):t("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:h,helpText:"Please copy the account number as shown on your statement. Do not include spaces or dashes."})))}},X=class{constructor(t){e(this,t)}render(){return t("div",{key:"ad9eadcf49dbc67e51cd814d3ded334a587cc17c"},t("label",{key:"b8ba3d8b7ef9fc33e0e0870f71b7df5dbfae4759",class:"form-label",part:u},this.label),t("div",{key:"1839bdadb96b3c814c73991530497f9a7be6a10d",part:u},this.value||""))}},G=class{constructor(t){e(this,t),this.documents=[],this.isLoading=!1}render(){return this.isLoading?t(A,{height:"50px"}):this.documents.length?t(a,null,t("div",{class:"card",part:f},t("div",{class:"card-body"},t("h5",{class:"card-title",part:b},"Documents Already on File"),t("div",{class:"table-responsive"},t("table",{class:"table table-sm table-borderless",part:m},t("thead",null,t("tr",null,t("th",{style:{width:"25%"},part:p,scope:"col"},"File Name"),t("th",{style:{width:"25%"},part:p,scope:"col"},"File Type"),t("th",{style:{width:"25%"},part:p,scope:"col"},"Document Type"),t("th",{style:{width:"25%"},part:p,scope:"col"},"Date Uploaded"))),t("tbody",null,this.documents.sort(((e,t)=>e.document_type.localeCompare(t.document_type))).map(((e,a)=>t("tr",{class:0===a?"border-bottom border-top":"border-bottom"},t("td",{part:v},e.file_name),t("td",{part:v},e.file_type),t("td",{part:v},N(e.document_type)),t("td",{part:v},`${j(e.created_at)} - ${E(e.created_at)}`))))))))),t("hr",null)):null}},J=class{constructor(t){e(this,t),this.formControlInput=i(this,"formControlInput",7),this.formControlBlur=i(this,"formControlBlur",7),this.fileSelected=i(this,"fileSelected",7),this.isFocused=!1,this.errorText="",this.inputHandler=()=>{},this.disabled=!1,this.handleFormControlInput=e=>{const t=e.target,a=t.getAttribute("name");this.inputHandler(a,t.value),this.formControlInput.emit({name:a,value:t.value})},this.changeHandler=()=>{const e=this.fileInput.files;e&&this.fileSelected.emit({fileList:e,document_type:this.documentType})}}componentDidLoad(){this.fileInput=this.el.querySelector("input")}get part(){let e=y;return this.errorText&&(e=g),this.disabled&&(e=x),this.isFocused&&(e=T),e}render(){return t(a,{key:"8172f7df27c42c6d5211d29ef595dd2e4dbd9def"},t("div",{key:"99740d980c280502242ee1cdcee2a3df6ba53146",class:"form-group d-flex flex-column"},t("div",{key:"5fb94f2b710d5fd734172ee91b59621d736e129b",class:"d-flex align-items-start gap-2"},t("label",{key:"12fedf016c7d789fad8692c7ae03975481964005",part:k,class:"form-label",htmlFor:this.name},this.label),t("form-control-tooltip",{key:"6d59be5a27d3c9a171292244fc9e9bb598b9ecce",helpText:this.helpText})),t("input",{key:"64c7d9eaa46f95714d5527cf94d28c206065a411",ref:e=>this.fileInput=e,type:"file",name:this.name,part:this.part,class:this.errorText?"form-control is-invalid":"form-control",multiple:this.multiple,disabled:this.disabled,onChange:this.changeHandler,onInput:this.handleFormControlInput,onFocus:()=>this.isFocused=!0,onBlur:()=>{this.isFocused=!1,this.formControlBlur.emit()}}),t(C,{key:"9610c0676934fd616fbdac08e98a102240773084",errorText:this.errorText,name:this.name})))}get el(){return s(this)}},W=class{constructor(t){e(this,t),this.isEditingIdentification=!1,this.inputHandler=(e,t)=>{H(this.formController,{[e]:t})},this.onAddressFormUpdate=e=>{V(this.formController,Object.assign(Object.assign({},this.formController.values.getValue().address),e))}}render(){var e,a,i,s,l,o,n,r,c;return t("form",{key:"a9c0f6332bf302d5eb9f93c4ca045d572a40468f"},t("fieldset",{key:"115c564826335a9c7b670bbc0409912c3eb7a4aa"},t("div",{key:"6de8909b4b2f3c7d8ec4665aad77ef59cdf035b4",class:"d-flex align-items-center gap-2"},t("legend",{key:"bb8b5a3775eae450a866356a9e149a0bf57b5699",class:"mb-0",part:b},"Representative"),t("form-control-tooltip",{key:"a0296d4a3c35a039525f39501e117ee6fdd12257",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."})),t("hr",{key:"abbee22f5664275f27dd8eeb2b12c87b059ff024",class:"mt-2"}),t("div",{key:"e165ff125df62dc1d22b7329fe7fe2ff200cbbb3",class:"row gy-3"},t("div",{key:"114ff752eeda3ffa90529ff6bc675b874f543336",class:"col-12 col-md-8"},t("form-control-text",{key:"8b6ce9f4a327ca5282aa32c226f671945aa10404",name:"name",label:"Full Name",defaultValue:null===(e=this.representativeDefaultValue)||void 0===e?void 0:e.name,errorText:this.errors.name,inputHandler:this.inputHandler})),t("div",{key:"bce864367883c6bbf7bd0841114a3dbb39db692b",class:"col-12 col-md-4"},t("form-control-text",{key:"ec3e72dc3f84c0daee2c6509f7dbf2bad22f5db6",name:"title",label:"Title",defaultValue:null===(a=this.representativeDefaultValue)||void 0===a?void 0:a.title,errorText:this.errors.title,inputHandler:this.inputHandler,helpText:"Role at your business, e.g. President, CEO, Treasurer."})),t("div",{key:"200ae959d897d9d22016553d3c586cf3f0438dd9",class:"col-12 col-md-6"},t("form-control-text",{key:"4f77d6ca6c3c85edabc11af6f5703ab1327f05e7",name:"email",label:"Email Address",defaultValue:null===(i=this.representativeDefaultValue)||void 0===i?void 0:i.email,errorText:this.errors.email,inputHandler:this.inputHandler})),t("div",{key:"cf642ee73f7ae8b254920a3f781c23dc456f16ae",class:"col-12 col-md-6"},t("form-control-number-masked",{key:"df609213bec728f17b2527a2e99ff3e0e69604aa",name:"phone",label:"Phone Number",defaultValue:null===(s=this.representativeDefaultValue)||void 0===s?void 0:s.phone,errorText:this.errors.phone,inputHandler:this.inputHandler,mask:I.US})),t("div",{key:"2e4565c06976723ae4e497a5305cea7468bac2f4",class:"col-12 col-md-4"},t("form-control-date",{key:"ca7d4bf05c32d1d9983df430d338cc3433015957",name:"dob_full",label:"Birth Date",defaultValue:null===(l=this.representativeDefaultValue)||void 0===l?void 0:l.dob_full,errorText:this.errors.dob_full,inputHandler:this.inputHandler,onFormControlInput:e=>D(e,this.formController),helpText:"Must be 18 or older."})),t("div",{key:"f6cbe1b7f4e5575f626e6d73f31b4a1a09ac33e3",class:"col-12 col-md-8"},!(null===(o=this.representativeDefaultValue)||void 0===o?void 0:o.ssn_last4)||this.isEditingIdentification?t("form-control-number-masked",{name:"identification_number",label:F[this.country].idNumberLabel,defaultValue:this.isEditingIdentification?"":null===(n=this.representativeDefaultValue)||void 0===n?void 0:n.identification_number,errorText:this.errors.identification_number,inputHandler:this.inputHandler,mask:O[this.country],helpText:F[this.country].identityHelpText}):t("div",null,t("label",{class:"form-label",part:k},F[this.country].idNumberLabel),t("div",{class:"input-group mb-3"},t("input",{type:"text",class:"form-control",part:x,value:`****${null===(r=this.representativeDefaultValue)||void 0===r?void 0:r.ssn_last4}`,disabled:!0}),t("button",{class:"btn btn-secondary",type:"button",part:_,onClick:()=>{this.isEditingIdentification=!0,H(this.formController,{identification_number:"",ssn_last4:null})}},"Change")))),t("div",{key:"e3fa556dece2feaf5eb175ae3734c2319777ef48",class:"col-12"},t("justifi-identity-address-form",{key:"fe3d349371d11b8a246b9c31aebd7d9c84e03f8e",errors:this.errors.address,defaultValues:null===(c=this.representativeDefaultValue)||void 0===c?void 0:c.address,handleFormUpdate:this.onAddressFormUpdate,country:this.country})))))}},K=class{constructor(t){e(this,t),this.errorEvent=i(this,"error-event",7)}async validate(){return this.coreComponent.validate()}async submit(){return this.coreComponent.submit()}async validateAndSubmit({onSuccess:e}){this.coreComponent.validateAndSubmit({onSuccess:e})}componentWillLoad(){this.initializeApi()}initializeApi(){this.authToken&&(this.getOwner=L({authToken:this.authToken,identityId:this.ownerId,service:new R}),this.patchOwner=P({authToken:this.authToken,identityId:this.ownerId,service:new R}),this.postOwner=B({authToken:this.authToken,service:new R}))}render(){return t("owner-form-core",{key:"47c36dfc76ac8a108950e17770d1a0fb06fe4e42",ownerId:this.ownerId,businessId:this.businessId,getOwner:this.getOwner,patchOwner:this.patchOwner,postOwner:this.postOwner,allowOptionalFields:this.allowOptionalFields,removeOwner:this.removeOwner,newFormOpen:this.newFormOpen,ownersLength:this.ownersLength,country:this.country,ref:e=>this.coreComponent=e})}},Q=class{constructor(t){e(this,t),this.plaidVerificationSuccess=i(this,"plaidVerificationSuccess",7),this.plaidVerificationError=i(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 Y,this.abortController=null,this.timeoutId=null,this.initializePlaidLink=async()=>{try{if(void 0===window.Plaid)return void this.handleError({code:c.PLAID_SDK_LOAD_FAILED,message:r[c.PLAID_SDK_LOAD_FAILED],severity:n[c.PLAID_SDK_LOAD_FAILED],retryable:!0,userAction:"Refresh the page and try again"});if(await this.getLinkToken(),!this.linkToken)return void this.handleError({code:c.PLAID_LINK_TOKEN_FAILED,message:r[c.PLAID_LINK_TOKEN_FAILED],severity:n[c.PLAID_LINK_TOKEN_FAILED],retryable:!0,userAction:"Click to try again"});const e=window.Plaid;this.plaidLink=e.create({token:this.linkToken,onSuccess:this.handlePlaidSuccess,onExit:this.handlePlaidExit,onEvent:this.handlePlaidEvent,onLoad:this.handlePlaidLoad})}catch(e){this.handleError({code:c.PLAID_LINK_INIT_FAILED,message:r[c.PLAID_LINK_INIT_FAILED],severity:n[c.PLAID_LINK_INIT_FAILED],originalError:e,retryable:!0,userAction:"Click to try again"})}},this.getLinkToken=async()=>{var e,t,a,i;try{if(!this.authToken||!this.accountId)return void this.handleError({code:c.PLAID_LINK_TOKEN_FAILED,message:"Missing authentication. Please provide authToken and accountId.",severity:l.ERROR,retryable:!1,userAction:"Provide required props"});this.abortController=new AbortController,this.timeoutId=setTimeout((()=>{var e;null===(e=this.abortController)||void 0===e||e.abort()}),3e4);const e=await this.plaidService.getLinkTokenForVerification(this.authToken,this.businessId,this.abortController.signal);if(this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null),e.error)throw new Error("string"==typeof e.error?e.error:e.error.message||"Failed to get link token");this.linkToken=e.data.link_token,this.linkTokenId=e.data.id}catch(s){this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null);let l=c.PLAID_LINK_TOKEN_FAILED,o=r[l],d=!0;"AbortError"===s.name?(l=c.PLAID_TIMEOUT,o=r[l],d=!0):(null===(e=s.message)||void 0===e?void 0:e.includes("network"))||(null===(t=s.message)||void 0===t?void 0:t.includes("fetch"))?(l=c.PLAID_NETWORK_ERROR,o=r[l],d=!0):((null===(a=s.message)||void 0===a?void 0:a.includes("401"))||(null===(i=s.message)||void 0===i?void 0:i.includes("unauthorized")))&&(l=c.PLAID_INVALID_CREDENTIALS,o="Authentication failed. Please check your credentials.",d=!1),this.handleError({code:l,message:o,severity:n[l],originalError:s,retryable:d,userAction:d?"Click to try again":"Check your credentials"})}},this.openPlaidLink=()=>{this.plaidLink&&this.linkToken&&(this.isAuthenticating=!0,this.clearError(),this.plaidLink.open())},this.handlePlaidSuccess=async e=>{var t;this.isAuthenticating=!1,this.isLoading=!0,this.clearError();try{const a=await this.plaidService.postPlaidVerifiedBankAccountData(this.authToken,this.businessId,{public_token:e,link_token_id:this.linkTokenId},null===(t=this.abortController)||void 0===t?void 0:t.signal);if(a.error)throw new Error("string"==typeof a.error?a.error:a.error.message||"Failed to verify bank account");this.isSuccess=!0,this.isLoading=!1,this.plaidVerificationSuccess.emit({publicToken:e,bankAccount:a.data})}catch(e){this.isLoading=!1,this.handleError({code:c.PLAID_AUTHENTICATION_FAILED,message:(null==e?void 0:e.message)||"Failed to verify bank account",severity:n[c.PLAID_AUTHENTICATION_FAILED],originalError:e,retryable:!0,userAction:"Click to try again"})}},this.handlePlaidExit=e=>{this.isAuthenticating=!1,e&&this.handlePlaidError(e)},this.handlePlaidEvent=(e,t)=>{switch(e){case"OPEN":this.isAuthenticating=!0;break;case"CLOSE":this.isAuthenticating=!1;break;case"ERROR":this.handlePlaidError(t)}},this.handlePlaidLoad=()=>{},this.handlePlaidError=e=>{let t=c.PLAID_AUTHENTICATION_FAILED,a=r[t],i=!0,s="Click to try again";if(e.error_code)switch(e.error_code){case"INVALID_CREDENTIALS":t=c.PLAID_INVALID_CREDENTIALS,a=r[t],i=!0;break;case"ITEM_LOGIN_REQUIRED":t=c.PLAID_INVALID_CREDENTIALS,a="Your bank requires re-authentication. Please try again.",i=!0;break;case"ITEM_LOCKED":t=c.PLAID_ACCOUNT_LOCKED,a=r[t],i=!1,s="Contact your bank";break;case"INSTITUTION_NOT_RESPONDING":t=c.PLAID_MAINTENANCE,a=r[t],i=!0;break;case"RATE_LIMIT_EXCEEDED":t=c.PLAID_RATE_LIMITED,a=r[t],i=!0;break;default:e.error_message&&(a=e.error_message)}this.handleError({code:t,message:a,severity:n[t],originalError:e,retryable:i,userAction:s}),this.isAuthenticating=!1},this.handleError=e=>{this.error=e,this.isLoading=!1,this.plaidVerificationError.emit(e),console.error("Plaid verification error:",e)},this.clearError=()=>{this.error&&(this.error=null)}}componentDidRender(){this.scriptRef&&(this.scriptRef.onload=()=>{this.initializePlaidLink()},this.scriptRef.onerror=()=>{this.handleError({code:c.PLAID_SDK_LOAD_FAILED,message:r[c.PLAID_SDK_LOAD_FAILED],severity:n[c.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 e=t("img",{class:"plaid-logo-img",src:q,alt:"Plaid",title:"Plaid",style:{display:"inline",width:"20px",height:"20px",marginLeft:"5px",marginTop:"-2px"}});return t(M,null,t("script",{src:"https://cdn.plaid.com/link/v2/stable/link-initialize.js",async:!0,ref:e=>this.scriptRef=e}),t("div",null,t("div",{class:"mb-3"},t(S,{variant:"primary",type:"button",onClick:e=>{e.preventDefault(),this.openPlaidLink()},disabled:this.isLoading,part:w},"Connect with Plaid ",e," (instant verification)")),(()=>this.error?t("div",{class:(this.error.severity===l.ERROR?"text-danger":this.error.severity===l.WARNING?"text-warning":"text-info")+" mt-2"},t("small",null,this.error.message),t("br",null),this.error.userAction&&t("small",{class:"text-muted"},this.error.userAction)):null)(),(()=>this.error?null:this.isLoading?t("div",{class:"text-info mt-2"},t("small",null,"Verifying bank account...")):this.isSuccess?t("div",{class:"text-success mt-2"},t("small",null,"✓ Bank account verified successfully")):this.isAuthenticating?t("div",{class:"text-info mt-2"},t("small",null,"Connecting to your bank...")):null)()))}};export{U as bank_account_document_form_inputs,$ as bank_account_form_inputs,z as bank_account_form_inputs_canada,X as bank_account_read_only_value,G as business_documents_on_file,J as form_control_file,W as justifi_business_representative_form_inputs,K as justifi_owner_form,Q as plaid_verification}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as s,c as t,h as e,H as i}from"./p-CV0Pyo1O.js";import{C as r,a as n}from"./p-Cjcsf8ku.js";import{m as o,b as a,f as h,g as c}from"./p-R0FDNhyd.js";import{B as l,a as d,D as u}from"./p-DqtDbB8E.js";import{a as m,c as p,b}from"./p-BovgIz83.js";import{F as f,c as v,a as y,b as g,d as w}from"./p-CKiAlBsU.js";import{A as k,C as _,e as j,R as C,f as T}from"./p-BcNb9bVO.js";import{C as O,P as x}from"./p-CVaOFfrI.js";import{J as S,a4 as E,am as I,$ as L,Y as A,aG as D}from"./p-C4FLe2pT.js";import{P as B}from"./p-C3kbpEIZ.js";import{b as P,c as H}from"./p-Bt4GjEWL.js";import{a as V,B as F}from"./p-XYgDHrVL.js";import"./p-DVJaoI_m.js";import"./p-HXpYMWUU.js";import{E as q,p as W,q as Y}from"./p-BiNakvsa.js";import"./p-CLHwhyvu.js";import"./p-BH0Xfn-F.js";import{A as M,B as N,v as U,C as z,D as R,E as G,F as X}from"./p-HT_4DkD0.js";import{B as J}from"./p-DFiTyYE9.js";import"./p-CZfYo5-1.js";import{c as $}from"./p-_-2E_vYf.js";import{d as Q,e as Z}from"./p-D8EGHc_m.js";import{A as K}from"./p-55QcjheA.js";import"./p-D2muobcE.js";import"./p-BFTU3MAI.js";import"./p-DqVU8ohH.js";import"./p-D8GTwl9v.js";import"./p-MeSAYDNh.js";class ss{constructor(s){this.id=s.id,this.account_owner_name=s.account_owner_name,this.full_name=s.full_name,this.account_type=s.account_type,this.account_number=s.account_number,this.acct_last_four=s.acct_last_four,this.account_number_last4=s.account_number_last4,this.routing_number=s.routing_number,this.institution_number=s.institution_number,this.transit_number=s.transit_number,this.bank_name=s.bank_name,this.country=s.country,this.currency=s.currency,this.nickname=s.nickname,this.metadata=s.metadata,this.business_id=s.business_id,this.platform_account_id=s.platform_account_id,this.created_at=s.created_at,this.updated_at=s.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 ts=class{constructor(e){s(this,e),this.errorEvent=t(this,"error-event",7),this.stepCompleteEvent=t(this,"complete-form-step-event",7),this.formLoading=t(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:s=>{this.additional_questions=new k(s.data.additional_questions||{}),this.formController.setInitialValues(Object.assign({},this.additional_questions))},onError:({error:s,code:t,severity:e})=>{this.errorEvent.emit({message:s,errorCode:t,severity:e})},final:()=>{this.formLoading.emit(!1),this.isLoading=!1}})},this.sendData=s=>{let t;this.formLoading.emit(!0),this.patchBusiness({payload:this.patchPayload,onSuccess:e=>{t=e,s()},onError:({error:s,code:e,severity:i})=>{t=s,this.errorEvent.emit({message:s,errorCode:e,severity:i})},final:()=>{this.stepCompleteEvent.emit({response:t,formStep:V.additionalQuestions}),this.formLoading.emit(!1)}})},this.inputHandler=(s,t)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[s]:t})),this.additional_questions=new k(Object.assign(Object.assign({},this.formController.values.getValue()),{[s]:t}))}}propChanged(){this.initializeApi()}recurringPaymentsWatcher(s){this.recurringPayments="Yes"===(null==s?void 0:s.business_recurring_payments)}async validateAndSubmit({onSuccess:s}){this.formController.validateAndSubmit((()=>this.sendData(s)))}get patchPayload(){return{additional_questions:new k(this.formController.values.getValue()).payload}}componentWillLoad(){this.initializeApi(),this.formController=new f(m(this.allowOptionalFields))}componentDidLoad(){this.getBusiness&&this.getData(),this.formController.errors.subscribe((s=>{this.errors=Object.assign({},s)}))}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=o({authToken:this.authToken,businessId:this.businessId,service:new l}),this.patchBusiness=a({authToken:this.authToken,businessId:this.businessId,service:new l})):this.errorEvent.emit({message:"Missing required props",errorCode:n.MISSING_PROPS,severity:r.ERROR})}render(){var s,t,i,r,n;const o=this.formController.getInitialValues();return this.isLoading?e(B,null):e("form",null,e("fieldset",null,e("div",{class:"d-flex align-items-center gap-2"},e("legend",{class:"mb-0",part:S},"Additional Questions"),e("form-control-tooltip",{helpText:"This information helps us understand the business and identify and monitor trends to safeguard you and your customers."})),e("hr",{class:"mt-2"}),e("div",{class:"row gy-3"},e("div",{class:"col-12 col-md-6"},e("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===(s=this.errors)||void 0===s?void 0:s.business_revenue,defaultValue:null==o?void 0:o.business_revenue,maskOptions:O.WHOLE})),e("div",{class:"col-12 col-md-6"},e("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===(t=this.errors)||void 0===t?void 0:t.business_payment_volume,defaultValue:null==o?void 0:o.business_payment_volume,maskOptions:O.WHOLE})),e("div",{class:"col-12"},e("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==o?void 0:o.business_average_transaction_amount})),e("div",{class:"col-12"},e("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===(r=this.errors)||void 0===r?void 0:r.business_when_service_received,options:P,defaultValue:null==o?void 0:o.business_when_service_received})),e("div",{class:"col-12"},e("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===(n=this.errors)||void 0===n?void 0:n.business_other_payment_details,defaultValue:null==o?void 0:o.business_other_payment_details})))))}static get watchers(){return{authToken:["propChanged"],businessId:["propChanged"],additional_questions:["recurringPaymentsWatcher"]}}},es=(s,t)=>s.some((s=>s.document_type===t)),is=s=>s?{bank_name:R.nullable(),nickname:z.nullable(),account_owner_name:U.nullable(),account_type:N.nullable(),account_number:M.nullable()}:{bank_name:R.required("Enter bank name"),nickname:z.required("Enter nickname"),account_owner_name:U.required("Enter account owner name"),account_type:N.required("Select account type"),account_number:M.required("Enter account number")},rs=(s,t)=>{if(t)return{voided_check:g().nullable(),bank_statement:g().nullable()};const e=es(s,q.voidedCheck),i=es(s,q.bankStatement),r=e||i,n="Please upload either a voided check or a bank statement. Only one is required.";return{voided_check:g().when("bank_statement",{is:s=>!s&&!r,then:s=>s.required(n),otherwise:s=>s.notRequired()}),bank_statement:g().when("voided_check",{is:s=>!s&&!r,then:s=>s.required(n),otherwise:s=>s.notRequired()})}},ns={[_.USA]:(s,t=[])=>((s,t)=>{const e=Object.assign(Object.assign(Object.assign({},is(t)),(s=>s?{routing_number:X.nullable()}:{routing_number:X.required("Enter routing number")})(t)),rs(s,t));return v().shape(e,[["voided_check","bank_statement"]])})(t,s),[_.CAN]:(s,t=[])=>((s,t)=>{const e=Object.assign(Object.assign(Object.assign({},is(t)),(s=>{const t=y().length(3,"Institution number must be 3 digits").matches(G,"Enter valid institution number"),e=y().length(5,"Transit number must be 5 digits").matches(G,"Enter valid transit number");return s?{institution_number:t.nullable(),transit_number:e.nullable()}:{institution_number:t.required("Enter institution number"),transit_number:e.required("Enter transit number")}})(t)),rs(s,t));return v().shape(e,[["voided_check","bank_statement"]])})(t,s)},os=class{constructor(e){s(this,e),this.errorEvent=t(this,"error-event",7),this.stepCompleteEvent=t(this,"complete-form-step-event",7),this.formLoading=t(this,"formLoading",7),this.errors={},this.bankAccount={},this.existingDocuments=[],this.documentData=new W,this.isLoading=!1,this.isAddingNewBankAccount=!0,this.bankAccountVerification=!1,this.platformAccountId=null,this.usePlaidVerification=!0,this.getSchema=()=>(0,ns[this.country])(this.allowOptionalFields,this.existingDocuments),this.initializeFormController=()=>{this.formController=new f(this.getSchema()),this.formController.setInitialValues(this.isAddingNewBankAccount?{business_id:this.businessId}:Object.assign({},this.bankAccount)),this.formController.errors.subscribe((s=>{this.errors=Object.assign({},s)}))},this.inputHandler=(s,t)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[s]:t}))},this.storeFiles=s=>{const t=Array.from(s.detail.fileList),e=s.detail.document_type,i=t.map((s=>new Y({file:s,document_type:e},this.businessId)));this.documentData[e]=i},this.getData=()=>{this.isLoading=!0,this.getBusiness({onSuccess:s=>{if(s.data.bank_accounts.length>0){const t=s.data.bank_accounts;this.bankAccount=new ss(t[t.length-1]),this.isAddingNewBankAccount=!1}else this.bankAccount=new ss({}),this.bankAccount.business_id=this.businessId;this.existingDocuments=s.data.documents,this.bankAccountVerification=!0===s.data.settings.bank_account_verification,this.platformAccountId=s.data.platform_account_id},onError:({error:s,code:t,severity:e})=>{this.errorEvent.emit({message:s,errorCode:t,severity:e})},final:()=>{this.initializeFormController(),this.isLoading=!1}})},this.handleChangeBankAccount=()=>{this.isAddingNewBankAccount=!0,this.documentData=new W,this.usePlaidVerification=this.bankAccountVerification&&!!this.platformAccountId,this.initializeFormController()},this.handleCancel=()=>{this.isAddingNewBankAccount=!1,this.documentData=new W,this.usePlaidVerification=!0,this.initializeFormController()},this.handleToggleToManualEntry=()=>{this.usePlaidVerification=!1},this.handleToggleToPlaidVerification=()=>{this.usePlaidVerification=!0},this.handleSaveBankAccount=async()=>{this.formController.validateAndSubmit((()=>{this.sendData((()=>{}))}))},this.postDocumentRecordData=async s=>{this.isLoading=!0;const t=s.record_data;return new Promise((e=>{this.postDocumentRecord({payload:t,onSuccess:t=>{e(this.handleDocRecordResponse(s,t))},onError:({error:s,code:t,severity:i})=>{this.errorEvent.emit({message:s,errorCode:t,severity:i}),e(!1)}})}))},this.handleDocRecordResponse=(s,t)=>t.error?(this.errorEvent.emit({errorCode:n.POST_ERROR,message:t.error.message,severity:r.ERROR,data:t.error}),!1):(s.setPresignedUrl(t.data.presigned_url),!0),this.uploadDocument=async s=>{if(!s.presigned_url)throw new Error("Presigned URL is not set");const t=await s.getFileData(),e=await fetch(s.presigned_url,{method:"PUT",body:t});return this.handleUploadResponse(e)},this.handleUploadResponse=s=>!s.error||(this.errorEvent.emit({errorCode:n.POST_ERROR,message:s.error.message,severity:r.ERROR,data:s.error}),!1)}propChanged(){this.initializeApi()}watchHandler(s){this.formLoading.emit(s)}async validateAndSubmit({onSuccess:s}){this.existingBankAccount&&!this.isAddingNewBankAccount?this.sendData(s):this.formController.validateAndSubmit((()=>this.sendData(s)))}componentWillLoad(){this.initializeApi(),this.getBusiness&&this.getData(),this.formController=new f(this.getSchema())}componentDidLoad(){this.formController.errors.subscribe((s=>{this.errors=Object.assign({},s)}))}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=o({authToken:this.authToken,businessId:this.businessId,service:new l}),this.postBankAccount=h({authToken:this.authToken,service:new d}),this.postDocumentRecord=c({authToken:this.authToken,service:new u})):this.errorEvent.emit({message:"Missing required props",errorCode:n.MISSING_PROPS,severity:r.ERROR})}get postPayload(){const s=this.formController.values.getValue();return new ss(s).payload}get existingBankAccount(){var s;return!!(null===(s=this.bankAccount)||void 0===s?void 0:s.id)}get showReadOnlyView(){return this.existingBankAccount&&!this.isAddingNewBankAccount}async sendData(s){try{if(this.isAddingNewBankAccount&&!await this.postBankAccountData())return;if(!await this.postBusinessDocuments())return;this.isAddingNewBankAccount&&(this.isAddingNewBankAccount=!1,await this.refreshBankAccountData()),s()}catch(s){this.errorEvent.emit({message:s,errorCode:n.POST_ERROR,severity:r.ERROR})}}async postBankAccountData(){let s;return this.isLoading=!0,new Promise((t=>{let e=!1;this.postBankAccount({payload:this.postPayload,onSuccess:t=>{s=t,e=!0},onError:({error:s,code:t,severity:i})=>{e=!1,this.errorEvent.emit({message:s,errorCode:t,severity:i})},final:()=>{this.stepCompleteEvent.emit({response:s,formStep:V.bankAccount}),this.isLoading=!1,t(e)}})}))}async refreshBankAccountData(){return new Promise((s=>{this.isLoading=!0,this.getBusiness({onSuccess:s=>{const{data:t}=s,{bank_accounts:e,documents:i,settings:r,platform_account_id:n}=t;e.length>0&&(this.bankAccount=new ss(e[e.length-1])),this.existingDocuments=i,this.bankAccountVerification=!0===r.bank_account_verification,this.platformAccountId=n,this.initializeFormController()},onError:({error:s,code:t,severity:e})=>{this.errorEvent.emit({message:s,errorCode:t,severity:e})},final:()=>{this.isLoading=!1,s()}})}))}async postBusinessDocuments(){this.isLoading=!0;try{const s=Object.values(this.documentData).flat();return!s.length||!(await Promise.all(s.map((s=>this.postDocumentRecordData(s))))).includes(!1)&&!(await Promise.all(s.map((s=>this.uploadDocument(s))))).includes(!1)}finally{this.isLoading=!1}}render(){const s=this.formController.getInitialValues(),t=this.bankAccountVerification&&this.platformAccountId;return this.isLoading?e(B,null):e("form",null,e("fieldset",{class:"mb-4"},e("div",{class:"d-flex align-items-center gap-2"},e("legend",{class:"mb-0",part:S},"Bank Account Info"),e("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."})),e("hr",{class:"mt-2"}),t&&this.usePlaidVerification&&!this.showReadOnlyView&&e("div",{class:"mt-3"},e("plaid-verification",{authToken:this.authToken,accountId:this.platformAccountId,businessId:this.businessId,onPlaidVerificationSuccess:()=>{this.isAddingNewBankAccount=!1,this.refreshBankAccountData()}}),e("div",{class:"mt-3"},e(J,{type:"button",variant:"link",onClick:this.handleToggleToManualEntry,disabled:this.isLoading,part:E},"Enter bank details manually (document upload required)"))),(!this.usePlaidVerification||this.showReadOnlyView)&&e("div",null,t&&!this.usePlaidVerification&&!this.showReadOnlyView&&e("div",{class:"mb-3"},e(J,{type:"button",variant:"secondary",onClick:this.handleToggleToPlaidVerification,disabled:this.isLoading,part:I},"Link bank account with Plaid instead")),e(this.country===_.CAN?"bank-account-form-inputs-canada":"bank-account-form-inputs",{defaultValue:s,errors:this.errors,inputHandler:this.inputHandler,formDisabled:this.showReadOnlyView})),this.showReadOnlyView&&e("div",{class:"mt-3"},e(J,{variant:"secondary",type:"button",onClick:this.handleChangeBankAccount,disabled:this.isLoading,part:I},"Change Bank Account")),(!this.existingBankAccount||this.isAddingNewBankAccount)&&!this.usePlaidVerification&&e("div",{class:"mt-3 d-flex gap-2"},this.isAddingNewBankAccount&&e(J,{variant:"secondary",type:"button",onClick:this.handleCancel,disabled:this.isLoading,part:I},"Cancel"),e(J,{variant:"primary",type:"button",onClick:this.handleSaveBankAccount,disabled:this.isLoading,isLoading:this.isLoading},"Save Bank Account"))),(!this.usePlaidVerification||this.showReadOnlyView)&&e("fieldset",{class:"mt-4"},e("div",{class:"d-flex align-items-center gap-2"},e("legend",{class:"mb-0",part:S},"Document Uploads"),e("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."})),e("hr",{class:"mt-2"}),e("business-documents-on-file",{documents:this.existingDocuments,isLoading:this.isLoading}),e("bank-account-document-form-inputs",{inputHandler:this.inputHandler,errors:this.errors,storeFiles:this.storeFiles})))}static get watchers(){return{authToken:["propChanged"],businessId:["propChanged"],isLoading:["watchHandler"]}}},as=class{constructor(e){s(this,e),this.errorEvent=t(this,"error-event",7),this.stepCompleteEvent=t(this,"complete-form-step-event",7),this.formLoading=t(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:s=>{this.coreInfo=new j(s.data),this.formController.setInitialValues(Object.assign({},this.coreInfo))},onError:({error:s,code:t,severity:e})=>{this.errorEvent.emit({message:s,errorCode:t,severity:e})},final:()=>{this.formLoading.emit(!1),this.isLoading=!1}}))},this.sendData=s=>{let t;this.formLoading.emit(!0),this.patchBusiness({payload:this.patchPayload,onSuccess:e=>{t=e,s(),this.isEditingTaxId=!1},onError:({error:s,code:e,severity:i,rawError:r})=>{t=s,r&&"object"==typeof r&&r.param&&this.formController.setFieldError(r.param,r.message),this.errorEvent.emit({message:s,errorCode:e,severity:i})},final:()=>{this.stepCompleteEvent.emit({response:t,formStep:V.businessInfo}),this.formLoading.emit(!1)}})},this.inputHandler=(s,t)=>{this.errors[s]&&this.formController.clearFieldError(s),this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[s]:t}))}}propChanged(){this.initializeApi()}async validateAndSubmit({onSuccess:s}){this.formController.validateAndSubmit((()=>this.sendData(s)))}get patchPayload(){return new j(this.formController.values.getValue()).payload}componentWillLoad(){this.initializeApi();const s=this.country===_.CAN?p(this.allowOptionalFields):b(this.allowOptionalFields);this.formController=new f(s),this.getData()}componentDidLoad(){this.formController.errors.subscribe((s=>{this.errors=Object.assign({},s)}))}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=o({authToken:this.authToken,businessId:this.businessId,service:new l}),this.patchBusiness=a({authToken:this.authToken,businessId:this.businessId,service:new l})):this.errorEvent.emit({message:"Missing required props",errorCode:n.MISSING_PROPS,severity:r.ERROR})}render(){var s,t;const i=this.formController.getInitialValues();return this.isLoading?e(B,null):e("form",null,e("fieldset",null,e("div",{class:"d-flex align-items-center gap-2"},e("legend",{class:"mb-0",part:S},"Business Information")),e("hr",{class:"mt-2"}),e("div",{class:"row gy-3"},e("div",{class:"col-12 col-md-6"},e("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)."})),e("div",{class:"col-12 col-md-6"},e("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)"})),e("div",{class:"col-12 col-md-8"},e("form-control-select",{name:"classification",label:"Business Classification",options:H,defaultValue:i.classification,errorText:this.errors.classification,inputHandler:this.inputHandler})),e("div",{class:"col-12 col-md-4"},e("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})),e("div",{class:"col-12 col-md-6"},e("form-control-text",{name:"industry",label:"Industry",defaultValue:i.industry,errorText:this.errors.industry,inputHandler:this.inputHandler,helpText:"Describe what you sell"})),e("div",{class:"col-12 col-md-6"},!(null===(s=this.coreInfo)||void 0===s?void 0:s.tax_id_last4)||this.isEditingTaxId?e("form-control-number-masked",{name:"tax_id",label:$[this.country].taxIdLabel,defaultValue:this.isEditingTaxId?"":i.tax_id,errorText:this.errors.tax_id,inputHandler:this.inputHandler,mask:"000000000",helpText:$[this.country].taxIdHelpText}):e("div",null,e("label",{class:"form-label",part:L},$[this.country].taxIdLabel),e("div",{class:"input-group mb-3"},e("input",{type:"text",class:"form-control",part:A,value:`****${null===(t=this.coreInfo)||void 0===t?void 0:t.tax_id_last4}`,disabled:!0}),e("button",{class:"btn btn-secondary",type:"button",part:I,onClick:()=>{this.isEditingTaxId=!0,this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{tax_id:"",tax_id_last4:null}))}},"Change")))),e("div",{class:"col-12"},e("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."})),e("div",{class:"col-12 col-md-6"},e("form-control-text",{name:"email",label:"Business Email Address",defaultValue:i.email,errorText:this.errors.email,inputHandler:this.inputHandler})),e("div",{class:"col-12 col-md-6"},e("form-control-number-masked",{name:"phone",label:"Business Phone Number",defaultValue:i.phone,errorText:this.errors.phone,inputHandler:this.inputHandler,mask:x.US})))))}static get watchers(){return{authToken:["propChanged"],businessId:["propChanged"]}}},hs=class{constructor(e){s(this,e),this.clickEvent=t(this,"click-event",7),this.stepCompleteEvent=t(this,"complete-form-step-event",7),this.errorEvent=t(this,"error-event",7),this.formLoading=t(this,"formLoading",7),this.ownersPayload=[],this.refs=[],this.isLoading=!1,this.representativeIsOwner=null,this.matchRef=(s,t)=>{if(null===s)return;const e=this.ownersPayload.findIndex((s=>s.id===t));-1!==e&&(this.refs.length!==this.ownersPayload.length&&this.manageRefs(),this.refs[e]=s)},this.getData=()=>{this.formLoading.emit(!0),this.isLoading=!0,this.getBusiness({onSuccess:s=>{this.representative=new C(s.data.representative||{}),s.data.owners.length?this.ownersPayload=s.data.owners.map((s=>({id:s.id}))):this.addOwnerForm()},onError:({error:s,code:t,severity:e})=>{this.errorEvent.emit({message:s,errorCode:t,severity:e})},final:()=>{this.formLoading.emit(!1),this.isLoading=!1,this.manageRefs()}})},this.sendData=async s=>{let t;this.formLoading.emit(!0),this.patchBusiness({payload:{owners:this.ownersPayload},onSuccess:e=>{t=e,s()},onError:({error:s,code:e,severity:i})=>{t=s,this.errorEvent.emit({message:s,errorCode:e,severity:i})},final:()=>{this.stepCompleteEvent.emit({response:t,formStep:V.owners}),this.formLoading.emit(!1)}})},this.addOwnerForm=s=>{this.newFormOpen=!0,this.ownersPayload=[...this.ownersPayload,{id:""}],s&&this.clickEvent.emit({name:F.addOwnerForm})},this.removeOwnerForm=s=>{this.ownersPayload=this.ownersPayload.filter((t=>t.id!==s)),this.newFormOpen&&(this.newFormOpen=!1)},this.handleRepresentativeIsOwnerChange=s=>{this.representativeIsOwner=s,this.representativeIsOwner&&(this.formLoading.emit(!0),this.isLoading=!0,this.ownersPayload=this.ownersPayload.filter((s=>""!==s.id)),this.patchBusiness({payload:{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((s=>s.id))}async validateAndSubmit({onSuccess:s}){const t=this.refs.map((s=>s.validate()));if(!(await Promise.all(t)).every((s=>s)))return;const e=this.refs.map((s=>s.submit()));(await Promise.all(e)).every((s=>s))&&this.sendData(s)}componentWillLoad(){this.initializeApi(),this.getBusiness&&this.getData()}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=o({authToken:this.authToken,businessId:this.businessId,service:new l}),this.patchBusiness=a({authToken:this.authToken,businessId:this.businessId,service:new l})):this.errorEvent.emit({message:"Missing required props",errorCode:n.MISSING_PROPS,severity:r.ERROR})}ownersWatcher(){this.manageRefs()}handleOwnerSubmit(s){const t=s.detail,e=this.ownersPayload.map((s=>s.id===t.id?t:s));e.includes(t)||(e[this.ownersPayload.findIndex((s=>!s.id))]=t,this.newFormOpen&&(this.newFormOpen=!1)),this.ownersPayload=e}render(){if(this.isLoading)return e(i,null,e(B,null));const s=this.ownersPayload.some((s=>s.id===this.representative.id)),t=null===this.representativeIsOwner&&!s;return e(i,null,e("div",null,e("div",{class:"d-flex align-items-center gap-2"},e("legend",{class:"mb-0",part:S},"Owners"),e("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."})),e("hr",{class:"mt-2"}),t&&e("div",{class:"alert alert-warning mb-3",part:D},e("div",{class:"card-body"},e("div",{class:"d-flex align-items-center mb-3"},e("strong",null,"Is the representative of this business also an owner?")),e("div",{class:"d-flex gap-2"},e(J,{variant:"primary",onClick:()=>this.handleRepresentativeIsOwnerChange(!0)},"Yes"),e(J,{variant:"secondary",onClick:()=>this.handleRepresentativeIsOwnerChange(!1)},"No")))),e("div",{class:"row gy-3"},this.ownersPayload.map((s=>e("justifi-owner-form",{key:s.id,authToken:this.authToken,businessId:this.businessId,ownerId:s.id,removeOwner:this.removeOwnerForm,newFormOpen:this.newFormOpen,ownersLength:this.ownersPayload.length,country:this.country,allowOptionalFields:this.allowOptionalFields,ref:t=>this.matchRef(t,s.id)})))),e("div",{class:"d-flex justify-content-start"},e("div",{class:"gap-2"},e(J,{variant:"primary",onClick:()=>this.addOwnerForm(!0),hidden:!this.showAddOwnerButton},"Add Owner")))))}static get watchers(){return{authToken:["propChanged"],businessId:["propChanged"],ownersPayload:["ownersWatcher"]}}},cs=class{constructor(e){s(this,e),this.errorEvent=t(this,"error-event",7),this.stepCompleteEvent=t(this,"complete-form-step-event",7),this.formLoading=t(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:s=>{this.representative=new C(s.data.representative||{}),this.representative.address.country=this.country,this.formController.setInitialValues(Object.assign({},this.representative))},onError:({error:s,code:t,severity:e})=>{this.errorEvent.emit({message:s,errorCode:t,severity:e})},final:()=>{this.formLoading.emit(!1),this.isLoading=!1}}))},this.sendData=s=>{let t;this.formLoading.emit(!0),this.patchBusiness({payload:this.patchPayload,onSuccess:e=>{t=e,s()},onError:({error:s,code:e,severity:i})=>{t=s,this.errorEvent.emit({message:s,errorCode:e,severity:i})},final:()=>{this.stepCompleteEvent.emit({response:t,formStep:V.representative}),this.formLoading.emit(!1)}})}}propChanged(){this.initializeApi(),this.getData()}async validateAndSubmit({onSuccess:s}){this.formController.validateAndSubmit((()=>this.sendData(s)))}componentWillLoad(){this.initializeApi(),this.initializeForm()}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=o({authToken:this.authToken,businessId:this.businessId,service:new l}),this.patchBusiness=a({authToken:this.authToken,businessId:this.businessId,service:new l})):this.errorEvent.emit({message:"Missing required props",errorCode:n.MISSING_PROPS,severity:r.ERROR})}initializeForm(){const s=Q[this.country];s?(this.formController=new f(s("representative",this.allowOptionalFields)),this.getData()):this.errorEvent.emit({message:"Missing schema for selected country",errorCode:n.MISSING_PROPS,severity:r.ERROR})}componentDidLoad(){this.formController&&this.formController.errors.subscribe((s=>{this.errors=Object.assign({},s)}))}get patchPayload(){return{representative:new C(this.formController.values.getValue()).payload}}render(){return!this.formController||this.isLoading?e(B,null):e("justifi-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"]}}},ls=class{constructor(e){s(this,e),this.stepCompleteEvent=t(this,"complete-form-step-event",7),this.errorEvent=t(this,"error-event",7),this.formLoading=t(this,"formLoading",7),this.formCompleted=t(this,"formCompleted",7),this.errors={},this.fetchData=async()=>{this.formLoading.emit(!0);try{const s=await this.api.get({endpoint:this.businessEndpoint,authToken:this.authToken});this.acceptedTermsBefore=s.data.terms_conditions_accepted}catch(s){this.errorEvent.emit({errorCode:n.FETCH_ERROR,message:s.message,severity:r.ERROR,data:s})}finally{this.formLoading.emit(!1)}},this.sendData=async s=>{this.formLoading.emit(!0);try{const t=this.termsPayload,e=await this.api.post({endpoint:this.termsConditionsEndpoint,body:t,authToken:this.authToken});this.handleResponse(e,s)}catch(s){this.errorEvent.emit({errorCode:n.POST_ERROR,message:s.message,severity:r.ERROR,data:s})}finally{this.formLoading.emit(!1)}},this.inputHandler=(s,t)=>{this.acceptedTerms=t,this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[s]:t}))}}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=K(),this.formController=new f((s=>{const t=v({accepted:w().oneOf([!0],"You must agree to the terms and conditions to continue").required("You must agree to the terms and conditions to continue")}),e=v({accepted:w().nullable()});return s?e:t})(this.allowOptionalFields)),this.businessId&&this.authToken&&this.fetchData()}handleResponse(s,t){s.error?this.errorEvent.emit({errorCode:n.POST_ERROR,message:s.error.message,severity:r.ERROR,data:s.error}):t(),this.stepCompleteEvent.emit({response:s,formStep:V.termsAndConditions}),this.formCompleted.emit()}async validateAndSubmit({onSuccess:s}){this.acceptedTermsBefore?(this.stepCompleteEvent.emit({response:null,formStep:V.termsAndConditions,metadata:"no data submitted"}),this.formCompleted.emit(),s()):this.formController.validateAndSubmit((()=>this.sendData(s)))}componentDidLoad(){this.formController.errors.subscribe((s=>{this.errors=Object.assign({},s)}))}get merchantAgreementLink(){return e("a",{href:"https://justifi.tech/merchant-agreement/",target:"_blank",rel:"noopener noreferrer"},"merchant agreement")}render(){return e("form",{key:"33336d0a66d63ce39951822fd570a9a0689e714d"},e("fieldset",{key:"fcfdb59eef671cb408ed99e2dad20d6be706688a"},e("legend",{key:"f0cf7f0ac15c90cf36ee25d4bf986c0e781a2e92",part:S},"Terms and Conditions"),e("hr",{key:"d5c820e7d6523f931040a994bd103d69fd644c45"}),e("div",{key:"681b584de14afe121f5dc69ee0bad1cab51ba0d1"},e("p",{key:"7c597bf891a108d303739126b806ded5220f56ab"},"Please read and accept the ",this.merchantAgreementLink," to submit your provisioning request.")),e("br",{key:"52854c5a07611180be40df21a5f60d7d9d4c4cb7"}),e("div",{key:"7448b3f6138b996edac137b961367725e3b40556",class:"row-gy-3"},e("div",{key:"c732deb4e1e3a2d04dd4e09914543a7f594af108",class:"col-12"},e("form-control-checkbox",{key:"fca18e4843aef20d13790029b114b2ecaeb6ffa2",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})))))}},ds=class{constructor(e){s(this,e),this.errorEvent=t(this,"error-event",7),this.stepCompleteEvent=t(this,"complete-form-step-event",7),this.formLoading=t(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:s=>{const t=new T((s.data||{}).legal_address||{});this.legal_address=Object.assign(Object.assign({},t),{country:this.country}),this.formController.setInitialValues(Object.assign({},this.legal_address))},onError:({error:s,code:t,severity:e})=>{this.errorEvent.emit({message:s,errorCode:t,severity:e})},final:()=>{this.formLoading.emit(!1),this.isLoading=!1}}))},this.sendData=s=>{let t;this.formLoading.emit(!0),this.patchBusiness({payload:this.patchPayload,onSuccess:e=>{t=e,s()},onError:({error:s,code:e,severity:i})=>{t=s,this.errorEvent.emit({message:s,errorCode:e,severity:i})},final:()=>{this.stepCompleteEvent.emit({response:t,formStep:V.legalAddress}),this.formLoading.emit(!1)}})},this.inputHandler=(s,t)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[s]:t}))}}propChanged(){this.initializeApi()}async validateAndSubmit({onSuccess:s}){this.formController.validateAndSubmit((()=>this.sendData(s)))}get patchPayload(){return{legal_address:new T(this.formController.values.getValue()).payload}}componentWillLoad(){this.initializeApi(),this.formController=new f((0,Z[this.country])(this.allowOptionalFields)),this.getData()}componentDidLoad(){this.formController.errors.subscribe((s=>{this.errors=Object.assign({},s)}))}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=o({authToken:this.authToken,businessId:this.businessId,service:new l}),this.patchBusiness=a({authToken:this.authToken,businessId:this.businessId,service:new l})):this.errorEvent.emit({message:"Missing required props",errorCode:n.MISSING_PROPS,severity:r.ERROR})}render(){var s;const t=null===(s=this.formController)||void 0===s?void 0:s.getInitialValues();return this.isLoading?e(B,null):e("form",null,e("fieldset",null,e("div",{class:"d-flex align-items-center gap-2"},e("legend",{class:"mb-0",part:S},"Legal Address of your Business"),e("form-control-tooltip",{helpText:"No PO Boxes."})),e("hr",{class:"mt-2"}),e("justifi-form-address-fields",{country:this.country,errors:this.errors,defaultValues:t,inputHandler:this.inputHandler})))}static get watchers(){return{authToken:["propChanged"],businessId:["propChanged"]}}},us=class{constructor(t){s(this,t)}get showPreviousStepButton(){return this.currentStep>0}get showNextStepButton(){return this.currentStep<this.totalSteps}get showSubmitButton(){return this.currentStep===this.totalSteps}render(){return e("div",{key:"53ba6c809e1968712b333f4bcf2798dbca186ddb",class:"d-flex gap-2"},e(J,{key:"b45c60083ccf6589cae0c63ce6b66c18da340dc7",variant:"secondary",type:"button",onClick:()=>this.previousStepButtonOnClick(),disabled:this.formDisabled,hidden:!this.showPreviousStepButton},"Previous"),e(J,{key:"27372798da0276de44d1563a4688486e7cc91d64",variant:"primary",type:"button",onClick:s=>this.nextStepButtonOnClick(s,F.nextStep),disabled:this.formDisabled,isLoading:this.formLoading,hidden:!this.showNextStepButton},"Next"),e(J,{key:"8bc14ca8fe951caf276f8ed03e502486e11acbe2",variant:"primary",type:"submit",onClick:s=>this.nextStepButtonOnClick(s,F.submit),disabled:this.formDisabled,isLoading:this.formLoading,hidden:!this.showSubmitButton},"Submit"))}},ms=class{constructor(t){s(this,t),this.allowOptionalFields=!1,this.country=_.USA,this.componentStepMapping={0:()=>e("justifi-business-core-info-form-step",{businessId:this.businessId,authToken:this.authToken,ref:s=>this.refs[0]=s,allowOptionalFields:this.allowOptionalFields,country:this.country}),1:()=>e("justifi-legal-address-form-step",{businessId:this.businessId,authToken:this.authToken,ref:s=>this.refs[1]=s,allowOptionalFields:this.allowOptionalFields,country:this.country}),2:()=>e("justifi-additional-questions-form-step",{businessId:this.businessId,authToken:this.authToken,ref:s=>this.refs[2]=s,allowOptionalFields:this.allowOptionalFields}),3:()=>e("justifi-business-representative-form-step",{businessId:this.businessId,authToken:this.authToken,ref:s=>this.refs[3]=s,allowOptionalFields:this.allowOptionalFields,country:this.country}),4:()=>e("justifi-business-owners-form-step",{businessId:this.businessId,authToken:this.authToken,ref:s=>this.refs[4]=s,allowOptionalFields:this.allowOptionalFields,country:this.country}),5:()=>e("justifi-business-bank-account-form-step",{businessId:this.businessId,authToken:this.authToken,ref:s=>this.refs[5]=s,allowOptionalFields:this.allowOptionalFields,country:this.country}),6:()=>e("justifi-business-terms-conditions-form-step",{businessId:this.businessId,authToken:this.authToken,ref:s=>this.refs[6]=s,onFormLoading:this.handleFormLoading,allowOptionalFields:this.allowOptionalFields})}}get currentStepComponent(){return this.componentStepMapping[this.currentStep]()}render(){return e("div",{key:"ff7c9e688009383fdbe18c9824fa578d2338900c",class:"col-12 mb-4"},this.currentStepComponent)}};export{ts as justifi_additional_questions_form_step,os as justifi_business_bank_account_form_step,as as justifi_business_core_info_form_step,hs as justifi_business_owners_form_step,cs as justifi_business_representative_form_step,ls as justifi_business_terms_conditions_form_step,ds as justifi_legal_address_form_step,us as justifi_payment_provisioning_form_buttons,ms as justifi_payment_provisioning_form_steps}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,c as t,h as i}from"./p-CV0Pyo1O.js";import{c as a,J as s}from"./p-
|
|
1
|
+
import{r as e,c as t,h as i}from"./p-CV0Pyo1O.js";import{c as a,J as s}from"./p-DX6fcx_0.js";import{c as d}from"./p-Daew0gTO.js";import{c}from"./p-C4FLe2pT.js";import{S as o}from"./p-BqNNwq6C.js";import"./p-CZfYo5-1.js";import{P as f}from"./p-DkoufM1t.js";import"./p-C2WozQkF.js";import"./p-55QcjheA.js";import"./p-DVJaoI_m.js";import"./p-D8GTwl9v.js";import"./p-MeSAYDNh.js";import"./p-HXpYMWUU.js";import"./p-Cjcsf8ku.js";import"./p-BiNakvsa.js";import"./p-BH0Xfn-F.js";import"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";const h=class{constructor(i){e(this,i),this.errorEvent=t(this,"error-event",7),this.loadedEvent=t(this,"loaded",7),this.submitEvent=t(this,"submit-event",7),this.availablePaymentMethods=[],this.errorMessage="",this.insuranceToggled=!1,this.isSubmitting=!1,this.disableBankAccount=!1,this.disableBnpl=!1,this.disableCreditCard=!1,this.disablePaymentMethodGroup=!1,this.hideBankAccountBillingForm=!1,this.hideCardBillingForm=!1}propChanged(){this.updateStore()}connectedCallback(){this.authToken&&this.checkoutId&&this.updateStore()}componentWillLoad(){a(),this.analytics=new s(this)}disconnectedCallback(){var e;null===(e=this.analytics)||void 0===e||e.cleanup()}checkoutComplete(e){this.isSubmitting=!1}checkoutError(e){console.error("[justifi-checkout] error-event received",null==e?void 0:e.detail),this.isSubmitting=!1}checkoutChanged(e){this.availablePaymentMethods=this.disableBnpl?e.detail.availablePaymentMethodTypes.filter((e=>e!==f.SEZZLE)):e.detail.availablePaymentMethodTypes}async fillBillingForm(e){var t;d.billingFormFields=e,null===(t=this.tokenizePaymentMethodRef)||void 0===t||t.fillBillingForm(e)}async validate(){var e;return{isValid:await(null===(e=this.modularCheckoutRef)||void 0===e?void 0:e.validate())}}updateStore(){d.checkoutId=this.checkoutId,d.authToken=this.authToken,d.disableCreditCard=this.disableCreditCard,d.disableBankAccount=this.disableBankAccount,d.disablePaymentMethodGroup=this.disablePaymentMethodGroup}async submit(e){var t;this.isSubmitting=!0,null===(t=this.modularCheckoutRef)||void 0===t||t.submitCheckout(d.billingFormFields)}get showPaymentTypeHeader(){return!this.disableCreditCard&&!this.disableBankAccount}render(){var e,t;return i(o,{key:"6bbc4c4997d14ac9040b8f88075a7e9b53208d4c"},i("justifi-modular-checkout",{key:"9b11e7df277e5e9f70cd8928f865a2e62cfc8293",ref:e=>{this.modularCheckoutRef=e},authToken:this.authToken,checkoutId:this.checkoutId,preCompleteHook:this.preCompleteHook},i("div",{key:"c64981c31fd2d022f886b0613bd47bd0b0fe5f2a",class:"row gy-3 jfi-checkout-core"},i("div",{key:"8f01af25b281a19f7fc83451a44f63836efadc20",class:"col-12",part:c},i("justifi-header",{key:"d729ed0b26c94e74d8ce824fcf97bd3002e3a9d0",text:"Summary",level:"h2",class:"fs-5 fw-bold pb-3"}),i("section",{key:"9cc9863b1dd2531bda52e609bba5c7c8f9883cb1"},i("justifi-checkout-summary",{key:"00f36de593e245982bfe03c8867881fedfb7d43f"}))),i("div",{key:"3fe5390d7b8b2fbcdbfff4b71d4b7c43ddae9ff6",class:"col-12 mt-4"},i("slot",{key:"84fa5a7e7772124d7fa61a9317499618850eb0bb",name:"insurance"})),i("div",{key:"c8d1553c6041c0e000eab9dc953a23aa089a3f90",class:"col-12 mt-4"},i("justifi-header",{key:"a08fc163ba437f767ab88d78ac55ae003b09a567",text:"Payment",level:"h2",class:"fs-5 fw-bold pb-3"}),this.showPaymentTypeHeader&&i("justifi-header",{key:"bff5fc2986d37bbe49a5253d43db55663ee7be74",text:"Select payment type",level:"h3",class:"fs-6 fw-bold lh-lg"}),i("div",{key:"f5ca969400444639b09e423b154e47abf89c731f",class:"d-flex flex-column"},i("section",{key:"b70209321ebefd161ae3113293c62fe953913f2e"},i("div",{key:"4df7539a9b8d6b52d47ad32974a59ab2d366b4b2"},this.availablePaymentMethods.includes(f.APPLE_PAY)&&i("div",{key:"023deb9a1d025e36cc2b07c3ea8144e0068ea470",class:"mb-3"},i("justifi-apple-pay",{key:"4e52440f329bae25194e71fa30190218f5c1cecb"})),this.availablePaymentMethods.includes(f.GOOGLE_PAY)&&i("div",{key:"83e12debb25e0ef095ca40d87054411396238754",class:"mb-3"},i("justifi-google-pay",{key:"ed6312e39ff4a98c819cf1853f416c6fbf845323",ref:e=>this.googlePayRef=e})),i("justifi-saved-payment-methods",{key:"e059fda26ec54c4f908754663fa23f26c3df8f0c"}),this.availablePaymentMethods.includes(f.SEZZLE)&&i("justifi-radio-list-item",{key:"3d836539d5850abfd956b39bede6efad5954bdad",name:"paymentMethodType",value:f.SEZZLE,checked:(null===(e=null==d?void 0:d.selectedPaymentMethod)||void 0===e?void 0:e.type)===f.SEZZLE,label:i("justifi-sezzle-payment-method",{ref:e=>this.sezzlePaymentMethodRef=e}),"onRadio-click":()=>{var e;null===(e=this.sezzlePaymentMethodRef)||void 0===e||e.handleSelectionClick()}}),this.availablePaymentMethods.includes(f.PLAID)&&!this.disableBnpl&&i("justifi-radio-list-item",{key:"ac0ac64e9f7586764e3f5671c74794c80ffcff54",name:"paymentMethodType",value:f.PLAID,checked:(null===(t=null==d?void 0:d.selectedPaymentMethod)||void 0===t?void 0:t.type)===f.PLAID,label:i("justifi-plaid-payment-method",{ref:e=>this.plaidPaymentMethodRef=e}),"onRadio-click":()=>{var e;null===(e=this.plaidPaymentMethodRef)||void 0===e||e.handleSelectionClick()}}),i("internal-tokenize-payment-method",{key:"894e7a5bfef2eefa5d045928bb6fab3b1f39bd5e",ref:e=>this.tokenizePaymentMethodRef=e,authToken:this.authToken,accountId:d.accountId,disableCreditCard:this.disableCreditCard,disableBankAccount:this.disableBankAccount,hideCardBillingForm:this.hideCardBillingForm,hideBankAccountBillingForm:this.hideBankAccountBillingForm,hideSubmitButton:!0,paymentMethodGroupId:d.paymentMethodGroupId}))))),i("div",{key:"2121952545d38693f11426ef8146b39956d4f427",class:"mt-4"},i("justifi-button",{key:"5e7cf3c699048943df68c0506a34617d0b14bf07",text:"Pay",type:"submit",variant:"primary",clickHandler:e=>this.submit(e),disabled:this.isSubmitting,isLoading:this.isSubmitting,customStyle:{width:"100%",textAlign:"center"}})))))}static get watchers(){return{authToken:["propChanged"],checkoutId:["propChanged"],disableCreditCard:["propChanged"],disableBankAccount:["propChanged"],disablePaymentMethodGroup:["propChanged"]}}};export{h as justifi_checkout}
|