@saasquatch/mint-components 2.3.0-5 → 2.3.0-7

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.
Files changed (67) hide show
  1. package/dist/cjs/sqm-banking-info-form_10.cjs.entry.js +28 -721
  2. package/dist/cjs/sqm-big-stat_47.cjs.entry.js +4 -4
  3. package/dist/cjs/sqm-email-verification_2.cjs.entry.js +17 -32
  4. package/dist/cjs/{sqm-partner-info-modal-view-2eb52318.js → sqm-partner-info-modal-view-65cc677a.js} +1 -0
  5. package/dist/cjs/sqm-stencilbook.cjs.entry.js +254 -77
  6. package/dist/cjs/{sqm-user-info-form-view-0e1ddbe4.js → sqm-user-info-form-view-42323dc5.js} +743 -38
  7. package/dist/cjs/{useIndirectTaxForm-c3c1ec56.js → useIndirectTaxForm-d1cd23f7.js} +5 -5
  8. package/dist/collection/components/sqm-partner-info-modal/sqm-partner-info-modal-view.js +1 -0
  9. package/dist/collection/components/sqm-partner-info-modal/usePartnerInfoModal.js +16 -31
  10. package/dist/collection/components/sqm-stencilbook/sqm-stencilbook.js +2 -0
  11. package/dist/collection/components/tax-and-cash/sqm-payout-details-card/PayoutDetailsCard.stories.js +6 -0
  12. package/dist/collection/components/tax-and-cash/sqm-payout-details-card/sqm-payout-details-card-view.js +13 -2
  13. package/dist/collection/components/tax-and-cash/sqm-tax-and-cash-dashboard/TaxAndCashDashboardView.stories.js +151 -0
  14. package/dist/esm/sqm-banking-info-form_10.entry.js +16 -709
  15. package/dist/esm/sqm-big-stat_47.entry.js +2 -2
  16. package/dist/esm/sqm-email-verification_2.entry.js +17 -32
  17. package/dist/esm/{sqm-partner-info-modal-view-e8efbef1.js → sqm-partner-info-modal-view-136c443d.js} +1 -0
  18. package/dist/esm/sqm-stencilbook.entry.js +218 -41
  19. package/dist/esm/{sqm-user-info-form-view-e1ba6009.js → sqm-user-info-form-view-dc473cb8.js} +721 -17
  20. package/dist/esm/{useIndirectTaxForm-b2888ea5.js → useIndirectTaxForm-27668ad4.js} +1 -1
  21. package/dist/esm-es5/sqm-banking-info-form_10.entry.js +1 -1
  22. package/dist/esm-es5/sqm-big-stat_47.entry.js +1 -1
  23. package/dist/esm-es5/sqm-email-verification_2.entry.js +1 -1
  24. package/dist/esm-es5/sqm-partner-info-modal-view-136c443d.js +1 -0
  25. package/dist/esm-es5/sqm-stencilbook.entry.js +1 -1
  26. package/dist/esm-es5/sqm-user-info-form-view-dc473cb8.js +1 -0
  27. package/dist/esm-es5/subregions-24c1c137.js +1 -0
  28. package/dist/esm-es5/{useIndirectTaxForm-b2888ea5.js → useIndirectTaxForm-27668ad4.js} +1 -1
  29. package/dist/mint-components/mint-components.esm.js +1 -1
  30. package/dist/mint-components/p-1f387c7b.system.js +1 -1
  31. package/dist/mint-components/{p-abe9f5b1.js → p-2e462dd9.js} +5 -5
  32. package/dist/mint-components/{p-b419f9ac.entry.js → p-3c052d3d.entry.js} +1 -1
  33. package/dist/mint-components/p-3f68e4e3.js +1 -0
  34. package/dist/mint-components/{p-a38eece5.system.entry.js → p-4575f71b.system.entry.js} +1 -1
  35. package/dist/mint-components/{p-fa227290.entry.js → p-459c4251.entry.js} +6 -31
  36. package/dist/mint-components/p-4c6ab282.js +1 -0
  37. package/dist/mint-components/p-547f8243.system.entry.js +1 -0
  38. package/dist/mint-components/p-66cb8bec.system.js +1 -0
  39. package/dist/mint-components/p-b21c53cb.system.entry.js +1 -0
  40. package/dist/mint-components/p-b24bb1ee.system.js +1 -0
  41. package/dist/mint-components/p-c2903e7d.entry.js +83 -0
  42. package/dist/mint-components/p-cb58a2c6.js +1 -0
  43. package/dist/mint-components/p-d30c8cb3.entry.js +9 -0
  44. package/dist/mint-components/p-df74f653.system.entry.js +1 -0
  45. package/dist/mint-components/p-ec58628f.system.js +1 -0
  46. package/dist/mint-components/{p-58c24352.system.js → p-ed945efe.system.js} +1 -1
  47. package/dist/types/components/sqm-partner-info-modal/usePartnerInfoModal.d.ts +0 -1
  48. package/dist/types/components/tax-and-cash/sqm-payout-details-card/PayoutDetailsCard.stories.d.ts +1 -0
  49. package/dist/types/components/tax-and-cash/sqm-tax-and-cash-dashboard/TaxAndCashDashboardView.stories.d.ts +19 -0
  50. package/docs/docs.docx +0 -0
  51. package/package.json +1 -1
  52. package/dist/esm-es5/sqm-partner-info-modal-view-e8efbef1.js +0 -1
  53. package/dist/esm-es5/sqm-user-info-form-view-e1ba6009.js +0 -1
  54. package/dist/esm-es5/utils-4f5cd04c.js +0 -1
  55. package/dist/mint-components/p-1e6a2945.js +0 -1
  56. package/dist/mint-components/p-25b32748.system.entry.js +0 -1
  57. package/dist/mint-components/p-41415f9a.system.entry.js +0 -1
  58. package/dist/mint-components/p-58c525ce.system.js +0 -1
  59. package/dist/mint-components/p-7f1bc92b.entry.js +0 -9
  60. package/dist/mint-components/p-b0177b7f.js +0 -1
  61. package/dist/mint-components/p-b222bace.system.entry.js +0 -1
  62. package/dist/mint-components/p-b96ed8eb.js +0 -1
  63. package/dist/mint-components/p-cdabd9de.system.js +0 -1
  64. package/dist/mint-components/p-ebc519bc.system.js +0 -1
  65. package/dist/mint-components/p-ffcebe78.entry.js +0 -83
  66. package/dist/cjs/{utils-a3b3d05b.js → subregions-e7273457.js} +44 -44
  67. package/dist/esm/{utils-4f5cd04c.js → subregions-24c1c137.js} +44 -44
