@saasquatch/mint-components 2.0.2-4 → 2.0.2-6

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 (184) hide show
  1. package/dist/cjs/{IndirectTaxDetailsView-e5f70b8b.js → IndirectTaxDetailsView-dce2a79b.js} +2 -2
  2. package/dist/cjs/{ShadowViewAddon-925a8fa6.js → ShadowViewAddon-357bc625.js} +8 -8
  3. package/dist/cjs/{usePayoutStatus-95874989.js → data-16106637.js} +129 -155
  4. package/dist/cjs/{global-8bba5b3a.js → global-3d01d469.js} +5 -1
  5. package/dist/cjs/loader.cjs.js +2 -2
  6. package/dist/cjs/mint-components.cjs.js +2 -2
  7. package/dist/cjs/sqm-banking-info-form_10.cjs.entry.js +114 -344
  8. package/dist/cjs/sqm-big-stat_47.cjs.entry.js +29 -224
  9. package/dist/cjs/sqm-code-verification.cjs.entry.js +1 -1
  10. package/dist/cjs/sqm-email-verification.cjs.entry.js +1 -1
  11. package/dist/cjs/sqm-empty_4.cjs.entry.js +1 -1
  12. package/dist/cjs/sqm-header-logo.cjs.entry.js +1 -14
  13. package/dist/cjs/{sqm-lead-checkbox-field-view-340acad0.js → sqm-lead-checkbox-field-view-ebb9ead9.js} +1 -1
  14. package/dist/cjs/sqm-lead-checkbox-field.cjs.entry.js +3 -3
  15. package/dist/cjs/{sqm-lead-input-field-view-06ed3632.js → sqm-lead-input-field-view-62debb73.js} +1 -1
  16. package/dist/cjs/sqm-lead-input-field.cjs.entry.js +3 -3
  17. package/dist/cjs/sqm-leaderboard-rank.cjs.entry.js +1 -1
  18. package/dist/cjs/sqm-pagination_3.cjs.entry.js +1 -1
  19. package/dist/cjs/{sqm-portal-email-verification-view-5518eb0d.js → sqm-portal-email-verification-view-c280139a.js} +1 -1
  20. package/dist/cjs/sqm-portal-email-verification.cjs.entry.js +2 -2
  21. package/dist/cjs/{sqm-portal-profile-view-615e6975.js → sqm-portal-profile-view-7bca5749.js} +1 -1
  22. package/dist/cjs/sqm-portal-profile.cjs.entry.js +2 -2
  23. package/dist/cjs/sqm-referral-table_11.cjs.entry.js +1 -1
  24. package/dist/cjs/sqm-rewards-table_9.cjs.entry.js +1 -1
  25. package/dist/cjs/sqm-stencilbook.cjs.entry.js +8 -9
  26. package/dist/cjs/{useLeadFormState-fd0445f9.js → useLeadFormState-593f5d39.js} +1 -1
  27. package/dist/cjs/{utils-83d125fa.js → utils-5167439f.js} +1 -1
  28. package/dist/collection/components/sqm-header-logo/sqm-header-logo.js +3 -80
  29. package/dist/collection/components/sqm-portal-footer/sqm-portal-footer-view.js +3 -3
  30. package/dist/collection/components/sqm-reward-exchange-list/sqm-reward-exchange-list-view.js +4 -4
  31. package/dist/collection/components/tax-and-cash/TaxForm.stories.js +0 -1
  32. package/dist/collection/components/tax-and-cash/sqm-banking-info-form/useBankingInfoForm.js +1 -2
  33. package/dist/collection/components/tax-and-cash/sqm-indirect-tax-form/useIndirectTaxForm.js +40 -46
  34. package/dist/collection/components/tax-and-cash/sqm-payout-status-alert/sqm-payout-status-alert-view.js +2 -90
  35. package/dist/collection/components/tax-and-cash/sqm-payout-status-alert/sqm-payout-status-alert.js +0 -353
  36. package/dist/collection/components/tax-and-cash/sqm-payout-status-alert/usePayoutStatus.js +3 -30
  37. package/dist/collection/components/tax-and-cash/sqm-tax-and-cash/sqm-tax-and-cash.js +1 -301
  38. package/dist/collection/components/tax-and-cash/sqm-tax-and-cash-dashboard/sqm-tax-and-cash-dashboard-view.js +2 -92
  39. package/dist/collection/components/tax-and-cash/sqm-tax-and-cash-dashboard/sqm-tax-and-cash-dashboard.js +0 -300
  40. package/dist/collection/components/tax-and-cash/sqm-user-info-form/sqm-user-info-form-view.js +12 -23
  41. package/dist/collection/components/tax-and-cash/sqm-user-info-form/sqm-user-info-form.js +1 -1
  42. package/dist/collection/components/tax-and-cash/sqm-user-info-form/useUserInfoForm.js +9 -92
  43. package/dist/collection/global/styles.js +5 -1
  44. package/dist/collection/global/styles.ts +5 -1
  45. package/dist/esm/{IndirectTaxDetailsView-0a57b622.js → IndirectTaxDetailsView-b7fa596b.js} +2 -2
  46. package/dist/esm/{ShadowViewAddon-aae27c2e.js → ShadowViewAddon-32559cba.js} +8 -8
  47. package/dist/esm/{usePayoutStatus-c515b24b.js → data-acdb790f.js} +130 -156
  48. package/dist/esm/{global-1099f20d.js → global-55e73040.js} +5 -1
  49. package/dist/esm/loader.js +2 -2
  50. package/dist/esm/mint-components.js +2 -2
  51. package/dist/esm/sqm-banking-info-form_10.entry.js +65 -295
  52. package/dist/esm/sqm-big-stat_47.entry.js +7 -202
  53. package/dist/esm/sqm-code-verification.entry.js +1 -1
  54. package/dist/esm/sqm-email-verification.entry.js +1 -1
  55. package/dist/esm/sqm-empty_4.entry.js +1 -1
  56. package/dist/esm/sqm-header-logo.entry.js +1 -14
  57. package/dist/esm/{sqm-lead-checkbox-field-view-cbafee07.js → sqm-lead-checkbox-field-view-c359cc95.js} +1 -1
  58. package/dist/esm/sqm-lead-checkbox-field.entry.js +3 -3
  59. package/dist/esm/{sqm-lead-input-field-view-f3775c28.js → sqm-lead-input-field-view-6fe71f32.js} +1 -1
  60. package/dist/esm/sqm-lead-input-field.entry.js +3 -3
  61. package/dist/esm/sqm-leaderboard-rank.entry.js +1 -1
  62. package/dist/esm/sqm-pagination_3.entry.js +1 -1
  63. package/dist/esm/{sqm-portal-email-verification-view-7d86299c.js → sqm-portal-email-verification-view-176ddb91.js} +1 -1
  64. package/dist/esm/sqm-portal-email-verification.entry.js +2 -2
  65. package/dist/esm/{sqm-portal-profile-view-3ed13e4d.js → sqm-portal-profile-view-6a53716b.js} +1 -1
  66. package/dist/esm/sqm-portal-profile.entry.js +2 -2
  67. package/dist/esm/sqm-referral-table_11.entry.js +1 -1
  68. package/dist/esm/sqm-rewards-table_9.entry.js +1 -1
  69. package/dist/esm/sqm-stencilbook.entry.js +8 -9
  70. package/dist/esm/{useLeadFormState-c379e5d7.js → useLeadFormState-d8667862.js} +1 -1
  71. package/dist/esm/{utils-6122971b.js → utils-27fdc7d7.js} +1 -1
  72. package/dist/esm-es5/{IndirectTaxDetailsView-0a57b622.js → IndirectTaxDetailsView-b7fa596b.js} +1 -1
  73. package/dist/esm-es5/{ShadowViewAddon-aae27c2e.js → ShadowViewAddon-32559cba.js} +1 -1
  74. package/dist/esm-es5/data-acdb790f.js +6 -0
  75. package/dist/esm-es5/{global-1099f20d.js → global-55e73040.js} +1 -1
  76. package/dist/esm-es5/loader.js +1 -1
  77. package/dist/esm-es5/mint-components.js +1 -1
  78. package/dist/esm-es5/sqm-banking-info-form_10.entry.js +1 -1
  79. package/dist/esm-es5/sqm-big-stat_47.entry.js +1 -1
  80. package/dist/esm-es5/sqm-code-verification.entry.js +1 -1
  81. package/dist/esm-es5/sqm-email-verification.entry.js +1 -1
  82. package/dist/esm-es5/sqm-empty_4.entry.js +1 -1
  83. package/dist/esm-es5/sqm-header-logo.entry.js +1 -1
  84. package/dist/esm-es5/{sqm-lead-checkbox-field-view-cbafee07.js → sqm-lead-checkbox-field-view-c359cc95.js} +1 -1
  85. package/dist/esm-es5/sqm-lead-checkbox-field.entry.js +1 -1
  86. package/dist/esm-es5/{sqm-lead-input-field-view-f3775c28.js → sqm-lead-input-field-view-6fe71f32.js} +1 -1
  87. package/dist/esm-es5/sqm-lead-input-field.entry.js +1 -1
  88. package/dist/esm-es5/sqm-leaderboard-rank.entry.js +1 -1
  89. package/dist/esm-es5/sqm-pagination_3.entry.js +1 -1
  90. package/dist/esm-es5/{sqm-portal-email-verification-view-7d86299c.js → sqm-portal-email-verification-view-176ddb91.js} +1 -1
  91. package/dist/esm-es5/sqm-portal-email-verification.entry.js +1 -1
  92. package/dist/esm-es5/{sqm-portal-profile-view-3ed13e4d.js → sqm-portal-profile-view-6a53716b.js} +1 -1
  93. package/dist/esm-es5/sqm-portal-profile.entry.js +1 -1
  94. package/dist/esm-es5/sqm-referral-table_11.entry.js +1 -1
  95. package/dist/esm-es5/sqm-rewards-table_9.entry.js +1 -1
  96. package/dist/esm-es5/sqm-stencilbook.entry.js +1 -1
  97. package/dist/esm-es5/{useLeadFormState-c379e5d7.js → useLeadFormState-d8667862.js} +1 -1
  98. package/dist/esm-es5/{utils-6122971b.js → utils-27fdc7d7.js} +1 -1
  99. package/dist/mint-components/global/styles.ts +5 -1
  100. package/dist/mint-components/mint-components.esm.js +1 -1
  101. package/dist/mint-components/mint-components.js +1 -1
  102. package/dist/mint-components/{p-f0eae4e6.system.js → p-0c6259b2.system.js} +1 -1
  103. package/dist/mint-components/{p-aefaec37.entry.js → p-130fd1d8.entry.js} +1 -1
  104. package/dist/mint-components/p-17e3f564.system.entry.js +1 -0
  105. package/dist/mint-components/{p-db1a0db1.js → p-1b7900ed.js} +1 -1
  106. package/dist/mint-components/{p-ed16b35a.js → p-23c21cf4.js} +1 -1
  107. package/dist/mint-components/{p-aa08457e.system.js → p-271c092c.system.js} +1 -1
  108. package/dist/mint-components/{p-5f3eafd4.entry.js → p-2e0a3d84.entry.js} +2 -2
  109. package/dist/mint-components/{p-0649123a.system.entry.js → p-3aba7c3a.system.entry.js} +1 -1
  110. package/dist/mint-components/{p-4c811d12.entry.js → p-449314ca.entry.js} +1 -1
  111. package/dist/mint-components/p-469a6450.system.js +6 -0
  112. package/dist/mint-components/{p-f401ef19.system.entry.js → p-46a22d08.system.entry.js} +1 -1
  113. package/dist/mint-components/{p-57ce33dd.js → p-47b73018.js} +2 -2
  114. package/dist/mint-components/{p-60465a2d.system.js → p-4cfa1432.system.js} +1 -1
  115. package/dist/mint-components/{p-c85f204b.system.js → p-52123353.system.js} +1 -1
  116. package/dist/mint-components/{p-bec87ac9.system.entry.js → p-54154ed4.system.entry.js} +1 -1
  117. package/dist/mint-components/{p-47c83656.entry.js → p-5a8911c7.entry.js} +1 -1
  118. package/dist/mint-components/{p-56009bf0.system.entry.js → p-5b088b96.system.entry.js} +1 -1
  119. package/dist/mint-components/{p-6d5bd95a.js → p-618d249d.js} +1 -1
  120. package/dist/mint-components/{p-22a9114f.system.entry.js → p-6ec7b746.system.entry.js} +1 -1
  121. package/dist/mint-components/{p-6445e926.system.entry.js → p-709cdbf7.system.entry.js} +1 -1
  122. package/dist/mint-components/{p-38f932ae.system.js → p-73fdd315.system.js} +1 -1
  123. package/dist/mint-components/{p-4ce51b1c.system.entry.js → p-745a27ee.system.entry.js} +1 -1
  124. package/dist/mint-components/{p-6d9ce4e5.entry.js → p-757820a4.entry.js} +1 -1
  125. package/dist/mint-components/{p-18720462.system.entry.js → p-7a2375c3.system.entry.js} +1 -1
  126. package/dist/mint-components/{p-d3120982.system.entry.js → p-84632241.system.entry.js} +1 -1
  127. package/dist/mint-components/{p-aa8c6332.js → p-887e3b03.js} +1 -1
  128. package/dist/mint-components/p-8a2ec966.entry.js +1 -0
  129. package/dist/mint-components/p-8a458176.entry.js +273 -0
  130. package/dist/mint-components/{p-60c14cec.entry.js → p-93f37676.entry.js} +1 -1
  131. package/dist/mint-components/{p-7a268047.js → p-9504b639.js} +1 -1
  132. package/dist/mint-components/{p-717b6730.system.entry.js → p-959925bf.system.entry.js} +1 -1
  133. package/dist/mint-components/p-9d4f1401.system.entry.js +1 -0
  134. package/dist/mint-components/{p-4fed8672.js → p-9db05d78.js} +1 -1
  135. package/dist/mint-components/p-9ff60e10.system.js +1 -0
  136. package/dist/mint-components/p-a7ee19dc.entry.js +1 -0
  137. package/dist/mint-components/{p-c994512c.system.js → p-aeea89b4.system.js} +1 -1
  138. package/dist/mint-components/{p-a5c63310.entry.js → p-b427cf9e.entry.js} +1 -1
  139. package/dist/mint-components/{p-511c87ce.system.entry.js → p-b5905137.system.entry.js} +1 -1
  140. package/dist/mint-components/{p-14e813a7.system.entry.js → p-b9d63ca9.system.entry.js} +1 -1
  141. package/dist/mint-components/{p-a217cc8d.entry.js → p-bcb8532f.entry.js} +1 -1
  142. package/dist/mint-components/{p-e0a724dd.system.js → p-bcc61fbe.system.js} +1 -1
  143. package/dist/mint-components/{p-00bc7211.js → p-c25e76f7.js} +1 -1
  144. package/dist/mint-components/{p-6c006998.entry.js → p-c803eaed.entry.js} +1 -1
  145. package/dist/mint-components/p-c8bbd212.entry.js +99 -0
  146. package/dist/mint-components/{p-5d059c95.entry.js → p-da0a7fa5.entry.js} +1 -1
  147. package/dist/mint-components/p-e1e7d01c.js +157 -0
  148. package/dist/mint-components/{p-ad4348c3.system.js → p-e8661eaa.system.js} +1 -1
  149. package/dist/mint-components/{p-79a3344f.js → p-ec0f9326.js} +1 -1
  150. package/dist/mint-components/p-eea87fdc.system.entry.js +1 -0
  151. package/dist/mint-components/{p-74f43a08.system.js → p-f9c3290d.system.js} +1 -1
  152. package/dist/mint-components/p-fac02d24.entry.js +1 -0
  153. package/dist/types/components/sqm-header-logo/sqm-header-logo.d.ts +1 -14
  154. package/dist/types/components/tax-and-cash/sqm-indirect-tax-form/useIndirectTaxForm.d.ts +0 -24
  155. package/dist/types/components/tax-and-cash/sqm-payout-status-alert/sqm-payout-status-alert-view.d.ts +0 -16
  156. package/dist/types/components/tax-and-cash/sqm-payout-status-alert/sqm-payout-status-alert.d.ts +0 -57
  157. package/dist/types/components/tax-and-cash/sqm-payout-status-alert/usePayoutStatus.d.ts +1 -3
  158. package/dist/types/components/tax-and-cash/sqm-tax-and-cash/sqm-tax-and-cash.d.ts +0 -48
  159. package/dist/types/components/tax-and-cash/sqm-tax-and-cash-dashboard/sqm-tax-and-cash-dashboard-view.d.ts +0 -12
  160. package/dist/types/components/tax-and-cash/sqm-tax-and-cash-dashboard/sqm-tax-and-cash-dashboard.d.ts +0 -48
  161. package/dist/types/components/tax-and-cash/sqm-user-info-form/sqm-user-info-form-view.d.ts +0 -2
  162. package/dist/types/components/tax-and-cash/sqm-user-info-form/useUserInfoForm.d.ts +0 -1
  163. package/dist/types/components.d.ts +41 -331
  164. package/docs/docs.docx +0 -0
  165. package/docs/raisins.json +1 -1
  166. package/grapesjs/grapesjs.js +1 -1
  167. package/package.json +1 -1
  168. package/shoelace/assets/icons/twitter-x.svg +4 -0
  169. package/dist/esm-es5/usePayoutStatus-c515b24b.js +0 -6
  170. package/dist/mint-components/p-09ab53fb.system.entry.js +0 -1
  171. package/dist/mint-components/p-1c1ae908.system.js +0 -6
  172. package/dist/mint-components/p-296dea25.system.entry.js +0 -1
  173. package/dist/mint-components/p-69ed04cc.entry.js +0 -273
  174. package/dist/mint-components/p-6eb050f1.system.entry.js +0 -1
  175. package/dist/mint-components/p-8b5b2acc.entry.js +0 -1
  176. package/dist/mint-components/p-967a9040.system.js +0 -1
  177. package/dist/mint-components/p-9c3ad5dc.entry.js +0 -99
  178. package/dist/mint-components/p-ab111e29.entry.js +0 -1
  179. package/dist/mint-components/p-c9cceb05.js +0 -157
  180. package/dist/mint-components/p-ea0bc627.entry.js +0 -1
  181. package/dist/types/global/android.d.ts +0 -7
  182. package/dist/types/global/demo.d.ts +0 -2
  183. package/dist/types/stories/features.d.ts +0 -4
  184. package/dist/types/stories/templates.d.ts +0 -4
