@saasquatch/mint-components 2.0.0-3 → 2.0.0-31

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 (62) hide show
  1. package/dist/cjs/{ShadowViewAddon-23b04c91.js → ShadowViewAddon-016bebfd.js} +1 -1
  2. package/dist/cjs/loader.cjs.js +1 -1
  3. package/dist/cjs/mint-components.cjs.js +1 -1
  4. package/dist/cjs/sqm-banking-info-form_10.cjs.entry.js +10 -4
  5. package/dist/cjs/sqm-big-stat_46.cjs.entry.js +17 -45
  6. package/dist/cjs/sqm-empty_4.cjs.entry.js +1 -1
  7. package/dist/cjs/{sqm-portal-container-view-07e4343f.js → sqm-portal-container-view-ca86b9e5.js} +1 -1
  8. package/dist/cjs/sqm-stencilbook.cjs.entry.js +6 -5
  9. package/dist/cjs/sqm-tax-and-cash-dashboard.cjs.entry.js +1059 -0
  10. package/dist/collection/components/sqm-hero/sqm-hero.js +1 -9
  11. package/dist/collection/components/sqm-portal-container/sqm-portal-container-view.js +1 -1
  12. package/dist/collection/components/sqm-portal-footer/sqm-portal-footer.js +1 -1
  13. package/dist/collection/components/sqm-reward-exchange-list/sqm-reward-exchange-list.js +1 -34
  14. package/dist/collection/components/sqm-titled-section/sqm-titled-section.js +1 -1
  15. package/dist/collection/components/tax-and-cash/TaxForm.stories.js +4 -3
  16. package/dist/collection/components/tax-and-cash/sqm-payout-status-alert/sqm-payout-status-alert.js +48 -2
  17. package/dist/collection/components/tax-and-cash/sqm-tax-and-cash-dashboard/sqm-tax-and-cash-dashboard.js +11 -5
  18. package/dist/esm/{ShadowViewAddon-c0bd62f7.js → ShadowViewAddon-4cde160a.js} +1 -1
  19. package/dist/esm/loader.js +1 -1
  20. package/dist/esm/mint-components.js +1 -1
  21. package/dist/esm/sqm-banking-info-form_10.entry.js +10 -4
  22. package/dist/esm/sqm-big-stat_46.entry.js +17 -45
  23. package/dist/esm/sqm-empty_4.entry.js +1 -1
  24. package/dist/esm/{sqm-portal-container-view-176e92e3.js → sqm-portal-container-view-16309b22.js} +1 -1
  25. package/dist/esm/sqm-stencilbook.entry.js +6 -5
  26. package/dist/esm/sqm-tax-and-cash-dashboard.entry.js +1055 -0
  27. package/dist/esm-es5/{ShadowViewAddon-c0bd62f7.js → ShadowViewAddon-4cde160a.js} +1 -1
  28. package/dist/esm-es5/loader.js +1 -1
  29. package/dist/esm-es5/mint-components.js +1 -1
  30. package/dist/esm-es5/sqm-banking-info-form_10.entry.js +1 -1
  31. package/dist/esm-es5/sqm-big-stat_46.entry.js +1 -1
  32. package/dist/esm-es5/sqm-empty_4.entry.js +1 -1
  33. package/dist/esm-es5/{sqm-portal-container-view-176e92e3.js → sqm-portal-container-view-16309b22.js} +1 -1
  34. package/dist/esm-es5/sqm-stencilbook.entry.js +1 -1
  35. package/dist/mint-components/mint-components.esm.js +1 -1
  36. package/dist/mint-components/{p-9580aac3.js → p-1fa9ef02.js} +1 -1
  37. package/dist/mint-components/{p-b8d3fb57.entry.js → p-38263521.entry.js} +12 -12
  38. package/dist/mint-components/{p-76d4ef41.entry.js → p-3bf5cd51.entry.js} +1 -1
  39. package/dist/mint-components/{p-a38dd63f.system.entry.js → p-3ea29bac.system.entry.js} +1 -1
  40. package/dist/mint-components/{p-7d735c9c.js → p-4ffc5bce.js} +1 -1
  41. package/dist/mint-components/p-69308e0d.system.entry.js +1 -0
  42. package/dist/mint-components/p-69d8b4f2.system.entry.js +1 -0
  43. package/dist/mint-components/p-92bed2ad.system.js +1 -0
  44. package/dist/mint-components/p-967a9040.system.js +1 -1
  45. package/dist/mint-components/{p-35081b0c.system.entry.js → p-9fed62f8.system.entry.js} +1 -1
  46. package/dist/mint-components/p-bfac0290.entry.js +99 -0
  47. package/dist/mint-components/{p-bb452830.system.js → p-c62b277d.system.js} +1 -1
  48. package/dist/mint-components/{p-f860e7f1.entry.js → p-e110688b.entry.js} +2 -2
  49. package/dist/mint-components/sqm-tax-and-cash-dashboard.entry.js +1055 -0
  50. package/dist/types/components/sqm-portal-footer/sqm-portal-footer.d.ts +1 -1
  51. package/dist/types/components/sqm-titled-section/sqm-titled-section.d.ts +1 -1
  52. package/dist/types/components/tax-and-cash/sqm-payout-status-alert/sqm-payout-status-alert.d.ts +8 -0
  53. package/dist/types/components/tax-and-cash/sqm-tax-and-cash-dashboard/sqm-tax-and-cash-dashboard.d.ts +1 -1
  54. package/dist/types/components.d.ts +18 -2
  55. package/docs/docs.docx +0 -0
  56. package/docs/raisins.json +1 -1
  57. package/grapesjs/grapesjs.js +1 -1
  58. package/package.json +1 -1
  59. package/dist/mint-components/p-13e66b37.system.entry.js +0 -1
  60. package/dist/mint-components/p-a0730259.entry.js +0 -99
  61. package/dist/mint-components/p-a6f4fb03.system.js +0 -1
  62. package/dist/mint-components/p-c5fea579.system.entry.js +0 -1
