@saasquatch/mint-components 1.15.0-78 → 1.15.0-79

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 (75) hide show
  1. package/dist/cjs/{ShadowViewAddon-e703fa61.js → ShadowViewAddon-9bf35bfe.js} +102 -1
  2. package/dist/cjs/{extractProps-e9c55ba8.js → extractProps-fd93ba62.js} +0 -14
  3. package/dist/cjs/loader.cjs.js +1 -1
  4. package/dist/cjs/mint-components.cjs.js +1 -1
  5. package/dist/cjs/parseStates-d1effc19.js +16 -0
  6. package/dist/cjs/sqm-big-stat_43.cjs.entry.js +14 -3
  7. package/dist/cjs/sqm-stencilbook.cjs.entry.js +1 -1
  8. package/dist/cjs/sqm-tax-and-cash.cjs.entry.js +7 -6
  9. package/dist/cjs/sqm-widget-verification.cjs.entry.js +5 -4
  10. package/dist/collection/components/sqm-big-stat/useBigStat.js +102 -0
  11. package/dist/collection/components/sqm-hero/sqm-hero-view.js +0 -1
  12. package/dist/collection/components/sqm-hero-image/sqm-hero-image-view.js +0 -1
  13. package/dist/collection/components/sqm-reward-exchange-list/sqm-reward-exchange-list.js +43 -1
  14. package/dist/collection/components/sqm-titled-section/sqm-titled-section.js +1 -1
  15. package/dist/collection/components/sqm-widget-verification/sqm-widget-verification.js +4 -4
  16. package/dist/collection/components/tax-and-cash/sqm-tax-and-cash/sqm-tax-and-cash.js +8 -8
  17. package/dist/esm/{ShadowViewAddon-6635eef4.js → ShadowViewAddon-3c2957fe.js} +102 -1
  18. package/dist/esm/{extractProps-54064fb0.js → extractProps-ae1afbb3.js} +1 -14
  19. package/dist/esm/loader.js +1 -1
  20. package/dist/esm/mint-components.js +1 -1
  21. package/dist/esm/parseStates-ed75e224.js +14 -0
  22. package/dist/esm/sqm-big-stat_43.entry.js +14 -3
  23. package/dist/esm/sqm-stencilbook.entry.js +1 -1
  24. package/dist/esm/sqm-tax-and-cash.entry.js +6 -5
  25. package/dist/esm/sqm-widget-verification.entry.js +4 -3
  26. package/dist/esm-es5/ShadowViewAddon-3c2957fe.js +1 -0
  27. package/dist/esm-es5/extractProps-ae1afbb3.js +1 -0
  28. package/dist/esm-es5/loader.js +1 -1
  29. package/dist/esm-es5/mint-components.js +1 -1
  30. package/dist/esm-es5/parseStates-ed75e224.js +1 -0
  31. package/dist/esm-es5/sqm-big-stat_43.entry.js +1 -1
  32. package/dist/esm-es5/sqm-stencilbook.entry.js +1 -1
  33. package/dist/esm-es5/sqm-tax-and-cash.entry.js +1 -1
  34. package/dist/esm-es5/sqm-widget-verification.entry.js +1 -1
  35. package/dist/mint-components/mint-components.esm.js +1 -1
  36. package/dist/mint-components/{p-bfa37e52.entry.js → p-0f941bb6.entry.js} +1 -1
  37. package/dist/mint-components/p-115dfc03.system.js +1 -0
  38. package/dist/mint-components/p-13f3a647.js +1 -0
  39. package/dist/mint-components/p-153a122d.system.js +1 -0
  40. package/dist/mint-components/p-26468242.js +1 -0
  41. package/dist/mint-components/p-2a8e2f28.system.js +1 -1
  42. package/dist/mint-components/p-35a2332d.js +448 -0
  43. package/dist/mint-components/{p-958223c1.system.entry.js → p-65d2f344.system.entry.js} +1 -1
  44. package/dist/mint-components/{p-6b51c05f.entry.js → p-9e00773c.entry.js} +19 -19
  45. package/dist/mint-components/p-a8645c1b.system.js +1 -0
  46. package/dist/mint-components/p-abd33116.system.entry.js +1 -0
  47. package/dist/mint-components/p-ba16858e.system.entry.js +1 -0
  48. package/dist/mint-components/p-c3fe8514.system.entry.js +1 -0
  49. package/dist/mint-components/{p-b2bf7fcb.entry.js → p-c79bb1c6.entry.js} +2 -2
  50. package/dist/mint-components/p-e1a5f64a.entry.js +1 -0
  51. package/dist/types/components/sqm-reward-exchange-list/sqm-reward-exchange-list.d.ts +7 -0
  52. package/dist/types/components/sqm-reward-exchange-list/useRewardExchangeList.d.ts +1 -0
  53. package/dist/types/components/sqm-titled-section/sqm-titled-section.d.ts +1 -1
  54. package/dist/types/components/sqm-widget-verification/sqm-widget-verification.d.ts +2 -2
  55. package/dist/types/components/tax-and-cash/sqm-tax-and-cash/sqm-tax-and-cash.d.ts +4 -4
  56. package/dist/types/components.d.ts +26 -12
  57. package/docs/docs.docx +0 -0
  58. package/docs/raisins.json +1 -1
  59. package/grapesjs/grapesjs.js +1 -1
  60. package/package.json +1 -1
  61. package/shoelace/assets/icons/twitter-x.svg +4 -0
  62. package/dist/esm-es5/ShadowViewAddon-6635eef4.js +0 -1
  63. package/dist/esm-es5/extractProps-54064fb0.js +0 -1
  64. package/dist/mint-components/p-0797a946.js +0 -1
  65. package/dist/mint-components/p-434f9eaa.system.entry.js +0 -1
  66. package/dist/mint-components/p-59932036.js +0 -394
  67. package/dist/mint-components/p-81a62c33.system.js +0 -1
  68. package/dist/mint-components/p-999a396d.system.entry.js +0 -1
  69. package/dist/mint-components/p-c786f3b4.entry.js +0 -1
  70. package/dist/mint-components/p-e55aafe9.system.js +0 -1
  71. package/dist/mint-components/p-f94788ab.system.entry.js +0 -1
  72. package/dist/types/global/android.d.ts +0 -7
  73. package/dist/types/global/demo.d.ts +0 -2
  74. package/dist/types/stories/features.d.ts +0 -4
  75. package/dist/types/stories/templates.d.ts +0 -4
