@saasquatch/mint-components 2.0.2-8 → 2.0.2
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/{IndirectTaxDetailsView-e5f70b8b.js → IndirectTaxDetailsView-659a139c.js} +2 -2
- package/dist/cjs/{ShadowViewAddon-925a8fa6.js → ShadowViewAddon-fbc33c53.js} +8 -8
- package/dist/cjs/{usePayoutStatus-9abe2de8.js → data-16106637.js} +129 -158
- package/dist/cjs/{global-8bba5b3a.js → global-e862bfd4.js} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/mint-components.cjs.js +2 -2
- package/dist/cjs/sqm-banking-info-form_10.cjs.entry.js +115 -345
- package/dist/cjs/sqm-big-stat_47.cjs.entry.js +29 -224
- package/dist/cjs/sqm-code-verification.cjs.entry.js +1 -1
- package/dist/cjs/sqm-email-verification.cjs.entry.js +1 -1
- package/dist/cjs/sqm-empty_4.cjs.entry.js +1 -1
- package/dist/cjs/sqm-header-logo.cjs.entry.js +1 -14
- package/dist/cjs/{sqm-lead-checkbox-field-view-340acad0.js → sqm-lead-checkbox-field-view-dca40eb4.js} +1 -1
- package/dist/cjs/sqm-lead-checkbox-field.cjs.entry.js +3 -3
- package/dist/cjs/{sqm-lead-input-field-view-06ed3632.js → sqm-lead-input-field-view-2006001f.js} +1 -1
- package/dist/cjs/sqm-lead-input-field.cjs.entry.js +3 -3
- package/dist/cjs/sqm-leaderboard-rank.cjs.entry.js +1 -1
- package/dist/cjs/sqm-pagination_3.cjs.entry.js +1 -1
- package/dist/cjs/{sqm-portal-email-verification-view-5518eb0d.js → sqm-portal-email-verification-view-1745d9a2.js} +1 -1
- package/dist/cjs/sqm-portal-email-verification.cjs.entry.js +2 -2
- package/dist/cjs/{sqm-portal-profile-view-615e6975.js → sqm-portal-profile-view-5c5e29b1.js} +1 -1
- package/dist/cjs/sqm-portal-profile.cjs.entry.js +2 -2
- package/dist/cjs/sqm-referral-table_11.cjs.entry.js +1 -1
- package/dist/cjs/sqm-rewards-table_9.cjs.entry.js +1 -1
- package/dist/cjs/sqm-stencilbook.cjs.entry.js +8 -9
- package/dist/cjs/{useLeadFormState-fd0445f9.js → useLeadFormState-91999606.js} +1 -1
- package/dist/cjs/{utils-83d125fa.js → utils-4eb18a29.js} +1 -1
- package/dist/collection/components/sqm-header-logo/sqm-header-logo.js +3 -80
- package/dist/collection/components/sqm-portal-footer/sqm-portal-footer-view.js +3 -3
- package/dist/collection/components/sqm-reward-exchange-list/sqm-reward-exchange-list-view.js +4 -4
- package/dist/collection/components/tax-and-cash/TaxForm.stories.js +0 -1
- package/dist/collection/components/tax-and-cash/sqm-banking-info-form/useBankingInfoForm.js +1 -2
- package/dist/collection/components/tax-and-cash/sqm-indirect-tax-form/useIndirectTaxForm.js +40 -46
- package/dist/collection/components/tax-and-cash/sqm-payout-status-alert/sqm-payout-status-alert-view.js +2 -90
- package/dist/collection/components/tax-and-cash/sqm-payout-status-alert/sqm-payout-status-alert.js +0 -353
- package/dist/collection/components/tax-and-cash/sqm-payout-status-alert/usePayoutStatus.js +3 -33
- package/dist/collection/components/tax-and-cash/sqm-tax-and-cash/sqm-tax-and-cash.js +1 -301
- package/dist/collection/components/tax-and-cash/sqm-tax-and-cash-dashboard/sqm-tax-and-cash-dashboard-view.js +2 -92
- package/dist/collection/components/tax-and-cash/sqm-tax-and-cash-dashboard/sqm-tax-and-cash-dashboard.js +2 -302
- package/dist/collection/components/tax-and-cash/sqm-user-info-form/sqm-user-info-form-view.js +12 -23
- package/dist/collection/components/tax-and-cash/sqm-user-info-form/sqm-user-info-form.js +1 -1
- package/dist/collection/components/tax-and-cash/sqm-user-info-form/useUserInfoForm.js +9 -92
- package/dist/collection/global/styles.js +1 -1
- package/dist/collection/global/styles.ts +1 -1
- package/dist/esm/{IndirectTaxDetailsView-0a57b622.js → IndirectTaxDetailsView-8dec05e4.js} +2 -2
- package/dist/esm/{ShadowViewAddon-aae27c2e.js → ShadowViewAddon-7a242b65.js} +8 -8
- package/dist/esm/{usePayoutStatus-e0ef2374.js → data-acdb790f.js} +130 -159
- package/dist/esm/{global-1099f20d.js → global-58a69018.js} +1 -1
- package/dist/esm/loader.js +2 -2
- package/dist/esm/mint-components.js +2 -2
- package/dist/esm/sqm-banking-info-form_10.entry.js +66 -296
- package/dist/esm/sqm-big-stat_47.entry.js +7 -202
- package/dist/esm/sqm-code-verification.entry.js +1 -1
- package/dist/esm/sqm-email-verification.entry.js +1 -1
- package/dist/esm/sqm-empty_4.entry.js +1 -1
- package/dist/esm/sqm-header-logo.entry.js +1 -14
- package/dist/esm/{sqm-lead-checkbox-field-view-cbafee07.js → sqm-lead-checkbox-field-view-81541e40.js} +1 -1
- package/dist/esm/sqm-lead-checkbox-field.entry.js +3 -3
- package/dist/esm/{sqm-lead-input-field-view-f3775c28.js → sqm-lead-input-field-view-d543d939.js} +1 -1
- package/dist/esm/sqm-lead-input-field.entry.js +3 -3
- package/dist/esm/sqm-leaderboard-rank.entry.js +1 -1
- package/dist/esm/sqm-pagination_3.entry.js +1 -1
- package/dist/esm/{sqm-portal-email-verification-view-7d86299c.js → sqm-portal-email-verification-view-5fb1a99e.js} +1 -1
- package/dist/esm/sqm-portal-email-verification.entry.js +2 -2
- package/dist/esm/{sqm-portal-profile-view-3ed13e4d.js → sqm-portal-profile-view-e3aef106.js} +1 -1
- package/dist/esm/sqm-portal-profile.entry.js +2 -2
- package/dist/esm/sqm-referral-table_11.entry.js +1 -1
- package/dist/esm/sqm-rewards-table_9.entry.js +1 -1
- package/dist/esm/sqm-stencilbook.entry.js +8 -9
- package/dist/esm/{useLeadFormState-c379e5d7.js → useLeadFormState-8d4b2620.js} +1 -1
- package/dist/esm/{utils-6122971b.js → utils-2695a43e.js} +1 -1
- package/dist/esm-es5/{IndirectTaxDetailsView-0a57b622.js → IndirectTaxDetailsView-8dec05e4.js} +1 -1
- package/dist/esm-es5/{ShadowViewAddon-aae27c2e.js → ShadowViewAddon-7a242b65.js} +1 -1
- package/dist/esm-es5/data-acdb790f.js +6 -0
- package/dist/esm-es5/{global-1099f20d.js → global-58a69018.js} +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/mint-components.js +1 -1
- package/dist/esm-es5/sqm-banking-info-form_10.entry.js +1 -1
- package/dist/esm-es5/sqm-big-stat_47.entry.js +1 -1
- package/dist/esm-es5/sqm-code-verification.entry.js +1 -1
- package/dist/esm-es5/sqm-email-verification.entry.js +1 -1
- package/dist/esm-es5/sqm-empty_4.entry.js +1 -1
- package/dist/esm-es5/sqm-header-logo.entry.js +1 -1
- package/dist/esm-es5/{sqm-lead-checkbox-field-view-cbafee07.js → sqm-lead-checkbox-field-view-81541e40.js} +1 -1
- package/dist/esm-es5/sqm-lead-checkbox-field.entry.js +1 -1
- package/dist/esm-es5/{sqm-lead-input-field-view-f3775c28.js → sqm-lead-input-field-view-d543d939.js} +1 -1
- package/dist/esm-es5/sqm-lead-input-field.entry.js +1 -1
- package/dist/esm-es5/sqm-leaderboard-rank.entry.js +1 -1
- package/dist/esm-es5/sqm-pagination_3.entry.js +1 -1
- package/dist/esm-es5/{sqm-portal-email-verification-view-7d86299c.js → sqm-portal-email-verification-view-5fb1a99e.js} +1 -1
- package/dist/esm-es5/sqm-portal-email-verification.entry.js +1 -1
- package/dist/esm-es5/{sqm-portal-profile-view-3ed13e4d.js → sqm-portal-profile-view-e3aef106.js} +1 -1
- package/dist/esm-es5/sqm-portal-profile.entry.js +1 -1
- package/dist/esm-es5/sqm-referral-table_11.entry.js +1 -1
- package/dist/esm-es5/sqm-rewards-table_9.entry.js +1 -1
- package/dist/esm-es5/sqm-stencilbook.entry.js +1 -1
- package/dist/esm-es5/{useLeadFormState-c379e5d7.js → useLeadFormState-8d4b2620.js} +1 -1
- package/dist/esm-es5/{utils-6122971b.js → utils-2695a43e.js} +1 -1
- package/dist/mint-components/global/styles.ts +1 -1
- package/dist/mint-components/mint-components.esm.js +1 -1
- package/dist/mint-components/mint-components.js +1 -1
- package/dist/mint-components/{p-717b6730.system.entry.js → p-011c0990.system.entry.js} +1 -1
- package/dist/mint-components/p-012d31bc.entry.js +99 -0
- package/dist/mint-components/{p-db1a0db1.js → p-027c0b10.js} +1 -1
- package/dist/mint-components/{p-aa8c6332.js → p-088f082f.js} +1 -1
- package/dist/mint-components/{p-511c87ce.system.entry.js → p-0c024cf0.system.entry.js} +1 -1
- package/dist/mint-components/{p-60465a2d.system.js → p-1215518e.system.js} +1 -1
- package/dist/mint-components/{p-6c006998.entry.js → p-12e6cea7.entry.js} +2 -2
- package/dist/mint-components/{p-ad4348c3.system.js → p-13c6673e.system.js} +1 -1
- package/dist/mint-components/{p-ed16b35a.js → p-1aa9136c.js} +1 -1
- package/dist/mint-components/{p-a5c63310.entry.js → p-1b79b186.entry.js} +1 -1
- package/dist/mint-components/{p-6d5bd95a.js → p-1d8c5935.js} +1 -1
- package/dist/mint-components/{p-56009bf0.system.entry.js → p-2ea3eea9.system.entry.js} +1 -1
- package/dist/mint-components/p-2ea6e2fa.entry.js +273 -0
- package/dist/mint-components/p-303b84d7.system.entry.js +1 -0
- package/dist/mint-components/{p-7a268047.js → p-325c5476.js} +1 -1
- package/dist/mint-components/{p-bec87ac9.system.entry.js → p-36a1fa33.system.entry.js} +1 -1
- package/dist/mint-components/{p-aefaec37.entry.js → p-43ad51bc.entry.js} +1 -1
- package/dist/mint-components/p-469a6450.system.js +6 -0
- package/dist/mint-components/{p-e0a724dd.system.js → p-4cc72a4e.system.js} +1 -1
- package/dist/mint-components/{p-47c83656.entry.js → p-58c79873.entry.js} +1 -1
- package/dist/mint-components/{p-c994512c.system.js → p-5fbe6356.system.js} +1 -1
- package/dist/mint-components/{p-6d9ce4e5.entry.js → p-6076dbaf.entry.js} +1 -1
- package/dist/mint-components/{p-5f3eafd4.entry.js → p-6976099f.entry.js} +2 -2
- package/dist/mint-components/p-752ede25.system.entry.js +1 -0
- package/dist/mint-components/{p-74f43a08.system.js → p-78dda262.system.js} +1 -1
- package/dist/mint-components/{p-4ce51b1c.system.entry.js → p-829cb9ed.system.entry.js} +1 -1
- package/dist/mint-components/{p-c85f204b.system.js → p-8618e8f6.system.js} +1 -1
- package/dist/mint-components/{p-aa08457e.system.js → p-8d9fa981.system.js} +1 -1
- package/dist/mint-components/p-947bacd1.system.js +1 -0
- package/dist/mint-components/{p-0649123a.system.entry.js → p-97747228.system.entry.js} +1 -1
- package/dist/mint-components/{p-79a3344f.js → p-988f236f.js} +1 -1
- package/dist/mint-components/{p-22a9114f.system.entry.js → p-9d46f87f.system.entry.js} +1 -1
- package/dist/mint-components/{p-4c811d12.entry.js → p-a470e203.entry.js} +2 -2
- package/dist/mint-components/p-a7ee19dc.entry.js +1 -0
- package/dist/mint-components/{p-00bc7211.js → p-a974c549.js} +1 -1
- package/dist/mint-components/p-ad3ebf4d.entry.js +1 -0
- package/dist/mint-components/{p-4fed8672.js → p-bf044217.js} +1 -1
- package/dist/mint-components/{p-d3120982.system.entry.js → p-c6e8086f.system.entry.js} +1 -1
- package/dist/mint-components/{p-38f932ae.system.js → p-d7635535.system.js} +1 -1
- package/dist/mint-components/{p-ea0bc627.entry.js → p-d88d8ffe.entry.js} +1 -1
- package/dist/mint-components/{p-a217cc8d.entry.js → p-dc5bca55.entry.js} +1 -1
- package/dist/mint-components/{p-6445e926.system.entry.js → p-deecffd0.system.entry.js} +1 -1
- package/dist/mint-components/{p-60c14cec.entry.js → p-e19f0908.entry.js} +1 -1
- package/dist/mint-components/p-e1e7d01c.js +157 -0
- package/dist/mint-components/{p-14e813a7.system.entry.js → p-e8bda98a.system.entry.js} +1 -1
- package/dist/mint-components/{p-5d059c95.entry.js → p-ee3a7577.entry.js} +1 -1
- package/dist/mint-components/p-eea87fdc.system.entry.js +1 -0
- package/dist/mint-components/{p-f401ef19.system.entry.js → p-f5256738.system.entry.js} +1 -1
- package/dist/mint-components/p-f5820d03.system.js +1 -0
- package/dist/mint-components/{p-18720462.system.entry.js → p-fcf8bdbc.system.entry.js} +1 -1
- package/dist/mint-components/{p-57ce33dd.js → p-ffc3cd7c.js} +2 -2
- package/dist/types/components/sqm-header-logo/sqm-header-logo.d.ts +1 -14
- package/dist/types/components/tax-and-cash/sqm-indirect-tax-form/useIndirectTaxForm.d.ts +0 -24
- package/dist/types/components/tax-and-cash/sqm-payout-status-alert/sqm-payout-status-alert-view.d.ts +0 -16
- package/dist/types/components/tax-and-cash/sqm-payout-status-alert/sqm-payout-status-alert.d.ts +0 -57
- package/dist/types/components/tax-and-cash/sqm-payout-status-alert/usePayoutStatus.d.ts +1 -3
- package/dist/types/components/tax-and-cash/sqm-tax-and-cash/sqm-tax-and-cash.d.ts +0 -48
- package/dist/types/components/tax-and-cash/sqm-tax-and-cash-dashboard/sqm-tax-and-cash-dashboard-view.d.ts +0 -12
- package/dist/types/components/tax-and-cash/sqm-tax-and-cash-dashboard/sqm-tax-and-cash-dashboard.d.ts +0 -48
- package/dist/types/components/tax-and-cash/sqm-user-info-form/sqm-user-info-form-view.d.ts +0 -2
- package/dist/types/components/tax-and-cash/sqm-user-info-form/useUserInfoForm.d.ts +0 -1
- package/dist/types/components.d.ts +1 -331
- package/docs/docs.docx +0 -0
- package/docs/raisins.json +1 -1
- package/grapesjs/grapesjs.js +1 -1
- package/package.json +1 -1
- package/shoelace/assets/icons/twitter-x.svg +4 -0
- package/dist/esm-es5/usePayoutStatus-e0ef2374.js +0 -6
- package/dist/mint-components/p-0279c71d.system.entry.js +0 -1
- package/dist/mint-components/p-09ab53fb.system.entry.js +0 -1
- package/dist/mint-components/p-27bc4daa.system.entry.js +0 -1
- package/dist/mint-components/p-59bb2d52.system.js +0 -6
- package/dist/mint-components/p-72bc9830.entry.js +0 -273
- package/dist/mint-components/p-8b5b2acc.entry.js +0 -1
- package/dist/mint-components/p-967a9040.system.js +0 -1
- package/dist/mint-components/p-ab111e29.entry.js +0 -1
- package/dist/mint-components/p-c41108ae.js +0 -157
- package/dist/mint-components/p-e09c13e3.entry.js +0 -99
- package/dist/mint-components/p-f0eae4e6.system.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { h, r as registerInstance, c as Host, g as getElement
|
|
2
|
-
import { i as intl } from './global-
|
|
1
|
+
import { h, r as registerInstance, c as Host, g as getElement } from './index-b3a06de8.js';
|
|
2
|
+
import { i as intl } from './global-58a69018.js';
|
|
3
3
|
import { m as useRef, k as useState, f as useEffect, n as h$1, u as useMemo, b as browser, j as useReducer } from './dom-context-hooks.module-63370afd.js';
|
|
4
4
|
import { d as dist, _, L, J, t as Pn, F as Fn, x as $n, $ as $e, i as isDemo, p as En, u as useCallback, R as Rn, w as wn } from './index.module-c9811a48.js';
|
|
5
5
|
import { j as jsonpointer } from './jsonpointer-388a7082.js';
|
|
@@ -12,10 +12,10 @@ import { u as useRerenderListener, a as useRequestRerender } from './re-render-7
|
|
|
12
12
|
import { u as useChildElements } from './useChildElements-3d872cef.js';
|
|
13
13
|
import { l as luxon } from './luxon-bbf75a9d.js';
|
|
14
14
|
import { g as generateUserError } from './useReferralTable-909ccb28.js';
|
|
15
|
-
import { a as INDIRECT_TAX_SPAIN_REGIONS, b as INDIRECT_TAX_PROVINCES, O as OtherRegionSlotView, I as InvoiceTableView, v as vatLabels, A as ADDRESS_REGIONS } from './IndirectTaxDetailsView-
|
|
16
|
-
import { t as taxTypeToName, v as validTaxDocument, g as getCountryObj, L as LoadingView, f as formatErrorMessage, a as validateBillingField, o as objectIsFull } from './utils-
|
|
15
|
+
import { a as INDIRECT_TAX_SPAIN_REGIONS, b as INDIRECT_TAX_PROVINCES, O as OtherRegionSlotView, I as InvoiceTableView, v as vatLabels, A as ADDRESS_REGIONS } from './IndirectTaxDetailsView-8dec05e4.js';
|
|
16
|
+
import { t as taxTypeToName, v as validTaxDocument, g as getCountryObj, L as LoadingView, f as formatErrorMessage, a as validateBillingField, o as objectIsFull } from './utils-2695a43e.js';
|
|
17
17
|
import { b as VERIFICATION_EVENT_KEY } from './keys-406491dc.js';
|
|
18
|
-
import { i as FORM_STEPS, a as TAX_FORM_CONTEXT_NAMESPACE, S as SORTED_COUNTRIES_NAMESPACE, c as USER_QUERY_NAMESPACE, T as TAX_CONTEXT_NAMESPACE, F as FINANCE_NETWORK_SETTINGS_NAMESPACE, j as TAX_FORM_UPDATED_EVENT_KEY, U as USER_FORM_CONTEXT_NAMESPACE, d as COUNTRIES_QUERY_NAMESPACE, k as useVeriffApp, l as getStatus, V as VERIFF_COMPLETE_EVENT_KEY, C as CURRENCIES_NAMESPACE } from './
|
|
18
|
+
import { i as FORM_STEPS, a as TAX_FORM_CONTEXT_NAMESPACE, S as SORTED_COUNTRIES_NAMESPACE, c as USER_QUERY_NAMESPACE, T as TAX_CONTEXT_NAMESPACE, F as FINANCE_NETWORK_SETTINGS_NAMESPACE, j as TAX_FORM_UPDATED_EVENT_KEY, U as USER_FORM_CONTEXT_NAMESPACE, d as COUNTRIES_QUERY_NAMESPACE, k as useVeriffApp, l as getStatus, V as VERIFF_COMPLETE_EVENT_KEY, C as CURRENCIES_NAMESPACE } from './data-acdb790f.js';
|
|
19
19
|
|
|
20
20
|
function getFormMap({ props, getValidationErrorMessage, bankCountry, }) {
|
|
21
21
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32;
|
|
@@ -901,8 +901,7 @@ function useBankingInfoForm(props) {
|
|
|
901
901
|
: _paymentMethodChecked;
|
|
902
902
|
useEffect(() => {
|
|
903
903
|
// reset redirect hash
|
|
904
|
-
|
|
905
|
-
window.location.hash = "";
|
|
904
|
+
window.location.hash = "";
|
|
906
905
|
}, []);
|
|
907
906
|
useEffect(() => {
|
|
908
907
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
@@ -2608,51 +2607,8 @@ function useIndirectTaxForm(props) {
|
|
|
2608
2607
|
console.error("Could not detect select change");
|
|
2609
2608
|
setFormState((p) => ({ ...p, [field]: value }));
|
|
2610
2609
|
};
|
|
2611
|
-
async function connectPartner(formData) {
|
|
2612
|
-
var _a, _b, _c, _d, _e;
|
|
2613
|
-
const vars = {
|
|
2614
|
-
user: {
|
|
2615
|
-
id: user.id,
|
|
2616
|
-
accountId: user.accountId,
|
|
2617
|
-
},
|
|
2618
|
-
firstName: userForm.firstName,
|
|
2619
|
-
lastName: userForm.lastName,
|
|
2620
|
-
countryCode: userForm.countryCode,
|
|
2621
|
-
currency: userForm.currency,
|
|
2622
|
-
address: userForm.address,
|
|
2623
|
-
city: userForm.city,
|
|
2624
|
-
state: userForm.state,
|
|
2625
|
-
postalCode: userForm.postalCode,
|
|
2626
|
-
phoneNumber: userForm.phoneNumber,
|
|
2627
|
-
phoneNumberCountryCode: userForm.phoneNumberCountryCode,
|
|
2628
|
-
indirectTaxCountryCode: formData.selectedRegion,
|
|
2629
|
-
indirectTaxRegion: formData.province || formData.subRegion,
|
|
2630
|
-
indirectTaxId: formData.indirectTaxNumber,
|
|
2631
|
-
additionalTaxId: formData.qstNumber,
|
|
2632
|
-
withholdingTaxId: formData.subRegionTaxNumber,
|
|
2633
|
-
};
|
|
2634
|
-
const result = await connectImpactPartner({
|
|
2635
|
-
vars,
|
|
2636
|
-
});
|
|
2637
|
-
if (!result || ((_a = result) === null || _a === void 0 ? void 0 : _a.message))
|
|
2638
|
-
throw new Error();
|
|
2639
|
-
if (!((_b = result.createImpactConnection) === null || _b === void 0 ? void 0 : _b.success)) {
|
|
2640
|
-
// Output backend errors to console for now
|
|
2641
|
-
console.error("Failed to create Impact connection: ", result.createImpactConnection.validationErrors);
|
|
2642
|
-
throw new Error();
|
|
2643
|
-
}
|
|
2644
|
-
await refetch();
|
|
2645
|
-
const resultPublisher = (_e = (_d = (_c = result
|
|
2646
|
-
.createImpactConnection) === null || _c === void 0 ? void 0 : _c.user) === null || _d === void 0 ? void 0 : _d.impactConnection) === null || _e === void 0 ? void 0 : _e.publisher;
|
|
2647
|
-
const hasValidCurrentDocument = validTaxDocument(resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.requiredTaxDocumentType) && (resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.currentTaxDocument);
|
|
2648
|
-
// Fire form change event
|
|
2649
|
-
window.dispatchEvent(new Event(TAX_FORM_UPDATED_EVENT_KEY));
|
|
2650
|
-
return {
|
|
2651
|
-
resultPublisher,
|
|
2652
|
-
hasValidCurrentDocument,
|
|
2653
|
-
};
|
|
2654
|
-
}
|
|
2655
2610
|
const onSubmit = async (event) => {
|
|
2611
|
+
var _a, _b, _c, _d, _e;
|
|
2656
2612
|
if (!option) {
|
|
2657
2613
|
setErrors({ taxDetails: true });
|
|
2658
2614
|
return;
|
|
@@ -2678,7 +2634,44 @@ function useIndirectTaxForm(props) {
|
|
|
2678
2634
|
}
|
|
2679
2635
|
setLoading(true);
|
|
2680
2636
|
try {
|
|
2681
|
-
const
|
|
2637
|
+
const vars = {
|
|
2638
|
+
user: {
|
|
2639
|
+
id: user.id,
|
|
2640
|
+
accountId: user.accountId,
|
|
2641
|
+
},
|
|
2642
|
+
firstName: userForm.firstName,
|
|
2643
|
+
lastName: userForm.lastName,
|
|
2644
|
+
countryCode: userForm.countryCode,
|
|
2645
|
+
currency: userForm.currency,
|
|
2646
|
+
address: userForm.address,
|
|
2647
|
+
city: userForm.city,
|
|
2648
|
+
state: userForm.state,
|
|
2649
|
+
postalCode: userForm.postalCode,
|
|
2650
|
+
phoneNumber: userForm.phoneNumber,
|
|
2651
|
+
phoneNumberCountryCode: userForm.phoneNumberCountryCode,
|
|
2652
|
+
indirectTaxCountryCode: formData.selectedRegion,
|
|
2653
|
+
indirectTaxRegion: formData.province || formData.subRegion,
|
|
2654
|
+
indirectTaxId: formData.indirectTaxNumber,
|
|
2655
|
+
additionalTaxId: formData.qstNumber,
|
|
2656
|
+
withholdingTaxId: formData.subRegionTaxNumber,
|
|
2657
|
+
};
|
|
2658
|
+
const result = await connectImpactPartner({
|
|
2659
|
+
vars,
|
|
2660
|
+
});
|
|
2661
|
+
if (!result || ((_a = result) === null || _a === void 0 ? void 0 : _a.message))
|
|
2662
|
+
throw new Error();
|
|
2663
|
+
if (!((_b = result.createImpactConnection) === null || _b === void 0 ? void 0 : _b.success)) {
|
|
2664
|
+
// Output backend errors to console for now
|
|
2665
|
+
console.error("Failed to create Impact connection: ", result.createImpactConnection
|
|
2666
|
+
.validationErrors);
|
|
2667
|
+
throw new Error();
|
|
2668
|
+
}
|
|
2669
|
+
await refetch();
|
|
2670
|
+
const resultPublisher = (_e = (_d = (_c = result
|
|
2671
|
+
.createImpactConnection) === null || _c === void 0 ? void 0 : _c.user) === null || _d === void 0 ? void 0 : _d.impactConnection) === null || _e === void 0 ? void 0 : _e.publisher;
|
|
2672
|
+
const hasValidCurrentDocument = validTaxDocument(resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.requiredTaxDocumentType) && (resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.currentTaxDocument);
|
|
2673
|
+
// Fire form change event
|
|
2674
|
+
window.dispatchEvent(new Event(TAX_FORM_UPDATED_EVENT_KEY));
|
|
2682
2675
|
if ((resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.requiredTaxDocumentType) &&
|
|
2683
2676
|
!hasValidCurrentDocument) {
|
|
2684
2677
|
// Go to docusign form
|
|
@@ -4031,7 +4024,7 @@ const TaxAndCashDashboardView = (props) => {
|
|
|
4031
4024
|
icon: "exclamation-octagon",
|
|
4032
4025
|
class: sheet$4.classes.ErrorHoldAlertContainer,
|
|
4033
4026
|
};
|
|
4034
|
-
case "
|
|
4027
|
+
case "ACCOUNT_REVIEW":
|
|
4035
4028
|
return {
|
|
4036
4029
|
header: text.accountReviewHeader,
|
|
4037
4030
|
description: intl.formatMessage({
|
|
@@ -4045,96 +4038,6 @@ const TaxAndCashDashboardView = (props) => {
|
|
|
4045
4038
|
icon: "exclamation-triangle",
|
|
4046
4039
|
class: sheet$4.classes.WarningHoldAlertContainer,
|
|
4047
4040
|
};
|
|
4048
|
-
case "PAYMENT_HOLD_ON_CHANGE":
|
|
4049
|
-
return {
|
|
4050
|
-
header: text.paymentHoldOnChangeHeader,
|
|
4051
|
-
description: intl.formatMessage({
|
|
4052
|
-
id: "accountReviewDescription",
|
|
4053
|
-
defaultMessage: text.paymentHoldOnChangeDescription,
|
|
4054
|
-
}, {
|
|
4055
|
-
supportLink: (h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
|
|
4056
|
-
}),
|
|
4057
|
-
buttonText: null,
|
|
4058
|
-
alertType: "warning",
|
|
4059
|
-
icon: "exclamation-triangle",
|
|
4060
|
-
class: sheet$4.classes.WarningHoldAlertContainer,
|
|
4061
|
-
};
|
|
4062
|
-
case "BENEFICIARY_NAME_INVALID":
|
|
4063
|
-
return {
|
|
4064
|
-
header: text.beneficiaryNameInvalidHeader,
|
|
4065
|
-
description: intl.formatMessage({
|
|
4066
|
-
id: "accountReviewDescription",
|
|
4067
|
-
defaultMessage: text.beneficiaryNameInvalidDescription,
|
|
4068
|
-
}, {
|
|
4069
|
-
supportLink: (h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
|
|
4070
|
-
}),
|
|
4071
|
-
button: (h(Fragment, null,
|
|
4072
|
-
h("sl-button", { disabled: states.disabled || states.loading, type: "primary", class: sheet$4.classes.EditBankDetailsButton, onClick: callbacks.onEditPayoutInfo }, text.editPaymentInformationButton),
|
|
4073
|
-
h("sl-button", { disabled: states.disabled || states.loading, type: "default", class: sheet$4.classes.EditBankDetailsButton, onClick: callbacks.onNewFormClick }, text.newFormButton))),
|
|
4074
|
-
alertType: "warning",
|
|
4075
|
-
icon: "exclamation-triangle",
|
|
4076
|
-
class: sheet$4.classes.WarningHoldAlertContainer,
|
|
4077
|
-
};
|
|
4078
|
-
case "BENEFICIARY_NAME_MISMATCH":
|
|
4079
|
-
return {
|
|
4080
|
-
header: text.beneficiaryNameMismatchHeader,
|
|
4081
|
-
description: intl.formatMessage({
|
|
4082
|
-
id: "accountReviewDescription",
|
|
4083
|
-
defaultMessage: text.beneficiaryNameMismatchDescription,
|
|
4084
|
-
}, {
|
|
4085
|
-
supportLink: (h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
|
|
4086
|
-
}),
|
|
4087
|
-
button: (h(Fragment, null,
|
|
4088
|
-
h("sl-button", { disabled: states.disabled || states.loading, type: "primary", class: sheet$4.classes.EditBankDetailsButton, onClick: callbacks.onEditPayoutInfo }, text.editPaymentInformationButton),
|
|
4089
|
-
h("sl-button", { disabled: states.disabled || states.loading, type: "default", class: sheet$4.classes.EditBankDetailsButton, onClick: callbacks.onNewFormClick }, text.newFormButton))),
|
|
4090
|
-
alertType: "warning",
|
|
4091
|
-
icon: "exclamation-triangle",
|
|
4092
|
-
class: sheet$4.classes.WarningHoldAlertContainer,
|
|
4093
|
-
};
|
|
4094
|
-
case "BANK_TAX_NAME_MISMATCH":
|
|
4095
|
-
return {
|
|
4096
|
-
header: text.bankTaxNameMismatchHeader,
|
|
4097
|
-
description: intl.formatMessage({
|
|
4098
|
-
id: "accountReviewDescription",
|
|
4099
|
-
defaultMessage: text.bankTaxNameMismatchDescription,
|
|
4100
|
-
}, {
|
|
4101
|
-
supportLink: (h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
|
|
4102
|
-
}),
|
|
4103
|
-
button: (h(Fragment, null,
|
|
4104
|
-
h("sl-button", { disabled: states.disabled || states.loading, type: "primary", class: sheet$4.classes.EditBankDetailsButton, onClick: callbacks.onEditPayoutInfo }, text.editPaymentInformationButton),
|
|
4105
|
-
h("sl-button", { disabled: states.disabled || states.loading, type: "default", class: sheet$4.classes.EditBankDetailsButton, onClick: callbacks.onNewFormClick }, text.newFormButton))),
|
|
4106
|
-
alertType: "warning",
|
|
4107
|
-
icon: "exclamation-triangle",
|
|
4108
|
-
class: sheet$4.classes.WarningHoldAlertContainer,
|
|
4109
|
-
};
|
|
4110
|
-
case "WITHDRAWAL_SETTINGS_INVALID":
|
|
4111
|
-
return {
|
|
4112
|
-
header: text.withdrawalSettingsInvalidHeader,
|
|
4113
|
-
description: intl.formatMessage({
|
|
4114
|
-
id: "accountReviewDescription",
|
|
4115
|
-
defaultMessage: text.withdrawalSettingsInvalidDescription,
|
|
4116
|
-
}, {
|
|
4117
|
-
supportLink: (h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
|
|
4118
|
-
}),
|
|
4119
|
-
button: (h("sl-button", { disabled: states.disabled || states.loading, type: "default", class: sheet$4.classes.EditBankDetailsButton, onClick: callbacks.onEditPayoutInfo }, text.editPaymentInformationButton)),
|
|
4120
|
-
alertType: "warning",
|
|
4121
|
-
icon: "exclamation-triangle",
|
|
4122
|
-
class: sheet$4.classes.WarningHoldAlertContainer,
|
|
4123
|
-
};
|
|
4124
|
-
case "PAYMENT_RETURNED":
|
|
4125
|
-
return {
|
|
4126
|
-
header: text.paymentReturnedHeader,
|
|
4127
|
-
description: intl.formatMessage({
|
|
4128
|
-
id: "accountReviewDescription",
|
|
4129
|
-
defaultMessage: text.paymentReturnedDescription,
|
|
4130
|
-
}, {
|
|
4131
|
-
supportLink: (h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
|
|
4132
|
-
}),
|
|
4133
|
-
button: (h("sl-button", { disabled: states.disabled || states.loading, type: "primary", class: sheet$4.classes.EditBankDetailsButton, onClick: callbacks.onEditPayoutInfo }, text.editPaymentInformationButton)),
|
|
4134
|
-
alertType: "error",
|
|
4135
|
-
icon: "exclamation-triangle",
|
|
4136
|
-
class: sheet$4.classes.WarningHoldAlertContainer,
|
|
4137
|
-
};
|
|
4138
4041
|
case "HOLD":
|
|
4139
4042
|
return {
|
|
4140
4043
|
header: text.payoutHoldAlertHeader,
|
|
@@ -4602,7 +4505,7 @@ const TaxAndCashDashboard = class {
|
|
|
4602
4505
|
*
|
|
4603
4506
|
* @uiName Edit payment info button label
|
|
4604
4507
|
*/
|
|
4605
|
-
this.editPaymentInformationButton = "Edit
|
|
4508
|
+
this.editPaymentInformationButton = "Edit Payout Information";
|
|
4606
4509
|
/**
|
|
4607
4510
|
* @uiName Not registered for indirect tax text
|
|
4608
4511
|
* @uiWidget textArea
|
|
@@ -4705,54 +4608,6 @@ const TaxAndCashDashboard = class {
|
|
|
4705
4608
|
* @uiName Account review alert description
|
|
4706
4609
|
*/
|
|
4707
4610
|
this.accountReviewDescription = "This process takes 48 hours, payouts are on hold until it's completed. You will receive an email from our referral provider, Impact.com, if any issues arise. It contains details on how to resolve this issue. If you need further assistance, please reach out to our {supportLink}.";
|
|
4708
|
-
/**
|
|
4709
|
-
* @uiName Payment hold on change alert header
|
|
4710
|
-
*/
|
|
4711
|
-
this.paymentHoldOnChangeHeader = "We are reviewing your new payout settings";
|
|
4712
|
-
/**
|
|
4713
|
-
* @uiName Payment hold on change alert description
|
|
4714
|
-
*/
|
|
4715
|
-
this.paymentHoldOnChangeDescription = "Your payout is temporarily on hold while we review your new payment information, this process is usually resolved within 48 hours.";
|
|
4716
|
-
/**
|
|
4717
|
-
* @uiName Beneficiary name invalid alert header
|
|
4718
|
-
*/
|
|
4719
|
-
this.beneficiaryNameInvalidHeader = "Your payment information does not match your tax form";
|
|
4720
|
-
/**
|
|
4721
|
-
* @uiName Beneficiary name invalid description
|
|
4722
|
-
*/
|
|
4723
|
-
this.beneficiaryNameInvalidDescription = "The beneficiary name in your payment information does not match what was submitted in your tax form. Please review and update your payment information or tax form so that they match exactly and do not include any invalid characters. Your payouts are on hold until this is resolved.";
|
|
4724
|
-
/**
|
|
4725
|
-
* @uiName Beneficiary name mismatch alert header
|
|
4726
|
-
*/
|
|
4727
|
-
this.beneficiaryNameMismatchHeader = "Your payment information does not match your tax form";
|
|
4728
|
-
/**
|
|
4729
|
-
* @uiName Beneficiary name mismatch alert description
|
|
4730
|
-
*/
|
|
4731
|
-
this.beneficiaryNameMismatchDescription = "The beneficiary name in your payment information does not match what was submitted in your tax form. Please review and update your payment information or tax form so that they match exactly and do not include any invalid characters. Your payouts are on hold until this is resolved.";
|
|
4732
|
-
/**
|
|
4733
|
-
* @uiName Bank name mismatch alert header
|
|
4734
|
-
*/
|
|
4735
|
-
this.bankTaxNameMismatchHeader = "Your payment information does not match your tax form";
|
|
4736
|
-
/**
|
|
4737
|
-
* @uiName Bank name mismatch alert description
|
|
4738
|
-
*/
|
|
4739
|
-
this.bankTaxNameMismatchDescription = "The bank name in your payment information does not match what was submitted in your tax form. Please review and update your payment information or tax form so that they match exactly and do not include any invalid characters. Your payouts are on hold until this is resolved.";
|
|
4740
|
-
/**
|
|
4741
|
-
* @uiName Withdrawal settings invalid alert header
|
|
4742
|
-
*/
|
|
4743
|
-
this.withdrawalSettingsInvalidHeader = "Your payment information includes invalid characters";
|
|
4744
|
-
/**
|
|
4745
|
-
* @uiName Withdrawal settings invalid alert description
|
|
4746
|
-
*/
|
|
4747
|
-
this.withdrawalSettingsInvalidDescription = "There are invalid characters in your payment information. Please review your information and make sure it is correct with no invalid characters. Your payouts are on hold until this is resolved.";
|
|
4748
|
-
/**
|
|
4749
|
-
* @uiName Payment returned alert header
|
|
4750
|
-
*/
|
|
4751
|
-
this.paymentReturnedHeader = "Payout unsuccessful";
|
|
4752
|
-
/**
|
|
4753
|
-
* @uiName Payment returned alert description
|
|
4754
|
-
*/
|
|
4755
|
-
this.paymentReturnedDescription = "Our recent payment attempt for your earnings was unsuccessful. Please review your payment information and make sure it is correct.";
|
|
4756
4611
|
/**
|
|
4757
4612
|
* @uiName Terms and Conditions text
|
|
4758
4613
|
*/
|
|
@@ -6171,12 +6026,6 @@ const UserInfoFormView = (props) => {
|
|
|
6171
6026
|
default:
|
|
6172
6027
|
regionLabel = text.state;
|
|
6173
6028
|
}
|
|
6174
|
-
function isDisabledInput(field) {
|
|
6175
|
-
var _a;
|
|
6176
|
-
if (states.isPartner && !!((_a = data.partnerData) === null || _a === void 0 ? void 0 : _a[field]))
|
|
6177
|
-
return true;
|
|
6178
|
-
return false;
|
|
6179
|
-
}
|
|
6180
6029
|
return (h("sl-form", { class: classes.FormWrapper, "onSl-submit": callbacks.onSubmit, ref: (el) => (refs.formRef.current = el), novalidate: true },
|
|
6181
6030
|
h("style", { type: "text/css" },
|
|
6182
6031
|
styleString$5,
|
|
@@ -6217,22 +6066,18 @@ const UserInfoFormView = (props) => {
|
|
|
6217
6066
|
})))),
|
|
6218
6067
|
h("div", null,
|
|
6219
6068
|
h("div", { class: classes.InputContainer },
|
|
6220
|
-
h("sl-input", Object.assign({ class: "ErrorInput", exportparts: "label: input-label, base: input-base", value: formState.firstName, label: text.firstName, disabled: states.disabled ||
|
|
6221
|
-
states.isUser ||
|
|
6222
|
-
isDisabledInput("firstName") }, (((_b = formState.errors) === null || _b === void 0 ? void 0 : _b.firstName) ? {
|
|
6069
|
+
h("sl-input", Object.assign({ class: "ErrorInput", exportparts: "label: input-label, base: input-base", value: formState.firstName, label: text.firstName, disabled: states.disabled || states.isUser || states.isPartner }, (((_b = formState.errors) === null || _b === void 0 ? void 0 : _b.firstName) ? {
|
|
6223
6070
|
class: classes.ErrorInput,
|
|
6224
6071
|
helpText: formatErrorMessage(text.firstName, formState.errors.firstName),
|
|
6225
6072
|
}
|
|
6226
6073
|
: {}), { id: "firstName", name: "/firstName", required: true })),
|
|
6227
|
-
h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", value: formState.lastName, label: text.lastName, disabled: states.disabled ||
|
|
6228
|
-
states.isUser ||
|
|
6229
|
-
isDisabledInput("lastName") }, (((_c = formState.errors) === null || _c === void 0 ? void 0 : _c.lastName) ? {
|
|
6074
|
+
h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", value: formState.lastName, label: text.lastName, disabled: states.disabled || states.isUser || states.isPartner }, (((_c = formState.errors) === null || _c === void 0 ? void 0 : _c.lastName) ? {
|
|
6230
6075
|
class: classes.ErrorInput,
|
|
6231
6076
|
helpText: formatErrorMessage(text.lastName, formState.errors.lastName),
|
|
6232
6077
|
}
|
|
6233
6078
|
: {}), { id: "lastName", name: "/lastName", required: true })),
|
|
6234
6079
|
h("sl-input", { exportparts: "label: input-label, base: input-base", value: formState.email, label: text.email, disabled: true, id: "email", name: "/email", required: true }),
|
|
6235
|
-
h("sl-select", Object.assign({ id: "countryCode", exportparts: "label: input-label, base: input-base", name: "/countryCode", label: text.country, value: formState.countryCode, disabled: states.disabled ||
|
|
6080
|
+
h("sl-select", Object.assign({ id: "countryCode", exportparts: "label: input-label, base: input-base", name: "/countryCode", label: text.country, value: formState.countryCode, disabled: states.disabled || states.isPartner }, (((_d = formState.errors) === null || _d === void 0 ? void 0 : _d.countryCode) ? {
|
|
6236
6081
|
class: classes.ErrorInput,
|
|
6237
6082
|
helpText: formatErrorMessage(text.country, formState.errors.countryCode),
|
|
6238
6083
|
}
|
|
@@ -6248,8 +6093,7 @@ const UserInfoFormView = (props) => {
|
|
|
6248
6093
|
h("div", { class: classes.PhoneInputsSection },
|
|
6249
6094
|
h("p", null, text.phoneNumber),
|
|
6250
6095
|
h("div", { class: classes.PhoneInputsContainer },
|
|
6251
|
-
h("sl-select", Object.assign({ id: "phoneNumberCountryCode", exportparts: "label: input-label, base: input-base", name: "/phoneNumberCountryCode", value: formState.phoneNumberCountryCode, disabled: states.disabled ||
|
|
6252
|
-
isDisabledInput("phoneNumberCountryCode"), ref: (el) => (refs.phoneCountryRef.current = el) }, (((_g = formState.errors) === null || _g === void 0 ? void 0 : _g.phoneNumberCountryCode) ? {
|
|
6096
|
+
h("sl-select", Object.assign({ id: "phoneNumberCountryCode", exportparts: "label: input-label, base: input-base", name: "/phoneNumberCountryCode", value: formState.phoneNumberCountryCode, disabled: states.disabled || states.isPartner, ref: (el) => (refs.phoneCountryRef.current = el) }, (((_g = formState.errors) === null || _g === void 0 ? void 0 : _g.phoneNumberCountryCode) ? {
|
|
6253
6097
|
class: classes.ErrorInput,
|
|
6254
6098
|
}
|
|
6255
6099
|
: {}), { required: true, "onSl-select": (e) => callbacks.onFormChange("phoneCountry", e) }),
|
|
@@ -6275,7 +6119,7 @@ const UserInfoFormView = (props) => {
|
|
|
6275
6119
|
// Naive phone number validation
|
|
6276
6120
|
validateBillingField(/[a-zA-Z]+/, value) &&
|
|
6277
6121
|
formatErrorMessage(text.phoneNumber, text.error.fieldInvalidError);
|
|
6278
|
-
}, disabled: states.disabled ||
|
|
6122
|
+
}, disabled: states.disabled || states.isPartner }, (((_k = formState.errors) === null || _k === void 0 ? void 0 : _k.phoneNumber) ? {
|
|
6279
6123
|
class: classes.ErrorInput,
|
|
6280
6124
|
helpText: formatErrorMessage(text.phoneNumber, formState.errors.phoneNumber),
|
|
6281
6125
|
}
|
|
@@ -6283,7 +6127,7 @@ const UserInfoFormView = (props) => {
|
|
|
6283
6127
|
h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", label: text.address, id: "address", name: "/address", value: formState.address, validationError: ({ value }) =>
|
|
6284
6128
|
// Checks for non-ASCII characters
|
|
6285
6129
|
!validateBillingField(/^[\x20-\xFF]+$/, value) &&
|
|
6286
|
-
formatErrorMessage(text.address, text.error.invalidCharacterError), disabled: states.disabled ||
|
|
6130
|
+
formatErrorMessage(text.address, text.error.invalidCharacterError), disabled: states.disabled || states.isPartner }, (((_l = formState.errors) === null || _l === void 0 ? void 0 : _l.address) ? {
|
|
6287
6131
|
class: classes.ErrorInput,
|
|
6288
6132
|
helpText: formatErrorMessage(text.address, formState.errors.address),
|
|
6289
6133
|
}
|
|
@@ -6291,22 +6135,22 @@ const UserInfoFormView = (props) => {
|
|
|
6291
6135
|
h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", label: text.city, id: "city", name: "/city", value: formState.city, validationError: ({ value }) =>
|
|
6292
6136
|
// Checks for non-ASCII characters
|
|
6293
6137
|
!validateBillingField(/^[\x20-\xFF]+$/, value) &&
|
|
6294
|
-
formatErrorMessage(text.city, text.error.invalidCharacterError), disabled: states.disabled ||
|
|
6138
|
+
formatErrorMessage(text.city, text.error.invalidCharacterError), disabled: states.disabled || states.isPartner }, (((_m = formState.errors) === null || _m === void 0 ? void 0 : _m.city) ? {
|
|
6295
6139
|
class: classes.ErrorInput,
|
|
6296
6140
|
helpText: formatErrorMessage(text.city, formState.errors.city),
|
|
6297
6141
|
}
|
|
6298
6142
|
: {}), { required: true })),
|
|
6299
|
-
!states.hideState && (h("sl-select", Object.assign({ label: regionLabel, exportparts: "label: input-label, base: input-base", id: "state", name: "/state", value: formState.state, disabled: states.disabled ||
|
|
6143
|
+
!states.hideState && (h("sl-select", Object.assign({ label: regionLabel, exportparts: "label: input-label, base: input-base", id: "state", name: "/state", value: formState.state, disabled: states.disabled || states.isPartner }, (((_o = formState.errors) === null || _o === void 0 ? void 0 : _o.state) ? {
|
|
6300
6144
|
class: classes.ErrorInput,
|
|
6301
6145
|
helpText: formatErrorMessage(text.state, formState.errors.state),
|
|
6302
6146
|
}
|
|
6303
6147
|
: {}), { required: true }), (_p = data.regions) === null || _p === void 0 ? void 0 : _p.map((r) => (h("sl-menu-item", { value: r.value }, r.label))))),
|
|
6304
|
-
h("sl-input", Object.assign({ label: text.postalCode, exportparts: "label: input-label, base: input-base", id: "postalCode", name: "/postalCode", value: formState.postalCode, disabled: states.disabled ||
|
|
6148
|
+
h("sl-input", Object.assign({ label: text.postalCode, exportparts: "label: input-label, base: input-base", id: "postalCode", name: "/postalCode", value: formState.postalCode, disabled: states.disabled || states.isPartner }, (((_q = formState.errors) === null || _q === void 0 ? void 0 : _q.postalCode) ? {
|
|
6305
6149
|
class: classes.ErrorInput,
|
|
6306
6150
|
helpText: formatErrorMessage(text.postalCode, formState.errors.postalCode),
|
|
6307
6151
|
}
|
|
6308
6152
|
: {}), { required: true })),
|
|
6309
|
-
h("sl-select", Object.assign({ id: "currency", exportparts: "label: input-label, base: input-base", name: "/currency", label: text.currency, menu: true, value: formState.currency, disabled: states.disabled ||
|
|
6153
|
+
h("sl-select", Object.assign({ id: "currency", exportparts: "label: input-label, base: input-base", name: "/currency", label: text.currency, menu: true, value: formState.currency, disabled: states.disabled || states.isPartner, helpText: text.currencyHelpText }, (((_r = formState.errors) === null || _r === void 0 ? void 0 : _r.currency) ? {
|
|
6310
6154
|
class: classes.ErrorInput,
|
|
6311
6155
|
helpText: formatErrorMessage(text.currency, formState.errors.currency),
|
|
6312
6156
|
}
|
|
@@ -6328,13 +6172,13 @@ const UserInfoFormView = (props) => {
|
|
|
6328
6172
|
h("div", { class: classes.CheckboxWrapper },
|
|
6329
6173
|
h("sl-checkbox", { checked: formState.allowBankingCollection === true, "onSl-change": (e) => {
|
|
6330
6174
|
e.target.value = e.target.checked;
|
|
6331
|
-
}, disabled: states.disabled, required: true, value: formState.allowBankingCollection, id: "allowBankingCollection", name: "/allowBankingCollection" }, bankingCollectionText),
|
|
6175
|
+
}, disabled: states.isPartner ? false : states.disabled, required: true, value: formState.allowBankingCollection, id: "allowBankingCollection", name: "/allowBankingCollection" }, bankingCollectionText),
|
|
6332
6176
|
((_u = formState.errors) === null || _u === void 0 ? void 0 : _u.allowBankingCollection) && (h("p", { class: classes.ErrorText }, formatErrorMessage(text.termsAndConditionsLabel, formState.errors.allowBankingCollection))))),
|
|
6333
|
-
h("sl-button", { type: "primary", disabled: states.disabled, submit: true, exportparts: "base: primarybutton-base" }, text.continueButton))))));
|
|
6177
|
+
h("sl-button", { type: "primary", disabled: states.isPartner ? false : states.disabled, submit: true, exportparts: "base: primarybutton-base" }, text.continueButton))))));
|
|
6334
6178
|
};
|
|
6335
6179
|
|
|
6336
6180
|
function useUserInfoForm(props) {
|
|
6337
|
-
var _a, _b, _c, _d
|
|
6181
|
+
var _a, _b, _c, _d;
|
|
6338
6182
|
const currencyRef = useRef(undefined);
|
|
6339
6183
|
const phoneCountryRef = useRef(undefined);
|
|
6340
6184
|
const formRef = useRef(null);
|
|
@@ -6342,9 +6186,7 @@ function useUserInfoForm(props) {
|
|
|
6342
6186
|
const countries = Fn(SORTED_COUNTRIES_NAMESPACE);
|
|
6343
6187
|
const [step, setStep] = Pn(TAX_CONTEXT_NAMESPACE);
|
|
6344
6188
|
const [userFormContext, setUserFormContext] = Pn(USER_FORM_CONTEXT_NAMESPACE);
|
|
6345
|
-
const
|
|
6346
|
-
const [connectImpactPartner, { loading: connectLoading, errors: connectErrors },] = $e(CONNECT_PARTNER);
|
|
6347
|
-
const { data, loading, refetch, errors: userError, } = $n(USER_QUERY_NAMESPACE);
|
|
6189
|
+
const { data, loading, errors: userError, } = $n(USER_QUERY_NAMESPACE);
|
|
6348
6190
|
const _currencies = Fn(CURRENCIES_NAMESPACE);
|
|
6349
6191
|
const currencies = useMemo(() => [...(_currencies || [])].sort((a, b) => a.displayName.localeCompare(b.displayName)), [_currencies]);
|
|
6350
6192
|
const [countrySearch, setCountrySearch] = useState("");
|
|
@@ -6446,45 +6288,6 @@ function useUserInfoForm(props) {
|
|
|
6446
6288
|
setFilteredCurrencies(currencies.filter((c) => c.currencyCode.toLowerCase().includes(currencySearch.toLowerCase())) || []);
|
|
6447
6289
|
}
|
|
6448
6290
|
}, [currencySearch, currencies]);
|
|
6449
|
-
async function connectPartner(formData) {
|
|
6450
|
-
var _a, _b, _c, _d, _e;
|
|
6451
|
-
const vars = {
|
|
6452
|
-
user: {
|
|
6453
|
-
id: user.id,
|
|
6454
|
-
accountId: user.accountId,
|
|
6455
|
-
},
|
|
6456
|
-
firstName: formData.firstName,
|
|
6457
|
-
lastName: formData.lastName,
|
|
6458
|
-
countryCode: formData.countryCode,
|
|
6459
|
-
currency: formData.currency,
|
|
6460
|
-
address: formData.address,
|
|
6461
|
-
city: formData.city,
|
|
6462
|
-
state: formData.state,
|
|
6463
|
-
postalCode: formData.postalCode,
|
|
6464
|
-
phoneNumber: formData.phoneNumber,
|
|
6465
|
-
phoneNumberCountryCode: formData.phoneNumberCountryCode,
|
|
6466
|
-
};
|
|
6467
|
-
const result = await connectImpactPartner({
|
|
6468
|
-
vars,
|
|
6469
|
-
});
|
|
6470
|
-
if (!result || ((_a = result) === null || _a === void 0 ? void 0 : _a.message))
|
|
6471
|
-
throw new Error();
|
|
6472
|
-
if (!((_b = result.createImpactConnection) === null || _b === void 0 ? void 0 : _b.success)) {
|
|
6473
|
-
// Output backend errors to console for now
|
|
6474
|
-
console.error("Failed to create Impact connection: ", result.createImpactConnection.validationErrors);
|
|
6475
|
-
throw new Error();
|
|
6476
|
-
}
|
|
6477
|
-
await refetch();
|
|
6478
|
-
const resultPublisher = (_e = (_d = (_c = result
|
|
6479
|
-
.createImpactConnection) === null || _c === void 0 ? void 0 : _c.user) === null || _d === void 0 ? void 0 : _d.impactConnection) === null || _e === void 0 ? void 0 : _e.publisher;
|
|
6480
|
-
const hasValidCurrentDocument = validTaxDocument(resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.requiredTaxDocumentType) && (resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.currentTaxDocument);
|
|
6481
|
-
// Fire form change event
|
|
6482
|
-
window.dispatchEvent(new Event(TAX_FORM_UPDATED_EVENT_KEY));
|
|
6483
|
-
return {
|
|
6484
|
-
resultPublisher,
|
|
6485
|
-
hasValidCurrentDocument,
|
|
6486
|
-
};
|
|
6487
|
-
}
|
|
6488
6291
|
async function onSubmit(event) {
|
|
6489
6292
|
let formControls = event.target.getFormControls();
|
|
6490
6293
|
let formData = {};
|
|
@@ -6527,41 +6330,9 @@ function useUserInfoForm(props) {
|
|
|
6527
6330
|
postalCode: userData.postalCode,
|
|
6528
6331
|
currency: userData.currency,
|
|
6529
6332
|
});
|
|
6530
|
-
const
|
|
6531
|
-
console.log({ skipNextStep });
|
|
6532
|
-
if (skipNextStep) {
|
|
6533
|
-
try {
|
|
6534
|
-
const { resultPublisher, hasValidCurrentDocument } = await connectPartner(formData);
|
|
6535
|
-
if ((resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.requiredTaxDocumentType) &&
|
|
6536
|
-
!hasValidCurrentDocument) {
|
|
6537
|
-
// Go to docusign form
|
|
6538
|
-
setStep("/3");
|
|
6539
|
-
}
|
|
6540
|
-
else {
|
|
6541
|
-
if (resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.brandedSignup) {
|
|
6542
|
-
// Go to banking information form
|
|
6543
|
-
setStep("/4");
|
|
6544
|
-
}
|
|
6545
|
-
else {
|
|
6546
|
-
// Go right to the dashboard
|
|
6547
|
-
setStep("/dashboard");
|
|
6548
|
-
}
|
|
6549
|
-
}
|
|
6550
|
-
return;
|
|
6551
|
-
}
|
|
6552
|
-
catch (e) {
|
|
6553
|
-
setErrors({ general: true });
|
|
6554
|
-
return;
|
|
6555
|
-
}
|
|
6556
|
-
}
|
|
6557
|
-
const nextStep = context.overrideNextStep || skipNextStep ? "/3" : "/2";
|
|
6333
|
+
const nextStep = context.overrideNextStep || "/2";
|
|
6558
6334
|
setStep(nextStep);
|
|
6559
6335
|
}
|
|
6560
|
-
function getSkipNextStep(userData) {
|
|
6561
|
-
if (userData.countryCode === "US")
|
|
6562
|
-
return true;
|
|
6563
|
-
return true;
|
|
6564
|
-
}
|
|
6565
6336
|
const hasStates = ["ES", "AU", "US", "CA"].includes(userFormContext.countryCode);
|
|
6566
6337
|
const regionObj = hasStates
|
|
6567
6338
|
? ADDRESS_REGIONS[userFormContext === null || userFormContext === void 0 ? void 0 : userFormContext.countryCode]
|
|
@@ -6589,17 +6360,16 @@ function useUserInfoForm(props) {
|
|
|
6589
6360
|
allCountries: countries,
|
|
6590
6361
|
regionLabelEnum: regionObj === null || regionObj === void 0 ? void 0 : regionObj.labelEnum,
|
|
6591
6362
|
regions: (regionObj === null || regionObj === void 0 ? void 0 : regionObj.regions) || [],
|
|
6592
|
-
partnerData: (_b = (_a = data === null || data === void 0 ? void 0 : data.user) === null || _a === void 0 ? void 0 : _a.impactConnection) === null || _b === void 0 ? void 0 : _b.publisher,
|
|
6593
6363
|
},
|
|
6594
6364
|
states: {
|
|
6595
6365
|
step: step === null || step === void 0 ? void 0 : step.replace("/", ""),
|
|
6596
6366
|
hideState: !hasStates,
|
|
6597
6367
|
hideSteps: !!context.hideSteps,
|
|
6598
|
-
disabled: loading
|
|
6368
|
+
disabled: loading,
|
|
6599
6369
|
loadingError: !!(userError === null || userError === void 0 ? void 0 : userError.message),
|
|
6600
|
-
loading: loading
|
|
6601
|
-
isPartner: !!((
|
|
6602
|
-
isUser: !!((
|
|
6370
|
+
loading: loading,
|
|
6371
|
+
isPartner: !!((_b = (_a = data === null || data === void 0 ? void 0 : data.user) === null || _a === void 0 ? void 0 : _a.impactConnection) === null || _b === void 0 ? void 0 : _b.publisher),
|
|
6372
|
+
isUser: !!((_d = (_c = data === null || data === void 0 ? void 0 : data.user) === null || _c === void 0 ? void 0 : _c.impactConnection) === null || _d === void 0 ? void 0 : _d.user),
|
|
6603
6373
|
formState: {
|
|
6604
6374
|
...userFormContext,
|
|
6605
6375
|
errors: formErrors,
|