@saasquatch/mint-components 1.16.0-18 → 1.16.0-19

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.
@@ -5806,36 +5806,19 @@ const TaxAndCashDashboardView = (props) => {
5806
5806
  function getAlert(status) {
5807
5807
  switch (status) {
5808
5808
  case "OVER_W9_THRESHOLD":
5809
- if (states.enforceUsTaxComplianceOption === "CASH_ONLY_DEFER_W9") {
5810
- return {
5811
- header: text.w9RequiredHeader,
5812
- description: global.intl.formatMessage({
5813
- id: "w9RequiredDescription",
5814
- defaultMessage: text.w9RequiredDescription,
5815
- }, {
5816
- termsAndConditions: (index.h("a", { target: "_blank", href: `https://terms.advocate.impact.com/PayoutTermsAndConditions.html` }, text.termsAndConditions)),
5817
- }),
5818
- button: (index.h("sl-button", { style: { marginTop: "var(--sl-spacing-x-small)" }, type: "default", onClick: callbacks.onNewFormClick }, text.w9RequiredButtonText)),
5819
- alertType: "info",
5820
- icon: "info-circle",
5821
- class: sheet$5.classes.WarningHoldAlertContainer,
5822
- };
5823
- }
5824
- else {
5825
- return {
5826
- header: text.payoutHoldAlertHeader,
5827
- description: global.intl.formatMessage({
5828
- id: "payoutHoldAlertDescription",
5829
- defaultMessage: text.payoutHoldAlertDescription,
5830
- }, {
5831
- supportLink: (index.h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
5832
- }),
5833
- buttonText: null,
5834
- alertType: "warning",
5835
- icon: "exclamation-triangle",
5836
- class: sheet$5.classes.WarningHoldAlertContainer,
5837
- };
5838
- }
5809
+ return {
5810
+ header: text.w9RequiredHeader,
5811
+ description: global.intl.formatMessage({
5812
+ id: "w9RequiredDescription",
5813
+ defaultMessage: text.w9RequiredDescription,
5814
+ }, {
5815
+ termsAndConditions: (index.h("a", { target: "_blank", href: `https://terms.advocate.impact.com/PayoutTermsAndConditions.html` }, text.termsAndConditions)),
5816
+ }),
5817
+ button: (index.h("sl-button", { style: { marginTop: "var(--sl-spacing-x-small)" }, type: "default", onClick: callbacks.onNewFormClick }, text.w9RequiredButtonText)),
5818
+ alertType: "info",
5819
+ icon: "info-circle",
5820
+ class: sheet$5.classes.WarningHoldAlertContainer,
5821
+ };
5839
5822
  case "VERIFICATION:REQUIRED":
5840
5823
  return {
5841
5824
  header: text.verificationRequiredHeader,
@@ -6044,7 +6027,7 @@ const TaxAndCashDashboardView = (props) => {
6044
6027
  slots.payoutDetailsCardSlot,
6045
6028
  !states.loading && (index.h("p", { class: sheet$5.classes.DescriptionText }, text.payoutFromImpact)),
6046
6029
  states.canEditPayoutInfo && (index.h("sl-button", { disabled: states.disabled || states.loading, type: "default", class: sheet$5.classes.EditBankDetailsButton, onClick: callbacks.onEditPayoutInfo }, text.editPaymentInformationButton)))),
6047
- !states.noFormNeeded && (index.h("div", { class: sheet$5.classes.TaxDocumentsContainer },
6030
+ (!states.noFormNeeded || states.status === "NOT_VERIFIED") && (index.h("div", { class: sheet$5.classes.TaxDocumentsContainer },
6048
6031
  index.h("div", null, states.loading ? (index.h("div", { class: sheet$5.classes.TaxSectionSkeletonContainer },
6049
6032
  index.h("sl-skeleton", { class: sheet$5.classes.SkeletonOne }),
6050
6033
  index.h("sl-skeleton", { class: sheet$5.classes.SkeletonTwo }))) : (index.h("div", null,
@@ -6058,7 +6041,8 @@ const TaxAndCashDashboardView = (props) => {
6058
6041
  documentType: states.documentTypeString,
6059
6042
  })),
6060
6043
  index.h("span", { class: sheet$5.classes.StatusAlert }, statusMap[states.status]))),
6061
- states.status !== "NOT_VERIFIED" && (index.h("sl-button", { disabled: states.disabled || states.loading, onClick: callbacks.onClick, type: "default", class: sheet$5.classes.NewFormButton, exportparts: "base: primarybutton-base" }, text.newFormButton)))))))),
6044
+ states.noFormNeeded &&
6045
+ states.status !== "NOT_VERIFIED" && (index.h("sl-button", { disabled: states.disabled || states.loading, onClick: callbacks.onClick, type: "default", class: sheet$5.classes.NewFormButton, exportparts: "base: primarybutton-base" }, text.newFormButton)))))))),
6062
6046
  index.h("div", { class: sheet$5.classes.IndirectTaxPreviewContainer }, states.loading ? (index.h("div", { class: sheet$5.classes.TaxSectionSkeletonContainer },
6063
6047
  index.h("sl-skeleton", { class: sheet$5.classes.SkeletonOne }),
6064
6048
  index.h("sl-skeleton", { class: sheet$5.classes.SkeletonTwo }))) : (index.h("div", null,
@@ -6106,13 +6090,6 @@ const TaxAndCashDashboardView = (props) => {
6106
6090
  index.h("sqm-invoice-table-data-column", { "column-title": text.earningsAfterTaxColumnTitle, property: "netEarnings" })))))))))));
