@saasquatch/mint-components 1.14.6-6 → 1.14.6-8

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 (28) hide show
  1. package/dist/cjs/{ShadowViewAddon-40f0bc74.js → ShadowViewAddon-d1dda2b0.js} +1 -0
  2. package/dist/cjs/sqm-big-stat_42.cjs.entry.js +42 -30
  3. package/dist/cjs/sqm-stencilbook.cjs.entry.js +1 -2
  4. package/dist/collection/components/sqm-lead-form/LeadInputField.stories.js +0 -1
  5. package/dist/collection/components/sqm-lead-form/sqm-lead-form-view.js +1 -0
  6. package/dist/collection/components/sqm-lead-form/useLeadForm.js +20 -9
  7. package/dist/esm/{ShadowViewAddon-8a0d9e83.js → ShadowViewAddon-81771102.js} +1 -0
  8. package/dist/esm/sqm-big-stat_42.entry.js +42 -30
  9. package/dist/esm/sqm-stencilbook.entry.js +1 -2
  10. package/dist/esm-es5/{ShadowViewAddon-8a0d9e83.js → ShadowViewAddon-81771102.js} +1 -1
  11. package/dist/esm-es5/sqm-big-stat_42.entry.js +1 -1
  12. package/dist/esm-es5/sqm-stencilbook.entry.js +1 -1
  13. package/dist/mint-components/mint-components.esm.js +1 -1
  14. package/dist/mint-components/p-37996351.system.js +1 -1
  15. package/dist/mint-components/{p-4139feb5.js → p-460974bf.js} +1 -1
  16. package/dist/mint-components/{p-a7f1974f.system.entry.js → p-59970cb1.system.entry.js} +1 -1
  17. package/dist/mint-components/p-732849d6.system.entry.js +1 -0
  18. package/dist/mint-components/{p-ad6420a2.system.js → p-ad128614.system.js} +1 -1
  19. package/dist/mint-components/{p-21e6721e.entry.js → p-ba585a4b.entry.js} +2 -2
  20. package/dist/mint-components/{p-9e9953a8.entry.js → p-cbfa7a11.entry.js} +24 -16
  21. package/dist/types/components/sqm-lead-form/useLeadForm.d.ts +1 -1
  22. package/dist/types/global/android.d.ts +7 -0
  23. package/dist/types/global/demo.d.ts +2 -0
  24. package/dist/types/stories/features.d.ts +4 -0
  25. package/dist/types/stories/templates.d.ts +4 -0
  26. package/docs/docs.docx +0 -0
  27. package/package.json +1 -1
  28. package/dist/mint-components/p-f17bad5d.system.entry.js +0 -1
@@ -4094,6 +4094,7 @@ const styleString$d = sheet$d.toString();
4094
4094
  function LeadFormView(props) {
4095
4095
  var _a, _b, _c, _d;
4096
4096
  const { states, refs, callbacks, content } = props;
4097
+ console.log({ states });
4097
4098
  if (states.error) {
4098
4099
  window.scrollTo({ top: 0, left: 0, behavior: "smooth" });
4099
4100
  }
@@ -24,7 +24,7 @@ const sqmPortalLoginView = require('./sqm-portal-login-view-761a4d8e.js');
24
24
  const usePortalLogin = require('./usePortalLogin-63d896d1.js');
25
25
  const AsYouType = require('./AsYouType-6788393a.js');
26
26
  const utilities = require('./utilities-78f5e169.js');
27
- const ShadowViewAddon = require('./ShadowViewAddon-40f0bc74.js');
27
+ const ShadowViewAddon = require('./ShadowViewAddon-d1dda2b0.js');
28
28
  require('./sqm-portal-container-view-4f15143a.js');
29
29
  const usePayoutStatus = require('./usePayoutStatus-feeac99b.js');
30
30
 
@@ -1293,6 +1293,13 @@ function useInputFieldDemo(props) {
1293
1293
  }, props.demoData || {}, { arrayMerge: (_, a) => a });
