@saasquatch/mint-components 1.12.0-11 → 1.12.0-12

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 (107) hide show
  1. package/dist/cjs/loader.cjs.js +1 -1
  2. package/dist/cjs/mint-components.cjs.js +1 -1
  3. package/dist/cjs/sqm-banking-info-form_16.cjs.entry.js +137 -53
  4. package/dist/cjs/sqm-big-stat_39.cjs.entry.js +55 -15
  5. package/dist/cjs/sqm-code-verification.cjs.entry.js +4 -4
  6. package/dist/cjs/sqm-email-verification.cjs.entry.js +1 -1
  7. package/dist/cjs/{sqm-invoice-table-view-c58966f8.js → sqm-invoice-table-view-301eed81.js} +78 -23
  8. package/dist/cjs/sqm-stencilbook.cjs.entry.js +11 -21
  9. package/dist/cjs/sqm-widget-verification-internal.cjs.entry.js +7 -1
  10. package/dist/cjs/usePayoutStatus-5ac536a3.js +1045 -0
  11. package/dist/cjs/{useVerificationEmail-6aacdb71.js → useVerificationEmail-2eb28c2a.js} +5 -1
  12. package/dist/collection/components/sqm-widget-verification/sqm-code-verification/useCodeVerification.js +3 -3
  13. package/dist/collection/components/sqm-widget-verification/sqm-widget-verification-internal.js +7 -1
  14. package/dist/collection/components/sqm-widget-verification/useVerificationEmail.js +5 -1
  15. package/dist/collection/components/tax-and-cash/TaxForm.stories.js +75 -23
  16. package/dist/collection/components/tax-and-cash/eventKeys.js +1 -0
  17. package/dist/collection/components/tax-and-cash/sqm-banking-info-form/sqm-banking-info-form.js +5 -5
  18. package/dist/collection/components/tax-and-cash/sqm-banking-info-form/useBankingInfoForm.js +3 -0
  19. package/dist/collection/components/tax-and-cash/sqm-docusign-form/useDocusignForm.js +3 -0
  20. package/dist/collection/components/tax-and-cash/sqm-indirect-tax-form/useIndirectTaxForm.js +3 -0
  21. package/dist/collection/components/tax-and-cash/sqm-payout-details-card/PayoutDetailsCard.stories.js +0 -7
  22. package/dist/collection/components/tax-and-cash/sqm-payout-details-card/sqm-payout-details-card-view.js +0 -5
  23. package/dist/collection/components/tax-and-cash/sqm-payout-details-card/sqm-payout-details-card.js +0 -56
  24. package/dist/collection/components/tax-and-cash/sqm-payout-status-alert/PayoutStatusAlert.stories.js +5 -9
  25. package/dist/collection/components/tax-and-cash/sqm-payout-status-alert/sqm-payout-status-alert-view.js +28 -11
  26. package/dist/collection/components/tax-and-cash/sqm-payout-status-alert/sqm-payout-status-alert.js +155 -6
  27. package/dist/collection/components/tax-and-cash/sqm-payout-status-alert/usePayoutStatus.js +20 -9
  28. package/dist/collection/components/tax-and-cash/sqm-tax-and-cash-dashboard/sqm-tax-and-cash-dashboard-view.js +86 -21
  29. package/dist/collection/components/tax-and-cash/sqm-tax-and-cash-dashboard/sqm-tax-and-cash-dashboard.js +153 -2
  30. package/dist/collection/components/tax-and-cash/sqm-tax-and-cash-dashboard/useTaxAndCashDashboard.js +13 -5
  31. package/dist/collection/components/tax-and-cash/useVeriffApp.js +64 -0
  32. package/dist/esm/loader.js +1 -1
  33. package/dist/esm/mint-components.js +1 -1
  34. package/dist/esm/sqm-banking-info-form_16.entry.js +137 -53
  35. package/dist/esm/sqm-big-stat_39.entry.js +55 -15
  36. package/dist/esm/sqm-code-verification.entry.js +4 -4
  37. package/dist/esm/sqm-email-verification.entry.js +1 -1
  38. package/dist/esm/{sqm-invoice-table-view-d1cfdaf4.js → sqm-invoice-table-view-1f26f252.js} +78 -23
  39. package/dist/esm/sqm-stencilbook.entry.js +11 -21
  40. package/dist/esm/sqm-widget-verification-internal.entry.js +7 -1
  41. package/dist/esm/usePayoutStatus-d613ff10.js +1039 -0
  42. package/dist/esm/{useVerificationEmail-c32696ba.js → useVerificationEmail-2a21d0e3.js} +5 -1
  43. package/dist/esm-es5/loader.js +1 -1
  44. package/dist/esm-es5/mint-components.js +1 -1
  45. package/dist/esm-es5/sqm-banking-info-form_16.entry.js +1 -1
  46. package/dist/esm-es5/sqm-big-stat_39.entry.js +1 -1
  47. package/dist/esm-es5/sqm-code-verification.entry.js +1 -1
  48. package/dist/esm-es5/sqm-email-verification.entry.js +1 -1
  49. package/dist/esm-es5/sqm-invoice-table-view-1f26f252.js +1 -0
  50. package/dist/esm-es5/sqm-stencilbook.entry.js +1 -1
  51. package/dist/esm-es5/sqm-widget-verification-internal.entry.js +1 -1
  52. package/dist/esm-es5/usePayoutStatus-d613ff10.js +6 -0
  53. package/dist/esm-es5/useVerificationEmail-2a21d0e3.js +1 -0
  54. package/dist/mint-components/mint-components.esm.js +1 -1
  55. package/dist/mint-components/p-03e1ac96.system.entry.js +1 -0
  56. package/dist/mint-components/p-209eab38.system.js +6 -0
  57. package/dist/mint-components/p-2584baa5.entry.js +16 -0
  58. package/dist/mint-components/p-2c99add0.js +31 -0
  59. package/dist/mint-components/p-635f1cf5.system.entry.js +1 -0
  60. package/dist/mint-components/p-78ec0d48.js +1 -0
  61. package/dist/mint-components/p-7d79f697.system.js +1 -0
  62. package/dist/mint-components/p-9379ee08.js +48 -0
  63. package/dist/mint-components/p-9ddcfcd7.entry.js +195 -0
  64. package/dist/mint-components/p-a567ba84.system.entry.js +1 -0
  65. package/dist/mint-components/p-a8c28561.system.js +1 -0
  66. package/dist/mint-components/{p-5f766d09.entry.js → p-a9b7e11f.entry.js} +2 -2
  67. package/dist/mint-components/{p-1712a9fd.entry.js → p-b24b4d75.entry.js} +2 -2
  68. package/dist/mint-components/{p-331d060e.entry.js → p-b9e863d0.entry.js} +14 -14
  69. package/dist/mint-components/{p-aabab609.system.entry.js → p-c5d26757.system.entry.js} +1 -1
  70. package/dist/mint-components/{p-b62faaa5.system.entry.js → p-c5f84a95.system.entry.js} +1 -1
  71. package/dist/mint-components/p-ca809fdd.system.js +1 -1
  72. package/dist/mint-components/{p-e45a8501.system.entry.js → p-f7493ca6.system.entry.js} +1 -1
  73. package/dist/mint-components/{p-24092973.entry.js → p-f7902f51.entry.js} +2 -2
  74. package/dist/types/components/sqm-widget-verification/useVerificationEmail.d.ts +1 -0
  75. package/dist/types/components/tax-and-cash/TaxForm.stories.d.ts +3 -0
  76. package/dist/types/components/tax-and-cash/eventKeys.d.ts +1 -0
  77. package/dist/types/components/tax-and-cash/sqm-payout-details-card/PayoutDetailsCard.stories.d.ts +0 -1
  78. package/dist/types/components/tax-and-cash/sqm-payout-details-card/sqm-payout-details-card-view.d.ts +0 -4
  79. package/dist/types/components/tax-and-cash/sqm-payout-details-card/sqm-payout-details-card.d.ts +1 -16
  80. package/dist/types/components/tax-and-cash/sqm-payout-status-alert/PayoutStatusAlert.stories.d.ts +3 -1
  81. package/dist/types/components/tax-and-cash/sqm-payout-status-alert/sqm-payout-status-alert-view.d.ts +7 -2
  82. package/dist/types/components/tax-and-cash/sqm-payout-status-alert/sqm-payout-status-alert.d.ts +25 -0
  83. package/dist/types/components/tax-and-cash/sqm-payout-status-alert/usePayoutStatus.d.ts +3 -4
  84. package/dist/types/components/tax-and-cash/sqm-tax-and-cash-dashboard/sqm-tax-and-cash-dashboard-view.d.ts +8 -4
  85. package/dist/types/components/tax-and-cash/sqm-tax-and-cash-dashboard/sqm-tax-and-cash-dashboard.d.ts +24 -0
  86. package/dist/types/components/tax-and-cash/useVeriffApp.d.ts +6 -0
  87. package/dist/types/components.d.ts +98 -22
  88. package/docs/docs.docx +0 -0
  89. package/docs/raisins.json +1 -1
  90. package/grapesjs/grapesjs.js +1 -1
  91. package/package.json +2 -1
  92. package/dist/cjs/usePayoutStatus-b9fb7399.js +0 -70
  93. package/dist/esm/usePayoutStatus-1a635054.js +0 -67
  94. package/dist/esm-es5/sqm-invoice-table-view-d1cfdaf4.js +0 -1
  95. package/dist/esm-es5/usePayoutStatus-1a635054.js +0 -1
  96. package/dist/esm-es5/useVerificationEmail-c32696ba.js +0 -1
  97. package/dist/mint-components/p-0e45bc0e.system.entry.js +0 -1
  98. package/dist/mint-components/p-1e616d45.system.js +0 -1
  99. package/dist/mint-components/p-282a7d85.entry.js +0 -195
  100. package/dist/mint-components/p-4364001c.entry.js +0 -12
  101. package/dist/mint-components/p-4bd7a472.js +0 -1
  102. package/dist/mint-components/p-517224ef.js +0 -19
  103. package/dist/mint-components/p-8300d8c8.system.js +0 -1
  104. package/dist/mint-components/p-8bddb468.system.entry.js +0 -1
  105. package/dist/mint-components/p-974070c4.system.entry.js +0 -1
  106. package/dist/mint-components/p-d7806f31.js +0 -48
  107. package/dist/mint-components/p-e990dc21.system.js +0 -1