@@ -542,6 +542,92 @@ const rewardsAssignedQuery = (programId, locale, type, unit, global = "") => {
542
542
  };
543
543
  });
544
544
  };
545
+ const rewardsExpiredQuery = (programId, locale, type, unit, global = "") => {
546
+ return debugQuery(gql `
547
+ query (
548
+ $programId: ID
549
+ $type: RewardType
550
+ $unit: String!
551
+ $locale: RSLocale
552
+ ) {
553
+ fallback: formatRewardPrettyValue(
554
+ value: 0
555
+ unit: $unit
556
+ locale: $locale
557
+ formatType: UNIT_FORMATTED
558
+ )
559
+ viewer: viewer {
560
+ ... on User {
561
+ rewardBalanceDetails(
562
+ programId: $programId
563
+ filter: { type_eq: $type, unit_eq: $unit }
564
+ locale: $locale
565
+ ) {
566
+ ... on CreditRewardBalance {
567
+ prettyExpiredCredit
568
+ }
569
+ }
570
+ }
571
+ }
572
+ }
573
+ `, {
574
+ programId: !global && programId !== "classic" ? programId : null,
575
+ type,
576
+ unit,
577
+ locale,
578
+ }, (res) => {
579
+ var _a, _b, _c, _d, _e;
580
+ const arr = (_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.viewer) === null || _b === void 0 ? void 0 : _b.rewardBalanceDetails;
581
+ const fallback = (_c = res.data) === null || _c === void 0 ? void 0 : _c.fallback;
582
+ return {
583
+ value: ((_d = arr === null || arr === void 0 ? void 0 : arr[0]) === null || _d === void 0 ? void 0 : _d.prettyAssignedCredit) || 0,
584
+ statvalue: ((_e = arr === null || arr === void 0 ? void 0 : arr[0]) === null || _e === void 0 ? void 0 : _e.prettyAssignedCredit) || fallback,
585
+ };
586
+ });
587
+ };
588
+ const rewardsCancelledQuery = (programId, locale, type, unit, global = "") => {
589
+ return debugQuery(gql `
590
+ query (
591
+ $programId: ID
592
+ $type: RewardType
593
+ $unit: String!
594
+ $locale: RSLocale
595
+ ) {
596
+ fallback: formatRewardPrettyValue(
597
+ value: 0
598
+ unit: $unit
599
+ locale: $locale
600
+ formatType: UNIT_FORMATTED
601
+ )
602
+ viewer: viewer {
603
+ ... on User {
604
+ rewardBalanceDetails(
605
+ programId: $programId
606
+ filter: { type_eq: $type, unit_eq: $unit }
607
+ locale: $locale
608
+ ) {
609
+ ... on CreditRewardBalance {
610
+ prettyCancelledCredit
611
+ }
612
+ }
613
+ }
614
+ }
615
+ }
616
+ `, {
617
+ programId: !global && programId !== "classic" ? programId : null,
618
+ type,
619
+ unit,
620
+ locale,
621
+ }, (res) => {
622
+ var _a, _b, _c, _d, _e;
623
+ const arr = (_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.viewer) === null || _b === void 0 ? void 0 : _b.rewardBalanceDetails;
624
+ const fallback = (_c = res.data) === null || _c === void 0 ? void 0 : _c.fallback;
625
+ return {
626
+ value: ((_d = arr === null || arr === void 0 ? void 0 : arr[0]) === null || _d === void 0 ? void 0 : _d.prettyAssignedCredit) || 0,
627
+ statvalue: ((_e = arr === null || arr === void 0 ? void 0 : arr[0]) === null || _e === void 0 ? void 0 : _e.prettyAssignedCredit) || fallback,
628
+ };
629
+ });
630
+ };
545
631
  const rewardsAvailableQuery = (programId, locale, type, unit, global = "") => {
546
632
  return debugQuery(gql `
547
633
  query (
@@ -747,6 +833,14 @@ export const queries = {
747
833
  label: "Rewards Pending",
748
834
  query: rewardsPendingQuery,
749
835
  },
836
+ rewardsExpired: {
837
+ label: "Rewards Expired",
838
+ query: rewardsExpiredQuery,
839
+ },
840
+ rewardsCancelled: {
841
+ label: "Rewards Cancelled",
842
+ query: rewardsCancelledQuery,
843
+ },
750
844
  rewardsRedeemed: {
751
845
  label: "Rewards Paid",
752
846
  query: rewardsRedeemedQuery,
@@ -843,6 +937,14 @@ export const StatPaths = [
843
937
  name: "rewardsAssigned",
844
938
  route: "/(rewardsAssigned)/:statType/:unit/:global?",
845
939
  },
940
+ {
941
+ name: "rewardsExpired",
942
+ route: "/(rewardsExpired)/:statType/:unit/:global?",
943
+ },
944
+ {
945
+ name: "rewardsCancelled",
946
+ route: "/(rewardsCancelled)/:statType/:unit/:global?",
947
+ },
846
948
  {
847
949
  name: "rewardsPending",
848
950
  route: "/(rewardsPending)/:statType/:unit/:global?",
@@ -123,7 +123,6 @@ export function HeroView(props) {
123
123
 
124
124
  `;
125
125
  // NOTE: Spacing on the columns is controlled on the slots itself. For example using inline styling
126
- console.log("column to hide in mobile is ", states.columnToHideInMobile);
127
126
  return (h("div", { class: sheet.classes.Container, part: "sqm-base" },
128
127
  h("style", { type: "text/css" },
129
128
  vanillaStyle,
@@ -3,7 +3,6 @@ import { createStyleSheet } from "../../styling/JSS";
3
3
  export function HeroImageView(props, children) {
4
4
  const overlay = Boolean((props.header || props.description || props.buttonText) &&
5
5
  props.layout === "overlay");
6
- console.log("buttonType is ", props.buttonType);
7
6
  // Dependent on props, not feasiable to move out
8
7
  const style = {
9
8
  Container: {
@@ -6,6 +6,7 @@ import { isDemo } from "@saasquatch/component-boilerplate";
6
6
  import deepmerge from "deepmerge";
7
7
  import { getProps } from "../../utils/utils";
8
8
  import { demoRewardExchange } from "./RewardExchangeListData";
9
+ import { parseStates } from "../../utils/parseStates";
9
10
  /**
10
11
  * @uiName Reward Exchange
11
12
  * @validParents ["sqm-portal-container","div","sqm-divided-layout","sqm-brand","template","sqm-hero","sqm-tab","sqb-program-section","sqb-conditional-section"]
@@ -147,6 +148,13 @@ export class SqmRewardExchangeList {
147
148
  * @uiName Cost row title
148
149
  */
149
150
  this.costTitle = "Cost to Redeem";
151
+ /**
152
+ * @componentState { "title": "Choose reward", "props": { "redeemStage": "chooseReward" }, "dependencies": ["sqm-reward-exchange-list"] }
153
+ * @componentState { "title": "Reward details", "props": { "redeemStage": "chooseAmount", }, "dependencies": ["sqm-reward-exchange-list"] }
154
+ * @componentState { "title": "Confirm exchange", "props": { "redeemStage": "confirmation" }, "dependencies": ["sqm-reward-exchange-list"] }
155
+ * @componentState { "title": "Exchange successful", "props": { "redeemStage": "success" }, "dependencies": ["sqm-reward-exchange-list"] }
156
+ */
157
+ this.stateController = "{}";
150
158
  withHooks(this);
151
159
  }
152
160
  disconnectedCallback() { }
@@ -711,6 +719,36 @@ export class SqmRewardExchangeList {
711
719
  "reflect": false,
712
720
  "defaultValue": "\"Cost to Redeem\""
713
721
  },
722
+ "stateController": {
723
+ "type": "string",
724
+ "mutable": false,
725
+ "complexType": {
726
+ "original": "string",
727
+ "resolved": "string",
728
+ "references": {}
729
+ },
730
+ "required": false,
731
+ "optional": false,
732
+ "docs": {
733
+ "tags": [{
734
+ "text": "{ \"title\": \"Choose reward\", \"props\": { \"redeemStage\": \"chooseReward\" }, \"dependencies\": [\"sqm-reward-exchange-list\"] }",
735
+ "name": "componentState"
736
+ }, {
737
+ "text": "{ \"title\": \"Reward details\", \"props\": { \"redeemStage\": \"chooseAmount\", }, \"dependencies\": [\"sqm-reward-exchange-list\"] }",
738
+ "name": "componentState"
739
+ }, {
740
+ "text": "{ \"title\": \"Confirm exchange\", \"props\": { \"redeemStage\": \"confirmation\" }, \"dependencies\": [\"sqm-reward-exchange-list\"] }",
741
+ "name": "componentState"
742
+ }, {
743
+ "text": "{ \"title\": \"Exchange successful\", \"props\": { \"redeemStage\": \"success\" }, \"dependencies\": [\"sqm-reward-exchange-list\"] }",
744
+ "name": "componentState"
745
+ }],
746
+ "text": ""
747
+ },
748
+ "attribute": "state-controller",
749
+ "reflect": false,
750
+ "defaultValue": "\"{}\""
751
+ },
714
752
  "demoData": {
715
753
  "type": "unknown",
716
754
  "mutable": false,
@@ -751,6 +789,10 @@ function EmptySlot() {
751
789
  h("sqm-empty", { emptyStateImage: "https://res.cloudinary.com/saasquatch/image/upload/v1644360953/squatch-assets/empty_exchange2.png", emptyStateHeader: "Redeem rewards", emptyStateText: "Use your points to redeem rewards once they become available" })));
752
790
  }
753
791
  function useRewardExchangeListDemo(props) {
792
+ const states = parseStates(props.stateController);
793
+ const formatted = Object.keys(states).reduce((prev, key) => key === "reward-exchange-list"
794
+ ? { ...prev, ...states[key] }
795
+ : { ...prev, [`${key}_stateController`]: states[key] }, {});
754
796
  return deepmerge({
755
797
  states: {
756
798
  content: {
@@ -780,5 +822,5 @@ function useRewardExchangeListDemo(props) {
780
822
  refs: {
781
823
  canvasRef: {},
782
824
  },
783
- }, props.demoData || {}, { arrayMerge: (_, a) => a });
825
+ }, props.demoData || formatted || {}, { arrayMerge: (_, a) => a });
784
826
  }
@@ -4,7 +4,7 @@ import { getProps } from "../../utils/utils";
4
4
  import { PortalSectionView } from "./sqm-portal-section-view";
5
5
  /**
6
6
  * @uiName Titled Section
7
- * @validParents ["sqm-portal-container","div","sqm-divided-layout","sqm-brand","template","sqm-hero","sqm-tab", "sqm-referred-registration", "sqb-program-section","sqb-conditional-section", "sqm-instant-access-registration", "sqm-referral-card"]
7
+ * @validParents ["sqm-portal-container","div","sqm-divided-layout","template","sqm-hero","sqm-tab", "sqm-referred-registration", "sqb-program-section","sqb-conditional-section", "sqm-instant-access-registration", "sqm-referral-card"]
8
8
  * @validChildren ["div","sqm-portal-container","p","sqm-timeline","h1","h2","h3","h5","h4","sqm-qr-code","sqm-referral-code","sqm-referral-codes","sqm-share-code","sqm-share-link","sqm-text","span"]
9
9
  * @slots [{"name":"label", "title":"Label"},{"name":"content", "title":"Content"}]
10
10
  * @exampleGroup Layout
@@ -108,8 +108,8 @@ export class WidgetVerification {
108
108
  */
109
109
  this.codeStep_networkErrorMessage = "An error occurred while verifying your email. Please refresh the page and try again.";
110
110
  /**
111
- * @componentState { "title": "Email Step", "props": { "showCode": false }, "dependencies": ["sqm-email-verification"] }
112
- * @componentState { "title": "Code Step", "props": { "showCode": true }, "dependencies": ["sqm-code-verification"] }
111
+ * @componentState { "title": "Step 1: Enter email", "props": { "showCode": false }, "dependencies": ["sqm-email-verification"] }
112
+ * @componentState { "title": "Step 2: Enter code", "props": { "showCode": true }, "dependencies": ["sqm-code-verification"] }
113
113
  */
114
114
  this.stateController = "{}";
115
115
  withHooks(this);
@@ -534,10 +534,10 @@ export class WidgetVerification {
534
534
  "optional": false,
535
535
  "docs": {
536
536
  "tags": [{
537
- "text": "{ \"title\": \"Email Step\", \"props\": { \"showCode\": false }, \"dependencies\": [\"sqm-email-verification\"] }",
537
+ "text": "{ \"title\": \"Step 1: Enter email\", \"props\": { \"showCode\": false }, \"dependencies\": [\"sqm-email-verification\"] }",
538
538
  "name": "componentState"
539
539
  }, {
540
- "text": "{ \"title\": \"Code Step\", \"props\": { \"showCode\": true }, \"dependencies\": [\"sqm-code-verification\"] }",
540
+ "text": "{ \"title\": \"Step 2: Enter code\", \"props\": { \"showCode\": true }, \"dependencies\": [\"sqm-code-verification\"] }",
541
541
  "name": "componentState"
542
542
  }],
543
543
  "text": ""
@@ -1011,10 +1011,10 @@ export class TaxAndCashMonolith {
1011
1011
  this.supportLink = "support team";
1012
1012
  /**
1013
1013
  * @uiName Monolith States
1014
- * @componentState { "title": "Step 1", "props": { "step": "/1" }, "dependencies": ["sqm-user-info-form"] }
1015
- * @componentState { "title": "Step 2", "props": { "step": "/2" }, "dependencies": ["sqm-indirect-tax-form"] }
1016
- * @componentState { "title": "Step 3", "props": { "step": "/3" }, "dependencies": ["sqm-docusign-form"] }
1017
- * @componentState { "title": "Step 4", "props": { "step": "/4" }, "dependencies": ["sqm-banking-info-form"] }
1014
+ * @componentState { "title": "Step 1: Personal information", "props": { "step": "/1" }, "dependencies": ["sqm-user-info-form"] }
1015
+ * @componentState { "title": "Step 2: Indirect tax ", "props": { "step": "/2" }, "dependencies": ["sqm-indirect-tax-form"] }
1016
+ * @componentState { "title": "Step 3: Tax form", "props": { "step": "/3" }, "dependencies": ["sqm-docusign-form"] }
1017
+ * @componentState { "title": "Step 4: Payment method", "props": { "step": "/4" }, "dependencies": ["sqm-banking-info-form"] }
1018
1018
  * @componentState { "title": "Dashboard", "props": { "step": "/dashboard" }, "dependencies": ["sqm-tax-and-cash-dashboard"] }
1019
1019
  */
1020
1020
  this.stateController = "{}";
@@ -5246,16 +5246,16 @@ export class TaxAndCashMonolith {
5246
5246
  "text": "Monolith States",
5247
5247
  "name": "uiName"
5248
5248
  }, {
5249
- "text": "{ \"title\": \"Step 1\", \"props\": { \"step\": \"/1\" }, \"dependencies\": [\"sqm-user-info-form\"] }",
5249
+ "text": "{ \"title\": \"Step 1: Personal information\", \"props\": { \"step\": \"/1\" }, \"dependencies\": [\"sqm-user-info-form\"] }",
5250
5250
  "name": "componentState"
5251
5251
  }, {
5252
- "text": "{ \"title\": \"Step 2\", \"props\": { \"step\": \"/2\" }, \"dependencies\": [\"sqm-indirect-tax-form\"] }",
5252
+ "text": "{ \"title\": \"Step 2: Indirect tax \", \"props\": { \"step\": \"/2\" }, \"dependencies\": [\"sqm-indirect-tax-form\"] }",
5253
5253
  "name": "componentState"
5254
5254
  }, {
5255
- "text": "{ \"title\": \"Step 3\", \"props\": { \"step\": \"/3\" }, \"dependencies\": [\"sqm-docusign-form\"] }",
5255
+ "text": "{ \"title\": \"Step 3: Tax form\", \"props\": { \"step\": \"/3\" }, \"dependencies\": [\"sqm-docusign-form\"] }",
5256
5256
  "name": "componentState"
5257
5257
  }, {
5258
- "text": "{ \"title\": \"Step 4\", \"props\": { \"step\": \"/4\" }, \"dependencies\": [\"sqm-banking-info-form\"] }",
5258
+ "text": "{ \"title\": \"Step 4: Payment method\", \"props\": { \"step\": \"/4\" }, \"dependencies\": [\"sqm-banking-info-form\"] }",
5259
5259
  "name": "componentState"
5260
5260
  }, {
5261
5261
  "text": "{ \"title\": \"Dashboard\", \"props\": { \"step\": \"/dashboard\" }, \"dependencies\": [\"sqm-tax-and-cash-dashboard\"] }",
@@ -842,6 +842,92 @@ const rewardsAssignedQuery = (programId, locale, type, unit, global = "") => {
842
842
  };
843
843
  });
844
844
  };
845
+ const rewardsExpiredQuery = (programId, locale, type, unit, global = "") => {
846
+ return debugQuery(dist.gql `
847
+ query (
848
+ $programId: ID
849
+ $type: RewardType
850
+ $unit: String!
851
+ $locale: RSLocale
852
+ ) {
853
+ fallback: formatRewardPrettyValue(
854
+ value: 0
855
+ unit: $unit
856
+ locale: $locale
857
+ formatType: UNIT_FORMATTED
858
+ )
859
+ viewer: viewer {
860
+ ... on User {
861
+ rewardBalanceDetails(
862
+ programId: $programId
863
+ filter: { type_eq: $type, unit_eq: $unit }
864
+ locale: $locale
865
+ ) {
866
+ ... on CreditRewardBalance {
867
+ prettyExpiredCredit
868
+ }
869
+ }
870
+ }
871
+ }
872
+ }
873
+ `, {
874
+ programId: !global && programId !== "classic" ? programId : null,
875
+ type,
876
+ unit,
877
+ locale,
878
+ }, (res) => {
879
+ var _a, _b, _c, _d, _e;
880
+ const arr = (_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.viewer) === null || _b === void 0 ? void 0 : _b.rewardBalanceDetails;
881
+ const fallback = (_c = res.data) === null || _c === void 0 ? void 0 : _c.fallback;
882
+ return {
883
+ value: ((_d = arr === null || arr === void 0 ? void 0 : arr[0]) === null || _d === void 0 ? void 0 : _d.prettyAssignedCredit) || 0,
884
+ statvalue: ((_e = arr === null || arr === void 0 ? void 0 : arr[0]) === null || _e === void 0 ? void 0 : _e.prettyAssignedCredit) || fallback,
885
+ };
886
+ });
887
+ };
888
+ const rewardsCancelledQuery = (programId, locale, type, unit, global = "") => {
889
+ return debugQuery(dist.gql `
890
+ query (
891
+ $programId: ID
892
+ $type: RewardType
893
+ $unit: String!
894
+ $locale: RSLocale
895
+ ) {
896
+ fallback: formatRewardPrettyValue(
897
+ value: 0
898
+ unit: $unit
899
+ locale: $locale
900
+ formatType: UNIT_FORMATTED
901
+ )
902
+ viewer: viewer {
903
+ ... on User {
904
+ rewardBalanceDetails(
905
+ programId: $programId
906
+ filter: { type_eq: $type, unit_eq: $unit }
907
+ locale: $locale
908
+ ) {
909
+ ... on CreditRewardBalance {
910
+ prettyCancelledCredit
911
+ }
912
+ }
913
+ }
914
+ }
915
+ }
916
+ `, {
917
+ programId: !global && programId !== "classic" ? programId : null,
918
+ type,
919
+ unit,
920
+ locale,
921
+ }, (res) => {
922
+ var _a, _b, _c, _d, _e;
923
+ const arr = (_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.viewer) === null || _b === void 0 ? void 0 : _b.rewardBalanceDetails;
924
+ const fallback = (_c = res.data) === null || _c === void 0 ? void 0 : _c.fallback;
925
+ return {
926
+ value: ((_d = arr === null || arr === void 0 ? void 0 : arr[0]) === null || _d === void 0 ? void 0 : _d.prettyAssignedCredit) || 0,
927
+ statvalue: ((_e = arr === null || arr === void 0 ? void 0 : arr[0]) === null || _e === void 0 ? void 0 : _e.prettyAssignedCredit) || fallback,
928
+ };
929
+ });
930
+ };
845
931
  const rewardsAvailableQuery = (programId, locale, type, unit, global = "") => {
846
932
  return debugQuery(dist.gql `
847
933
  query (
@@ -1047,6 +1133,14 @@ const queries = {
1047
1133
  label: "Rewards Pending",
1048
1134
  query: rewardsPendingQuery,
1049
1135
  },
1136
+ rewardsExpired: {
1137
+ label: "Rewards Expired",
1138
+ query: rewardsExpiredQuery,
1139
+ },
1140
+ rewardsCancelled: {
1141
+ label: "Rewards Cancelled",
1142
+ query: rewardsCancelledQuery,
1143
+ },
1050
1144
  rewardsRedeemed: {
1051
1145
  label: "Rewards Paid",
1052
1146
  query: rewardsRedeemedQuery,
@@ -1143,6 +1237,14 @@ const StatPaths = [
1143
1237
  name: "rewardsAssigned",
1144
1238
  route: "/(rewardsAssigned)/:statType/:unit/:global?",
1145
1239
  },
1240
+ {
1241
+ name: "rewardsExpired",
1242
+ route: "/(rewardsExpired)/:statType/:unit/:global?",
1243
+ },
1244
+ {
1245
+ name: "rewardsCancelled",
1246
+ route: "/(rewardsCancelled)/:statType/:unit/:global?",
1247
+ },
1146
1248
  {
1147
1249
  name: "rewardsPending",
1148
1250
  route: "/(rewardsPending)/:statType/:unit/:global?",
@@ -2573,7 +2675,6 @@ function HeroView(props) {
2573
2675
 
2574
2676
  `;
2575
2677
  // NOTE: Spacing on the columns is controlled on the slots itself. For example using inline styling
2576
- console.log("column to hide in mobile is ", states.columnToHideInMobile);
2577
2678
  return (h("div", { class: sheet.classes.Container, part: "sqm-base" },
2578
2679
  h("style", { type: "text/css" },
2579
2680
  vanillaStyle,
@@ -1,16 +1,3 @@
1
- function parseStates(states) {
2
- if (typeof states === "string") {
3
- try {
4
- return JSON.parse(states);
5
- }
6
- catch (e) {
7
- return undefined;
8
- }
9
- }
10
- if (typeof states === "object")
11
- return states;
12
- }
13
-
14
1
  /**
15
2
  * Util function for getting just the props with a certain prefix.
16
3
  * @param props Text props on stencil component
@@ -29,4 +16,4 @@ function extractProps(props, prefix) {
29
16
  return formattedProps;
30
17
  }
31
18
 
32
- export { extractProps as e, parseStates as p };
19
+ export { extractProps as e };