1294
1294
  }
1295
1295
 
1296
+ const SUBMIT_LEAD = index_module.dist.gql `
1297
+ mutation submitForm($formSubmissionInput: FormSubmissionInput!) {
1298
+ submitForm(formSubmissionInput: $formSubmissionInput) {
1299
+ success
1300
+ }
1301
+ }
1302
+ `;
1296
1303
  const GET_USER_DETAILS = index_module.dist.gql `
1297
1304
  query getUser($programId: ID) {
1298
1305
  viewer {
@@ -1302,34 +1309,14 @@ const GET_USER_DETAILS = index_module.dist.gql `
1302
1309
  }
1303
1310
  }
1304
1311
  `;
1305
- function useReferralIframe(props) {
1306
- var _a;
1307
- const programId = index_module.H();
1308
- const user = index_module.J();
1309
- const { data } = index_module.wn(GET_USER_DETAILS, { programId }, !(user === null || user === void 0 ? void 0 : user.jwt) || !programId);
1310
- return {
1311
- states: {
1312
- content: props,
1313
- },
1314
- data: {
1315
- shareCode: (_a = data === null || data === void 0 ? void 0 : data.viewer) === null || _a === void 0 ? void 0 : _a.referralCode,
1316
- },
1317
- };
1318
- }
1319
-
1320
- const SUBMIT_LEAD = index_module.dist.gql `
1321
- mutation submitForm($formSubmissionInput: FormSubmissionInput!) {
1322
- submitForm(formSubmissionInput: $formSubmissionInput) {
1323
- success
1324
- }
1325
- }
1326
- `;
1327
1312
  function useLeadForm(props) {
1328
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
1313
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
1329
1314
  const formRef = stencilHooks_module.useRef(null);
1330
1315
  const { leadFormState, setLeadFormState } = useLeadFormState.useLeadFormState({});
1331
- const referralCode = (_b = (_a = useReferralIframe()) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.shareCode;
1332
- console.log({ referralCode });
1316
+ const programId = index_module.H();
1317
+ const user = index_module.J();
1318
+ const { data: userDetails } = index_module.wn(GET_USER_DETAILS, { programId }, !(user === null || user === void 0 ? void 0 : user.jwt) || !programId);
1319
+ console.log({ userDetails });
1333
1320
  const [submitLead, { loading, errors, data }] = index_module.$e(SUBMIT_LEAD);
1334
1321
  const [success, setSuccess] = stencilHooks_module.useState(false);
1335
1322
  stencilHooks_module.useEffect(() => {
@@ -1414,23 +1401,24 @@ function useLeadForm(props) {
1414
1401
  e.target.value = asYouType.input(e.target.value);
1415
1402
  }, []);
1416
1403
  let errorMessage = "";
1417
- if ((_c = errors === null || errors === void 0 ? void 0 : errors.response) === null || _c === void 0 ? void 0 : _c["error"]) {
1404
+ if ((_a = errors === null || errors === void 0 ? void 0 : errors.response) === null || _a === void 0 ? void 0 : _a["error"]) {
1418
1405
  errorMessage = props.networkErrorMessage;
1419
1406
  }
1420
- else if ((errors === null || errors === void 0 ? void 0 : errors.message) && !((_d = errors === null || errors === void 0 ? void 0 : errors.response) === null || _d === void 0 ? void 0 : _d.errors.length)) {
1407
+ else if ((errors === null || errors === void 0 ? void 0 : errors.message) && !((_b = errors === null || errors === void 0 ? void 0 : errors.response) === null || _b === void 0 ? void 0 : _b.errors.length)) {
1421
1408
  errorMessage = props.networkErrorMessage;
1422
1409
  }
1423
1410
  else {
1424
1411
  errorMessage =
1425
- ((_h = (_g = (_f = (_e = errors === null || errors === void 0 ? void 0 : errors.response) === null || _e === void 0 ? void 0 : _e.errors) === null || _f === void 0 ? void 0 : _f[0]) === null || _g === void 0 ? void 0 : _g.extensions) === null || _h === void 0 ? void 0 : _h.message) || ((_l = (_k = (_j = errors === null || errors === void 0 ? void 0 : errors.response) === null || _j === void 0 ? void 0 : _j.errors) === null || _k === void 0 ? void 0 : _k[0]) === null || _l === void 0 ? void 0 : _l.message) || (leadFormState === null || leadFormState === void 0 ? void 0 : leadFormState.error);
1412
+ ((_f = (_e = (_d = (_c = errors === null || errors === void 0 ? void 0 : errors.response) === null || _c === void 0 ? void 0 : _c.errors) === null || _d === void 0 ? void 0 : _d[0]) === null || _e === void 0 ? void 0 : _e.extensions) === null || _f === void 0 ? void 0 : _f.message) || ((_j = (_h = (_g = errors === null || errors === void 0 ? void 0 : errors.response) === null || _g === void 0 ? void 0 : _g.errors) === null || _h === void 0 ? void 0 : _h[0]) === null || _j === void 0 ? void 0 : _j.message) || (leadFormState === null || leadFormState === void 0 ? void 0 : leadFormState.error);
1426
1413
  }
1414
+ console.log({ errors, errorMessage });
1427
1415
  return {
1428
1416
  states: {
1429
1417
  loading,
1430
1418
  error: errorMessage,
1431
1419
  success,
1432
1420
  leadFormState,
1433
- referralCode,
1421
+ referralCode: ((_k = userDetails === null || userDetails === void 0 ? void 0 : userDetails.viewer) === null || _k === void 0 ? void 0 : _k.referralCode) || "",
1434
1422
  },
1435
1423
  callbacks: {
1436
1424
  submit,
@@ -3601,6 +3589,30 @@ const ReferralCard = class {
3601
3589
  }
3602
3590
  };
3603
3591
 
3592
+ const GET_USER_DETAILS$1 = index_module.dist.gql `
3593
+ query getUser($programId: ID) {
3594
+ viewer {
3595
+ ... on User {
3596
+ referralCode(programId: $programId)
3597
+ }
3598
+ }
3599
+ }
3600
+ `;
3601
+ function useReferralIframe(props) {
3602
+ var _a;
3603
+ const programId = index_module.H();
3604
+ const user = index_module.J();
3605
+ const { data } = index_module.wn(GET_USER_DETAILS$1, { programId }, !(user === null || user === void 0 ? void 0 : user.jwt) || !programId);
3606
+ return {
3607
+ states: {
3608
+ content: props,
3609
+ },
3610
+ data: {
3611
+ shareCode: (_a = data === null || data === void 0 ? void 0 : data.viewer) === null || _a === void 0 ? void 0 : _a.referralCode,
3612
+ },
3613
+ };
3614
+ }
3615
+
3604
3616
  const SqmReferralIframe = class {
3605
3617
  constructor(hostRef) {
3606
3618
  index.registerInstance(this, hostRef);
@@ -36,7 +36,7 @@ const sqmPortalResetPasswordView = require('./sqm-portal-reset-password-view-fe6
36
36
  const sqmPortalVerifyEmailView = require('./sqm-portal-verify-email-view-7b678f34.js');
37
37
  require('./ErrorView-b2fcf954.js');
38
38
  const sqmQrCodeView = require('./sqm-qr-code-view-15dfc0b6.js');
39
- const ShadowViewAddon = require('./ShadowViewAddon-40f0bc74.js');
39
+ const ShadowViewAddon = require('./ShadowViewAddon-d1dda2b0.js');
40
40
  const sqmPortalContainerView = require('./sqm-portal-container-view-4f15143a.js');
41
41
  const sqmInvoiceTableView = require('./sqm-invoice-table-view-0f7fa309.js');
42
42
  const sqmLeadInputFieldView = require('./sqm-lead-input-field-view-6344cd93.js');
@@ -15946,7 +15946,6 @@ const defaultProps$u = {
15946
15946
  },
15947
15947
  },
15948
15948
  content: {
15949
- required: false,
15950
15949
  fieldName: "firstName",
15951
15950
  fieldLabel: "First Name",
15952
15951
  fieldType: "text",
@@ -13,7 +13,6 @@ const defaultProps = {
13
13
  },
14
14
  },
15
15
  content: {
16
- required: false,
17
16
  fieldName: "firstName",
18
17
  fieldLabel: "First Name",
19
18
  fieldType: "text",
@@ -51,6 +51,7 @@ const styleString = sheet.toString();
51
51
  export function LeadFormView(props) {
52
52
  var _a, _b, _c, _d;
53
53
  const { states, refs, callbacks, content } = props;
54
+ console.log({ states });
54
55
  if (states.error) {
55
56
  window.scrollTo({ top: 0, left: 0, behavior: "smooth" });
56
57
  }
@@ -1,10 +1,9 @@
1
- import { useMutation } from "@saasquatch/component-boilerplate";
1
+ import { useMutation, useProgramId, useQuery, useUserIdentity, } from "@saasquatch/component-boilerplate";
2
2
  import { useCallback, useEffect, useRef, useState, } from "@saasquatch/universal-hooks";
3
3
  import { gql } from "graphql-request";
4
4
  import jsonpointer from "jsonpointer";
5
5
  import { AsYouType } from "libphonenumber-js";
6
6
  import { useLeadFormState } from "./useLeadFormState";
7
- import { useReferralIframe } from "../sqm-referral-iframe/useReferralIframe";
8
7
  const SUBMIT_LEAD = gql `
