@saasquatch/mint-components 1.12.0-10 → 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 (112) 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 +138 -59
  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 +4 -4
  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-email-verification/sqm-email-verification-view.js +1 -1
  14. package/dist/collection/components/sqm-widget-verification/sqm-email-verification/useEmailVerification.js +2 -2
  15. package/dist/collection/components/sqm-widget-verification/sqm-widget-verification-internal.js +7 -1
  16. package/dist/collection/components/sqm-widget-verification/useVerificationEmail.js +5 -1
  17. package/dist/collection/components/tax-and-cash/TaxForm.stories.js +75 -23
  18. package/dist/collection/components/tax-and-cash/eventKeys.js +1 -0
  19. package/dist/collection/components/tax-and-cash/sqm-banking-info-form/sqm-banking-info-form.js +5 -5
  20. package/dist/collection/components/tax-and-cash/sqm-banking-info-form/useBankingInfoForm.js +3 -0
  21. package/dist/collection/components/tax-and-cash/sqm-docusign-form/useDocusignForm.js +3 -0
  22. package/dist/collection/components/tax-and-cash/sqm-indirect-tax-form/useIndirectTaxForm.js +3 -0
  23. package/dist/collection/components/tax-and-cash/sqm-payout-details-card/PayoutDetailsCard.stories.js +0 -7
  24. package/dist/collection/components/tax-and-cash/sqm-payout-details-card/sqm-payout-details-card-view.js +0 -5
  25. package/dist/collection/components/tax-and-cash/sqm-payout-details-card/sqm-payout-details-card.js +0 -56
  26. package/dist/collection/components/tax-and-cash/sqm-payout-status-alert/PayoutStatusAlert.stories.js +5 -9
  27. package/dist/collection/components/tax-and-cash/sqm-payout-status-alert/sqm-payout-status-alert-view.js +28 -11
  28. package/dist/collection/components/tax-and-cash/sqm-payout-status-alert/sqm-payout-status-alert.js +155 -6
  29. package/dist/collection/components/tax-and-cash/sqm-payout-status-alert/usePayoutStatus.js +20 -9
  30. package/dist/collection/components/tax-and-cash/sqm-tax-and-cash-dashboard/sqm-tax-and-cash-dashboard-view.js +86 -21
  31. package/dist/collection/components/tax-and-cash/sqm-tax-and-cash-dashboard/sqm-tax-and-cash-dashboard.js +153 -2
  32. package/dist/collection/components/tax-and-cash/sqm-tax-and-cash-dashboard/useTaxAndCashDashboard.js +13 -5
  33. package/dist/collection/components/tax-and-cash/sqm-user-info-form/sqm-user-info-form-view.js +1 -6
  34. package/dist/collection/components/tax-and-cash/useVeriffApp.js +64 -0
  35. package/dist/esm/loader.js +1 -1
  36. package/dist/esm/mint-components.js +1 -1
  37. package/dist/esm/sqm-banking-info-form_16.entry.js +138 -59
  38. package/dist/esm/sqm-big-stat_39.entry.js +55 -15
  39. package/dist/esm/sqm-code-verification.entry.js +4 -4
  40. package/dist/esm/sqm-email-verification.entry.js +4 -4
  41. package/dist/esm/{sqm-invoice-table-view-d1cfdaf4.js → sqm-invoice-table-view-1f26f252.js} +78 -23
  42. package/dist/esm/sqm-stencilbook.entry.js +11 -21
  43. package/dist/esm/sqm-widget-verification-internal.entry.js +7 -1
  44. package/dist/esm/usePayoutStatus-d613ff10.js +1039 -0
  45. package/dist/esm/{useVerificationEmail-c32696ba.js → useVerificationEmail-2a21d0e3.js} +5 -1
  46. package/dist/esm-es5/loader.js +1 -1
  47. package/dist/esm-es5/mint-components.js +1 -1
  48. package/dist/esm-es5/sqm-banking-info-form_16.entry.js +1 -1
  49. package/dist/esm-es5/sqm-big-stat_39.entry.js +1 -1
  50. package/dist/esm-es5/sqm-code-verification.entry.js +1 -1
  51. package/dist/esm-es5/sqm-email-verification.entry.js +1 -1
  52. package/dist/esm-es5/sqm-invoice-table-view-1f26f252.js +1 -0
  53. package/dist/esm-es5/sqm-stencilbook.entry.js +1 -1
  54. package/dist/esm-es5/sqm-widget-verification-internal.entry.js +1 -1
  55. package/dist/esm-es5/usePayoutStatus-d613ff10.js +6 -0
  56. package/dist/esm-es5/useVerificationEmail-2a21d0e3.js +1 -0
  57. package/dist/mint-components/mint-components.esm.js +1 -1
  58. package/dist/mint-components/p-03e1ac96.system.entry.js +1 -0
  59. package/dist/mint-components/p-209eab38.system.js +6 -0
  60. package/dist/mint-components/p-2584baa5.entry.js +16 -0
  61. package/dist/mint-components/p-2c99add0.js +31 -0
  62. package/dist/mint-components/p-635f1cf5.system.entry.js +1 -0
  63. package/dist/mint-components/p-78ec0d48.js +1 -0
  64. package/dist/mint-components/p-7d79f697.system.js +1 -0
  65. package/dist/mint-components/p-9379ee08.js +48 -0
  66. package/dist/mint-components/p-9ddcfcd7.entry.js +195 -0
  67. package/dist/mint-components/p-a567ba84.system.entry.js +1 -0
  68. package/dist/mint-components/p-a8c28561.system.js +1 -0
  69. package/dist/mint-components/p-a9b7e11f.entry.js +25 -0
  70. package/dist/mint-components/{p-1712a9fd.entry.js → p-b24b4d75.entry.js} +2 -2
  71. package/dist/mint-components/{p-331d060e.entry.js → p-b9e863d0.entry.js} +14 -14
  72. package/dist/mint-components/p-c5d26757.system.entry.js +1 -0
  73. package/dist/mint-components/{p-b62faaa5.system.entry.js → p-c5f84a95.system.entry.js} +1 -1
  74. package/dist/mint-components/p-ca809fdd.system.js +1 -1
  75. package/dist/mint-components/{p-e45a8501.system.entry.js → p-f7493ca6.system.entry.js} +1 -1
  76. package/dist/mint-components/{p-24092973.entry.js → p-f7902f51.entry.js} +2 -2
  77. package/dist/types/components/sqm-widget-verification/useVerificationEmail.d.ts +1 -0
  78. package/dist/types/components/tax-and-cash/TaxForm.stories.d.ts +3 -0
  79. package/dist/types/components/tax-and-cash/eventKeys.d.ts +1 -0
  80. package/dist/types/components/tax-and-cash/sqm-payout-details-card/PayoutDetailsCard.stories.d.ts +0 -1
  81. package/dist/types/components/tax-and-cash/sqm-payout-details-card/sqm-payout-details-card-view.d.ts +0 -4
  82. package/dist/types/components/tax-and-cash/sqm-payout-details-card/sqm-payout-details-card.d.ts +1 -16
  83. package/dist/types/components/tax-and-cash/sqm-payout-status-alert/PayoutStatusAlert.stories.d.ts +3 -1
  84. package/dist/types/components/tax-and-cash/sqm-payout-status-alert/sqm-payout-status-alert-view.d.ts +7 -2
  85. package/dist/types/components/tax-and-cash/sqm-payout-status-alert/sqm-payout-status-alert.d.ts +25 -0
  86. package/dist/types/components/tax-and-cash/sqm-payout-status-alert/usePayoutStatus.d.ts +3 -4
  87. package/dist/types/components/tax-and-cash/sqm-tax-and-cash-dashboard/sqm-tax-and-cash-dashboard-view.d.ts +8 -4
  88. package/dist/types/components/tax-and-cash/sqm-tax-and-cash-dashboard/sqm-tax-and-cash-dashboard.d.ts +24 -0
  89. package/dist/types/components/tax-and-cash/useVeriffApp.d.ts +6 -0
  90. package/dist/types/components.d.ts +98 -22
  91. package/docs/docs.docx +0 -0
  92. package/docs/raisins.json +1 -1
  93. package/grapesjs/grapesjs.js +1 -1
  94. package/package.json +2 -1
  95. package/dist/cjs/usePayoutStatus-b9fb7399.js +0 -70
  96. package/dist/esm/usePayoutStatus-1a635054.js +0 -67
  97. package/dist/esm-es5/sqm-invoice-table-view-d1cfdaf4.js +0 -1
  98. package/dist/esm-es5/usePayoutStatus-1a635054.js +0 -1
  99. package/dist/esm-es5/useVerificationEmail-c32696ba.js +0 -1
  100. package/dist/mint-components/p-15c7a1d2.system.entry.js +0 -1
  101. package/dist/mint-components/p-1e616d45.system.js +0 -1
  102. package/dist/mint-components/p-4364001c.entry.js +0 -12
  103. package/dist/mint-components/p-4bd7a472.js +0 -1
  104. package/dist/mint-components/p-517224ef.js +0 -19
  105. package/dist/mint-components/p-5a23b560.system.entry.js +0 -1
  106. package/dist/mint-components/p-8300d8c8.system.js +0 -1
  107. package/dist/mint-components/p-8bddb468.system.entry.js +0 -1
  108. package/dist/mint-components/p-974070c4.system.entry.js +0 -1
  109. package/dist/mint-components/p-c41e1df8.entry.js +0 -195
  110. package/dist/mint-components/p-d7806f31.js +0 -48
  111. package/dist/mint-components/p-e990dc21.system.js +0 -1
  112. package/dist/mint-components/p-f340214f.entry.js +0 -25