@@ -3,7 +3,7 @@
3
3
  const domContextHooks_module = require('./dom-context-hooks.module-e7b6727c.js');
4
4
  const index_module = require('./index.module-f8c8495f.js');
5
5
  const jsonpointer = require('./jsonpointer-11327262.js');
6
- const utils = require('./utils-a3b3d05b.js');
6
+ const subregions = require('./subregions-e7273457.js');
7
7
  const data = require('./data-89ac73dd.js');
8
8
  const eventKeys = require('./eventKeys-7af4df4d.js');
9
9
 
@@ -1186,7 +1186,7 @@ function useIndirectTaxForm(props) {
1186
1186
  const { data: userData, refetch, errors: userError, } = index_module.$n(data.USER_QUERY_NAMESPACE);
1187
1187
  const { data: _countriesRes, loading: countriesLoading } = index_module.$n(data.COUNTRIES_QUERY_NAMESPACE);
1188
1188
  const intlLocale = (locale === null || locale === void 0 ? void 0 : locale.replace("_", "-")) || "en";
1189
- const _countries = domContextHooks_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) => utils.getCountryObj({ countryCode: country.countryCode, locale: intlLocale })); }, [(_a = _countriesRes === null || _countriesRes === void 0 ? void 0 : _countriesRes.impactPayoutCountries) === null || _a === void 0 ? void 0 : _a.data]);
1189
+ const _countries = domContextHooks_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) => subregions.getCountryObj({ countryCode: country.countryCode, locale: intlLocale })); }, [(_a = _countriesRes === null || _countriesRes === void 0 ? void 0 : _countriesRes.impactPayoutCountries) === null || _a === void 0 ? void 0 : _a.data]);
1190
1190
  const [loading, setLoading] = domContextHooks_module.useState(false);