6107
6091
  };
6108
6092
 
6109
- const GET_TAX_SETTING = index_module.dist.gql `
6110
- query getTenantSettings {
6111
- tenantSettings {
6112
- enforceUsTaxCompliance
6113
- }
6114
- }
6115
- `;
6116
6093
  function getCountryName(countryCode, locale) {
6117
6094
  if (!countryCode)
6118
6095
  return undefined;
@@ -6148,12 +6125,11 @@ function getIndirectTaxType(taxInformation) {
6148
6125
  return "Indirect Tax";
6149
6126
  }
6150
6127
  const useTaxAndCashDashboard = (props) => {
6151
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
6128
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
6152
6129
  const setStep = index_module.En(TAX_CONTEXT_NAMESPACE);
6153
6130
  const setContext = index_module.En(TAX_FORM_CONTEXT_NAMESPACE);
6154
6131
  const [showDialog, setShowDialog] = stencilHooks_module.useState(false);
6155
6132
  const { render, loading: veriffLoading, errors: veriffErrors, } = usePayoutStatus.useVeriffApp();
6156
- const { data: taxSettingRes } = index_module.wn(GET_TAX_SETTING, {});
6157
6133
  const locale = index_module.L();
6158
6134
  stencilHooks_module.useEffect(() => {
6159
6135
  // Clear override context once on submitted
@@ -6194,32 +6170,30 @@ const useTaxAndCashDashboard = (props) => {
6194
6170
  window.removeEventListener(usePayoutStatus.VERIFF_COMPLETE_EVENT_KEY, cb);
6195
6171
  };
6196
6172
  }, []);
6197
- const enforceUsTaxComplianceOption = (_e = taxSettingRes === null || taxSettingRes === void 0 ? void 0 : taxSettingRes.tenantSettings) === null || _e === void 0 ? void 0 : _e.enforceUsTaxCompliance;
6198
6173
  return {
6199
6174
  states: {
6200
6175
  dateSubmitted,
6201
6176
  documentType,
6202
6177
  canEditPayoutInfo: publisher === null || publisher === void 0 ? void 0 : publisher.brandedSignup,
6203
6178
  documentTypeString: sqmInvoiceTableView.taxTypeToName(documentType),
6204
- status: (_f = publisher === null || publisher === void 0 ? void 0 : publisher.currentTaxDocument) === null || _f === void 0 ? void 0 : _f.status,
6205
- subRegion: getSubRegionName((_g = publisher === null || publisher === void 0 ? void 0 : publisher.taxInformation) === null || _g === void 0 ? void 0 : _g.indirectTaxRegion),
6206
- subRegionTaxNumber: (_h = publisher === null || publisher === void 0 ? void 0 : publisher.taxInformation) === null || _h === void 0 ? void 0 : _h.withholdingTaxId,
6207
- qstNumber: (_j = publisher === null || publisher === void 0 ? void 0 : publisher.taxInformation) === null || _j === void 0 ? void 0 : _j.additionalTaxId,
6179
+ status: (_e = publisher === null || publisher === void 0 ? void 0 : publisher.currentTaxDocument) === null || _e === void 0 ? void 0 : _e.status,
6180
+ subRegion: getSubRegionName((_f = publisher === null || publisher === void 0 ? void 0 : publisher.taxInformation) === null || _f === void 0 ? void 0 : _f.indirectTaxRegion),
6181
+ subRegionTaxNumber: (_g = publisher === null || publisher === void 0 ? void 0 : publisher.taxInformation) === null || _g === void 0 ? void 0 : _g.withholdingTaxId,
6182
+ qstNumber: (_h = publisher === null || publisher === void 0 ? void 0 : publisher.taxInformation) === null || _h === void 0 ? void 0 : _h.additionalTaxId,
6208
6183
  indirectTaxType: getIndirectTaxType(publisher === null || publisher === void 0 ? void 0 : publisher.taxInformation),
6209
- indirectTaxNumber: (_k = publisher === null || publisher === void 0 ? void 0 : publisher.taxInformation) === null || _k === void 0 ? void 0 : _k.indirectTaxId,
6184
+ indirectTaxNumber: (_j = publisher === null || publisher === void 0 ? void 0 : publisher.taxInformation) === null || _j === void 0 ? void 0 : _j.indirectTaxId,
6210
6185
  isBusinessEntity: (publisher === null || publisher === void 0 ? void 0 : publisher.requiredTaxDocumentType) === "W8BENE",
6211
6186
  province: provinceName,
6212
- country: getCountryName((_l = publisher === null || publisher === void 0 ? void 0 : publisher.taxInformation) === null || _l === void 0 ? void 0 : _l.indirectTaxCountryCode, locale),
6213
- notRegistered: !((_m = publisher === null || publisher === void 0 ? void 0 : publisher.taxInformation) === null || _m === void 0 ? void 0 : _m.indirectTaxId),
6187
+ country: getCountryName((_k = publisher === null || publisher === void 0 ? void 0 : publisher.taxInformation) === null || _k === void 0 ? void 0 : _k.indirectTaxCountryCode, locale),
6188
+ notRegistered: !((_l = publisher === null || publisher === void 0 ? void 0 : publisher.taxInformation) === null || _l === void 0 ? void 0 : _l.indirectTaxId),
6214
6189
  noFormNeeded: !documentType,
6215
6190
  disabled: loading,
6216
6191
  loading,
6217
6192
  loadingError: !!(userError === null || userError === void 0 ? void 0 : userError.message),
6218
6193
  showNewFormDialog: showDialog,
6219
- hasHold: !!((_o = publisher === null || publisher === void 0 ? void 0 : publisher.payoutsAccount) === null || _o === void 0 ? void 0 : _o.hold),
6194
+ hasHold: !!((_m = publisher === null || publisher === void 0 ? void 0 : publisher.payoutsAccount) === null || _m === void 0 ? void 0 : _m.hold),
6220
6195
  payoutStatus,
6221
6196
  veriffLoading,
6222
- enforceUsTaxComplianceOption,
6223
6197
  },
6224
6198
  callbacks: {
6225
6199
  onClick: () => setShowDialog(true),
@@ -200,36 +200,19 @@ export const TaxAndCashDashboardView = (props) => {
200
200
  function getAlert(status) {
201
201
  switch (status) {
202
202
  case "OVER_W9_THRESHOLD":
203
- if (states.enforceUsTaxComplianceOption === "CASH_ONLY_DEFER_W9") {
204
- return {
205
- header: text.w9RequiredHeader,
206
- description: intl.formatMessage({
207
- id: "w9RequiredDescription",
208
- defaultMessage: text.w9RequiredDescription,
209
- }, {
210
- termsAndConditions: (h("a", { target: "_blank", href: `https://terms.advocate.impact.com/PayoutTermsAndConditions.html` }, text.termsAndConditions)),
211
- }),
212
- button: (h("sl-button", { style: { marginTop: "var(--sl-spacing-x-small)" }, type: "default", onClick: callbacks.onNewFormClick }, text.w9RequiredButtonText)),
213
- alertType: "info",
214
- icon: "info-circle",
215
- class: sheet.classes.WarningHoldAlertContainer,
216
- };
217
- }
218
- else {
219
- return {
220
- header: text.payoutHoldAlertHeader,
221
- description: intl.formatMessage({
222
- id: "payoutHoldAlertDescription",
223
- defaultMessage: text.payoutHoldAlertDescription,
224
- }, {
225
- supportLink: (h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
226
- }),
227
- buttonText: null,
228
- alertType: "warning",
229
- icon: "exclamation-triangle",
230
- class: sheet.classes.WarningHoldAlertContainer,
231
- };
232
- }
203
+ return {
204
+ header: text.w9RequiredHeader,
205
+ description: intl.formatMessage({
206
+ id: "w9RequiredDescription",
207
+ defaultMessage: text.w9RequiredDescription,
208
+ }, {
209
+ termsAndConditions: (h("a", { target: "_blank", href: `https://terms.advocate.impact.com/PayoutTermsAndConditions.html` }, text.termsAndConditions)),
210
+ }),
211
+ button: (h("sl-button", { style: { marginTop: "var(--sl-spacing-x-small)" }, type: "default", onClick: callbacks.onNewFormClick }, text.w9RequiredButtonText)),
212
+ alertType: "info",
213
+ icon: "info-circle",
214
+ class: sheet.classes.WarningHoldAlertContainer,
215
+ };
233
216
  case "VERIFICATION:REQUIRED":
234
217
  return {
235
218
  header: text.verificationRequiredHeader,
@@ -438,7 +421,7 @@ export const TaxAndCashDashboardView = (props) => {
438
421
  slots.payoutDetailsCardSlot,
439
422
  !states.loading && (h("p", { class: sheet.classes.DescriptionText }, text.payoutFromImpact)),
440
423
  states.canEditPayoutInfo && (h("sl-button", { disabled: states.disabled || states.loading, type: "default", class: sheet.classes.EditBankDetailsButton, onClick: callbacks.onEditPayoutInfo }, text.editPaymentInformationButton)))),
441
- !states.noFormNeeded && (h("div", { class: sheet.classes.TaxDocumentsContainer },
424
+ (!states.noFormNeeded || states.status === "NOT_VERIFIED") && (h("div", { class: sheet.classes.TaxDocumentsContainer },
442
425
  h("div", null, states.loading ? (h("div", { class: sheet.classes.TaxSectionSkeletonContainer },
443
426
  h("sl-skeleton", { class: sheet.classes.SkeletonOne }),
444
427
  h("sl-skeleton", { class: sheet.classes.SkeletonTwo }))) : (h("div", null,
@@ -452,7 +435,8 @@ export const TaxAndCashDashboardView = (props) => {
452
435
  documentType: states.documentTypeString,
453
436
  })),
454
437
  h("span", { class: sheet.classes.StatusAlert }, statusMap[states.status]))),
455
- states.status !== "NOT_VERIFIED" && (h("sl-button", { disabled: states.disabled || states.loading, onClick: callbacks.onClick, type: "default", class: sheet.classes.NewFormButton, exportparts: "base: primarybutton-base" }, text.newFormButton)))))))),
438
+ states.noFormNeeded &&
439
+ states.status !== "NOT_VERIFIED" && (h("sl-button", { disabled: states.disabled || states.loading, onClick: callbacks.onClick, type: "default", class: sheet.classes.NewFormButton, exportparts: "base: primarybutton-base" }, text.newFormButton)))))))),
456
440
  h("div", { class: sheet.classes.IndirectTaxPreviewContainer }, states.loading ? (h("div", { class: sheet.classes.TaxSectionSkeletonContainer },
457
441
  h("sl-skeleton", { class: sheet.classes.SkeletonOne }),
458
442
  h("sl-skeleton", { class: sheet.classes.SkeletonTwo }))) : (h("div", null,
@@ -1869,7 +1869,7 @@ export class TaxAndCashDashboard {
1869
1869
  "mutable": false,
1870
1870
  "complexType": {
1871
1871
  "original": "DemoData<UseTaxAndCashDashboardResult>",
1872
- "resolved": "{ states?: { status?: string; documentType: TaxDocumentType; documentTypeString: string; canEditPayoutInfo: boolean; disabled?: boolean; dateSubmitted?: string; noFormNeeded?: boolean; indirectTaxType?: string; qstNumber?: string; subRegionTaxNumber?: string; subRegion?: string; indirectTaxNumber?: string; province?: string; country?: string; notRegistered?: boolean; isBusinessEntity?: boolean; loading?: boolean; loadingError?: boolean; showNewFormDialog: boolean; hasHold: boolean; payoutStatus: PayoutStatus; veriffLoading: boolean; errors?: { general?: boolean; }; enforceUsTaxComplianceOption?: string; }; }",
1872
+ "resolved": "{ states?: { status?: string; documentType: TaxDocumentType; documentTypeString: string; canEditPayoutInfo: boolean; disabled?: boolean; dateSubmitted?: string; noFormNeeded?: boolean; indirectTaxType?: string; qstNumber?: string; subRegionTaxNumber?: string; subRegion?: string; indirectTaxNumber?: string; province?: string; country?: string; notRegistered?: boolean; isBusinessEntity?: boolean; loading?: boolean; loadingError?: boolean; showNewFormDialog: boolean; hasHold: boolean; payoutStatus: PayoutStatus; veriffLoading: boolean; errors?: { general?: boolean; }; }; }",
1873
1873
  "references": {
1874
1874
  "DemoData": {
1875
1875
  "location": "import",
@@ -1,20 +1,12 @@
1
- import { useLocale, useParentQueryValue, useQuery, useSetParent, } from "@saasquatch/component-boilerplate";
1
+ import { useLocale, useParentQueryValue, useSetParent, } from "@saasquatch/component-boilerplate";
2
2
  import { useEffect, useState } from "@saasquatch/universal-hooks";
3
3
  import { DateTime } from "luxon";
4
4
  import { vatLabels } from "../countries";
5
- import { getStatus, } from "../sqm-payout-status-alert/usePayoutStatus";
5
+ import { getStatus } from "../sqm-payout-status-alert/usePayoutStatus";
6
6
  import { TAX_CONTEXT_NAMESPACE, TAX_FORM_CONTEXT_NAMESPACE, USER_QUERY_NAMESPACE, } from "../sqm-tax-and-cash/data";
7
7
  import { INDIRECT_TAX_PROVINCES, INDIRECT_TAX_SPAIN_REGIONS, } from "../subregions";
8
8
  import { useVeriffApp, VERIFF_COMPLETE_EVENT_KEY } from "../useVeriffApp";
9
9
  import { taxTypeToName } from "../utils";
10
- import { gql } from "graphql-request";
11
- const GET_TAX_SETTING = gql `
12
- query getTenantSettings {
13
- tenantSettings {
14
- enforceUsTaxCompliance
15
- }
16
- }
17
- `;
18
10
  function getCountryName(countryCode, locale) {
19
11
  if (!countryCode)
20
12
  return undefined;
@@ -50,12 +42,11 @@ function getIndirectTaxType(taxInformation) {
50
42
  return "Indirect Tax";
51
43
  }
52
44
  export const useTaxAndCashDashboard = (props) => {
53
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
45
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
54
46
  const setStep = useSetParent(TAX_CONTEXT_NAMESPACE);
55
47
  const setContext = useSetParent(TAX_FORM_CONTEXT_NAMESPACE);
56
48
  const [showDialog, setShowDialog] = useState(false);
57
49
  const { render, loading: veriffLoading, errors: veriffErrors, } = useVeriffApp();
58
- const { data: taxSettingRes } = useQuery(GET_TAX_SETTING, {});
59
50
  const locale = useLocale();
60
51
  useEffect(() => {
61
52
  // Clear override context once on submitted
@@ -96,32 +87,30 @@ export const useTaxAndCashDashboard = (props) => {
96
87
  window.removeEventListener(VERIFF_COMPLETE_EVENT_KEY, cb);
97
88
  };
98
89
  }, []);
99
- const enforceUsTaxComplianceOption = (_e = taxSettingRes === null || taxSettingRes === void 0 ? void 0 : taxSettingRes.tenantSettings) === null || _e === void 0 ? void 0 : _e.enforceUsTaxCompliance;
100
90
  return {
101
91
  states: {
102
92
  dateSubmitted,
103
93
  documentType,
104
94
  canEditPayoutInfo: publisher === null || publisher === void 0 ? void 0 : publisher.brandedSignup,
105
95
  documentTypeString: taxTypeToName(documentType),
106
- status: (_f = publisher === null || publisher === void 0 ? void 0 : publisher.currentTaxDocument) === null || _f === void 0 ? void 0 : _f.status,
107
- subRegion: getSubRegionName((_g = publisher === null || publisher === void 0 ? void 0 : publisher.taxInformation) === null || _g === void 0 ? void 0 : _g.indirectTaxRegion),
108
- subRegionTaxNumber: (_h = publisher === null || publisher === void 0 ? void 0 : publisher.taxInformation) === null || _h === void 0 ? void 0 : _h.withholdingTaxId,
109
- qstNumber: (_j = publisher === null || publisher === void 0 ? void 0 : publisher.taxInformation) === null || _j === void 0 ? void 0 : _j.additionalTaxId,
96
+ status: (_e = publisher === null || publisher === void 0 ? void 0 : publisher.currentTaxDocument) === null || _e === void 0 ? void 0 : _e.status,
97
+ subRegion: getSubRegionName((_f = publisher === null || publisher === void 0 ? void 0 : publisher.taxInformation) === null || _f === void 0 ? void 0 : _f.indirectTaxRegion),
98
+ subRegionTaxNumber: (_g = publisher === null || publisher === void 0 ? void 0 : publisher.taxInformation) === null || _g === void 0 ? void 0 : _g.withholdingTaxId,
99
+ qstNumber: (_h = publisher === null || publisher === void 0 ? void 0 : publisher.taxInformation) === null || _h === void 0 ? void 0 : _h.additionalTaxId,
110
100
  indirectTaxType: getIndirectTaxType(publisher === null || publisher === void 0 ? void 0 : publisher.taxInformation),
111
- indirectTaxNumber: (_k = publisher === null || publisher === void 0 ? void 0 : publisher.taxInformation) === null || _k === void 0 ? void 0 : _k.indirectTaxId,
101
+ indirectTaxNumber: (_j = publisher === null || publisher === void 0 ? void 0 : publisher.taxInformation) === null || _j === void 0 ? void 0 : _j.indirectTaxId,
112
102
  isBusinessEntity: (publisher === null || publisher === void 0 ? void 0 : publisher.requiredTaxDocumentType) === "W8BENE",
113
103
  province: provinceName,
114
- country: getCountryName((_l = publisher === null || publisher === void 0 ? void 0 : publisher.taxInformation) === null || _l === void 0 ? void 0 : _l.indirectTaxCountryCode, locale),
115
- notRegistered: !((_m = publisher === null || publisher === void 0 ? void 0 : publisher.taxInformation) === null || _m === void 0 ? void 0 : _m.indirectTaxId),
104
+ country: getCountryName((_k = publisher === null || publisher === void 0 ? void 0 : publisher.taxInformation) === null || _k === void 0 ? void 0 : _k.indirectTaxCountryCode, locale),
105
+ notRegistered: !((_l = publisher === null || publisher === void 0 ? void 0 : publisher.taxInformation) === null || _l === void 0 ? void 0 : _l.indirectTaxId),
116
106
  noFormNeeded: !documentType,
117
107
  disabled: loading,
118
108
  loading,
119
109
  loadingError: !!(userError === null || userError === void 0 ? void 0 : userError.message),
120
110
  showNewFormDialog: showDialog,
121
- hasHold: !!((_o = publisher === null || publisher === void 0 ? void 0 : publisher.payoutsAccount) === null || _o === void 0 ? void 0 : _o.hold),
111
+ hasHold: !!((_m = publisher === null || publisher === void 0 ? void 0 : publisher.payoutsAccount) === null || _m === void 0 ? void 0 : _m.hold),
122
112
  payoutStatus,
123
113
  veriffLoading,
124
- enforceUsTaxComplianceOption,
125
114
  },
126
115
  callbacks: {
127
116
  onClick: () => setShowDialog(true),
@@ -1,7 +1,7 @@
1
1
  import { h, r as registerInstance, c as Host, g as getElement } from './index-91e7729f.js';
2
2
  import { m as useRef, k as useState, f as useEffect, n as h$1, l, u as useMemo, b as browser, j as useReducer } from './stencil-hooks.module-4bc38af4.js';
3
3
  import { i as intl } from './global-be1f9992.js';
4
- import { d as dist, _, L, J, t as Pn, F as Fn, x as $n, $ as $e, i as isDemo, q as En, u as useCallback, R as Rn, M as Mn, I as In, S as Sn, w as wn } from './index.module-89a79f66.js';
4
+ import { d as dist, _, L, J, t as Pn, F as Fn, x as $n, $ as $e, i as isDemo, q as En, u as useCallback, R as Rn, M as Mn, I as In, S as Sn } from './index.module-89a79f66.js';
5
5
  import { j as jsonpointer } from './jsonpointer-388a7082.js';
6
6
  import { c as cjs } from './cjs-bdfb4486.js';
7
7
  import { g as getProps, l as luxonLocale } from './utils-334c1e34.js';
@@ -5802,36 +5802,19 @@ const TaxAndCashDashboardView = (props) => {
5802
5802
  function getAlert(status) {
5803
5803
  switch (status) {
5804
5804
  case "OVER_W9_THRESHOLD":
5805
- if (states.enforceUsTaxComplianceOption === "CASH_ONLY_DEFER_W9") {
5806
- return {
5807
- header: text.w9RequiredHeader,
5808
- description: intl.formatMessage({
5809
- id: "w9RequiredDescription",
5810
- defaultMessage: text.w9RequiredDescription,
5811
- }, {
5812
- termsAndConditions: (h("a", { target: "_blank", href: `https://terms.advocate.impact.com/PayoutTermsAndConditions.html` }, text.termsAndConditions)),
5813
- }),
5814
- button: (h("sl-button", { style: { marginTop: "var(--sl-spacing-x-small)" }, type: "default", onClick: callbacks.onNewFormClick }, text.w9RequiredButtonText)),
5815
- alertType: "info",
5816
- icon: "info-circle",
5817
- class: sheet$5.classes.WarningHoldAlertContainer,
5818
- };
5819
- }
5820
- else {
5821
- return {
5822
- header: text.payoutHoldAlertHeader,
5823
- description: intl.formatMessage({
5824
- id: "payoutHoldAlertDescription",
5825
- defaultMessage: text.payoutHoldAlertDescription,
5826
- }, {
5827
- supportLink: (h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
5828
- }),
5829
- buttonText: null,
5830
- alertType: "warning",
5831
- icon: "exclamation-triangle",
5832
- class: sheet$5.classes.WarningHoldAlertContainer,
5833
- };
5834
- }
5805
+ return {
5806
+ header: text.w9RequiredHeader,
5807
+ description: intl.formatMessage({
5808
+ id: "w9RequiredDescription",
5809
+ defaultMessage: text.w9RequiredDescription,
5810
+ }, {
5811
+ termsAndConditions: (h("a", { target: "_blank", href: `https://terms.advocate.impact.com/PayoutTermsAndConditions.html` }, text.termsAndConditions)),
5812
+ }),
5813
+ button: (h("sl-button", { style: { marginTop: "var(--sl-spacing-x-small)" }, type: "default", onClick: callbacks.onNewFormClick }, text.w9RequiredButtonText)),
5814
+ alertType: "info",
5815
+ icon: "info-circle",
5816
+ class: sheet$5.classes.WarningHoldAlertContainer,
5817
+ };
5835
5818
  case "VERIFICATION:REQUIRED":
5836
5819
  return {
5837
5820
  header: text.verificationRequiredHeader,
@@ -6040,7 +6023,7 @@ const TaxAndCashDashboardView = (props) => {
6040
6023
  slots.payoutDetailsCardSlot,
6041
6024
  !states.loading && (h("p", { class: sheet$5.classes.DescriptionText }, text.payoutFromImpact)),
6042
6025
  states.canEditPayoutInfo && (h("sl-button", { disabled: states.disabled || states.loading, type: "default", class: sheet$5.classes.EditBankDetailsButton, onClick: callbacks.onEditPayoutInfo }, text.editPaymentInformationButton)))),
6043
- !states.noFormNeeded && (h("div", { class: sheet$5.classes.TaxDocumentsContainer },
6026
+ (!states.noFormNeeded || states.status === "NOT_VERIFIED") && (h("div", { class: sheet$5.classes.TaxDocumentsContainer },
6044
6027
  h("div", null, states.loading ? (h("div", { class: sheet$5.classes.TaxSectionSkeletonContainer },
6045
6028
  h("sl-skeleton", { class: sheet$5.classes.SkeletonOne }),
6046
6029
  h("sl-skeleton", { class: sheet$5.classes.SkeletonTwo }))) : (h("div", null,
@@ -6054,7 +6037,8 @@ const TaxAndCashDashboardView = (props) => {
6054
6037
  documentType: states.documentTypeString,
6055
6038
  })),
6056
6039
  h("span", { class: sheet$5.classes.StatusAlert }, statusMap[states.status]))),
6057
- states.status !== "NOT_VERIFIED" && (h("sl-button", { disabled: states.disabled || states.loading, onClick: callbacks.onClick, type: "default", class: sheet$5.classes.NewFormButton, exportparts: "base: primarybutton-base" }, text.newFormButton)))))))),
6040
+ states.noFormNeeded &&
6041
+ states.status !== "NOT_VERIFIED" && (h("sl-button", { disabled: states.disabled || states.loading, onClick: callbacks.onClick, type: "default", class: sheet$5.classes.NewFormButton, exportparts: "base: primarybutton-base" }, text.newFormButton)))))))),
6058
6042
  h("div", { class: sheet$5.classes.IndirectTaxPreviewContainer }, states.loading ? (h("div", { class: sheet$5.classes.TaxSectionSkeletonContainer },
6059
6043
  h("sl-skeleton", { class: sheet$5.classes.SkeletonOne }),
6060
6044
  h("sl-skeleton", { class: sheet$5.classes.SkeletonTwo }))) : (h("div", null,
@@ -6102,13 +6086,6 @@ const TaxAndCashDashboardView = (props) => {
6102
6086
  h("sqm-invoice-table-data-column", { "column-title": text.earningsAfterTaxColumnTitle, property: "netEarnings" })))))))))));