@@ -59,6 +59,7 @@ const SubmitImpactCodeMutation = index_module.dist.gql `
59
59
  // ! is done before calling any mutations
60
60
  function useVerificationEmail() {
61
61
  const userIdentity = index_module.K();
62
+ const [verificationEmail, setVerificationEmail] = stencilHooks_module.useState(null);
62
63
  const [hasEmails, setHasEmails] = stencilHooks_module.useState({
63
64
  participant: false,
64
65
  impact: false,
@@ -76,7 +77,7 @@ function useVerificationEmail() {
76
77
  const verifyErrors = verifyMutationErrors || submitImpactCodeErrors;
77
78
  const [initialized, setInitialized] = stencilHooks_module.useState(false);
78
79
  const initialise = async () => {
79
- var _a, _b, _c, _d;
80
+ var _a, _b, _c, _d, _e, _f, _g, _h;
80
81
  try {
81
82
  const lookup = await fetch({});
82
83
  if (!lookup || lookup instanceof Error)
@@ -85,6 +86,8 @@ function useVerificationEmail() {
85
86
  participant: !!((_a = lookup === null || lookup === void 0 ? void 0 : lookup.viewer) === null || _a === void 0 ? void 0 : _a.email),
86
87
  impact: !!((_d = (_c = (_b = lookup === null || lookup === void 0 ? void 0 : lookup.viewer) === null || _b === void 0 ? void 0 : _b.impactConnection) === null || _c === void 0 ? void 0 : _c.user) === null || _d === void 0 ? void 0 : _d.email),
87
88
  });
89
+ setVerificationEmail(((_g = (_f = (_e = lookup === null || lookup === void 0 ? void 0 : lookup.viewer) === null || _e === void 0 ? void 0 : _e.impactConnection) === null || _f === void 0 ? void 0 : _f.user) === null || _g === void 0 ? void 0 : _g.email) || ((_h = lookup === null || lookup === void 0 ? void 0 : lookup.viewer) === null || _h === void 0 ? void 0 : _h.email) ||
90
+ null);
88
91
  setInitialized(true);
89
92
  }
90
93
  catch (e) {
@@ -155,6 +158,7 @@ function useVerificationEmail() {
155
158
  }, []);
156
159
  return {
157
160
  initialized,
161
+ verificationEmail,
158
162
  send: [
159
163
  sendVerificationEmail,
160
164
  { loading: sendLoading, errors: sendErrors },
@@ -46,7 +46,7 @@ export function useWidgetCodeVerification(props) {
46
46
  const [codeRef, setCodeRef] = useState(null);
47
47
  const [validationError, setValidationError] = useState(false);
48
48
  const [emailError, setEmailError] = useState(false);
49
- const { initialized, send: [sendEmail, { loading: sendLoading, errors: sendErrors }], verify: [verifyEmail, { loading: verifyLoading, errors: verifyErrors }], } = useVerificationEmail();
49
+ const { initialized, verificationEmail, send: [sendEmail, { loading: sendLoading, errors: sendErrors }], verify: [verifyEmail, { loading: verifyLoading, errors: verifyErrors }], } = useVerificationEmail();
50
50
  useEffect(() => {
51
51
  if (!codeRef)
52
52
  return;
@@ -66,7 +66,7 @@ export function useWidgetCodeVerification(props) {
66
66
  if (!input)
67
67
  return;
68
68
  if (idx === codeElements.length - 1) {
69
- e.target.value = input.slice(-1);
69
+ e.target.value = input.slice(0, 1);
70
70
  return;
71
71
  }
72
72
  if (input.length > 1) {
@@ -137,7 +137,7 @@ export function useWidgetCodeVerification(props) {
137
137
  codeWrapperRef: setCodeRef,
138
138
  },
139
139
  states: {
140
- email,
140
+ email: verificationEmail,
141
141
  emailResent,
142
142
  resendError: sendErrors || verifyErrors,
143
143
  initialiseLoading: !initialized,
@@ -81,7 +81,7 @@ export function WidgetEmailVerificationView(props) {
81
81
  h(TextSpanView, { type: "p" }, text.verifyEmailHeaderText),
82
82
  h("sl-form", { "onSl-submit": callbacks.submitEmail },
83
83
  h("div", { class: sheet.classes.InputsContainer },
84
- h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", label: text.emailLabel, value: states.email, type: "email", id: "email", name: "email", disabled: !!states.email || states.loading }, (states.error
84
+ h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", label: text.emailLabel, value: states.email || "", type: "email", id: "email", name: "email", disabled: !!states.email || states.loading }, (states.error
85
85
  ? {
86
86
  class: sheet.classes.ErrorInput,
87
87
  helpText: text.emailValidationErrorText,
@@ -5,7 +5,7 @@ import { SHOW_CODE_NAMESPACE, VERIFICATION_EMAIL_NAMESPACE } from "../keys";
5
5
  import { useVerificationEmail } from "../useVerificationEmail";
6
6
  export const UpsertUserEmailMutation = gql `