1191
1191
  const [formState, setFormState] = domContextHooks_module.useState({});
1192
1192
  const [errors, setErrors] = domContextHooks_module.useState({});
@@ -1291,7 +1291,7 @@ function useIndirectTaxForm(props) {
1291
1291
  }
1292
1292
  await refetch();
1293
1293
  const resultPublisher = (_g = (_f = connectionResult === null || connectionResult === void 0 ? void 0 : connectionResult.user) === null || _f === void 0 ? void 0 : _f.impactConnection) === null || _g === void 0 ? void 0 : _g.publisher;
1294
- const hasValidCurrentDocument = utils.validTaxDocument(resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.requiredTaxDocumentType) && (resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.currentTaxDocument);
1294
+ const hasValidCurrentDocument = subregions.validTaxDocument(resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.requiredTaxDocumentType) && (resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.currentTaxDocument);
1295
1295
  // Fire form change event
1296
1296
  window.dispatchEvent(new Event(eventKeys.TAX_FORM_UPDATED_EVENT_KEY));
1297
1297
  return {
@@ -1378,10 +1378,10 @@ function useIndirectTaxForm(props) {
1378
1378
  })),
1379
1379
  },
1380
1380
  data: {
1381
- esRegions: utils.INDIRECT_TAX_SPAIN_REGIONS,
1381
+ esRegions: subregions.INDIRECT_TAX_SPAIN_REGIONS,
1382
1382
  countries: filteredCountries,
1383
1383
  allCountries: _countries,
1384
- provinces: utils.INDIRECT_TAX_PROVINCES,
1384
+ provinces: subregions.INDIRECT_TAX_PROVINCES,
1385
1385
  },
1386
1386
  text: props.getTextProps(),
1387
1387
  refs: {
@@ -66,6 +66,7 @@ const style = {
66
66
  color: "var(--sqm-primary-button-color)",
67
67
  backgroundColor: "var(--sqm-primary-button-background)",
68
68
  border: "var(--sqm-primary-button-color-border)",
69
+ borderRadius: "var(--sqm-primary-button-radius)",
69
70
  },
70
71
  },
71
72
  };
@@ -48,32 +48,6 @@ export const GET_CURRENCIES = gql `
48
48
  }
49
49
  }
50
50
  `;
51
- export const CONNECT_PARTNER = gql `
52
- mutation createImpactConnection($vars: ImpactConnectionInput!) {
53
- createImpactConnection(impactConnectionInput: $vars) {
54
- success
55
- validationErrors {
56
- field
57
- message
58
- }
59
- user {
60
- id
61
- accountId
62
- impactConnection {
63
- connected
64
- publisher {
65
- brandedSignup
66
- requiredTaxDocumentType
67
- currentTaxDocument {
68
- type
69
- status
70
- }
71
- }
72
- }
73
- }
74
- }
75
- }
76
- `;
77
51
  const START_IMPACT_CONNECTION = gql `
78
52
  mutation startImpactConnection($vars: ImpactConnectionInput!) {
79
53
  startImpactConnection(impactConnectionInput: $vars) {
@@ -101,7 +75,7 @@ const START_IMPACT_CONNECTION = gql `
101
75
  }
