@saasquatch/mint-components 1.14.6-0 → 1.14.6-10

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 (83) hide show
  1. package/dist/cjs/{ShadowViewAddon-be112912.js → ShadowViewAddon-d1dda2b0.js} +62 -27
  2. package/dist/cjs/loader.cjs.js +1 -1
  3. package/dist/cjs/mint-components.cjs.js +1 -1
  4. package/dist/cjs/sqm-big-stat_42.cjs.entry.js +108 -121
  5. package/dist/cjs/sqm-lead-dropdown-field-view-03a3e03f.js +69 -0
  6. package/dist/cjs/sqm-lead-dropdown-field.cjs.entry.js +81 -0
  7. package/dist/cjs/sqm-lead-input-field-view-6344cd93.js +51 -0
  8. package/dist/cjs/sqm-lead-input-field.cjs.entry.js +84 -0
  9. package/dist/cjs/sqm-stencilbook.cjs.entry.js +166 -49
  10. package/dist/cjs/useLeadFormState-c83d2034.js +72 -0
  11. package/dist/collection/collection-manifest.json +3 -1
  12. package/dist/collection/components/sqm-lead-form/LeadForm.stories.js +34 -46
  13. package/dist/collection/components/sqm-lead-form/LeadFormDropdownField.stories.js +59 -0
  14. package/dist/collection/components/sqm-lead-form/LeadInputField.stories.js +48 -0
  15. package/dist/collection/components/sqm-lead-form/sqm-lead-dropdown-field-view.js +65 -0
  16. package/dist/collection/components/sqm-lead-form/sqm-lead-dropdown-field.js +199 -0
  17. package/dist/collection/components/sqm-lead-form/sqm-lead-form-view.js +63 -27
  18. package/dist/collection/components/sqm-lead-form/sqm-lead-form.js +147 -36
  19. package/dist/collection/components/sqm-lead-form/sqm-lead-input-field-view.js +47 -0
  20. package/dist/collection/components/sqm-lead-form/sqm-lead-input-field.js +228 -0
  21. package/dist/collection/components/sqm-lead-form/useLeadDropdownField.js +10 -0
  22. package/dist/collection/components/sqm-lead-form/useLeadForm.js +30 -8
  23. package/dist/collection/components/sqm-lead-form/useLeadInputField.js +10 -0
  24. package/dist/collection/components/sqm-stencilbook/sqm-stencilbook.js +4 -0
  25. package/dist/esm/{ShadowViewAddon-9a77dd6b.js → ShadowViewAddon-81771102.js} +62 -27
  26. package/dist/esm/loader.js +1 -1
  27. package/dist/esm/mint-components.js +1 -1
  28. package/dist/esm/sqm-big-stat_42.entry.js +105 -118
  29. package/dist/esm/sqm-lead-dropdown-field-view-4c85fe20.js +67 -0
  30. package/dist/esm/sqm-lead-dropdown-field.entry.js +77 -0
  31. package/dist/esm/sqm-lead-input-field-view-f1dd4b77.js +49 -0
  32. package/dist/esm/sqm-lead-input-field.entry.js +80 -0
  33. package/dist/esm/sqm-stencilbook.entry.js +166 -49
  34. package/dist/esm/useLeadFormState-9016d812.js +68 -0
  35. package/dist/esm-es5/{ShadowViewAddon-9a77dd6b.js → ShadowViewAddon-81771102.js} +1 -1
  36. package/dist/esm-es5/loader.js +1 -1
  37. package/dist/esm-es5/mint-components.js +1 -1
  38. package/dist/esm-es5/sqm-big-stat_42.entry.js +1 -1
  39. package/dist/esm-es5/sqm-lead-dropdown-field-view-4c85fe20.js +1 -0
  40. package/dist/esm-es5/sqm-lead-dropdown-field.entry.js +1 -0
  41. package/dist/esm-es5/sqm-lead-input-field-view-f1dd4b77.js +1 -0
  42. package/dist/esm-es5/sqm-lead-input-field.entry.js +1 -0
  43. package/dist/esm-es5/sqm-stencilbook.entry.js +1 -1
  44. package/dist/esm-es5/useLeadFormState-9016d812.js +1 -0
  45. package/dist/mint-components/mint-components.esm.js +1 -1
  46. package/dist/mint-components/p-10343b27.system.entry.js +1 -0
  47. package/dist/mint-components/p-15f1ff1d.system.js +1 -0
  48. package/dist/mint-components/p-1d704c40.system.js +1 -0
  49. package/dist/mint-components/p-26da31c6.js +1 -0
  50. package/dist/mint-components/p-37996351.system.js +1 -1
  51. package/dist/mint-components/p-4056c0ea.system.entry.js +1 -0
  52. package/dist/mint-components/{p-ca9caa59.js → p-460974bf.js} +3 -3
  53. package/dist/mint-components/p-4d5b02af.js +1 -0
  54. package/dist/mint-components/p-59970cb1.system.entry.js +1 -0
  55. package/dist/mint-components/p-6b093d8c.entry.js +1 -0
  56. package/dist/mint-components/p-79e1a189.entry.js +273 -0
  57. package/dist/mint-components/p-87384d9e.system.js +1 -0
  58. package/dist/mint-components/{p-5aafb98a.system.js → p-ad128614.system.js} +1 -1
  59. package/dist/mint-components/{p-aa71fc1a.entry.js → p-ba585a4b.entry.js} +2 -2
  60. package/dist/mint-components/p-c5a55554.entry.js +1 -0
  61. package/dist/mint-components/p-de5356d9.system.entry.js +1 -0
  62. package/dist/mint-components/p-f98a4354.js +1 -0
  63. package/dist/types/components/sqm-lead-form/LeadForm.stories.d.ts +1 -0
  64. package/dist/types/components/sqm-lead-form/LeadFormDropdownField.stories.d.ts +9 -0
  65. package/dist/types/components/sqm-lead-form/LeadInputField.stories.d.ts +8 -0
  66. package/dist/types/components/sqm-lead-form/sqm-lead-dropdown-field-view.d.ts +15 -0
  67. package/dist/types/components/sqm-lead-form/sqm-lead-dropdown-field.d.ts +42 -0
  68. package/dist/types/components/sqm-lead-form/sqm-lead-form-view.d.ts +7 -0
  69. package/dist/types/components/sqm-lead-form/sqm-lead-form.d.ts +24 -7
  70. package/dist/types/components/sqm-lead-form/sqm-lead-input-field-view.d.ts +14 -0
  71. package/dist/types/components/sqm-lead-form/sqm-lead-input-field.d.ts +49 -0
  72. package/dist/types/components/sqm-lead-form/useLeadDropdownField.d.ts +6 -0
  73. package/dist/types/components/sqm-lead-form/useLeadForm.d.ts +5 -1
  74. package/dist/types/components/sqm-lead-form/useLeadInputField.d.ts +6 -0
  75. package/dist/types/components/sqm-referral-iframe/useReferralIframe.d.ts +1 -1
  76. package/dist/types/components.d.ts +194 -12
  77. package/docs/docs.docx +0 -0
  78. package/docs/raisins.json +1 -1
  79. package/grapesjs/grapesjs.js +1 -1
  80. package/package.json +1 -1
  81. package/dist/mint-components/p-a2adc8b8.system.entry.js +0 -1
  82. package/dist/mint-components/p-e62f2051.entry.js +0 -265
  83. package/dist/mint-components/p-f38f77b5.system.entry.js +0 -1