@@ -82,7 +82,7 @@ export function PayoutStatusAlertView(props) {
82
82
  icon: "info-circle",
83
83
  class: sheet.classes.InfoAlertContainer,
84
84
  };
85
- case "VERIFICATION_NEEDED":
85
+ case "VERIFICATION:REQUIRED":
86
86
  return {
87
87
  header: text.verificationRequiredHeader,
88
88
  description: text.verificationRequiredDescription,
@@ -91,6 +91,30 @@ export function PayoutStatusAlertView(props) {
91
91
  icon: "exclamation-triangle",
92
92
  class: sheet.classes.WarningAlertContainer,
93
93
  };
94
+ case "VERIFICATION:INTERNAL":
95
+ return {
96
+ header: text.verificationRequiredInternalHeader,
97
+ description: text.verificationRequiredInternalDescription,
98
+ alertType: "warning",
99
+ icon: "exclamation-triangle",
100
+ class: sheet.classes.WarningAlertContainer,
101
+ };
102
+ case "VERIFICATION:REVIEW":
103
+ return {
104
+ header: text.verificationReviewInternalHeader,
105
+ description: text.verificationReviewInternalDescription,
106
+ alertType: "warning",
107
+ icon: "exclamation-triangle",
108
+ class: sheet.classes.WarningAlertContainer,
109
+ };
110
+ case "VERIFICATION:FAILED":
111
+ return {
112
+ header: text.verificationFailedInternalHeader,
113
+ description: text.verificationFailedInternalDescription,
114
+ alertType: "critical",
115
+ icon: "exclamation-octagon",
116
+ class: sheet.classes.ErrorAlertContainer,
117
+ };
94
118
  case "HOLD":
95
119
  return {
96
120
  header: text.holdHeader,
@@ -104,15 +128,12 @@ export function PayoutStatusAlertView(props) {
104
128
  return;
105
129
  }
106
130
  }
107
- //AL: TODO hookup ID
108
131
  function getButton(status) {
109
132
  switch (status) {
110
133
  case "INFORMATION_REQUIRED":
111
134
  return data.type === "SquatchJS2" ? (h("sqm-scroll", { "scroll-tag-name": "sqm-tabs", "button-text": text.informationRequiredButtonText, "scroll-animation": "smooth" })) : data.type === "SquatchPortal" ? (h("sl-button", { type: "default", onClick: callbacks.onTermsClick }, text.informationRequiredButtonText)) : (h("sl-button", { type: "default" }, text.informationRequiredButtonText));
112
- case "VERIFICATION_NEEDED":
113
- return (h("sl-button", { type: "default", loading: states.loading,
114
- //AL: TODO callback to open verification form
115
- onClick: () => callbacks.onClick }, text.verificationRequiredButtonText));
135
+ case "VERIFICATION:REQUIRED":
136
+ return (h("sl-button", { type: "default", loading: states.veriffLoading, onClick: callbacks.onClick }, text.verificationRequiredButtonText));
116
137
  default:
117
138
  return;
118
139
  }
@@ -123,9 +144,5 @@ export function PayoutStatusAlertView(props) {
123
144
  h("sl-icon", { slot: "icon", name: (_c = getAlert(states.status)) === null || _c === void 0 ? void 0 : _c.icon }),
124
145
  h("strong", null, (_d = getAlert(states.status)) === null || _d === void 0 ? void 0 : _d.header),
125
146
  h("p", { class: sheet.classes.AlertDescriptionText }, (_e = getAlert(states.status)) === null || _e === void 0 ? void 0 : _e.description),
126
- getButton(states.status)),
127
- h("sl-dialog", { noDismiss: true, class: sheet.classes.Dialog, open: states.showVerifyIdentity, "onSl-hide": callbacks.onCancel },
128
- h("iframe", {
129
- // AL: TODO replace iframe URL with verification url when available
130
- scrolling: "yes", frameBorder: "0", width: "100%", height: "100%", src: "https://impacttech.complytaxforms.com/ServiceRedirect.aspx?Language=eng&Param1=UxBORV4bOIrqNb4gbpNmtvW3wjdZJyx4gPElIGMJNR8=&UUID=B576EA3E-80FD-4D85-AA59-653D23A7CCE8" }))));
147
+ getButton(states.status))));
131
148
  }