102
76
  `;
103
77
  export function usePartnerInfoModal(props) {
104
- var _a, _b, _c, _d, _e, _f, _g;
78
+ var _a, _b, _c, _d, _e;
105
79
  const locale = useLocale();
106
80
  const setPartnerCreated = useSetParent(PARTNER_CREATED_NAMESPACE);
107
81
  const { data: userData, loading: userLoading, refetch, } = useQuery(GET_USER_PARTNER_INFO, {});
@@ -116,8 +90,20 @@ export function usePartnerInfoModal(props) {
116
90
  });
117
91
  const [startImpactConnection, { loading: connectLoading }] = useMutation(START_IMPACT_CONNECTION);
118
92
  const [allowBankingCollection, setAllowBankingCollection] = useState(false);
119
- const countries = ((_e = countriesData === null || countriesData === void 0 ? void 0 : countriesData.impactPayoutCountries) === null || _e === void 0 ? void 0 : _e.data) || [];
120
- const isExistingPartner = !!((_f = user === null || user === void 0 ? void 0 : user.impactConnection) === null || _f === void 0 ? void 0 : _f.publisher);
93
+ const countries = useMemo(() => {
94
+ var _a;
95
+ const data = (_a = countriesData === null || countriesData === void 0 ? void 0 : countriesData.impactPayoutCountries) === null || _a === void 0 ? void 0 : _a.data;
96
+ if (!data)
97
+ return [];
98
+ return [...data].sort((a, b) => {
99
+ if (a.countryCode === "US")
100
+ return -1;
101
+ if (b.countryCode === "US")
102
+ return 1;
103
+ return a.displayName.localeCompare(b.displayName);
104
+ });
105
+ }, [countriesData]);
106
+ const isExistingPartner = !!((_e = user === null || user === void 0 ? void 0 : user.impactConnection) === null || _e === void 0 ? void 0 : _e.publisher);
121
107
  const _currencies = useMemo(() => {
122
108
  var _a, _b, _c;
123
109
  // if isExistingPartner, grab all currencies since select is disabled anyways
@@ -140,7 +126,7 @@ export function usePartnerInfoModal(props) {
140
126
  const currencies = useMemo(() => [..._currencies].sort((a, b) => a.displayName.localeCompare(b.displayName)), [_currencies]);
141
127
  const [countrySearch, setCountrySearch] = useState("");
142
128
  const [currencySearch, setCurrencySearch] = useState("");
143
- const [filteredCountries, setFilteredCountries] = useState(((_g = countriesData === null || countriesData === void 0 ? void 0 : countriesData.impactPayoutCountries) === null || _g === void 0 ? void 0 : _g.data) || []);
129
+ const [filteredCountries, setFilteredCountries] = useState(countries || []);
144
130
  const [filteredCurrencies, setFilteredCurrencies] = useState(currencies || []);
145
131
  const [error, setError] = useState("");
146
132
  const [success, setSuccess] = useState(false);
@@ -243,7 +229,6 @@ export function usePartnerInfoModal(props) {
243
229
  setError(props.networkErrorText);
244
230
  }
245
231
  }
246
- console.log(impactConnection, "impactConnection in partner modal");
247
232
  const showModal = !success &&
248
233
  !userLoading &&
249
234
  (impactConnection === null || impactConnection === void 0 ? void 0 : impactConnection.connectionStatus) === "NOT_STARTED";
@@ -96,6 +96,7 @@ import * as UserName from "../sqm-user-name/UserName.stories";
96
96
  import * as WidgetCodeVerification from "../sqm-widget-verification/sqm-code-verification/WidgetCodeVerification.stories";
97
97
  import * as WidgetEmailVerification from "../sqm-widget-verification/sqm-email-verification/WidgetEmailVerification.stories";
98
98
  import * as BankingInfoForm from "../tax-and-cash/BankingForm.stories";
99
+ import * as TaxAndCashDashboardView from "../tax-and-cash/sqm-tax-and-cash-dashboard/TaxAndCashDashboardView.stories";
99
100
  import * as TaxForm from "../tax-and-cash/TaxForm.stories";
100
101
  import * as PayoutDetailsCard from "../tax-and-cash/sqm-payout-details-card/PayoutDetailsCard.stories";
101
102
  import * as PayoutStatusAlert from "../tax-and-cash/sqm-payout-status-alert/PayoutStatusAlert.stories";
@@ -221,6 +222,7 @@ const stories = [
221
222
  TaxAndCashRewardsTable,
222
223
  TaxAndCashReferralTableRewardsCell,
223
224
  TaxAndCashReferralTable,
225
+ TaxAndCashDashboardView,
224
226
  PartnerInfoModal,
225
227
  WidgetVerification,
226
228
  UserAttribute,
@@ -38,3 +38,9 @@ export const PaypalPayout = () => {
38
38
  },
39
39
  } }));
40
40
  };
41
+ export const BadgeTextICUParsing = () => {
42
+ return (h("div", { style: { display: "flex", flexDirection: "column", gap: "16px" } },
43
+ h("sqm-payout-details-card", { "status-badge-text": "{badgeText, select, payoutToday {Payout Today} nextPayout {Next Payout} other {Failed} }", demoData: { states: { badgeStatus: "nextPayout" } } }),
44
+ h("sqm-payout-details-card", { "status-badge-text": "{badgeText, select, payoutToday {Payout Today} nextPayout {Next Payout} other {Failed} }", demoData: { states: { badgeStatus: "payoutToday" } } }),
45
+ h("sqm-payout-details-card", { "status-badge-text": "{badgeText, select, payoutToday {Payout Today} nextPayout {Next Payout} other {Failed} }", demoData: { states: { badgeStatus: "error" } } })));
46
+ };
@@ -125,6 +125,14 @@ const style = {
125
125
  color: "var(--sl-color-white)",
126
126
  },
127
127
  },
128
+ DangerBadge: {
129
+ "&::part(base)": {
130
+ textAlign: "center",
131
+ whiteSpace: "pre-line",
132
+ background: "var(--sqm-danger-color-icon)",
133
+ color: "var(--sl-color-white)",
134
+ },
135
+ },
128
136
  Container: {
129
137
  display: "flex",
130
138
  flexDirection: "column",
@@ -145,8 +153,11 @@ export function PayoutDetailsCardView(props) {
145
153
  h("sqm-skeleton", { width: "25%", height: "16px" })));
146
154
  };
147
155
  const renderStatusBadge = (status, statusBadgeText) => {
148
- const badgeType = status === "nextPayout" ? "success" : "primary";
149
- const badgeClass = badgeType === "success" ? classes.SuccessBadge : classes.PrimaryBadge;
156
+ const badgeClass = status === "nextPayout"
157
+ ? classes.SuccessBadge
158
+ : status === "payoutToday"
159
+ ? classes.PrimaryBadge
160
+ : classes.DangerBadge;
150
161
  const statusText = intl.formatMessage({
151
162
  id: "badgeText",
152
163
  defaultMessage: statusBadgeText,
@@ -0,0 +1,151 @@
1
+ import { h } from "@stencil/core";
2
+ import { TaxAndCashDashboardView, } from "./sqm-tax-and-cash-dashboard-view";
3
+ import { taxTypeToName } from "../utils";
4
+ export default {
5
+ title: "Components/Tax And Cash Dashboard View",
6
+ };
7
+ const defaultText = {
8
+ statusTextActive: "Active",
9
+ statusTextNotActive: "Invalid Tax Form",
10
+ statusTextNotVerified: "Not Verified",
11
+ statusTextRequired: "Required",
12
+ requiredTaxForm: "Your payouts are on hold until you submit a {taxFormType} tax form.",
13
+ badgeTextSubmittedOn: "Submitted on {dateSubmitted}.",
14
+ badgeTextSubmittedOnW8: "Submitted on {dateSubmitted}. Valid for three years after submission.",
15
+ badgeTextAwaitingReview: "Awaiting review. Submitted on {dateSubmitted}.",
16
+ taxAlertHeaderNotActiveW9: "Your W-9 tax form has personal information that doesn't match your profile",
17
+ taxAlertHeaderNotActiveW8: "{documentType} tax form is invalid",
18
+ taxAlertNotActiveMessageW9: "Please resubmit a new {documentType} form.",
19
+ taxAlertNotActiveMessageW8: "Your tax form may have expired or has personal information that doesn't match your profile. Please submit a new {documentType} form.",
20
+ invalidForm: "Make sure your information is correct and submit new form.",
21
+ bankingInformationSectionHeader: "Payout information",
22
+ taxDocumentSectionHeader: "Tax documents",
23
+ taxDocumentSectionSubHeader: "{documentType} tax form",
24
+ taxDocumentSectionSubHeaderNoDocument: "Tax form",
25
+ indirectTaxInfoSectionHeader: "Indirect tax",
26
+ indirectTaxInfoCanada: "Registered in {province}, {country}",
27
+ indirectTaxInfoOtherCountry: "Registered in {country}",
28
+ indirectTaxInfoSpain: "Registered in {country}, {subRegion}",
29
+ indirectTaxTooltipSupport: "To make changes to your indirect tax information, please contact our {supportLink}.",
30
+ indirectTaxDetails: "{indirectTaxType} number: {indirectTaxNumber}",
31
+ newFormButton: "Submit new tax form",
32
+ editPaymentInformationButton: "Edit payout information",
33
+ notRegisteredForTax: "Not registered for indirect tax. If you've previously registered with your tax authority, contact our {supportLink} to add your information to stay tax compliant.",
34
+ qstNumber: "QST number: {qstNumber}",
35
+ subRegionTaxNumber: "Income tax number: {subRegionTaxNumber}",
36
+ invoiceColumnTitle: "Invoice",
37
+ dateColumnTitle: "Date",
38
+ earningsColumnTitle: "Earnings",
39
+ indirectTaxColumnTitle: "Indirect tax",
40
+ earningsAfterTaxColumnTitle: "Earnings after tax",
41
+ invoiceDescription: "View and download your invoices to report your earnings and stay tax compliant.",
42
+ invoicePrevLabel: "Prev",
43
+ invoiceMoreLabel: "Next",
44
+ invoiceHeader: "Invoices",
45
+ invoiceEmptyStateHeader: "View your invoice details",
46
+ invoiceEmptyStateText: "Refer a friend to view the status of your invoices and rewards earned",
47
+ payoutFromImpact: "Your balance may take up to 24 hours to update. Payouts will be sent from our referral program provider, impact.com.",
48
+ replaceTaxFormModalHeader: "Replace existing tax form",
49
+ replaceTaxFormModalBodyText: "Submitting a new tax form will remove your existing form. Make sure to sign and complete your new tax form to prevent any issues with your next payout.",
50
+ supportLink: "support team",
51
+ cancelButton: "Cancel",
52
+ payoutHoldAlertHeader: "Your payout is on hold",
53
+ payoutHoldAlertDescription: "Please contact our {supportLink} or check your inbox for an email from our referral program provider, impact.com.",
54
+ verificationRequiredHeader: "Verify your identity",
55
+ verificationRequiredDescription: "Complete your verification to start receiving your cash rewards. It should only take a few minutes verify. If you run in to an issue verifying your identity contact our {supportLink}.",
56
+ verificationRequiredButtonText: "Start Verification",
57
+ verificationRequiredInternalHeader: "Identity verification in progress",
58
+ verificationRequiredInternalDescription: "Identity verification submission has been received. Our system is currently performing additional checks and analyzing the results. You will be updated shortly. If you don't hear from us contact our {supportLink}.",
59
+ verificationReviewInternalHeader: "Identity verification under review",
60
+ verificationReviewInternalDescription: "Identity verification requires further review due to a potential error. Our team is reviewing the information and will update you shortly. If you don't hear from us contact our {supportLink}.",
61
+ verificationFailedInternalHeader: "Identity verification unsuccessful",
62
+ verificationFailedInternalDescription: "Identity verification has failed. Our team is reviewing the report and will contact you with further information. If you don't hear from us contact our {supportLink}.",
63
+ w9RequiredHeader: "Your next payout is on hold",
64
+ w9RequiredDescription: "You have surpassed the $2000 threshold requiring a W-9 form or have multiple accounts with impact.com. To remove the hold, please submit your W-9 form.",
65
+ w9RequiredButtonText: "Submit W-9",
66
+ accountReviewHeader: "Your account is under review",
67
+ 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}.",
68
+ paymentHoldOnChangeHeader: "We are reviewing your new payout settings",
69
+ paymentHoldOnChangeDescription: "Your payout is temporarily on hold while we review your new payment information, this process is usually resolved within 48 hours.",
70
+ beneficiaryNameInvalidHeader: "Your payment information does not match your tax form",
71
+ beneficiaryNameInvalidDescription: "The account holder (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.",
72
+ beneficiaryNameMismatchHeader: "Your payment information does not match your tax form",
73
+ beneficiaryNameMismatchDescription: "The account holder (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.",
74
+ bankTaxNameMismatchHeader: "Your payment information does not match your tax form",
75
+ bankTaxNameMismatchDescription: "The bank account (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.",
76
+ withdrawalSettingsInvalidHeader: "Your payment information is incomplete or includes invalid characters",
77
+ withdrawalSettingsInvalidDescription: "There are missing fields or invalid characters in your payment information. Please review your information and make sure it is correct. Your payouts are on hold until this is resolved.",
78
+ paymentReturnedHeader: "Payout unsuccessful",
79
+ paymentReturnedDescription: "Our recent payment attempt for your earnings was unsuccessful. Please review your payment information and make sure it is correct.",
80
+ termsAndConditions: "Terms and Conditions",
81
+ error: {
82
+ generalTitle: "There was a problem submitting your information",
83
+ generalDescription: "Please review your information and try again. If this problem continues, contact our {supportLink}.",
84
+ loadingErrorAlertHeader: "There was a problem loading your form",
85
+ loadingErrorAlertDescription: "Please refresh the page and try again. If this problem continues, contact our {supportLink}.",
86
+ },
87
+ };
88
+ const defaultCallbacks = {
89
+ onClick: () => { },
90
+ onVerifyClick: () => { },
91
+ onEditPayoutInfo: () => { },
92
+ onNewFormCancel: () => { },
93
+ onNewFormClick: () => { },
94
+ };
95
+ const defaultSlots = {
96
+ payoutDetailsCardSlot: (h("sqm-payout-details-card", { demoData: { states: { badgeStatus: "nextPayout" } } })),
97
+ };
98
+ const baseStates = {
99
+ payoutStatus: "DONE",
100
+ veriffLoading: false,
101
+ canEditPayoutInfo: true,
102
+ disabled: false,
103
+ status: "ACTIVE",
104
+ documentType: "W9",
105
+ documentTypeString: taxTypeToName("W9"),
106
+ dateSubmitted: "Jan 18th, 2025",
107
+ noFormNeeded: false,
108
+ country: "United States",
109
+ indirectTaxType: "VAT",
110
+ indirectTaxNumber: "123456",
111
+ showNewFormDialog: false,
112
+ hasHold: false,
113
+ loading: false,
114
+ loadingError: false,
115
+ };
116
+ // Stories not covered by TaxForm.stories.tsx (which uses sqm-tax-and-cash-dashboard WC)
117
+ // ─── Base ─────────────────────────────────────────────────────────────────────
118
+ export const ActiveW9Form = () => (h(TaxAndCashDashboardView, { states: baseStates, text: defaultText, callbacks: defaultCallbacks, slots: defaultSlots }));
119
+ export const TaxFormRequired = () => (h(TaxAndCashDashboardView, { states: {
120
+ ...baseStates,
121
+ status: undefined,
122
+ documentType: "W9",
123
+ documentTypeString: taxTypeToName("W9"),
124
+ noFormNeeded: false,
125
+ }, text: defaultText, callbacks: defaultCallbacks, slots: defaultSlots }));
126
+ // ─── Payout hold statuses not in TaxForm.stories.tsx ─────────────────────────
127
+ export const AccountUnderReview = () => (h(TaxAndCashDashboardView, { states: { ...baseStates, payoutStatus: "NEW_PAYEE_REVIEW" }, text: defaultText, callbacks: defaultCallbacks, slots: defaultSlots }));
128
+ export const PaymentHoldOnChange = () => (h(TaxAndCashDashboardView, { states: { ...baseStates, payoutStatus: "PAYMENT_HOLD_ON_CHANGE" }, text: defaultText, callbacks: defaultCallbacks, slots: defaultSlots }));
129
+ export const BeneficiaryNameInvalid = () => (h(TaxAndCashDashboardView, { states: { ...baseStates, payoutStatus: "BENEFICIARY_NAME_INVALID" }, text: defaultText, callbacks: defaultCallbacks, slots: defaultSlots }));
130
+ export const BeneficiaryNameMismatch = () => (h(TaxAndCashDashboardView, { states: { ...baseStates, payoutStatus: "BENEFICIARY_NAME_MISMATCH" }, text: defaultText, callbacks: defaultCallbacks, slots: defaultSlots }));
131
+ export const BankTaxNameMismatch = () => (h(TaxAndCashDashboardView, { states: { ...baseStates, payoutStatus: "BANK_TAX_NAME_MISMATCH" }, text: defaultText, callbacks: defaultCallbacks, slots: defaultSlots }));
132
+ export const WithdrawalSettingsInvalid = () => (h(TaxAndCashDashboardView, { states: { ...baseStates, payoutStatus: "WITHDRAWAL_SETTINGS_INVALID" }, text: defaultText, callbacks: defaultCallbacks, slots: defaultSlots }));
133
+ export const PaymentReturned = () => (h(TaxAndCashDashboardView, { states: { ...baseStates, payoutStatus: "PAYMENT_RETURNED" }, text: defaultText, callbacks: defaultCallbacks, slots: defaultSlots }));
134
+ export const W9ThresholdReachedHardBlock = () => (h(TaxAndCashDashboardView, { states: {
135
+ ...baseStates,
136
+ payoutStatus: "OVER_W9_THRESHOLD",
137
+ enforceUsTaxComplianceOption: "HARD_BLOCK",
138
+ status: undefined,
139
+ }, text: defaultText, callbacks: defaultCallbacks, slots: defaultSlots }));
140
+ // ─── Verification loading state ───────────────────────────────────────────────
141
+ export const VerificationRequiredLoading = () => (h(TaxAndCashDashboardView, { states: {
142
+ ...baseStates,
143
+ payoutStatus: "VERIFICATION:REQUIRED",
144
+ veriffLoading: true,
145
+ notRegistered: true,
146
+ }, text: defaultText, callbacks: defaultCallbacks, slots: defaultSlots }));
147
+ // ─── Loading and error states ─────────────────────────────────────────────────
148
+ export const Loading = () => (h(TaxAndCashDashboardView, { states: { ...baseStates, loading: true }, text: defaultText, callbacks: defaultCallbacks, slots: defaultSlots }));
149
+ export const LoadingError = () => (h(TaxAndCashDashboardView, { states: { ...baseStates, loadingError: true }, text: defaultText, callbacks: defaultCallbacks, slots: defaultSlots }));
150
+ export const GeneralError = () => (h(TaxAndCashDashboardView, { states: { ...baseStates, errors: { general: true } }, text: defaultText, callbacks: defaultCallbacks, slots: defaultSlots }));
151
+ export const Disabled = () => (h(TaxAndCashDashboardView, { states: { ...baseStates, disabled: true }, text: defaultText, callbacks: defaultCallbacks, slots: defaultSlots }));