@@ -1,5 +1,5 @@
1
- import { h, r as registerInstance, c as Host, g as getElement, F as Fragment } from './index-b3a06de8.js';
2
- import { i as intl } from './global-1099f20d.js';
1
+ import { h, r as registerInstance, c as Host, g as getElement } from './index-b3a06de8.js';
2
+ import { i as intl } from './global-55e73040.js';
3
3
  import { m as useRef, k as useState, f as useEffect, n as h$1, u as useMemo, b as browser, j as useReducer } from './dom-context-hooks.module-63370afd.js';
4
4
  import { d as dist, _, L, J, t as Pn, F as Fn, x as $n, $ as $e, i as isDemo, p as En, u as useCallback, R as Rn, w as wn } from './index.module-c9811a48.js';
5
5
  import { j as jsonpointer } from './jsonpointer-388a7082.js';
@@ -12,10 +12,10 @@ import { u as useRerenderListener, a as useRequestRerender } from './re-render-7
12
12
  import { u as useChildElements } from './useChildElements-3d872cef.js';
13
13
  import { l as luxon } from './luxon-bbf75a9d.js';
14
14
  import { g as generateUserError } from './useReferralTable-909ccb28.js';
15
- import { a as INDIRECT_TAX_SPAIN_REGIONS, b as INDIRECT_TAX_PROVINCES, O as OtherRegionSlotView, I as InvoiceTableView, v as vatLabels, A as ADDRESS_REGIONS } from './IndirectTaxDetailsView-0a57b622.js';
16
- import { t as taxTypeToName, v as validTaxDocument, g as getCountryObj, L as LoadingView, f as formatErrorMessage, a as validateBillingField, o as objectIsFull } from './utils-6122971b.js';
15
+ import { a as INDIRECT_TAX_SPAIN_REGIONS, b as INDIRECT_TAX_PROVINCES, O as OtherRegionSlotView, I as InvoiceTableView, v as vatLabels, A as ADDRESS_REGIONS } from './IndirectTaxDetailsView-b7fa596b.js';
16
+ import { t as taxTypeToName, v as validTaxDocument, g as getCountryObj, L as LoadingView, f as formatErrorMessage, a as validateBillingField, o as objectIsFull } from './utils-27fdc7d7.js';
17
17
  import { b as VERIFICATION_EVENT_KEY } from './keys-406491dc.js';