@@ -36,14 +36,39 @@ export class PayoutStatusAlert {
36
36
  * @uiName Verification required alert button text
37
37
  */
38
38
  this.verificationRequiredButtonText = "Start Verification";
39
+ /**
40
+ * @uiName Verification required internal alert header
41
+ */
42
+ this.verificationRequiredInternalHeader = "Identity Verification in Progress";
43
+ /**
44
+ * @uiName Verification required internal alert description
45
+ */
46
+ this.verificationRequiredInternalDescription = "Identity verification submission has been received. Our system is currently performing additional checks and analyzing the results. You will be updated shortley.";
47
+ /**
48
+ * @uiName Verification review internal alert header
49
+ */
50
+ this.verificationReviewInternalHeader = "Identity Verification Under Review";
51
+ /**
52
+ * @uiName Verification review internal alert description
53
+ */
54
+ this.verificationReviewInternalDescription = "Identity verification requires further review due to a potential error. Our team is reviewing the information and will update you shortly.";
55
+ /**
56
+ * @uiName Verification failed internal alert header
57
+ */
58
+ this.verificationFailedInternalHeader = "Identity Verification Unsuccessful";
59
+ /**
60
+ * @uiName Verification failed internal alert description
61
+ */
62
+ this.verificationFailedInternalDescription = "Identity verification has failed. Our team is reviewing the report and will contact you with further information.";
39
63
  /**
40
64
  * @uiName Payout on hold alert header
41
65
  */
42
66
  this.holdHeader = "Your payouts and account are on hold";
43
67
  /**
44
68
  * @uiName Payout on hold alert description
69
+ * AL: TODO copy not finalized for support section
45
70
  */
46
- this.holdDescription = "Please check your inbox for an email from our referral provider, impact.com. It contains details on how to resolve this issue. If you need further assistance, feel free to reach out to {support email}.";
71
+ this.holdDescription = "Please check your inbox for an email from our referral provider, impact.com. It contains details on how to resolve this issue. If you need further assistance, feel free to reach out to our support team.";
47
72
  /**
48
73
  * @uiName Cash & Payouts Terms and Conditions url
49
74
  */
@@ -66,7 +91,6 @@ export class PayoutStatusAlert {
66
91
  const props = isDemo()
67
92
  ? useDemoPayoutStatusAlert(this)
68
93
  : usePayoutStatus(this);
69
- console.log({ props });
70
94
  return h(PayoutStatusAlertView, Object.assign({}, props));
71
95
  }
72
96
  static get is() { return "sqm-payout-status-alert"; }
@@ -198,6 +222,132 @@ export class PayoutStatusAlert {
198
222
  "reflect": false,
199
223
  "defaultValue": "\"Start Verification\""
200
224
  },
225
+ "verificationRequiredInternalHeader": {
226
+ "type": "string",
227
+ "mutable": false,
228
+ "complexType": {
229
+ "original": "string",
230
+ "resolved": "string",
231
+ "references": {}
232
+ },
233
+ "required": false,
234
+ "optional": false,
235
+ "docs": {
236
+ "tags": [{
237
+ "text": "Verification required internal alert header",
238
+ "name": "uiName"
239
+ }],
240
+ "text": ""
241
+ },
242
+ "attribute": "verification-required-internal-header",
243
+ "reflect": false,
244
+ "defaultValue": "\"Identity Verification in Progress\""
245
+ },
246
+ "verificationRequiredInternalDescription": {
247
+ "type": "string",
248
+ "mutable": false,
249
+ "complexType": {
250
+ "original": "string",
251
+ "resolved": "string",
252
+ "references": {}
253
+ },
254
+ "required": false,
255
+ "optional": false,
256
+ "docs": {
257
+ "tags": [{
258
+ "text": "Verification required internal alert description",
259
+ "name": "uiName"
260
+ }],
261
+ "text": ""
262
+ },
263
+ "attribute": "verification-required-internal-description",
264
+ "reflect": false,
265
+ "defaultValue": "\"Identity verification submission has been received. Our system is currently performing additional checks and analyzing the results. You will be updated shortley.\""
266
+ },
267
+ "verificationReviewInternalHeader": {
268
+ "type": "string",
269
+ "mutable": false,
270
+ "complexType": {
271
+ "original": "string",
272
+ "resolved": "string",
273
+ "references": {}
274
+ },
275
+ "required": false,
276
+ "optional": false,
277
+ "docs": {
278
+ "tags": [{
279
+ "text": "Verification review internal alert header",
280
+ "name": "uiName"
281
+ }],
282
+ "text": ""
283
+ },
284
+ "attribute": "verification-review-internal-header",
285
+ "reflect": false,
286
+ "defaultValue": "\"Identity Verification Under Review\""
287
+ },
288
+ "verificationReviewInternalDescription": {
289
+ "type": "string",
290
+ "mutable": false,
291
+ "complexType": {
292
+ "original": "string",
293
+ "resolved": "string",
294
+ "references": {}
295
+ },
296
+ "required": false,
297
+ "optional": false,
298
+ "docs": {
299
+ "tags": [{
300
+ "text": "Verification review internal alert description",
301
+ "name": "uiName"
302
+ }],
303
+ "text": ""
304
+ },
305
+ "attribute": "verification-review-internal-description",
306
+ "reflect": false,
307
+ "defaultValue": "\"Identity verification requires further review due to a potential error. Our team is reviewing the information and will update you shortly.\""
308
+ },
309
+ "verificationFailedInternalHeader": {
310
+ "type": "string",
311
+ "mutable": false,
312
+ "complexType": {
313
+ "original": "string",
314
+ "resolved": "string",
315
+ "references": {}
316
+ },
317
+ "required": false,
318
+ "optional": false,
319
+ "docs": {
320
+ "tags": [{
321
+ "text": "Verification failed internal alert header",
322
+ "name": "uiName"
323
+ }],
324
+ "text": ""
325
+ },
326
+ "attribute": "verification-failed-internal-header",
327
+ "reflect": false,
328
+ "defaultValue": "\"Identity Verification Unsuccessful\""
329
+ },
330
+ "verificationFailedInternalDescription": {
331
+ "type": "string",
332
+ "mutable": false,
333
+ "complexType": {
334
+ "original": "string",
335
+ "resolved": "string",
336
+ "references": {}
337
+ },
338
+ "required": false,
339
+ "optional": false,
340
+ "docs": {
341
+ "tags": [{
342
+ "text": "Verification failed internal alert description",
343
+ "name": "uiName"
344
+ }],
345
+ "text": ""
346
+ },
347
+ "attribute": "verification-failed-internal-description",
348
+ "reflect": false,
349
+ "defaultValue": "\"Identity verification has failed. Our team is reviewing the report and will contact you with further information.\""
350
+ },
201
351
  "holdHeader": {
202
352
  "type": "string",
203
353
  "mutable": false,
@@ -231,14 +381,14 @@ export class PayoutStatusAlert {
231
381
  "optional": false,
232
382
  "docs": {
233
383
  "tags": [{
234
- "text": "Payout on hold alert description",
384
+ "text": "Payout on hold alert description\nAL: TODO copy not finalized for support section",
235
385
  "name": "uiName"
236
386
  }],
237
387
  "text": ""
238
388
  },
239
389
  "attribute": "hold-description",
240
390
  "reflect": false,
241
- "defaultValue": "\"Please check your inbox for an email from our referral provider, impact.com. It contains details on how to resolve this issue. If you need further assistance, feel free to reach out to {support email}.\""
391
+ "defaultValue": "\"Please check your inbox for an email from our referral provider, impact.com. It contains details on how to resolve this issue. If you need further assistance, feel free to reach out to our support team.\""
242
392
  },
243
393
  "termsUrl": {
244
394
  "type": "string",
@@ -308,7 +458,7 @@ export class PayoutStatusAlert {
308
458
  "mutable": false,
309
459
  "complexType": {
310
460
  "original": "DemoData<PayoutStatusAlertViewProps>",
311
- "resolved": "{ states?: { error: boolean; loading: boolean; status: PayoutStatus; showVerifyIdentity: boolean; }; data?: { type: \"SquatchJS2\" | \"SquatchAndroid\" | \"SquatchIOS\" | \"SquatchPortal\" | \"SquatchAdmin\" | \"None\"; }; }",
461
+ "resolved": "{ states?: { error: boolean; loading: boolean; status: PayoutStatus; veriffLoading: boolean; }; data?: { type: \"SquatchJS2\" | \"SquatchAndroid\" | \"SquatchIOS\" | \"SquatchPortal\" | \"SquatchAdmin\" | \"None\"; }; }",
312
462
  "references": {
313
463
  "DemoData": {
314
464
  "location": "import",
@@ -348,7 +498,6 @@ function useDemoPayoutStatusAlert(props) {
348
498
  callbacks: {
349
499
  onTermsClick: () => { },
350
500
  onClick: () => console.log("show"),
351
- onCancel: () => console.log("hide"),
352
501
  },
353
502
  }, props.demoData || {}, { arrayMerge: (_, a) => a });
354
503
  }
@@ -1,6 +1,8 @@
1
1
  import { getEnvironmentSDK, useQuery } from "@saasquatch/component-boilerplate";
2
- import { useState, useEffect } from "@saasquatch/stencil-hooks";
2
+ import { useEffect, useState } from "@saasquatch/stencil-hooks";
3
3
  import { gql } from "graphql-request";
4
+ import { TAX_FORM_UPDATED_EVENT_KEY } from "../eventKeys";
5
+ import { useVeriffApp, VERIFF_COMPLETE_EVENT_KEY } from "../useVeriffApp";
4
6
  const GET_USER_STATUS = gql `
5
7
  query getUserStatus {
6
8
  user: viewer {
@@ -21,12 +23,18 @@ const GET_USER_STATUS = gql `
21
23
  }
22
24
  `;
23
25
  export function getStatus(data) {
24
- var _a, _b, _c, _d, _e;
26
+ var _a, _b, _c, _d, _e, _f, _g, _h;
25
27
  const account = (_b = (_a = data.user.impactConnection) === null || _a === void 0 ? void 0 : _a.publisher) === null || _b === void 0 ? void 0 : _b.payoutsAccount;
26
28
  if (!((_d = (_c = data.user) === null || _c === void 0 ? void 0 : _c.impactConnection) === null || _d === void 0 ? void 0 : _d.connected) || !account)
27
29
  return "INFORMATION_REQUIRED";
28
30
  if ((_e = account.holdReasons) === null || _e === void 0 ? void 0 : _e.includes("IDV_CHECK_REQUIRED"))
29
- return "VERIFICATION_NEEDED";
31
+ return "VERIFICATION:REQUIRED";
32
+ if ((_f = account.holdReasons) === null || _f === void 0 ? void 0 : _f.includes("IDV_CHECK_REQUIRED_INTERNAL"))
33
+ return "VERIFICATION:INTERNAL";
34
+ if ((_g = account.holdReasons) === null || _g === void 0 ? void 0 : _g.includes("IDV_CHECK_REVIEW_INTERNAL"))
35
+ return "VERIFICATION:REVIEW";
36
+ if ((_h = account.holdReasons) === null || _h === void 0 ? void 0 : _h.includes("IDV_CHECK_FAILED_INTERNAL"))
37
+ return "VERIFICATION:FAILED";
30
38
  if (account.hold)
31
39
  return "HOLD";
32
40
  return "DONE";
@@ -34,8 +42,8 @@ export function getStatus(data) {
34
42
  export function usePayoutStatus(props) {
35
43
  const { type } = getEnvironmentSDK();
36
44
  const { loading, data, errors, refetch } = useQuery(GET_USER_STATUS, {});
45
+ const { render, loading: veriffLoading, errors: veriffErrors, } = useVeriffApp();
37
46
  const [status, setStatus] = useState(undefined);
38
- const [showDialog, setShowDialog] = useState(false);
39
47
  useEffect(() => {
40
48
  if (!data)
41
49
  return;
@@ -44,22 +52,25 @@ export function usePayoutStatus(props) {
44
52
  }, [data]);
45
53
  useEffect(() => {
46
54
  const cb = () => refetch();
47
- window.addEventListener("sqm:tax-form-updated", cb);
48
- return () => window.removeEventListener("sqm:tax-form-updated", cb);
55
+ window.addEventListener(TAX_FORM_UPDATED_EVENT_KEY, cb);
56
+ window.addEventListener(VERIFF_COMPLETE_EVENT_KEY, cb);
57
+ return () => {
58
+ window.removeEventListener(TAX_FORM_UPDATED_EVENT_KEY, cb);
59
+ window.removeEventListener(VERIFF_COMPLETE_EVENT_KEY, cb);
60
+ };
49
61
  }, []);
50
62
  return {
51
63
  states: {
52
64
  loading,
65
+ veriffLoading,
53
66
  status,
54
- showVerifyIdentity: showDialog,
55
67
  error: !!errors,
56
68
  },
57
69
  data: { type },
58
70
  text: props.getTextProps(),
59
71
  callbacks: {
60
72
  onTermsClick: () => window.open(props.termsUrl, "_blank").focus(),
61
- onClick: () => setShowDialog(true),
62
- onCancel: () => setShowDialog(false),
73
+ onClick: render,
63
74
  },
64
75
  };
65
76
  }
@@ -2,17 +2,43 @@ import { h } from "@stencil/core";
2
2
  import { intl } from "../../../global/global";
3
3
  import { createStyleSheet } from "../../../styling/JSS";
4
4
  const style = {
5
- WarningAlertContainer: {
5
+ ErrorAlertContainer: {
6
6
  "&::part(base)": {
7
7
  backgroundColor: "var(--sl-color-red-100)",
8
8
  borderTop: "none",
9
9
  },
10
+ "& sl-icon::part(base)": {
11
+ color: "var(--sl-color-danger-500)",
12
+ },
13
+ },
14
+ WarningAlertContainer: {
15
+ "&::part(base)": {
16
+ backgroundColor: "var(--sl-color-yellow-100)",
17
+ borderTop: "none",
18
+ },
19
+ "& sl-icon::part(base)": {
20
+ color: "var(--sl-color-warning-500)",
21
+ },
10
22
  },
11
- HoldAlertContainer: {
23
+ WarningHoldAlertContainer: {
24
+ marginLeft: "-20px",
12
25
  "&::part(base)": {
13
26
  border: "none",
14
27
  backgroundColor: "transparent",
15
28
  },
29
+ "& sl-icon::part(base)": {
30
+ color: "var(--sl-color-warning-500)",
31
+ },
32
+ },
33
+ ErrorHoldAlertContainer: {
34
+ marginLeft: "-20px",
35
+ "&::part(base)": {
36
+ border: "none",
37
+ backgroundColor: "transparent",
38
+ },
39
+ "& sl-icon::part(base)": {
40
+ color: "var(--sl-color-danger-500)",
41
+ },
16
42
  },
17
43
  ExpiringSoonAlertContainer: {
18
44
  "&::part(base)": {
@@ -165,8 +191,56 @@ const style = {
165
191
  const sheet = createStyleSheet(style);
166
192
  const styleString = sheet.toString();
167
193
  export const TaxAndCashDashboardView = (props) => {
168
- var _a;
194
+ var _a, _b, _c, _d;
169
195
  const { states, text, callbacks, slots } = props;
196
+ function getAlert(status) {
197
+ switch (status) {
198
+ case "VERIFICATION:REQUIRED":
199
+ return {
200
+ header: text.verificationRequiredHeader,
201
+ description: text.verificationRequiredDescription,
202
+ buttonText: text.verificationRequiredButtonText,
203
+ alertType: "warning",
204
+ icon: "exclamation-triangle",
205
+ class: sheet.classes.WarningHoldAlertContainer,
206
+ };
207
+ case "VERIFICATION:INTERNAL":
208
+ return {
209
+ header: text.verificationRequiredInternalHeader,
210
+ description: text.verificationRequiredInternalDescription,
211
+ alertType: "warning",
212
+ icon: "exclamation-triangle",
213
+ class: sheet.classes.WarningHoldAlertContainer,
214
+ };
215
+ case "VERIFICATION:REVIEW":
216
+ return {
217
+ header: text.verificationReviewInternalHeader,
218
+ description: text.verificationReviewInternalDescription,
219
+ alertType: "warning",
220
+ icon: "exclamation-triangle",
221
+ class: sheet.classes.WarningHoldAlertContainer,
222
+ };
223
+ case "VERIFICATION:FAILED":
224
+ return {
225
+ header: text.verificationFailedInternalHeader,
226
+ description: text.verificationFailedInternalDescription,
227
+ alertType: "critical",
228
+ icon: "exclamation-octagon",
229
+ class: sheet.classes.ErrorHoldAlertContainer,
230
+ };
231
+ case "HOLD":
232
+ return {
233
+ header: text.payoutHoldAlertHeader,
234
+ description: text.payoutHoldAlertDescription,
235
+ buttonText: null,
236
+ alertType: "warning",
237
+ icon: "exclamation-triangle",
238
+ class: sheet.classes.WarningHoldAlertContainer,
239
+ };
240
+ default:
241
+ return;
242
+ }
243
+ }
170
244
  const statusMap = {
171
245
  NOT_VERIFIED: (h("div", { class: sheet.classes.TaxFormDetailsContainer },
172
246
  h("sl-badge", { type: "warning", pill: true }, text.statusTextNotVerified),
@@ -191,7 +265,7 @@ export const TaxAndCashDashboardView = (props) => {
191
265
  h("p", null, text.invalidForm))),
192
266
  };
193
267
  const alertMap = {
194
- INACTIVE: (h("sl-alert", { exportparts: "base: alert-base, icon:alert-icon", type: "danger", open: true, class: sheet.classes.WarningAlertContainer },
268
+ INACTIVE: (h("sl-alert", { exportparts: "base: alert-base, icon:alert-icon", type: "danger", open: true, class: sheet.classes.ErrorAlertContainer },
195
269
  h("sl-icon", { slot: "icon", name: "exclamation-octagon" }),
196
270
  h("strong", null, intl.formatMessage({
197
271
  id: `taxAlertHeaderNotActive`,
@@ -243,32 +317,23 @@ export const TaxAndCashDashboardView = (props) => {
243
317
  h("div", null,
244
318
  h("style", { type: "text/css" }, styleString),
245
319
  states.loadingError && (h("div", null,
246
- h("sl-alert", { exportparts: "base: alert-base, icon:alert-icon", type: "danger", open: true, class: sheet.classes.WarningAlertContainer },
320
+ h("sl-alert", { exportparts: "base: alert-base, icon:alert-icon", type: "danger", open: true, class: sheet.classes.ErrorAlertContainer },
247
321
  h("sl-icon", { slot: "icon", name: "exclamation-octagon" }),
248
322
  h("strong", null, text.error.loadingErrorAlertHeader),
249
323
  h("br", null),
250
324
  text.error.loadingErrorAlertDescription))),
251
- ((_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.WarningAlertContainer },
325
+ ((_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 },
252
326
  h("sl-icon", { slot: "icon", name: "exclamation-octagon" }),
253
327
  h("strong", null, text.error.generalTitle),
254
328
  h("br", null),
255
329
  text.error.generalDescription)),
256
- states.hasHold && (h("sl-alert", { exportparts: "base: alert-base, icon:alert-icon", type: "warning", open: true, class: sheet.classes.HoldAlertContainer },
257
- h("sl-icon", { slot: "icon", name: "exclamation-triangle" }),
258
- h("strong", null, text.payoutHoldAlertHeader),
259
- h("br", null),
260
- text.payoutHoldAlertDescription)),
261
- states.payoutStatus === "VERIFICATION_NEEDED" && (h("sl-alert", { exportparts: "base: alert-base, icon:alert-icon", type: "warning", open: true, class: sheet.classes.HoldAlertContainer },
262
- h("sl-icon", { slot: "icon", name: "exclamation-triangle" }),
263
- h("strong", null, text.verificationRequiredHeader),
264
- h("p", { style: { margin: "0" } }, text.verificationRequiredDescription),
265
- h("sl-button", { style: { marginTop: "var(--sl-spacing-x-small)" }, type: "default", loading: states.loading,
330
+ states.payoutStatus && states.payoutStatus !== "DONE" && (h("sl-alert", { exportparts: "base: alert-base, icon:alert-icon", name: (_b = getAlert(states.payoutStatus)) === null || _b === void 0 ? void 0 : _b.alertType, open: true, class: (_c = getAlert(states.payoutStatus)) === null || _c === void 0 ? void 0 : _c.class },
331
+ h("sl-icon", { slot: "icon", name: (_d = getAlert(states.payoutStatus)) === null || _d === void 0 ? void 0 : _d.icon }),
332
+ h("strong", null, getAlert(states.payoutStatus).header),
333
+ h("p", { style: { margin: "0" } }, getAlert(states.payoutStatus).description),
334
+ getAlert(states.payoutStatus).buttonText && (h("sl-button", { style: { marginTop: "var(--sl-spacing-x-small)" }, type: "default", loading: states.loading,
266
335
  //AL: TODO hooks
267
- onClick: () => callbacks.onClick }, text.verificationRequiredButtonText))),
268
- h("sl-dialog", { noDismiss: true, class: sheet.classes.Dialog, open: states.showVerifyIdentity, "onSl-hide": callbacks.onVerifyIdentityCancel },
269
- h("iframe", {
270
- // AL: TODO replace iframe URL with verification url when available
271
- scrolling: "yes", frameBorder: "0", width: "100%", height: "100%", src: "https://impacttech.complytaxforms.com/ServiceRedirect.aspx?Language=eng&Param1=UxBORV4bOIrqNb4gbpNmtvW3wjdZJyx4gPElIGMJNR8=&UUID=B576EA3E-80FD-4D85-AA59-653D23A7CCE8" })),
336
+ onClick: () => callbacks.onClick }, getAlert(states.payoutStatus).buttonText)))),
272
337
  h("sl-dialog", { label: text.replaceTaxFormModalHeader, class: sheet.classes.Dialog, open: states.showNewFormDialog, "onSl-hide": callbacks.onNewFormCancel },
273
338
  h("p", null, text.replaceTaxFormModalBodyText),
274
339
  h("sl-button", { slot: "footer", type: "primary", class: sheet.classes.DialogButton, onClick: callbacks.onNewFormClick }, text.newFormButton),