@saasquatch/mint-components 1.15.4 → 1.15.5-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/{ShadowViewAddon-e9dc77e3.js → ShadowViewAddon-28865623.js} +2 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/mint-components.cjs.js +1 -1
- package/dist/cjs/sqm-banking-info-form_17.cjs.entry.js +377 -234
- package/dist/cjs/{sqm-base-registration-form-view-66f99821.js → sqm-base-registration-form-view-8029d30e.js} +4 -9
- package/dist/cjs/sqm-big-stat_43.cjs.entry.js +143 -10
- package/dist/cjs/{sqm-invoice-table-view-5c74607f.js → sqm-invoice-table-view-3f60fba9.js} +1 -0
- package/dist/cjs/sqm-portal-google-registration-form.cjs.entry.js +19 -28
- package/dist/cjs/sqm-stencilbook.cjs.entry.js +5 -8
- package/dist/cjs/{usePayoutStatus-733ef29a.js → usePayoutStatus-fc4e609e.js} +167 -2
- package/dist/collection/components/sqm-base-registration/BaseRegistrationForm.stories.js +2 -2
- package/dist/collection/components/sqm-base-registration/sqm-base-registration-form-view.js +4 -9
- package/dist/collection/components/sqm-checkbox-field/sqm-checkbox-field.js +1 -1
- package/dist/collection/components/sqm-dropdown-field/sqm-dropdown-field.js +1 -1
- package/dist/collection/components/sqm-input-field/sqm-input-field.js +1 -1
- package/dist/collection/components/sqm-marketing-emails-checkbox/sqm-marketing-emails-checkbox.js +1 -1
- package/dist/collection/components/sqm-name-fields/NameFields.stories.js +0 -2
- package/dist/collection/components/sqm-name-fields/sqm-name-fields-view.js +3 -3
- package/dist/collection/components/sqm-name-fields/sqm-name-fields.js +1 -31
- package/dist/collection/components/sqm-name-fields/useNameFields.js +0 -1
- package/dist/collection/components/sqm-password-field/sqm-password-field.js +2 -2
- package/dist/collection/components/sqm-portal-google-registration-form/PortalGoogleRegistrationForm.stories.js +0 -1
- package/dist/collection/components/sqm-portal-google-registration-form/sqm-portal-google-registration-form.js +5 -7
- package/dist/collection/components/sqm-portal-google-registration-form/usePortalGoogleRegistrationForm.js +15 -22
- package/dist/collection/components/tax-and-cash/TaxForm.stories.js +1 -0
- package/dist/collection/components/tax-and-cash/sqm-indirect-tax-form/useIndirectTaxForm.js +47 -40
- package/dist/collection/components/tax-and-cash/sqm-payout-status-alert/sqm-payout-status-alert-view.js +87 -1
- package/dist/collection/components/tax-and-cash/sqm-payout-status-alert/sqm-payout-status-alert.js +327 -0
- package/dist/collection/components/tax-and-cash/sqm-payout-status-alert/usePayoutStatus.js +27 -3
- package/dist/collection/components/tax-and-cash/sqm-tax-and-cash/sqm-tax-and-cash.js +300 -0
- package/dist/collection/components/tax-and-cash/sqm-tax-and-cash-dashboard/sqm-tax-and-cash-dashboard-view.js +85 -1
- package/dist/collection/components/tax-and-cash/sqm-tax-and-cash-dashboard/sqm-tax-and-cash-dashboard.js +300 -0
- package/dist/collection/components/tax-and-cash/sqm-user-info-form/sqm-user-info-form-view.js +23 -12
- 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 +90 -9
- package/dist/esm/{ShadowViewAddon-e0d5f1c9.js → ShadowViewAddon-f2176779.js} +2 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/mint-components.js +1 -1
- package/dist/esm/sqm-banking-info-form_17.entry.js +331 -188
- package/dist/esm/{sqm-base-registration-form-view-d81e316a.js → sqm-base-registration-form-view-dafba287.js} +4 -9
- package/dist/esm/sqm-big-stat_43.entry.js +143 -10
- package/dist/esm/{sqm-invoice-table-view-3491dd80.js → sqm-invoice-table-view-01453fa3.js} +1 -0
- package/dist/esm/sqm-portal-google-registration-form.entry.js +19 -28
- package/dist/esm/sqm-stencilbook.entry.js +5 -8
- package/dist/esm/{usePayoutStatus-b89e8c49.js → usePayoutStatus-b4bdbfa7.js} +154 -4
- package/dist/esm-es5/{ShadowViewAddon-e0d5f1c9.js → ShadowViewAddon-f2176779.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_17.entry.js +1 -1
- package/dist/esm-es5/sqm-base-registration-form-view-dafba287.js +1 -0
- package/dist/esm-es5/sqm-big-stat_43.entry.js +1 -1
- package/dist/esm-es5/sqm-invoice-table-view-01453fa3.js +1 -0
- package/dist/esm-es5/sqm-portal-google-registration-form.entry.js +1 -1
- package/dist/esm-es5/sqm-stencilbook.entry.js +1 -1
- package/dist/esm-es5/usePayoutStatus-b4bdbfa7.js +6 -0
- package/dist/mint-components/mint-components.esm.js +1 -1
- package/dist/mint-components/{p-3ac8613d.system.entry.js → p-02832118.system.entry.js} +1 -1
- package/dist/mint-components/{p-d15b642f.system.js → p-0d939b73.system.js} +1 -1
- package/dist/mint-components/p-2651ef99.system.js +1 -0
- package/dist/mint-components/p-35701119.js +1 -0
- package/dist/mint-components/p-37996351.system.js +1 -1
- package/dist/mint-components/{p-1edebab1.entry.js → p-4a731079.entry.js} +2 -2
- package/dist/mint-components/p-59fe6066.js +1 -0
- package/dist/mint-components/p-86a5db85.system.js +1 -0
- package/dist/mint-components/p-93db61eb.system.js +6 -0
- package/dist/mint-components/p-9c4f4cd6.entry.js +1 -0
- package/dist/mint-components/p-a3647f70.system.entry.js +1 -0
- package/dist/mint-components/p-a4f494ee.system.entry.js +1 -0
- package/dist/mint-components/p-ba14b5f7.system.entry.js +1 -0
- package/dist/mint-components/{p-3b6dccec.js → p-c1b074b6.js} +1 -1
- package/dist/mint-components/p-d0b404d5.entry.js +109 -0
- package/dist/mint-components/p-e3deed72.entry.js +273 -0
- package/dist/mint-components/p-fde41ad1.js +157 -0
- package/dist/types/components/sqm-base-registration/sqm-base-registration-form-view.d.ts +1 -2
- package/dist/types/components/sqm-checkbox-field/sqm-checkbox-field.d.ts +1 -1
- package/dist/types/components/sqm-dropdown-field/sqm-dropdown-field.d.ts +1 -1
- package/dist/types/components/sqm-input-field/sqm-input-field.d.ts +1 -1
- package/dist/types/components/sqm-marketing-emails-checkbox/sqm-marketing-emails-checkbox.d.ts +1 -1
- package/dist/types/components/sqm-name-fields/sqm-name-fields-view.d.ts +0 -1
- package/dist/types/components/sqm-name-fields/sqm-name-fields.d.ts +0 -5
- package/dist/types/components/sqm-name-fields/useNameFields.d.ts +0 -1
- package/dist/types/components/sqm-password-field/sqm-password-field.d.ts +1 -1
- package/dist/types/components/sqm-portal-google-registration-form/usePortalGoogleRegistrationForm.d.ts +1 -2
- package/dist/types/components/tax-and-cash/sqm-indirect-tax-form/useIndirectTaxForm.d.ts +31 -0
- package/dist/types/components/tax-and-cash/sqm-payout-status-alert/sqm-payout-status-alert-view.d.ts +14 -0
- package/dist/types/components/tax-and-cash/sqm-payout-status-alert/sqm-payout-status-alert.d.ts +53 -0
- package/dist/types/components/tax-and-cash/sqm-payout-status-alert/usePayoutStatus.d.ts +2 -1
- package/dist/types/components/tax-and-cash/sqm-tax-and-cash/sqm-tax-and-cash.d.ts +48 -0
- package/dist/types/components/tax-and-cash/sqm-tax-and-cash-dashboard/sqm-tax-and-cash-dashboard-view.d.ts +12 -0
- package/dist/types/components/tax-and-cash/sqm-tax-and-cash-dashboard/sqm-tax-and-cash-dashboard.d.ts +48 -0
- package/dist/types/components/tax-and-cash/sqm-user-info-form/sqm-user-info-form-view.d.ts +2 -0
- package/dist/types/components/tax-and-cash/sqm-user-info-form/useUserInfoForm.d.ts +1 -0
- package/dist/types/components.d.ts +296 -10
- package/docs/docs.docx +0 -0
- package/docs/raisins.json +1 -1
- package/grapesjs/grapesjs.js +1 -1
- package/package.json +1 -1
- package/dist/esm-es5/sqm-base-registration-form-view-d81e316a.js +0 -1
- package/dist/esm-es5/sqm-invoice-table-view-3491dd80.js +0 -1
- package/dist/esm-es5/usePayoutStatus-b89e8c49.js +0 -6
- package/dist/mint-components/p-021b0540.js +0 -46
- package/dist/mint-components/p-3d73cd84.entry.js +0 -220
- package/dist/mint-components/p-49932f12.system.js +0 -1
- package/dist/mint-components/p-7176a952.entry.js +0 -1
- package/dist/mint-components/p-8d0393d9.system.entry.js +0 -1
- package/dist/mint-components/p-9308221f.js +0 -1
- package/dist/mint-components/p-959c42b2.system.entry.js +0 -1
- package/dist/mint-components/p-a6494752.system.js +0 -6
- package/dist/mint-components/p-bc021969.system.js +0 -1
- package/dist/mint-components/p-c78e6066.entry.js +0 -273
- package/dist/mint-components/p-e64e8354.system.entry.js +0 -1
- package/dist/mint-components/p-e8e48982.js +0 -1
- package/dist/types/global/android.d.ts +0 -7
- package/dist/types/global/demo.d.ts +0 -2
- package/dist/types/stories/features.d.ts +0 -4
- package/dist/types/stories/templates.d.ts +0 -4
|
@@ -18,139 +18,12 @@ const luxon = require('./luxon-2926d85f.js');
|
|
|
18
18
|
const useReferralTable = require('./useReferralTable-7c3f9600.js');
|
|
19
19
|
const sqmTextSpanView = require('./sqm-text-span-view-0aa82125.js');
|
|
20
20
|
const ErrorView = require('./ErrorView-b2fcf954.js');
|
|
21
|
-
const sqmInvoiceTableView = require('./sqm-invoice-table-view-
|
|
21
|
+
const sqmInvoiceTableView = require('./sqm-invoice-table-view-3f60fba9.js');
|
|
22
22
|
const extractProps = require('./extractProps-fd93ba62.js');
|
|
23
23
|
const keys = require('./keys-cff24974.js');
|
|
24
|
-
const usePayoutStatus = require('./usePayoutStatus-
|
|
24
|
+
const usePayoutStatus = require('./usePayoutStatus-fc4e609e.js');
|
|
25
25
|
const useVerificationEmail = require('./useVerificationEmail-95a82767.js');
|
|
26
26
|
|
|
27
|
-
const TAX_CONTEXT_NAMESPACE = "sq:tax-and-cash";
|
|
28
|
-
const TAX_FORM_CONTEXT_NAMESPACE = "sq:tax-form-context";
|
|
29
|
-
const USER_QUERY_NAMESPACE = "sq:user-info-query";
|
|
30
|
-
const USER_FORM_CONTEXT_NAMESPACE = "sq:user-form-context";
|
|
31
|
-
const FINANCE_NETWORK_SETTINGS_NAMESPACE = "sq:finance-network-settings";
|
|
32
|
-
const COUNTRIES_NAMESPACE = "sq:countries:list";
|
|
33
|
-
const SORTED_COUNTRIES_NAMESPACE = "sq:countries:sorted";
|
|
34
|
-
const COUNTRIES_QUERY_NAMESPACE = "sq:countries:query";
|
|
35
|
-
const CURRENCIES_NAMESPACE = "sq:currencies:list";
|
|
36
|
-
const CURRENCIES_QUERY_NAMESPACE = "sq:currencies:query";
|
|
37
|
-
const GET_USER = index_module.dist.gql `
|
|
38
|
-
query getUserTaxInfo {
|
|
39
|
-
user: viewer {
|
|
40
|
-
... on User {
|
|
41
|
-
id
|
|
42
|
-
firstName
|
|
43
|
-
lastName
|
|
44
|
-
email
|
|
45
|
-
countryCode
|
|
46
|
-
customFields
|
|
47
|
-
rewards(limit: 1000) {
|
|
48
|
-
data {
|
|
49
|
-
statuses
|
|
50
|
-
partnerFundsTransfer {
|
|
51
|
-
id
|
|
52
|
-
status
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
managedIdentity {
|
|
57
|
-
uid
|
|
58
|
-
email
|
|
59
|
-
emailVerified
|
|
60
|
-
}
|
|
61
|
-
impactConnection {
|
|
62
|
-
connected
|
|
63
|
-
user {
|
|
64
|
-
firstName
|
|
65
|
-
lastName
|
|
66
|
-
}
|
|
67
|
-
publisher {
|
|
68
|
-
id
|
|
69
|
-
brandedSignup
|
|
70
|
-
countryCode
|
|
71
|
-
currency
|
|
72
|
-
billingAddress
|
|
73
|
-
billingCity
|
|
74
|
-
billingState
|
|
75
|
-
billingCountryCode
|
|
76
|
-
billingPostalCode
|
|
77
|
-
phoneNumberCountryCode
|
|
78
|
-
phoneNumber
|
|
79
|
-
taxInformation {
|
|
80
|
-
indirectTaxId
|
|
81
|
-
indirectTaxCountryCode
|
|
82
|
-
indirectTaxRegion
|
|
83
|
-
additionalTaxId
|
|
84
|
-
withholdingTaxId
|
|
85
|
-
withholdingTaxCountryCode
|
|
86
|
-
}
|
|
87
|
-
requiredTaxDocumentType
|
|
88
|
-
currentTaxDocument {
|
|
89
|
-
status
|
|
90
|
-
type
|
|
91
|
-
dateCreated
|
|
92
|
-
}
|
|
93
|
-
withdrawalSettings {
|
|
94
|
-
paymentMethod
|
|
95
|
-
paypalEmailAddress
|
|
96
|
-
bankCountry
|
|
97
|
-
bankAccountNumber
|
|
98
|
-
paymentSchedulingType
|
|
99
|
-
paymentThreshold
|
|
100
|
-
paymentDay
|
|
101
|
-
}
|
|
102
|
-
payoutsAccount {
|
|
103
|
-
hold
|
|
104
|
-
holdReasons
|
|
105
|
-
balance
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
`;
|
|
113
|
-
const GET_COUNTRIES = index_module.dist.gql `
|
|
114
|
-
query getCountries {
|
|
115
|
-
impactPayoutCountries(limit: 1000) {
|
|
116
|
-
data {
|
|
117
|
-
countryCode
|
|
118
|
-
displayName
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
`;
|
|
123
|
-
const GET_CURRENCIES = index_module.dist.gql `
|
|
124
|
-
query currencies($locale: RSLocale) {
|
|
125
|
-
currencies(limit: 300) {
|
|
126
|
-
data {
|
|
127
|
-
displayName(locale: $locale)
|
|
128
|
-
currencyCode
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
`;
|
|
133
|
-
const GET_FINANCE_NETWORK_SETTINGS = index_module.dist.gql `
|
|
134
|
-
query impactFinanceNetworkSettings(
|
|
135
|
-
$filter: ImpactFinanceNetworkSettingsFilterInput
|
|
136
|
-
) {
|
|
137
|
-
impactFinanceNetworkSettings(filter: $filter, limit: 1000) {
|
|
138
|
-
data {
|
|
139
|
-
countryCode
|
|
140
|
-
currency
|
|
141
|
-
defaultFinancePaymentMethodId
|
|
142
|
-
thresholdOptions
|
|
143
|
-
withdrawalSettingId
|
|
144
|
-
internationalEftFee
|
|
145
|
-
foreignFxFee
|
|
146
|
-
defaultFxFee
|
|
147
|
-
}
|
|
148
|
-
totalCount
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
`;
|
|
152
|
-
const FORM_STEPS = 4;
|
|
153
|
-
|
|
154
27
|
function getFormMap({ props, getValidationErrorMessage, bankCountry, }) {
|
|
155
28
|
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;
|
|
156
29
|
const { errors, ...formState } = props.states.formState;
|
|
@@ -904,7 +777,7 @@ const BankingInfoFormView = (props) => {
|
|
|
904
777
|
!states.hideSteps && (index.h("p", null, global.intl.formatMessage({
|
|
905
778
|
id: "formStep",
|
|
906
779
|
defaultMessage: text.formStep,
|
|
907
|
-
}, { step: states.step, count: FORM_STEPS }))),
|
|
780
|
+
}, { step: states.step, count: usePayoutStatus.FORM_STEPS }))),
|
|
908
781
|
index.h("h3", { style: { fontSize: "24px" } }, text.taxAndPayouts),
|
|
909
782
|
index.h("p", { class: classes.PageDescriptionText }, text.taxAndPayoutsDescription)),
|
|
910
783
|
((_a = formState.errors) === null || _a === void 0 ? void 0 : _a.general) && (index.h("sl-alert", { exportparts: "base: alert-base, icon:alert-icon", type: "warning", open: true, class: sheet.classes.AlertContainer },
|
|
@@ -1045,12 +918,12 @@ function useBankingInfoForm(props) {
|
|
|
1045
918
|
const host = index_module._();
|
|
1046
919
|
const locale = index_module.L();
|
|
1047
920
|
const user = index_module.J();
|
|
1048
|
-
const [step, setStep] = index_module.Pn(TAX_CONTEXT_NAMESPACE);
|
|
1049
|
-
const context = index_module.Fn(TAX_FORM_CONTEXT_NAMESPACE);
|
|
1050
|
-
const countries = index_module.Fn(SORTED_COUNTRIES_NAMESPACE);
|
|
921
|
+
const [step, setStep] = index_module.Pn(usePayoutStatus.TAX_CONTEXT_NAMESPACE);
|
|
922
|
+
const context = index_module.Fn(usePayoutStatus.TAX_FORM_CONTEXT_NAMESPACE);
|
|
923
|
+
const countries = index_module.Fn(usePayoutStatus.SORTED_COUNTRIES_NAMESPACE);
|
|
1051
924
|
const formRef = stencilHooks_module.useRef(null);
|
|
1052
|
-
const { data: paymentOptionsData, loading: paymentOptionsLoading, errors: paymentOptionsError, } = index_module.$n(FINANCE_NETWORK_SETTINGS_NAMESPACE);
|
|
1053
|
-
const { data: userData, refetch, errors: userError, } = index_module.$n(USER_QUERY_NAMESPACE);
|
|
925
|
+
const { data: paymentOptionsData, loading: paymentOptionsLoading, errors: paymentOptionsError, } = index_module.$n(usePayoutStatus.FINANCE_NETWORK_SETTINGS_NAMESPACE);
|
|
926
|
+
const { data: userData, refetch, errors: userError, } = index_module.$n(usePayoutStatus.USER_QUERY_NAMESPACE);
|
|
1054
927
|
const [saveWithdrawalSettings] = index_module.$e(SAVE_WITHDRAWAL_SETTINGS);
|
|
1055
928
|
const [updateWithdrawalSettings] = index_module.$e(UPDATE_WITHDRAWAL_SETTINGS);
|
|
1056
929
|
const [showVerification, setShowVerification] = stencilHooks_module.useState(false);
|
|
@@ -1746,7 +1619,7 @@ function useDemoBankingInfoForm(props) {
|
|
|
1746
1619
|
const defaultPaymentScheduleChecked = (_f = (_e = (_d = props.demoData) === null || _d === void 0 ? void 0 : _d.states) === null || _e === void 0 ? void 0 : _e.formState) === null || _f === void 0 ? void 0 : _f.paymentScheduleChecked;
|
|
1747
1620
|
const defaultCurrency = (_h = (_g = props.demoData) === null || _g === void 0 ? void 0 : _g.states) === null || _h === void 0 ? void 0 : _h.currency;
|
|
1748
1621
|
const defaultCountry = (_l = (_k = (_j = props.demoData) === null || _j === void 0 ? void 0 : _j.states) === null || _k === void 0 ? void 0 : _k.formState) === null || _l === void 0 ? void 0 : _l.bankCountry;
|
|
1749
|
-
const setStep = index_module.En(TAX_CONTEXT_NAMESPACE);
|
|
1622
|
+
const setStep = index_module.En(usePayoutStatus.TAX_CONTEXT_NAMESPACE);
|
|
1750
1623
|
const [paymentMethodChecked, setPaymentMethodChecked] = stencilHooks_module.useState(undefined);
|
|
1751
1624
|
const [paymentScheduleChecked, setPaymentScheduleChecked] = stencilHooks_module.useState(undefined);
|
|
1752
1625
|
const [currency, setCurrency] = stencilHooks_module.useState(defaultCurrency);
|
|
@@ -2195,9 +2068,9 @@ const DOCUSIGN_EXPIRED_STATES = ["ttl_expired", "session_timeout"];
|
|
|
2195
2068
|
function useDocusignForm(props) {
|
|
2196
2069
|
var _a, _b, _c;
|
|
2197
2070
|
const user = index_module.J();
|
|
2198
|
-
const context = index_module.Fn(TAX_FORM_CONTEXT_NAMESPACE);
|
|
2199
|
-
const [step, setStep] = index_module.Pn(TAX_CONTEXT_NAMESPACE);
|
|
2200
|
-
const { data, loading: userLoading, refetch, } = index_module.$n(USER_QUERY_NAMESPACE);
|
|
2071
|
+
const context = index_module.Fn(usePayoutStatus.TAX_FORM_CONTEXT_NAMESPACE);
|
|
2072
|
+
const [step, setStep] = index_module.Pn(usePayoutStatus.TAX_CONTEXT_NAMESPACE);
|
|
2073
|
+
const { data, loading: userLoading, refetch, } = index_module.$n(usePayoutStatus.USER_QUERY_NAMESPACE);
|
|
2201
2074
|
const publisher = (_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;
|
|
2202
2075
|
const [createTaxDocument, { loading: documentLoading, data: document, errors: documentErrors },] = index_module.$e(GET_TAX_DOCUMENT);
|
|
2203
2076
|
const [completeTaxDocument, { loading: completeDocumentLoading, data: completeData, errors: completeErrors, },] = index_module.$e(COMPLETE_TAX_DOCUMENT);
|
|
@@ -2621,7 +2494,7 @@ const DocusignFormView = (props) => {
|
|
|
2621
2494
|
!states.hideSteps && (index.h("p", null, global.intl.formatMessage({
|
|
2622
2495
|
id: "formStep",
|
|
2623
2496
|
defaultMessage: text.formStep,
|
|
2624
|
-
}, { step: states.step, count: FORM_STEPS }))),
|
|
2497
|
+
}, { step: states.step, count: usePayoutStatus.FORM_STEPS }))),
|
|
2625
2498
|
index.h("h3", null, text.taxForm),
|
|
2626
2499
|
index.h("p", { class: classes.PageDescriptionText }, text.taxAndPayoutsDescription))),
|
|
2627
2500
|
states.loadingError && (index.h("div", null,
|
|
@@ -2818,7 +2691,7 @@ const DocusignForm = class {
|
|
|
2818
2691
|
get el() { return index.getElement(this); }
|
|
2819
2692
|
};
|
|
2820
2693
|
function useDocusignFormDemo(props) {
|
|
2821
|
-
const setStep = index_module.En(TAX_CONTEXT_NAMESPACE);
|
|
2694
|
+
const setStep = index_module.En(usePayoutStatus.TAX_CONTEXT_NAMESPACE);
|
|
2822
2695
|
return cjs.cjs({
|
|
2823
2696
|
text: props.getTextProps(),
|
|
2824
2697
|
states: {
|
|
@@ -3009,7 +2882,7 @@ const IndirectTaxFormView = (props) => {
|
|
|
3009
2882
|
global.intl.formatMessage({
|
|
3010
2883
|
id: "formStep",
|
|
3011
2884
|
defaultMessage: text.formStep,
|
|
3012
|
-
}, { step: states.step, count: FORM_STEPS }))),
|
|
2885
|
+
}, { step: states.step, count: usePayoutStatus.FORM_STEPS }))),
|
|
3013
2886
|
index.h("h3", null, text.indirectTax),
|
|
3014
2887
|
index.h("p", { class: classes.PageDescriptionText }, text.taxAndPayoutsDescription),
|
|
3015
2888
|
index.h("p", { class: classes.DescriptionText }, text.indirectTaxDescription)),
|
|
@@ -3112,12 +2985,12 @@ function useIndirectTaxForm(props) {
|
|
|
3112
2985
|
const user = index_module.J();
|
|
3113
2986
|
const locale = index_module.L();
|
|
3114
2987
|
const formRef = stencilHooks_module.useRef(null);
|
|
3115
|
-
const context = index_module.Fn(TAX_FORM_CONTEXT_NAMESPACE);
|
|
3116
|
-
const [step, setStep] = index_module.Pn(TAX_CONTEXT_NAMESPACE);
|
|
2988
|
+
const context = index_module.Fn(usePayoutStatus.TAX_FORM_CONTEXT_NAMESPACE);
|
|
2989
|
+
const [step, setStep] = index_module.Pn(usePayoutStatus.TAX_CONTEXT_NAMESPACE);
|
|
3117
2990
|
const [connectImpactPartner, { loading: connectLoading, errors: connectErrors },] = index_module.$e(CONNECT_PARTNER);
|
|
3118
|
-
const userForm = index_module.Fn(USER_FORM_CONTEXT_NAMESPACE);
|
|
3119
|
-
const { data: userData, refetch, errors: userError, } = index_module.$n(USER_QUERY_NAMESPACE);
|
|
3120
|
-
const { data: _countriesRes, loading: countriesLoading } = index_module.$n(COUNTRIES_QUERY_NAMESPACE);
|
|
2991
|
+
const userForm = index_module.Fn(usePayoutStatus.USER_FORM_CONTEXT_NAMESPACE);
|
|
2992
|
+
const { data: userData, refetch, errors: userError, } = index_module.$n(usePayoutStatus.USER_QUERY_NAMESPACE);
|
|
2993
|
+
const { data: _countriesRes, loading: countriesLoading } = index_module.$n(usePayoutStatus.COUNTRIES_QUERY_NAMESPACE);
|
|
3121
2994
|
const intlLocale = (locale === null || locale === void 0 ? void 0 : locale.replace("_", "-")) || "en";
|
|
3122
2995
|
const _countries = stencilHooks_module.useMemo(() => { var _a, _b; return (_b = (_a = _countriesRes === null || _countriesRes === void 0 ? void 0 : _countriesRes.impactPayoutCountries) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.map((country) => sqmInvoiceTableView.getCountryObj({ countryCode: country.countryCode, locale: intlLocale })); }, [(_a = _countriesRes === null || _countriesRes === void 0 ? void 0 : _countriesRes.impactPayoutCountries) === null || _a === void 0 ? void 0 : _a.data]);
|
|
3123
2996
|
const [loading, setLoading] = stencilHooks_module.useState(false);
|
|
@@ -3176,8 +3049,51 @@ function useIndirectTaxForm(props) {
|
|
|
3176
3049
|
console.error("Could not detect select change");
|
|
3177
3050
|
setFormState((p) => ({ ...p, [field]: value }));
|
|
3178
3051
|
};
|
|
3179
|
-
|
|
3052
|
+
async function connectPartner(formData) {
|
|
3180
3053
|
var _a, _b, _c, _d, _e;
|
|
3054
|
+
const vars = {
|
|
3055
|
+
user: {
|
|
3056
|
+
id: user.id,
|
|
3057
|
+
accountId: user.accountId,
|
|
3058
|
+
},
|
|
3059
|
+
firstName: userForm.firstName,
|
|
3060
|
+
lastName: userForm.lastName,
|
|
3061
|
+
countryCode: userForm.countryCode,
|
|
3062
|
+
currency: userForm.currency,
|
|
3063
|
+
address: userForm.address,
|
|
3064
|
+
city: userForm.city,
|
|
3065
|
+
state: userForm.state,
|
|
3066
|
+
postalCode: userForm.postalCode,
|
|
3067
|
+
phoneNumber: userForm.phoneNumber,
|
|
3068
|
+
phoneNumberCountryCode: userForm.phoneNumberCountryCode,
|
|
3069
|
+
indirectTaxCountryCode: formData.selectedRegion,
|
|
3070
|
+
indirectTaxRegion: formData.province || formData.subRegion,
|
|
3071
|
+
indirectTaxId: formData.indirectTaxNumber,
|
|
3072
|
+
additionalTaxId: formData.qstNumber,
|
|
3073
|
+
withholdingTaxId: formData.subRegionTaxNumber,
|
|
3074
|
+
};
|
|
3075
|
+
const result = await connectImpactPartner({
|
|
3076
|
+
vars,
|
|
3077
|
+
});
|
|
3078
|
+
if (!result || ((_a = result) === null || _a === void 0 ? void 0 : _a.message))
|
|
3079
|
+
throw new Error();
|
|
3080
|
+
if (!((_b = result.createImpactConnection) === null || _b === void 0 ? void 0 : _b.success)) {
|
|
3081
|
+
// Output backend errors to console for now
|
|
3082
|
+
console.error("Failed to create Impact connection: ", result.createImpactConnection.validationErrors);
|
|
3083
|
+
throw new Error();
|
|
3084
|
+
}
|
|
3085
|
+
await refetch();
|
|
3086
|
+
const resultPublisher = (_e = (_d = (_c = result
|
|
3087
|
+
.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;
|
|
3088
|
+
const hasValidCurrentDocument = sqmInvoiceTableView.validTaxDocument(resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.requiredTaxDocumentType) && (resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.currentTaxDocument);
|
|
3089
|
+
// Fire form change event
|
|
3090
|
+
window.dispatchEvent(new Event(usePayoutStatus.TAX_FORM_UPDATED_EVENT_KEY));
|
|
3091
|
+
return {
|
|
3092
|
+
resultPublisher,
|
|
3093
|
+
hasValidCurrentDocument,
|
|
3094
|
+
};
|
|
3095
|
+
}
|
|
3096
|
+
const onSubmit = async (event) => {
|
|
3181
3097
|
if (!option) {
|
|
3182
3098
|
setErrors({ taxDetails: true });
|
|
3183
3099
|
return;
|
|
@@ -3203,44 +3119,7 @@ function useIndirectTaxForm(props) {
|
|
|
3203
3119
|
}
|
|
3204
3120
|
setLoading(true);
|
|
3205
3121
|
try {
|
|
3206
|
-
const
|
|
3207
|
-
user: {
|
|
3208
|
-
id: user.id,
|
|
3209
|
-
accountId: user.accountId,
|
|
3210
|
-
},
|
|
3211
|
-
firstName: userForm.firstName,
|
|
3212
|
-
lastName: userForm.lastName,
|
|
3213
|
-
countryCode: userForm.countryCode,
|
|
3214
|
-
currency: userForm.currency,
|
|
3215
|
-
address: userForm.address,
|
|
3216
|
-
city: userForm.city,
|
|
3217
|
-
state: userForm.state,
|
|
3218
|
-
postalCode: userForm.postalCode,
|
|
3219
|
-
phoneNumber: userForm.phoneNumber,
|
|
3220
|
-
phoneNumberCountryCode: userForm.phoneNumberCountryCode,
|
|
3221
|
-
indirectTaxCountryCode: formData.selectedRegion,
|
|
3222
|
-
indirectTaxRegion: formData.province || formData.subRegion,
|
|
3223
|
-
indirectTaxId: formData.indirectTaxNumber,
|
|
3224
|
-
additionalTaxId: formData.qstNumber,
|
|
3225
|
-
withholdingTaxId: formData.subRegionTaxNumber,
|
|
3226
|
-
};
|
|
3227
|
-
const result = await connectImpactPartner({
|
|
3228
|
-
vars,
|
|
3229
|
-
});
|
|
3230
|
-
if (!result || ((_a = result) === null || _a === void 0 ? void 0 : _a.message))
|
|
3231
|
-
throw new Error();
|
|
3232
|
-
if (!((_b = result.createImpactConnection) === null || _b === void 0 ? void 0 : _b.success)) {
|
|
3233
|
-
// Output backend errors to console for now
|
|
3234
|
-
console.error("Failed to create Impact connection: ", result.createImpactConnection
|
|
3235
|
-
.validationErrors);
|
|
3236
|
-
throw new Error();
|
|
3237
|
-
}
|
|
3238
|
-
await refetch();
|
|
3239
|
-
const resultPublisher = (_e = (_d = (_c = result
|
|
3240
|
-
.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;
|
|
3241
|
-
const hasValidCurrentDocument = sqmInvoiceTableView.validTaxDocument(resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.requiredTaxDocumentType) && (resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.currentTaxDocument);
|
|
3242
|
-
// Fire form change event
|
|
3243
|
-
window.dispatchEvent(new Event(usePayoutStatus.TAX_FORM_UPDATED_EVENT_KEY));
|
|
3122
|
+
const { resultPublisher, hasValidCurrentDocument } = await connectPartner(formData);
|
|
3244
3123
|
if ((resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.requiredTaxDocumentType) &&
|
|
3245
3124
|
!hasValidCurrentDocument) {
|
|
3246
3125
|
// Go to docusign form
|
|
@@ -3291,6 +3170,7 @@ function useIndirectTaxForm(props) {
|
|
|
3291
3170
|
...p,
|
|
3292
3171
|
hasSubRegionTaxNumber: !p.hasSubRegionTaxNumber,
|
|
3293
3172
|
})),
|
|
3173
|
+
connectPartner,
|
|
3294
3174
|
},
|
|
3295
3175
|
data: {
|
|
3296
3176
|
esRegions: sqmInvoiceTableView.INDIRECT_TAX_SPAIN_REGIONS,
|
|
@@ -3516,7 +3396,7 @@ const IndirectTaxForm = class {
|
|
|
3516
3396
|
}
|
|
3517
3397
|
};
|
|
3518
3398
|
function useDemoIndirectTaxForm(props) {
|
|
3519
|
-
const setStep = index_module.En(TAX_CONTEXT_NAMESPACE);
|
|
3399
|
+
const setStep = index_module.En(usePayoutStatus.TAX_CONTEXT_NAMESPACE);
|
|
3520
3400
|
const [option, setOption] = stencilHooks_module.useState(null);
|
|
3521
3401
|
const [demoFormState, setDemoFormState] = stencilHooks_module.useState({});
|
|
3522
3402
|
return cjs.cjs({
|
|
@@ -4198,7 +4078,7 @@ function PayoutDetailsCardView(props) {
|
|
|
4198
4078
|
|
|
4199
4079
|
function usePayoutDetailsCard(props) {
|
|
4200
4080
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
4201
|
-
const { data, loading } = index_module.$n(USER_QUERY_NAMESPACE);
|
|
4081
|
+
const { data, loading } = index_module.$n(usePayoutStatus.USER_QUERY_NAMESPACE);
|
|
4202
4082
|
const publisher = (_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;
|
|
4203
4083
|
function getPayoutDetailedStatusText(paymentDay) {
|
|
4204
4084
|
var _a;
|
|
@@ -4365,17 +4245,17 @@ function useTaxAndCash() {
|
|
|
4365
4245
|
const locale = index_module.L();
|
|
4366
4246
|
// State for current step of form
|
|
4367
4247
|
const [step, setStep] = index_module.In({
|
|
4368
|
-
namespace: TAX_CONTEXT_NAMESPACE,
|
|
4248
|
+
namespace: usePayoutStatus.TAX_CONTEXT_NAMESPACE,
|
|
4369
4249
|
initialValue: "/loading",
|
|
4370
4250
|
});
|
|
4371
4251
|
// State for when to hide steps, or override certain actions
|
|
4372
4252
|
const [context, _setContext] = index_module.In({
|
|
4373
|
-
namespace: TAX_FORM_CONTEXT_NAMESPACE,
|
|
4253
|
+
namespace: usePayoutStatus.TAX_FORM_CONTEXT_NAMESPACE,
|
|
4374
4254
|
initialValue: {},
|
|
4375
4255
|
});
|
|
4376
4256
|
// State to carry user form information into step 2
|
|
4377
4257
|
const [userFormContext, _setUserFormContext] = index_module.In({
|
|
4378
|
-
namespace: USER_FORM_CONTEXT_NAMESPACE,
|
|
4258
|
+
namespace: usePayoutStatus.USER_FORM_CONTEXT_NAMESPACE,
|
|
4379
4259
|
initialValue: {
|
|
4380
4260
|
firstName: undefined,
|
|
4381
4261
|
lastName: undefined,
|
|
@@ -4385,20 +4265,20 @@ function useTaxAndCash() {
|
|
|
4385
4265
|
},
|
|
4386
4266
|
});
|
|
4387
4267
|
const [_currenciesContext, setCurrenciesContext] = index_module.In({
|
|
4388
|
-
namespace: CURRENCIES_NAMESPACE,
|
|
4268
|
+
namespace: usePayoutStatus.CURRENCIES_NAMESPACE,
|
|
4389
4269
|
initialValue: [],
|
|
4390
4270
|
});
|
|
4391
4271
|
const [_countriesContext, _setCountriesContext] = index_module.In({
|
|
4392
|
-
namespace: COUNTRIES_NAMESPACE,
|
|
4272
|
+
namespace: usePayoutStatus.COUNTRIES_NAMESPACE,
|
|
4393
4273
|
initialValue: [],
|
|
4394
4274
|
});
|
|
4395
4275
|
const [_sortedCountriesContext, setSortedCountriesContext] = index_module.In({
|
|
4396
|
-
namespace: SORTED_COUNTRIES_NAMESPACE,
|
|
4276
|
+
namespace: usePayoutStatus.SORTED_COUNTRIES_NAMESPACE,
|
|
4397
4277
|
initialValue: [],
|
|
4398
4278
|
});
|
|
4399
4279
|
const { data, errors } = index_module.Sn({
|
|
4400
|
-
namespace: USER_QUERY_NAMESPACE,
|
|
4401
|
-
query: GET_USER,
|
|
4280
|
+
namespace: usePayoutStatus.USER_QUERY_NAMESPACE,
|
|
4281
|
+
query: usePayoutStatus.GET_USER,
|
|
4402
4282
|
skip: !user,
|
|
4403
4283
|
options: {
|
|
4404
4284
|
batch: false,
|
|
@@ -4407,21 +4287,21 @@ function useTaxAndCash() {
|
|
|
4407
4287
|
const countryCode = ((_c = (_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) === null || _c === void 0 ? void 0 : _c.countryCode) ||
|
|
4408
4288
|
userFormContext.countryCode;
|
|
4409
4289
|
index_module.Sn({
|
|
4410
|
-
namespace: COUNTRIES_QUERY_NAMESPACE,
|
|
4411
|
-
query: GET_COUNTRIES,
|
|
4290
|
+
namespace: usePayoutStatus.COUNTRIES_QUERY_NAMESPACE,
|
|
4291
|
+
query: usePayoutStatus.GET_COUNTRIES,
|
|
4412
4292
|
skip: !user,
|
|
4413
4293
|
});
|
|
4414
4294
|
const { data: financeNetworkData, refetch } = index_module.Sn({
|
|
4415
|
-
namespace: FINANCE_NETWORK_SETTINGS_NAMESPACE,
|
|
4416
|
-
query: GET_FINANCE_NETWORK_SETTINGS,
|
|
4295
|
+
namespace: usePayoutStatus.FINANCE_NETWORK_SETTINGS_NAMESPACE,
|
|
4296
|
+
query: usePayoutStatus.GET_FINANCE_NETWORK_SETTINGS,
|
|
4417
4297
|
skip: !user,
|
|
4418
4298
|
variables: {
|
|
4419
4299
|
filter: getFinanceNetworkFilter(),
|
|
4420
4300
|
},
|
|
4421
4301
|
});
|
|
4422
4302
|
const { data: currenciesData } = index_module.Sn({
|
|
4423
|
-
namespace: CURRENCIES_QUERY_NAMESPACE,
|
|
4424
|
-
query: GET_CURRENCIES,
|
|
4303
|
+
namespace: usePayoutStatus.CURRENCIES_QUERY_NAMESPACE,
|
|
4304
|
+
query: usePayoutStatus.GET_CURRENCIES,
|
|
4425
4305
|
skip: !user,
|
|
4426
4306
|
variables: {
|
|
4427
4307
|
locale,
|
|
@@ -4500,7 +4380,7 @@ function useTaxAndCash() {
|
|
|
4500
4380
|
step,
|
|
4501
4381
|
setStep,
|
|
4502
4382
|
context,
|
|
4503
|
-
namespace: index_module.Mn(TAX_CONTEXT_NAMESPACE),
|
|
4383
|
+
namespace: index_module.Mn(usePayoutStatus.TAX_CONTEXT_NAMESPACE),
|
|
4504
4384
|
loading: step === "/loading",
|
|
4505
4385
|
};
|
|
4506
4386
|
}
|
|
@@ -5432,6 +5312,54 @@ const TaxAndCashMonolith = class {
|
|
|
5432
5312
|
* @uiName Account review alert description
|
|
5433
5313
|
*/
|
|
5434
5314
|
this.dashboard_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}.";
|
|
5315
|
+
/**
|
|
5316
|
+
* @uiName Payment on hold alert header
|
|
5317
|
+
*/
|
|
5318
|
+
this.dashboard_paymentOnHoldHeader = "We are reviewing your new payout settings";
|
|
5319
|
+
/**
|
|
5320
|
+
* @uiName Payment on hold alert description
|
|
5321
|
+
*/
|
|
5322
|
+
this.dashboard_paymentOnHoldDescription = "Your payout is temporarily on hold while we review your new payment information, this process is usually resolved within 48 hours.";
|
|
5323
|
+
/**
|
|
5324
|
+
* @uiName Beneficiary name invalid alert header
|
|
5325
|
+
*/
|
|
5326
|
+
this.dashboard_beneficiaryNameInvalidHeader = "Your payment information does not match your tax form";
|
|
5327
|
+
/**
|
|
5328
|
+
* @uiName Beneficiary name invalid description
|
|
5329
|
+
*/
|
|
5330
|
+
this.dashboard_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.";
|
|
5331
|
+
/**
|
|
5332
|
+
* @uiName Beneficiary name mismatch alert header
|
|
5333
|
+
*/
|
|
5334
|
+
this.dashboard_beneficiaryNameMismatchHeader = "Your payment information does not match your tax form";
|
|
5335
|
+
/**
|
|
5336
|
+
* @uiName Beneficiary name mismatch alert description
|
|
5337
|
+
*/
|
|
5338
|
+
this.dashboard_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.";
|
|
5339
|
+
/**
|
|
5340
|
+
* @uiName Bank name mismatch alert header
|
|
5341
|
+
*/
|
|
5342
|
+
this.dashboard_bankNameMismatchHeader = "Your payment information does not match your tax form";
|
|
5343
|
+
/**
|
|
5344
|
+
* @uiName Bank name mismatch alert description
|
|
5345
|
+
*/
|
|
5346
|
+
this.dashboard_bankNameMismatchDescription = "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.";
|
|
5347
|
+
/**
|
|
5348
|
+
* @uiName Withdrawal settings invalid alert header
|
|
5349
|
+
*/
|
|
5350
|
+
this.dashboard_withdrawalSettingsInvalidHeader = "Your payment information includes invalid characters";
|
|
5351
|
+
/**
|
|
5352
|
+
* @uiName Withdrawal settings invalid alert description
|
|
5353
|
+
*/
|
|
5354
|
+
this.dashboard_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.";
|
|
5355
|
+
/**
|
|
5356
|
+
* @uiName Payment returned alert header
|
|
5357
|
+
*/
|
|
5358
|
+
this.dashboard_paymentReturnedHeader = "Payout unsuccessful";
|
|
5359
|
+
/**
|
|
5360
|
+
* @uiName Payment returned alert description
|
|
5361
|
+
*/
|
|
5362
|
+
this.dashboard_paymentReturnedDescription = "Our recent payment attempt for your earnings was unsuccessful. Please review your payment information and make sure it is correct.";
|
|
5435
5363
|
/**
|
|
5436
5364
|
* @uiName Terms and Conditions text
|
|
5437
5365
|
* @uiGroup Dashboard Properties
|
|
@@ -5612,7 +5540,7 @@ const TaxAndCashMonolith = class {
|
|
|
5612
5540
|
};
|
|
5613
5541
|
function useDemoTaxAndCash(props) {
|
|
5614
5542
|
const [step, setStep] = index_module.In({
|
|
5615
|
-
namespace: TAX_CONTEXT_NAMESPACE,
|
|
5543
|
+
namespace: usePayoutStatus.TAX_CONTEXT_NAMESPACE,
|
|
5616
5544
|
initialValue: "/1",
|
|
5617
5545
|
});
|
|
5618
5546
|
return cjs.cjs({
|
|
@@ -5903,7 +5831,7 @@ const TaxAndCashDashboardView = (props) => {
|
|
|
5903
5831
|
icon: "exclamation-octagon",
|
|
5904
5832
|
class: sheet$5.classes.ErrorHoldAlertContainer,
|
|
5905
5833
|
};
|
|
5906
|
-
case "
|
|
5834
|
+
case "NEW_PAYEE_REVIEW":
|
|
5907
5835
|
return {
|
|
5908
5836
|
header: text.accountReviewHeader,
|
|
5909
5837
|
description: global.intl.formatMessage({
|
|
@@ -5917,6 +5845,90 @@ const TaxAndCashDashboardView = (props) => {
|
|
|
5917
5845
|
icon: "exclamation-triangle",
|
|
5918
5846
|
class: sheet$5.classes.WarningHoldAlertContainer,
|
|
5919
5847
|
};
|
|
5848
|
+
case "PAYMENT_HOLD_ON_CHANGE":
|
|
5849
|
+
return {
|
|
5850
|
+
header: text.paymentHoldOnChangeHeader,
|
|
5851
|
+
description: global.intl.formatMessage({
|
|
5852
|
+
id: "accountReviewDescription",
|
|
5853
|
+
defaultMessage: text.paymentHoldOnChangeDescription,
|
|
5854
|
+
}, {
|
|
5855
|
+
supportLink: (index.h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
|
|
5856
|
+
}),
|
|
5857
|
+
buttonText: null,
|
|
5858
|
+
alertType: "warning",
|
|
5859
|
+
icon: "exclamation-triangle",
|
|
5860
|
+
class: sheet$5.classes.WarningHoldAlertContainer,
|
|
5861
|
+
};
|
|
5862
|
+
case "BENEFICIARY_NAME_INVALID":
|
|
5863
|
+
return {
|
|
5864
|
+
header: text.beneficiaryNameInvalidHeader,
|
|
5865
|
+
description: global.intl.formatMessage({
|
|
5866
|
+
id: "accountReviewDescription",
|
|
5867
|
+
defaultMessage: text.beneficiaryNameInvalidDescription,
|
|
5868
|
+
}, {
|
|
5869
|
+
supportLink: (index.h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
|
|
5870
|
+
}),
|
|
5871
|
+
button: (index.h("sl-button", { disabled: states.disabled || states.loading, type: "default", class: sheet$5.classes.EditBankDetailsButton, onClick: callbacks.onEditPayoutInfo }, text.editPaymentInformationButton)),
|
|
5872
|
+
alertType: "warning",
|
|
5873
|
+
icon: "exclamation-triangle",
|
|
5874
|
+
class: sheet$5.classes.WarningHoldAlertContainer,
|
|
5875
|
+
};
|
|
5876
|
+
case "BENEFICIARY_NAME_MISMATCH":
|
|
5877
|
+
return {
|
|
5878
|
+
header: text.beneficiaryNameMismatchHeader,
|
|
5879
|
+
description: global.intl.formatMessage({
|
|
5880
|
+
id: "accountReviewDescription",
|
|
5881
|
+
defaultMessage: text.beneficiaryNameMismatchDescription,
|
|
5882
|
+
}, {
|
|
5883
|
+
supportLink: (index.h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
|
|
5884
|
+
}),
|
|
5885
|
+
button: (index.h("sl-button", { disabled: states.disabled || states.loading, type: "default", class: sheet$5.classes.EditBankDetailsButton, onClick: callbacks.onEditPayoutInfo }, text.editPaymentInformationButton)),
|
|
5886
|
+
alertType: "warning",
|
|
5887
|
+
icon: "exclamation-triangle",
|
|
5888
|
+
class: sheet$5.classes.WarningHoldAlertContainer,
|
|
5889
|
+
};
|
|
5890
|
+
case "BANK_TAX_NAME_MISMATCH":
|
|
5891
|
+
return {
|
|
5892
|
+
header: text.bankTaxNameMismatchHeader,
|
|
5893
|
+
description: global.intl.formatMessage({
|
|
5894
|
+
id: "accountReviewDescription",
|
|
5895
|
+
defaultMessage: text.bankTaxNameMismatchDescription,
|
|
5896
|
+
}, {
|
|
5897
|
+
supportLink: (index.h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
|
|
5898
|
+
}),
|
|
5899
|
+
button: (index.h("sl-button", { disabled: states.disabled || states.loading, type: "default", class: sheet$5.classes.EditBankDetailsButton, onClick: callbacks.onEditPayoutInfo }, text.editPaymentInformationButton)),
|
|
5900
|
+
alertType: "warning",
|
|
5901
|
+
icon: "exclamation-triangle",
|
|
5902
|
+
class: sheet$5.classes.WarningHoldAlertContainer,
|
|
5903
|
+
};
|
|
5904
|
+
case "WITHDRAWAL_SETTINGS_INVALID":
|
|
5905
|
+
return {
|
|
5906
|
+
header: text.withdrawalSettingsInvalidHeader,
|
|
5907
|
+
description: global.intl.formatMessage({
|
|
5908
|
+
id: "accountReviewDescription",
|
|
5909
|
+
defaultMessage: text.withdrawalSettingsInvalidDescription,
|
|
5910
|
+
}, {
|
|
5911
|
+
supportLink: (index.h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
|
|
5912
|
+
}),
|
|
5913
|
+
button: (index.h("sl-button", { disabled: states.disabled || states.loading, type: "default", class: sheet$5.classes.EditBankDetailsButton, onClick: callbacks.onEditPayoutInfo }, text.editPaymentInformationButton)),
|
|
5914
|
+
alertType: "warning",
|
|
5915
|
+
icon: "exclamation-triangle",
|
|
5916
|
+
class: sheet$5.classes.WarningHoldAlertContainer,
|
|
5917
|
+
};
|
|
5918
|
+
case "PAYMENT_RETURNED":
|
|
5919
|
+
return {
|
|
5920
|
+
header: text.paymentReturnedHeader,
|
|
5921
|
+
description: global.intl.formatMessage({
|
|
5922
|
+
id: "accountReviewDescription",
|
|
5923
|
+
defaultMessage: text.paymentReturnedDescription,
|
|
5924
|
+
}, {
|
|
5925
|
+
supportLink: (index.h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
|
|
5926
|
+
}),
|
|
5927
|
+
button: (index.h("sl-button", { disabled: states.disabled || states.loading, type: "default", class: sheet$5.classes.EditBankDetailsButton, onClick: callbacks.onEditPayoutInfo }, text.editPaymentInformationButton)),
|
|
5928
|
+
alertType: "warning",
|
|
5929
|
+
icon: "exclamation-triangle",
|
|
5930
|
+
class: sheet$5.classes.WarningHoldAlertContainer,
|
|
5931
|
+
};
|
|
5920
5932
|
case "HOLD":
|
|
5921
5933
|
return {
|
|
5922
5934
|
header: text.payoutHoldAlertHeader,
|
|
@@ -6163,8 +6175,8 @@ function getIndirectTaxType(taxInformation) {
|
|
|
6163
6175
|
}
|
|
6164
6176
|
const useTaxAndCashDashboard = (props) => {
|
|
6165
6177
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
6166
|
-
const setStep = index_module.En(TAX_CONTEXT_NAMESPACE);
|
|
6167
|
-
const setContext = index_module.En(TAX_FORM_CONTEXT_NAMESPACE);
|
|
6178
|
+
const setStep = index_module.En(usePayoutStatus.TAX_CONTEXT_NAMESPACE);
|
|
6179
|
+
const setContext = index_module.En(usePayoutStatus.TAX_FORM_CONTEXT_NAMESPACE);
|
|
6168
6180
|
const [showDialog, setShowDialog] = stencilHooks_module.useState(false);
|
|
6169
6181
|
const { render, loading: veriffLoading, errors: veriffErrors, } = usePayoutStatus.useVeriffApp();
|
|
6170
6182
|
const { data: taxSettingRes } = index_module.wn(GET_TAX_SETTING, {});
|
|
@@ -6175,7 +6187,7 @@ const useTaxAndCashDashboard = (props) => {
|
|
|
6175
6187
|
if (window.location.hash)
|
|
6176
6188
|
setStep(`/${window.location.hash.replace("#", "")}`);
|
|
6177
6189
|
}, []);
|
|
6178
|
-
const { data, loading, errors: userError, refetch, } = index_module.$n(USER_QUERY_NAMESPACE);
|
|
6190
|
+
const { data, loading, errors: userError, refetch, } = index_module.$n(usePayoutStatus.USER_QUERY_NAMESPACE);
|
|
6179
6191
|
const publisher = (_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;
|
|
6180
6192
|
const documentType = publisher === null || publisher === void 0 ? void 0 : publisher.requiredTaxDocumentType;
|
|
6181
6193
|
const submissionDate = (_c = publisher === null || publisher === void 0 ? void 0 : publisher.currentTaxDocument) === null || _c === void 0 ? void 0 : _c.dateCreated;
|
|
@@ -6486,6 +6498,54 @@ const TaxAndCashDashboard = class {
|
|
|
6486
6498
|
* @uiName Account review alert description
|
|
6487
6499
|
*/
|
|
6488
6500
|
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}.";
|
|
6501
|
+
/**
|
|
6502
|
+
* @uiName Payment hold on change alert header
|
|
6503
|
+
*/
|
|
6504
|
+
this.paymentHoldOnChangeHeader = "We are reviewing your new payout settings";
|
|
6505
|
+
/**
|
|
6506
|
+
* @uiName Payment hold on change alert description
|
|
6507
|
+
*/
|
|
6508
|
+
this.paymentHoldOnChangeDescription = "Your payout is temporarily on hold while we review your new payment information, this process is usually resolved within 48 hours.";
|
|
6509
|
+
/**
|
|
6510
|
+
* @uiName Beneficiary name invalid alert header
|
|
6511
|
+
*/
|
|
6512
|
+
this.beneficiaryNameInvalidHeader = "Your payment information does not match your tax form";
|
|
6513
|
+
/**
|
|
6514
|
+
* @uiName Beneficiary name invalid description
|
|
6515
|
+
*/
|
|
6516
|
+
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.";
|
|
6517
|
+
/**
|
|
6518
|
+
* @uiName Beneficiary name mismatch alert header
|
|
6519
|
+
*/
|
|
6520
|
+
this.beneficiaryNameMismatchHeader = "Your payment information does not match your tax form";
|
|
6521
|
+
/**
|
|
6522
|
+
* @uiName Beneficiary name mismatch alert description
|
|
6523
|
+
*/
|
|
6524
|
+
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.";
|
|
6525
|
+
/**
|
|
6526
|
+
* @uiName Bank name mismatch alert header
|
|
6527
|
+
*/
|
|
6528
|
+
this.bankTaxNameMismatchHeader = "Your payment information does not match your tax form";
|
|
6529
|
+
/**
|
|
6530
|
+
* @uiName Bank name mismatch alert description
|
|
6531
|
+
*/
|
|
6532
|
+
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.";
|
|
6533
|
+
/**
|
|
6534
|
+
* @uiName Withdrawal settings invalid alert header
|
|
6535
|
+
*/
|
|
6536
|
+
this.withdrawalSettingsInvalidHeader = "Your payment information includes invalid characters";
|
|
6537
|
+
/**
|
|
6538
|
+
* @uiName Withdrawal settings invalid alert description
|
|
6539
|
+
*/
|
|
6540
|
+
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.";
|
|
6541
|
+
/**
|
|
6542
|
+
* @uiName Payment returned alert header
|
|
6543
|
+
*/
|
|
6544
|
+
this.paymentReturnedHeader = "Payout unsuccessful";
|
|
6545
|
+
/**
|
|
6546
|
+
* @uiName Payment returned alert description
|
|
6547
|
+
*/
|
|
6548
|
+
this.paymentReturnedDescription = "Our recent payment attempt for your earnings was unsuccessful. Please review your payment information and make sure it is correct.";
|
|
6489
6549
|
/**
|
|
6490
6550
|
* @uiName Terms and Conditions text
|
|
6491
6551
|
*/
|
|
@@ -7751,6 +7811,12 @@ const UserInfoFormView = (props) => {
|
|
|
7751
7811
|
default:
|
|
7752
7812
|
regionLabel = text.state;
|
|
7753
7813
|
}
|
|
7814
|
+
function isDisabledInput(field) {
|
|
7815
|
+
var _a;
|
|
7816
|
+
if (states.isPartner && !!((_a = data.partnerData) === null || _a === void 0 ? void 0 : _a[field]))
|
|
7817
|
+
return true;
|
|
7818
|
+
return false;
|
|
7819
|
+
}
|
|
7754
7820
|
return (index.h("sl-form", { class: classes.FormWrapper, "onSl-submit": callbacks.onSubmit, ref: (el) => (refs.formRef.current = el), novalidate: true },
|
|
7755
7821
|
index.h("style", { type: "text/css" },
|
|
7756
7822
|
styleString$6,
|
|
@@ -7773,7 +7839,7 @@ const UserInfoFormView = (props) => {
|
|
|
7773
7839
|
!states.hideSteps && (index.h("p", null, global.intl.formatMessage({
|
|
7774
7840
|
id: "formStep",
|
|
7775
7841
|
defaultMessage: text.formStep,
|
|
7776
|
-
}, { step: states.step, count: FORM_STEPS }))),
|
|
7842
|
+
}, { step: states.step, count: usePayoutStatus.FORM_STEPS }))),
|
|
7777
7843
|
index.h("h3", null, text.personalInformation),
|
|
7778
7844
|
index.h("p", { class: classes.PageDescriptionText }, text.taxAndPayoutsDescription))),
|
|
7779
7845
|
((_a = formState.errors) === null || _a === void 0 ? void 0 : _a.general) && (index.h("sl-alert", { exportparts: "base: alert-base, icon:alert-icon", type: "warning", open: true, class: sheet$6.classes.AlertContainer },
|
|
@@ -7798,18 +7864,22 @@ const UserInfoFormView = (props) => {
|
|
|
7798
7864
|
}))),
|
|
7799
7865
|
index.h("div", null,
|
|
7800
7866
|
index.h("div", { class: classes.InputContainer },
|
|
7801
|
-
index.h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", value: formState.firstName, label: text.firstName, disabled: states.disabled ||
|
|
7867
|
+
index.h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", value: formState.firstName, label: text.firstName, disabled: states.disabled ||
|
|
7868
|
+
states.isUser ||
|
|
7869
|
+
isDisabledInput("firstName") }, (((_b = formState.errors) === null || _b === void 0 ? void 0 : _b.firstName) ? {
|
|
7802
7870
|
class: classes.ErrorInput,
|
|
7803
7871
|
helpText: sqmInvoiceTableView.formatErrorMessage(text.firstName, formState.errors.firstName),
|
|
7804
7872
|
}
|
|
7805
7873
|
: {}), { id: "firstName", name: "/firstName", required: true })),
|
|
7806
|
-
index.h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", value: formState.lastName, label: text.lastName, disabled: states.disabled ||
|
|
7874
|
+
index.h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", value: formState.lastName, label: text.lastName, disabled: states.disabled ||
|
|
7875
|
+
states.isUser ||
|
|
7876
|
+
isDisabledInput("lastName") }, (((_c = formState.errors) === null || _c === void 0 ? void 0 : _c.lastName) ? {
|
|
7807
7877
|
class: classes.ErrorInput,
|
|
7808
7878
|
helpText: sqmInvoiceTableView.formatErrorMessage(text.lastName, formState.errors.lastName),
|
|
7809
7879
|
}
|
|
7810
7880
|
: {}), { id: "lastName", name: "/lastName", required: true })),
|
|
7811
7881
|
index.h("sl-input", { exportparts: "label: input-label, base: input-base", value: formState.email, label: text.email, disabled: true, id: "email", name: "/email", required: true }),
|
|
7812
|
-
index.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 ||
|
|
7882
|
+
index.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 || isDisabledInput("countryCode") }, (((_d = formState.errors) === null || _d === void 0 ? void 0 : _d.countryCode) ? {
|
|
7813
7883
|
class: classes.ErrorInput,
|
|
7814
7884
|
helpText: sqmInvoiceTableView.formatErrorMessage(text.country, formState.errors.countryCode),
|
|
7815
7885
|
}
|
|
@@ -7825,7 +7895,8 @@ const UserInfoFormView = (props) => {
|
|
|
7825
7895
|
index.h("div", { class: classes.PhoneInputsSection },
|
|
7826
7896
|
index.h("p", null, text.phoneNumber),
|
|
7827
7897
|
index.h("div", { class: classes.PhoneInputsContainer },
|
|
7828
|
-
index.h("sl-select", Object.assign({ id: "phoneNumberCountryCode", exportparts: "label: input-label, base: input-base", name: "/phoneNumberCountryCode", value: formState.phoneNumberCountryCode, disabled: states.disabled ||
|
|
7898
|
+
index.h("sl-select", Object.assign({ id: "phoneNumberCountryCode", exportparts: "label: input-label, base: input-base", name: "/phoneNumberCountryCode", value: formState.phoneNumberCountryCode, disabled: states.disabled ||
|
|
7899
|
+
isDisabledInput("phoneNumberCountryCode"), ref: (el) => (refs.phoneCountryRef.current = el) }, (((_g = formState.errors) === null || _g === void 0 ? void 0 : _g.phoneNumberCountryCode) ? {
|
|
7829
7900
|
class: classes.ErrorInput,
|
|
7830
7901
|
}
|
|
7831
7902
|
: {}), { required: true, "onSl-select": (e) => callbacks.onFormChange("phoneCountry", e) }),
|
|
@@ -7851,7 +7922,7 @@ const UserInfoFormView = (props) => {
|
|
|
7851
7922
|
// Naive phone number validation
|
|
7852
7923
|
sqmInvoiceTableView.validateBillingField(/[a-zA-Z]+/, value) &&
|
|
7853
7924
|
sqmInvoiceTableView.formatErrorMessage(text.phoneNumber, text.error.fieldInvalidError);
|
|
7854
|
-
}, disabled: states.disabled ||
|
|
7925
|
+
}, disabled: states.disabled || isDisabledInput("phoneNumber") }, (((_k = formState.errors) === null || _k === void 0 ? void 0 : _k.phoneNumber) ? {
|
|
7855
7926
|
class: classes.ErrorInput,
|
|
7856
7927
|
helpText: sqmInvoiceTableView.formatErrorMessage(text.phoneNumber, formState.errors.phoneNumber),
|
|
7857
7928
|
}
|
|
@@ -7859,7 +7930,7 @@ const UserInfoFormView = (props) => {
|
|
|
7859
7930
|
index.h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", label: text.address, id: "address", name: "/address", value: formState.address, validationError: ({ value }) =>
|
|
7860
7931
|
// Checks for non-ASCII characters
|
|
7861
7932
|
!sqmInvoiceTableView.validateBillingField(/^[\x20-\xFF]+$/, value) &&
|
|
7862
|
-
sqmInvoiceTableView.formatErrorMessage(text.address, text.error.invalidCharacterError), disabled: states.disabled ||
|
|
7933
|
+
sqmInvoiceTableView.formatErrorMessage(text.address, text.error.invalidCharacterError), disabled: states.disabled || isDisabledInput("address") }, (((_l = formState.errors) === null || _l === void 0 ? void 0 : _l.address) ? {
|
|
7863
7934
|
class: classes.ErrorInput,
|
|
7864
7935
|
helpText: sqmInvoiceTableView.formatErrorMessage(text.address, formState.errors.address),
|
|
7865
7936
|
}
|
|
@@ -7867,22 +7938,22 @@ const UserInfoFormView = (props) => {
|
|
|
7867
7938
|
index.h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", label: text.city, id: "city", name: "/city", value: formState.city, validationError: ({ value }) =>
|
|
7868
7939
|
// Checks for non-ASCII characters
|
|
7869
7940
|
!sqmInvoiceTableView.validateBillingField(/^[\x20-\xFF]+$/, value) &&
|
|
7870
|
-
sqmInvoiceTableView.formatErrorMessage(text.city, text.error.invalidCharacterError), disabled: states.disabled ||
|
|
7941
|
+
sqmInvoiceTableView.formatErrorMessage(text.city, text.error.invalidCharacterError), disabled: states.disabled || isDisabledInput("city") }, (((_m = formState.errors) === null || _m === void 0 ? void 0 : _m.city) ? {
|
|
7871
7942
|
class: classes.ErrorInput,
|
|
7872
7943
|
helpText: sqmInvoiceTableView.formatErrorMessage(text.city, formState.errors.city),
|
|
7873
7944
|
}
|
|
7874
7945
|
: {}), { required: true })),
|
|
7875
|
-
!states.hideState && (index.h("sl-select", Object.assign({ label: regionLabel, exportparts: "label: input-label, base: input-base", id: "state", name: "/state", value: formState.state, disabled: states.disabled ||
|
|
7946
|
+
!states.hideState && (index.h("sl-select", Object.assign({ label: regionLabel, exportparts: "label: input-label, base: input-base", id: "state", name: "/state", value: formState.state, disabled: states.disabled || isDisabledInput("state") }, (((_o = formState.errors) === null || _o === void 0 ? void 0 : _o.state) ? {
|
|
7876
7947
|
class: classes.ErrorInput,
|
|
7877
7948
|
helpText: sqmInvoiceTableView.formatErrorMessage(text.state, formState.errors.state),
|
|
7878
7949
|
}
|
|
7879
7950
|
: {}), { required: true }), (_p = data.regions) === null || _p === void 0 ? void 0 : _p.map((r) => (index.h("sl-menu-item", { value: r.value }, r.label))))),
|
|
7880
|
-
index.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 ||
|
|
7951
|
+
index.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 || isDisabledInput("postalCode") }, (((_q = formState.errors) === null || _q === void 0 ? void 0 : _q.postalCode) ? {
|
|
7881
7952
|
class: classes.ErrorInput,
|
|
7882
7953
|
helpText: sqmInvoiceTableView.formatErrorMessage(text.postalCode, formState.errors.postalCode),
|
|
7883
7954
|
}
|
|
7884
7955
|
: {}), { required: true })),
|
|
7885
|
-
index.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 ||
|
|
7956
|
+
index.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 || isDisabledInput("currency"), helpText: text.currencyHelpText }, (((_r = formState.errors) === null || _r === void 0 ? void 0 : _r.currency) ? {
|
|
7886
7957
|
class: classes.ErrorInput,
|
|
7887
7958
|
helpText: sqmInvoiceTableView.formatErrorMessage(text.currency, formState.errors.currency),
|
|
7888
7959
|
}
|
|
@@ -7904,22 +7975,24 @@ const UserInfoFormView = (props) => {
|
|
|
7904
7975
|
index.h("div", { class: classes.CheckboxWrapper },
|
|
7905
7976
|
index.h("sl-checkbox", { exportparts: "label: input-label, base: input-base", checked: formState.allowBankingCollection === true, "onSl-change": (e) => {
|
|
7906
7977
|
e.target.value = e.target.checked;
|
|
7907
|
-
}, disabled: states.
|
|
7978
|
+
}, disabled: states.disabled, required: true, value: formState.allowBankingCollection, id: "allowBankingCollection", name: "/allowBankingCollection" }, bankingCollectionText),
|
|
7908
7979
|
((_u = formState.errors) === null || _u === void 0 ? void 0 : _u.allowBankingCollection) && (index.h("p", { class: classes.ErrorText }, sqmInvoiceTableView.formatErrorMessage(text.termsAndConditionsLabel, formState.errors.allowBankingCollection))))),
|
|
7909
|
-
index.h("sl-button", { type: "primary", disabled: states.
|
|
7980
|
+
index.h("sl-button", { type: "primary", disabled: states.disabled, submit: true, exportparts: "base: primarybutton-base" }, text.continueButton))))));
|
|
7910
7981
|
};
|
|
7911
7982
|
|
|
7912
7983
|
function useUserInfoForm(props) {
|
|
7913
|
-
var _a, _b, _c, _d;
|
|
7984
|
+
var _a, _b, _c, _d, _e, _f;
|
|
7914
7985
|
const currencyRef = stencilHooks_module.useRef(undefined);
|
|
7915
7986
|
const phoneCountryRef = stencilHooks_module.useRef(undefined);
|
|
7916
7987
|
const formRef = stencilHooks_module.useRef(null);
|
|
7917
|
-
const context = index_module.Fn(TAX_FORM_CONTEXT_NAMESPACE);
|
|
7918
|
-
const countries = index_module.Fn(SORTED_COUNTRIES_NAMESPACE);
|
|
7919
|
-
const [step, setStep] = index_module.Pn(TAX_CONTEXT_NAMESPACE);
|
|
7920
|
-
const [userFormContext, setUserFormContext] = index_module.Pn(USER_FORM_CONTEXT_NAMESPACE);
|
|
7921
|
-
const
|
|
7922
|
-
const
|
|
7988
|
+
const context = index_module.Fn(usePayoutStatus.TAX_FORM_CONTEXT_NAMESPACE);
|
|
7989
|
+
const countries = index_module.Fn(usePayoutStatus.SORTED_COUNTRIES_NAMESPACE);
|
|
7990
|
+
const [step, setStep] = index_module.Pn(usePayoutStatus.TAX_CONTEXT_NAMESPACE);
|
|
7991
|
+
const [userFormContext, setUserFormContext] = index_module.Pn(usePayoutStatus.USER_FORM_CONTEXT_NAMESPACE);
|
|
7992
|
+
const user = index_module.J();
|
|
7993
|
+
const [connectImpactPartner, { loading: connectLoading, errors: connectErrors },] = index_module.$e(CONNECT_PARTNER);
|
|
7994
|
+
const { data, loading, refetch, errors: userError, } = index_module.$n(usePayoutStatus.USER_QUERY_NAMESPACE);
|
|
7995
|
+
const _currencies = index_module.Fn(usePayoutStatus.CURRENCIES_NAMESPACE);
|
|
7923
7996
|
const currencies = stencilHooks_module.useMemo(() => [...(_currencies || [])].sort((a, b) => a.displayName.localeCompare(b.displayName)), [_currencies]);
|
|
7924
7997
|
const [countrySearch, setCountrySearch] = stencilHooks_module.useState("");
|
|
7925
7998
|
const [phoneCountrySearch, setPhoneCountrySearch] = stencilHooks_module.useState("");
|
|
@@ -8020,6 +8093,45 @@ function useUserInfoForm(props) {
|
|
|
8020
8093
|
setFilteredCurrencies(currencies.filter((c) => c.currencyCode.toLowerCase().includes(currencySearch.toLowerCase())) || []);
|
|
8021
8094
|
}
|
|
8022
8095
|
}, [currencySearch, currencies]);
|
|
8096
|
+
async function connectPartner(formData) {
|
|
8097
|
+
var _a, _b, _c, _d, _e;
|
|
8098
|
+
const vars = {
|
|
8099
|
+
user: {
|
|
8100
|
+
id: user.id,
|
|
8101
|
+
accountId: user.accountId,
|
|
8102
|
+
},
|
|
8103
|
+
firstName: formData.firstName,
|
|
8104
|
+
lastName: formData.lastName,
|
|
8105
|
+
countryCode: formData.countryCode,
|
|
8106
|
+
currency: formData.currency,
|
|
8107
|
+
address: formData.address,
|
|
8108
|
+
city: formData.city,
|
|
8109
|
+
state: formData.state,
|
|
8110
|
+
postalCode: formData.postalCode,
|
|
8111
|
+
phoneNumber: formData.phoneNumber,
|
|
8112
|
+
phoneNumberCountryCode: formData.phoneNumberCountryCode,
|
|
8113
|
+
};
|
|
8114
|
+
const result = await connectImpactPartner({
|
|
8115
|
+
vars,
|
|
8116
|
+
});
|
|
8117
|
+
if (!result || ((_a = result) === null || _a === void 0 ? void 0 : _a.message))
|
|
8118
|
+
throw new Error();
|
|
8119
|
+
if (!((_b = result.createImpactConnection) === null || _b === void 0 ? void 0 : _b.success)) {
|
|
8120
|
+
// Output backend errors to console for now
|
|
8121
|
+
console.error("Failed to create Impact connection: ", result.createImpactConnection.validationErrors);
|
|
8122
|
+
throw new Error();
|
|
8123
|
+
}
|
|
8124
|
+
await refetch();
|
|
8125
|
+
const resultPublisher = (_e = (_d = (_c = result
|
|
8126
|
+
.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;
|
|
8127
|
+
const hasValidCurrentDocument = sqmInvoiceTableView.validTaxDocument(resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.requiredTaxDocumentType) && (resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.currentTaxDocument);
|
|
8128
|
+
// Fire form change event
|
|
8129
|
+
window.dispatchEvent(new Event(usePayoutStatus.TAX_FORM_UPDATED_EVENT_KEY));
|
|
8130
|
+
return {
|
|
8131
|
+
resultPublisher,
|
|
8132
|
+
hasValidCurrentDocument,
|
|
8133
|
+
};
|
|
8134
|
+
}
|
|
8023
8135
|
async function onSubmit(event) {
|
|
8024
8136
|
let formControls = event.target.getFormControls();
|
|
8025
8137
|
let formData = {};
|
|
@@ -8062,9 +8174,39 @@ function useUserInfoForm(props) {
|
|
|
8062
8174
|
postalCode: userData.postalCode,
|
|
8063
8175
|
currency: userData.currency,
|
|
8064
8176
|
});
|
|
8065
|
-
const
|
|
8177
|
+
const skipNextStep = getSkipNextStep(userData);
|
|
8178
|
+
console.log({ skipNextStep });
|
|
8179
|
+
if (skipNextStep) {
|
|
8180
|
+
try {
|
|
8181
|
+
const { resultPublisher, hasValidCurrentDocument } = await connectPartner(formData);
|
|
8182
|
+
if ((resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.requiredTaxDocumentType) &&
|
|
8183
|
+
!hasValidCurrentDocument) {
|
|
8184
|
+
// Go to docusign form
|
|
8185
|
+
setStep("/3");
|
|
8186
|
+
}
|
|
8187
|
+
else {
|
|
8188
|
+
if (resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.brandedSignup) {
|
|
8189
|
+
// Go to banking information form
|
|
8190
|
+
setStep("/4");
|
|
8191
|
+
}
|
|
8192
|
+
else {
|
|
8193
|
+
// Go right to the dashboard
|
|
8194
|
+
setStep("/dashboard");
|
|
8195
|
+
}
|
|
8196
|
+
}
|
|
8197
|
+
}
|
|
8198
|
+
catch (e) {
|
|
8199
|
+
setErrors({ general: true });
|
|
8200
|
+
}
|
|
8201
|
+
}
|
|
8202
|
+
const nextStep = context.overrideNextStep || skipNextStep ? "/3" : "/2";
|
|
8066
8203
|
setStep(nextStep);
|
|
8067
8204
|
}
|
|
8205
|
+
function getSkipNextStep(userData) {
|
|
8206
|
+
if (userData.countryCode === "US")
|
|
8207
|
+
return true;
|
|
8208
|
+
return true;
|
|
8209
|
+
}
|
|
8068
8210
|
const hasStates = ["ES", "AU", "US", "CA"].includes(userFormContext.countryCode);
|
|
8069
8211
|
const regionObj = hasStates
|
|
8070
8212
|
? sqmInvoiceTableView.ADDRESS_REGIONS[userFormContext === null || userFormContext === void 0 ? void 0 : userFormContext.countryCode]
|
|
@@ -8092,16 +8234,17 @@ function useUserInfoForm(props) {
|
|
|
8092
8234
|
allCountries: countries,
|
|
8093
8235
|
regionLabelEnum: regionObj === null || regionObj === void 0 ? void 0 : regionObj.labelEnum,
|
|
8094
8236
|
regions: (regionObj === null || regionObj === void 0 ? void 0 : regionObj.regions) || [],
|
|
8237
|
+
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,
|
|
8095
8238
|
},
|
|
8096
8239
|
states: {
|
|
8097
8240
|
step: step === null || step === void 0 ? void 0 : step.replace("/", ""),
|
|
8098
8241
|
hideState: !hasStates,
|
|
8099
8242
|
hideSteps: !!context.hideSteps,
|
|
8100
|
-
disabled: loading,
|
|
8243
|
+
disabled: loading || connectLoading,
|
|
8101
8244
|
loadingError: !!(userError === null || userError === void 0 ? void 0 : userError.message),
|
|
8102
|
-
loading: loading,
|
|
8103
|
-
isPartner: !!((
|
|
8104
|
-
isUser: !!((
|
|
8245
|
+
loading: loading || connectLoading,
|
|
8246
|
+
isPartner: !!((_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.publisher),
|
|
8247
|
+
isUser: !!((_f = (_e = data === null || data === void 0 ? void 0 : data.user) === null || _e === void 0 ? void 0 : _e.impactConnection) === null || _f === void 0 ? void 0 : _f.user),
|
|
8105
8248
|
formState: {
|
|
8106
8249
|
...userFormContext,
|
|
8107
8250
|
errors: formErrors,
|
|
@@ -8293,7 +8436,7 @@ const TaxForm = class {
|
|
|
8293
8436
|
}
|
|
8294
8437
|
};
|
|
8295
8438
|
function useDemoUserInfoForm(props) {
|
|
8296
|
-
const setStep = index_module.En(TAX_CONTEXT_NAMESPACE);
|
|
8439
|
+
const setStep = index_module.En(usePayoutStatus.TAX_CONTEXT_NAMESPACE);
|
|
8297
8440
|
return cjs.cjs({
|
|
8298
8441
|
setStep,
|
|
8299
8442
|
onSubmit: () => {
|