@@ -0,0 +1,1055 @@
1
+ import { h, r as registerInstance, i as Host } from './index-bfb7f924.js';
2
+ import { i as intl } from './global-b1d291bf.js';
3
+ import { i as useState, j as useEffect, o as h$1 } from './dom-context-hooks.module-01c1b885.js';
4
+ import { d as dist, q as En, w as wn, L, x as $n, i as isDemo } from './index.module-83586215.js';
5
+ import './GoogleFonts-e3a7f82a.js';
6
+ import './jss-preset-default.esm-c36417f8.js';
7
+ import { c as createStyleSheet } from './JSS-8c381d8b.js';
8
+ import { g as getProps } from './utils-643261a0.js';
9
+ import { c as cjs } from './cjs-e829b75b.js';
10
+ import { l as luxon } from './luxon-58a4306e.js';
11
+ import { a as INDIRECT_TAX_PROVINCES, I as INDIRECT_TAX_SPAIN_REGIONS } from './subregions-ae091902.js';
12
+ import { t as taxTypeToName } from './utils-97fcb89a.js';
13
+ import { v as vatLabels } from './countries-1d6f807a.js';
14
+ import { p as parseStates } from './parseStates-ed75e224.js';
15
+ import { T as TAX_CONTEXT_NAMESPACE, a as TAX_FORM_CONTEXT_NAMESPACE, c as USER_QUERY_NAMESPACE } from './data-7ce5b518.js';
16
+ import './eventKeys-f76b6a03.js';
17
+ import { a as useVeriffApp, g as getStatus, V as VERIFF_COMPLETE_EVENT_KEY } from './usePayoutStatus-4bc60adb.js';
18
+
19
+ const style = {
20
+ ErrorAlertContainer: {
21
+ "&::part(base)": {
22
+ backgroundColor: "var(--sl-color-red-100)",
23
+ borderTop: "none",
24
+ },
25
+ "& sl-icon::part(base)": {
26
+ color: "var(--sl-color-danger-500)",
27
+ },
28
+ },
29
+ WarningAlertContainer: {
30
+ "&::part(base)": {
31
+ backgroundColor: "var(--sl-color-yellow-100)",
32
+ borderTop: "none",
33
+ maxWidth: "600px",
34
+ },
35
+ "& sl-icon::part(base)": {
36
+ color: "var(--sl-color-warning-500)",
37
+ },
38
+ },
39
+ WarningHoldAlertContainer: {
40
+ marginLeft: "-20px",
41
+ "&::part(base)": {
42
+ maxWidth: "850px",
43
+ border: "none",
44
+ backgroundColor: "transparent",
45
+ },
46
+ "& sl-icon::part(base)": {
47
+ color: "var(--sl-color-warning-500)",
48
+ },
49
+ },
50
+ ErrorHoldAlertContainer: {
51
+ marginLeft: "-20px",
52
+ "&::part(base)": {
53
+ maxWidth: "850px",
54
+ border: "none",
55
+ backgroundColor: "transparent",
56
+ },
57
+ "& sl-icon::part(base)": {
58
+ color: "var(--sl-color-danger-500)",
59
+ },
60
+ },
61
+ ExpiringSoonAlertContainer: {
62
+ "&::part(base)": {
63
+ backgroundColor: "var(--sl-color-yellow-100)",
64
+ borderTop: "none",
65
+ },
66
+ },
67
+ BankingInformationContainer: {
68
+ maxWidth: "700px",
69
+ },
70
+ IndirectTaxPreviewContainer: {
71
+ marginTop: "var(--sl-spacing-x-large)",
72
+ borderTop: "1px solid var(--sl-color-neutral-200)",
73
+ },
74
+ IndirectTaxPreviewHeaderContainer: {
75
+ marginTop: "var(--sl-spacing-large)",
76
+ marginBottom: "var(--sl-spacing-xx-small)",
77
+ margin: "0",
78
+ display: "flex",
79
+ gap: "var(--sl-spacing-x-small)",
80
+ "&::part(base)": {
81
+ color: "var(--sl-color-green-500)",
82
+ },
83
+ },
84
+ IndirectTaxPreviewDetails: {
85
+ gap: "var(--sl-spacing-x-small)",
86
+ display: "flex",
87
+ flexDirection: "column",
88
+ lineHeight: "var(--sl-spacing-medium)",
89
+ fontSize: "var(--sl-font-size-small)",
90
+ },
91
+ InvoiceTableContainer: {
92
+ marginTop: "var(--sl-spacing-medium)",
93
+ },
94
+ NotRegisteredIndirectTaxText: {
95
+ color: "var(--sl-color-gray-500)",
96
+ },
97
+ TaxDocumentsContainer: {
98
+ marginTop: "var(--sl-spacing-xx-large)",
99
+ borderTop: "1px solid var(--sl-color-neutral-200)",
100
+ },
101
+ TaxDocumentsSectionHeaderContainer: {
102
+ marginTop: "var(--sl-spacing-x-large)",
103
+ marginBottom: "var(--sl-spacing-xx-small)",
104
+ },
105
+ StatusContainer: {
106
+ marginTop: "var(--sl-spacing-x-large)",
107
+ display: "flex",
108
+ flexDirection: "column",
109
+ gap: "var(--sl-spacing-x-small)",
110
+ "& h3": {
111
+ margin: "0",
112
+ },
113
+ "& p": {
114
+ margin: "0",
115
+ paddingTop: "2px",
116
+ color: "var(--sl-color-gray-500)",
117
+ },
118
+ },
119
+ StatusAlert: {
120
+ fontSize: "var(--sl-font-size-small)",
121
+ },
122
+ TaxFormDetailsContainer: {
123
+ display: "flex",
124
+ gap: "var(--sl-spacing-small)",
125
+ alignItems: "center",
126
+ },
127
+ NewFormButton: {
128
+ marginTop: "var(--sl-spacing-large)",
129
+ maxWidth: "300px",
130
+ },
131
+ EditBankDetailsButton: {
132
+ marginTop: "var(--sl-spacing-large)",
133
+ },
134
+ SkeletonOne: {
135
+ width: "15%",
136
+ height: "10px",
137
+ },
138
+ SkeletonTwo: {
139
+ width: "25%",
140
+ height: "24px",
141
+ top: "var(--sl-spacing-small)",
142
+ marginBottom: "var(--sl-spacing-x-small)",
143
+ },
144
+ TaxSectionSkeletonContainer: {
145
+ display: "flex",
146
+ flexDirection: "column",
147
+ marginTop: "var(--sl-spacing-x-large)",
148
+ },
149
+ TaxDocSubtext: {
150
+ margin: "0",
151
+ color: "var(--sl-color-neutral-500)",
152
+ lineHeight: "var(--sl-spacing-medium)",
153
+ fontSize: "var(--sl-font-size-small)",
154
+ marginLeft: "1px",
155
+ },
156
+ TooltipContainer: {
157
+ display: "flex",
158
+ textAlign: "center",
159
+ width: "250px",
160
+ },
161
+ ToolTip: {
162
+ top: "6px",
163
+ width: "16px",
164
+ height: "16px",
165
+ },
166
+ TaxNumberContainer: {
167
+ display: "flex",
168
+ flexDirection: "column",
169
+ gap: "6px",
170
+ },
171
+ DescriptionText: {
172
+ color: "var(--sl-color-gray-500)",
173
+ fontSize: "var(--sl-font-size-x-small)",
174
+ marginBottom: "none",
175
+ maxWidth: "492px",
176
+ },
177
+ PageDescriptionText: {
178
+ color: "var(--sl-color-neutral-500)",
179
+ fontSize: "var(--sl-font-size-medium)",
180
+ marginTop: "0",
181
+ },
182
+ Dialog: {
183
+ "&::part(panel)": {
184
+ maxWidth: "420px",
185
+ },
186
+ "&::part(close-button)": {
187
+ marginBottom: "var(--sl-spacing-xx-large)",
188
+ },
189
+ "&::part(title)": {
190
+ fontSize: "var(--sl-font-size-x-large)",
191
+ fontWeight: "600",
192
+ marginTop: "var(--sl-spacing-xxx-large)",
193
+ padding: "var(--sl-spacing-x-large) var(--sl-spacing-x-large) 0 var(--sl-spacing-x-large)",
194
+ },
195
+ "&::part(body)": {
196
+ padding: "0 var(--sl-spacing-x-large) 0 var(--sl-spacing-x-large)",
197
+ fontSize: "var(--sl-font-size-small)",
198
+ },
199
+ "&::part(footer)": {
200
+ display: "flex",
201
+ flexDirection: "column",
202
+ gap: "var(--sl-spacing-small)",
203
+ marginBottom: "var(--sl-spacing-xx-small)",
204
+ alignItems: "center",
205
+ flex: "1",
206
+ },
207
+ },
208
+ DialogButton: { margin: "auto", width: "100%" },
209
+ };
210
+ const sheet = createStyleSheet(style);
211
+ const styleString = sheet.toString();
212
+ const TaxAndCashDashboardView = (props) => {
213
+ var _a;
214
+ const { states, text, callbacks, slots } = props;
215
+ function getAlert(status) {
216
+ switch (status) {
217
+ case "OVER_W9_THRESHOLD":
218
+ if (states.enforceUsTaxComplianceOption === "CASH_ONLY_DEFER_W9") {
219
+ return {
220
+ header: text.w9RequiredHeader,
221
+ description: intl.formatMessage({
222
+ id: "w9RequiredDescription",
223
+ defaultMessage: text.w9RequiredDescription,
224
+ }, {
225
+ termsAndConditions: (h("a", { target: "_blank", href: `https://terms.advocate.impact.com/PayoutTermsAndConditions.html` }, text.termsAndConditions)),
226
+ }),
227
+ button: (h("sl-button", { style: { marginTop: "var(--sl-spacing-x-small)" }, type: "default", onClick: callbacks.onNewFormClick }, text.w9RequiredButtonText)),
228
+ alertType: "info",
229
+ icon: "info-circle",
230
+ class: sheet.classes.WarningHoldAlertContainer,
231
+ };
232
+ }
233
+ else {
234
+ return {
235
+ header: text.payoutHoldAlertHeader,
236
+ description: intl.formatMessage({
237
+ id: "payoutHoldAlertDescription",
238
+ defaultMessage: text.payoutHoldAlertDescription,
239
+ }, {
240
+ supportLink: (h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
241
+ }),
242
+ buttonText: null,
243
+ alertType: "warning",
244
+ icon: "exclamation-triangle",
245
+ class: sheet.classes.WarningHoldAlertContainer,
246
+ };
247
+ }
248
+ case "VERIFICATION:REQUIRED":
249
+ return {
250
+ header: text.verificationRequiredHeader,
251
+ description: intl.formatMessage({
252
+ id: "verificationRequiredDescription",
253
+ defaultMessage: text.verificationRequiredDescription,
254
+ }, {
255
+ supportLink: (h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
256
+ }),
257
+ buttonText: text.verificationRequiredButtonText,
258
+ alertType: "warning",
259
+ icon: "exclamation-triangle",
260
+ class: sheet.classes.WarningHoldAlertContainer,
261
+ };
262
+ case "VERIFICATION:INTERNAL":
263
+ return {
264
+ header: text.verificationRequiredInternalHeader,
265
+ description: intl.formatMessage({
266
+ id: "verificationRequiredInternalDescription",
267
+ defaultMessage: text.verificationRequiredInternalDescription,
268
+ }, {
269
+ supportLink: (h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
270
+ }),
271
+ alertType: "warning",
272
+ icon: "exclamation-triangle",
273
+ class: sheet.classes.WarningHoldAlertContainer,
274
+ };
275
+ case "VERIFICATION:REVIEW":
276
+ return {
277
+ header: text.verificationReviewInternalHeader,
278
+ description: intl.formatMessage({
279
+ id: "verificationReviewInternalDescription",
280
+ defaultMessage: text.verificationReviewInternalDescription,
281
+ }, {
282
+ supportLink: (h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
283
+ }),
284
+ alertType: "warning",
285
+ icon: "exclamation-triangle",
286
+ class: sheet.classes.WarningHoldAlertContainer,
287
+ };
288
+ case "VERIFICATION:FAILED":
289
+ return {
290
+ header: text.verificationFailedInternalHeader,
291
+ description: intl.formatMessage({
292
+ id: "verificationFailedInternalDescription",
293
+ defaultMessage: text.verificationFailedInternalDescription,
294
+ }, {
295
+ supportLink: (h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
296
+ }),
297
+ alertType: "error",
298
+ icon: "exclamation-octagon",
299
+ class: sheet.classes.ErrorHoldAlertContainer,
300
+ };
301
+ case "ACCOUNT_REVIEW":
302
+ return {
303
+ header: text.accountReviewHeader,
304
+ description: intl.formatMessage({
305
+ id: "accountReviewDescription",
306
+ defaultMessage: text.accountReviewDescription,
307
+ }, {
308
+ supportLink: (h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
309
+ }),
310
+ buttonText: null,
311
+ alertType: "warning",
312
+ icon: "exclamation-triangle",
313
+ class: sheet.classes.WarningHoldAlertContainer,
314
+ };
315
+ case "HOLD":
316
+ return {
317
+ header: text.payoutHoldAlertHeader,
318
+ description: intl.formatMessage({
319
+ id: "payoutHoldAlertDescription",
320
+ defaultMessage: text.payoutHoldAlertDescription,
321
+ }, {
322
+ supportLink: (h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
323
+ }),
324
+ buttonText: null,
325
+ alertType: "warning",
326
+ icon: "exclamation-triangle",
327
+ class: sheet.classes.WarningHoldAlertContainer,
328
+ };
329
+ default:
330
+ return;
331
+ }
332
+ }
333
+ const statusMap = {
334
+ NOT_VERIFIED: (h("div", { class: sheet.classes.TaxFormDetailsContainer },
335
+ h("sl-badge", { type: "warning", pill: true }, text.statusTextNotVerified),
336
+ h("p", null, intl.formatMessage({
337
+ id: `badgeTextAwaitingReview`,
338
+ defaultMessage: text.badgeTextAwaitingReview,
339
+ }, {
340
+ dateSubmitted: states.dateSubmitted,
341
+ })))),
342
+ ACTIVE: (h("div", { class: sheet.classes.TaxFormDetailsContainer },
343
+ h("sl-badge", { type: "success", pill: true }, text.statusTextActive),
344
+ h("p", null, intl.formatMessage({
345
+ id: `badgeTextSubmittedOn`,
346
+ defaultMessage: states.documentType === "W9"
347
+ ? text.badgeTextSubmittedOn
348
+ : text.badgeTextSubmittedOnW8,
349
+ }, {
350
+ dateSubmitted: states.dateSubmitted,
351
+ })))),
352
+ INACTIVE: (h("div", { class: sheet.classes.TaxFormDetailsContainer },
353
+ h("sl-badge", { type: "danger", pill: true }, text.statusTextNotActive),
354
+ h("p", null, text.invalidForm))),
355
+ undefined: (h("div", { class: sheet.classes.TaxFormDetailsContainer },
356
+ h("sl-badge", { type: "danger", pill: true }, text.statusTextRequired),
357
+ h("p", null, intl.formatMessage({
358
+ id: `requiredTaxForm`,
359
+ defaultMessage: text.requiredTaxForm,
360
+ }, {
361
+ taxFormType: states.documentType,
362
+ })))),
363
+ };
364
+ const alertMap = {
365
+ INACTIVE: (h("sl-alert", { exportparts: "base: alert-base, icon:alert-icon", type: "danger", open: true },
366
+ h("sl-icon", { slot: "icon", name: "exclamation-octagon" }),
367
+ h("strong", null, intl.formatMessage({
368
+ id: `taxAlertHeaderNotActive`,
369
+ defaultMessage: states.documentType === "W9"
370
+ ? text.taxAlertHeaderNotActiveW9
371
+ : text.taxAlertHeaderNotActiveW8,
372
+ }, {
373
+ documentType: states.documentTypeString,
374
+ })),
375
+ h("br", null),
376
+ intl.formatMessage({
377
+ id: `taxAlertMessage`,
378
+ defaultMessage: states.documentType === "W9"
379
+ ? text.taxAlertNotActiveMessageW9
380
+ : text.taxAlertNotActiveMessageW8,
381
+ }, {
382
+ documentType: states.documentTypeString,
383
+ }))),
384
+ };
385
+ const getIndirectTaxRegisteredIn = () => {
386
+ if (states.province) {
387
+ return intl.formatMessage({
388
+ id: `indirectTaxInfoCanada`,
389
+ defaultMessage: text.indirectTaxInfoCanada,
390
+ }, {
391
+ country: "Canada",
392
+ province: states.province,
393
+ });
394
+ }
395
+ else if (states.subRegion) {
396
+ return intl.formatMessage({
397
+ id: `indirectTaxInfoSpain`,
398
+ defaultMessage: text.indirectTaxInfoSpain,
399
+ }, {
400
+ country: states.country,
401
+ subRegion: states.subRegion,
402
+ });
403
+ }
404
+ else {
405
+ return intl.formatMessage({
406
+ id: `indirectTaxInfoOtherCountry`,
407
+ defaultMessage: text.indirectTaxInfoOtherCountry,
408
+ }, {
409
+ country: states.country,
410
+ });
411
+ }
412
+ };
413
+ const alertInfo = getAlert(states.payoutStatus);
414
+ return (h("div", null,
415
+ h("div", null,
416
+ h("style", { type: "text/css" }, styleString),
417
+ states.loadingError && (h("div", null,
418
+ h("sl-alert", { exportparts: "base: alert-base, icon:alert-icon", type: "danger", open: true },
419
+ h("sl-icon", { slot: "icon", name: "exclamation-octagon" }),
420
+ h("strong", null, text.error.loadingErrorAlertHeader),
421
+ h("br", null),
422
+ intl.formatMessage({
423
+ id: "loadingErrorAlertDescription",
424
+ defaultMessage: text.error.loadingErrorAlertDescription,
425
+ }, {
426
+ supportLink: (h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
427
+ })))),
428
+ ((_a = states.errors) === null || _a === void 0 ? void 0 : _a.general) && (h("sl-alert", { exportparts: "base: alert-base, icon:alert-icon", type: "danger", open: true, class: sheet.classes.ErrorAlertContainer },
429
+ h("sl-icon", { slot: "icon", name: "exclamation-octagon" }),
430
+ h("strong", null, text.error.generalTitle),
431
+ h("br", null),
432
+ intl.formatMessage({
433
+ id: "generalDescription",
434
+ defaultMessage: text.error.generalDescription,
435
+ }, {
436
+ supportLink: (h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
437
+ }))),
438
+ alertInfo && (h("sl-alert", { exportparts: "base: alert-base, icon:alert-icon", name: alertInfo === null || alertInfo === void 0 ? void 0 : alertInfo.alertType, open: true, class: alertInfo === null || alertInfo === void 0 ? void 0 : alertInfo.class },
439
+ h("sl-icon", { slot: "icon", name: alertInfo === null || alertInfo === void 0 ? void 0 : alertInfo.icon }),
440
+ h("strong", null, alertInfo.header),
441
+ h("p", { style: { margin: "0" } }, alertInfo.description),
442
+ alertInfo.buttonText && (h("sl-button", { style: { marginTop: "var(--sl-spacing-x-small)" }, type: "default", loading: states.veriffLoading, onClick: () => callbacks.onVerifyClick() }, alertInfo.buttonText)),
443
+ alertInfo.button ? (alertInfo.button) : (h("div", { style: { display: "none" } })))),
444
+ h("sl-dialog", { label: text.replaceTaxFormModalHeader, class: sheet.classes.Dialog, open: states.showNewFormDialog, "onSl-hide": callbacks.onNewFormCancel },
445
+ h("p", null, text.replaceTaxFormModalBodyText),
446
+ h("sl-button", { slot: "footer", type: "primary", class: sheet.classes.DialogButton, onClick: callbacks.onNewFormClick }, text.newFormButton),
447
+ h("sl-button", { slot: "footer", type: "default", class: sheet.classes.DialogButton, onClick: callbacks.onNewFormCancel }, text.cancelButton)),
448
+ states.status === "INACTIVE" && alertMap[states.status],
449
+ h("div", null,
450
+ h("h3", { style: { marginBottom: "0" } }, text.bankingInformationSectionHeader),
451
+ h("div", { class: sheet.classes.BankingInformationContainer },
452
+ slots.payoutDetailsCardSlot,
453
+ !states.loading && (h("p", { class: sheet.classes.DescriptionText }, text.payoutFromImpact)),
454
+ states.canEditPayoutInfo && (h("sl-button", { disabled: states.disabled || states.loading, type: "default", class: sheet.classes.EditBankDetailsButton, onClick: callbacks.onEditPayoutInfo }, text.editPaymentInformationButton)))),
455
+ (!states.noFormNeeded || states.status === "NOT_VERIFIED") && (h("div", { class: sheet.classes.TaxDocumentsContainer },
456
+ h("div", null, states.loading ? (h("div", { class: sheet.classes.TaxSectionSkeletonContainer },
457
+ h("sl-skeleton", { class: sheet.classes.SkeletonOne }),
458
+ h("sl-skeleton", { class: sheet.classes.SkeletonTwo }))) : (h("div", null,
459
+ h("div", null,
460
+ h("span", { class: sheet.classes.TaxFormDetailsContainer },
461
+ h("div", { class: sheet.classes.StatusContainer },
462
+ h("h3", null, intl.formatMessage({
463
+ id: "section-subheader",
464
+ defaultMessage: text.taxDocumentSectionSubHeader,
465
+ }, {
466
+ documentType: states.documentTypeString || "W-9",
467
+ })),
468
+ h("span", { class: sheet.classes.StatusAlert }, statusMap[states.status]))),
469
+ states.noFormNeeded &&
470
+ 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)))))))),
471
+ h("div", { class: sheet.classes.IndirectTaxPreviewContainer }, states.loading ? (h("div", { class: sheet.classes.TaxSectionSkeletonContainer },
472
+ h("sl-skeleton", { class: sheet.classes.SkeletonOne }),
473
+ h("sl-skeleton", { class: sheet.classes.SkeletonTwo }))) : (h("div", null,
474
+ h("h3", { class: sheet.classes.IndirectTaxPreviewHeaderContainer },
475
+ text.indirectTaxInfoSectionHeader,
476
+ h("sl-tooltip", { trigger: "hover", placement: "right", content: text.indirectTaxTooltipSupport, class: sheet.classes.TooltipContainer },
477
+ h("sl-icon", { name: "info-circle", class: sheet.classes.ToolTip }))),
478
+ h("div", { class: sheet.classes.IndirectTaxPreviewDetails },
479
+ h("span", null, states.notRegistered ? (h("span", { class: sheet.classes.NotRegisteredIndirectTaxText }, intl.formatMessage({
480
+ id: "notRegisteredForTax",
481
+ defaultMessage: text.notRegisteredForTax,
482
+ }, {
483
+ supportLink: (h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
484
+ }))) : (getIndirectTaxRegisteredIn())),
485
+ !states.notRegistered && (h("div", { class: sheet.classes.TaxNumberContainer },
486
+ h("span", null, intl.formatMessage({
487
+ id: `indirectTaxDetails`,
488
+ defaultMessage: text.indirectTaxDetails,
489
+ }, {
490
+ indirectTaxType: states.indirectTaxType,
491
+ indirectTaxNumber: states.indirectTaxNumber,
492
+ })),
493
+ h("span", null,
494
+ states.qstNumber &&
495
+ intl.formatMessage({
496
+ id: `qstNumber`,
497
+ defaultMessage: text.qstNumber,
498
+ }, {
499
+ qstNumber: states.qstNumber,
500
+ }),
501
+ states.subRegionTaxNumber &&
502
+ intl.formatMessage({
503
+ id: `subRegionTaxNumber`,
504
+ defaultMessage: text.subRegionTaxNumber,
505
+ }, {
506
+ subRegionTaxNumber: states.subRegionTaxNumber,
507
+ })))),
508
+ !states.notRegistered && (h("div", { class: sheet.classes.InvoiceTableContainer },
509
+ h("sqm-invoice-table", { description: text.invoiceDescription, "prev-label": text.invoicePrevLabel, "more-label": text.invoiceMoreLabel, header: text.invoiceHeader, "empty-state-header": text.invoiceEmptyStateHeader, "empty-state-text": text.invoiceEmptyStateText },
510
+ h("sqm-invoice-table-download-column", null),
511
+ h("sqm-invoice-table-date-column", { "column-title": text.dateColumnTitle }),
512
+ h("sqm-invoice-table-data-column", { "column-title": text.invoiceColumnTitle, property: "invoiceId" }),
513
+ h("sqm-invoice-table-data-column", { "column-title": text.earningsColumnTitle, property: "earnings" }),
514
+ h("sqm-invoice-table-data-column", { "column-title": text.indirectTaxColumnTitle, property: "indirectTax" }),
515
+ h("sqm-invoice-table-data-column", { "column-title": text.earningsAfterTaxColumnTitle, property: "netEarnings" })))))))))));
516
+ };
517
+
518
+ const GET_TAX_SETTING = dist.gql `
519
+ query getTenantSettings {
520
+ tenantSettings {
521
+ enforceUsTaxCompliance
522
+ }
523
+ }
524
+ `;
525
+ function getCountryName(countryCode, locale) {
526
+ if (!countryCode)
527
+ return undefined;
528
+ // @ts-ignore: DisplayNames exists on Intl
529
+ return new Intl.DisplayNames([(locale === null || locale === void 0 ? void 0 : locale.replace("_", "-")) || "en-US"], {
530
+ type: "region",
531
+ }).of([countryCode]);
532
+ }
533
+ function getSubRegionName(regionCode) {
534
+ var _a;
535
+ if (!regionCode)
536
+ return "";
537
+ // Impact adds an underscore to some regions
538
+ const standardCode = regionCode.replace("_", "");
539
+ const regions = [...INDIRECT_TAX_PROVINCES, ...INDIRECT_TAX_SPAIN_REGIONS];
540
+ return (_a = regions.find((r) => r.regionCode === standardCode)) === null || _a === void 0 ? void 0 : _a.displayName;
541
+ }
542
+ function getIndirectTaxType(taxInformation) {
543
+ var _a;
544
+ const regions = [...INDIRECT_TAX_PROVINCES, ...INDIRECT_TAX_SPAIN_REGIONS];
545
+ if (taxInformation === null || taxInformation === void 0 ? void 0 : taxInformation.indirectTaxRegion) {
546
+ const standardRegion = taxInformation.indirectTaxRegion.replace("_", "");
547
+ const taxType = (_a = regions.find((r) => r.regionCode === standardRegion)) === null || _a === void 0 ? void 0 : _a.taxType;
548
+ if (taxType)
549
+ return taxType;
550
+ }
551
+ // Spain regions only have VAT type
552
+ if (taxInformation === null || taxInformation === void 0 ? void 0 : taxInformation.withholdingTaxCountryCode)
553
+ return "VAT";
554
+ if (taxInformation === null || taxInformation === void 0 ? void 0 : taxInformation.indirectTaxCountryCode) {
555
+ return vatLabels[taxInformation.indirectTaxCountryCode] || "Indirect Tax";
556
+ }
557
+ return "Indirect Tax";
558
+ }
559
+ const useTaxAndCashDashboard = (props) => {
560
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
561
+ const setStep = En(TAX_CONTEXT_NAMESPACE);
562
+ const setContext = En(TAX_FORM_CONTEXT_NAMESPACE);
563
+ const [showDialog, setShowDialog] = useState(false);
564
+ const { render, loading: veriffLoading, errors: veriffErrors, } = useVeriffApp();
565
+ const { data: taxSettingRes } = wn(GET_TAX_SETTING, {});
566
+ const locale = L();
567
+ useEffect(() => {
568
+ // Clear override context once on submitted
569
+ setContext({});
570
+ if (window.location.hash)
571
+ setStep(`/${window.location.hash.replace("#", "")}`);
572
+ }, []);
573
+ const { data, loading, errors: userError, refetch, } = $n(USER_QUERY_NAMESPACE);
574
+ 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;
575
+ const documentType = publisher === null || publisher === void 0 ? void 0 : publisher.requiredTaxDocumentType;
576
+ const submissionDate = (_c = publisher === null || publisher === void 0 ? void 0 : publisher.currentTaxDocument) === null || _c === void 0 ? void 0 : _c.dateCreated;
577
+ const dateSubmitted = submissionDate
578
+ ? luxon.DateTime.fromMillis(submissionDate).toFormat("LLL dd, yyyy")
579
+ : undefined;
580
+ const onEditPayoutInfo = () => {
581
+ setContext({
582
+ overrideNextStep: "/dashboard",
583
+ overrideBackStep: "/dashboard",
584
+ hideSteps: true,
585
+ });
586
+ setStep("/4");
587
+ };
588
+ const onNewFormClick = () => {
589
+ setShowDialog(false);
590
+ setContext({
591
+ overrideNextStep: "/dashboard",
592
+ overrideBackStep: "/dashboard",
593
+ hideSteps: true,
594
+ });
595
+ setStep("/3");
596
+ };
597
+ const provinceName = (_d = INDIRECT_TAX_PROVINCES.find((p) => { var _a; return p.regionCode === ((_a = publisher === null || publisher === void 0 ? void 0 : publisher.taxInformation) === null || _a === void 0 ? void 0 : _a.indirectTaxRegion); })) === null || _d === void 0 ? void 0 : _d.displayName;
598
+ const payoutStatus = data ? getStatus(data) : null;
599
+ useEffect(() => {
600
+ const cb = () => refetch();
601
+ window.addEventListener(VERIFF_COMPLETE_EVENT_KEY, cb);
602
+ return () => {
603
+ window.removeEventListener(VERIFF_COMPLETE_EVENT_KEY, cb);
604
+ };
605
+ }, []);
606
+ const enforceUsTaxComplianceOption = (_e = taxSettingRes === null || taxSettingRes === void 0 ? void 0 : taxSettingRes.tenantSettings) === null || _e === void 0 ? void 0 : _e.enforceUsTaxCompliance;
607
+ return {
608
+ states: {
609
+ dateSubmitted,
610
+ documentType,
611
+ canEditPayoutInfo: publisher === null || publisher === void 0 ? void 0 : publisher.brandedSignup,
612
+ documentTypeString: taxTypeToName(documentType),
613
+ status: (_f = publisher === null || publisher === void 0 ? void 0 : publisher.currentTaxDocument) === null || _f === void 0 ? void 0 : _f.status,
614
+ subRegion: getSubRegionName((_g = publisher === null || publisher === void 0 ? void 0 : publisher.taxInformation) === null || _g === void 0 ? void 0 : _g.indirectTaxRegion),
615
+ subRegionTaxNumber: (_h = publisher === null || publisher === void 0 ? void 0 : publisher.taxInformation) === null || _h === void 0 ? void 0 : _h.withholdingTaxId,
616
+ qstNumber: (_j = publisher === null || publisher === void 0 ? void 0 : publisher.taxInformation) === null || _j === void 0 ? void 0 : _j.additionalTaxId,
617
+ indirectTaxType: getIndirectTaxType(publisher === null || publisher === void 0 ? void 0 : publisher.taxInformation),
618
+ indirectTaxNumber: (_k = publisher === null || publisher === void 0 ? void 0 : publisher.taxInformation) === null || _k === void 0 ? void 0 : _k.indirectTaxId,
619
+ isBusinessEntity: (publisher === null || publisher === void 0 ? void 0 : publisher.requiredTaxDocumentType) === "W8BENE",
620
+ province: provinceName,
621
+ country: getCountryName((_l = publisher === null || publisher === void 0 ? void 0 : publisher.taxInformation) === null || _l === void 0 ? void 0 : _l.indirectTaxCountryCode, locale),
622
+ notRegistered: !((_m = publisher === null || publisher === void 0 ? void 0 : publisher.taxInformation) === null || _m === void 0 ? void 0 : _m.indirectTaxId),
623
+ noFormNeeded: !documentType,
624
+ disabled: loading,
625
+ loading,
626
+ loadingError: !!(userError === null || userError === void 0 ? void 0 : userError.message),
627
+ showNewFormDialog: showDialog,
628
+ hasHold: !!((_o = publisher === null || publisher === void 0 ? void 0 : publisher.payoutsAccount) === null || _o === void 0 ? void 0 : _o.hold),
629
+ payoutStatus,
630
+ veriffLoading,
631
+ enforceUsTaxComplianceOption,
632
+ },
633
+ callbacks: {
634
+ onClick: () => setShowDialog(true),
635
+ onVerifyClick: () => render(),
636
+ onEditPayoutInfo,
637
+ onNewFormCancel: () => setShowDialog(false),
638
+ onNewFormClick,
639
+ },
640
+ text: props.getTextProps(),
641
+ };
642
+ };
643
+
644
+ const TaxAndCashDashboard = class {
645
+ constructor(hostRef) {
646
+ registerInstance(this, hostRef);
647
+ /**
648
+ * @uiName Active tax form badge label
649
+ */
650
+ this.statusTextActive = "Active";
651
+ /**
652
+ * @uiName Invalid tax form badge label
653
+ */
654
+ this.statusTextNotActive = "Invalid Tax Form";
655
+ /**
656
+ * Displayed when the participant submitted their form but it is awaiting review.
657
+ *
658
+ * @uiName Not verified tax form badge label
659
+ */
660
+ this.statusTextNotVerified = "Not Verified";
661
+ /**
662
+ * Displayed when the participant has not submitted their required tax form.
663
+ *
664
+ * @uiName Required tax form badge label
665
+ */
666
+ this.statusTextRequired = "Required";
667
+ /**
668
+ * Additional text displayed next to the tax form's status badge
669
+ *
670
+ * @uiName Required tax form description
671
+ */
672
+ this.requiredTaxForm = "Your payouts are on hold until you submit a {taxFormType} tax form.";
673
+ /**
674
+ * Additional text displayed next to the tax form's status badge
675
+ *
676
+ * @uiName Active W-9 description
677
+ */
678
+ this.badgeTextSubmittedOn = "Submitted on {dateSubmitted}.";
679
+ /**
680
+ * Additional text displayed next to the tax form's status badge.
681
+ *
682
+ * @uiName Active W-8 description
683
+ */
684
+ this.badgeTextSubmittedOnW8 = "Submitted on {dateSubmitted}. Valid for three years after submission.";
685
+ /**
686
+ * Additional text displayed next to the tax form's status badge.
687
+ *
688
+ * @uiName Tax form in review description
689
+ */
690
+ this.badgeTextAwaitingReview = "Awaiting review. Submitted on {dateSubmitted}.";
691
+ /**
692
+ * Part of the alert displayed at the top of the page.
693
+ *
694
+ * @uiName Inactive W-9 error message title
695
+ * @uiWidget textArea
696
+ */
697
+ this.taxAlertHeaderNotActiveW9 = "Your W-9 tax form has personal information that doesn’t match your profile";
698
+ /**
699
+ * Part of the alert displayed at the top of the page.
700
+ *
701
+ * @uiName Inactive W-8 error message title
702
+ * @uiWidget textArea
703
+ */
704
+ this.taxAlertHeaderNotActiveW8 = "{documentType} tax form is invalid";
705
+ /**
706
+ * Part of the alert displayed at the top of the page.
707
+ *
708
+ * @uiName Inactive W-9 error message description
709
+ * @uiWidget textArea
710
+ */
711
+ this.taxAlertNotActiveMessageW9 = "Please resubmit a new {documentType} form.";
712
+ /**
713
+ * Part of the alert displayed at the top of the page.
714
+ *
715
+ * @uiName Inactive W-8 error message description
716
+ */
717
+ this.taxAlertNotActiveMessageW8 = "Your tax form may have expired or has personal information that doesn’t match your profile. Please submit a new {documentType} form.";
718
+ /**
719
+ * Additional text displayed next to the tax form's status badge.
720
+ *
721
+ * @uiName Invalid tax form description
722
+ * @uiWidget textArea
723
+ */
724
+ this.invalidForm = "Make sure your information is correct and submit new form.";
725
+ /**
726
+ * @uiName Payout information section header
727
+ */
728
+ this.bankingInformationSectionHeader = "Payout information";
729
+ /**
730
+ * @uiName Tax document section header
731
+ */
732
+ this.taxDocumentSectionHeader = "Tax documents";
733
+ /**
734
+ * Displayed under the tax document section header.
735
+ *
736
+ * @uiName Tax documents section description
737
+ */
738
+ this.taxDocumentSectionSubHeader = "{documentType} tax form";
739
+ /**
740
+ *
741
+ * @uiName Indirect tax section header
742
+ */
743
+ this.indirectTaxInfoSectionHeader = "Indirect tax";
744
+ /**
745
+ * If the participant is registered for indirect tax in Canada, display the province they’re registered in.
746
+ *
747
+ * @uiName Canadian province of indirect tax
748
+ */
749
+ this.indirectTaxInfoCanada = "Registered in {province}, {country}";
750
+ /**
751
+ * If the participant is registered for indirect tax, display the country they’re registered in.
752
+ *
753
+ * @uiName Indirect tax country
754
+ */
755
+ this.indirectTaxInfoOtherCountry = "Registered in {country}";
756
+ /**
757
+ * If the participant is registered for indirect tax in Spain, display the region they’re registered in.
758
+ *
759
+ * @uiName Spanish region of indirect tax
760
+ */
761
+ this.indirectTaxInfoSpain = "Registered in {country}, {subRegion}";
762
+ /**
763
+ * @uiName Indirect tax tooltip
764
+ * @uiWidget textArea
765
+ */
766
+ this.indirectTaxTooltipSupport = "To make changes to your indirect tax information, please contact our Support team.";
767
+ /**
768
+ * Displayed to participants who have submitted their indirect tax information.
769
+ *
770
+ * @uiName Indirect tax details
771
+ */
772
+ this.indirectTaxDetails = "{indirectTaxType} number: {indirectTaxNumber}";
773
+ /**
774
+ * @uiName Submit new tax form button label
775
+ */
776
+ this.newFormButton = "Submit new form";
777
+ /**
778
+ *
779
+ * @uiName Edit payment info button label
780
+ */
781
+ this.editPaymentInformationButton = "Edit Payout Information";
782
+ /**
783
+ * @uiName Not registered for indirect tax text
784
+ * @uiWidget textArea
785
+ */
786
+ this.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.";
787
+ /**
788
+ * Displayed to participants registered in Quebec, Canada.
789
+ * @uiName QST indirect tax details
790
+ */
791
+ this.qstNumber = "QST number: {qstNumber}";
792
+ /**
793
+ * @uiName Spain sub-region indirect tax number
794
+ */
795
+ this.subRegionTaxNumber = "Income tax number: {subRegionTaxNumber}";
796
+ /**
797
+ * @uiName Payout status badge
798
+ */
799
+ this.statusBadgeText = "{badgeText, select, payoutToday {Payout Today} nextPayout {Next Payout} }";
800
+ /**
801
+ * Display participants' payout preference on the payout information card, indicating the balance at which they want to get paid.
802
+ * @uiName Payout schedule by threshold text
803
+ */
804
+ this.thresholdPayoutText = "Next payout occurs when balance is {thresholdBalance}";
805
+ /**
806
+ * Shown before the participant’s bank account information.
807
+ * @uiName Bank account field label
808
+ */
809
+ this.accountText = "Account";
810
+ /**
811
+ * Part of the alert displayed at the top of the page when there’s been an issue preventing payouts.
812
+ * @uiName Payout error message title
813
+ * @uiWidget textArea
814
+ */
815
+ this.payoutHoldAlertHeader = "Your payout is on hold";
816
+ /**
817
+ * Part of the alert displayed at the top of the page when there’s been an issue preventing payouts.
818
+ * @uiName Payout error message description
819
+ * @uiWidget textArea
820
+ */
821
+ this.payoutHoldAlertDescription = "Please contact our {supportLink} or check your inbox for an email from our referral program provider, impact.com.";
822
+ /**
823
+ * Text displayed for existing publishers that do not have saved banking information.
824
+ * @uiName Payout missing information subtext
825
+ */
826
+ this.payoutMissingInformationText = "Missing banking information, go to Impact.com to resolve.";
827
+ /**
828
+ * Part of the alert displayed at the top of the page when the user needs to verify their identity.
829
+ * @uiName Verification required alert message title
830
+ * @uiWidget textArea
831
+ */
832
+ this.verificationRequiredHeader = "Verify your identity";
833
+ /**
834
+ * Part of the alert displayed at the top of the page when the user needs to verify their identity
835
+ * @uiName Verification required alert message description
836
+ * @uiWidget textArea
837
+ */
838
+ this.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}.";
839
+ /**
840
+ * @uiName Verification required internal alert header
841
+ */
842
+ this.verificationRequiredInternalHeader = "Identity Verification in Progress";
843
+ /**
844
+ * @uiName Verification required internal alert description
845
+ */
846
+ this.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}.";
847
+ /**
848
+ * @uiName Verification review internal alert header
849
+ */
850
+ this.verificationReviewInternalHeader = "Identity Verification Under Review";
851
+ /**
852
+ * @uiName Verification review internal alert description
853
+ */
854
+ this.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}.";
855
+ /**
856
+ * @uiName Verification failed internal alert header
857
+ */
858
+ this.verificationFailedInternalHeader = "Identity Verification Unsuccessful";
859
+ /**
860
+ * @uiName Verification failed internal alert description
861
+ */
862
+ this.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}.";
863
+ /**
864
+ * Part of the alert displayed at the top of the page when the user needs to verify their identity.
865
+ * @uiName Verification required alert button text
866
+ */
867
+ this.verificationRequiredButtonText = "Start Verification";
868
+ /**
869
+ * @uiName W-9 payment threshold alert header
870
+ */
871
+ this.w9RequiredHeader = "Your next payout is on hold";
872
+ /**
873
+ * @uiName W-9 payment threshold alert description
874
+ */
875
+ this.w9RequiredDescription = "You have surpassed the $600 threshold requiring a W-9 form or have multiple accounts with impact.com. To remove the hold, please submit your W-9 form.";
876
+ /**
877
+ * @uiName Account review alert header
878
+ */
879
+ this.accountReviewHeader = "Your account is under review";
880
+ /**
881
+ * @uiName Account review alert description
882
+ */
883
+ 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}.";
884
+ /**
885
+ * @uiName Terms and Conditions text
886
+ */
887
+ this.termsAndConditions = "Terms and Conditions";
888
+ /**
889
+ * @uiName W-9 payment threshold alert button text
890
+ */
891
+ this.w9RequiredButtonText = "Submit W-9";
892
+ /**
893
+ * Part of the alert displayed at the top of the page.
894
+ * @uiName Form submission error message title
895
+ * @uiWidget textArea
896
+ */
897
+ this.generalErrorTitle = "There was a problem submitting your information";
898
+ /**
899
+ * Part of the alert displayed at the top of the page.
900
+ * @uiName Form submission error message description
901
+ * @uiWidget textArea
902
+ */
903
+ this.generalErrorDescription = "Please review your information and try again. If this problem continues, contact our {supportLink}.";
904
+ /**
905
+ * Displayed under the payout details card.
906
+ * @uiName Payout from impact text
907
+ * @uiWidget textArea
908
+ */
909
+ this.payoutFromImpact = "Your balance may take up to 24 hours to update. Payouts will be sent from our referral program provider, impact.com.";
910
+ /**
911
+ * Part of the alert displayed at the top of the page.
912
+ * @uiName Page load error message title
913
+ * @uiWidget textArea
914
+ */
915
+ this.loadingErrorAlertHeader = "There was a problem loading your form";
916
+ /**
917
+ * Part of the alert displayed at the top of the page.
918
+ * @uiName Page load error message description
919
+ * @uiWidget textArea
920
+ */
921
+ this.loadingErrorAlertDescription = "Please refresh the page and try again. If this problem continues, contact our {supportLink}.";
922
+ /**
923
+ * Part of the Invoice table displayed at the bottom of the page.
924
+ * @uiName Invoice number column title
925
+ */
926
+ this.invoiceColumnTitle = "Invoice";
927
+ /**
928
+ * Part of the Invoice table displayed at the bottom of the page.
929
+ * @uiName Date column title
930
+ */
931
+ this.dateColumnTitle = "Date";
932
+ /**
933
+ * Part of the Invoice table displayed at the bottom of the page.
934
+ * @uiName Earnings column title
935
+ */
936
+ this.earningsColumnTitle = "Earnings";
937
+ /**
938
+ * Part of the Invoice table displayed at the bottom of the page.
939
+ * @uiName Indirect tax column title
940
+ */
941
+ this.indirectTaxColumnTitle = "Indirect tax";
942
+ /**
943
+ * Part of the Invoice table displayed at the bottom of the page.
944
+ * @uiName Earnings after tax column title
945
+ */
946
+ this.earningsAfterTaxColumnTitle = "Earnings after tax";
947
+ /** @uiName Invoice table description */
948
+ this.invoiceDescription = "View and download your invoices to report your earnings and stay tax compliant.";
949
+ /** @uiName Invoice table previous page button label */
950
+ this.invoicePrevLabel = "Prev";
951
+ /** @uiName Invoice table next page button label */
952
+ this.invoiceMoreLabel = "Next";
953
+ /** @uiName Invoice table title */
954
+ this.invoiceHeader = "Invoices";
955
+ /** @uiName Empty invoice table header */
956
+ this.invoiceEmptyStateHeader = "View your invoice details";
957
+ /** @uiName Empty invoice table description */
958
+ this.invoiceEmptyStateText = "Refer a friend to view the status of your invoices and rewards earned";
959
+ /**
960
+ * @uiName Replace tax form modal header
961
+ */
962
+ this.replaceTaxFormModalHeader = "Replace existing tax form";
963
+ /**
964
+ * @uiName Replace tax form modal body text
965
+ */
966
+ this.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.";
967
+ /**
968
+ * @uiName Support link text
969
+ */
970
+ this.supportLink = "support team";
971
+ /**
972
+ * @uiName Cancel button label
973
+ */
974
+ this.cancelButton = "Cancel";
975
+ /**
976
+ * @undocumented
977
+ * @componentState { "title": "Payouts on hold", "props": { "states": { "payoutStatus": "HOLD" } }, "dependencies": ["sqm-payout-status-alert"] "uiGroup": "Dashboard Properties" }
978
+ */
979
+ this.stateController = "{}";
980
+ h$1(this);
981
+ }
982
+ disconnectedCallback() { }
983
+ getTextProps() {
984
+ const props = getProps(this);
985
+ return {
986
+ ...props,
987
+ error: {
988
+ generalDescription: props.generalErrorDescription,
989
+ generalTitle: props.generalErrorTitle,
990
+ loadingErrorAlertHeader: props.loadingErrorAlertHeader,
991
+ loadingErrorAlertDescription: props.loadingErrorAlertDescription,
992
+ },
993
+ };
994
+ }
995
+ render() {
996
+ const props = isDemo()
997
+ ? useDemoTaxAndCashDashboard(this)
998
+ : useTaxAndCashDashboard(this);
999
+ return (h(Host, null, h(TaxAndCashDashboardView, { callbacks: props.callbacks, states: props.states, text: props.text, slots: {
1000
+ payoutDetailsCardSlot: (h("sqm-payout-details-card", Object.assign({}, this.getTextProps()))),
1001
+ } })));
1002
+ }
1003
+ };
1004
+ function useDemoTaxAndCashDashboard(props) {
1005
+ var _a, _b, _c, _d;
1006
+ const parsed = parseStates(props.stateController);
1007
+ const formatted = parsed["sqm-tax-and-cash-dashboard"] !== undefined
1008
+ ? parsed["sqm-tax-and-cash-dashboard"]
1009
+ : {};
1010
+ const parsedPayoutStatus = (_b = (_a = formatted === null || formatted === void 0 ? void 0 : formatted.states) === null || _a === void 0 ? void 0 : _a.payoutStatus) !== null && _b !== void 0 ? _b : (_d = (_c = props.demoData) === null || _c === void 0 ? void 0 : _c.states) === null || _d === void 0 ? void 0 : _d.payoutStatus;
1011
+ // @ts-ignore
1012
+ return cjs({
1013
+ states: {
1014
+ dateSubmitted: "today",
1015
+ documentType: "W9",
1016
+ documentTypeString: "W-9",
1017
+ status: "ACTIVE",
1018
+ country: "United States",
1019
+ indirectTaxNumber: "55555555",
1020
+ indirectTaxType: "Indirect Tax",
1021
+ noFormNeeded: false,
1022
+ disabled: false,
1023
+ loading: false,
1024
+ showNewFormDialog: false,
1025
+ hasHold: false,
1026
+ subRegion: "CA",
1027
+ subRegionTaxNumber: undefined,
1028
+ qstNumber: undefined,
1029
+ isBusinessEntity: false,
1030
+ province: undefined,
1031
+ notRegistered: true,
1032
+ loadingError: false,
1033
+ payoutStatus: parsedPayoutStatus || "DONE",
1034
+ veriffLoading: false,
1035
+ canEditPayoutInfo: true,
1036
+ },
1037
+ callbacks: {
1038
+ onClick: () => console.debug("check step"),
1039
+ onEditPayoutInfo: () => console.debug("payout info"),
1040
+ onNewFormCancel: () => console.log("hide"),
1041
+ onNewFormClick: () => console.log("show"),
1042
+ onVerifyClick: () => console.log("verify"),
1043
+ },
1044
+ text: props.getTextProps(),
1045
+ slots: {
1046
+ payoutDetailsCardSlot: (h("sqm-payout-details-card", { demoData: {
1047
+ states: {
1048
+ badgeStatus: "nextPayout",
1049
+ },
1050
+ } })),
1051
+ },
1052
+ }, props.demoData || formatted || {}, { arrayMerge: (_, a) => a });
1053
+ }
1054
+
1055
+ export { TaxAndCashDashboard as sqm_tax_and_cash_dashboard };