6103
6087
  };
6104
6088
 
6105
- const GET_TAX_SETTING = dist.gql `
6106
- query getTenantSettings {
6107
- tenantSettings {
6108
- enforceUsTaxCompliance
6109
- }
6110
- }
6111
- `;
6112
6089
  function getCountryName(countryCode, locale) {
6113
6090
  if (!countryCode)
6114
6091
  return undefined;
@@ -6144,12 +6121,11 @@ function getIndirectTaxType(taxInformation) {
6144
6121
  return "Indirect Tax";
6145
6122
  }
6146
6123
  const useTaxAndCashDashboard = (props) => {
6147
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
6124
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
6148
6125
  const setStep = En(TAX_CONTEXT_NAMESPACE);
6149
6126
  const setContext = En(TAX_FORM_CONTEXT_NAMESPACE);
6150
6127
  const [showDialog, setShowDialog] = useState(false);
6151
6128
  const { render, loading: veriffLoading, errors: veriffErrors, } = useVeriffApp();
6152
- const { data: taxSettingRes } = wn(GET_TAX_SETTING, {});
6153
6129
  const locale = L();
6154
6130
  useEffect(() => {
6155
6131
  // Clear override context once on submitted
@@ -6190,32 +6166,30 @@ const useTaxAndCashDashboard = (props) => {
6190
6166
  window.removeEventListener(VERIFF_COMPLETE_EVENT_KEY, cb);
6191
6167
  };
6192
6168
  }, []);
6193
- const enforceUsTaxComplianceOption = (_e = taxSettingRes === null || taxSettingRes === void 0 ? void 0 : taxSettingRes.tenantSettings) === null || _e === void 0 ? void 0 : _e.enforceUsTaxCompliance;
6194
6169
  return {
6195
6170
  states: {
6196
6171
  dateSubmitted,
6197
6172
  documentType,
6198
6173
  canEditPayoutInfo: publisher === null || publisher === void 0 ? void 0 : publisher.brandedSignup,
6199
6174
  documentTypeString: taxTypeToName(documentType),
6200
- status: (_f = publisher === null || publisher === void 0 ? void 0 : publisher.currentTaxDocument) === null || _f === void 0 ? void 0 : _f.status,
6201
- subRegion: getSubRegionName((_g = publisher === null || publisher === void 0 ? void 0 : publisher.taxInformation) === null || _g === void 0 ? void 0 : _g.indirectTaxRegion),
6202
- subRegionTaxNumber: (_h = publisher === null || publisher === void 0 ? void 0 : publisher.taxInformation) === null || _h === void 0 ? void 0 : _h.withholdingTaxId,
6203
- qstNumber: (_j = publisher === null || publisher === void 0 ? void 0 : publisher.taxInformation) === null || _j === void 0 ? void 0 : _j.additionalTaxId,
6175
+ status: (_e = publisher === null || publisher === void 0 ? void 0 : publisher.currentTaxDocument) === null || _e === void 0 ? void 0 : _e.status,
6176
+ subRegion: getSubRegionName((_f = publisher === null || publisher === void 0 ? void 0 : publisher.taxInformation) === null || _f === void 0 ? void 0 : _f.indirectTaxRegion),
6177
+ subRegionTaxNumber: (_g = publisher === null || publisher === void 0 ? void 0 : publisher.taxInformation) === null || _g === void 0 ? void 0 : _g.withholdingTaxId,
6178
+ qstNumber: (_h = publisher === null || publisher === void 0 ? void 0 : publisher.taxInformation) === null || _h === void 0 ? void 0 : _h.additionalTaxId,
6204
6179
  indirectTaxType: getIndirectTaxType(publisher === null || publisher === void 0 ? void 0 : publisher.taxInformation),
6205
- indirectTaxNumber: (_k = publisher === null || publisher === void 0 ? void 0 : publisher.taxInformation) === null || _k === void 0 ? void 0 : _k.indirectTaxId,
6180
+ indirectTaxNumber: (_j = publisher === null || publisher === void 0 ? void 0 : publisher.taxInformation) === null || _j === void 0 ? void 0 : _j.indirectTaxId,
6206
6181
  isBusinessEntity: (publisher === null || publisher === void 0 ? void 0 : publisher.requiredTaxDocumentType) === "W8BENE",
6207
6182
  province: provinceName,
6208
- country: getCountryName((_l = publisher === null || publisher === void 0 ? void 0 : publisher.taxInformation) === null || _l === void 0 ? void 0 : _l.indirectTaxCountryCode, locale),
6209
- notRegistered: !((_m = publisher === null || publisher === void 0 ? void 0 : publisher.taxInformation) === null || _m === void 0 ? void 0 : _m.indirectTaxId),
6183
+ country: getCountryName((_k = publisher === null || publisher === void 0 ? void 0 : publisher.taxInformation) === null || _k === void 0 ? void 0 : _k.indirectTaxCountryCode, locale),
6184
+ notRegistered: !((_l = publisher === null || publisher === void 0 ? void 0 : publisher.taxInformation) === null || _l === void 0 ? void 0 : _l.indirectTaxId),
6210
6185
  noFormNeeded: !documentType,
6211
6186
  disabled: loading,
6212
6187
  loading,
6213
6188
  loadingError: !!(userError === null || userError === void 0 ? void 0 : userError.message),
6214
6189
  showNewFormDialog: showDialog,
6215
- hasHold: !!((_o = publisher === null || publisher === void 0 ? void 0 : publisher.payoutsAccount) === null || _o === void 0 ? void 0 : _o.hold),
6190
+ hasHold: !!((_m = publisher === null || publisher === void 0 ? void 0 : publisher.payoutsAccount) === null || _m === void 0 ? void 0 : _m.hold),
6216
6191
  payoutStatus,
6217
6192
  veriffLoading,
6218
- enforceUsTaxComplianceOption,
6219
6193
  },
6220
6194
  callbacks: {
6221
6195
  onClick: () => setShowDialog(true),