@@ -19,11 +19,12 @@ require('./luxon-2926d85f.js');
19
19
  require('./sqm-text-span-view-0aa82125.js');
20
20
  const index$1 = require('./index-8c6255f5.js');
21
21
  const useRegistrationFormState = require('./useRegistrationFormState-7b820f0c.js');
22
+ const useLeadFormState = require('./useLeadFormState-c83d2034.js');
22
23
  const sqmPortalLoginView = require('./sqm-portal-login-view-761a4d8e.js');
23
24
  const usePortalLogin = require('./usePortalLogin-63d896d1.js');
24
25
  const AsYouType = require('./AsYouType-6788393a.js');
25
26
  const utilities = require('./utilities-78f5e169.js');
26
- const ShadowViewAddon = require('./ShadowViewAddon-be112912.js');
27
+ const ShadowViewAddon = require('./ShadowViewAddon-d1dda2b0.js');
27
28
  require('./sqm-portal-container-view-4f15143a.js');
28
29
  const usePayoutStatus = require('./usePayoutStatus-feeac99b.js');
29
30
 
@@ -141,58 +142,6 @@ const CardFeed = class {
141
142
  }
142
143
  };
143
144
 
144
- const style = {
145
- IconStyle: {
146
- display: "block",
147
- position: "absolute",
148
- top: "23px",
149
- },
150
- DivStyle: {
151
- marginLeft: "28px",
152
- },
153
- Details: {
154
- marginLeft: "28px",
155
- },
156
- Heading: {
157
- display: "inline-block",
158
- },
159
- Children: {
160
- display: "none",
161
- },
162
- };
163
- const sheet = JSS.createStyleSheet(style);
164
- const styleString = sheet.toString();
165
- function RequiredPropsError({ missingProps, heading = "There was a problem loading this section", subheading = "There was a technical problem that prevented this section from loading. Please contact us with the link to this page.", description = "Error occured while loading <{tagName}>. Values for the following attributes are missing:", }, children) {
166
- if (!missingProps)
167
- return false;
168
- const host = index_module._();
169
- const [detailsOpen, setDetailsOpen] = stencilHooks_module.useState(false);
170
- return (index.h("sl-alert", { type: "danger", open: true },
171
- index.h("style", { type: "text/css" }, styleString),
172
- index.h("div", { slot: "icon", class: sheet.classes.IconStyle },
173
- index.h("sl-icon", { name: "exclamation-octagon" })),
174
- index.h("div", { class: sheet.classes.DivStyle },
175
- index.h("h2", { class: sheet.classes.Heading }, global.intl.formatMessage({
176
- id: `error-heading`,
177
- defaultMessage: heading,
178
- })),
179
- index.h("p", null, global.intl.formatMessage({
180
- id: `error-subheading`,
181
- defaultMessage: subheading,
182
- }))),
183
- index.h("details", { class: sheet.classes.Details },
184
- index.h("summary", { onClick: () => setDetailsOpen(!detailsOpen) },
185
- detailsOpen ? "Less" : "More",
186
- " details"),
187
- index.h("p", null, global.intl.formatMessage({
188
- id: `error-description`,
189
- defaultMessage: description,
190
- }, { tagName: host.tagName.toLowerCase() })),
191
- index.h("ul", null, missingProps.map((prop) => (index.h("li", null,
192
- index.h("strong", null, prop.attribute)))))),
193
- index.h("div", { class: sheet.classes.Children }, children)));
194
- }
195
-
196
145
  function useCheckboxField(props) {
197
146
  var _a;
198
147
  const registrationFormState = stencilHooks_module.d(useRegistrationFormState.REGISTRATION_FORM_STATE_CONTEXT);
@@ -252,7 +201,7 @@ const CheckboxField = class {
252
201
  },
253
202
  ]);