9
8
  mutation submitForm($formSubmissionInput: FormSubmissionInput!) {
10
9
  submitForm(formSubmissionInput: $formSubmissionInput) {
@@ -12,12 +11,23 @@ const SUBMIT_LEAD = gql `
12
11
  }
13
12
  }
14
13
  `;
14
+ const GET_USER_DETAILS = gql `
15
+ query getUser($programId: ID) {
16
+ viewer {
17
+ ... on User {
18
+ referralCode(programId: $programId)
19
+ }
20
+ }
21
+ }
22
+ `;
15
23
  export function useLeadForm(props) {
16
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
24
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
17
25
  const formRef = useRef(null);
18
26
  const { leadFormState, setLeadFormState } = useLeadFormState({});
19
- const referralCode = (_b = (_a = useReferralIframe()) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.shareCode;
20
- console.log({ referralCode });
27
+ const programId = useProgramId();
28
+ const user = useUserIdentity();
29
+ const { data: userDetails } = useQuery(GET_USER_DETAILS, { programId }, !(user === null || user === void 0 ? void 0 : user.jwt) || !programId);
30
+ console.log({ userDetails });
21
31
  const [submitLead, { loading, errors, data }] = useMutation(SUBMIT_LEAD);
22
32
  const [success, setSuccess] = useState(false);
23
33
  useEffect(() => {
@@ -102,23 +112,24 @@ export function useLeadForm(props) {
102
112
  e.target.value = asYouType.input(e.target.value);
103
113
  }, []);
104
114
  let errorMessage = "";
105
- if ((_c = errors === null || errors === void 0 ? void 0 : errors.response) === null || _c === void 0 ? void 0 : _c["error"]) {
115
+ if ((_a = errors === null || errors === void 0 ? void 0 : errors.response) === null || _a === void 0 ? void 0 : _a["error"]) {
106
116
  errorMessage = props.networkErrorMessage;
107
117
  }
108
- else if ((errors === null || errors === void 0 ? void 0 : errors.message) && !((_d = errors === null || errors === void 0 ? void 0 : errors.response) === null || _d === void 0 ? void 0 : _d.errors.length)) {
118
+ else if ((errors === null || errors === void 0 ? void 0 : errors.message) && !((_b = errors === null || errors === void 0 ? void 0 : errors.response) === null || _b === void 0 ? void 0 : _b.errors.length)) {
109
119
  errorMessage = props.networkErrorMessage;
110
120
  }
111
121
  else {
112
122
  errorMessage =
113
- ((_h = (_g = (_f = (_e = errors === null || errors === void 0 ? void 0 : errors.response) === null || _e === void 0 ? void 0 : _e.errors) === null || _f === void 0 ? void 0 : _f[0]) === null || _g === void 0 ? void 0 : _g.extensions) === null || _h === void 0 ? void 0 : _h.message) || ((_l = (_k = (_j = errors === null || errors === void 0 ? void 0 : errors.response) === null || _j === void 0 ? void 0 : _j.errors) === null || _k === void 0 ? void 0 : _k[0]) === null || _l === void 0 ? void 0 : _l.message) || (leadFormState === null || leadFormState === void 0 ? void 0 : leadFormState.error);
123
+ ((_f = (_e = (_d = (_c = errors === null || errors === void 0 ? void 0 : errors.response) === null || _c === void 0 ? void 0 : _c.errors) === null || _d === void 0 ? void 0 : _d[0]) === null || _e === void 0 ? void 0 : _e.extensions) === null || _f === void 0 ? void 0 : _f.message) || ((_j = (_h = (_g = errors === null || errors === void 0 ? void 0 : errors.response) === null || _g === void 0 ? void 0 : _g.errors) === null || _h === void 0 ? void 0 : _h[0]) === null || _j === void 0 ? void 0 : _j.message) || (leadFormState === null || leadFormState === void 0 ? void 0 : leadFormState.error);
114
124
  }
125
+ console.log({ errors, errorMessage });
115
126
  return {
116
127
  states: {
117
128
  loading,
118
129
  error: errorMessage,
119
130
  success,
120
131
  leadFormState,
121
- referralCode,
132
+ referralCode: ((_k = userDetails === null || userDetails === void 0 ? void 0 : userDetails.viewer) === null || _k === void 0 ? void 0 : _k.referralCode) || "",
122
133
  },
123
134
  callbacks: {
124
135
  submit,
@@ -4092,6 +4092,7 @@ const styleString$d = sheet$d.toString();
4092
4092
  function LeadFormView(props) {
4093
4093
  var _a, _b, _c, _d;
4094
4094
  const { states, refs, callbacks, content } = props;
4095
+ console.log({ states });
4095
4096
  if (states.error) {
4096
4097
  window.scrollTo({ top: 0, left: 0, behavior: "smooth" });
4097
4098
  }
@@ -20,7 +20,7 @@ import { P as PortalLoginView } from './sqm-portal-login-view-7e49609a.js';
20
20
  import { u as usePortalLogin } from './usePortalLogin-ef647a50.js';
21
21
  import { A as AsYouType } from './AsYouType-46f67d0d.js';
22
22
  import { i as isEmpty } from './utilities-5b0ca040.js';
23
- import { b as useDemoBigStat, V as useBigStat, B as BigStatView, Q as autoColorScaleCss, J as CardFeedView, i as CheckboxFieldView, K as CouponCodeView, D as DropdownFieldView, E as EditProfileView, H as HeroView, I as InputFieldView, O as LeadFormView, W as withShadowView, L as LeaderboardView, N as NameFieldsView, C as ChangeMarktingView, d as PortalChangePasswordView, h as PortalFooterView, P as PortalFrameView, e as PortalRegisterView, R as ReferralIframeView, X as demoRewardExchange, j as RewardExchangeView, a as useShareButton, S as ShareButtonView, u as useShareLink, c as StatContainerView, T as TaskCardView } from './ShadowViewAddon-8a0d9e83.js';
23
+ import { b as useDemoBigStat, V as useBigStat, B as BigStatView, Q as autoColorScaleCss, J as CardFeedView, i as CheckboxFieldView, K as CouponCodeView, D as DropdownFieldView, E as EditProfileView, H as HeroView, I as InputFieldView, O as LeadFormView, W as withShadowView, L as LeaderboardView, N as NameFieldsView, C as ChangeMarktingView, d as PortalChangePasswordView, h as PortalFooterView, P as PortalFrameView, e as PortalRegisterView, R as ReferralIframeView, X as demoRewardExchange, j as RewardExchangeView, a as useShareButton, S as ShareButtonView, u as useShareLink, c as StatContainerView, T as TaskCardView } from './ShadowViewAddon-81771102.js';
24
24
  import './sqm-portal-container-view-1683ae32.js';
25
25
  import { u as usePayoutStatus } from './usePayoutStatus-fed17fc9.js';
26
26
 
@@ -1289,6 +1289,13 @@ function useInputFieldDemo(props) {
1289
1289
  }, props.demoData || {}, { arrayMerge: (_, a) => a });
1290
1290
  }
1291
1291
 
1292
+ const SUBMIT_LEAD = dist.gql `
1293
+ mutation submitForm($formSubmissionInput: FormSubmissionInput!) {
1294
+ submitForm(formSubmissionInput: $formSubmissionInput) {
1295
+ success
1296
+ }
1297
+ }
1298
+ `;
1292
1299
  const GET_USER_DETAILS = dist.gql `
1293
1300
  query getUser($programId: ID) {
1294
1301
  viewer {
@@ -1298,34 +1305,14 @@ const GET_USER_DETAILS = dist.gql `
1298
1305
  }
1299
1306
  }
1300
1307
  `;
1301
- function useReferralIframe(props) {
1302
- var _a;
1303
- const programId = H();
1304
- const user = J();
1305
- const { data } = wn(GET_USER_DETAILS, { programId }, !(user === null || user === void 0 ? void 0 : user.jwt) || !programId);
1306
- return {
1307
- states: {
1308
- content: props,
1309
- },
1310
- data: {
1311
- shareCode: (_a = data === null || data === void 0 ? void 0 : data.viewer) === null || _a === void 0 ? void 0 : _a.referralCode,
1312
- },
1313
- };
1314
- }
1315
-
1316
- const SUBMIT_LEAD = dist.gql `
1317
- mutation submitForm($formSubmissionInput: FormSubmissionInput!) {
1318
- submitForm(formSubmissionInput: $formSubmissionInput) {
1319
- success
1320
- }
1321
- }
1322
- `;
1323
1308
  function useLeadForm(props) {
1324
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
1309
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
1325
1310
  const formRef = useRef(null);
1326
1311
  const { leadFormState, setLeadFormState } = useLeadFormState({});
1327
- const referralCode = (_b = (_a = useReferralIframe()) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.shareCode;
1328
- console.log({ referralCode });
1312
+ const programId = H();
1313
+ const user = J();
1314
+ const { data: userDetails } = wn(GET_USER_DETAILS, { programId }, !(user === null || user === void 0 ? void 0 : user.jwt) || !programId);
1315
+ console.log({ userDetails });
1329
1316
  const [submitLead, { loading, errors, data }] = $e(SUBMIT_LEAD);
1330
1317
  const [success, setSuccess] = useState(false);
1331
1318
  useEffect(() => {
@@ -1410,23 +1397,24 @@ function useLeadForm(props) {
1410
1397
  e.target.value = asYouType.input(e.target.value);
1411
1398
  }, []);
1412
1399
  let errorMessage = "";
1413
- if ((_c = errors === null || errors === void 0 ? void 0 : errors.response) === null || _c === void 0 ? void 0 : _c["error"]) {
1400
+ if ((_a = errors === null || errors === void 0 ? void 0 : errors.response) === null || _a === void 0 ? void 0 : _a["error"]) {
1414
1401
  errorMessage = props.networkErrorMessage;
1415
1402
  }
1416
- else if ((errors === null || errors === void 0 ? void 0 : errors.message) && !((_d = errors === null || errors === void 0 ? void 0 : errors.response) === null || _d === void 0 ? void 0 : _d.errors.length)) {
1403
+ else if ((errors === null || errors === void 0 ? void 0 : errors.message) && !((_b = errors === null || errors === void 0 ? void 0 : errors.response) === null || _b === void 0 ? void 0 : _b.errors.length)) {
1417
1404
  errorMessage = props.networkErrorMessage;
1418
1405
  }
1419
1406
  else {
1420
1407
  errorMessage =
1421
- ((_h = (_g = (_f = (_e = errors === null || errors === void 0 ? void 0 : errors.response) === null || _e === void 0 ? void 0 : _e.errors) === null || _f === void 0 ? void 0 : _f[0]) === null || _g === void 0 ? void 0 : _g.extensions) === null || _h === void 0 ? void 0 : _h.message) || ((_l = (_k = (_j = errors === null || errors === void 0 ? void 0 : errors.response) === null || _j === void 0 ? void 0 : _j.errors) === null || _k === void 0 ? void 0 : _k[0]) === null || _l === void 0 ? void 0 : _l.message) || (leadFormState === null || leadFormState === void 0 ? void 0 : leadFormState.error);
1408
+ ((_f = (_e = (_d = (_c = errors === null || errors === void 0 ? void 0 : errors.response) === null || _c === void 0 ? void 0 : _c.errors) === null || _d === void 0 ? void 0 : _d[0]) === null || _e === void 0 ? void 0 : _e.extensions) === null || _f === void 0 ? void 0 : _f.message) || ((_j = (_h = (_g = errors === null || errors === void 0 ? void 0 : errors.response) === null || _g === void 0 ? void 0 : _g.errors) === null || _h === void 0 ? void 0 : _h[0]) === null || _j === void 0 ? void 0 : _j.message) || (leadFormState === null || leadFormState === void 0 ? void 0 : leadFormState.error);
1422
1409
  }
1410
+ console.log({ errors, errorMessage });
1423
1411
  return {
1424
1412
  states: {
1425
1413
  loading,
1426
1414
  error: errorMessage,
1427
1415
  success,
1428
1416
  leadFormState,
1429
- referralCode,
1417
+ referralCode: ((_k = userDetails === null || userDetails === void 0 ? void 0 : userDetails.viewer) === null || _k === void 0 ? void 0 : _k.referralCode) || "",
1430
1418
  },
1431
1419
  callbacks: {
1432
1420
  submit,
@@ -3597,6 +3585,30 @@ const ReferralCard = class {
3597
3585
  }
3598
3586
  };
3599
3587
 
3588
+ const GET_USER_DETAILS$1 = dist.gql `
3589
+ query getUser($programId: ID) {
3590
+ viewer {
3591
+ ... on User {
3592
+ referralCode(programId: $programId)
3593
+ }
3594
+ }
3595
+ }
3596
+ `;
3597
+ function useReferralIframe(props) {
3598
+ var _a;
3599
+ const programId = H();
3600
+ const user = J();
3601
+ const { data } = wn(GET_USER_DETAILS$1, { programId }, !(user === null || user === void 0 ? void 0 : user.jwt) || !programId);
3602
+ return {
3603
+ states: {
3604
+ content: props,
3605
+ },
3606
+ data: {
3607
+ shareCode: (_a = data === null || data === void 0 ? void 0 : data.viewer) === null || _a === void 0 ? void 0 : _a.referralCode,
3608
+ },
3609
+ };
3610
+ }
3611
+
3600
3612
  const SqmReferralIframe = class {
3601
3613
  constructor(hostRef) {
3602
3614
  registerInstance(this, hostRef);
@@ -32,7 +32,7 @@ import { P as PortalResetPasswordView } from './sqm-portal-reset-password-view-5
32
32
  import { P as PortalVerifyEmailView } from './sqm-portal-verify-email-view-b12cb894.js';
33
33
  import './ErrorView-48e2b969.js';
34
34
  import { Q as QrCodeView } from './sqm-qr-code-view-f1d0763b.js';
35
- import { S as ShareButtonView, L as LeaderboardView, B as BigStatView, P as PortalFrameView, E as EditProfileView, u as useShareLink, a as useShareButton, b as useDemoBigStat, c as StatContainerView, d as PortalChangePasswordView, e as PortalRegisterView, C as ChangeMarktingView, T as TaskCardView, f as ProgressBarView, g as PoweredByImg$1, h as PortalFooterView, H as HeroView, R as ReferralIframeView, N as NameFieldsView, i as CheckboxFieldView, D as DropdownFieldView, I as InputFieldView, j as RewardExchangeView, r as rewardExchangeCustomErrorMsg, k as rewardExchangeLongText, l as rewardExchangeSelected, m as chooseAmountFixed, n as chooseAmountFixedNoDescription, o as chooseAmountVariable, p as chooseAmountVariableNoDescription, q as chooseAmountVariableDisabled, s as chooseAmountVariableUnavailable, t as confirmFixed, v as confirmVariable, w as redemptionError, x as queryError, y as success, z as successVariable, A as loading, F as empty$1, G as rewardExchange, J as CardFeedView, K as CouponCodeView, M as ProgressBar$2, O as LeadFormView, Q as autoColorScaleCss, U as ShadowViewAddon } from './ShadowViewAddon-8a0d9e83.js';
35
+ import { S as ShareButtonView, L as LeaderboardView, B as BigStatView, P as PortalFrameView, E as EditProfileView, u as useShareLink, a as useShareButton, b as useDemoBigStat, c as StatContainerView, d as PortalChangePasswordView, e as PortalRegisterView, C as ChangeMarktingView, T as TaskCardView, f as ProgressBarView, g as PoweredByImg$1, h as PortalFooterView, H as HeroView, R as ReferralIframeView, N as NameFieldsView, i as CheckboxFieldView, D as DropdownFieldView, I as InputFieldView, j as RewardExchangeView, r as rewardExchangeCustomErrorMsg, k as rewardExchangeLongText, l as rewardExchangeSelected, m as chooseAmountFixed, n as chooseAmountFixedNoDescription, o as chooseAmountVariable, p as chooseAmountVariableNoDescription, q as chooseAmountVariableDisabled, s as chooseAmountVariableUnavailable, t as confirmFixed, v as confirmVariable, w as redemptionError, x as queryError, y as success, z as successVariable, A as loading, F as empty$1, G as rewardExchange, J as CardFeedView, K as CouponCodeView, M as ProgressBar$2, O as LeadFormView, Q as autoColorScaleCss, U as ShadowViewAddon } from './ShadowViewAddon-81771102.js';
36
36
  import { P as PortalContainerView, a as PortalSectionView } from './sqm-portal-container-view-1683ae32.js';
37
37
  import { O as OtherRegionSlotView, I as InvoiceTableView, T as TaxForm } from './sqm-invoice-table-view-7f376a75.js';
38
38
  import { L as LeadInputFieldView } from './sqm-lead-input-field-view-f1dd4b77.js';
@@ -15942,7 +15942,6 @@ const defaultProps$u = {
15942
15942
  },
15943
15943
  },
15944
15944
  content: {
15945
- required: false,
15946
15945
  fieldName: "firstName",
15947
15946
  fieldLabel: "First Name",
15948
15947
  fieldType: "text",