18
- import { i as FORM_STEPS, a as TAX_FORM_CONTEXT_NAMESPACE, S as SORTED_COUNTRIES_NAMESPACE, c as USER_QUERY_NAMESPACE, T as TAX_CONTEXT_NAMESPACE, F as FINANCE_NETWORK_SETTINGS_NAMESPACE, j as TAX_FORM_UPDATED_EVENT_KEY, U as USER_FORM_CONTEXT_NAMESPACE, d as COUNTRIES_QUERY_NAMESPACE, k as useVeriffApp, l as getStatus, V as VERIFF_COMPLETE_EVENT_KEY, C as CURRENCIES_NAMESPACE } from './usePayoutStatus-c515b24b.js';
18
+ import { i as FORM_STEPS, a as TAX_FORM_CONTEXT_NAMESPACE, S as SORTED_COUNTRIES_NAMESPACE, c as USER_QUERY_NAMESPACE, T as TAX_CONTEXT_NAMESPACE, F as FINANCE_NETWORK_SETTINGS_NAMESPACE, j as TAX_FORM_UPDATED_EVENT_KEY, U as USER_FORM_CONTEXT_NAMESPACE, d as COUNTRIES_QUERY_NAMESPACE, k as useVeriffApp, l as getStatus, V as VERIFF_COMPLETE_EVENT_KEY, C as CURRENCIES_NAMESPACE } from './data-acdb790f.js';
19
19
 