254
203
  if (!index_module.isDemo() && missingProps) {
255
- return (index.h(RequiredPropsError, { missingProps: missingProps, heading: "An error occured while loading this form", subheading: "A technical problem prevented this checkbox field from loading. Please contact us with the link to this page.", description: "Values for the following attributes are missing:" }));
204
+ return (index.h(useLeadFormState.RequiredPropsError, { missingProps: missingProps, heading: "An error occured while loading this form", subheading: "A technical problem prevented this checkbox field from loading. Please contact us with the link to this page.", description: "Values for the following attributes are missing:" }));
256
205
  }
257
206
  const content = {
258
207
  ...utils.getProps(this),
@@ -718,7 +667,7 @@ const DropdownField = class {
718
667
  },
719
668
  ]);
720
669
  if (!index_module.isDemo() && missingProps) {
721
- return (index.h(RequiredPropsError, { missingProps: missingProps, heading: "An error occured while loading this form", subheading: "A technical problem prevented this drop down field from loading. Please contact us with the link to this page.", description: "Values for the following attributes are missing:" }, index.h("slot", null)));
670
+ return (index.h(useLeadFormState.RequiredPropsError, { missingProps: missingProps, heading: "An error occured while loading this form", subheading: "A technical problem prevented this drop down field from loading. Please contact us with the link to this page.", description: "Values for the following attributes are missing:" }, index.h("slot", null)));
722
671
  }
723
672
  const content = {
724
673
  ...utils.getProps(this),
@@ -1330,7 +1279,7 @@ const InputField = class {
1330
1279
  },
1331
1280
  ]);
1332
1281
  if (!index_module.isDemo() && missingProps) {
1333
- return (index.h(RequiredPropsError, { missingProps: missingProps, heading: "An error occured while loading this form", subheading: "A technical problem prevented this input field from loading. Please contact us with the link to this page.", description: "Values for the following attributes are missing:" }));
1282
+ return (index.h(useLeadFormState.RequiredPropsError, { missingProps: missingProps, heading: "An error occured while loading this form", subheading: "A technical problem prevented this input field from loading. Please contact us with the link to this page.", description: "Values for the following attributes are missing:" }));
1334
1283
  }
1335
1284
  const { states } = index_module.isDemo() ? useInputFieldDemo(this) : useInputField();
1336
1285
  return index.h(ShadowViewAddon.InputFieldView, { states: states, content: content });
@@ -1344,27 +1293,32 @@ function useInputFieldDemo(props) {
1344
1293
  }, props.demoData || {}, { arrayMerge: (_, a) => a });
1345
1294
  }
1346
1295
 
1347
- const LEAD_FORM_STATE_CONTEXT = "sq:lead-form-state";
1348
- const LEAD_FORM_STATE_CONTEXT_INTERNAL = "sq:lead-form-state-internal";
1349
- function useLeadFormState(formState) {
1350
- const host = index_module._();
1351
- const [leadFormState, setLeadFormState] = stencilHooks_module.y(host, LEAD_FORM_STATE_CONTEXT, formState);
1352
- stencilHooks_module.y(host, LEAD_FORM_STATE_CONTEXT_INTERNAL, [leadFormState, setLeadFormState]);
1353
- return { leadFormState, setLeadFormState };
1354
- }
1355
-
1356
1296
  const SUBMIT_LEAD = index_module.dist.gql `
1357
- mutation submitForm($formSubmissionInput: FormSubmissionInput) {
1297
+ mutation submitForm($formSubmissionInput: FormSubmissionInput!) {
1358
1298
  submitForm(formSubmissionInput: $formSubmissionInput) {
1359
1299
  success
1360
1300
  }
1361
1301
  }
1362
1302
  `;
1303
+ const GET_USER_DETAILS = index_module.dist.gql `
1304
+ query getUser($programId: ID) {
1305
+ viewer {
1306
+ ... on User {
1307
+ referralCode(programId: $programId)
1308
+ }
1309
+ }
1310
+ }
1311
+ `;
1363
1312
  function useLeadForm(props) {
1364
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
1313
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
1365
1314
  const formRef = stencilHooks_module.useRef(null);
1366
- const { leadFormState, setLeadFormState } = useLeadFormState({});
1315
+ const { leadFormState, setLeadFormState } = useLeadFormState.useLeadFormState({});
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 });
1367
1320
  const [submitLead, { loading, errors, data }] = index_module.$e(SUBMIT_LEAD);