7
7
  mutation upsertUser($userInput: UserInput!) {
8
- user(userInput: $userInput) {
8
+ upsertUser(userInput: $userInput) {
9
9
  id
10
10
  accountId
11
11
  email
@@ -35,7 +35,7 @@ export function useUpsertUserEmail() {
35
35
  const upsertUserEmail = async (email) => {
36
36
  try {
37
37
  const result = await request({
38
- user: {
38
+ userInput: {
39
39
  id: user.id,
40
40
  accountId: user.accountId,
41
41
  email,
@@ -14,6 +14,10 @@ const USER_LOOKUP = gql `
14
14
  accountId
15
15
  email
16
16
  emailVerified
17
+ managedIdentity {
18
+ email
19
+ emailVerified
20
+ }
17
21
  }
18
22
  }
19
23
  }
@@ -33,13 +37,15 @@ function useWidgetVerificationInternal() {
33
37
  const [fetch] = useLazyQuery(USER_LOOKUP);
34
38
  useEffect(() => {
35
39
  const checkUser = async () => {
36
- var _a;
40
+ var _a, _b, _c;
37
41
  try {
38
42
  const res = await fetch({});
39
43
  if (!res || res instanceof Error)
40
44
  throw new Error();
41
45
  if ((_a = res === null || res === void 0 ? void 0 : res.viewer) === null || _a === void 0 ? void 0 : _a.emailVerified)
42
46
  setContext(true);
47
+ else if ((_c = (_b = res === null || res === void 0 ? void 0 : res.viewer) === null || _b === void 0 ? void 0 : _b.managedIdentity) === null || _c === void 0 ? void 0 : _c.emailVerified)
48
+ setContext(true);
43
49
  }
44
50
  catch (e) {
45
51
  console.error("Could not fetch user information:", e);
@@ -57,6 +57,7 @@ const SubmitImpactCodeMutation = gql `
57
57
  // ! is done before calling any mutations
58
58
  export function useVerificationEmail() {
59
59
  const userIdentity = useUserIdentity();
60
+ const [verificationEmail, setVerificationEmail] = useState(null);
60
61
  const [hasEmails, setHasEmails] = useState({
61
62
  participant: false,
62
63
  impact: false,
@@ -74,7 +75,7 @@ export function useVerificationEmail() {
74
75
  const verifyErrors = verifyMutationErrors || submitImpactCodeErrors;
75
76
  const [initialized, setInitialized] = useState(false);
76
77
  const initialise = async () => {
77
- var _a, _b, _c, _d;
78
+ var _a, _b, _c, _d, _e, _f, _g, _h;
78
79
  try {
79
80
  const lookup = await fetch({});
80
81
  if (!lookup || lookup instanceof Error)
@@ -83,6 +84,8 @@ export function useVerificationEmail() {
83
84
  participant: !!((_a = lookup === null || lookup === void 0 ? void 0 : lookup.viewer) === null || _a === void 0 ? void 0 : _a.email),
84
85
  impact: !!((_d = (_c = (_b = lookup === null || lookup === void 0 ? void 0 : lookup.viewer) === null || _b === void 0 ? void 0 : _b.impactConnection) === null || _c === void 0 ? void 0 : _c.user) === null || _d === void 0 ? void 0 : _d.email),
85
86
  });
87
+ setVerificationEmail(((_g = (_f = (_e = lookup === null || lookup === void 0 ? void 0 : lookup.viewer) === null || _e === void 0 ? void 0 : _e.impactConnection) === null || _f === void 0 ? void 0 : _f.user) === null || _g === void 0 ? void 0 : _g.email) || ((_h = lookup === null || lookup === void 0 ? void 0 : lookup.viewer) === null || _h === void 0 ? void 0 : _h.email) ||
88
+ null);
86
89
  setInitialized(true);
87
90
  }
88
91
  catch (e) {
@@ -153,6 +156,7 @@ export function useVerificationEmail() {
153
156
  }, []);
154
157
  return {
155
158
  initialized,
159
+ verificationEmail,
156
160
  send: [
157
161
  sendVerificationEmail,
158
162
  { loading: sendLoading, errors: sendErrors },
@@ -247,7 +247,7 @@ const docusignFormProps = {
247
247
  };
248
248
  const dashboardProps = {
249
249
  states: {
250
- showVerifyIdentity: false,
250
+ veriffLoading: false,
251
251
  payoutStatus: "DONE",
252
252
  canEditPayoutInfo: true,
253
253
  disabled: false,
@@ -768,7 +768,7 @@ export const TaxAndCashDashboardActiveW8BENForm = () => {
768
768
  ...dashboardProps,
769
769
  states: {
770
770
  payoutStatus: "DONE",
771
- showVerifyIdentity: false,
771
+ veriffLoading: false,
772
772
  noFormNeeded: false,
773
773
  canEditPayoutInfo: true,
774
774
  documentType: "W8BEN",
@@ -786,7 +786,7 @@ export const TaxAndCashDashboardActiveW8BENEForm = () => {
786
786
  ...dashboardProps,
787
787
  states: {
788
788
  payoutStatus: "DONE",
789
- showVerifyIdentity: false,
789
+ veriffLoading: false,
790
790
  noFormNeeded: false,
791
791
  canEditPayoutInfo: true,
792
792
  documentType: "W8BENE",
@@ -804,7 +804,7 @@ export const TaxAndCashDashboardNotActiveW9Form = () => {
804
804
  ...dashboardProps,
805
805
  states: {
806
806
  payoutStatus: "DONE",
807
- showVerifyIdentity: false,
807
+ veriffLoading: false,
808
808
  noFormNeeded: false,
809
809
  canEditPayoutInfo: true,
810
810
  status: "INACTIVE",
@@ -823,7 +823,6 @@ export const TaxAndCashDashboardNotVerifiedW9Form = () => {
823
823
  ...dashboardProps,
824
824
  states: {
825
825
  payoutStatus: "DONE",
826
- showVerifyIdentity: false,
827
826
  canEditPayoutInfo: true,
828
827
  disabled: false,
829
828
  status: "NOT_VERIFIED",
@@ -835,6 +834,7 @@ export const TaxAndCashDashboardNotVerifiedW9Form = () => {
835
834
  indirectTaxNumber: "123456",
836
835
  showNewFormDialog: false,
837
836
  hasHold: false,
837
+ veriffLoading: false,
838
838
  },
839
839
  } }));
840
840
  };
@@ -843,7 +843,7 @@ export const TaxAndCashDashboardNotVerifiedW8BENForm = () => {
843
843
  ...dashboardProps,
844
844
  states: {
845
845
  payoutStatus: "DONE",
846
- showVerifyIdentity: false,
846
+ veriffLoading: false,
847
847
  canEditPayoutInfo: true,
848
848
  disabled: false,
849
849
  status: "NOT_VERIFIED",
@@ -864,7 +864,7 @@ export const TaxAndCashDashboardNotVerifiedW8BENEForm = () => {
864
864
  ...dashboardProps,
865
865
  states: {
866
866
  payoutStatus: "DONE",
867
- showVerifyIdentity: false,
867
+ veriffLoading: false,
868
868
  canEditPayoutInfo: true,
869
869
  disabled: false,
870
870
  status: "NOT_VERIFIED",
@@ -885,7 +885,7 @@ export const TaxAndCashDashboardNotActiveW8BENEForm = () => {
885
885
  ...dashboardProps,
886
886
  states: {
887
887
  payoutStatus: "DONE",
888
- showVerifyIdentity: false,
888
+ veriffLoading: false,
889
889
  canEditPayoutInfo: true,
890
890
  disabled: false,
891
891
  status: "NOT_ACTIVE",
@@ -906,7 +906,7 @@ export const TaxAndCashDashboardNoFormNeeded = () => {
906
906
  ...dashboardProps,
907
907
  states: {
908
908
  payoutStatus: "DONE",
909
- showVerifyIdentity: false,
909
+ veriffLoading: false,
910
910
  canEditPayoutInfo: true,
911
911
  disabled: false,
912
912
  documentType: "W9",
@@ -927,7 +927,7 @@ export const TaxAndCashDashboardIndirectTaxCanada = () => {
927
927
  ...dashboardProps,
928
928
  states: {
929
929
  payoutStatus: "DONE",
930
- showVerifyIdentity: false,
930
+ veriffLoading: false,
931
931
  canEditPayoutInfo: true,
932
932
  status: "ACTIVE",
933
933
  disabled: false,
@@ -949,7 +949,7 @@ export const TaxAndCashDashboardIndirectTaxCanadaQuebec = () => {
949
949
  ...dashboardProps,
950
950
  states: {
951
951
  payoutStatus: "DONE",
952
- showVerifyIdentity: false,
952
+ veriffLoading: false,
953
953
  canEditPayoutInfo: true,
954
954
  status: "ACTIVE",
955
955
  disabled: false,
@@ -972,7 +972,7 @@ export const TaxAndCashDashboardIndirectTaxSpain = () => {
972
972
  ...dashboardProps,
973
973
  states: {
974
974
  payoutStatus: "DONE",
975
- showVerifyIdentity: false,
975
+ veriffLoading: false,
976
976
  canEditPayoutInfo: true,
977
977
  status: "ACTIVE",
978
978
  disabled: false,
@@ -995,7 +995,7 @@ export const TaxAndCashDashboardIndirectTaxNotRegistered = () => {
995
995
  ...dashboardProps,
996
996
  states: {
997
997
  payoutStatus: "DONE",
998
- showVerifyIdentity: false,
998
+ veriffLoading: false,
999
999
  canEditPayoutInfo: true,
1000
1000
  status: "ACTIVE",
1001
1001
  documentType: "W8BEN",
@@ -1012,10 +1012,62 @@ export const TaxAndCashDashboardIdentityVerifcationRequired = () => {
1012
1012
  return (h("sqm-tax-and-cash-dashboard", { demoData: {
1013
1013
  ...dashboardProps,
1014
1014
  states: {
1015
- payoutStatus: "VERIFICATION_NEEDED",
1016
- showVerifyIdentity: true,
1017
- showIdentityVerificationDialog: true,
1018
- identiyRequired: true,
1015
+ payoutStatus: "VERIFICATION:REQUIRED",
1016
+ veriffLoading: false,
1017
+ canEditPayoutInfo: true,
1018
+ status: "ACTIVE",
1019
+ documentType: "W8BEN",
1020
+ documentTypeString: taxTypeToName("W8BEN"),
1021
+ dateSubmitted: "Jan 18th, 2025",
1022
+ noFormNeeded: false,
1023
+ notRegistered: true,
1024
+ showNewFormDialog: false,
1025
+ hasHold: false,
1026
+ },
1027
+ } }));
1028
+ };
1029
+ export const TaxAndCashDashboardIdentityVerifcationRequiredInternal = () => {
1030
+ return (h("sqm-tax-and-cash-dashboard", { demoData: {
1031
+ ...dashboardProps,
1032
+ states: {
1033
+ payoutStatus: "VERIFICATION:INTERNAL",
1034
+ veriffLoading: false,
1035
+ canEditPayoutInfo: true,
1036
+ status: "ACTIVE",
1037
+ documentType: "W8BEN",
1038
+ documentTypeString: taxTypeToName("W8BEN"),
1039
+ dateSubmitted: "Jan 18th, 2025",
1040
+ noFormNeeded: false,
1041
+ notRegistered: true,
1042
+ showNewFormDialog: false,
1043
+ hasHold: false,
1044
+ },
1045
+ } }));
1046
+ };
1047
+ export const TaxAndCashDashboardIdentityVerifcationReviewInternal = () => {
1048
+ return (h("sqm-tax-and-cash-dashboard", { demoData: {
1049
+ ...dashboardProps,
1050
+ states: {
1051
+ payoutStatus: "VERIFICATION:REVIEW",
1052
+ veriffLoading: false,
1053
+ canEditPayoutInfo: true,
1054
+ status: "ACTIVE",
1055
+ documentType: "W8BEN",
1056
+ documentTypeString: taxTypeToName("W8BEN"),
1057
+ dateSubmitted: "Jan 18th, 2025",
1058
+ noFormNeeded: false,
1059
+ notRegistered: true,
1060
+ showNewFormDialog: false,
1061
+ hasHold: false,
1062
+ },
1063
+ } }));
1064
+ };
1065
+ export const TaxAndCashDashboardIdentityVerifcationFailedInternal = () => {
1066
+ return (h("sqm-tax-and-cash-dashboard", { demoData: {
1067
+ ...dashboardProps,
1068
+ states: {
1069
+ payoutStatus: "VERIFICATION:FAILED",
1070
+ veriffLoading: false,
1019
1071
  canEditPayoutInfo: true,
1020
1072
  status: "ACTIVE",
1021
1073
  documentType: "W8BEN",
@@ -1033,7 +1085,7 @@ export const TaxAndCashDashboardNewTaxForm = () => {
1033
1085
  ...dashboardProps,
1034
1086
  states: {
1035
1087
  payoutStatus: "DONE",
1036
- showVerifyIdentity: false,
1088
+ veriffLoading: false,
1037
1089
  canEditPayoutInfo: true,
1038
1090
  status: "ACTIVE",
1039
1091
  documentType: "W8BEN",
@@ -1051,7 +1103,7 @@ export const TaxAndCashDashboardPayoutsOnHold = () => {
1051
1103
  ...dashboardProps,
1052
1104
  states: {
1053
1105
  payoutStatus: "DONE",
1054
- showVerifyIdentity: false,
1106
+ veriffLoading: false,
1055
1107
  canEditPayoutInfo: true,
1056
1108
  disabled: true,
1057
1109
  status: "ACTIVE",
@@ -1071,7 +1123,7 @@ export const TaxAndCashDashboardLoading = () => {
1071
1123
  ...dashboardProps,
1072
1124
  states: {
1073
1125
  payoutStatus: "DONE",
1074
- showVerifyIdentity: false,
1126
+ veriffLoading: false,
1075
1127
  canEditPayoutInfo: true,
1076
1128
  disabled: false,
1077
1129
  status: "ACTIVE",
@@ -1090,7 +1142,7 @@ export const TaxAndCashDashboardWithLoadingError = () => {
1090
1142
  ...dashboardProps,
1091
1143
  states: {
1092
1144
  payoutStatus: "DONE",
1093
- showVerifyIdentity: false,
1145
+ veriffLoading: false,
1094
1146
  disabled: false,
1095
1147
  canEditPayoutInfo: true,
1096
1148
  status: "ACTIVE",
@@ -1110,7 +1162,7 @@ export const TaxAndCashDashboardWithGeneralError = () => {
1110
1162
  ...dashboardProps,
1111
1163
  states: {
1112
1164
  payoutStatus: "DONE",
1113
- showVerifyIdentity: false,
1165
+ veriffLoading: false,
1114
1166
  canEditPayoutInfo: true,
1115
1167
  disabled: false,
1116
1168
  status: "ACTIVE",
@@ -1134,7 +1186,7 @@ export const TaxAndCashDashboardDisabled = () => {
1134
1186
  ...dashboardProps,
1135
1187
  states: {
1136
1188
  payoutStatus: "DONE",
1137
- showVerifyIdentity: false,
1189
+ veriffLoading: false,
1138
1190
  canEditPayoutInfo: true,
1139
1191
  disabled: true,
1140
1192
  status: "ACTIVE",
@@ -0,0 +1 @@
1
+ export const TAX_FORM_UPDATED_EVENT_KEY = "sqm:tax-form-updated";
@@ -319,14 +319,14 @@ export class BankingInfoForm {
319
319
  return (h(Host, null,
320
320
  h(BankingInfoFormView, { callbacks: props.callbacks, text: props.text, states: props.states, refs: props.refs, slots: {
321
321
  formInputsSlot: inputFields === null || inputFields === void 0 ? void 0 : inputFields.map(({ input }) => input),
322
- countryInputSlot: (h("sl-select", Object.assign({ label: props.text.bankLocationLabel, required: true, name: "/bankCountry", id: "bankCountry", value: props.states.formState.bankCountry || "", "onSl-select": (e) => { var _a, _b; return props.callbacks.setBankCountry((_b = (_a = e.detail) === null || _a === void 0 ? void 0 : _a.item) === null || _b === void 0 ? void 0 : _b.value); } }, (((_a = errors === null || errors === void 0 ? void 0 : errors.inputErrors) === null || _a === void 0 ? void 0 : _a.bankCountry) && {
322
+ countryInputSlot: (h("sl-select", Object.assign({ label: props.text.bankLocationLabel, disabled: props.states.saveLoading, required: true, name: "/bankCountry", id: "bankCountry", value: props.states.formState.bankCountry || "", "onSl-select": (e) => { var _a, _b; return props.callbacks.setBankCountry((_b = (_a = e.detail) === null || _a === void 0 ? void 0 : _a.item) === null || _b === void 0 ? void 0 : _b.value); } }, (((_a = errors === null || errors === void 0 ? void 0 : errors.inputErrors) === null || _a === void 0 ? void 0 : _a.bankCountry) && {
323
323
  class: "error-input",
324
324
  helpText: getValidationErrorMessage({
325
325
  type: (_c = (_b = errors === null || errors === void 0 ? void 0 : errors.inputErrors) === null || _b === void 0 ? void 0 : _b.bankCountry) === null || _c === void 0 ? void 0 : _c.type,
326
326
  label: props.text.bankLocationLabel,
327
327
  }),
328
328
  })),
329
- h("sl-input", { class: searchStyle.SearchInput, placeholder: this.searchForCountryText, onKeyDown: (e) => {
329
+ h("sl-input", { disabled: props.states.saveLoading, class: searchStyle.SearchInput, placeholder: this.searchForCountryText, onKeyDown: (e) => {
330
330
  // Stop shoelace intercepting key presses
331
331
  e.stopPropagation();
332
332
  }, "onSl-input": (e) => {
@@ -337,14 +337,14 @@ export class BankingInfoForm {
337
337
  }), (_f = (_e = props.states) === null || _e === void 0 ? void 0 : _e.allCountries) === null || _f === void 0 ? void 0 :
338
338
  _f.map((c) => (h("sl-menu-item", { value: c.countryCode, style: { display: "none" } }, c.displayName))))),
339
339
  paymentMethodSlot: (h("sl-input", { key: "paymentMethod", label: props.text.paymentMethod, placeholder: props.states.paymentMethodFeeLabel, disabled: true })),
340
- paymentThresholdSelectSlot: (h("sl-select", Object.assign({ required: true, label: props.text.paymentThresholdSelectLabel, name: "/paymentThreshold", id: "paymentThreshold", value: ((_h = (_g = props.states) === null || _g === void 0 ? void 0 : _g.formState) === null || _h === void 0 ? void 0 : _h.paymentThreshold) || "" }, (((_j = errors === null || errors === void 0 ? void 0 : errors.inputErrors) === null || _j === void 0 ? void 0 : _j.paymentThreshold) && {
340
+ paymentThresholdSelectSlot: (h("sl-select", Object.assign({ required: true, disabled: props.states.saveLoading, label: props.text.paymentThresholdSelectLabel, name: "/paymentThreshold", id: "paymentThreshold", value: ((_h = (_g = props.states) === null || _g === void 0 ? void 0 : _g.formState) === null || _h === void 0 ? void 0 : _h.paymentThreshold) || "" }, (((_j = errors === null || errors === void 0 ? void 0 : errors.inputErrors) === null || _j === void 0 ? void 0 : _j.paymentThreshold) && {
341
341
  class: "error-input",
342
342
  helpText: getValidationErrorMessage({
343
343
  type: (_l = (_k = errors === null || errors === void 0 ? void 0 : errors.inputErrors) === null || _k === void 0 ? void 0 : _k.paymentThreshold) === null || _l === void 0 ? void 0 : _l.type,
344
344
  label: props.text.paymentThresholdSelectLabel,
345
345
  }),
346
346
  })), props.states.thresholds.map((t) => (h("sl-menu-item", { value: t }, `${props.states.currency}${t}`))))),
347
- paymentFixedDaySelectSlot: (h("sl-select", Object.assign({ required: true, label: props.text.paymentDaySelectLabel, value: ((_o = (_m = props.states) === null || _m === void 0 ? void 0 : _m.formState) === null || _o === void 0 ? void 0 : _o.paymentDay) || "", name: "/paymentDay", id: "paymentDay" }, (((_p = errors === null || errors === void 0 ? void 0 : errors.inputErrors) === null || _p === void 0 ? void 0 : _p.paymentDay) && {
347
+ paymentFixedDaySelectSlot: (h("sl-select", Object.assign({ required: true, disabled: props.states.saveLoading, label: props.text.paymentDaySelectLabel, value: ((_o = (_m = props.states) === null || _m === void 0 ? void 0 : _m.formState) === null || _o === void 0 ? void 0 : _o.paymentDay) || "", name: "/paymentDay", id: "paymentDay" }, (((_p = errors === null || errors === void 0 ? void 0 : errors.inputErrors) === null || _p === void 0 ? void 0 : _p.paymentDay) && {
348
348
  class: "error-input",
349
349
  helpText: getValidationErrorMessage({
350
350
  type: (_r = (_q = errors === null || errors === void 0 ? void 0 : errors.inputErrors) === null || _q === void 0 ? void 0 : _q.paymentDay) === null || _r === void 0 ? void 0 : _r.type,
@@ -353,7 +353,7 @@ export class BankingInfoForm {
353
353
  })),
354
354
  h("sl-menu-item", { value: "1" }, props.text.paymentDayFirstOfMonthLabelText),
355
355
  h("sl-menu-item", { value: "15" }, props.text.paymentDayFifteenthOfMonthLabelText))),
356
- paypalInputSlot: (h("sl-input", Object.assign({ required: true, value: ((_t = (_s = props.states) === null || _s === void 0 ? void 0 : _s.formState) === null || _t === void 0 ? void 0 : _t.paypalEmailAddress) || "", label: props.text.payPalInputLabel, key: "paypalEmailAddress", name: "/paypalEmailAddress", id: "paypalEmailAddress", type: "text" }, (((_w = (_v = (_u = props.states.formState) === null || _u === void 0 ? void 0 : _u.errors) === null || _v === void 0 ? void 0 : _v.inputErrors) === null || _w === void 0 ? void 0 : _w.paypalEmailAddress) && {
356
+ paypalInputSlot: (h("sl-input", Object.assign({ required: true, disabled: props.states.saveLoading, value: ((_t = (_s = props.states) === null || _s === void 0 ? void 0 : _s.formState) === null || _t === void 0 ? void 0 : _t.paypalEmailAddress) || "", label: props.text.payPalInputLabel, key: "paypalEmailAddress", name: "/paypalEmailAddress", id: "paypalEmailAddress", type: "text" }, (((_w = (_v = (_u = props.states.formState) === null || _u === void 0 ? void 0 : _u.errors) === null || _v === void 0 ? void 0 : _v.inputErrors) === null || _w === void 0 ? void 0 : _w.paypalEmailAddress) && {
357
357
  class: "error-input",
358
358
  helpText: getValidationErrorMessage({
359
359
  type: (_0 = (_z = (_y = (_x = props.states.formState) === null || _x === void 0 ? void 0 : _x.errors) === null || _y === void 0 ? void 0 : _y.inputErrors) === null || _z === void 0 ? void 0 : _z.paypalEmailAddress) === null || _0 === void 0 ? void 0 : _0.type,
@@ -5,6 +5,7 @@ import JSONPointer from "jsonpointer";
5
5
  import { intl } from "../../../global/global";
6
6
  import { FINANCE_NETWORK_SETTINGS_NAMESPACE, SORTED_COUNTRIES_NAMESPACE, TAX_CONTEXT_NAMESPACE, TAX_FORM_CONTEXT_NAMESPACE, USER_QUERY_NAMESPACE, } from "../sqm-tax-and-cash/data";
7
7
  import { VERIFICATION_EVENT_KEY } from "../../sqm-widget-verification/keys";
8
+ import { TAX_FORM_UPDATED_EVENT_KEY } from "../eventKeys";
8
9
  // Hardcoded in Impact backend
9
10
  export const paypalFeeMap = {
10
11
  USD: "USD20.00",
@@ -244,6 +245,8 @@ export function useBankingInfoForm(props) {
244
245
  });
245
246
  return;
246
247
  }
248
+ // Fire form change event
249
+ window.dispatchEvent(new Event(TAX_FORM_UPDATED_EVENT_KEY));
247
250
  await refetch();
248
251
  setStep("/dashboard");
249
252
  }
@@ -3,6 +3,7 @@ import { useEffect, useState } from "@saasquatch/universal-hooks";
3
3
  import { gql } from "graphql-request";
4
4
  import { TAX_CONTEXT_NAMESPACE, TAX_FORM_CONTEXT_NAMESPACE, USER_QUERY_NAMESPACE, } from "../sqm-tax-and-cash/data";
5
5
  import { taxTypeToName, validTaxDocument } from "../utils";
6
+ import { TAX_FORM_UPDATED_EVENT_KEY } from "../eventKeys";
6
7
  const GET_TAX_DOCUMENT = gql `
7
8
  mutation createImpactPublisherTaxDocument(
8
9
  $vars: CreateImpactPublisherTaxDocumentInput!
@@ -101,6 +102,8 @@ export function useDocusignForm(props) {
101
102
  // @ts-expect-error: no data type for result
102
103
  if (!result.completeImpactPublisherTaxDocument.success)
103
104
  throw new Error();
105
+ // Fire form change event
106
+ window.dispatchEvent(new Event(TAX_FORM_UPDATED_EVENT_KEY));
104
107
  setShowExitButton(true);
105
108
  }
106
109
  catch (e) {
@@ -5,6 +5,7 @@ import JSONPointer from "jsonpointer";
5
5
  import { COUNTRIES_QUERY_NAMESPACE, TAX_CONTEXT_NAMESPACE, TAX_FORM_CONTEXT_NAMESPACE, USER_FORM_CONTEXT_NAMESPACE, USER_QUERY_NAMESPACE, } from "../sqm-tax-and-cash/data";
6
6
  import { INDIRECT_TAX_PROVINCES, INDIRECT_TAX_SPAIN_REGIONS, } from "../subregions";
7
7
  import { getCountryObj, validTaxDocument } from "../utils";
8
+ import { TAX_FORM_UPDATED_EVENT_KEY } from "../eventKeys";
8
9
  const CONNECT_PARTNER = gql `
9
10
  mutation createImpactConnection($vars: ImpactConnectionInput!) {
10
11
  createImpactConnection(impactConnectionInput: $vars) {
@@ -169,6 +170,8 @@ export function useIndirectTaxForm(props) {
169
170
  const resultPublisher = (_e = (_d = (_c = result
170
171
  .createImpactConnection) === null || _c === void 0 ? void 0 : _c.user) === null || _d === void 0 ? void 0 : _d.impactConnection) === null || _e === void 0 ? void 0 : _e.publisher;
171
172
  const hasValidCurrentDocument = validTaxDocument(resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.requiredTaxDocumentType) && (resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.currentTaxDocument);
173
+ // Fire form change event
174
+ window.dispatchEvent(new Event(TAX_FORM_UPDATED_EVENT_KEY));
172
175
  if ((resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.requiredTaxDocumentType) &&
173
176
  !hasValidCurrentDocument) {
174
177
  // Go to docusign form
@@ -9,13 +9,6 @@ export const Loading = () => {
9
9
  },
10
10
  } }));
11
11
  };
12
- export const Error = () => {
13
- return (h("sqm-payout-details-card", { demoData: {
14
- states: {
15
- error: true,
16
- },
17
- } }));
18
- };
19
12
  export const NextPayout = () => {
20
13
  return (h("sqm-payout-details-card", { demoData: {
21
14
  states: {
@@ -166,11 +166,6 @@ export function PayoutDetailsCardView(props) {
166
166
  });
167
167
  return (h("div", { class: classes.Container },
168
168
  h("style", { type: "text/css" }, styleString),
169
- states.error && (h("sl-alert", { exportparts: "base: alert-base, icon:alert-icon", class: classes.Alert, type: "warning", open: true },
170
- h("sl-icon", { slot: "icon", name: "exclamation-triangle" }),
171
- h("div", { class: classes.AlertContent },
172
- h("b", null, text.error.errorTitleText),
173
- text.error.errorDescriptionText))),
174
169
  states.loading ? (renderLoadingSkeleton()) : (h("div", { class: classes.CardContainer },
175
170
  h("div", { class: classes.StatusContainer },
176
171
  h("p", { class: classes.SubduedRegularText }, states.badgeStatus === "thresholdPayout"
@@ -26,16 +26,6 @@ export class PayoutDetailsCard {
26
26
  * @uiName Bank account field label
27
27
  */
28
28
  this.accountText = "Account";
29
- /**
30
- * Part of the alert displayed at the top of the page when there’s been an issue preventing payouts.
31
- * @uiName Payout error message title
32
- */
33
- this.errorTitleText = "Your payout is on hold ";
34
- /**
35
- * Part of the alert displayed at the top of the page when there’s been an issue preventing payouts.
36
- * @uiName Payout error message description
37
- */
38
- this.errorDescriptionText = "If you’ve recently added your payout information, please wait while we verify your information. If it’s still on hold after a few days, please contact Support or check your inbox for an email from our referral program provider, impact.com.";
39
29
  /**
40
30
  * Text displayed for existing publishers that do not have saved banking information.
41
31
  * @uiName Payout missing information subtext
@@ -48,10 +38,6 @@ export class PayoutDetailsCard {
48
38
  const props = getProps(this);
49
39
  return {
50
40
  ...props,
51
- error: {
52
- errorTitleText: this.errorTitleText,
53
- errorDescriptionText: this.errorDescriptionText,
54
- },
55
41
  };
56
42
  }
57
43
  render() {
@@ -127,48 +113,6 @@ export class PayoutDetailsCard {
127
113
  "reflect": false,
128
114
  "defaultValue": "\"Account\""
129
115
  },
130
- "errorTitleText": {
131
- "type": "string",
132
- "mutable": false,
133
- "complexType": {
134
- "original": "string",
135
- "resolved": "string",
136
- "references": {}
137
- },
138
- "required": false,
139
- "optional": false,
140
- "docs": {
141
- "tags": [{
142
- "text": "Payout error message title",
143
- "name": "uiName"
144
- }],
145
- "text": "Part of the alert displayed at the top of the page when there\u2019s been an issue preventing payouts."
146
- },
147
- "attribute": "error-title-text",
148
- "reflect": false,
149
- "defaultValue": "\"Your payout is on hold \""
150
- },
151
- "errorDescriptionText": {
152
- "type": "string",
153
- "mutable": false,
154
- "complexType": {
155
- "original": "string",
156
- "resolved": "string",
157
- "references": {}
158
- },
159
- "required": false,
160
- "optional": false,
161
- "docs": {
162
- "tags": [{
163
- "text": "Payout error message description",
164
- "name": "uiName"
165
- }],
166
- "text": "Part of the alert displayed at the top of the page when there\u2019s been an issue preventing payouts."
167
- },
168
- "attribute": "error-description-text",
169
- "reflect": false,
170
- "defaultValue": "\"If you\u2019ve recently added your payout information, please wait while we verify your information. If it\u2019s still on hold after a few days, please contact Support or check your inbox for an email from our referral program provider, impact.com.\""
171
- },
172
116
  "payoutMissingInformationText": {
173
117
  "type": "string",
174
118
  "mutable": false,
@@ -6,17 +6,13 @@ const defaultProps = {
6
6
  error: false,
7
7
  status: "INFORMATION_REQUIRED",
8
8
  loading: false,
9
- showVerifyIdentity: false,
9
+ veriffLoading: false,
10
10
  };
11
11
  export const InformationRequired = () => (h("sqm-payout-status-alert", { demoData: { states: defaultProps } }));
12
- export const VerifyIdentity = () => (h("sqm-payout-status-alert", { demoData: { states: { ...defaultProps, status: "VERIFICATION_NEEDED" } } }));
13
- export const VerifyIdentityOpen = () => (h("sqm-payout-status-alert", { demoData: {
14
- states: {
15
- ...defaultProps,
16
- status: "VERIFICATION_NEEDED",
17
- showVerifyIdentity: true,
18
- },
19
- } }));
12
+ export const VerifyIdentity = () => (h("sqm-payout-status-alert", { demoData: { states: { ...defaultProps, status: "VERIFICATION:REQUIRED" } } }));
13
+ export const VerifyIdentityRequiredInternal = () => (h("sqm-payout-status-alert", { demoData: { states: { ...defaultProps, status: "VERIFICATION:INTERNAL" } } }));
14
+ export const VerifyIdentityReviewInternal = () => (h("sqm-payout-status-alert", { demoData: { states: { ...defaultProps, status: "VERIFICATION:REVIEW" } } }));
15
+ export const VerifyIdentityFailedInternal = () => (h("sqm-payout-status-alert", { demoData: { states: { ...defaultProps, status: "VERIFICATION:FAILED" } } }));
20
16
  export const Hold = () => (h("sqm-payout-status-alert", { demoData: { states: { ...defaultProps, status: "HOLD" } } }));
21
17
  export const Loading = () => (h("sqm-payout-status-alert", { demoData: { states: { ...defaultProps, loading: true } } }));
22
18
  export const Error = () => (h("sqm-payout-status-alert", { demoData: { states: { ...defaultProps, error: true } } }));