20
20
  function getFormMap({ props, getValidationErrorMessage, bankCountry, }) {
21
21
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32;
@@ -901,8 +901,7 @@ function useBankingInfoForm(props) {
901
901
  : _paymentMethodChecked;
902
902
  useEffect(() => {
903
903
  // reset redirect hash
904
- if (window.location.hash !== "#4")
905
- window.location.hash = "";
904
+ window.location.hash = "";
906
905
  }, []);
907
906
  useEffect(() => {
908
907
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
@@ -2608,51 +2607,8 @@ function useIndirectTaxForm(props) {
2608
2607
  console.error("Could not detect select change");
2609
2608
  setFormState((p) => ({ ...p, [field]: value }));
2610
2609
  };
2611
- async function connectPartner(formData) {
2612
- var _a, _b, _c, _d, _e;
2613
- const vars = {
2614
- user: {
2615
- id: user.id,
2616
- accountId: user.accountId,
2617
- },
2618
- firstName: userForm.firstName,
2619
- lastName: userForm.lastName,
2620
- countryCode: userForm.countryCode,
2621
- currency: userForm.currency,
2622
- address: userForm.address,
2623
- city: userForm.city,
2624
- state: userForm.state,
2625
- postalCode: userForm.postalCode,
2626
- phoneNumber: userForm.phoneNumber,
2627
- phoneNumberCountryCode: userForm.phoneNumberCountryCode,
2628
- indirectTaxCountryCode: formData.selectedRegion,
2629
- indirectTaxRegion: formData.province || formData.subRegion,
2630
- indirectTaxId: formData.indirectTaxNumber,
2631
- additionalTaxId: formData.qstNumber,
2632
- withholdingTaxId: formData.subRegionTaxNumber,
2633
- };
2634
- const result = await connectImpactPartner({
2635
- vars,
2636
- });
2637
- if (!result || ((_a = result) === null || _a === void 0 ? void 0 : _a.message))
2638
- throw new Error();
2639
- if (!((_b = result.createImpactConnection) === null || _b === void 0 ? void 0 : _b.success)) {
2640
- // Output backend errors to console for now
2641
- console.error("Failed to create Impact connection: ", result.createImpactConnection.validationErrors);
2642
- throw new Error();
2643
- }
2644
- await refetch();
2645
- const resultPublisher = (_e = (_d = (_c = result
2646
- .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;
2647
- const hasValidCurrentDocument = validTaxDocument(resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.requiredTaxDocumentType) && (resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.currentTaxDocument);
2648
- // Fire form change event
2649
- window.dispatchEvent(new Event(TAX_FORM_UPDATED_EVENT_KEY));
2650
- return {
2651
- resultPublisher,
2652
- hasValidCurrentDocument,
2653
- };
2654
- }
2655
2610
  const onSubmit = async (event) => {
2611
+ var _a, _b, _c, _d, _e;
2656
2612
  if (!option) {
2657
2613
  setErrors({ taxDetails: true });
2658
2614
  return;
@@ -2678,7 +2634,44 @@ function useIndirectTaxForm(props) {
2678
2634
  }
2679
2635
  setLoading(true);
2680
2636
  try {
2681
- const { resultPublisher, hasValidCurrentDocument } = await connectPartner(formData);
2637
+ const vars = {
2638
+ user: {
2639
+ id: user.id,
2640
+ accountId: user.accountId,
2641
+ },
2642
+ firstName: userForm.firstName,
2643
+ lastName: userForm.lastName,
2644
+ countryCode: userForm.countryCode,
2645
+ currency: userForm.currency,
2646
+ address: userForm.address,
2647
+ city: userForm.city,
2648
+ state: userForm.state,
2649
+ postalCode: userForm.postalCode,
2650
+ phoneNumber: userForm.phoneNumber,
2651
+ phoneNumberCountryCode: userForm.phoneNumberCountryCode,
2652
+ indirectTaxCountryCode: formData.selectedRegion,
2653
+ indirectTaxRegion: formData.province || formData.subRegion,
2654
+ indirectTaxId: formData.indirectTaxNumber,
2655
+ additionalTaxId: formData.qstNumber,
2656
+ withholdingTaxId: formData.subRegionTaxNumber,
2657
+ };
2658
+ const result = await connectImpactPartner({
2659
+ vars,
2660
+ });
2661
+ if (!result || ((_a = result) === null || _a === void 0 ? void 0 : _a.message))
2662
+ throw new Error();
2663
+ if (!((_b = result.createImpactConnection) === null || _b === void 0 ? void 0 : _b.success)) {
2664
+ // Output backend errors to console for now
2665
+ console.error("Failed to create Impact connection: ", result.createImpactConnection
2666
+ .validationErrors);
2667
+ throw new Error();
2668
+ }
2669
+ await refetch();
2670
+ const resultPublisher = (_e = (_d = (_c = result
2671
+ .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;
2672
+ const hasValidCurrentDocument = validTaxDocument(resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.requiredTaxDocumentType) && (resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.currentTaxDocument);
2673
+ // Fire form change event
2674
+ window.dispatchEvent(new Event(TAX_FORM_UPDATED_EVENT_KEY));
2682
2675
  if ((resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.requiredTaxDocumentType) &&
2683
2676
  !hasValidCurrentDocument) {
2684
2677
  // Go to docusign form
@@ -4031,7 +4024,7 @@ const TaxAndCashDashboardView = (props) => {
4031
4024
  icon: "exclamation-octagon",
4032
4025
  class: sheet$4.classes.ErrorHoldAlertContainer,
4033
4026
  };
4034
- case "NEW_PAYEE_REVIEW":
4027
+ case "ACCOUNT_REVIEW":
4035
4028
  return {
4036
4029
  header: text.accountReviewHeader,
4037
4030
  description: intl.formatMessage({
@@ -4045,96 +4038,6 @@ const TaxAndCashDashboardView = (props) => {
4045
4038
  icon: "exclamation-triangle",
4046
4039
  class: sheet$4.classes.WarningHoldAlertContainer,
4047
4040
  };
4048
- case "PAYMENT_HOLD_ON_CHANGE":
4049
- return {
4050
- header: text.paymentHoldOnChangeHeader,
4051
- description: intl.formatMessage({
4052
- id: "accountReviewDescription",
4053
- defaultMessage: text.paymentHoldOnChangeDescription,
4054
- }, {
4055
- supportLink: (h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
4056
- }),
4057
- buttonText: null,
4058
- alertType: "warning",
4059
- icon: "exclamation-triangle",
4060
- class: sheet$4.classes.WarningHoldAlertContainer,
4061
- };
4062
- case "BENEFICIARY_NAME_INVALID":
4063
- return {
4064
- header: text.beneficiaryNameInvalidHeader,
4065
- description: intl.formatMessage({
4066
- id: "accountReviewDescription",
4067
- defaultMessage: text.beneficiaryNameInvalidDescription,
4068
- }, {
4069
- supportLink: (h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
4070
- }),
4071
- button: (h(Fragment, null,
4072
- h("sl-button", { disabled: states.disabled || states.loading, type: "primary", class: sheet$4.classes.EditBankDetailsButton, onClick: callbacks.onEditPayoutInfo }, text.editPaymentInformationButton),
4073
- h("sl-button", { disabled: states.disabled || states.loading, type: "default", class: sheet$4.classes.EditBankDetailsButton, onClick: callbacks.onNewFormClick }, text.newFormButton))),
4074
- alertType: "warning",
4075
- icon: "exclamation-triangle",
4076
- class: sheet$4.classes.WarningHoldAlertContainer,
4077
- };
4078
- case "BENEFICIARY_NAME_MISMATCH":
4079
- return {
4080
- header: text.beneficiaryNameMismatchHeader,
4081
- description: intl.formatMessage({
4082
- id: "accountReviewDescription",
4083
- defaultMessage: text.beneficiaryNameMismatchDescription,
4084
- }, {
4085
- supportLink: (h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
4086
- }),
4087
- button: (h(Fragment, null,
4088
- h("sl-button", { disabled: states.disabled || states.loading, type: "primary", class: sheet$4.classes.EditBankDetailsButton, onClick: callbacks.onEditPayoutInfo }, text.editPaymentInformationButton),
4089
- h("sl-button", { disabled: states.disabled || states.loading, type: "default", class: sheet$4.classes.EditBankDetailsButton, onClick: callbacks.onNewFormClick }, text.newFormButton))),
4090
- alertType: "warning",
4091
- icon: "exclamation-triangle",
4092
- class: sheet$4.classes.WarningHoldAlertContainer,
4093
- };
4094
- case "BANK_TAX_NAME_MISMATCH":
4095
- return {
4096
- header: text.bankTaxNameMismatchHeader,
4097
- description: intl.formatMessage({
4098
- id: "accountReviewDescription",
4099
- defaultMessage: text.bankTaxNameMismatchDescription,
4100
- }, {
4101
- supportLink: (h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
4102
- }),
4103
- button: (h(Fragment, null,
4104
- h("sl-button", { disabled: states.disabled || states.loading, type: "primary", class: sheet$4.classes.EditBankDetailsButton, onClick: callbacks.onEditPayoutInfo }, text.editPaymentInformationButton),
4105
- h("sl-button", { disabled: states.disabled || states.loading, type: "default", class: sheet$4.classes.EditBankDetailsButton, onClick: callbacks.onNewFormClick }, text.newFormButton))),
4106
- alertType: "warning",
4107
- icon: "exclamation-triangle",
4108
- class: sheet$4.classes.WarningHoldAlertContainer,
4109
- };
4110
- case "WITHDRAWAL_SETTINGS_INVALID":
4111
- return {
4112
- header: text.withdrawalSettingsInvalidHeader,
4113
- description: intl.formatMessage({
4114
- id: "accountReviewDescription",
4115
- defaultMessage: text.withdrawalSettingsInvalidDescription,
4116
- }, {
4117
- supportLink: (h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
4118
- }),
4119
- button: (h("sl-button", { disabled: states.disabled || states.loading, type: "default", class: sheet$4.classes.EditBankDetailsButton, onClick: callbacks.onEditPayoutInfo }, text.editPaymentInformationButton)),
4120
- alertType: "warning",
4121
- icon: "exclamation-triangle",
4122
- class: sheet$4.classes.WarningHoldAlertContainer,
4123
- };
4124
- case "PAYMENT_RETURNED":
4125
- return {
4126
- header: text.paymentReturnedHeader,
4127
- description: intl.formatMessage({
4128
- id: "accountReviewDescription",
4129
- defaultMessage: text.paymentReturnedDescription,
4130
- }, {
4131
- supportLink: (h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
4132
- }),
4133
- button: (h("sl-button", { disabled: states.disabled || states.loading, type: "primary", class: sheet$4.classes.EditBankDetailsButton, onClick: callbacks.onEditPayoutInfo }, text.editPaymentInformationButton)),
4134
- alertType: "warning",
4135
- icon: "exclamation-triangle",
4136
- class: sheet$4.classes.WarningHoldAlertContainer,
4137
- };
4138
4041
  case "HOLD":
4139
4042
  return {
4140
4043
  header: text.payoutHoldAlertHeader,
@@ -4705,54 +4608,6 @@ const TaxAndCashDashboard = class {
4705
4608
  * @uiName Account review alert description
4706
4609
  */
4707
4610
  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}.";
4708
- /**
4709
- * @uiName Payment hold on change alert header
4710
- */
4711
- this.paymentHoldOnChangeHeader = "We are reviewing your new payout settings";
4712
- /**
4713
- * @uiName Payment hold on change alert description
4714
- */
4715
- this.paymentHoldOnChangeDescription = "Your payout is temporarily on hold while we review your new payment information, this process is usually resolved within 48 hours.";
4716
- /**
4717
- * @uiName Beneficiary name invalid alert header
4718
- */
4719
- this.beneficiaryNameInvalidHeader = "Your payment information does not match your tax form";
4720
- /**
4721
- * @uiName Beneficiary name invalid description
4722
- */
4723
- this.beneficiaryNameInvalidDescription = "The beneficiary name in your payment information does not match what was submitted in your tax form. Please review and update your payment information or tax form so that they match exactly and do not include any invalid characters. Your payouts are on hold until this is resolved.";
4724
- /**
4725
- * @uiName Beneficiary name mismatch alert header
4726
- */
4727
- this.beneficiaryNameMismatchHeader = "Your payment information does not match your tax form";
4728
- /**
4729
- * @uiName Beneficiary name mismatch alert description
4730
- */
4731
- this.beneficiaryNameMismatchDescription = "The beneficiary name in your payment information does not match what was submitted in your tax form. Please review and update your payment information or tax form so that they match exactly and do not include any invalid characters. Your payouts are on hold until this is resolved.";
4732
- /**
4733
- * @uiName Bank name mismatch alert header
4734
- */
4735
- this.bankTaxNameMismatchHeader = "Your payment information does not match your tax form";
4736
- /**
4737
- * @uiName Bank name mismatch alert description
4738
- */
4739
- this.bankTaxNameMismatchDescription = "The bank name in your payment information does not match what was submitted in your tax form. Please review and update your payment information or tax form so that they match exactly and do not include any invalid characters. Your payouts are on hold until this is resolved.";
4740
- /**
4741
- * @uiName Withdrawal settings invalid alert header
4742
- */
4743
- this.withdrawalSettingsInvalidHeader = "Your payment information includes invalid characters";
4744
- /**
4745
- * @uiName Withdrawal settings invalid alert description
4746
- */
4747
- this.withdrawalSettingsInvalidDescription = "There are invalid characters in your payment information. Please review your information and make sure it is correct with no invalid characters. Your payouts are on hold until this is resolved.";
4748
- /**
4749
- * @uiName Payment returned alert header
4750
- */
4751
- this.paymentReturnedHeader = "Payout unsuccessful";
4752
- /**
4753
- * @uiName Payment returned alert description
4754
- */
4755
- this.paymentReturnedDescription = "Our recent payment attempt for your earnings was unsuccessful. Please review your payment information and make sure it is correct.";
4756
4611
  /**
4757
4612
  * @uiName Terms and Conditions text
4758
4613
  */
@@ -6171,12 +6026,6 @@ const UserInfoFormView = (props) => {
6171
6026
  default:
6172
6027
  regionLabel = text.state;
6173
6028
  }
6174
- function isDisabledInput(field) {
6175
- var _a;
6176
- if (states.isPartner && !!((_a = data.partnerData) === null || _a === void 0 ? void 0 : _a[field]))
6177
- return true;
6178
- return false;
6179
- }
6180
6029
  return (h("sl-form", { class: classes.FormWrapper, "onSl-submit": callbacks.onSubmit, ref: (el) => (refs.formRef.current = el), novalidate: true },
6181
6030
  h("style", { type: "text/css" },
6182
6031
  styleString$5,
@@ -6217,22 +6066,18 @@ const UserInfoFormView = (props) => {
6217
6066
  })))),
6218
6067
  h("div", null,
6219
6068
  h("div", { class: classes.InputContainer },
6220
- h("sl-input", Object.assign({ class: "ErrorInput", exportparts: "label: input-label, base: input-base", value: formState.firstName, label: text.firstName, disabled: states.disabled ||
6221
- states.isUser ||
6222
- isDisabledInput("firstName") }, (((_b = formState.errors) === null || _b === void 0 ? void 0 : _b.firstName) ? {
6069
+ h("sl-input", Object.assign({ class: "ErrorInput", exportparts: "label: input-label, base: input-base", value: formState.firstName, label: text.firstName, disabled: states.disabled || states.isUser || states.isPartner }, (((_b = formState.errors) === null || _b === void 0 ? void 0 : _b.firstName) ? {
6223
6070
  class: classes.ErrorInput,
6224
6071
  helpText: formatErrorMessage(text.firstName, formState.errors.firstName),
6225
6072
  }
6226
6073
  : {}), { id: "firstName", name: "/firstName", required: true })),
6227
- h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", value: formState.lastName, label: text.lastName, disabled: states.disabled ||
6228
- states.isUser ||
6229
- isDisabledInput("lastName") }, (((_c = formState.errors) === null || _c === void 0 ? void 0 : _c.lastName) ? {
6074
+ h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", value: formState.lastName, label: text.lastName, disabled: states.disabled || states.isUser || states.isPartner }, (((_c = formState.errors) === null || _c === void 0 ? void 0 : _c.lastName) ? {
6230
6075
  class: classes.ErrorInput,
6231
6076
  helpText: formatErrorMessage(text.lastName, formState.errors.lastName),
6232
6077
  }
6233
6078
  : {}), { id: "lastName", name: "/lastName", required: true })),
6234
6079
  h("sl-input", { exportparts: "label: input-label, base: input-base", value: formState.email, label: text.email, disabled: true, id: "email", name: "/email", required: true }),
6235
- h("sl-select", Object.assign({ id: "countryCode", exportparts: "label: input-label, base: input-base", name: "/countryCode", label: text.country, value: formState.countryCode, disabled: states.disabled || isDisabledInput("countryCode") }, (((_d = formState.errors) === null || _d === void 0 ? void 0 : _d.countryCode) ? {
6080
+ h("sl-select", Object.assign({ id: "countryCode", exportparts: "label: input-label, base: input-base", name: "/countryCode", label: text.country, value: formState.countryCode, disabled: states.disabled || states.isPartner }, (((_d = formState.errors) === null || _d === void 0 ? void 0 : _d.countryCode) ? {
6236
6081
  class: classes.ErrorInput,
6237
6082
  helpText: formatErrorMessage(text.country, formState.errors.countryCode),
6238
6083
  }
@@ -6248,8 +6093,7 @@ const UserInfoFormView = (props) => {
6248
6093
  h("div", { class: classes.PhoneInputsSection },
6249
6094
  h("p", null, text.phoneNumber),
6250
6095
  h("div", { class: classes.PhoneInputsContainer },
6251
- h("sl-select", Object.assign({ id: "phoneNumberCountryCode", exportparts: "label: input-label, base: input-base", name: "/phoneNumberCountryCode", value: formState.phoneNumberCountryCode, disabled: states.disabled ||
6252
- isDisabledInput("phoneNumberCountryCode"), ref: (el) => (refs.phoneCountryRef.current = el) }, (((_g = formState.errors) === null || _g === void 0 ? void 0 : _g.phoneNumberCountryCode) ? {
6096
+ h("sl-select", Object.assign({ id: "phoneNumberCountryCode", exportparts: "label: input-label, base: input-base", name: "/phoneNumberCountryCode", value: formState.phoneNumberCountryCode, disabled: states.disabled || states.isPartner, ref: (el) => (refs.phoneCountryRef.current = el) }, (((_g = formState.errors) === null || _g === void 0 ? void 0 : _g.phoneNumberCountryCode) ? {
6253
6097
  class: classes.ErrorInput,
6254
6098
  }
6255
6099
  : {}), { required: true, "onSl-select": (e) => callbacks.onFormChange("phoneCountry", e) }),
@@ -6275,7 +6119,7 @@ const UserInfoFormView = (props) => {
6275
6119
  // Naive phone number validation
6276
6120
  validateBillingField(/[a-zA-Z]+/, value) &&
6277
6121
  formatErrorMessage(text.phoneNumber, text.error.fieldInvalidError);
6278
- }, disabled: states.disabled || isDisabledInput("phoneNumber") }, (((_k = formState.errors) === null || _k === void 0 ? void 0 : _k.phoneNumber) ? {
6122
+ }, disabled: states.disabled || states.isPartner }, (((_k = formState.errors) === null || _k === void 0 ? void 0 : _k.phoneNumber) ? {
6279
6123
  class: classes.ErrorInput,
6280
6124
  helpText: formatErrorMessage(text.phoneNumber, formState.errors.phoneNumber),
6281
6125
  }
@@ -6283,7 +6127,7 @@ const UserInfoFormView = (props) => {
6283
6127
  h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", label: text.address, id: "address", name: "/address", value: formState.address, validationError: ({ value }) =>
6284
6128
  // Checks for non-ASCII characters
6285
6129
  !validateBillingField(/^[\x20-\xFF]+$/, value) &&
6286
- formatErrorMessage(text.address, text.error.invalidCharacterError), disabled: states.disabled || isDisabledInput("address") }, (((_l = formState.errors) === null || _l === void 0 ? void 0 : _l.address) ? {
6130
+ formatErrorMessage(text.address, text.error.invalidCharacterError), disabled: states.disabled || states.isPartner }, (((_l = formState.errors) === null || _l === void 0 ? void 0 : _l.address) ? {
6287
6131
  class: classes.ErrorInput,
6288
6132
  helpText: formatErrorMessage(text.address, formState.errors.address),
6289
6133
  }
@@ -6291,22 +6135,22 @@ const UserInfoFormView = (props) => {
6291
6135
  h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", label: text.city, id: "city", name: "/city", value: formState.city, validationError: ({ value }) =>
6292
6136
  // Checks for non-ASCII characters
6293
6137
  !validateBillingField(/^[\x20-\xFF]+$/, value) &&
6294
- formatErrorMessage(text.city, text.error.invalidCharacterError), disabled: states.disabled || isDisabledInput("city") }, (((_m = formState.errors) === null || _m === void 0 ? void 0 : _m.city) ? {
6138
+ formatErrorMessage(text.city, text.error.invalidCharacterError), disabled: states.disabled || states.isPartner }, (((_m = formState.errors) === null || _m === void 0 ? void 0 : _m.city) ? {
6295
6139
  class: classes.ErrorInput,
6296
6140
  helpText: formatErrorMessage(text.city, formState.errors.city),
6297
6141
  }
6298
6142
  : {}), { required: true })),
6299
- !states.hideState && (h("sl-select", Object.assign({ label: regionLabel, exportparts: "label: input-label, base: input-base", id: "state", name: "/state", value: formState.state, disabled: states.disabled || isDisabledInput("state") }, (((_o = formState.errors) === null || _o === void 0 ? void 0 : _o.state) ? {
6143
+ !states.hideState && (h("sl-select", Object.assign({ label: regionLabel, exportparts: "label: input-label, base: input-base", id: "state", name: "/state", value: formState.state, disabled: states.disabled || states.isPartner }, (((_o = formState.errors) === null || _o === void 0 ? void 0 : _o.state) ? {
6300
6144
  class: classes.ErrorInput,
6301
6145
  helpText: formatErrorMessage(text.state, formState.errors.state),
6302
6146
  }
6303
6147
  : {}), { required: true }), (_p = data.regions) === null || _p === void 0 ? void 0 : _p.map((r) => (h("sl-menu-item", { value: r.value }, r.label))))),
6304
- h("sl-input", Object.assign({ label: text.postalCode, exportparts: "label: input-label, base: input-base", id: "postalCode", name: "/postalCode", value: formState.postalCode, disabled: states.disabled || isDisabledInput("postalCode") }, (((_q = formState.errors) === null || _q === void 0 ? void 0 : _q.postalCode) ? {
6148
+ h("sl-input", Object.assign({ label: text.postalCode, exportparts: "label: input-label, base: input-base", id: "postalCode", name: "/postalCode", value: formState.postalCode, disabled: states.disabled || states.isPartner }, (((_q = formState.errors) === null || _q === void 0 ? void 0 : _q.postalCode) ? {
6305
6149
  class: classes.ErrorInput,
6306
6150
  helpText: formatErrorMessage(text.postalCode, formState.errors.postalCode),
6307
6151
  }
6308
6152
  : {}), { required: true })),
6309
- h("sl-select", Object.assign({ id: "currency", exportparts: "label: input-label, base: input-base", name: "/currency", label: text.currency, menu: true, value: formState.currency, disabled: states.disabled || isDisabledInput("currency"), helpText: text.currencyHelpText }, (((_r = formState.errors) === null || _r === void 0 ? void 0 : _r.currency) ? {
6153
+ h("sl-select", Object.assign({ id: "currency", exportparts: "label: input-label, base: input-base", name: "/currency", label: text.currency, menu: true, value: formState.currency, disabled: states.disabled || states.isPartner, helpText: text.currencyHelpText }, (((_r = formState.errors) === null || _r === void 0 ? void 0 : _r.currency) ? {
6310
6154
  class: classes.ErrorInput,
6311
6155
  helpText: formatErrorMessage(text.currency, formState.errors.currency),
6312
6156
  }
@@ -6328,13 +6172,13 @@ const UserInfoFormView = (props) => {
6328
6172
  h("div", { class: classes.CheckboxWrapper },
6329
6173
  h("sl-checkbox", { checked: formState.allowBankingCollection === true, "onSl-change": (e) => {
6330
6174
  e.target.value = e.target.checked;
6331
- }, disabled: states.disabled, required: true, value: formState.allowBankingCollection, id: "allowBankingCollection", name: "/allowBankingCollection" }, bankingCollectionText),
6175
+ }, disabled: states.isPartner ? false : states.disabled, required: true, value: formState.allowBankingCollection, id: "allowBankingCollection", name: "/allowBankingCollection" }, bankingCollectionText),
6332
6176
  ((_u = formState.errors) === null || _u === void 0 ? void 0 : _u.allowBankingCollection) && (h("p", { class: classes.ErrorText }, formatErrorMessage(text.termsAndConditionsLabel, formState.errors.allowBankingCollection))))),
6333
- h("sl-button", { type: "primary", disabled: states.disabled, submit: true, exportparts: "base: primarybutton-base" }, text.continueButton))))));
6177
+ h("sl-button", { type: "primary", disabled: states.isPartner ? false : states.disabled, submit: true, exportparts: "base: primarybutton-base" }, text.continueButton))))));
6334
6178
  };
6335
6179
 
6336
6180
  function useUserInfoForm(props) {
6337
- var _a, _b, _c, _d, _e, _f;
6181
+ var _a, _b, _c, _d;
6338
6182
  const currencyRef = useRef(undefined);
6339
6183
  const phoneCountryRef = useRef(undefined);
6340
6184
  const formRef = useRef(null);
@@ -6342,9 +6186,7 @@ function useUserInfoForm(props) {
6342
6186
  const countries = Fn(SORTED_COUNTRIES_NAMESPACE);
6343
6187
  const [step, setStep] = Pn(TAX_CONTEXT_NAMESPACE);
6344
6188
  const [userFormContext, setUserFormContext] = Pn(USER_FORM_CONTEXT_NAMESPACE);
6345
- const user = J();
6346
- const [connectImpactPartner, { loading: connectLoading, errors: connectErrors },] = $e(CONNECT_PARTNER);
6347
- const { data, loading, refetch, errors: userError, } = $n(USER_QUERY_NAMESPACE);
6189
+ const { data, loading, errors: userError, } = $n(USER_QUERY_NAMESPACE);
6348
6190
  const _currencies = Fn(CURRENCIES_NAMESPACE);
6349
6191
  const currencies = useMemo(() => [...(_currencies || [])].sort((a, b) => a.displayName.localeCompare(b.displayName)), [_currencies]);
6350
6192
  const [countrySearch, setCountrySearch] = useState("");
@@ -6446,45 +6288,6 @@ function useUserInfoForm(props) {
6446
6288
  setFilteredCurrencies(currencies.filter((c) => c.currencyCode.toLowerCase().includes(currencySearch.toLowerCase())) || []);
6447
6289
  }
6448
6290
  }, [currencySearch, currencies]);
6449
- async function connectPartner(formData) {
6450
- var _a, _b, _c, _d, _e;
6451
- const vars = {
6452
- user: {
6453
- id: user.id,
6454
- accountId: user.accountId,
6455
- },
6456
- firstName: formData.firstName,
6457
- lastName: formData.lastName,
6458
- countryCode: formData.countryCode,
6459
- currency: formData.currency,
6460
- address: formData.address,
6461
- city: formData.city,
6462
- state: formData.state,
6463
- postalCode: formData.postalCode,
6464
- phoneNumber: formData.phoneNumber,
6465
- phoneNumberCountryCode: formData.phoneNumberCountryCode,
6466
- };
6467
- const result = await connectImpactPartner({
6468
- vars,
6469
- });
6470
- if (!result || ((_a = result) === null || _a === void 0 ? void 0 : _a.message))
6471
- throw new Error();
6472
- if (!((_b = result.createImpactConnection) === null || _b === void 0 ? void 0 : _b.success)) {
6473
- // Output backend errors to console for now
6474
- console.error("Failed to create Impact connection: ", result.createImpactConnection.validationErrors);
6475
- throw new Error();
6476
- }
6477
- await refetch();
6478
- const resultPublisher = (_e = (_d = (_c = result
6479
- .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;
6480
- const hasValidCurrentDocument = validTaxDocument(resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.requiredTaxDocumentType) && (resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.currentTaxDocument);
6481
- // Fire form change event
6482
- window.dispatchEvent(new Event(TAX_FORM_UPDATED_EVENT_KEY));
6483
- return {
6484
- resultPublisher,
6485
- hasValidCurrentDocument,
6486
- };
6487
- }
6488
6291
  async function onSubmit(event) {
6489
6292
  let formControls = event.target.getFormControls();
6490
6293
  let formData = {};
@@ -6527,41 +6330,9 @@ function useUserInfoForm(props) {
6527
6330
  postalCode: userData.postalCode,
6528
6331
  currency: userData.currency,
6529
6332
  });
6530
- const skipNextStep = getSkipNextStep(userData);
6531
- console.log({ skipNextStep });
6532
- if (skipNextStep) {
6533
- try {
6534
- const { resultPublisher, hasValidCurrentDocument } = await connectPartner(formData);
6535
- if ((resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.requiredTaxDocumentType) &&
6536
- !hasValidCurrentDocument) {
6537
- // Go to docusign form
6538
- setStep("/3");
6539
- }
6540
- else {
6541
- if (resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.brandedSignup) {
6542
- // Go to banking information form
6543
- setStep("/4");
6544
- }
6545
- else {
6546
- // Go right to the dashboard
6547
- setStep("/dashboard");
6548
- }
6549
- }
6550
- return;
6551
- }
6552
- catch (e) {
6553
- setErrors({ general: true });
6554
- return;
6555
- }
6556
- }
6557
- const nextStep = context.overrideNextStep || skipNextStep ? "/3" : "/2";
6333
+ const nextStep = context.overrideNextStep || "/2";
6558
6334
  setStep(nextStep);
6559
6335
  }
6560
- function getSkipNextStep(userData) {
6561
- if (userData.countryCode === "US")
6562
- return true;
6563
- return true;
6564
- }
6565
6336
  const hasStates = ["ES", "AU", "US", "CA"].includes(userFormContext.countryCode);
6566
6337
  const regionObj = hasStates
6567
6338
  ? ADDRESS_REGIONS[userFormContext === null || userFormContext === void 0 ? void 0 : userFormContext.countryCode]
@@ -6589,17 +6360,16 @@ function useUserInfoForm(props) {
6589
6360
  allCountries: countries,
6590
6361
  regionLabelEnum: regionObj === null || regionObj === void 0 ? void 0 : regionObj.labelEnum,
6591
6362
  regions: (regionObj === null || regionObj === void 0 ? void 0 : regionObj.regions) || [],
6592
- partnerData: (_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,
6593
6363
  },
6594
6364
  states: {
6595
6365
  step: step === null || step === void 0 ? void 0 : step.replace("/", ""),
6596
6366
  hideState: !hasStates,
6597
6367
  hideSteps: !!context.hideSteps,
6598
- disabled: loading || connectLoading,
6368
+ disabled: loading,
6599
6369
  loadingError: !!(userError === null || userError === void 0 ? void 0 : userError.message),
6600
- loading: loading || connectLoading,
6601
- isPartner: !!((_d = (_c = data === null || data === void 0 ? void 0 : data.user) === null || _c === void 0 ? void 0 : _c.impactConnection) === null || _d === void 0 ? void 0 : _d.publisher),
6602
- isUser: !!((_f = (_e = data === null || data === void 0 ? void 0 : data.user) === null || _e === void 0 ? void 0 : _e.impactConnection) === null || _f === void 0 ? void 0 : _f.user),
6370
+ loading: loading,
6371
+ isPartner: !!((_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),
6372
+ isUser: !!((_d = (_c = data === null || data === void 0 ? void 0 : data.user) === null || _c === void 0 ? void 0 : _c.impactConnection) === null || _d === void 0 ? void 0 : _d.user),
6603
6373
  formState: {
6604
6374
  ...userFormContext,
6605
6375
  errors: formErrors,