1321
+ const [success, setSuccess] = stencilHooks_module.useState(false);
1368
1322
  stencilHooks_module.useEffect(() => {
1369
1323
  if (!formRef.current)
1370
1324
  return;
@@ -1375,6 +1329,7 @@ function useLeadForm(props) {
1375
1329
  };
1376
1330
  }, [formRef.current]);
1377
1331
  const submit = async (event) => {
1332
+ var _a, _b, _c;
1378
1333
  let formControls = event.target.getFormControls();
1379
1334
  let formData = {};
1380
1335
  let validationErrors = {};
@@ -1413,6 +1368,11 @@ function useLeadForm(props) {
1413
1368
  };
1414
1369
  try {
1415
1370
  const result = await submitLead({ formSubmissionInput: variables });
1371
+ console.log({
1372
+ result,
1373
+ success: (_a = result === null || result === void 0 ? void 0 : result.submitForm) === null || _a === void 0 ? void 0 : _a.success,
1374
+ isError: result instanceof Error,
1375
+ });
1416
1376
  if (result instanceof Error) {
1417
1377
  throw result;
1418
1378
  }
@@ -1421,11 +1381,12 @@ function useLeadForm(props) {
1421
1381
  error: "",
1422
1382
  validationErrors: {},
1423
1383
  });
1424
- if (result.success) {
1425
- index_module.jn.push(props.nextPage);
1384
+ if ((_c = (_b = result === null || result === void 0 ? void 0 : result.data) === null || _b === void 0 ? void 0 : _b.submitForm) === null || _c === void 0 ? void 0 : _c.success) {
1385
+ setSuccess(true);
1426
1386
  }
1427
1387
  }
1428
1388
  catch (error) {
1389
+ console.log({ error });
1429
1390
  setLeadFormState({
1430
1391
  loading: false,
1431
1392
  error: props.networkErrorMessage,
@@ -1452,12 +1413,14 @@ function useLeadForm(props) {
1452
1413
  errorMessage =
1453
1414
  ((_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);
1454
1415
  }
1416
+ console.log({ errors, errorMessage });
1455
1417
  return {
1456
1418
  states: {
1457
1419
  loading,
1458
1420
  error: errorMessage,
1421
+ success,
1459
1422
  leadFormState,
1460
- referralCode: "ABC123",
1423
+ referralCode: ((_k = userDetails === null || userDetails === void 0 ? void 0 : userDetails.viewer) === null || _k === void 0 ? void 0 : _k.referralCode) || "",
1461
1424
  },
1462
1425
  callbacks: {
1463
1426
  submit,
@@ -1473,13 +1436,6 @@ const LeadForm = class {
1473
1436
  constructor(hostRef) {
1474
1437
  index.registerInstance(this, hostRef);
1475
1438
  this.ignored = true;
1476
- /**
1477
- * Redirect participants to this page from their verification email
1478
- *
1479
- * @uiName Submission redirect
1480
- * @uiWidget pageSelect
1481
- */
1482
- this.nextPage = "/";
1483
1439
  /**
1484
1440
  * @uiName Email field label
1485
1441
  */
@@ -1496,18 +1452,42 @@ const LeadForm = class {
1496
1452
  * @uiName Submit button text
1497
1453
  */
1498
1454
  this.submitLabel = "Submit";
1455
+ /**
1456
+ * @uiName Submit another form button label
1457
+ */
1458
+ this.resubmitFormLabel = "Refer Another Friend";
1499
1459
  /**
1500
1460
  * @uiName Header text
1501
1461
  */
1502
- this.pageLabel = "Submit your information";
1462
+ this.pageLabel = "Refer your friend";
1503
1463
  this.formKey = "lead-form";
1464
+ /**
1465
+ * Optional support link for error messages.
1466
+ */
1467
+ this.supportLink = "Support";
1468
+ /**
1469
+ * Header text shown on successful submission.
1470
+ */
1471
+ this.submitSuccessHeader = "Referral submitted";
1472
+ /**
1473
+ * Description text shown on successful submission.
1474
+ */
1475
+ this.submitSuccessDescription = "Our team will contact your friend to see if they’re a good fit. In the meantime, you can track this referral on Activity page.";
1476
+ /**
1477
+ * Header text shown when an error occurs.
1478
+ */
1479
+ this.submitErrorHeader = "An error occurred while submitting";
1480
+ /**
1481
+ * Description text shown when an error occurs.
1482
+ */
1483
+ this.submitErrorDescription = "Please try again later. If the problem continues, contact {supportLink}";
1504
1484
  /**
1505
1485
  * The message to be displayed when a required field is not filled.
1506
1486
  *
1507
1487
  * @uiName Required field message
1508
1488
  * @uiWidget textArea
1509
1489
  */
1510
- this.requiredFieldErrorMessage = "Cannot be empty";
1490
+ this.requiredFieldErrorMessage = "Please enter a valid {fieldLabel}";
1511
1491
  /**
1512
1492
  * The message to be displayed when a the form submission fails unexpectedly.
1513
1493
  *
@@ -1533,7 +1513,13 @@ const LeadForm = class {
1533
1513
  formData: index.h("slot", { name: "formData" }),
1534
1514
  emailLabel: this.emailLabel,
1535
1515
  submitLabel: this.submitLabel,
1516
+ resubmitFormLabel: this.resubmitFormLabel,
1536
1517
  pageLabel: this.pageLabel,
1518
+ supportLink: this.supportLink,
1519
+ submitSuccessHeader: this.submitSuccessHeader,
1520
+ submitSuccessDescription: this.submitSuccessDescription,
1521
+ submitErrorHeader: this.submitErrorHeader,
1522
+ submitErrorDescription: this.submitErrorDescription,
1537
1523
  invalidEmailErrorMessage: this.invalidEmailErrorMessage,
1538
1524
  requiredFieldErrorMessage: this.requiredFieldErrorMessage,
1539
1525
  };
@@ -1545,6 +1531,7 @@ function useRegisterDemo(props) {
1545
1531
  states: {
1546
1532
  error: "",
1547
1533
  loading: false,
1534
+ success: false,
1548
1535
  },
1549
1536
  callbacks: {
1550
1537
  submit: async (_event) => {
@@ -1855,7 +1842,7 @@ function useLeaderboardDemo(props) {
1855
1842
  }, props.demoData || {}, { arrayMerge: (_, a) => a });
1856
1843
  }
1857
1844
 
1858
- const style$1 = {
1845
+ const style = {
1859
1846
  Container: { display: "contents" },
1860
1847
  Link: {
1861
1848
  textDecoration: "none",
@@ -1867,16 +1854,16 @@ const vanillaStyle = `
1867
1854
  display: inline;
1868
1855
  }
1869
1856
  `;
1870
- const sheet$1 = JSS.createStyleSheet(style$1);
1871
- const styleString$1 = sheet$1.toString();
1857
+ const sheet = JSS.createStyleSheet(style);
1858
+ const styleString = sheet.toString();
1872
1859
  function LinkButtonView(props) {
1873
1860
  const { onClick, buttonText } = props;
1874
- return (index.h("span", { class: sheet$1.classes.Container, part: "sqm-base" },
1861
+ return (index.h("span", { class: sheet.classes.Container, part: "sqm-base" },
1875
1862
  index.h("style", { type: "text/css" },
1876
- styleString$1,
1863
+ styleString,
1877
1864
  vanillaStyle),
1878
1865
  index.h("sl-button", { onClick: onClick, type: "primary", exportparts: "base: primarybutton-base" },
1879
- index.h("a", { class: sheet$1.classes.Link, part: "sqm-link" }, buttonText))));
1866
+ index.h("a", { class: sheet.classes.Link, part: "sqm-link" }, buttonText))));
1880
1867
  }
1881
1868
 
1882
1869
  const LinkButton = class {
@@ -2057,7 +2044,7 @@ function useNavigationMenuDemo(props) {
2057
2044
  }
2058
2045
  NavigationMenu.style = sqmNavigationMenuCss;
2059
2046
 
2060
- const style$2 = {
2047
+ const style$1 = {
2061
2048
  Wrapper: {
2062
2049
  maxWidth: "200px",
2063
2050
  marginLeft: "auto",
@@ -2068,16 +2055,16 @@ const style$2 = {
2068
2055
  margin: "0",
2069
2056
  },
2070
2057
  };
2071
- const sheet$2 = JSS.createStyleSheet(style$2);
2072
- const styleString$2 = sheet$2.toString();
2058
+ const sheet$1 = JSS.createStyleSheet(style$1);
2059
+ const styleString$1 = sheet$1.toString();
2073
2060
  function PayoutButtonScrollView(props) {
2074
2061
  const { text, states } = props;
2075
2062
  if (!states.payoutSettingsComplete)
2076
2063
  return index.h("div", null);
2077
- return (index.h("div", { class: sheet$2.classes.Wrapper },
2078
- index.h("style", { type: "text/css" }, styleString$2),
2064
+ return (index.h("div", { class: sheet$1.classes.Wrapper },
2065
+ index.h("style", { type: "text/css" }, styleString$1),
2079
2066
  index.h("sqm-scroll", { "scroll-tag-name": "sqm-tabs", "button-text": text.payoutButtonText, "scroll-animation": "smooth" }),
2080
- index.h("p", { class: sheet$2.classes.PayoutButtonDescription }, text.payoutButtonDescription)));
2067
+ index.h("p", { class: sheet$1.classes.PayoutButtonDescription }, text.payoutButtonDescription)));
2081
2068
  }
2082
2069
 
2083
2070
  const GET_PAYOUT_DETAILS = index_module.dist.gql `
@@ -2150,7 +2137,7 @@ function useDemoPayoutButtonScroll(props) {
2150
2137
  }, props.demoData || {}, { arrayMerge: (_, a) => a });
2151
2138
  }
2152
2139
 
2153
- const style$3 = {
2140
+ const style$2 = {
2154
2141
  SkeletonOne: {
2155
2142
  width: "50%",
2156
2143
  height: "16px",
@@ -2201,8 +2188,8 @@ const style$3 = {
2201
2188
  "&::part(footer)": {},
2202
2189
  },
2203
2190
  };
2204
- const sheet$3 = JSS.createStyleSheet(style$3);
2205
- const styleString$3 = sheet$3.toString();
2191
+ const sheet$2 = JSS.createStyleSheet(style$2);
2192
+ const styleString$2 = sheet$2.toString();
2206
2193
  function PayoutStatusAlertView(props) {
2207
2194
  const { text, states, data, callbacks } = props;
2208
2195
  function getAlert(status) {
@@ -2213,7 +2200,7 @@ function PayoutStatusAlertView(props) {
2213
2200
  buttonText: null,
2214
2201
  alertType: "critical",
2215
2202
  icon: "exclamation-triangle",
2216
- class: sheet$3.classes.ErrorAlertContainer,
2203
+ class: sheet$2.classes.ErrorAlertContainer,
2217
2204
  };
2218
2205
  switch (status) {
2219
2206
  case "INFORMATION_REQUIRED":
@@ -2223,7 +2210,7 @@ function PayoutStatusAlertView(props) {
2223
2210
  buttonText: text.informationRequiredButtonText,
2224
2211
  alertType: "info",
2225
2212
  icon: "info-circle",
2226
- class: sheet$3.classes.InfoAlertContainer,
2213
+ class: sheet$2.classes.InfoAlertContainer,
2227
2214
  };
2228
2215
  case "VERIFICATION:REQUIRED":
2229
2216
  return {
@@ -2237,7 +2224,7 @@ function PayoutStatusAlertView(props) {
2237
2224
  buttonText: text.verificationRequiredButtonText,
2238
2225
  alertType: "warning",
2239
2226
  icon: "exclamation-triangle",
2240
- class: sheet$3.classes.WarningAlertContainer,
2227
+ class: sheet$2.classes.WarningAlertContainer,
2241
2228
  };
2242
2229
  case "VERIFICATION:INTERNAL":
2243
2230
  return {
@@ -2250,7 +2237,7 @@ function PayoutStatusAlertView(props) {
2250
2237
  }),
2251
2238
  alertType: "warning",
2252
2239
  icon: "exclamation-triangle",
2253
- class: sheet$3.classes.WarningAlertContainer,
2240
+ class: sheet$2.classes.WarningAlertContainer,
2254
2241
  };
2255
2242
  case "VERIFICATION:REVIEW":
2256
2243
  return {
@@ -2263,7 +2250,7 @@ function PayoutStatusAlertView(props) {
2263
2250
  }),
2264
2251
  alertType: "warning",
2265
2252
  icon: "exclamation-triangle",
2266
- class: sheet$3.classes.WarningAlertContainer,
2253
+ class: sheet$2.classes.WarningAlertContainer,
2267
2254
  };
2268
2255
  case "VERIFICATION:FAILED":
2269
2256
  return {
@@ -2276,7 +2263,7 @@ function PayoutStatusAlertView(props) {
2276
2263
  }),
2277
2264
  alertType: "critical",
2278
2265
  icon: "exclamation-octagon",
2279
- class: sheet$3.classes.ErrorAlertContainer,
2266
+ class: sheet$2.classes.ErrorAlertContainer,
2280
2267
  };
2281
2268
  case "HOLD":
2282
2269
  return {
@@ -2290,7 +2277,7 @@ function PayoutStatusAlertView(props) {
2290
2277
  buttonText: null,
2291
2278
  alertType: "warning",
2292
2279
  icon: "exclamation-triangle",
2293
- class: sheet$3.classes.WarningAlertContainer,
2280
+ class: sheet$2.classes.WarningAlertContainer,
2294
2281
  };
2295
2282
  default:
2296
2283
  return;
@@ -2309,18 +2296,18 @@ function PayoutStatusAlertView(props) {
2309
2296
  }
2310
2297
  }
2311
2298
  if (states.loading) {
2312
- return index.h("sl-skeleton", { class: sheet$3.classes.SkeletonOne });
2299
+ return index.h("sl-skeleton", { class: sheet$2.classes.SkeletonOne });
2313
2300
  }
2314
2301
  const alertDetails = getAlert(states.status);
2315
2302
  if (states.status === "DONE" || !alertDetails) {
2316
2303
  return index.h("div", null);
2317
2304
  }
2318
2305
  return (index.h("div", { part: "sqm-base" },
2319
- index.h("style", { type: "text/css" }, styleString$3),
2306
+ index.h("style", { type: "text/css" }, styleString$2),
2320
2307
  index.h("sl-alert", { exportparts: "base: alert-base, icon:alert-icon", type: alertDetails.alertType, class: alertDetails.class, open: true },
2321
2308
  index.h("sl-icon", { slot: "icon", name: alertDetails.icon }),
2322
2309
  index.h("strong", null, alertDetails.header),
2323
- index.h("p", { class: sheet$3.classes.AlertDescriptionText }, alertDetails.description),
2310
+ index.h("p", { class: sheet$2.classes.AlertDescriptionText }, alertDetails.description),
2324
2311
  getButton(states.status))));
2325
2312
  }
2326
2313
 
@@ -3474,7 +3461,7 @@ const ProgramMenu = class {
3474
3461
  }
3475
3462
  };
3476
3463
 
3477
- const style$4 = {
3464
+ const style$3 = {
3478
3465
  Container: {
3479
3466
  borderRadius: "var(--sl-border-radius-large)",
3480
3467
  color: "var(--sl-color-neutral-900)",
@@ -3502,15 +3489,15 @@ const style$4 = {
3502
3489
  },
3503
3490
  },
3504
3491
  };
3505
- const sheet$4 = JSS.createStyleSheet(style$4);
3506
- const styleString$4 = sheet$4.toString();
3492
+ const sheet$3 = JSS.createStyleSheet(style$3);
3493
+ const styleString$3 = sheet$3.toString();
3507
3494
  const vanillaStyle$1 = `
3508
3495
  :host{
3509
3496
  display: block;
3510
3497
  }
3511
3498
  `;
3512
3499
  function ReferralCardView(props) {
3513
- return (index.h("div", { part: "sqm-base", class: sheet$4.classes.Container, style: {
3500
+ return (index.h("div", { part: "sqm-base", class: sheet$3.classes.Container, style: {
3514
3501
  border: `${props.hideBorder ? "none" : "1px solid var(--sl-color-neutral-300)"}`,
3515
3502
  "padding-top": `var(--sl-spacing-${props.paddingTop})`,
3516
3503
  "padding-right": `var(--sl-spacing-${props.paddingRight})`,
@@ -3521,15 +3508,15 @@ function ReferralCardView(props) {
3521
3508
  margin: `${props.limitWidth ? "auto" : "none"}`,
3522
3509
  } },
3523
3510
  index.h("style", { type: "text/css" },
3524
- styleString$4,
3511
+ styleString$3,
3525
3512
  vanillaStyle$1),
3526
- props.hasHeader && (index.h("div", { class: sheet$4.classes.EndContainer }, props.slots.header)),
3527
- index.h("div", { part: "sqm-column-container", class: sheet$4.classes.ColumnContainer, style: {
3513
+ props.hasHeader && (index.h("div", { class: sheet$3.classes.EndContainer }, props.slots.header)),
3514
+ index.h("div", { part: "sqm-column-container", class: sheet$3.classes.ColumnContainer, style: {
3528
3515
  alignItems: props.verticalAlignment,
3529
3516
  } },
3530
3517
  props.slots.left,
3531
3518
  props.slots.right),
3532
- props.hasFooter && (index.h("div", { class: sheet$4.classes.EndContainer }, props.slots.footer))));
3519
+ props.hasFooter && (index.h("div", { class: sheet$3.classes.EndContainer }, props.slots.footer))));
3533
3520
  }
3534
3521
 
3535
3522
  const ReferralCard = class {
@@ -3604,7 +3591,7 @@ const ReferralCard = class {
3604
3591
  }
3605
3592
  };
3606
3593
 
3607
- const GET_USER_DETAILS = index_module.dist.gql `
3594
+ const GET_USER_DETAILS$1 = index_module.dist.gql `
3608
3595
  query getUser($programId: ID) {
3609
3596
  viewer {
3610
3597
  ... on User {
@@ -3617,7 +3604,7 @@ function useReferralIframe(props) {
3617
3604
  var _a;
3618
3605
  const programId = index_module.H();
3619
3606
  const user = index_module.J();
3620
- const { data } = index_module.wn(GET_USER_DETAILS, { programId }, !(user === null || user === void 0 ? void 0 : user.jwt) || !programId);
3607
+ const { data } = index_module.wn(GET_USER_DETAILS$1, { programId }, !(user === null || user === void 0 ? void 0 : user.jwt) || !programId);
3621
3608
  return {
3622
3609
  states: {
3623
3610
  content: props,
@@ -3653,7 +3640,7 @@ const SqmReferralIframe = class {
3653
3640
  },
3654
3641
  ]);
3655
3642
  if (missingProps) {
3656
- return (index.h(RequiredPropsError, { missingProps: missingProps, heading: "An error occured while loading this page", subheading: "A technical problem prevented this iframe from loading. Please contact us with the link to this page.", description: "Values for the following attributes are missing:" }));
3643
+ return (index.h(useLeadFormState.RequiredPropsError, { missingProps: missingProps, heading: "An error occured while loading this page", subheading: "A technical problem prevented this iframe from loading. Please contact us with the link to this page.", description: "Values for the following attributes are missing:" }));
3657
3644
  }
3658
3645
  const { states, data } = index_module.isDemo()
3659
3646
  ? useReferralIframeDemo(utils.getProps(this))
@@ -5252,7 +5239,7 @@ const Gift = () => (index.h("svg", { width: "24", height: "24", viewBox: "0 0 24
5252
5239
  const Circle = () => (index.h("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
5253
5240
  index.h("circle", { cx: "12", cy: "12", r: "9", fill: "currentColor", stroke: "currentColor", "stroke-width": "2" })));
5254
5241
 
5255
- const style$5 = {
5242
+ const style$4 = {
5256
5243
  TimelineReward: {
5257
5244
  color: "var(--sl-color-neutral-900)",
5258
5245
  lineHeight: "var(--sl-line-height-dense)",
@@ -5295,8 +5282,8 @@ const style$5 = {
5295
5282
  },
5296
5283
  },
5297
5284
  };
5298
- const sheet$5 = JSS.createStyleSheet(style$5);
5299
- const styleString$5 = sheet$5.toString();
5285
+ const sheet$4 = JSS.createStyleSheet(style$4);
5286
+ const styleString$4 = sheet$4.toString();
5300
5287
  const vanillaStyle$2 = `
5301
5288
  :host{
5302
5289
  display: block;
@@ -5309,9 +5296,9 @@ const vanillaStyle$2 = `
5309
5296
  function TimelineEntryView(props) {
5310
5297
  var _a;
5311
5298
  const timeline_icon = (_a = props.icon) !== null && _a !== void 0 ? _a : props.iconState;
5312
- return (index.h("div", { class: sheet$5.classes.TimelineReward, part: "sqm-base" },
5299
+ return (index.h("div", { class: sheet$4.classes.TimelineReward, part: "sqm-base" },
5313
5300
  index.h("style", { type: "text/css" },
5314
- styleString$5,
5301
+ styleString$4,
5315
5302
  vanillaStyle$2),
5316
5303
  index.h("div", { class: "container", part: "sqm-entry-container" },
5317
5304
  index.h("div", { class: "line" }, "/"),
@@ -0,0 +1,69 @@
1
+ 'use strict';
2
+
3
+ const index = require('./index-a29c60ef.js');
4
+ const global = require('./global-e31dc4f5.js');
5
+ const JSS = require('./JSS-8503a151.js');
6
+
7
+ const style = {
8
+ ErrorStyle: {
9
+ "--sl-input-border-color": "var(--sl-color-danger-500)",
10
+ "--sl-input-background-color": "var(--sl-color-danger-10)",
11
+ "--sl-input-border-color-focus": "var(--sl-color-danger-500)",
12
+ "--sl-input-border-color-hover": "var(--sl-color-danger-500)",
13
+ },
14
+ ErrorMessageStyle: {
15
+ margin: 0,
16
+ color: "var(--sl-color-danger-500)",
17
+ fontSize: "var(--sl-input-help-text-font-size-medium)",
18
+ },
19
+ FieldContainer: {
20
+ "margin-bottom": "var(--sl-spacing-large)",
21
+ },
22
+ };
23
+ const vanillaStyle = `
24
+ :host {
25
+ margin: 0 auto;
26
+ width: 100%;
27
+ display: block;
28
+ }
29
+ sl-select::part(label){
30
+ font-size: var(--sl-input-label-font-size-small);
31
+ font-weight: var(--sl-font-weight-semibold);
32
+ }
33
+ `;
34
+ JSS.jss.setup(JSS.create());
35
+ const sheet = JSS.jss.createStyleSheet(style);
36
+ const styleString = sheet.toString();
37
+ function LeadDropdownFieldView(props) {
38
+ var _a, _b, _c, _d, _e, _f, _g;
39
+ const { states, content } = props;
40
+ const validationErrors = (_a = states === null || states === void 0 ? void 0 : states.leadFormState) === null || _a === void 0 ? void 0 : _a.validationErrors;
41
+ const getRequiredFieldErrorMessage = ({ dropdownLabel, }) => global.intl.formatMessage({
42
+ id: "requiredFieldErrorMessage",
43
+ defaultMessage: content.requiredFieldErrorMessage,
44
+ }, {
45
+ dropdownLabel,
46
+ });
47
+ return (index.h("div", { class: sheet.classes.FieldContainer, part: "sqm-base" },
48
+ index.h("style", { type: "text/css" },
49
+ vanillaStyle,
50
+ styleString),
51
+ index.h("sl-select", Object.assign({ exportparts: "label: input-label, base: input-base", label: content.dropdownLabel, name: `/${content.dropdownName}` }, (!content.dropdownOptional ? { required: true } : []), { disabled: ((_b = states.leadFormState) === null || _b === void 0 ? void 0 : _b.loading) || ((_c = states.leadFormState) === null || _c === void 0 ? void 0 : _c.disabled), validationError: ({ value }) => {
52
+ if (!value) {
53
+ return getRequiredFieldErrorMessage({
54
+ dropdownLabel: content.dropdownLabel,
55
+ });
56
+ }
57
+ } }, (((_e = (_d = states.leadFormState) === null || _d === void 0 ? void 0 : _d.validationErrors) === null || _e === void 0 ? void 0 : _e.firstName) ? {
58
+ class: sheet.classes.ErrorStyle,
59
+ helpText: ((_g = (_f = states.leadFormState) === null || _f === void 0 ? void 0 : _f.validationErrors) === null || _g === void 0 ? void 0 : _g.firstName) ||
60
+ content.requiredFieldErrorMessage,
61
+ }
62
+ : [])), content.selectOptions),
63
+ (validationErrors === null || validationErrors === void 0 ? void 0 : validationErrors[content.dropdownName]) && (index.h("p", { class: sheet.classes.ErrorMessageStyle }, global.intl.formatMessage({
64
+ id: `errorMessage-${content.dropdownName}`,
65
+ defaultMessage: content.requiredFieldErrorMessage,
66
+ })))));
67
+ }
68
+
69
+ exports.LeadDropdownFieldView = LeadDropdownFieldView;