@saasquatch/mint-components 1.3.2-1 → 1.3.2-13

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 (285) hide show
  1. package/dist/cjs/{ShadowViewAddon-75c18b96.js → ShadowViewAddon-a85b8c8d.js} +1 -1
  2. package/dist/cjs/{global-041b5338.js → global-6223fe8f.js} +110 -56
  3. package/dist/cjs/{index.module-6a7bda18.js → index.module-7dd4b981.js} +2 -1
  4. package/dist/cjs/loader.cjs.js +3 -4
  5. package/dist/cjs/mint-components.cjs.js +3 -4
  6. package/dist/cjs/{re-render-7cdb2d81.js → re-render-6111d4bd.js} +1 -1
  7. package/dist/cjs/sqm-asset-card.cjs.entry.js +1 -1
  8. package/dist/cjs/sqm-big-stat.cjs.entry.js +2 -2
  9. package/dist/cjs/{sqm-divided-layout_27.cjs.entry.js → sqm-divided-layout_30.cjs.entry.js} +1959 -766
  10. package/dist/cjs/sqm-graphql-client-provider.cjs.entry.js +1 -1
  11. package/dist/cjs/{index-19309631.js → sqm-leaderboard-rank-view-7dd44d62.js} +10 -3
  12. package/dist/cjs/sqm-leaderboard-rank.cjs.entry.js +7 -9
  13. package/dist/cjs/sqm-leaderboard.cjs.entry.js +2 -2
  14. package/dist/cjs/sqm-name-fields.cjs.entry.js +1 -1
  15. package/dist/cjs/{sqm-navigation-sidebar-item-view-e99b4a10.js → sqm-navigation-sidebar-item-view-6c7f78e6.js} +1 -1
  16. package/dist/cjs/sqm-navigation-sidebar-item.cjs.entry.js +2 -2
  17. package/dist/cjs/sqm-popup-container.cjs.entry.js +1 -1
  18. package/dist/cjs/{sqm-portal-email-verification-view-5e955797.js → sqm-portal-email-verification-view-08d1848c.js} +1 -1
  19. package/dist/cjs/sqm-portal-email-verification.cjs.entry.js +3 -4
  20. package/dist/cjs/{sqm-portal-footer-view-9089feb7.js → sqm-portal-footer-view-69c73802.js} +1 -1
  21. package/dist/cjs/sqm-portal-footer.cjs.entry.js +3 -4
  22. package/dist/cjs/sqm-portal-forgot-password.cjs.entry.js +1 -1
  23. package/dist/cjs/sqm-portal-logout.cjs.entry.js +1 -1
  24. package/dist/cjs/{sqm-portal-profile-view-a23ea292.js → sqm-portal-profile-view-14b41436.js} +1 -1
  25. package/dist/cjs/sqm-portal-profile.cjs.entry.js +3 -4
  26. package/dist/cjs/sqm-portal-protected-route.cjs.entry.js +1 -1
  27. package/dist/cjs/sqm-portal-reset-password.cjs.entry.js +1 -1
  28. package/dist/cjs/sqm-portal-verify-email.cjs.entry.js +1 -1
  29. package/dist/cjs/sqm-referral-table-column.cjs.entry.js +2 -2
  30. package/dist/cjs/sqm-referral-table-date-column.cjs.entry.js +2 -2
  31. package/dist/cjs/sqm-referral-table-rewards-column.cjs.entry.js +2 -2
  32. package/dist/cjs/sqm-referral-table-status-column.cjs.entry.js +2 -2
  33. package/dist/cjs/sqm-referral-table-user-column.cjs.entry.js +2 -2
  34. package/dist/cjs/sqm-share-code.cjs.entry.js +1 -1
  35. package/dist/cjs/{useDemoBigStat-17e61803.js → useDemoBigStat-2786227e.js} +117 -21
  36. package/dist/collection/collection-manifest.json +2 -1
  37. package/dist/collection/components/sqm-big-stat/BigStat.stories.js +8 -1
  38. package/dist/collection/components/sqm-big-stat/UseBigStat.stories.js +3 -0
  39. package/dist/collection/components/sqm-big-stat/sqm-big-stat.js +1 -1
  40. package/dist/collection/components/sqm-big-stat/useBigStat.js +115 -20
  41. package/dist/collection/components/sqm-big-stat/useDemoBigStat.js +1 -0
  42. package/dist/collection/components/sqm-portal-register/sqm-portal-register.js +1 -1
  43. package/dist/collection/components/sqm-reward-exchange-list/RewardExchangeList.stories.js +21 -0
  44. package/dist/collection/components/sqm-reward-exchange-list/RewardExchangeListData.js +218 -0
  45. package/dist/collection/components/sqm-reward-exchange-list/SVGs.js +5 -14
  46. package/dist/collection/components/sqm-reward-exchange-list/progressBar.js +31 -43
  47. package/dist/collection/components/sqm-reward-exchange-list/sqm-reward-exchange-list-view.js +175 -100
  48. package/dist/collection/components/sqm-reward-exchange-list/sqm-reward-exchange-list.js +6 -8
  49. package/dist/collection/components/sqm-reward-exchange-list/useRewardExchangeList.js +10 -32
  50. package/dist/collection/components/sqm-rewards-table/UseRewardsTable.stories.js +53 -0
  51. package/dist/collection/components/sqm-rewards-table/sqm-rewards-table-column.js +120 -0
  52. package/dist/collection/components/sqm-rewards-table/useRewardsTable.js +11 -16
  53. package/dist/collection/components/{sqm-rewards-table → sqm-router}/Router.stories.js +0 -0
  54. package/dist/collection/components/sqm-share-button/sqm-share-button.js +1 -1
  55. package/dist/collection/components/sqm-stencilbook/CucumberAddon.js +3 -1
  56. package/dist/collection/components/sqm-stencilbook/sqm-stencilbook.js +7 -1
  57. package/dist/collection/components/sqm-task-card/SVGs.js +0 -6
  58. package/dist/collection/components/sqm-task-card/TaskCard.stories.js +165 -389
  59. package/dist/collection/components/sqm-task-card/UseTaskCard.stories.js +41 -0
  60. package/dist/collection/components/sqm-task-card/progress-bar/SVGs.js +7 -0
  61. package/dist/collection/components/sqm-task-card/progress-bar/progress-bar-view.js +318 -0
  62. package/dist/collection/components/sqm-task-card/sqm-task-card-view.js +93 -346
  63. package/dist/collection/components/sqm-task-card/sqm-task-card.js +127 -53
  64. package/dist/collection/global/styles.js +3 -0
  65. package/dist/collection/global/styles.ts +3 -0
  66. package/dist/collection/stories/NewPortal.stories.js +15 -15
  67. package/dist/esm/{ShadowViewAddon-fff5d35d.js → ShadowViewAddon-a3f510db.js} +1 -1
  68. package/dist/esm/{global-5ecbf81a.js → global-90da933f.js} +57 -3
  69. package/dist/esm/{index.module-f80561db.js → index.module-90d2c3ad.js} +2 -2
  70. package/dist/esm/loader.js +3 -4
  71. package/dist/esm/mint-components.js +3 -4
  72. package/dist/esm/{re-render-9ab5fe0f.js → re-render-e06f2f7f.js} +1 -1
  73. package/dist/esm/sqm-asset-card.entry.js +1 -1
  74. package/dist/esm/sqm-big-stat.entry.js +2 -2
  75. package/dist/esm/{sqm-divided-layout_27.entry.js → sqm-divided-layout_30.entry.js} +1939 -749
  76. package/dist/esm/sqm-graphql-client-provider.entry.js +1 -1
  77. package/dist/esm/{index-2f5dd0a1.js → sqm-leaderboard-rank-view-47844836.js} +9 -3
  78. package/dist/esm/sqm-leaderboard-rank.entry.js +3 -5
  79. package/dist/esm/sqm-leaderboard.entry.js +2 -2
  80. package/dist/esm/sqm-name-fields.entry.js +1 -1
  81. package/dist/esm/{sqm-navigation-sidebar-item-view-8a3f374b.js → sqm-navigation-sidebar-item-view-f2304ad9.js} +1 -1
  82. package/dist/esm/sqm-navigation-sidebar-item.entry.js +2 -2
  83. package/dist/esm/sqm-popup-container.entry.js +1 -1
  84. package/dist/esm/{sqm-portal-email-verification-view-90781be2.js → sqm-portal-email-verification-view-8cefe480.js} +1 -1
  85. package/dist/esm/sqm-portal-email-verification.entry.js +3 -4
  86. package/dist/esm/{sqm-portal-footer-view-c317518e.js → sqm-portal-footer-view-d9fe0bf8.js} +1 -1
  87. package/dist/esm/sqm-portal-footer.entry.js +3 -4
  88. package/dist/esm/sqm-portal-forgot-password.entry.js +1 -1
  89. package/dist/esm/sqm-portal-logout.entry.js +1 -1
  90. package/dist/esm/{sqm-portal-profile-view-824c8242.js → sqm-portal-profile-view-b67467b4.js} +1 -1
  91. package/dist/esm/sqm-portal-profile.entry.js +3 -4
  92. package/dist/esm/sqm-portal-protected-route.entry.js +1 -1
  93. package/dist/esm/sqm-portal-reset-password.entry.js +1 -1
  94. package/dist/esm/sqm-portal-verify-email.entry.js +1 -1
  95. package/dist/esm/sqm-referral-table-column.entry.js +2 -2
  96. package/dist/esm/sqm-referral-table-date-column.entry.js +2 -2
  97. package/dist/esm/sqm-referral-table-rewards-column.entry.js +2 -2
  98. package/dist/esm/sqm-referral-table-status-column.entry.js +2 -2
  99. package/dist/esm/sqm-referral-table-user-column.entry.js +2 -2
  100. package/dist/esm/sqm-share-code.entry.js +1 -1
  101. package/dist/esm/{useDemoBigStat-b71fe122.js → useDemoBigStat-c3b955b7.js} +117 -21
  102. package/dist/esm-es5/{ShadowViewAddon-fff5d35d.js → ShadowViewAddon-a3f510db.js} +1 -1
  103. package/dist/esm-es5/{global-5ecbf81a.js → global-90da933f.js} +16 -2
  104. package/dist/esm-es5/{index.module-f80561db.js → index.module-90d2c3ad.js} +1 -1
  105. package/dist/esm-es5/loader.js +1 -1
  106. package/dist/esm-es5/mint-components.js +1 -1
  107. package/dist/esm-es5/{re-render-9ab5fe0f.js → re-render-e06f2f7f.js} +1 -1
  108. package/dist/esm-es5/sqm-asset-card.entry.js +1 -1
  109. package/dist/esm-es5/sqm-big-stat.entry.js +1 -1
  110. package/dist/esm-es5/sqm-divided-layout_30.entry.js +1 -0
  111. package/dist/esm-es5/sqm-graphql-client-provider.entry.js +1 -1
  112. package/dist/esm-es5/sqm-leaderboard-rank-view-47844836.js +1 -0
  113. package/dist/esm-es5/sqm-leaderboard-rank.entry.js +1 -1
  114. package/dist/esm-es5/sqm-leaderboard.entry.js +1 -1
  115. package/dist/esm-es5/sqm-name-fields.entry.js +1 -1
  116. package/dist/esm-es5/{sqm-navigation-sidebar-item-view-8a3f374b.js → sqm-navigation-sidebar-item-view-f2304ad9.js} +1 -1
  117. package/dist/esm-es5/sqm-navigation-sidebar-item.entry.js +1 -1
  118. package/dist/esm-es5/sqm-popup-container.entry.js +1 -1
  119. package/dist/esm-es5/{sqm-portal-email-verification-view-90781be2.js → sqm-portal-email-verification-view-8cefe480.js} +1 -1
  120. package/dist/esm-es5/sqm-portal-email-verification.entry.js +1 -1
  121. package/dist/esm-es5/{sqm-portal-footer-view-c317518e.js → sqm-portal-footer-view-d9fe0bf8.js} +1 -1
  122. package/dist/esm-es5/sqm-portal-footer.entry.js +1 -1
  123. package/dist/esm-es5/sqm-portal-forgot-password.entry.js +1 -1
  124. package/dist/esm-es5/sqm-portal-logout.entry.js +1 -1
  125. package/dist/esm-es5/{sqm-portal-profile-view-824c8242.js → sqm-portal-profile-view-b67467b4.js} +1 -1
  126. package/dist/esm-es5/sqm-portal-profile.entry.js +1 -1
  127. package/dist/esm-es5/sqm-portal-protected-route.entry.js +1 -1
  128. package/dist/esm-es5/sqm-portal-reset-password.entry.js +1 -1
  129. package/dist/esm-es5/sqm-portal-verify-email.entry.js +1 -1
  130. package/dist/esm-es5/sqm-referral-table-column.entry.js +1 -1
  131. package/dist/esm-es5/sqm-referral-table-date-column.entry.js +1 -1
  132. package/dist/esm-es5/sqm-referral-table-rewards-column.entry.js +1 -1
  133. package/dist/esm-es5/sqm-referral-table-status-column.entry.js +1 -1
  134. package/dist/esm-es5/sqm-referral-table-user-column.entry.js +1 -1
  135. package/dist/esm-es5/sqm-share-code.entry.js +1 -1
  136. package/dist/esm-es5/useDemoBigStat-c3b955b7.js +1 -0
  137. package/dist/mint-components/global/styles.ts +3 -0
  138. package/dist/mint-components/mint-components.css +1 -0
  139. package/dist/mint-components/mint-components.esm.js +1 -1
  140. package/dist/mint-components/mint-components.js +1 -1
  141. package/dist/mint-components/{p-3052c913.system.js → p-07c924fa.system.js} +1 -1
  142. package/dist/mint-components/{p-05cca77b.js → p-0eb3e89c.js} +1 -1
  143. package/dist/mint-components/{p-337b49ee.entry.js → p-160bd62f.entry.js} +1 -1
  144. package/dist/mint-components/p-16f5a7cb.system.js +1 -0
  145. package/dist/mint-components/{p-4ba2faf2.system.entry.js → p-1a09e4e1.system.entry.js} +1 -1
  146. package/dist/mint-components/p-1c8b0290.entry.js +1 -0
  147. package/dist/mint-components/{p-7c13e32e.system.entry.js → p-1dcdca58.system.entry.js} +1 -1
  148. package/dist/mint-components/p-20d41ab1.entry.js +1 -0
  149. package/dist/mint-components/{p-e9ab90a1.entry.js → p-221a4097.entry.js} +1 -1
  150. package/dist/mint-components/{p-a0045707.system.entry.js → p-223b42bd.system.entry.js} +1 -1
  151. package/dist/mint-components/{p-cc3510c8.js → p-224504ad.js} +1 -1
  152. package/dist/mint-components/{p-2a025d2a.system.entry.js → p-24b3c6f0.system.entry.js} +1 -1
  153. package/dist/mint-components/{p-1b414d8f.system.entry.js → p-24c9a599.system.entry.js} +1 -1
  154. package/dist/mint-components/{p-a7f0b2f6.entry.js → p-29fab29b.entry.js} +1 -1
  155. package/dist/mint-components/{p-e475a5ff.system.entry.js → p-304e6c82.system.entry.js} +1 -1
  156. package/dist/mint-components/{p-5f28af29.entry.js → p-3397167c.entry.js} +1 -1
  157. package/dist/mint-components/p-33c5ffb7.entry.js +1 -0
  158. package/dist/mint-components/{p-04516274.system.entry.js → p-396bf448.system.entry.js} +1 -1
  159. package/dist/mint-components/p-3b97aed8.system.js +1 -0
  160. package/dist/mint-components/{p-3b0acfcd.system.js → p-3ce2fb83.system.js} +1 -1
  161. package/dist/mint-components/{p-82d7a2ba.entry.js → p-3d856985.entry.js} +1 -1
  162. package/dist/mint-components/p-3f7218fb.entry.js +335 -0
  163. package/dist/mint-components/{p-af06ea5b.system.entry.js → p-4052b948.system.entry.js} +1 -1
  164. package/dist/mint-components/{p-57a53dbd.system.entry.js → p-412a9226.system.entry.js} +1 -1
  165. package/dist/mint-components/p-44d0fc80.system.entry.js +1 -0
  166. package/dist/mint-components/{p-844f9bad.entry.js → p-45c752a0.entry.js} +1 -1
  167. package/dist/mint-components/{p-f1e1086e.js → p-46a4269a.js} +17 -2
  168. package/dist/mint-components/p-52802c88.entry.js +13 -0
  169. package/dist/mint-components/p-5480e4ee.entry.js +1 -0
  170. package/dist/mint-components/{p-db723323.system.entry.js → p-55508395.system.entry.js} +1 -1
  171. package/dist/mint-components/{p-844fd903.js → p-563253e8.js} +1 -1
  172. package/dist/mint-components/p-60855d33.system.js +1 -0
  173. package/dist/mint-components/p-67ae18d1.system.entry.js +1 -0
  174. package/dist/mint-components/{p-434ee9c1.js → p-6882070c.js} +1 -1
  175. package/dist/mint-components/{p-1ac9c24b.system.entry.js → p-69bcf4fa.system.entry.js} +1 -1
  176. package/dist/mint-components/p-6bf0a4d9.system.entry.js +1 -0
  177. package/dist/mint-components/p-6e245fa3.system.entry.js +1 -0
  178. package/dist/mint-components/{p-a4a00461.entry.js → p-723ebe45.entry.js} +1 -1
  179. package/dist/mint-components/{p-5dfc6804.system.entry.js → p-73148868.system.entry.js} +1 -1
  180. package/dist/mint-components/{p-6cdc70f4.entry.js → p-8435a22d.entry.js} +1 -1
  181. package/dist/mint-components/p-883a32e7.entry.js +1 -0
  182. package/dist/mint-components/p-9c554ca0.system.js +1 -0
  183. package/dist/mint-components/{p-d3787c3a.entry.js → p-9d6dbb2d.entry.js} +1 -1
  184. package/dist/mint-components/p-9e4fee30.system.entry.js +1 -0
  185. package/dist/mint-components/{p-2bce988c.js → p-a2c3cff3.js} +1 -1
  186. package/dist/mint-components/{p-d9cc041f.entry.js → p-a4c2c7ed.entry.js} +1 -1
  187. package/dist/mint-components/{p-1813b9b9.system.js → p-a6094ff9.system.js} +1 -1
  188. package/dist/mint-components/{p-aba21f90.entry.js → p-ade44a4e.entry.js} +1 -1
  189. package/dist/mint-components/p-b1bb07db.entry.js +1 -0
  190. package/dist/mint-components/{p-ceeaf074.system.js → p-b608f7a4.system.js} +35 -21
  191. package/dist/mint-components/p-b6b4022a.system.entry.js +1 -0
  192. package/dist/mint-components/{p-2f171597.entry.js → p-b8bd2607.entry.js} +1 -1
  193. package/dist/mint-components/{p-0688c9c2.system.entry.js → p-be2738b0.system.entry.js} +1 -1
  194. package/dist/mint-components/{p-82ab88fe.system.js → p-c6114bfe.system.js} +1 -1
  195. package/dist/mint-components/{p-16535642.system.entry.js → p-c79c608d.system.entry.js} +1 -1
  196. package/dist/mint-components/{p-505f5c59.system.entry.js → p-cca9026f.system.entry.js} +1 -1
  197. package/dist/mint-components/{p-71d942af.entry.js → p-cd410a05.entry.js} +2 -2
  198. package/dist/mint-components/{p-a0cfd3d9.system.js → p-cdeae699.system.js} +1 -1
  199. package/dist/mint-components/{p-3fd33dee.system.entry.js → p-d174d0bc.system.entry.js} +1 -1
  200. package/dist/mint-components/p-d21e0dbd.js +1 -0
  201. package/dist/mint-components/{p-00190438.js → p-d35b0366.js} +1 -1
  202. package/dist/mint-components/{p-8e37c08d.js → p-db2e4c42.js} +1 -1
  203. package/dist/mint-components/p-dc603d08.system.entry.js +1 -0
  204. package/dist/mint-components/{p-1fb688a9.system.js → p-e7f633b9.system.js} +1 -1
  205. package/dist/mint-components/{p-16da5146.entry.js → p-f17050de.entry.js} +1 -1
  206. package/dist/mint-components/p-f90486ca.js +235 -0
  207. package/dist/mint-components/p-fce1dbf6.entry.js +1 -0
  208. package/dist/types/components/sqm-big-stat/UseBigStat.stories.d.ts +6 -0
  209. package/dist/types/components/sqm-big-stat/sqm-big-stat-view.d.ts +1 -0
  210. package/dist/types/components/sqm-big-stat/useBigStat.d.ts +4 -1
  211. package/dist/types/components/sqm-reward-exchange-list/RewardExchangeList.stories.d.ts +6 -0
  212. package/dist/types/components/sqm-reward-exchange-list/RewardExchangeListData.d.ts +81 -0
  213. package/dist/types/components/sqm-reward-exchange-list/SVGs.d.ts +1 -0
  214. package/dist/types/components/sqm-reward-exchange-list/progressBar.d.ts +3 -2
  215. package/dist/types/components/sqm-reward-exchange-list/sqm-reward-exchange-list-view.d.ts +3 -4
  216. package/dist/types/components/sqm-rewards-table/UseRewardsTable.stories.d.ts +16 -0
  217. package/dist/types/components/sqm-rewards-table/sqm-rewards-table-column.d.ts +20 -0
  218. package/dist/types/components/sqm-rewards-table/useRewardsTable.d.ts +33 -0
  219. package/dist/types/components/{sqm-rewards-table → sqm-router}/Router.stories.d.ts +0 -0
  220. package/dist/types/components/sqm-task-card/SVGs.d.ts +0 -1
  221. package/dist/types/components/sqm-task-card/TaskCard.stories.d.ts +12 -5
  222. package/dist/types/components/sqm-task-card/UseTaskCard.stories.d.ts +10 -0
  223. package/dist/types/components/sqm-task-card/progress-bar/SVGs.d.ts +1 -0
  224. package/dist/types/components/sqm-task-card/progress-bar/progress-bar-view.d.ts +11 -0
  225. package/dist/types/components/sqm-task-card/sqm-task-card-view.d.ts +13 -22
  226. package/dist/types/components/sqm-task-card/sqm-task-card.d.ts +29 -14
  227. package/dist/types/components.d.ts +86 -36
  228. package/dist/types/global/styles.d.ts +1 -1
  229. package/grapesjs/grapesjs.js +1 -1
  230. package/package.json +1 -1
  231. package/dist/cjs/sqm-leaderboard-rank-view-35015d30.js +0 -10
  232. package/dist/cjs/sqm-rewards-table.cjs.entry.js +0 -332
  233. package/dist/cjs/sqm-task-card-view-57066e67.js +0 -476
  234. package/dist/cjs/sqm-task-card.cjs.entry.js +0 -56
  235. package/dist/cjs/tslib.es6-0e81fab1.js +0 -56
  236. package/dist/cjs/useChildElements-428ca5b8.js +0 -21
  237. package/dist/esm/sqm-leaderboard-rank-view-da91f5f3.js +0 -8
  238. package/dist/esm/sqm-rewards-table.entry.js +0 -328
  239. package/dist/esm/sqm-task-card-view-2ee495af.js +0 -474
  240. package/dist/esm/sqm-task-card.entry.js +0 -52
  241. package/dist/esm/tslib.es6-7ac9d7e4.js +0 -53
  242. package/dist/esm/useChildElements-506f00d0.js +0 -19
  243. package/dist/esm-es5/index-2f5dd0a1.js +0 -1
  244. package/dist/esm-es5/sqm-divided-layout_27.entry.js +0 -1
  245. package/dist/esm-es5/sqm-leaderboard-rank-view-da91f5f3.js +0 -1
  246. package/dist/esm-es5/sqm-rewards-table.entry.js +0 -1
  247. package/dist/esm-es5/sqm-task-card-view-2ee495af.js +0 -1
  248. package/dist/esm-es5/sqm-task-card.entry.js +0 -1
  249. package/dist/esm-es5/tslib.es6-7ac9d7e4.js +0 -15
  250. package/dist/esm-es5/useChildElements-506f00d0.js +0 -1
  251. package/dist/esm-es5/useDemoBigStat-b71fe122.js +0 -1
  252. package/dist/mint-components/p-11c75956.entry.js +0 -1
  253. package/dist/mint-components/p-189219ee.system.js +0 -1
  254. package/dist/mint-components/p-1e248afc.system.entry.js +0 -1
  255. package/dist/mint-components/p-21dfdeb8.entry.js +0 -1
  256. package/dist/mint-components/p-23a0bdae.entry.js +0 -1
  257. package/dist/mint-components/p-353b4413.system.js +0 -1
  258. package/dist/mint-components/p-405a9253.js +0 -227
  259. package/dist/mint-components/p-55e02769.entry.js +0 -13
  260. package/dist/mint-components/p-58d9b2f0.js +0 -15
  261. package/dist/mint-components/p-684850a7.entry.js +0 -287
  262. package/dist/mint-components/p-6d545e13.entry.js +0 -1
  263. package/dist/mint-components/p-70837c1c.entry.js +0 -49
  264. package/dist/mint-components/p-7c138c84.entry.js +0 -1
  265. package/dist/mint-components/p-7c261ea0.system.entry.js +0 -1
  266. package/dist/mint-components/p-8034f81c.system.entry.js +0 -1
  267. package/dist/mint-components/p-81dbda90.system.entry.js +0 -1
  268. package/dist/mint-components/p-8c16f04e.js +0 -1
  269. package/dist/mint-components/p-8f5e2af4.entry.js +0 -1
  270. package/dist/mint-components/p-91d39961.system.js +0 -1
  271. package/dist/mint-components/p-b3af1c6f.js +0 -1
  272. package/dist/mint-components/p-bf04a8e1.system.entry.js +0 -1
  273. package/dist/mint-components/p-bf055b6c.system.js +0 -1
  274. package/dist/mint-components/p-c3866bfa.system.entry.js +0 -1
  275. package/dist/mint-components/p-c9c4f31b.system.entry.js +0 -1
  276. package/dist/mint-components/p-dd6a666e.system.js +0 -15
  277. package/dist/mint-components/p-dfc3cf82.js +0 -1
  278. package/dist/mint-components/p-e19a57a4.system.entry.js +0 -1
  279. package/dist/mint-components/p-e22eed7b.entry.js +0 -1
  280. package/dist/mint-components/p-e2ebe90c.entry.js +0 -1
  281. package/dist/mint-components/p-e78a5a91.js +0 -1
  282. package/dist/mint-components/p-ecbabf6e.system.js +0 -1
  283. package/dist/mint-components/p-f41ab9e1.system.js +0 -1
  284. package/dist/mint-components/p-f87d8f53.system.js +0 -1
  285. package/dist/mint-components/p-fcaa5886.system.entry.js +0 -1
@@ -4,11 +4,10 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-b0129cd6.js');
6
6
  const _extends = require('./extends-0302d27d.js');
7
- const global = require('./global-041b5338.js');
7
+ const global = require('./global-6223fe8f.js');
8
8
  const useCallback = require('./use-callback-fadb2643.js');
9
- const index_module = require('./index.module-6a7bda18.js');
9
+ const index_module = require('./index.module-7dd4b981.js');
10
10
  const jsonpointer = require('./jsonpointer-11327262.js');
11
- require('./tslib.es6-0e81fab1.js');
12
11
  const jssPresetDefault_esm = require('./jss-preset-default.esm-6304d24f.js');
13
12
  const utils = require('./utils-95e5317c.js');
14
13
  const cjs = require('./cjs-1066ec21.js');
@@ -16,24 +15,21 @@ const mixins = require('./mixins-7b7c59fe.js');
16
15
  const sqmPortalContainerView = require('./sqm-portal-container-view-d144735a.js');
17
16
  const sqmPortalSectionView = require('./sqm-portal-section-view-3b008930.js');
18
17
  const sqmTextSpanView = require('./sqm-text-span-view-b5ae787b.js');
19
- const index$1 = require('./index-19309631.js');
20
- const reRender = require('./re-render-7cdb2d81.js');
21
- const useChildElements = require('./useChildElements-428ca5b8.js');
22
- const useDemoBigStat = require('./useDemoBigStat-17e61803.js');
18
+ const sqmLeaderboardRankView = require('./sqm-leaderboard-rank-view-7dd44d62.js');
19
+ const reRender = require('./re-render-6111d4bd.js');
20
+ const useDemoBigStat = require('./useDemoBigStat-2786227e.js');
23
21
  const sqmShareLinkView = require('./sqm-share-link-view-a935d07e.js');
24
- const ShadowViewAddon = require('./ShadowViewAddon-75c18b96.js');
25
- const sqmLeaderboardRankView = require('./sqm-leaderboard-rank-view-35015d30.js');
22
+ const ShadowViewAddon = require('./ShadowViewAddon-a85b8c8d.js');
26
23
  const sqmNavigationSidebarView = require('./sqm-navigation-sidebar-view-d06e1885.js');
27
- const sqmNavigationSidebarItemView = require('./sqm-navigation-sidebar-item-view-e99b4a10.js');
24
+ const sqmNavigationSidebarItemView = require('./sqm-navigation-sidebar-item-view-6c7f78e6.js');
28
25
  const sqmStatContainerView = require('./sqm-stat-container-view-ee7b00ff.js');
29
- const sqmPortalProfileView = require('./sqm-portal-profile-view-a23ea292.js');
26
+ const sqmPortalProfileView = require('./sqm-portal-profile-view-14b41436.js');
30
27
  const sqmPortalForgotPasswordView = require('./sqm-portal-forgot-password-view-1704d285.js');
31
- const sqmPortalEmailVerificationView = require('./sqm-portal-email-verification-view-5e955797.js');
28
+ const sqmPortalEmailVerificationView = require('./sqm-portal-email-verification-view-08d1848c.js');
32
29
  const sqmPortalResetPasswordView = require('./sqm-portal-reset-password-view-4d78fd6d.js');
33
30
  const sqmPortalVerifyEmailView = require('./sqm-portal-verify-email-view-b595e302.js');
34
31
  const sqmAssetCardView = require('./sqm-asset-card-view-07f86880.js');
35
- const sqmTaskCardView = require('./sqm-task-card-view-57066e67.js');
36
- const sqmPortalFooterView = require('./sqm-portal-footer-view-9089feb7.js');
32
+ const sqmPortalFooterView = require('./sqm-portal-footer-view-69c73802.js');
37
33
  const sqmHeroView = require('./sqm-hero-view-bb3d00a1.js');
38
34
  const sqmNameFieldsView = require('./sqm-name-fields-view-24614ac7.js');
39
35
 
@@ -5880,7 +5876,22 @@ function ReferralTableView(props) {
5880
5876
  index.h("sl-button", { size: "small", loading: states.loading, disabled: !states.hasNext, onClick: callbacks.nextPage, exportparts: "base: defaultbutton-base" }, data.textOverrides.moreLabel))));
5881
5877
  }
5882
5878
 
5883
- const GET_REFERRER_DATA = index$1.gql `
5879
+ function useChildElements() {
5880
+ const host = index_module.P();
5881
+ const initialState = host.children.length ? Array.from(host.children) : [];
5882
+ const [childElements, setChildElements] = _extends.useState(initialState);
5883
+ _extends.useEffect(() => {
5884
+ const observer = new MutationObserver(() => {
5885
+ const children = Array.from(host.children);
5886
+ setChildElements([...children]);
5887
+ });
5888
+ observer.observe(host, { childList: true });
5889
+ return () => observer.disconnect();
5890
+ }, [host]);
5891
+ return childElements;
5892
+ }
5893
+
5894
+ const GET_REFERRER_DATA = sqmLeaderboardRankView.gql `
5884
5895
  query getReferrals($programId: ID, $rewardFilter: RewardFilterInput) {
5885
5896
  viewer {
5886
5897
  ... on User {
@@ -5927,7 +5938,7 @@ const GET_REFERRER_DATA = index$1.gql `
5927
5938
  }
5928
5939
  }
5929
5940
  `;
5930
- const GET_REFERRAL_DATA = index$1.gql `
5941
+ const GET_REFERRAL_DATA = sqmLeaderboardRankView.gql `
5931
5942
  query getReferrals(
5932
5943
  $limit: Int!
5933
5944
  $offset: Int!
@@ -6091,7 +6102,7 @@ function useReferralTable(props, emptyElement, loadingElement) {
6091
6102
  }, [props.showReferrer]);
6092
6103
  const tick = reRender.useRerenderListener();
6093
6104
  const data = referralData === null || referralData === void 0 ? void 0 : referralData.data;
6094
- const components = useChildElements.useChildElements();
6105
+ const components = useChildElements();
6095
6106
  async function getComponentData(components) {
6096
6107
  // filter out loading and empty states from columns array
6097
6108
  const columnComponents = components.filter((component) => component.slot !== "loading" && component.slot !== "empty");
@@ -14771,6 +14782,7 @@ const GET_EXCHANGE_LIST = index_module.dist.gql `
14771
14782
  destinationValue
14772
14783
  prettyDestinationValue
14773
14784
  available
14785
+ unavailableReasonCode
14774
14786
  }
14775
14787
  }
14776
14788
  totalCount
@@ -14791,36 +14803,29 @@ const EXCHANGE = index_module.dist.gql `
14791
14803
  `;
14792
14804
  function useRewardExchangeList(props) {
14793
14805
  var _a, _b, _c, _d;
14794
- const drawerRef = _extends.useRef();
14795
14806
  const [exchangeState, setExchangeState] = _extends.useReducer((state, next) => ({
14796
14807
  ...state,
14797
14808
  ...next,
14798
14809
  }), {
14799
14810
  selectedItem: undefined,
14800
14811
  selectedStep: undefined,
14801
- redeemStage: "",
14812
+ redeemStage: "chooseReward",
14802
14813
  amount: 0,
14803
14814
  exchangeError: false,
14804
14815
  });
14805
14816
  const { selectedItem, selectedStep, redeemStage, amount, exchangeError } = exchangeState;
14806
14817
  const user = index_module.T();
14807
14818
  const [exchange, { data: exchangeResponse, errors }] = index_module.be(EXCHANGE);
14808
- const { data } = index_module.en(GET_EXCHANGE_LIST, !(user === null || user === void 0 ? void 0 : user.jwt));
14819
+ const { data, loading, refetch } = index_module.en(GET_EXCHANGE_LIST, !(user === null || user === void 0 ? void 0 : user.jwt));
14809
14820
  _extends.useEffect(() => {
14810
14821
  var _a, _b;
14811
14822
  if ((_b = (_a = exchangeResponse === null || exchangeResponse === void 0 ? void 0 : exchangeResponse.exchangeReward) === null || _a === void 0 ? void 0 : _a.reward) === null || _b === void 0 ? void 0 : _b.id) {
14812
14823
  setExchangeState({ redeemStage: "success" });
14813
14824
  }
14814
14825
  if (!!errors) {
14815
- console.log("YEA");
14816
14826
  setExchangeState({ exchangeError: true });
14817
14827
  }
14818
14828
  }, [exchangeResponse, errors]);
14819
- function openDrawer() {
14820
- var _a;
14821
- setExchangeState({ redeemStage: "chooseReward" });
14822
- (_a = drawerRef.current) === null || _a === void 0 ? void 0 : _a.show();
14823
- }
14824
14829
  function exchangeReward() {
14825
14830
  if (!selectedItem)
14826
14831
  return;
@@ -14878,29 +14883,16 @@ function useRewardExchangeList(props) {
14878
14883
  }
14879
14884
  exchange({ exchangeRewardInput: exchangeVariables });
14880
14885
  }
14881
- const resetState = useCallback.useCallback((e) => {
14882
- var _a, _b;
14883
- // selects also trigger an sl-hide event :(
14884
- //@ts-ignore - componentId is not private here
14885
- if (((_a = e === null || e === void 0 ? void 0 : e.target) === null || _a === void 0 ? void 0 : _a.componentId) !== ((_b = drawerRef.current) === null || _b === void 0 ? void 0 : _b.componentId))
14886
- return;
14886
+ const resetState = (refresh) => {
14887
+ refresh && refetch();
14887
14888
  setExchangeState({
14888
14889
  amount: 0,
14889
14890
  selectedStep: undefined,
14890
14891
  selectedItem: undefined,
14891
14892
  exchangeError: false,
14893
+ redeemStage: "chooseReward",
14892
14894
  });
14893
- }, []);
14894
- _extends.useEffect(() => {
14895
- if (!(drawerRef === null || drawerRef === void 0 ? void 0 : drawerRef.current))
14896
- return;
14897
- const drawer = drawerRef.current;
14898
- // Clear input value when drawer is closed
14899
- drawer.addEventListener("sl-hide", resetState);
14900
- return () => {
14901
- drawer.removeEventListener("sl-hide", resetState);
14902
- };
14903
- }, [drawerRef.current]);
14895
+ };
14904
14896
  function setStage(stage) {
14905
14897
  setExchangeState({ redeemStage: stage });
14906
14898
  }
@@ -14914,24 +14906,27 @@ function useRewardExchangeList(props) {
14914
14906
  amount,
14915
14907
  selectedStep,
14916
14908
  exchangeError,
14909
+ loading,
14917
14910
  },
14918
14911
  data: {
14919
14912
  exchangeList: (_b = (_a = data === null || data === void 0 ? void 0 : data.viewer) === null || _a === void 0 ? void 0 : _a.visibleRewardExchangeItems) === null || _b === void 0 ? void 0 : _b.data,
14920
- //@ts-ignore
14921
14913
  fuelTankCode: (_d = (_c = exchangeResponse === null || exchangeResponse === void 0 ? void 0 : exchangeResponse.exchangeReward) === null || _c === void 0 ? void 0 : _c.reward) === null || _d === void 0 ? void 0 : _d.fuelTankCode,
14922
14914
  },
14923
14915
  callbacks: {
14924
14916
  exchangeReward,
14925
- openDrawer,
14926
14917
  setExchangeState,
14927
14918
  setStage,
14928
- },
14929
- refs: {
14930
- drawerRef,
14919
+ resetState,
14931
14920
  },
14932
14921
  };
14933
14922
  }
14934
14923
 
14924
+ const ExchangeArrows = () => (index.h("svg", { width: "30", height: "30", viewBox: "0 0 30 30", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
14925
+ index.h("circle", { cx: "15", cy: "15", r: "15", fill: "white" }),
14926
+ index.h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M10.6255 21.783C10.5129 21.8963 10.3597 21.96 10.2 21.96C10.0402 21.96 9.88705 21.8963 9.77442 21.783L5.87442 17.8597C5.64081 17.6247 5.64194 17.2448 5.87695 17.0112C6.11197 16.7775 6.49186 16.7787 6.72548 17.0137L9.59995 19.9054V8.52001C9.59995 8.18864 9.86858 7.92001 10.2 7.92001C10.5313 7.92001 10.8 8.18864 10.8 8.52001V19.9054L13.6744 17.0137C13.908 16.7787 14.2879 16.7775 14.5229 17.0112C14.758 17.2448 14.7591 17.6247 14.5255 17.8597L10.6255 21.783ZM20.2255 8.09707C20.1129 7.98378 19.9597 7.92007 19.8 7.92007C19.6402 7.92007 19.487 7.98378 19.3744 8.09707L15.4744 12.0204C15.2408 12.2554 15.2419 12.6353 15.477 12.8689C15.712 13.1025 16.0919 13.1014 16.3255 12.8664L19.2 9.97473V21.3601C19.2 21.6914 19.4686 21.9601 19.8 21.9601C20.1313 21.9601 20.4 21.6914 20.4 21.3601V9.97473L23.2744 12.8664C23.508 13.1014 23.8879 13.1025 24.1229 12.8689C24.358 12.6353 24.3591 12.2554 24.1255 12.0204L20.2255 8.09707Z", fill: "#333333" })));
14927
+ const CheckMark = () => (index.h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "10", height: "7", viewBox: "0 0 10 7", fill: "none" },
14928
+ index.h("path", { d: "M2.12828 2.71485C1.72536 2.33712 1.09253 2.35754 0.714799 2.76045C0.337068 3.16336 0.357483 3.7962 0.760395 4.17393L2.12828 2.71485ZM3.81471 5.66661L3.13076 6.39615C3.51542 6.75677 4.11399 6.75677 4.49865 6.39615L3.81471 5.66661ZM9.23939 1.95171C9.6423 1.57397 9.66271 0.941139 9.28498 0.538227C8.90725 0.135315 8.27442 0.114901 7.87151 0.492631L9.23939 1.95171ZM0.760395 4.17393L3.13076 6.39615L4.49865 4.93708L2.12828 2.71485L0.760395 4.17393ZM4.49865 6.39615L9.23939 1.95171L7.87151 0.492631L3.13076 4.93708L4.49865 6.39615Z", fill: "white" })));
14929
+
14935
14930
  function Dot({ active, completed, incomplete, }) {
14936
14931
  return (index.h("div", { style: {
14937
14932
  flex: "0 0 0",
@@ -14951,63 +14946,47 @@ function Dot({ active, completed, incomplete, }) {
14951
14946
  index.h("div", { style: {
14952
14947
  backgroundColor: completed ? "#9E9E9E" : "#FFF",
14953
14948
  border: active
14954
- ? "2px solid #9E9E9E"
14949
+ ? "3px solid #9E9E9E"
14955
14950
  : incomplete
14956
- ? "2px solid #E5E5E5"
14957
- : "none",
14951
+ ? "3px solid #E5E5E5"
14952
+ : "3px solid #9E9E9E",
14958
14953
  borderRadius: "50%",
14959
- width: completed ? "12px" : "8px",
14960
- height: completed ? "12px" : "8px",
14961
- margin: "-4px auto 0px",
14954
+ width: "10px",
14955
+ height: "10px",
14956
+ margin: "-6px auto 0px",
14962
14957
  zIndex: "1",
14963
- } })));
14958
+ boxSizing: "content-box",
14959
+ } }, completed && (index.h("div", { style: { top: "-6px", position: "relative" } },
14960
+ index.h(CheckMark, null))))));
14961
+ }
14962
+ function ProgressLine({ incomplete = false, active = false }) {
14963
+ return (index.h("div", { style: {
14964
+ content: "''",
14965
+ flex: "0.5 0.5 0",
14966
+ height: "4px",
14967
+ borderRadius: "4px",
14968
+ background: incomplete || active ? "#E5E5E5" : "#9E9E9E",
14969
+ position: "relative",
14970
+ bottom: "0",
14971
+ left: "0",
14972
+ display: "flex",
14973
+ justifyContent: "center",
14974
+ columnGap: "50px",
14975
+ marginRight: "-2px",
14976
+ boxSizing: "content-box",
14977
+ } }));
14964
14978
  }
14965
14979
  function Progress({ active, completed, incomplete }) {
14966
14980
  return [
14967
- index.h("div", { style: {
14968
- content: "''",
14969
- flex: "0.5 0.5 0",
14970
- height: "4px",
14971
- borderRadius: "4px",
14972
- background: incomplete ? "#E5E5E5" : "#9E9E9E",
14973
- position: "relative",
14974
- bottom: "0",
14975
- left: "0",
14976
- display: "flex",
14977
- justifyContent: "center",
14978
- columnGap: "50px",
14979
- marginRight: "-2px",
14980
- boxSizing: "content-box",
14981
- } }),
14981
+ index.h(ProgressLine, { incomplete: incomplete }),
14982
14982
  index.h(Dot, { active: active, completed: completed, incomplete: incomplete }),
14983
- index.h("div", { style: {
14984
- content: "''",
14985
- flex: "0.5 0.5 0",
14986
- height: "4px",
14987
- borderRadius: "4px",
14988
- background: incomplete || active ? "#E5E5E5" : "#9E9E9E",
14989
- position: "relative",
14990
- bottom: "0",
14991
- left: "0",
14992
- display: "flex",
14993
- justifyContent: "center",
14994
- columnGap: "50px",
14995
- marginRight: "-2px",
14996
- boxSizing: "content-box",
14997
- } }),
14983
+ index.h(ProgressLine, { incomplete: incomplete, active: active }),
14998
14984
  ];
14999
14985
  }
15000
- function ProgressBar({ stage }) {
15001
- console.log({ stage });
15002
- return (index.h("div", { style: { display: "flex", columnGap: "-2px" } },
15003
- index.h(Progress, { active: stage === 0, completed: stage > 0, incomplete: stage < 0 }),
15004
- index.h(Progress, { active: stage === 1, completed: stage > 1, incomplete: stage < 1 }),
15005
- index.h(Progress, { active: stage === 2, completed: stage > 2, incomplete: stage < 2 })));
14986
+ function ProgressBar({ stageCount, currentStage, }) {
14987
+ return (index.h("div", { style: { display: "flex", columnGap: "-2px" } }, Array.from(Array(stageCount).keys()).map((stage) => (index.h(Progress, { active: currentStage === stage, completed: currentStage > stage, incomplete: currentStage < stage })))));
15006
14988
  }
15007
14989
 
15008
- const LeftArrow = () => (index.h("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", style: { marginBottom: "-2px", marginRight: "5px" } },
15009
- index.h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M7.34655 1.90573C7.75405 2.31323 7.75405 2.97392 7.34655 3.38143L3.56266 7.16531H14.9565C15.5328 7.16531 16 7.6325 16 8.20879C16 8.78509 15.5328 9.25227 14.9565 9.25227H3.56266L7.69437 13.384C8.10188 13.7915 8.10188 14.4522 7.69437 14.8597C7.28687 15.2672 6.62617 15.2672 6.21867 14.8597L0.305628 8.94664C-0.101876 8.53914 -0.101876 7.87845 0.305628 7.47094L5.87084 1.90573C6.27835 1.49822 6.93904 1.49822 7.34655 1.90573Z", fill: "#858585" })));
15010
-
15011
14990
  const stageList = ["chooseReward", "chooseAmount", "confirmation", "success"];
15012
14991
  const stageProgressList = {
15013
14992
  chooseReward: "Choose reward",
@@ -15017,38 +14996,43 @@ const stageProgressList = {
15017
14996
  function RewardExchangeView(props) {
15018
14997
  const style = {
15019
14998
  Container: {
14999
+ padding: "var(--sl-spacing-medium)",
15020
15000
  position: "relative",
15021
- display: "flex",
15022
15001
  },
15023
15002
  CardContainer: {
15024
- "&:hover": {
15025
- boxShadow: "0 3px 10px #87ceeb6e!important",
15003
+ "&:active": {
15004
+ //boxShadow: "0 3px 10px #87ceeb6e!important",
15026
15005
  },
15027
15006
  },
15028
15007
  Base: {
15029
- display: "block",
15008
+ display: "flex",
15030
15009
  cursor: "pointer",
15031
15010
  textAlign: "center",
15011
+ height: "120px",
15032
15012
  "&::part(base)": {
15013
+ boxShadow: "none",
15033
15014
  width: "100%",
15034
- height: "170px",
15015
+ // maxWidth: "350px",
15035
15016
  display: "flex",
15036
- justifyContent: "space-between",
15037
- alignItems: "center",
15017
+ margin: "0 auto",
15038
15018
  },
15039
15019
  "&::part(body)": {
15040
- padding: "10px 0",
15020
+ padding: 0,
15021
+ display: "flex",
15022
+ width: "100%",
15041
15023
  },
15042
15024
  },
15043
15025
  Drawer: {
15044
15026
  "&::part(base)": {
15045
15027
  minWidth: "400px",
15028
+ maxWidth: "700px",
15046
15029
  width: "50%",
15047
15030
  margin: "0 auto",
15048
15031
  right: "0",
15049
15032
  },
15050
15033
  "&::part(panel)": {
15051
15034
  height: "85vh",
15035
+ width: "100%",
15052
15036
  },
15053
15037
  },
15054
15038
  FullImage: {
@@ -15058,8 +15042,9 @@ function RewardExchangeView(props) {
15058
15042
  },
15059
15043
  PreviewImage: {
15060
15044
  objectFit: "contain",
15061
- maxWidth: "100%",
15062
- height: "75px",
15045
+ width: "120px",
15046
+ height: "120px",
15047
+ flex: 0.33,
15063
15048
  },
15064
15049
  InputBox: {
15065
15050
  width: "100%",
@@ -15074,8 +15059,9 @@ function RewardExchangeView(props) {
15074
15059
  },
15075
15060
  },
15076
15061
  Buttons: {
15077
- bottom: "0",
15062
+ marginLeft: "auto",
15078
15063
  width: "100%",
15064
+ maxWidth: "300px",
15079
15065
  },
15080
15066
  Button: {
15081
15067
  margin: "10px 0",
@@ -15083,12 +15069,57 @@ function RewardExchangeView(props) {
15083
15069
  textAlign: "center",
15084
15070
  cursor: "pointer",
15085
15071
  },
15072
+ ProgressBar: {
15073
+ fontSize: "80%",
15074
+ marginBottom: "20px",
15075
+ "& .text-area": {
15076
+ marginTop: "5px",
15077
+ display: "flex",
15078
+ justifyContent: "center",
15079
+ textAlign: "center",
15080
+ whiteSpace: "nowrap",
15081
+ marginBottom: "6px",
15082
+ "& .text": {
15083
+ flex: "1 1 0",
15084
+ },
15085
+ "& .text.subdued": {
15086
+ color: "#BDBDBD",
15087
+ },
15088
+ },
15089
+ },
15090
+ KutayCard: {
15091
+ "&::part(base)": {
15092
+ boxShadow: "none",
15093
+ },
15094
+ },
15095
+ KutayButton: {
15096
+ display: "flex",
15097
+ flexWrap: "wrap",
15098
+ margin: "var(--sl-spacing-medium) 0",
15099
+ "& .cancel": {
15100
+ width: "20%",
15101
+ marginLeft: "auto",
15102
+ marginRight: "var(--sl-spacing-medium)",
15103
+ "&::part(base)": {
15104
+ fontWeight: "var(--sl-font-weight-normal)",
15105
+ color: "var(--sl-color-neutral-1000)",
15106
+ },
15107
+ },
15108
+ "& .continue": {
15109
+ width: "20%",
15110
+ "&::part(base)": {
15111
+ background: "var(--sl-color-neutral-500)",
15112
+ fontWeight: "var(--sl-font-weight-normal)",
15113
+ color: "var(--sl-color-neutral-0)",
15114
+ },
15115
+ },
15116
+ },
15086
15117
  };
15087
15118
  // JSS config
15088
15119
  jssPresetDefault_esm.jss.setup(jssPresetDefault_esm.create());
15089
15120
  const sheet = jssPresetDefault_esm.jss.createStyleSheet(style);
15090
15121
  const styleString = sheet.toString();
15091
- const { states, data, callbacks, refs } = props;
15122
+ const { states, data, callbacks } = props;
15092
15123
  const { selectedItem, selectedStep } = states;
15093
15124
  function getInput() {
15094
15125
  var _a, _b;
@@ -15109,37 +15140,70 @@ function RewardExchangeView(props) {
15109
15140
  });
15110
15141
  } }, (_b = item.steps) === null || _b === void 0 ? void 0 : _b.map((step) => (index.h("sl-menu-item", { value: step, disabled: !step.available },
15111
15142
  step.prettyDestinationValue,
15112
- index.h("span", { slot: "suffix", style: { fontSize: "75%" } }, step.prettySourceValue))))));
15143
+ index.h("div", { slot: "suffix", style: { fontSize: "75%", float: "right" } },
15144
+ step.prettySourceValue,
15145
+ step.unavailableReasonCode && (index.h("p", { style: { fontSize: "70%", color: "#F2994A" } }, step.unavailableReasonCode))))))));
15113
15146
  }
15114
15147
  function chooseReward() {
15115
15148
  var _a;
15116
- const nextStage = (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.ruleType) === "FIXED_GLOBAL_REWARD"
15117
- ? "confirmation"
15118
- : "chooseAmount";
15119
- console.log({ nextStage, ruleType: selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.ruleType });
15120
- return (index.h("div", { style: {
15121
- display: "flex",
15122
- justifyContent: "center",
15123
- flexWrap: "wrap",
15124
- alignItems: "center",
15125
- columnGap: "12px",
15126
- rowGap: "12px",
15127
- } }, (_a = data.exchangeList) === null || _a === void 0 ? void 0 :
15128
- _a.map((item) => {
15149
+ return [
15150
+ index.h("div", { style: {
15151
+ display: "grid",
15152
+ justifyContent: "center",
15153
+ gap: "20px",
15154
+ gridTemplateColumns: "repeat(auto-fill, minmax(300px, 1fr))",
15155
+ } }, (_a = data.exchangeList) === null || _a === void 0 ? void 0 : _a.map((item) => {
15129
15156
  const style = {
15130
- boxShadow: item.key === (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.key) ? "0 1px 8px #87ceeb" : "none",
15157
+ boxShadow: item.key === (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.key)
15158
+ ? "0 0 0 2px var(--sl-color-primary-500)"
15159
+ : "none",
15131
15160
  marginBottom: "10px 0",
15161
+ borderRadius: "var(--sl-border-radius-medium)",
15132
15162
  flex: "1",
15133
- minWidth: "45%",
15163
+ minWidth: "100%",
15164
+ color: !item.available && "#eee",
15134
15165
  };
15135
- return (index.h("div", { key: item.key, class: sheet.classes.CardContainer, style: style },
15136
- index.h("sl-card", { class: sheet.classes.Base, onClick: () => callbacks.setExchangeState({ selectedItem: item }), disabled: !item.available },
15166
+ const amount = item.ruleType === "FIXED_GLOBAL_REWARD"
15167
+ ? item.prettySourceValue
15168
+ : `${item.sourceMinValue} to ${item.prettySourceMaxValue}`;
15169
+ return (index.h("div", { key: item.key, class: item.available ? sheet.classes.CardContainer : "", style: style },
15170
+ index.h("sl-card", { class: sheet.classes.Base, onClick: () => item.available &&
15171
+ callbacks.setExchangeState({ selectedItem: item }) },
15172
+ item.key === (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.key) && (index.h("div", { style: {
15173
+ width: "18px",
15174
+ height: "18px",
15175
+ borderRadius: "50%",
15176
+ background: "var(--sl-color-primary-500)",
15177
+ position: "relative",
15178
+ margin: "-9px",
15179
+ left: "350px",
15180
+ } },
15181
+ index.h("div", { style: { position: "relative", top: "-6px" } },
15182
+ index.h(CheckMark, null)))),
15183
+ // item?.imageUrl &&
15137
15184
  index.h("img", { class: sheet.classes.PreviewImage, src: (item === null || item === void 0 ? void 0 : item.imageUrl) || index.getAssetPath("./assets/Reward-icon.png") }),
15138
- index.h("p", null, item.description))));
15139
- }),
15140
- index.h("div", { class: sheet.classes.Buttons },
15141
- index.h("sl-button", { onClick: () => callbacks.setStage(nextStage), style: { display: "block" }, class: sheet.classes.Button, disabled: !states.selectedItem }, "Continue"),
15142
- index.h("a", { onClick: () => { var _a; return (_a = refs.drawerRef.current) === null || _a === void 0 ? void 0 : _a.hide(); }, style: { display: "block" }, class: sheet.classes.Button }, "Cancel"))));
15185
+ index.h("p", { style: {
15186
+ textAlign: "left",
15187
+ margin: "0",
15188
+ flex: "1",
15189
+ fontSize: "90%",
15190
+ padding: "8px",
15191
+ } },
15192
+ index.h("b", null, item.description),
15193
+ index.h("p", { style: { margin: "0" } }, amount),
15194
+ item.unavailableReasonCode && (index.h("p", { style: {
15195
+ fontSize: "70%",
15196
+ color: "#F2994A",
15197
+ marginTop: "0",
15198
+ } }, item.unavailableReasonCode ===
15199
+ "INSUFFICIENT_REDEEMABLE_CREDIT"
15200
+ ? "Not enough points"
15201
+ : item.unavailableReasonCode))))));
15202
+ })),
15203
+ index.h("div", { class: sheet.classes.KutayButton },
15204
+ index.h("sl-button", { class: "cancel", size: "large", type: "text" }, "Cancel"),
15205
+ index.h("sl-button", { class: "continue", size: "large", onClick: () => callbacks.setStage("chooseAmount"), disabled: !states.selectedItem }, "Continue")),
15206
+ ];
15143
15207
  }
15144
15208
  function chooseAmount() {
15145
15209
  const input = getInput();
@@ -15147,40 +15211,38 @@ function RewardExchangeView(props) {
15147
15211
  index.h("div", { style: { width: "50%", margin: "0 auto" } }, (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.imageUrl) && (index.h("img", { class: sheet.classes.FullImage, src: selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.imageUrl }))),
15148
15212
  index.h("p", null, selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.description),
15149
15213
  index.h("div", { class: sheet.classes.InputBox }, input),
15150
- index.h("div", { class: sheet.classes.Buttons },
15151
- index.h("sl-button", { onClick: () => callbacks.setStage("confirmation"), disabled: input && !states.amount, style: { display: "block" }, class: sheet.classes.Button }, "Continue"),
15152
- index.h("a", { onClick: () => callbacks.setStage("chooseReward"), style: { display: "block" }, class: sheet.classes.Button }, "Back"))));
15214
+ index.h("div", { class: sheet.classes.KutayButton },
15215
+ index.h("sl-button", { class: "cancel", size: "large", type: "text", onClick: () => callbacks.resetState() }, "Cancel"),
15216
+ index.h("sl-button", { class: "continue", size: "large", onClick: () => callbacks.setStage("confirmation"), disabled: input && !states.amount }, "Continue to confirmation"))));
15153
15217
  }
15154
- console.log({ selectedItem, selectedStep });
15155
15218
  function confirmation() {
15156
- console.log("confirmation:", { selectedItem });
15157
- const redemptionAmount = () => {
15158
- var _a;
15159
- if ((selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.ruleType) === "FIXED_GLOBAL_REWARD") {
15160
- return `Redeem ${selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.sourceValue} ${selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.sourceUnit} for ${selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.globalRewardKey}`;
15161
- }
15162
- else {
15163
- const amount = states.amount;
15164
- const reward = (_a = selectedStep === null || selectedStep === void 0 ? void 0 : selectedStep.prettyDestinationValue) !== null && _a !== void 0 ? _a : `${amount} ${selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.destinationUnit}`;
15165
- return `Redeem ${amount} ${selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.sourceUnit} for ${reward}`;
15166
- }
15167
- };
15168
- const previousStage = (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.ruleType) === "FIXED_GLOBAL_REWARD"
15169
- ? "chooseReward"
15170
- : "chooseAmount";
15171
15219
  return (index.h("div", null,
15172
- index.h("h2", null, "Confirm your redemption:"),
15173
- redemptionAmount(),
15220
+ index.h("h2", null, "Confirm and redeem"),
15221
+ index.h("div", { style: { textAlign: "center" } },
15222
+ index.h("p", null,
15223
+ index.h("b", null, selectedStep === null || selectedStep === void 0 ? void 0 : selectedStep.prettySourceValue)),
15224
+ index.h("p", null,
15225
+ index.h(ExchangeArrows, null)),
15226
+ index.h("div", { class: sheet.classes.CardContainer, style: {
15227
+ boxShadow: "none",
15228
+ marginBottom: "10px",
15229
+ flex: "1",
15230
+ minWidth: "100%",
15231
+ } },
15232
+ index.h("sl-card", { class: sheet.classes.Base },
15233
+ index.h("img", { class: sheet.classes.PreviewImage, src: (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.imageUrl) ||
15234
+ index.getAssetPath("./assets/Reward-icon.png") }),
15235
+ index.h("p", { style: { marginBottom: "0", flex: "1" } }, selectedStep === null || selectedStep === void 0 ? void 0 : selectedStep.prettyDestinationValue)))),
15174
15236
  index.h("div", { class: sheet.classes.Buttons },
15175
15237
  index.h("sl-button", { onClick: callbacks.exchangeReward, style: { display: "block" }, class: sheet.classes.Button }, "Redeem"),
15176
- index.h("a", { onClick: () => callbacks.setStage(previousStage), style: { display: "block" }, class: sheet.classes.Button }, "Back"))));
15238
+ index.h("a", { onClick: () => callbacks.setStage("chooseAmount"), style: { display: "block" }, class: sheet.classes.Button }, "Back"))));
15177
15239
  }
15178
15240
  function success() {
15179
15241
  return (index.h("div", { style: { textAlign: "center" } },
15180
15242
  index.h("img", { class: sheet.classes.FullImage, src: index.getAssetPath("./assets/Reward-icon.png") }),
15181
15243
  index.h("p", { style: { color: "forestgreen" } }, "Reward Redeemed"),
15182
15244
  (data === null || data === void 0 ? void 0 : data.fuelTankCode) && index.h("pre", null, data === null || data === void 0 ? void 0 : data.fuelTankCode),
15183
- index.h("sl-button", { onClick: () => { var _a, _b; return (_b = (_a = refs.drawerRef) === null || _a === void 0 ? void 0 : _a.current) === null || _b === void 0 ? void 0 : _b.hide(); } }, "Done")));
15245
+ index.h("sl-button", { onClick: () => callbacks.resetState(true) }, "Done")));
15184
15246
  }
15185
15247
  const stages = {
15186
15248
  chooseReward: () => chooseReward(),
@@ -15191,51 +15253,43 @@ function RewardExchangeView(props) {
15191
15253
  const currentStage = stages[states.redeemStage];
15192
15254
  function stageMap() {
15193
15255
  const stageNumber = stageList.indexOf(states.redeemStage);
15194
- return (index.h("div", { style: { fontSize: "80%" } },
15195
- index.h(ProgressBar, { stage: stageNumber }),
15196
- index.h("div", { style: {
15197
- marginTop: "5px",
15198
- display: "flex",
15199
- justifyContent: "center",
15200
- textAlign: "center",
15201
- whiteSpace: "nowrap",
15202
- marginBottom: "10px",
15203
- } }, Object.keys(stageProgressList).map((stage) => {
15204
- if (stage === states.redeemStage)
15205
- return (index.h("b", { style: { flex: "1 1 0" } },
15206
- " ",
15207
- stageProgressList[stage]));
15208
- return index.h("i", { style: { flex: "1 1 0" } }, stageProgressList[stage]);
15209
- }))));
15256
+ return (index.h("div", { class: sheet.classes.ProgressBar },
15257
+ index.h("div", { class: "text-area" }, Object.keys(stageProgressList).map((stage) => {
15258
+ if (stage === states.redeemStage) {
15259
+ return index.h("span", { class: "text" }, stageProgressList[stage]);
15260
+ }
15261
+ else {
15262
+ return (index.h("span", { class: "text subdued" }, stageProgressList[stage]));
15263
+ }
15264
+ })),
15265
+ index.h(ProgressBar, { stageCount: 3, currentStage: stageNumber })));
15210
15266
  }
15211
- const Label = () => {
15212
- if (states.redeemStage === "success")
15213
- return "";
15214
- let previousStage = "";
15215
- if (states.redeemStage === "confirmation") {
15216
- previousStage =
15217
- (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.ruleType) === "FIXED_GLOBAL_REWARD"
15218
- ? "chooseReward"
15219
- : "chooseAmount";
15220
- }
15221
- else if (states.redeemStage === "chooseAmount") {
15222
- previousStage = "chooseReward";
15223
- }
15224
- return (index.h("div", { slot: "label" },
15225
- index.h("a", { style: { cursor: "pointer", fontSize: "80%", color: "#858585" }, onClick: () => callbacks.setStage(previousStage) },
15226
- index.h(LeftArrow, null),
15227
- " Back")));
15228
- };
15267
+ // const BackButton = () => {
15268
+ // if (states.redeemStage === "success") return "";
15269
+ // let previousStage: Stages = "";
15270
+ // if (states.redeemStage === "confirmation") {
15271
+ // previousStage = "chooseAmount";
15272
+ // } else if (states.redeemStage === "chooseAmount") {
15273
+ // previousStage = "chooseReward";
15274
+ // }
15275
+ // return (
15276
+ // <div slot="label">
15277
+ // <a
15278
+ // style={{ cursor: "pointer", fontSize: "80%", color: "#858585" }}
15279
+ // onClick={() => callbacks.setStage(previousStage)}
15280
+ // >
15281
+ // <LeftArrow /> Back
15282
+ // </a>
15283
+ // </div>
15284
+ // );
15285
+ // };
15229
15286
  return (index.h("div", { class: sheet.classes.Container },
15230
15287
  index.h("style", { type: "text/css" }, styleString),
15231
15288
  index.h("div", null,
15232
- index.h("sl-drawer", { ref: (ref) => (refs.drawerRef.current = ref), placement: "right", class: sheet.classes.Drawer, open: stageList.indexOf(states.redeemStage) >= 0 },
15233
- index.h(Label, null),
15234
- stageMap(),
15235
- currentStage && currentStage(),
15236
- states.exchangeError &&
15237
- "Something went wrong. Please contact support or try again."),
15238
- index.h("sl-button", { onClick: () => callbacks.openDrawer() }, "Redeem Rewards"))));
15289
+ stageMap(),
15290
+ currentStage && currentStage(),
15291
+ states.exchangeError &&
15292
+ "Something went wrong. Please contact support or try again.")));
15239
15293
  }
15240
15294
 
15241
15295
  const SqmRewardExchangeList = class {
@@ -15259,10 +15313,10 @@ const SqmRewardExchangeList = class {
15259
15313
  // if (missingProps) {
15260
15314
  // return <RequiredPropsError missingProps={missingProps} />;
15261
15315
  // }
15262
- const { states, data, callbacks, refs } = index_module.j()
15316
+ const { states, data, callbacks } = index_module.j()
15263
15317
  ? useRewardExchangeListDemo(utils.getProps(this))
15264
15318
  : useRewardExchangeList(utils.getProps(this));
15265
- return (index.h(index.Host, { style: { display: "contents" } }, index.h(RewardExchangeView, { states: states, data: data, callbacks: callbacks, refs: refs })));
15319
+ return (index.h(index.Host, { style: { display: "contents" } }, index.h(RewardExchangeView, { states: states, data: data, callbacks: callbacks })));
15266
15320
  }
15267
15321
  static get assetsDirs() { return ["assets"]; }
15268
15322
  };
@@ -15272,162 +15326,498 @@ function useRewardExchangeListDemo(props) {
15272
15326
  content: {
15273
15327
  text: props,
15274
15328
  },
15275
- redeemStage: "",
15329
+ redeemStage: "chooseReward",
15276
15330
  amount: 0,
15277
15331
  selectedStep: undefined,
15278
15332
  exchangeError: false,
15333
+ loading: false,
15279
15334
  },
15280
15335
  data: {
15281
15336
  shareCode: "SHARECODE123",
15282
15337
  },
15283
15338
  callbacks: {
15284
15339
  exchangeReward: () => { },
15285
- openDrawer: () => { },
15286
15340
  setExchangeState: (_) => { },
15287
15341
  setStage: (_) => { },
15288
- },
15289
- refs: {
15290
- drawerRef: {},
15342
+ resetState: () => { }
15291
15343
  },
15292
15344
  }, props.demoData || {}, { arrayMerge: (_, a) => a });
15293
15345
  }
15294
15346
 
15295
- const debug$1 = _extends.browser("sq:useRouter");
15296
- function matchPath(pattern, page) {
15297
- if (!pattern)
15298
- return;
15299
- const regexp = useDemoBigStat.pathToRegexp(pattern);
15300
- return regexp.exec(page);
15301
- }
15302
- function useRouter() {
15303
- const location = index_module.an();
15304
- const host = index_module.P();
15305
- const [slot, setSlot] = _extends.useState(undefined);
15306
- const [container, setContainer] = _extends.useState(undefined);
15307
- const page = location.pathname;
15308
- // convert sqm-routes into templates
15309
- _extends.useEffect(() => {
15310
- const routes = host.querySelectorAll(`sqm-route`);
15311
- const routesArray = Array.from(routes);
15312
- routesArray.forEach((route) => {
15313
- const newTemplate = document.createElement("template");
15314
- newTemplate.setAttribute("path", route.path);
15315
- newTemplate.innerHTML = route.innerHTML;
15316
- route.parentNode.appendChild(newTemplate);
15317
- route.parentNode.removeChild(route);
15318
- });
15319
- }, []);
15320
- _extends.useEffect(() => {
15321
- var _a, _b;
15322
- if (!container || !slot) {
15323
- debug$1("DOM not ready for navigation rendering on:", page);
15324
- return;
15325
- }
15326
- // <template>
15327
- const templates = slot.querySelectorAll(`template`);
15328
- const templatesArray = Array.from(templates);
15329
- const template = templatesArray.find((template) => {
15330
- var _a, _b, _c;
15331
- //@ts-ignore
15332
- const path = (_b = (_a = template.attributes) === null || _a === void 0 ? void 0 : _a.path) === null || _b === void 0 ? void 0 : _b.nodeValue;
15333
- if ((_c = matchPath(path, page)) === null || _c === void 0 ? void 0 : _c.length)
15334
- return template;
15335
- });
15336
- //@ts-ignore - can't access template attributes directly
15337
- const templatePath = (_b = (_a = template === null || template === void 0 ? void 0 : template.attributes) === null || _a === void 0 ? void 0 : _a.path) === null || _b === void 0 ? void 0 : _b.nodeValue;
15338
- debug$1({
15339
- containerDatasetPage: container.dataset.page,
15340
- templatePath,
15341
- page,
15342
- });
15343
- // if no routes found, and the old route doesn't match the new route
15344
- if (!template) {
15345
- // No matching page, display nothing
15346
- debug$1("No matching page found for ", page, ", so render nothing");
15347
- container.innerHTML = "";
15348
- container.dataset.page = page;
15349
- return;
15350
- }
15351
- debug$1("Page updated to ", page, template);
15352
- // if pathToRegexp results truthy or page is an exact match
15353
- if (!!matchPath(templatePath, container.dataset.page)) {
15354
- debug$1("don't rerender");
15355
- // Same page, do not re-render
15356
- // Reduces dom mutations, speeds up page speed
15357
- }
15358
- else if (template) {
15359
- container.innerHTML = template.innerHTML;
15360
- container.dataset.page = page;
15361
- }
15362
- }, [slot, container, page]);
15363
- return {
15364
- callbacks: {
15365
- setSlot,
15366
- setContainer,
15367
- },
15368
- };
15369
- }
15370
-
15371
- const sqmRouterCss = "sqm-router{display:contents}";
15372
-
15373
- const SqmRouter = class {
15374
- constructor(hostRef) {
15375
- index.registerInstance(this, hostRef);
15376
- this.ignored = true;
15377
- _extends.h$1(this);
15378
- }
15379
- disconnectedCallback() { }
15380
- render() {
15381
- const { callbacks } = useRouter();
15382
- return (index.h(index.Host, null, index.h("div", { ref: callbacks.setSlot, style: { display: "none" } }, index.h("slot", null)), index.h("div", { style: { display: "contents" }, ref: callbacks.setContainer })));
15383
- }
15384
- };
15385
- SqmRouter.style = sqmRouterCss;
15386
-
15387
15347
  const style$7 = {
15388
- HostBlock: mixins.HostBlock,
15389
- buttonStyle: {
15390
- display: "block",
15348
+ THead: {
15349
+ padding: "var(--sl-spacing-small) var(--sl-spacing-medium) var(--sl-spacing-small) 0",
15350
+ "text-align": "left",
15351
+ },
15352
+ TCell: {
15353
+ padding: "var(--sl-spacing-small) var(--sl-spacing-medium) var(--sl-spacing-small) 0",
15354
+ },
15355
+ TRow: {
15356
+ "border-top": "1px solid #EAEAEA",
15357
+ },
15358
+ Table: {
15359
+ "border-collapse": "collapse",
15360
+ width: "100%",
15361
+ },
15362
+ ButtonContainer: {
15363
+ display: "flex",
15364
+ "justify-content": "flex-end",
15365
+ "margin-top": "var(--sl-spacing-small)",
15366
+ ...mixins.gap({ direction: "row", size: "var(--sl-spacing-small)" }),
15391
15367
  },
15392
15368
  };
15393
15369
  jssPresetDefault_esm.jss.setup(jssPresetDefault_esm.create());
15394
15370
  const sheet$7 = jssPresetDefault_esm.jss.createStyleSheet(style$7);
15395
15371
  const styleString$7 = sheet$7.toString();
15396
- function ShareButtonView(props, children) {
15397
- return props.hide ? (index.h(index.Host, { style: { display: "none" } })) : (index.h("div", null,
15372
+ function GenericTableView(props) {
15373
+ const { states, data, callbacks, elements } = props;
15374
+ const { columns, rows } = elements;
15375
+ const { show } = states;
15376
+ return (index.h("div", null,
15398
15377
  index.h("style", { type: "text/css" }, styleString$7),
15399
- index.h("sl-button", { class: sheet$7.classes.buttonStyle, loading: props.loading, disabled: props.disabled, pill: props.pill, size: props.size, type: props.type, onClick: props.onClick, exportparts: `base: ${props.type}sharebutton-base` },
15400
- !props.hideicon && (index.h("sl-icon", { slot: props.iconslot, name: props.icon ? props.icon : props.medium, exportparts: "icon" })),
15401
- !props.hidetext && children)));
15378
+ index.h("table", { class: sheet$7.classes.Table },
15379
+ data.textOverrides.showLabels && (index.h("thead", null,
15380
+ index.h("tr", null, columns === null || columns === void 0 ? void 0 : columns.map((column) => (index.h("th", { class: sheet$7.classes.THead },
15381
+ index.h(sqmTextSpanView.TextSpanView, { type: "h3" }, column))))))),
15382
+ index.h("tbody", null,
15383
+ show === "loading" && elements.loadingElement,
15384
+ show === "empty" && elements.emptyElement,
15385
+ show === "rows" && (rows === null || rows === void 0 ? void 0 : rows.map((row, i) => (index.h("tr", { class: sheet$7.classes.TRow, style: {
15386
+ borderTop: `${!data.textOverrides.showLabels && i === 0 ? "none" : ""}`,
15387
+ }, part: "table-row" }, row.map((cell) => (index.h("td", { class: sheet$7.classes.TCell },
15388
+ index.h(sqmTextSpanView.TextSpanView, { type: "p" }, cell)))))))))),
15389
+ index.h("div", { class: sheet$7.classes.ButtonContainer, part: states.namespace + "-button-wrapper" },
15390
+ index.h("sl-button", { size: "small", disabled: !states.hasPrev, loading: show === "loading", onClick: callbacks.prevPage, exportparts: "base: defaultbutton-base" }, data.textOverrides.prevLabel),
15391
+ index.h("sl-button", { size: "small", loading: show === "loading", disabled: !states.hasNext, onClick: callbacks.nextPage, exportparts: "base: defaultbutton-base" }, data.textOverrides.moreLabel))));
15392
+ }
15393
+
15394
+ function LoadingSlot$1() {
15395
+ return (index.h("slot", { name: "loading" },
15396
+ index.h(LoadingSkeleton, null)));
15397
+ }
15398
+ function LoadingSkeleton() {
15399
+ return (index.h("div", { style: { width: "100%" } },
15400
+ index.h("sl-skeleton", { style: { marginBottom: "28px" } }),
15401
+ index.h("sl-skeleton", { style: { marginBottom: "28px" } }),
15402
+ index.h("sl-skeleton", { style: { marginBottom: "28px" } }),
15403
+ index.h("sl-skeleton", { style: { marginBottom: "28px" } }),
15404
+ index.h("sl-skeleton", null)));
15405
+ }
15406
+ function EmptySlot$1({ label }) {
15407
+ return (index.h("slot", { name: "empty" },
15408
+ index.h(EmptySkeleton, { label: label })));
15409
+ }
15410
+ function EmptySkeleton({ label }) {
15411
+ return (index.h("div", { style: { width: "100%" } },
15412
+ index.h("sqm-text", null,
15413
+ index.h("h3", { style: { color: "#777777" } }, label))));
15402
15414
  }
15403
15415
 
15404
- const MessageLinkQuery = index$1.gql `
15405
- query (
15406
- $programId: ID
15407
- $engagementMedium: UserEngagementMedium!
15408
- $shareMedium: ReferralShareMedium!
15416
+ const CSS_NAMESPACE = "sqm-rewards-table";
15417
+ const GET_REWARDS = sqmLeaderboardRankView.gql `
15418
+ query getRewards(
15419
+ $limit: Int!
15420
+ $offset: Int!
15421
+ $rewardFilter: RewardFilterInput
15409
15422
  ) {
15410
15423
  viewer {
15411
15424
  ... on User {
15412
- messageLink(
15413
- programId: $programId
15414
- engagementMedium: $engagementMedium
15415
- shareMedium: $shareMedium
15416
- )
15417
- shareLink(programId: $programId, engagementMedium: $engagementMedium)
15418
- }
15419
- }
15420
- }
15421
- `;
15422
- function NativeShare(props, directLink) {
15423
- const title = props.sharetitle || "Share title";
15424
- const text = props.sharetext || "Share text";
15425
- if (directLink === "undefined") {
15426
- return alert("error: message link undefined!");
15427
- }
15428
- if (window.navigator.share) {
15429
- window.navigator
15430
- .share({
15425
+ id
15426
+ rewards(limit: $limit, offset: $offset, filter: $rewardFilter) {
15427
+ totalCount
15428
+ count
15429
+ data {
15430
+ id
15431
+ type
15432
+ value
15433
+ unit
15434
+ name
15435
+ dateGiven
15436
+ dateExpires
15437
+ dateCancelled
15438
+ dateRedeemed
15439
+ dateScheduledFor
15440
+ fuelTankCode
15441
+ fuelTankType
15442
+ currency
15443
+ prettyValue
15444
+ statuses
15445
+ globalRewardKey
15446
+ programRewardKey
15447
+ rewardRedemptionTransactions {
15448
+ data {
15449
+ exchangedRewards {
15450
+ data {
15451
+ prettyValue
15452
+ type
15453
+ fuelTankCode
15454
+ globalRewardKey
15455
+ }
15456
+ }
15457
+ }
15458
+ }
15459
+ }
15460
+ }
15461
+ }
15462
+ }
15463
+ }
15464
+ `;
15465
+ function useRewardsTable(props, emptyElement, loadingElement) {
15466
+ var _a, _b;
15467
+ const user = index_module.T();
15468
+ const programIdContext = index_module.M();
15469
+ // Default to context, overriden by props
15470
+ const programId = (_a = props.programId) !== null && _a !== void 0 ? _a : programIdContext;
15471
+ const rewardFilter = {
15472
+ userId_eq: user === null || user === void 0 ? void 0 : user.id,
15473
+ accountId_eq: user === null || user === void 0 ? void 0 : user.accountId,
15474
+ // If no program ID, shows all programs
15475
+ ...(programId
15476
+ ? programId === "classic"
15477
+ ? { programId_exists: false }
15478
+ : { programId_eq: programId }
15479
+ : {}),
15480
+ };
15481
+ const [content, setContent] = _extends.useReducer((state, next) => ({
15482
+ ...state,
15483
+ ...next,
15484
+ }), {
15485
+ columns: [],
15486
+ rows: [],
15487
+ loading: false,
15488
+ page: 0,
15489
+ });
15490
+ const { envelope: rewardsData, states, callbacks, } = index_module.sn(GET_REWARDS, (data) => { var _a; return (_a = data === null || data === void 0 ? void 0 : data.viewer) === null || _a === void 0 ? void 0 : _a.rewards; }, {
15491
+ limit: props.perPage,
15492
+ offset: 0,
15493
+ }, {
15494
+ rewardFilter,
15495
+ }, !(user === null || user === void 0 ? void 0 : user.jwt));
15496
+ const tick = reRender.useRerenderListener();
15497
+ const components = useChildElements();
15498
+ const data = rewardsData === null || rewardsData === void 0 ? void 0 : rewardsData.data;
15499
+ async function getComponentData(components) {
15500
+ // filter out loading and empty states from columns array
15501
+ const columnComponents = components.filter((component) => component.slot !== "loading" && component.slot !== "empty");
15502
+ // get the column titles (renderLabel is asynchronous)
15503
+ const columnsPromise = columnComponents === null || columnComponents === void 0 ? void 0 : columnComponents.map(async (c) => tryMethod$1(c, () => c.renderLabel()));
15504
+ // get the column cells (renderCell is asynchronous)
15505
+ const cellsPromise = data === null || data === void 0 ? void 0 : data.map(async (r) => {
15506
+ const cellPromise = columnComponents === null || columnComponents === void 0 ? void 0 : columnComponents.map(async (c) => tryMethod$1(c, () => c.renderCell([r], c)));
15507
+ const cells = await Promise.all(cellPromise);
15508
+ return cells;
15509
+ });
15510
+ const rows = cellsPromise && (await Promise.all(cellsPromise)).filter((i) => i);
15511
+ setContent({ rows });
15512
+ const columns = columnsPromise && (await Promise.all(columnsPromise));
15513
+ // Set the content to render and finish loading components
15514
+ setContent({ columns, loading: false, page: states.currentPage });
15515
+ }
15516
+ _extends.useEffect(() => {
15517
+ setContent({ loading: true });
15518
+ rewardsData && getComponentData(components);
15519
+ }, [rewardsData, components, tick]);
15520
+ const isEmpty = !((_b = content === null || content === void 0 ? void 0 : content.rows) === null || _b === void 0 ? void 0 : _b.length) && !(data === null || data === void 0 ? void 0 : data.length);
15521
+ console.log(states.loading, content.loading, rewardsData);
15522
+ const show =
15523
+ // 1 - Loading if loading
15524
+ states.loading || content.loading
15525
+ ? "loading"
15526
+ : // 2 - Empty if empty
15527
+ isEmpty
15528
+ ? "empty"
15529
+ : // 3 - Then show rows
15530
+ "rows";
15531
+ return {
15532
+ states: {
15533
+ hasNext: states.currentPage < states.pageCount - 1,
15534
+ hasPrev: states.currentPage > 0,
15535
+ show,
15536
+ namespace: CSS_NAMESPACE,
15537
+ },
15538
+ data: {
15539
+ textOverrides: {
15540
+ showLabels: props.showLabels,
15541
+ prevLabel: props.prevLabel,
15542
+ moreLabel: props.moreLabel,
15543
+ },
15544
+ },
15545
+ elements: {
15546
+ columns: content.columns,
15547
+ rows: content.rows,
15548
+ emptyElement,
15549
+ loadingElement,
15550
+ },
15551
+ callbacks: {
15552
+ nextPage: () => {
15553
+ callbacks.setCurrentPage(states.currentPage + 1);
15554
+ },
15555
+ prevPage: () => {
15556
+ callbacks.setCurrentPage(states.currentPage - 1);
15557
+ },
15558
+ },
15559
+ };
15560
+ }
15561
+ function generateUserError$1(e) {
15562
+ try {
15563
+ return JSON.stringify(e);
15564
+ }
15565
+ catch (e) {
15566
+ return "An unknown error";
15567
+ }
15568
+ }
15569
+ async function tryMethod$1(c, callback) {
15570
+ const tag = c.tagName.toLowerCase();
15571
+ await customElements.whenDefined(tag);
15572
+ let labelPromise;
15573
+ try {
15574
+ labelPromise = callback();
15575
+ }
15576
+ catch (e) {
15577
+ // renderLabel did not return a promise, so this method probably doesn't exist
15578
+ // therefore, we IGNORE the label
15579
+ if (callback.name === "renderReferrerCell") {
15580
+ console.error("column does not have a renderReferrerCell method.");
15581
+ }
15582
+ else {
15583
+ console.error("label promise failed", e);
15584
+ }
15585
+ return index.h("span", null);
15586
+ }
15587
+ try {
15588
+ return await labelPromise;
15589
+ }
15590
+ catch (e) {
15591
+ // The column returned a promise, and that promise failed.
15592
+ // This should not happen so we fail fast
15593
+ console.error("Error rendering label", e);
15594
+ const userError = generateUserError$1(e);
15595
+ return (index.h("details", null,
15596
+ index.h("summary", null, "Error"),
15597
+ userError));
15598
+ }
15599
+ }
15600
+
15601
+ const RewardsTable = class {
15602
+ constructor(hostRef) {
15603
+ index.registerInstance(this, hostRef);
15604
+ /** @uiName Number of rewards per page */
15605
+ this.perPage = 3;
15606
+ /** @uiName Show column labels */
15607
+ this.showLabels = true;
15608
+ /** @uiName Previous button text */
15609
+ this.prevLabel = "Prev";
15610
+ /** @uiName View More button text */
15611
+ this.moreLabel = "Next";
15612
+ /** @uiName Show Referred by user in table */
15613
+ this.showReferrer = false;
15614
+ _extends.h$1(this);
15615
+ }
15616
+ disconnectedCallback() { }
15617
+ render() {
15618
+ const empty = index.h(EmptySlot$1, { label: "No Rewards Yet" });
15619
+ const loading = index.h(LoadingSlot$1, null);
15620
+ const { states, data, callbacks, elements } = index_module.j()
15621
+ ? useRewardsTableDemo(this)
15622
+ : useRewardsTable(this, empty, loading);
15623
+ return (index.h(GenericTableView, { states: states, data: data, callbacks: callbacks, elements: elements }));
15624
+ }
15625
+ };
15626
+ function useRewardsTableDemo(props) {
15627
+ return cjs.cjs({
15628
+ states: {
15629
+ hasPrev: false,
15630
+ hasNext: false,
15631
+ loading: false,
15632
+ namespace: CSS_NAMESPACE,
15633
+ },
15634
+ callbacks: {
15635
+ prevPage: () => console.log("Prev"),
15636
+ nextPage: () => console.log("Next"),
15637
+ },
15638
+ data: {
15639
+ textOverrides: {
15640
+ showLabels: props.showLabels,
15641
+ prevLabel: props.prevLabel,
15642
+ moreLabel: props.moreLabel,
15643
+ },
15644
+ referralData: [],
15645
+ },
15646
+ elements: {
15647
+ emptyElement: index.h(EmptySkeleton, { label: "No Rewards Yet" }),
15648
+ loadingElement: index.h(LoadingSkeleton, null),
15649
+ // TODO: This should be smarter
15650
+ columns: [index.h("div", null, "Name"), index.h("div", null, "Email"), index.h("div", null, "DOB")],
15651
+ rows: [],
15652
+ },
15653
+ }, props.demoData || {}, { arrayMerge: (_, a) => a });
15654
+ }
15655
+
15656
+ const RewardsTableColumn = class {
15657
+ constructor(hostRef) {
15658
+ index.registerInstance(this, hostRef);
15659
+ /**
15660
+ * @uiName Reward column title
15661
+ */
15662
+ this.columnTitle = "Rewards";
15663
+ /**
15664
+ * @uiName Hide dropdown details of reward
15665
+ */
15666
+ this.hideDetails = false;
15667
+ _extends.h$1(this);
15668
+ }
15669
+ disconnectedCallback() { }
15670
+ //@ts-ignore
15671
+ async renderCell(data) {
15672
+ // TODO: Do the right thing with many rewards, pending rewards, canceled rewards
15673
+ console.log({ data });
15674
+ return (index.h("sqm-referral-table-rewards-cell", { rewards: data, hideDetails: this.hideDetails }));
15675
+ }
15676
+ async renderLabel() {
15677
+ return this.columnTitle;
15678
+ }
15679
+ render() {
15680
+ reRender.useRequestRerender([this.columnTitle]);
15681
+ return index.h(index.Host, { style: { display: "none" } });
15682
+ }
15683
+ };
15684
+
15685
+ const debug$1 = _extends.browser("sq:useRouter");
15686
+ function matchPath(pattern, page) {
15687
+ if (!pattern)
15688
+ return;
15689
+ const regexp = useDemoBigStat.pathToRegexp(pattern);
15690
+ return regexp.exec(page);
15691
+ }
15692
+ function useRouter() {
15693
+ const location = index_module.an();
15694
+ const host = index_module.P();
15695
+ const [slot, setSlot] = _extends.useState(undefined);
15696
+ const [container, setContainer] = _extends.useState(undefined);
15697
+ const page = location.pathname;
15698
+ // convert sqm-routes into templates
15699
+ _extends.useEffect(() => {
15700
+ const routes = host.querySelectorAll(`sqm-route`);
15701
+ const routesArray = Array.from(routes);
15702
+ routesArray.forEach((route) => {
15703
+ const newTemplate = document.createElement("template");
15704
+ newTemplate.setAttribute("path", route.path);
15705
+ newTemplate.innerHTML = route.innerHTML;
15706
+ route.parentNode.appendChild(newTemplate);
15707
+ route.parentNode.removeChild(route);
15708
+ });
15709
+ }, []);
15710
+ _extends.useEffect(() => {
15711
+ var _a, _b;
15712
+ if (!container || !slot) {
15713
+ debug$1("DOM not ready for navigation rendering on:", page);
15714
+ return;
15715
+ }
15716
+ // <template>
15717
+ const templates = slot.querySelectorAll(`template`);
15718
+ const templatesArray = Array.from(templates);
15719
+ const template = templatesArray.find((template) => {
15720
+ var _a, _b, _c;
15721
+ //@ts-ignore
15722
+ const path = (_b = (_a = template.attributes) === null || _a === void 0 ? void 0 : _a.path) === null || _b === void 0 ? void 0 : _b.nodeValue;
15723
+ if ((_c = matchPath(path, page)) === null || _c === void 0 ? void 0 : _c.length)
15724
+ return template;
15725
+ });
15726
+ //@ts-ignore - can't access template attributes directly
15727
+ const templatePath = (_b = (_a = template === null || template === void 0 ? void 0 : template.attributes) === null || _a === void 0 ? void 0 : _a.path) === null || _b === void 0 ? void 0 : _b.nodeValue;
15728
+ debug$1({
15729
+ containerDatasetPage: container.dataset.page,
15730
+ templatePath,
15731
+ page,
15732
+ });
15733
+ // if no routes found, and the old route doesn't match the new route
15734
+ if (!template) {
15735
+ // No matching page, display nothing
15736
+ debug$1("No matching page found for ", page, ", so render nothing");
15737
+ container.innerHTML = "";
15738
+ container.dataset.page = page;
15739
+ return;
15740
+ }
15741
+ debug$1("Page updated to ", page, template);
15742
+ // if pathToRegexp results truthy or page is an exact match
15743
+ if (!!matchPath(templatePath, container.dataset.page)) {
15744
+ debug$1("don't rerender");
15745
+ // Same page, do not re-render
15746
+ // Reduces dom mutations, speeds up page speed
15747
+ }
15748
+ else if (template) {
15749
+ container.innerHTML = template.innerHTML;
15750
+ container.dataset.page = page;
15751
+ }
15752
+ }, [slot, container, page]);
15753
+ return {
15754
+ callbacks: {
15755
+ setSlot,
15756
+ setContainer,
15757
+ },
15758
+ };
15759
+ }
15760
+
15761
+ const sqmRouterCss = "sqm-router{display:contents}";
15762
+
15763
+ const SqmRouter = class {
15764
+ constructor(hostRef) {
15765
+ index.registerInstance(this, hostRef);
15766
+ this.ignored = true;
15767
+ _extends.h$1(this);
15768
+ }
15769
+ disconnectedCallback() { }
15770
+ render() {
15771
+ const { callbacks } = useRouter();
15772
+ return (index.h(index.Host, null, index.h("div", { ref: callbacks.setSlot, style: { display: "none" } }, index.h("slot", null)), index.h("div", { style: { display: "contents" }, ref: callbacks.setContainer })));
15773
+ }
15774
+ };
15775
+ SqmRouter.style = sqmRouterCss;
15776
+
15777
+ const style$8 = {
15778
+ HostBlock: mixins.HostBlock,
15779
+ buttonStyle: {
15780
+ display: "block",
15781
+ },
15782
+ };
15783
+ jssPresetDefault_esm.jss.setup(jssPresetDefault_esm.create());
15784
+ const sheet$8 = jssPresetDefault_esm.jss.createStyleSheet(style$8);
15785
+ const styleString$8 = sheet$8.toString();
15786
+ function ShareButtonView(props, children) {
15787
+ return props.hide ? (index.h(index.Host, { style: { display: "none" } })) : (index.h("div", null,
15788
+ index.h("style", { type: "text/css" }, styleString$8),
15789
+ index.h("sl-button", { class: sheet$8.classes.buttonStyle, loading: props.loading, disabled: props.disabled, pill: props.pill, size: props.size, type: props.type, onClick: props.onClick, exportparts: `base: ${props.type}sharebutton-base` },
15790
+ !props.hideicon && (index.h("sl-icon", { slot: props.iconslot, name: props.icon ? props.icon : props.medium, exportparts: "icon" })),
15791
+ !props.hidetext && children)));
15792
+ }
15793
+
15794
+ const MessageLinkQuery = sqmLeaderboardRankView.gql `
15795
+ query (
15796
+ $programId: ID
15797
+ $engagementMedium: UserEngagementMedium!
15798
+ $shareMedium: ReferralShareMedium!
15799
+ ) {
15800
+ viewer {
15801
+ ... on User {
15802
+ messageLink(
15803
+ programId: $programId
15804
+ engagementMedium: $engagementMedium
15805
+ shareMedium: $shareMedium
15806
+ )
15807
+ shareLink(programId: $programId, engagementMedium: $engagementMedium)
15808
+ }
15809
+ }
15810
+ }
15811
+ `;
15812
+ function NativeShare(props, directLink) {
15813
+ const title = props.sharetitle || "Share title";
15814
+ const text = props.sharetext || "Share text";
15815
+ if (directLink === "undefined") {
15816
+ return alert("error: message link undefined!");
15817
+ }
15818
+ if (window.navigator.share) {
15819
+ window.navigator
15820
+ .share({
15431
15821
  title,
15432
15822
  text,
15433
15823
  url: directLink,
@@ -17134,11 +17524,12 @@ const BigStat_stories = {
17134
17524
  title: "Components/Big Stat",
17135
17525
  };
17136
17526
  const Default$1 = () => {
17137
- const props = { statvalue: "9.900,00" };
17527
+ const props = { value: 990000, statvalue: "9.900,00" };
17138
17528
  return index.h(useDemoBigStat.BigStatView, Object.assign({}, props), "Big stat");
17139
17529
  };
17140
17530
  const LeftAlign = () => {
17141
17531
  const props = {
17532
+ value: 500,
17142
17533
  statvalue: "500",
17143
17534
  alignment: "left",
17144
17535
  };
@@ -17146,6 +17537,7 @@ const LeftAlign = () => {
17146
17537
  };
17147
17538
  const RightAlign = () => {
17148
17539
  const props = {
17540
+ value: 500,
17149
17541
  statvalue: "500",
17150
17542
  alignment: "right",
17151
17543
  };
@@ -17153,6 +17545,7 @@ const RightAlign = () => {
17153
17545
  };
17154
17546
  const FlexReverse = () => {
17155
17547
  const props = {
17548
+ value: 500,
17156
17549
  statvalue: "500",
17157
17550
  flexReverse: true,
17158
17551
  };
@@ -17160,6 +17553,7 @@ const FlexReverse = () => {
17160
17553
  };
17161
17554
  const FlexReverseRight = () => {
17162
17555
  const props = {
17556
+ value: 500,
17163
17557
  statvalue: "500",
17164
17558
  flexReverse: true,
17165
17559
  alignment: "right",
@@ -17168,6 +17562,7 @@ const FlexReverseRight = () => {
17168
17562
  };
17169
17563
  const FlexReverseLeft = () => {
17170
17564
  const props = {
17565
+ value: 500,
17171
17566
  statvalue: "500",
17172
17567
  flexReverse: true,
17173
17568
  alignment: "left",
@@ -17176,12 +17571,14 @@ const FlexReverseLeft = () => {
17176
17571
  };
17177
17572
  const NoStatValue = () => {
17178
17573
  const props = {
17574
+ value: 0,
17179
17575
  statvalue: "...",
17180
17576
  };
17181
17577
  return index.h(useDemoBigStat.BigStatView, Object.assign({}, props), "Big stat");
17182
17578
  };
17183
17579
  const InvalidStatValue = () => {
17184
17580
  const props = {
17581
+ value: 0,
17185
17582
  statvalue: "!!!",
17186
17583
  };
17187
17584
  return index.h(useDemoBigStat.BigStatView, Object.assign({}, props), "Big stat");
@@ -17907,6 +18304,9 @@ const RewardBalanceCashUSD = createHookStory(() => {
17907
18304
  const ProgramGoals = createHookStory(() => {
17908
18305
  const dummy = encodeURIComponent("Paid-Member-Goal/referrals");
17909
18306
  return View(`/programGoals/count/${dummy}`, "/(programGoals)/:metricType/:goalId");
18307
+ });
18308
+ const CustomField = createHookStory(() => {
18309
+ return View(`/customFields/thingCount`, "/(customFields)/:customField");
17910
18310
  });
17911
18311
 
17912
18312
  const UseBigStat = /*#__PURE__*/Object.freeze({
@@ -17938,7 +18338,8 @@ const UseBigStat = /*#__PURE__*/Object.freeze({
17938
18338
  RewardsAvailableWithSlash: RewardsAvailableWithSlash,
17939
18339
  RewardBalance: RewardBalance,
17940
18340
  RewardBalanceCashUSD: RewardBalanceCashUSD,
17941
- ProgramGoals: ProgramGoals
18341
+ ProgramGoals: ProgramGoals,
18342
+ CustomField: CustomField
17942
18343
  });
17943
18344
 
17944
18345
  function setupGraphQL$4() {
@@ -18245,18 +18646,100 @@ const UseRewardExchangeList = /*#__PURE__*/Object.freeze({
18245
18646
  VariableCreditReward: VariableCreditReward
18246
18647
  });
18247
18648
 
18649
+ const UseRewardsTable_stories = {
18650
+ title: "Hooks / useRewardsTable",
18651
+ };
18652
+ function setupGraphQL$7() {
18653
+ const id = "testestest";
18654
+ const accountId = id;
18655
+ //@ts-ignore
18656
+ window.widgetIdent = {
18657
+ tenantAlias: "test_a8b41jotf8a1v",
18658
+ appDomain: "https://staging.referralsaasquatch.com",
18659
+ };
18660
+ _extends.useEffect(() => {
18661
+ index_module.L({
18662
+ accountId,
18663
+ id,
18664
+ jwt: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjp7ImFjY291bnRJZCI6InRlc3Rlc3Rlc3QiLCJpZCI6InRlc3Rlc3Rlc3QifX0.qYnU5hNeIj9C_G3NogfG7btgCPGZC7JRXY0MG6a63zs",
18665
+ });
18666
+ return () => {
18667
+ window.widgetIdent = undefined;
18668
+ index_module.L(undefined);
18669
+ };
18670
+ }, []);
18671
+ return { id, accountId };
18672
+ }
18673
+ const RewardsTableWithProgram = createHookStory(() => {
18674
+ setupGraphQL$7();
18675
+ index_module.A("sam-partner-test-2");
18676
+ return (index.h("sqm-rewards-table", null,
18677
+ index.h("sqm-rewards-table-column", null)));
18678
+ });
18679
+ const RewardsTableNoProgram = createHookStory(() => {
18680
+ setupGraphQL$7();
18681
+ index_module.A(undefined);
18682
+ return (index.h("sqm-rewards-table", null,
18683
+ index.h("sqm-rewards-table-column", null)));
18684
+ });
18685
+
18686
+ const UseRewardsTable = /*#__PURE__*/Object.freeze({
18687
+ __proto__: null,
18688
+ 'default': UseRewardsTable_stories,
18689
+ RewardsTableWithProgram: RewardsTableWithProgram,
18690
+ RewardsTableNoProgram: RewardsTableNoProgram
18691
+ });
18692
+
18693
+ const JWT = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjp7ImlkIjoic2FtK2tsaXBAc2Fhc3F1YXQuY2giLCJhY2NvdW50SWQiOiJzYW0ra2xpcEBzYWFzcXVhdC5jaCJ9fQ.FMNZ6oajyr6SiCcRqKKdyPqvNTvWROQ60MKAyfvWGfc";
18694
+ const UseTaskCard_stories = {
18695
+ title: "Hooks / useTaskCard",
18696
+ };
18697
+ function setupGraphQL$8() {
18698
+ const id = "sam+klip@saasquat.ch";
18699
+ const accountId = id;
18700
+ const programId = "klip-referral-program";
18701
+ //@ts-ignore
18702
+ window.widgetIdent = {
18703
+ tenantAlias: "test_a74miwdpofztj",
18704
+ appDomain: "https://staging.referralsaasquatch.com",
18705
+ programId,
18706
+ };
18707
+ _extends.useEffect(() => {
18708
+ index_module.L({
18709
+ accountId,
18710
+ id,
18711
+ jwt: JWT,
18712
+ });
18713
+ return () => {
18714
+ window.widgetIdent = undefined;
18715
+ index_module.L(undefined);
18716
+ };
18717
+ }, []);
18718
+ return { id, accountId };
18719
+ }
18720
+ const TaskCard = createHookStory(() => {
18721
+ setupGraphQL$8();
18722
+ return (index.h("sqm-task-card", { "card-title": "Comment on 5 articles", "button-text": "Start reading", goal: 5, steps: true, "show-progress-bar": true }));
18723
+ });
18724
+
18725
+ const UseTaskCard = /*#__PURE__*/Object.freeze({
18726
+ __proto__: null,
18727
+ 'default': UseTaskCard_stories,
18728
+ TaskCard: TaskCard
18729
+ });
18730
+
18248
18731
  const NewPortal_stories = {
18249
18732
  title: "New Portal",
18250
18733
  };
18251
- const style$8 = {
18734
+ const style$9 = {
18252
18735
  HeaderSubtitleBold: {
18253
18736
  "font-weight": 500,
18254
18737
  "text-decoration": "underline",
18255
18738
  },
18256
18739
  };
18257
18740
  jssPresetDefault_esm.jss.setup(jssPresetDefault_esm.create());
18258
- const sheet$8 = jssPresetDefault_esm.jss.createStyleSheet(style$8);
18259
- const styleString$8 = sheet$8.toString();
18741
+ const sheet$9 = jssPresetDefault_esm.jss.createStyleSheet(style$9);
18742
+ const styleString$9 = sheet$9.toString();
18260
18743
  const barProps = {
18261
18744
  data: {
18262
18745
  programs: [
@@ -18351,7 +18834,7 @@ const Dashboard = () => {
18351
18834
  hide: false,
18352
18835
  };
18353
18836
  return (index.h("sqm-divided-layout", { direction: "row" },
18354
- index.h("style", { type: "text/css" }, styleString$8),
18837
+ index.h("style", { type: "text/css" }, styleString$9),
18355
18838
  index.h(Sidebar, null),
18356
18839
  index.h("sqm-divided-layout", { direction: "column" },
18357
18840
  index.h(sqmPortalContainerView.PortalContainerView, Object.assign({}, { direction: "column", padding: "xxx-large", gap: "xxx-large" }),
@@ -18364,10 +18847,10 @@ const Dashboard = () => {
18364
18847
  index.h("h1", null, "John Smith"))),
18365
18848
  })),
18366
18849
  index.h(sqmStatContainerView.StatContainerView, Object.assign({}, { space: "64px" }),
18367
- index.h(useDemoBigStat.BigStatView, Object.assign({}, { statvalue: "2,345" }), "Clicks"),
18368
- index.h(useDemoBigStat.BigStatView, Object.assign({}, { statvalue: "58" }), "Referrals"),
18369
- index.h(useDemoBigStat.BigStatView, Object.assign({}, { statvalue: "$10,540" }), "Earned"),
18370
- index.h(useDemoBigStat.BigStatView, Object.assign({}, { statvalue: "$2,305" }), "Awaiting Payout"))),
18850
+ index.h(useDemoBigStat.BigStatView, Object.assign({}, { statvalue: "2,345", value: 234500 }), "Clicks"),
18851
+ index.h(useDemoBigStat.BigStatView, Object.assign({}, { statvalue: "58", value: 58 }), "Referrals"),
18852
+ index.h(useDemoBigStat.BigStatView, Object.assign({}, { statvalue: "$10,540", value: 1054000 }), "Earned"),
18853
+ index.h(useDemoBigStat.BigStatView, Object.assign({}, { statvalue: "$2,305", value: 230500 }), "Awaiting Payout"))),
18371
18854
  index.h(sqmPortalContainerView.PortalContainerView, Object.assign({}, { direction: "column", padding: "xxx-large", gap: "xxx-large" }),
18372
18855
  index.h(sqmPortalSectionView.PortalSectionView, Object.assign({}, {
18373
18856
  labelMargin: "x-large",
@@ -18409,7 +18892,7 @@ const Dashboard = () => {
18409
18892
  };
18410
18893
  const EditProfile$2 = () => {
18411
18894
  return (index.h("sqm-divided-layout", { direction: "row" },
18412
- index.h("style", { type: "text/css" }, styleString$8),
18895
+ index.h("style", { type: "text/css" }, styleString$9),
18413
18896
  index.h(Sidebar, null),
18414
18897
  index.h("sqm-divided-layout", { direction: "column" },
18415
18898
  index.h(sqmPortalProfileView.PortalProfileView, Object.assign({}, {
@@ -18473,7 +18956,7 @@ const EditProfile$2 = () => {
18473
18956
  };
18474
18957
  const Commissions = () => {
18475
18958
  return (index.h("sqm-divided-layout", { direction: "row" },
18476
- index.h("style", { type: "text/css" }, styleString$8),
18959
+ index.h("style", { type: "text/css" }, styleString$9),
18477
18960
  index.h(Sidebar, null),
18478
18961
  index.h("sqm-divided-layout", { direction: "column" },
18479
18962
  index.h(sqmPortalContainerView.PortalContainerView, Object.assign({}, { direction: "column", padding: "xxx-large", gap: "xxx-large" }),
@@ -18486,19 +18969,19 @@ const Commissions = () => {
18486
18969
  index.h("p", null,
18487
18970
  "for the",
18488
18971
  " ",
18489
- index.h("span", { class: sheet$8.classes.HeaderSubtitleBold }, "Partner Program #1"),
18972
+ index.h("span", { class: sheet$9.classes.HeaderSubtitleBold }, "Partner Program #1"),
18490
18973
  " ",
18491
18974
  "program"))),
18492
18975
  })),
18493
18976
  index.h(sqmStatContainerView.StatContainerView, Object.assign({}, { space: "64px" }),
18494
- index.h(useDemoBigStat.BigStatView, Object.assign({}, { statvalue: "$ 1,000" }), "Total Earned"),
18495
- index.h(useDemoBigStat.BigStatView, Object.assign({}, { statvalue: "$ 800" }), "Available"),
18496
- index.h(useDemoBigStat.BigStatView, Object.assign({}, { statvalue: "$ 180" }), "Pending"),
18497
- index.h(useDemoBigStat.BigStatView, Object.assign({}, { statvalue: "$ 20" }), "Redeemed"))))));
18977
+ index.h(useDemoBigStat.BigStatView, Object.assign({}, { statvalue: "$ 1,000", value: 100000 }), "Total Earned"),
18978
+ index.h(useDemoBigStat.BigStatView, Object.assign({}, { statvalue: "$ 800", value: 80000 }), "Available"),
18979
+ index.h(useDemoBigStat.BigStatView, Object.assign({}, { statvalue: "$ 180", value: 18000 }), "Pending"),
18980
+ index.h(useDemoBigStat.BigStatView, Object.assign({}, { statvalue: "$ 20", value: 2000 }), "Redeemed"))))));
18498
18981
  };
18499
18982
  const Activity = () => {
18500
18983
  return (index.h("sqm-divided-layout", { direction: "row" },
18501
- index.h("style", { type: "text/css" }, styleString$8),
18984
+ index.h("style", { type: "text/css" }, styleString$9),
18502
18985
  index.h(Sidebar, null),
18503
18986
  index.h("sqm-divided-layout", { direction: "column" },
18504
18987
  index.h(sqmPortalContainerView.PortalContainerView, Object.assign({}, { direction: "column", padding: "xxx-large", gap: "xxx-large" }),
@@ -18511,7 +18994,7 @@ const Activity = () => {
18511
18994
  index.h("p", null,
18512
18995
  "for the",
18513
18996
  " ",
18514
- index.h("span", { class: sheet$8.classes.HeaderSubtitleBold }, "Partner Program #1"),
18997
+ index.h("span", { class: sheet$9.classes.HeaderSubtitleBold }, "Partner Program #1"),
18515
18998
  " ",
18516
18999
  "program"))),
18517
19000
  })),
@@ -18521,10 +19004,10 @@ const Activity = () => {
18521
19004
  label: (index.h("sqm-text", null,
18522
19005
  index.h("h3", null, "Referral Activity"))),
18523
19006
  content: (index.h(sqmStatContainerView.StatContainerView, Object.assign({}, { space: "64px" }),
18524
- index.h(useDemoBigStat.BigStatView, Object.assign({}, { statvalue: "1,000" }), "Total Referrals"),
18525
- index.h(useDemoBigStat.BigStatView, Object.assign({}, { statvalue: "800" }), "Converted"),
18526
- index.h(useDemoBigStat.BigStatView, Object.assign({}, { statvalue: "180" }), "Pending"),
18527
- index.h(useDemoBigStat.BigStatView, Object.assign({}, { statvalue: "20" }), "Disqualified"))),
19007
+ index.h(useDemoBigStat.BigStatView, Object.assign({}, { statvalue: "1,000", value: 100000 }), "Total Referrals"),
19008
+ index.h(useDemoBigStat.BigStatView, Object.assign({}, { statvalue: "800", value: 800 }), "Converted"),
19009
+ index.h(useDemoBigStat.BigStatView, Object.assign({}, { statvalue: "180", value: 180 }), "Pending"),
19010
+ index.h(useDemoBigStat.BigStatView, Object.assign({}, { statvalue: "20", value: 20 }), "Disqualified"))),
18528
19011
  }))),
18529
19012
  index.h(sqmPortalSectionView.PortalSectionView, Object.assign({}, {
18530
19013
  labelMargin: "x-large",
@@ -18532,9 +19015,9 @@ const Activity = () => {
18532
19015
  label: (index.h("sqm-text", null,
18533
19016
  index.h("h3", null, "Traffic Generated"))),
18534
19017
  content: (index.h(sqmStatContainerView.StatContainerView, Object.assign({}, { space: "64px" }),
18535
- index.h(useDemoBigStat.BigStatView, Object.assign({}, { statvalue: "1,000" }), "Clicks"),
18536
- index.h(useDemoBigStat.BigStatView, Object.assign({}, { statvalue: "800" }), "From share link"),
18537
- index.h(useDemoBigStat.BigStatView, Object.assign({}, { statvalue: "180" }), "From share mediums"))),
19018
+ index.h(useDemoBigStat.BigStatView, Object.assign({}, { statvalue: "1,000", value: 1000 }), "Clicks"),
19019
+ index.h(useDemoBigStat.BigStatView, Object.assign({}, { statvalue: "800", value: 800 }), "From share link"),
19020
+ index.h(useDemoBigStat.BigStatView, Object.assign({}, { statvalue: "180", value: 180 }), "From share mediums"))),
18538
19021
  })))));
18539
19022
  };
18540
19023
 
@@ -20531,16 +21014,621 @@ const ValidationError = () => {
20531
21014
  } }));
20532
21015
  };
20533
21016
 
20534
- const PasswordField = /*#__PURE__*/Object.freeze({
20535
- __proto__: null,
20536
- 'default': PasswordField_stories,
20537
- Start: Start,
20538
- EmptyError: EmptyError,
20539
- ValidationError: ValidationError
20540
- });
21017
+ const PasswordField = /*#__PURE__*/Object.freeze({
21018
+ __proto__: null,
21019
+ 'default': PasswordField_stories,
21020
+ Start: Start,
21021
+ EmptyError: EmptyError,
21022
+ ValidationError: ValidationError
21023
+ });
21024
+
21025
+ /**
21026
+ * Displays a cartesian product of the input props
21027
+ *
21028
+ * @returns
21029
+ */
21030
+ function MatrixStory({ matrix, props, Component, }) {
21031
+ const propMatrix = Object.keys(matrix).map((propKey) => {
21032
+ const propValues = matrix[propKey];
21033
+ return propValues.map((val) => {
21034
+ return {
21035
+ [propKey]: val,
21036
+ };
21037
+ });
21038
+ });
21039
+ const combinations = cartesian(...propMatrix);
21040
+ const propsCombinations = combinations.map((combo) => {
21041
+ return combo.reduce((props, prop) => {
21042
+ return {
21043
+ ...props,
21044
+ ...prop,
21045
+ };
21046
+ }, {});
21047
+ });
21048
+ return propsCombinations.map((combo) => {
21049
+ const example = { ...props, ...combo };
21050
+ return (index.h("div", null,
21051
+ index.h(PropsTable, { values: example }),
21052
+ index.h("hr", null),
21053
+ index.h(Component, Object.assign({}, example))));
21054
+ });
21055
+ }
21056
+ function PropsTable({ values }) {
21057
+ return (index.h("table", null,
21058
+ index.h("tbody", null, Object.keys(values).map((key) => {
21059
+ return (index.h("tr", null,
21060
+ index.h("th", null, key),
21061
+ index.h("td", null, JSON.stringify(values[key]))));
21062
+ }))));
21063
+ }
21064
+ /**
21065
+ * Source: https://stackoverflow.com/questions/15298912/javascript-generating-combinations-from-n-arrays-with-m-elements
21066
+ *
21067
+ * TODO: Could replace with a fork of https://www.npmjs.com/package/cartesian
21068
+ *
21069
+ * @param args - an array of arrays
21070
+ * @returns combinations of the elements in those array
21071
+ */
21072
+ function cartesian(...args) {
21073
+ var r = [], max = args.length - 1;
21074
+ function helper(arr, i) {
21075
+ for (var j = 0, l = args[i].length; j < l; j++) {
21076
+ var a = arr.slice(0); // clone arr
21077
+ a.push(args[i][j]);
21078
+ if (i == max)
21079
+ r.push(a);
21080
+ else
21081
+ helper(a, i + 1);
21082
+ }
21083
+ }
21084
+ helper([], 0);
21085
+ return r;
21086
+ }
21087
+
21088
+ const checkmark_circle = () => {
21089
+ return (index.h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 18 18" },
21090
+ index.h("path", { fill: "currentColor", "fill-rule": "evenodd", d: "M1.636 9a7.364 7.364 0 1114.728 0A7.364 7.364 0 011.636 9zM9 0a9 9 0 100 18A9 9 0 009 0zm5.192 6.266a.982.982 0 00-1.548-1.208l-4.787 6.137-2.58-2.58a.982.982 0 00-1.39 1.388l3.367 3.366a.982.982 0 001.468-.09l5.47-7.013z", "clip-rule": "evenodd" })));
21091
+ };
21092
+ const arrow_left_right = () => {
21093
+ return (index.h("svg", { width: 11, height: 12, fill: "none", xmlns: "http://www.w3.org/2000/svg" },
21094
+ index.h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M10.265 2.789a.346.346 0 000-.489L8.066.101a.346.346 0 10-.489.489l1.61 1.609H2.073a.691.691 0 00-.69.691v1.728a.346.346 0 00.69 0V2.89h7.114L7.577 4.5a.346.346 0 10.49.488l2.198-2.2zM.101 9.21a.346.346 0 000 .489l2.2 2.199a.346.346 0 00.488-.489l-1.61-1.609h7.114c.382 0 .691-.31.691-.691V7.382a.346.346 0 00-.691 0V9.11H1.18L2.789 7.5a.346.346 0 10-.489-.488l-2.199 2.2z", fill: "currentColor" })));
21095
+ };
21096
+
21097
+ const gift = () => {
21098
+ return (index.h("svg", { width: 16, height: 16, fill: "none", xmlns: "http://www.w3.org/2000/svg" },
21099
+ index.h("path", { d: "M15 5H9v11h4.5a1 1 0 001-1V9h.5a1 1 0 001-1V6a1 1 0 00-1-1zM1.5 9v6a1 1 0 001 1H7V5H1a1 1 0 00-1 1v2a1 1 0 001 1h.5z", fill: "var(--sl-color-primary-200)" }),
21100
+ index.h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M1.5 9v1h13V9h-13z", fill: "var(--sl-color-primary-300)" }),
21101
+ index.h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M14 2.71c0 .886-1.33 2.227-2 2.29H9v11H7.002V5H4.588C3.212 4.702 2 3.645 2 2.52 2 1.426 2.476.558 3.342.183 4.169-.176 5.125.02 5.88.545c.927.643 1.447 1.851 1.919 2.947l.123.286.12-.272C8.51 2.45 9.045 1.243 9.94.596c.793-.573 1.801-.79 2.672-.397.9.405 1.388 1.336 1.388 2.51zM10.612 1.5c.48-.347 1.056-.41 1.548 0 .428.357.45.525.506.93l.01.07c0 .599-.516 1.5-1.032 1.5-.366 0-.653-.003-.922-.006-.49-.005-.92-.01-1.657.006.14-.272.252-.533.36-.782.285-.667.534-1.246 1.187-1.718zm-5.673 0c-.233-.161-.766-.09-.987.006-.183.08-.456.32-.456 1.015 0 .674 1.092 1.257 1.092 1.257S5.454 4 7.002 4c-.527-1.305-1.273-1.951-2.063-2.5z", fill: "var(--sl-color-primary-600)" })));
21102
+ };
21103
+
21104
+ function ProgressBarView(props) {
21105
+ const { progress = 0, goal = 1, steps = false, progressBarUnit = "", repeatable = false, complete = false, expired = false, } = props;
21106
+ console.log("progress bar props", props);
21107
+ const gift1 = gift();
21108
+ const gift2 = gift();
21109
+ const gift3 = gift();
21110
+ var items = [];
21111
+ var columns = "";
21112
+ var repetitions = Math.floor(progress / goal);
21113
+ if (repeatable) {
21114
+ if (steps) {
21115
+ addStepsRepeatable();
21116
+ }
21117
+ else {
21118
+ addLinearRepeatable();
21119
+ }
21120
+ }
21121
+ // non repeatable
21122
+ else {
21123
+ if (steps) {
21124
+ addSteps();
21125
+ }
21126
+ else {
21127
+ addLinear();
21128
+ }
21129
+ }
21130
+ const style = {
21131
+ ProgressBar: {
21132
+ "& .progress-bar": {
21133
+ height: "15px",
21134
+ marginTop: steps
21135
+ ? "var(--sl-spacing-medium)"
21136
+ : "var(--sl-spacing-large)",
21137
+ filter: expired ? "grayscale(1)" : "",
21138
+ marginBottom: "var(--sl-spacing-xx-large)",
21139
+ marginRight: "var(--sl-spacing-x-small)",
21140
+ fontSize: "var(--sl-font-size-x-small)",
21141
+ display: "grid",
21142
+ gridTemplateColumns: columns,
21143
+ lineHeight: "45px",
21144
+ userSelect: "none",
21145
+ },
21146
+ "& .progress-bar.repeatable-steps": {
21147
+ marginLeft: "var(--sl-spacing-x-small)",
21148
+ },
21149
+ "& .filled:after": {
21150
+ content: '""',
21151
+ display: "flex",
21152
+ width: "100%",
21153
+ height: "4px",
21154
+ borderRadius: "4px",
21155
+ backgroundColor: complete
21156
+ ? "var(--sl-color-success-500)"
21157
+ : "var(--sl-color-primary-500)",
21158
+ },
21159
+ "& .progress": {
21160
+ display: "block",
21161
+ textAlign: "center",
21162
+ marginLeft: "-100px",
21163
+ marginRight: "-100px",
21164
+ },
21165
+ "& .progress::after": {
21166
+ content: '""',
21167
+ width: "12px",
21168
+ height: "12px",
21169
+ display: "flex",
21170
+ backgroundColor: complete
21171
+ ? "var(--sl-color-success-500)"
21172
+ : "var(--sl-color-primary-500)",
21173
+ borderRadius: "50%",
21174
+ position: "relative",
21175
+ left: "47%",
21176
+ top: "-85%",
21177
+ },
21178
+ "& .progress.bg:after": {
21179
+ width: "0",
21180
+ height: "0",
21181
+ border: "none",
21182
+ },
21183
+ "& .progress.top": {
21184
+ position: "relative",
21185
+ top: "-40px",
21186
+ },
21187
+ "& .progress.top:after": {
21188
+ top: "-16%",
21189
+ },
21190
+ "& .empty": {
21191
+ display: "block",
21192
+ textAlign: "center",
21193
+ marginLeft: "-100px",
21194
+ marginRight: "-100px",
21195
+ },
21196
+ "& .empty::after": {
21197
+ content: '""',
21198
+ width: "12px",
21199
+ height: "12px",
21200
+ border: "2px solid #E0E0E0",
21201
+ margin: "-2px",
21202
+ display: "flex",
21203
+ backgroundColor: "white",
21204
+ borderRadius: "50%",
21205
+ position: "relative",
21206
+ left: "47%",
21207
+ top: "-85%",
21208
+ },
21209
+ "& .empty.bg:after": {
21210
+ width: "0",
21211
+ height: "0",
21212
+ border: "none",
21213
+ },
21214
+ "& .remain:after": {
21215
+ content: '""',
21216
+ display: "flex",
21217
+ width: "100%",
21218
+ height: "4px",
21219
+ borderRadius: "4px",
21220
+ backgroundColor: "#E0E0E0",
21221
+ },
21222
+ "& .gift.bw": {
21223
+ filter: "grayscale(100%)",
21224
+ },
21225
+ "& .gift.start": {
21226
+ transform: "scale(80%)",
21227
+ top: "-20px",
21228
+ },
21229
+ "& .gift": {
21230
+ textAlign: "center",
21231
+ marginLeft: "-100px",
21232
+ marginRight: "-100px",
21233
+ position: "relative",
21234
+ display: "list-item",
21235
+ listStyleType: "none",
21236
+ top: "-18px",
21237
+ filter: goal <= progress ? "" : "grayscale(100%)",
21238
+ zIndex: "1",
21239
+ },
21240
+ },
21241
+ };
21242
+ jssPresetDefault_esm.jss.setup(jssPresetDefault_esm.create());
21243
+ const sheet = jssPresetDefault_esm.jss.createStyleSheet(style);
21244
+ const styleString = sheet.toString();
21245
+ return (index.h("div", { class: sheet.classes.ProgressBar },
21246
+ index.h("style", { type: "text/css" }, styleString),
21247
+ index.h("div", { class: repetitions > 1 ? "progress-bar repeatable-steps" : "progress-bar" }, items)));
21248
+ function clamp(x, min, max) {
21249
+ return Math.min(Math.max(x, min), max);
21250
+ }
21251
+ function addLinear() {
21252
+ const ratio = progress / goal;
21253
+ columns =
21254
+ clamp(ratio, 0, 1) + "fr 0fr " + clamp(1 - ratio, 0, 1) + "fr 0fr 0fr";
21255
+ items.push(index.h("div", { class: "filled" }));
21256
+ items.push(index.h("div", { class: clamp(progress, 0, goal) == goal ? "progress top bg" : "progress top" }, clamp(progress, 0, goal) == goal
21257
+ ? ""
21258
+ : progressBarUnit + clamp(progress, 0, goal)));
21259
+ items.push(index.h("div", { class: "remain" }));
21260
+ items.push(index.h("div", { class: "progress bg" }, goal));
21261
+ items.push(index.h("div", { class: "gift" }, gift1));
21262
+ }
21263
+ function addSteps() {
21264
+ let ratio = 1 / goal;
21265
+ for (let i = 1; i < goal; i++) {
21266
+ columns += ratio + "fr 0fr ";
21267
+ if (i > progress) {
21268
+ items.push(index.h("div", { class: "remain" }));
21269
+ items.push(index.h("div", { class: "empty" }, i));
21270
+ }
21271
+ else {
21272
+ items.push(index.h("div", { class: "filled" }));
21273
+ items.push(index.h("div", { class: "progress" }, i));
21274
+ }
21275
+ }
21276
+ columns += ratio + "fr 0fr ";
21277
+ // reward success
21278
+ if (goal <= progress) {
21279
+ columns += "0fr ";
21280
+ items.push(index.h("div", { class: "filled" }));
21281
+ items.push(index.h("div", { class: "progress bg" }, goal));
21282
+ items.push(index.h("div", { class: "gift" }, gift1));
21283
+ }
21284
+ // reward fail
21285
+ else {
21286
+ columns += "0fr ";
21287
+ items.push(index.h("div", { class: "remain" }));
21288
+ items.push(index.h("div", { class: "empty bg" }, goal));
21289
+ items.push(index.h("div", { class: "gift" }, gift1));
21290
+ }
21291
+ }
21292
+ function addLinearRepeatable() {
21293
+ let repetitions = Math.floor(progress / goal);
21294
+ let ratio = ((progress % goal) / goal) * 0.5;
21295
+ // 0 repetition
21296
+ if (repetitions == 0) {
21297
+ columns = ratio + "fr 0fr " + (0.5 - ratio) + "fr 0fr 0fr 0.5fr 0fr 0fr";
21298
+ items.push(index.h("div", { class: "filled" }));
21299
+ items.push(index.h("div", { class: progress == goal ? "progress top bg" : "progress top" }, progressBarUnit + progress));
21300
+ items.push(index.h("div", { class: "remain" }));
21301
+ items.push(index.h("div", { class: "progress bg" }, progressBarUnit + goal));
21302
+ items.push(index.h("div", { class: "gift" }, gift1));
21303
+ items.push(index.h("div", { class: "remain" }));
21304
+ items.push(index.h("div", { class: "progress bg" }, progressBarUnit + goal * 2));
21305
+ items.push(index.h("div", { class: "gift bw" }, gift2));
21306
+ }
21307
+ // single repetition
21308
+ else if (repetitions == 1) {
21309
+ columns =
21310
+ "0.5fr 0fr 0fr " + ratio + "fr 0fr " + (0.5 - ratio) + "fr 0fr 0fr";
21311
+ items.push(index.h("div", { class: "filled" }));
21312
+ items.push(index.h("div", { class: "progress bg" }, progressBarUnit + goal));
21313
+ items.push(index.h("div", { class: "gift" }, gift1));
21314
+ items.push(index.h("div", { class: "filled" }));
21315
+ items.push(index.h("div", { class: progress == goal ? "progress top bg" : "progress top" }, progress == goal ? "" : progressBarUnit + progress));
21316
+ items.push(index.h("div", { class: "remain" }));
21317
+ items.push(index.h("div", { class: "progress bg" }, progressBarUnit + goal * 2));
21318
+ items.push(index.h("div", { class: "gift bw" }, gift2));
21319
+ }
21320
+ // multiple repetitions
21321
+ else {
21322
+ columns =
21323
+ "0fr 0fr 0.5fr 0fr 0fr " +
21324
+ ratio +
21325
+ "fr 0fr " +
21326
+ (0.5 - ratio) +
21327
+ "fr 0fr 0fr";
21328
+ items.push(index.h("div", { class: "progress bg" }, progressBarUnit + goal * (repetitions - 1)));
21329
+ items.push(index.h("div", { class: "gift start" }, gift1));
21330
+ items.push(index.h("div", { class: "filled" }));
21331
+ items.push(index.h("div", { class: "progress bg" }, progressBarUnit + goal * repetitions));
21332
+ items.push(index.h("div", { class: "gift" }, gift2));
21333
+ items.push(index.h("div", { class: "filled" }));
21334
+ items.push(index.h("div", { class: progress == goal * repetitions ? "progress top bg" : "progress top" }, progress == goal * repetitions ? "" : progressBarUnit + progress));
21335
+ items.push(index.h("div", { class: "remain" }));
21336
+ items.push(index.h("div", { class: "progress bg" }, progressBarUnit + goal * (repetitions + 1)));
21337
+ items.push(index.h("div", { class: "gift bw" }, gift3));
21338
+ }
21339
+ }
21340
+ function addStepsRepeatable() {
21341
+ let repetitions = Math.floor(progress / goal);
21342
+ // no or single repetition
21343
+ if (repetitions < 2) {
21344
+ let ratio = 1 / goal;
21345
+ for (let i = 1; i < goal * 2 + 1; i++) {
21346
+ columns += ratio + "fr 0fr ";
21347
+ if (i > progress) {
21348
+ if (i == goal) {
21349
+ columns += "0fr ";
21350
+ items.push(index.h("div", { class: "remain" }));
21351
+ items.push(index.h("div", { class: "empty bg" }, goal));
21352
+ items.push(index.h("div", { class: "gift bw" }, gift1));
21353
+ }
21354
+ else if (i == goal * 2) {
21355
+ columns += "0fr 0fr";
21356
+ items.push(index.h("div", { class: "remain" }));
21357
+ items.push(index.h("div", { class: "empty bg" }, goal * 2));
21358
+ items.push(index.h("div", { class: "gift bw" }, gift2));
21359
+ }
21360
+ else {
21361
+ items.push(index.h("div", { class: "remain" }));
21362
+ items.push(index.h("div", { class: "empty" }, i));
21363
+ }
21364
+ }
21365
+ else if (i == goal) {
21366
+ columns += "0fr ";
21367
+ items.push(index.h("div", { class: "filled" }));
21368
+ items.push(index.h("div", { class: "progress bg" }, i));
21369
+ items.push(index.h("div", { class: "gift" }, gift3));
21370
+ }
21371
+ else {
21372
+ items.push(index.h("div", { class: "filled" }));
21373
+ items.push(index.h("div", { class: "progress" }, i));
21374
+ }
21375
+ }
21376
+ }
21377
+ // case repetition many
21378
+ else {
21379
+ let position = (progress % goal) + goal;
21380
+ let ratio = 1 / goal;
21381
+ columns += "0fr 0fr ";
21382
+ items.push(index.h("div", { class: "progress bg" }, goal * (repetitions - 1)));
21383
+ items.push(index.h("div", { class: "gift start" }, gift1));
21384
+ for (let i = 1; i < goal * 2 + 1; i++) {
21385
+ columns += ratio + "fr 0fr ";
21386
+ if (i <= goal) {
21387
+ if (i == goal) {
21388
+ columns += "0fr ";
21389
+ items.push(index.h("div", { class: "filled" }));
21390
+ items.push(index.h("div", { class: "progress bg" }, i + goal * (repetitions - 1)));
21391
+ items.push(index.h("div", { class: "gift" }, gift2));
21392
+ }
21393
+ else {
21394
+ items.push(index.h("div", { class: "filled" }));
21395
+ items.push(index.h("div", { class: "progress" }, i + goal * (repetitions - 1)));
21396
+ }
21397
+ }
21398
+ else if (i > position) {
21399
+ if (i == goal * 2) {
21400
+ columns += "0fr 0fr";
21401
+ items.push(index.h("div", { class: "remain" }));
21402
+ items.push(index.h("div", { class: "empty bg" }, i + goal * (repetitions - 1)));
21403
+ items.push(index.h("div", { class: "gift bw" }, gift3));
21404
+ }
21405
+ else {
21406
+ items.push(index.h("div", { class: "remain" }));
21407
+ items.push(index.h("div", { class: "empty" }, i + goal * (repetitions - 1)));
21408
+ }
21409
+ }
21410
+ else {
21411
+ items.push(index.h("div", { class: "filled" }));
21412
+ items.push(index.h("div", { class: "progress" }, i + goal * (repetitions - 1)));
21413
+ }
21414
+ }
21415
+ }
21416
+ }
21417
+ }
21418
+
21419
+ function TaskCardView(props) {
21420
+ console.log({ props });
21421
+ const checkmark_circle$1 = checkmark_circle();
21422
+ const arrow_left_right$1 = arrow_left_right();
21423
+ const style = {
21424
+ HostBlock: mixins.HostBlock,
21425
+ TaskCard: {
21426
+ "& .main > div": {
21427
+ margin: "var(--sl-spacing-medium)",
21428
+ },
21429
+ "& .main": {
21430
+ position: "relative",
21431
+ boxSizing: "border-box",
21432
+ minWidth: "347px",
21433
+ background: "var(--sl-color-neutral-0)",
21434
+ border: "1px solid var(--sl-color-neutral-300)",
21435
+ borderRadius: "var(--sl-border-radius-medium)",
21436
+ fontSize: "var(--sl-font-size-small)",
21437
+ lineHeight: "var(--sl-line-height-dense)",
21438
+ color: "var(--sl-color-neutral-600)",
21439
+ },
21440
+ "& .main.complete": {
21441
+ background: "var(--sl-color-success-50)",
21442
+ borderColor: "var(--sl-color-success-700)",
21443
+ },
21444
+ "& .main.expired": {
21445
+ color: "var(--sl-color-neutral-400)",
21446
+ background: "var(--sl-color-neutral-100)",
21447
+ },
21448
+ "& .title": {
21449
+ fontSize: "var(--sl-font-size-small)",
21450
+ fontWeight: "var(--sl-font-weight-semibold)",
21451
+ },
21452
+ "& .black": {
21453
+ color: "var(--sl-color-neutral-1000)",
21454
+ },
21455
+ },
21456
+ Header: {
21457
+ display: "flex",
21458
+ "& .icon": {
21459
+ alignSelf: "center",
21460
+ lineHeight: "0",
21461
+ color: "var(--sl-color-success-700)",
21462
+ fontSize: "var(--sl-font-size-large)",
21463
+ marginRight: "var(--sl-spacing-x-small)",
21464
+ },
21465
+ "& .value": {
21466
+ alignSelf: "center",
21467
+ fontSize: "var(--sl-font-size-x-large)",
21468
+ fontWeight: "var(--sl-font-weight-semibold)",
21469
+ lineHeight: "100%",
21470
+ marginRight: "var(--sl-spacing-xx-small)",
21471
+ },
21472
+ "& .text": {
21473
+ alignSelf: "end",
21474
+ textTransform: "uppercase",
21475
+ fontSize: "var(--sl-font-size-x-small)",
21476
+ lineHeight: "var(--sl-font-size-medium)",
21477
+ marginRight: "var(--sl-spacing-xx-small)",
21478
+ },
21479
+ "& .end": {
21480
+ color: "var(--sl-color-warning-600)",
21481
+ fontWeight: "var(--sl-font-weight-semibold)",
21482
+ marginBottom: "var(--sl-spacing-xx-small)",
21483
+ },
21484
+ "& .black": {
21485
+ color: "var(--sl-color-neutral-1000)",
21486
+ },
21487
+ "& .neutral": {
21488
+ color: "var(--sl-color-neutral-400)",
21489
+ },
21490
+ },
21491
+ Footer: {
21492
+ display: "flex",
21493
+ "& .icon": {
21494
+ fontSize: "var(--sl-font-size-xx-small)",
21495
+ marginRight: "var(--sl-spacing-xx-small)",
21496
+ },
21497
+ "& .text": {
21498
+ marginTop: "auto",
21499
+ verticalAlign: "text-bottom",
21500
+ fontSize: "var(--sl-font-size-x-small)",
21501
+ },
21502
+ "& .success": {
21503
+ color: "var(--sl-color-success-600)",
21504
+ fontWeight: "var(--sl-font-weight-semibold)",
21505
+ },
21506
+ "& .action": {
21507
+ marginTop: "auto",
21508
+ marginLeft: "auto",
21509
+ "&::part(base)": {
21510
+ color: "var(--sl-color-neutral-0)",
21511
+ borderRadius: "var(--sl-border-radius-medium)",
21512
+ },
21513
+ "&.disabled::part(base)": {
21514
+ border: "1px solid var(--sl-color-neutral-400)",
21515
+ background: "var(--sl-color-neutral-400)",
21516
+ },
21517
+ },
21518
+ "& .neutral": {
21519
+ color: "var(--sl-color-neutral-400)",
21520
+ },
21521
+ },
21522
+ };
21523
+ jssPresetDefault_esm.jss.setup(jssPresetDefault_esm.create());
21524
+ const sheet = jssPresetDefault_esm.jss.createStyleSheet(style);
21525
+ const styleString = sheet.toString();
21526
+ const showComplete = props.progress >= props.goal;
21527
+ const repetitions = props.showProgressBar
21528
+ ? Math.floor(props.progress / props.goal)
21529
+ : props.progress;
21530
+ const taskComplete = showComplete && props.repeatable === false;
21531
+ const dateExpire = props.showExpiry && luxon.DateTime.fromISO(props.dateExpires.split("/").pop());
21532
+ const taskExpired = props.showExpiry && luxon.DateTime.now() > dateExpire;
21533
+ const dateExpireText = dateExpire.toLocaleString(luxon.DateTime.DATE_FULL);
21534
+ console.log(taskExpired);
21535
+ return (index.h("div", { class: sheet.classes.TaskCard },
21536
+ index.h("div", { class: taskExpired ? "main expired" : taskComplete ? "main complete" : "main" },
21537
+ index.h("style", { type: "text/css" }, styleString),
21538
+ index.h("div", { class: sheet.classes.Header }, props.loading ? (index.h("sl-skeleton", { style: { width: "22%", margin: "0" } })) : (index.h("div", null,
21539
+ taskExpired && (index.h("div", { class: "end" },
21540
+ " ",
21541
+ "Ended " + dateExpireText,
21542
+ " ")),
21543
+ showComplete && (index.h("span", { class: taskExpired ? "icon neutral" : "icon" }, checkmark_circle$1)),
21544
+ index.h("span", { class: taskExpired ? "value" : "value black" }, props.rewardAmount),
21545
+ index.h("span", { class: "text" }, props.rewardUnit)))),
21546
+ props.loading ? (index.h("sl-skeleton", { style: { width: "42%", margin: "0 16px" } })) : (index.h("div", { class: taskExpired ? "title" : "title black" }, props.cardTitle)),
21547
+ props.loading ? (index.h("sl-skeleton", { style: { width: "91%", margin: "12px 16px" } })) : (index.h(Details, Object.assign({}, props))),
21548
+ props.showProgressBar && props.loading ? (index.h("sl-skeleton", { style: { width: "91%", margin: "0 auto" } })) : (props.showProgressBar && (index.h(ProgressBarView, Object.assign({}, props, { complete: taskComplete, expired: taskExpired })))),
21549
+ index.h("div", { class: sheet.classes.Footer }, props.loading ? (index.h("sl-skeleton", { style: { width: "25%", marginLeft: "auto" } })) : (index.h("div", { style: { display: "contents" } },
21550
+ index.h("span", { class: "text" },
21551
+ props.repeatable && (index.h("div", null,
21552
+ index.h("span", { class: repetitions > 0
21553
+ ? taskExpired
21554
+ ? "icon neutral"
21555
+ : "icon success"
21556
+ : "icon" }, arrow_left_right$1),
21557
+ index.h("span", { class: repetitions > 0
21558
+ ? taskExpired
21559
+ ? "neutral"
21560
+ : "success"
21561
+ : "" }, "Completed " + repetitions + " times"))),
21562
+ props.showExpiry && !taskExpired && (index.h("span", null, "Ends " + dateExpireText))),
21563
+ index.h("sl-button", { class: taskComplete || taskExpired ? "action disabled" : "action", type: "primary", size: "small", onClick: () => window.open(props.buttonLink), disabled: taskComplete || taskExpired }, props.buttonText)))))));
21564
+ }
21565
+ function Details(props) {
21566
+ const style = {
21567
+ Description: {
21568
+ "& input[type=checkbox]": {
21569
+ display: "none",
21570
+ },
21571
+ "& input:checked ~ .details": {
21572
+ transform: "rotate(-180deg)",
21573
+ },
21574
+ "& .details": {
21575
+ position: "absolute",
21576
+ top: "var(--sl-spacing-medium)",
21577
+ right: "var(--sl-spacing-medium)",
21578
+ color: "var(--sl-color-neutral-700)",
21579
+ fontSize: "var(--sl-font-size-large)",
21580
+ "& :hover": {
21581
+ color: "var(--sl-color-primary-700)",
21582
+ },
21583
+ transformOrigin: "50% 37%",
21584
+ transition: "transform var(--sl-transition-medium) ease",
21585
+ },
21586
+ "& input:checked ~ .summary": {
21587
+ transition: "all var(--sl-transition-medium) ease",
21588
+ maxHeight: "300px",
21589
+ marginBottom: props.steps
21590
+ ? "var(--sl-spacing-large)"
21591
+ : props.showProgressBar
21592
+ ? "var(--sl-spacing-xx-large)"
21593
+ : "var(--sl-spacing-large)",
21594
+ },
21595
+ "& .summary": {
21596
+ display: "block",
21597
+ overflow: "hidden",
21598
+ fontSize: "var(--sl-font-size-small)",
21599
+ maxHeight: "0px",
21600
+ transition: "all var(--sl-transition-fast) ease-out",
21601
+ marginBottom: "var(--sl-spacing-medium)",
21602
+ },
21603
+ },
21604
+ };
21605
+ jssPresetDefault_esm.jss.setup(jssPresetDefault_esm.create());
21606
+ const sheet = jssPresetDefault_esm.jss.createStyleSheet(style);
21607
+ const styleString = sheet.toString();
21608
+ const rid = Math.random().toString(36).slice(2);
21609
+ return (index.h("div", null,
21610
+ index.h("style", { type: "text/css" }, styleString),
21611
+ index.h("span", { class: sheet.classes.Description },
21612
+ index.h("input", { type: "checkbox", id: "details-" + rid }),
21613
+ index.h("label", { class: "details", htmlFor: "details-" + rid },
21614
+ index.h("sl-icon", { name: "chevron-down" })),
21615
+ index.h("span", { class: "summary" }, props.description))));
21616
+ }
21617
+
21618
+ const scenarioTaskCard = "@author:derek\r\n@owner:\r\nFeature: Task Card\r\n\r\n\tScenario: A header, body title, description and a CTA button are always displayed\r\n\t\tGiven the Task Card is configured with the following props\r\n\t\t\t| prop | value |\r\n\t\t\t| rewardAmount | \"40\" |\r\n\t\t\t| rewardUnit | \"Points\" |\r\n\t\t\t| cardTitle | Complete a survey |\r\n\t\t\t| description | Fill out our survey form and receive points! |\r\n\t\t\t| buttonText | Take Survey |\r\n\t\t\t| buttonLink | https://example.com/ |\r\n\t\tWhen a user views the Task Card\r\n\t\tThen they see \"40 Points\" as the heading\r\n\t\tAnd the \"40\" is bolded\r\n\t\tAnd they see \"Complete a survey\" bolded in the body\r\n\t\tAnd a details icon in the top right hand corner\r\n\t\tAnd a button with text \"Take Survey\" in the bottom right hand corner\r\n\t\tWhen they click the button\r\n\t\tThen they are redirected to \"example.com\" in a new window\r\n\t\tWhen they click the details icon\r\n\t\tThen \"Fill out our survey form and receive points!\" is shown as the card description\r\n\r\n\tScenario: A loading state is displayed while the Task Card is loading\r\n\t\tGiven a Task Card component\r\n\t\tWhen a user views the Task Card\r\n\t\tThen a loading state is displayed\r\n\t\tWhen the Task Card has loaded\r\n\t\tThen the loading state disapears\r\n\r\n\tScenario Outline: The Progress Bar can be shown or hidden but is hidden by default\r\n\t\tGiven a Task Card component\r\n\t\tAnd it <mayHave> \"showProgressBar\" <value>\r\n\t\tWhen a user views the Task Card\r\n\t\tThen the progress bar <mayBe> displayed\r\n\t\tExamples:\r\n\t\t\t| mayHave | value | mayBe |\r\n\t\t\t| has | true | is |\r\n\t\t\t| has | false | isn't |\r\n\t\t\t| doesn't have | | isn't |\r\n\r\n\tScenario Outline: Tasks can be repeatable or one-time only but are one-time only be default\r\n\t\tGiven a Task Card component\r\n\t\tAnd it <mayHave> \"repeatable\" <value>\r\n\t\tAnd a user who has already completed the task\r\n\t\tWhen they views the Task Card\r\n\t\tThen they see a green checkmark icon beside the card heading\r\n\t\tAnd the card <mayBe> green\r\n\t\tAnd the card's border <mayBe> green\r\n\t\tAnd the CTA button <mayBe> disabled\r\n\t\tAnd the CTA button <mayBe> grey\r\n\t\tExamples:\r\n\t\t\t| mayHave | value | mayBe |\r\n\t\t\t| has | true | isn't |\r\n\t\t\t| has | false | is |\r\n\t\t\t| doesn't have | | is |\r\n\r\n\tScenario: Task Expiries can be configured and disable the CTA after the expiry\r\n\t\tGiven a Task Card component\r\n\t\tAnd it is configured for <expiry>\r\n\t\tWhen a user views the Card on <day>\r\n\t\tThen they the expiry on <cardLocation>\r\n\t\tAnd the text <mayBe> orange\r\n\t\tAnd the card <mayBe> disabled\r\n\t\tAnd the card <mayBe> grey\r\n\t\tAnd the user <mayBe> unable to complete the loyalty task\r\n\t\tExamples:\r\n\t\t\t| expiry | day | cardLocation | mayBe |\r\n\t\t\t| Dec 31 2021 11:59:59 | Dec 1st 2021 12:00:00 | bottom left | isn't |\r\n\t\t\t| Dec 31 2021 11:59:59 | Dec 31 2021 11:00:00 | top right | isn't |\r\n\t\t\t| Dec 31 2021 11:59:59 | Jan 15th 2022 10:00:00 | top right | is |\r\n\r\n\tScenario Outline: Task expiry can be hidden or shown but is hidden by default\r\n\t\tGiven a Task Card\r\n\t\tAnd it is configured with an expiry\r\n\t\tAnd it <mayHave> \"showExpiry\" <value>\r\n\t\tWhen a user views the Task card\r\n\t\tThen the expiry <mayBe> shown in the bottom left hand corner\r\n\t\tExamples:\r\n\t\t\t| mayHave | value | mayBe |\r\n\t\t\t| has | true | is |\r\n\t\t\t| has | false | isn't |\r\n\t\t\t| doesn't have | | isn't |\r\n\r\n\t#DS: Currently this text is non configurable and isnt set up for proper pluralization\r\n\tScenario Outline: A task completion count is displayed for repeatable tasks\r\n\t\tGiven a Task Card is configured for a repeatable task\r\n\t\tAnd has \"goalCompletionNumber\" <goalCompletionNumberValue>\r\n\t\tAnd a user with <userGoalProgress>\r\n\t\tWhen the user views the task card\r\n\t\tThen they see a repeat icon\r\n\t\tAnd the <text> in the bottom left hand corner\r\n\t\tAnd the <text> is green\r\n\t\tExamples:\r\n\t\t\t| goalCompletionNumber | userGoalProgress | text |\r\n\t\t\t| 1 | 0 | Completed 0 times |\r\n\t\t\t| 1 | 1 | Completed 1 times |\r\n\t\t\t| 1 | 2 | Completed 2 times |\r\n\t\t\t| 10 | 5 | Completed 0 times |\r\n\t\t\t| 10 | 12 | Completed 1 times |\r\n\t\t\t| 10 | 29 | Completed 2 times |\r\n\r\n\tScenario Outline: The source of a user's progress can be a custom field or a program goal\r\n\t\tGiven a Task Card is configured to have <progressSourcePath> progress source\r\n\t\tAnd a user\r\n\t\tWhen they view the Task card\r\n\t\tThen the value at <progressSourcePath> is used to benchmark their progress against the Goal Completion Count\r\n\t\tExamples:\r\n\t\t\t| value |\r\n\t\t\t| /customFields/activityCount |\r\n\t\t\t| /customFields/purchaseTotal |\r\n\t\t\t| /programGoals/count%2FComment-on-Article |\r\n\t\t\t| /programGoals/count/Referral-Started%2Freferrals |\r\n\r\n\tScenario Outline: The users completion of a goal is calculated by the Goal Completion Number\r\n\t\tGiven a Task Card is configured to have <goalValue>\r\n\t\tAnd a user who has <progressValue>\r\n\t\tWhen they view the Task Card\r\n\t\tThen they are shown to have <progressValue> towards <goalValue>\r\n\t\tWhen their progress grows larger than <goalValue>\r\n\t\tThen the task is marked as completed\r\n\t\tExamples:\r\n\t\t\t| goalValue | progressValue |\r\n\t\t\t| 1 | 0 |\r\n\t\t\t| 10 | 9 |\r\n\t\t\t| 5 | 2 |\r\n\r\n\tScenario: The Goal Completion Number defaults to 1\r\n\t\tGiven a Task Card without a configured \"goalCompletionNumber\"\r\n\t\tAnd a user who has <progressValue>\r\n\t\tWhen they view the Task Card\r\n\t\tThen it <mayBe> marked as completed\r\n\t\tExamples:\r\n\t\t\t| progressValue | mayBe |\r\n\t\t\t| 0 | isn't |\r\n\t\t\t| 1 | is |\r\n\t\t\t| 2 | is |";
20541
21619
 
21620
+ const scenarioProgressBar = "@author:\r\n@owner:\r\nFeature: Task Card Progress Bar\r\n\r\n\tScenario Outline: Progress Bar\r\n\r\n\t\tGiven <progress> and <goal>\r\n\t\tThen I have <progressBar>\r\n\t\tAnd <progressBar> shows <progress> with <unit> above\r\n\t\tAnd gift icon has <color>\r\n\t\tAnd gift icon shows <goal> with <unit> below\r\n\r\n\t\tExamples:\r\n\t\t\t| progress | goal | progressBar | unit | color |\r\n\t\t\t| -100 | 500 | ●――――――――――――――――――🎁 | $ | no |\r\n\t\t\t| 0 | 500 | ●――――――――――――――――――🎁 | $ | no |\r\n\t\t\t| 250 | 500 | ―――――――――●―――――――――🎁 | $ | no |\r\n\t\t\t| 500 | 500 | ―――――――――――――――――――🎁 | $ | yes |\r\n\t\t\t| 1000 | 500 | ―――――――――――――――――――🎁 | $ | yes |\r\n\r\n\tScenario Outline: Progress Bar Steps\r\n\r\n\t\tGiven <progress> and <goal>\r\n\t\tAnd steps is enabled\r\n\t\tThen I have <progressBar>\r\n\t\tAnd <progressBar> has incrementing steps from 1 to <goal>\r\n\t\tAnd gift icon has <color>\r\n\t\tAnd gift icon shows <goal> below\r\n\r\n\t\tExamples:\r\n\t\t\t| progress | goal | progressBar | color |\r\n\t\t\t| -1 | 5 | ―――○―――○―――○―――○―――🎁 | no |\r\n\t\t\t| 0 | 5 | ―――○―――○―――○―――○―――🎁 | no |\r\n\t\t\t| 1 | 5 | ―――●―――○―――○―――○―――🎁 | no |\r\n\t\t\t| 5 | 5 | ―――○―――○―――○―――●―――🎁 | yes |\r\n\t\t\t| 7 | 5 | ―――○―――○―――○―――●―――🎁 | yes |\r\n\r\n\r\n\tScenario Outline: Progress Bar Repeatable\r\n\r\n\t\tGiven <progress> and <goal>\r\n\t\tThen I have <progressBar>\r\n\t\tAnd <progressBar> shows <progress> with <unit> above\r\n\t\tAnd <icon1> has <color1>\r\n\t\tAnd <icon2> has <color2>\r\n\t\tAnd <icon3> has <color3>\r\n\t\tAnd <icon1> shows <text1> below\r\n\t\tAnd <icon2> shows <text2> below\r\n\t\tAnd <icon3> shows <text3> below\r\n\r\n\t\tExamples:\r\n\t\t\t| progress | goal | progressBar | unit | icon1 | icon2 | icon3 | color1 | color2 | color3 | text 1 | text 2 | text 3 |\r\n\t\t\t| 250 | 500 | ――――●――――🎁―――――――🎁 | $ | NA | gift | gift | NA | no | no | NA | 500 | 1000 |\r\n\t\t\t| 500 | 500 | ―――――――――🎁―――――――🎁 | $ | NA | gift | gift | NA | yes | no | NA | 500 | 1000 |\r\n\t\t\t| 750 | 500 | ―――――――――🎁―――●―――🎁 | $ | NA | gift | gift | NA | yes | no | NA | 500 | 1000 |\r\n\t\t\t| 1000 | 500 | 🎁―――――――🎁―――――――🎁 | $ | gift | gift | gift | yes | yes | no | 500 | 1000 | 1500 |\r\n\t\t\t| 1250 | 500 | 🎁―――――――🎁―――●―――🎁 | $ | gift | gift | gift | yes | yes | no | 500 | 1000 | 1500 |\r\n\r\n\t# \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t math logic inside text ?\r\n\t# | 1250 | 500 | 🎁―――――――🎁―――●―――🎁 | gift | gift | gift | yes | yes | no | goal * (⌊ progress / goal ⌋ - 1) | goal * ⌊ progress / goal ⌋ | goal * (⌊ progress / goal ⌋ +1) |\r\n\r\n\r\n\tScenario Outline: Progress Bar Steps Repeatable\r\n\r\n\t\tGiven <progress> and <goal>\r\n\t\tAnd steps is enabled\r\n\t\tThen I have <progressBar>\r\n\t\tAnd <progressBar> has incrementing steps\r\n\r\n\t\tExamples:\r\n\t\t\t| progress | goal | progressBar |";
21621
+
21622
+ const scenario$5 = scenarioTaskCard + scenarioProgressBar;
20542
21623
  const TaskCard_stories = {
20543
- title: "Components/Task Card",
21624
+ title: "Components/Task Card/",
21625
+ parameters: {
21626
+ scenario: scenario$5,
21627
+ },
21628
+ };
21629
+ const storyFrame = {
21630
+ display: "inline-flex",
21631
+ gap: "32px",
20544
21632
  };
20545
21633
  const resizable = {
20546
21634
  width: "347px",
@@ -20549,495 +21637,270 @@ const resizable = {
20549
21637
  height: "fit-content",
20550
21638
  overflow: "hidden",
20551
21639
  };
20552
- const Default$a = () => {
20553
- // @ts-ignore
20554
- return index.h(sqmTaskCardView.TaskCardView, null);
21640
+ const oneAction = {
21641
+ rewardAmount: 20,
21642
+ rewardUnit: "Points",
21643
+ cardTitle: "Complete a survey",
21644
+ description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
21645
+ repeatable: false,
21646
+ showProgressBar: false,
21647
+ progress: 0,
21648
+ goal: 1,
21649
+ buttonText: "Take survey",
21650
+ buttonLink: "https://example.com/",
21651
+ showExpiry: false,
21652
+ dateExpires: null,
21653
+ loading: false,
20555
21654
  };
20556
- const NotRepeatable = () => {
20557
- const oneAction = {
20558
- points: 20,
20559
- cardTitle: "Complete a survey",
20560
- description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
20561
- buttonText: "Take survey",
20562
- goal: 1,
20563
- };
20564
- const coupleActions = {
20565
- points: 40,
20566
- cardTitle: "Comment on 5 articles",
20567
- showProgressBar: true,
20568
- goal: 5,
20569
- steps: 1,
20570
- description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
20571
- buttonText: "Start reading",
20572
- };
20573
- const manyActions = {
20574
- points: 150,
20575
- cardTitle: "Spend $500 at our Store",
20576
- showProgressBar: true,
20577
- goal: 500,
20578
- unit: "$",
20579
- description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
20580
- buttonText: "Visit our Store",
20581
- };
20582
- return (index.h("div", { style: { display: "inline-flex", gap: "32px" } },
21655
+ const coupleActions = {
21656
+ rewardAmount: 40,
21657
+ rewardUnit: "Points",
21658
+ cardTitle: "Comment on 5 articles",
21659
+ description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
21660
+ repeatable: false,
21661
+ showProgressBar: true,
21662
+ steps: true,
21663
+ progress: 1,
21664
+ goal: 5,
21665
+ buttonText: "Take survey",
21666
+ buttonLink: "https://example.com/",
21667
+ showExpiry: false,
21668
+ dateExpires: null,
21669
+ loading: false,
21670
+ };
21671
+ const manyActions = {
21672
+ rewardAmount: 150,
21673
+ rewardUnit: "Points",
21674
+ cardTitle: "Spend $500 at our Store",
21675
+ description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
21676
+ repeatable: false,
21677
+ showProgressBar: true,
21678
+ progress: 100,
21679
+ goal: 500,
21680
+ progressBarUnit: "$",
21681
+ buttonText: "Take survey",
21682
+ buttonLink: "https://example.com/",
21683
+ showExpiry: false,
21684
+ dateExpires: null,
21685
+ loading: false,
21686
+ };
21687
+ const TaskCardNotRepeatable = () => {
21688
+ return (index.h("div", { style: storyFrame },
20583
21689
  index.h("div", { style: resizable },
20584
21690
  index.h("h4", null, "One Action"),
20585
- index.h(sqmTaskCardView.TaskCardView, Object.assign({}, oneAction, { progress: 0 })),
21691
+ index.h(TaskCardView, Object.assign({}, oneAction, { progress: 0 })),
20586
21692
  " ",
20587
21693
  index.h("h5", null),
20588
- index.h(sqmTaskCardView.TaskCardView, Object.assign({}, oneAction, { progress: 1 })),
21694
+ index.h(TaskCardView, Object.assign({}, oneAction, { progress: 1 })),
20589
21695
  " ",
20590
21696
  index.h("h5", null)),
20591
21697
  index.h("div", { style: resizable },
20592
21698
  index.h("h4", null, "A Couple Actions"),
20593
- index.h(sqmTaskCardView.TaskCardView, Object.assign({}, coupleActions, { progress: 0 })),
21699
+ index.h(TaskCardView, Object.assign({}, coupleActions, { progress: 1 })),
20594
21700
  " ",
20595
21701
  index.h("h5", null),
20596
- index.h(sqmTaskCardView.TaskCardView, Object.assign({}, coupleActions, { progress: 1 })),
20597
- " ",
20598
- index.h("h5", null),
20599
- index.h(sqmTaskCardView.TaskCardView, Object.assign({}, coupleActions, { progress: 5 })),
20600
- " ",
20601
- index.h("h5", null),
20602
- index.h("h5", null,
20603
- "Progress ",
20604
- ">",
20605
- " Goal"),
20606
- index.h(sqmTaskCardView.TaskCardView, Object.assign({}, coupleActions, { progress: 9 })),
21702
+ index.h(TaskCardView, Object.assign({}, coupleActions, { progress: 5 })),
20607
21703
  " ",
20608
21704
  index.h("h5", null)),
20609
21705
  index.h("div", { style: resizable },
20610
21706
  index.h("h4", null, "Many Actions"),
20611
- index.h(sqmTaskCardView.TaskCardView, Object.assign({}, manyActions, { progress: 0 })),
20612
- " ",
20613
- index.h("h5", null),
20614
- index.h(sqmTaskCardView.TaskCardView, Object.assign({}, manyActions, { progress: 230 })),
20615
- " ",
20616
- index.h("h5", null),
20617
- index.h(sqmTaskCardView.TaskCardView, Object.assign({}, manyActions, { progress: 500 })),
21707
+ index.h(TaskCardView, Object.assign({}, manyActions, { progress: 230 })),
20618
21708
  " ",
20619
21709
  index.h("h5", null),
20620
- index.h("h5", null,
20621
- "Progress ",
20622
- ">",
20623
- " Goal"),
20624
- index.h(sqmTaskCardView.TaskCardView, Object.assign({}, manyActions, { progress: 700 })),
21710
+ index.h(TaskCardView, Object.assign({}, manyActions, { progress: 500 })),
20625
21711
  " ",
20626
21712
  index.h("h5", null))));
20627
21713
  };
20628
- const NotRepeatableWithExpiry = () => {
20629
- const oneAction = {
20630
- points: 20,
20631
- cardTitle: "Complete a survey",
20632
- description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
20633
- buttonText: "Take survey",
20634
- goal: 1,
20635
- expire: true,
20636
- dateExpire: "Nov 1, 2021",
20637
- };
20638
- const coupleActions = {
20639
- points: 40,
20640
- cardTitle: "Comment on 5 articles",
20641
- showProgressBar: true,
20642
- goal: 5,
20643
- steps: 1,
20644
- description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
20645
- buttonText: "Start reading",
20646
- expire: true,
20647
- dateExpire: "Nov 1, 2021",
20648
- };
20649
- const manyActions = {
20650
- points: 150,
20651
- cardTitle: "Spend $500 at our Store",
20652
- showProgressBar: true,
20653
- goal: 500,
20654
- unit: "$",
20655
- description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
20656
- buttonText: "Visit our Store",
20657
- expire: true,
20658
- dateExpire: "Nov 1, 2021",
20659
- };
20660
- return (index.h("div", { style: { display: "inline-flex", gap: "32px" } },
21714
+ const TaskCardRepeatable = () => {
21715
+ return (index.h("div", { style: storyFrame },
20661
21716
  index.h("div", { style: resizable },
20662
21717
  index.h("h4", null, "One Action"),
20663
- index.h(sqmTaskCardView.TaskCardView, Object.assign({}, oneAction, { progress: 0 })),
21718
+ index.h(TaskCardView, Object.assign({}, oneAction, { progress: 0, repeatable: true })),
20664
21719
  " ",
20665
21720
  index.h("h5", null),
20666
- index.h(sqmTaskCardView.TaskCardView, Object.assign({}, oneAction, { progress: 1 })),
21721
+ index.h(TaskCardView, Object.assign({}, oneAction, { progress: 1, repeatable: true })),
20667
21722
  " ",
20668
21723
  index.h("h5", null)),
20669
21724
  index.h("div", { style: resizable },
20670
21725
  index.h("h4", null, "A Couple Actions"),
20671
- index.h(sqmTaskCardView.TaskCardView, Object.assign({}, coupleActions, { progress: 0 })),
20672
- " ",
21726
+ index.h(TaskCardView, Object.assign({}, coupleActions, { progress: 1, repeatable: true })),
20673
21727
  index.h("h5", null),
20674
- index.h(sqmTaskCardView.TaskCardView, Object.assign({}, coupleActions, { progress: 1 })),
20675
- " ",
21728
+ index.h(TaskCardView, Object.assign({}, coupleActions, { progress: 5, repeatable: true })),
20676
21729
  index.h("h5", null),
20677
- index.h(sqmTaskCardView.TaskCardView, Object.assign({}, coupleActions, { progress: 5 })),
20678
- " ",
21730
+ index.h(TaskCardView, Object.assign({}, coupleActions, { progress: 7, repeatable: true })),
20679
21731
  index.h("h5", null),
20680
- index.h("h5", null,
20681
- "Progress ",
20682
- ">",
20683
- " Goal"),
20684
- index.h(sqmTaskCardView.TaskCardView, Object.assign({}, coupleActions, { progress: 9 })),
20685
- " ",
21732
+ index.h(TaskCardView, Object.assign({}, coupleActions, { progress: 10, repeatable: true })),
20686
21733
  index.h("h5", null)),
20687
21734
  index.h("div", { style: resizable },
20688
21735
  index.h("h4", null, "Many Actions"),
20689
- index.h(sqmTaskCardView.TaskCardView, Object.assign({}, manyActions, { progress: 0 })),
20690
- " ",
21736
+ index.h(TaskCardView, Object.assign({}, manyActions, { progress: 100, repeatable: true })),
20691
21737
  index.h("h5", null),
20692
- index.h(sqmTaskCardView.TaskCardView, Object.assign({}, manyActions, { progress: 230 })),
20693
- " ",
21738
+ index.h(TaskCardView, Object.assign({}, manyActions, { progress: 500, repeatable: true })),
20694
21739
  index.h("h5", null),
20695
- index.h(sqmTaskCardView.TaskCardView, Object.assign({}, manyActions, { progress: 500 })),
20696
- " ",
21740
+ index.h(TaskCardView, Object.assign({}, manyActions, { progress: 650, repeatable: true })),
20697
21741
  index.h("h5", null),
20698
- index.h("h5", null,
20699
- "Progress ",
20700
- ">",
20701
- " Goal"),
20702
- index.h(sqmTaskCardView.TaskCardView, Object.assign({}, manyActions, { progress: 700 })),
20703
- " ",
21742
+ index.h(TaskCardView, Object.assign({}, manyActions, { progress: 1000, repeatable: true })),
20704
21743
  index.h("h5", null))));
20705
21744
  };
20706
- const Repeatable = () => {
20707
- const oneAction = {
20708
- points: 20,
20709
- cardTitle: "Complete a survey",
20710
- description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
20711
- buttonText: "Take survey",
20712
- goal: 1,
20713
- repeatable: true,
20714
- };
20715
- const coupleActions = {
20716
- points: 40,
20717
- cardTitle: "Comment on 5 articles",
20718
- showProgressBar: true,
20719
- repeatable: true,
20720
- goal: 5,
20721
- steps: 1,
20722
- description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
20723
- buttonText: "Start reading",
20724
- };
20725
- const manyActions = {
20726
- points: 150,
20727
- cardTitle: "Spend $500 at our Store",
20728
- showProgressBar: true,
20729
- repeatable: true,
20730
- goal: 500,
20731
- unit: "$",
20732
- description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
20733
- buttonText: "Visit our Store",
21745
+ const TaskCardDateExpires = () => {
21746
+ const expire = {
21747
+ showExpiry: true,
21748
+ dateExpires: "2021-12-01T08:00:00.000Z/2077-12-01T08:00:00.000Z",
20734
21749
  };
20735
- return (index.h("div", { style: { display: "inline-flex", gap: "32px" } },
21750
+ const expireRepeat = { ...expire, repeatable: true };
21751
+ return (index.h("div", { style: storyFrame },
20736
21752
  index.h("div", { style: resizable },
20737
21753
  index.h("h4", null, "One Action"),
20738
- index.h(sqmTaskCardView.TaskCardView, Object.assign({}, oneAction, { progress: 0 })),
21754
+ index.h(TaskCardView, Object.assign({}, oneAction, expire)),
20739
21755
  " ",
20740
21756
  index.h("h5", null),
20741
- index.h(sqmTaskCardView.TaskCardView, Object.assign({}, oneAction, { progress: 1 })),
21757
+ index.h(TaskCardView, Object.assign({}, oneAction, expireRepeat)),
20742
21758
  " ",
20743
21759
  index.h("h5", null)),
20744
21760
  index.h("div", { style: resizable },
20745
21761
  index.h("h4", null, "A Couple Actions"),
20746
- index.h(sqmTaskCardView.TaskCardView, Object.assign({}, coupleActions, { progress: 1 })),
20747
- " ",
20748
- index.h("h5", null),
20749
- index.h(sqmTaskCardView.TaskCardView, Object.assign({}, coupleActions, { progress: 5 })),
20750
- " ",
20751
- index.h("h5", null),
20752
- index.h(sqmTaskCardView.TaskCardView, Object.assign({}, coupleActions, { progress: 7 })),
21762
+ index.h(TaskCardView, Object.assign({}, coupleActions, expire)),
20753
21763
  " ",
20754
21764
  index.h("h5", null),
20755
- index.h(sqmTaskCardView.TaskCardView, Object.assign({}, coupleActions, { progress: 10 })),
20756
- " ",
20757
- index.h("h5", null),
20758
- index.h(sqmTaskCardView.TaskCardView, Object.assign({}, coupleActions, { progress: 12 })),
20759
- " ",
20760
- index.h("h5", null),
20761
- index.h(sqmTaskCardView.TaskCardView, Object.assign({}, coupleActions, { progress: 15 })),
20762
- " ",
20763
- index.h("h5", null),
20764
- index.h(sqmTaskCardView.TaskCardView, Object.assign({}, coupleActions, { progress: 17 })),
20765
- " ",
20766
- index.h("h5", null),
20767
- index.h(sqmTaskCardView.TaskCardView, Object.assign({}, coupleActions, { progress: 22 })),
21765
+ index.h(TaskCardView, Object.assign({}, coupleActions, expireRepeat)),
20768
21766
  " ",
20769
21767
  index.h("h5", null)),
20770
21768
  index.h("div", { style: resizable },
20771
21769
  index.h("h4", null, "Many Actions"),
20772
- index.h(sqmTaskCardView.TaskCardView, Object.assign({}, manyActions, { progress: 100 })),
20773
- " ",
20774
- index.h("h5", null),
20775
- index.h(sqmTaskCardView.TaskCardView, Object.assign({}, manyActions, { progress: 500 })),
20776
- " ",
20777
- index.h("h5", null),
20778
- index.h(sqmTaskCardView.TaskCardView, Object.assign({}, manyActions, { progress: 650 })),
20779
- " ",
20780
- index.h("h5", null),
20781
- index.h(sqmTaskCardView.TaskCardView, Object.assign({}, manyActions, { progress: 1000 })),
20782
- " ",
20783
- index.h("h5", null),
20784
- index.h(sqmTaskCardView.TaskCardView, Object.assign({}, manyActions, { progress: 1200 })),
21770
+ index.h(TaskCardView, Object.assign({}, manyActions, expire)),
20785
21771
  " ",
20786
21772
  index.h("h5", null),
20787
- index.h(sqmTaskCardView.TaskCardView, Object.assign({}, manyActions, { progress: 1500 })),
20788
- " ",
20789
- index.h("h5", null),
20790
- index.h(sqmTaskCardView.TaskCardView, Object.assign({}, manyActions, { progress: 1700 })),
20791
- " ",
20792
- index.h("h5", null),
20793
- index.h(sqmTaskCardView.TaskCardView, Object.assign({}, manyActions, { progress: 2200 })),
21773
+ index.h(TaskCardView, Object.assign({}, manyActions, expireRepeat)),
20794
21774
  " ",
20795
21775
  index.h("h5", null))));
20796
21776
  };
20797
- const RepeatableWithExpiry = () => {
20798
- const oneAction = {
20799
- points: 20,
20800
- cardTitle: "Complete a survey",
20801
- description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
20802
- buttonText: "Take survey",
20803
- goal: 1,
20804
- repeatable: true,
20805
- expire: true,
20806
- dateExpire: "Nov 1, 2021",
20807
- };
20808
- const coupleActions = {
20809
- points: 40,
20810
- cardTitle: "Comment on 5 articles",
20811
- showProgressBar: true,
20812
- repeatable: true,
20813
- goal: 5,
20814
- steps: 1,
20815
- description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
20816
- buttonText: "Start reading",
20817
- expire: true,
20818
- dateExpire: "Nov 1, 2021",
20819
- };
20820
- const manyActions = {
20821
- points: 150,
20822
- cardTitle: "Spend $500 at our Store",
20823
- showProgressBar: true,
20824
- repeatable: true,
20825
- goal: 500,
20826
- unit: "$",
20827
- description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
20828
- buttonText: "Visit our Store",
20829
- expire: true,
20830
- dateExpire: "Nov 1, 2021",
20831
- };
20832
- return (index.h("div", { style: { display: "inline-flex", gap: "32px" } },
21777
+ const TaskCardLoading = () => {
21778
+ const loading = { loading: true };
21779
+ return (index.h("div", { style: storyFrame },
20833
21780
  index.h("div", { style: resizable },
20834
21781
  index.h("h4", null, "One Action"),
20835
- index.h(sqmTaskCardView.TaskCardView, Object.assign({}, oneAction, { progress: 0 })),
21782
+ index.h(TaskCardView, Object.assign({}, oneAction, loading)),
20836
21783
  " ",
20837
21784
  index.h("h5", null),
20838
- index.h(sqmTaskCardView.TaskCardView, Object.assign({}, oneAction, { progress: 1 })),
21785
+ index.h(TaskCardView, Object.assign({}, oneAction, loading)),
20839
21786
  " ",
20840
21787
  index.h("h5", null)),
20841
21788
  index.h("div", { style: resizable },
20842
21789
  index.h("h4", null, "A Couple Actions"),
20843
- index.h(sqmTaskCardView.TaskCardView, Object.assign({}, coupleActions, { progress: 1 })),
21790
+ index.h(TaskCardView, Object.assign({}, coupleActions, loading)),
20844
21791
  " ",
20845
21792
  index.h("h5", null),
20846
- index.h(sqmTaskCardView.TaskCardView, Object.assign({}, coupleActions, { progress: 5 })),
21793
+ index.h(TaskCardView, Object.assign({}, coupleActions, loading)),
20847
21794
  " ",
20848
- index.h("h5", null),
20849
- index.h(sqmTaskCardView.TaskCardView, Object.assign({}, coupleActions, { progress: 7 })),
21795
+ index.h("h5", null)),
21796
+ index.h("div", { style: resizable },
21797
+ index.h("h4", null, "Many Actions"),
21798
+ index.h(TaskCardView, Object.assign({}, manyActions, loading)),
20850
21799
  " ",
20851
21800
  index.h("h5", null),
20852
- index.h(sqmTaskCardView.TaskCardView, Object.assign({}, coupleActions, { progress: 10 })),
21801
+ index.h(TaskCardView, Object.assign({}, manyActions, loading)),
20853
21802
  " ",
20854
- index.h("h5", null),
20855
- index.h(sqmTaskCardView.TaskCardView, Object.assign({}, coupleActions, { progress: 12 })),
21803
+ index.h("h5", null))));
21804
+ };
21805
+ const TaskCardExpired = () => {
21806
+ const expire = {
21807
+ showExpiry: true,
21808
+ dateExpires: "2021-12-01T08:00:00.000Z/2021-12-01T08:00:00.000Z",
21809
+ };
21810
+ const expireRepeat = { ...expire, repeatable: true };
21811
+ return (index.h("div", { style: storyFrame },
21812
+ index.h("div", { style: resizable },
21813
+ index.h("h4", null, "One Action"),
21814
+ index.h(TaskCardView, Object.assign({}, oneAction, { progress: 0 }, expire)),
20856
21815
  " ",
20857
21816
  index.h("h5", null),
20858
- index.h(sqmTaskCardView.TaskCardView, Object.assign({}, coupleActions, { progress: 15 })),
21817
+ index.h(TaskCardView, Object.assign({}, oneAction, { progress: 1 }, expire)),
20859
21818
  " ",
20860
21819
  index.h("h5", null),
20861
- index.h(sqmTaskCardView.TaskCardView, Object.assign({}, coupleActions, { progress: 17 })),
21820
+ index.h(TaskCardView, Object.assign({}, oneAction, { progress: 0 }, expireRepeat)),
20862
21821
  " ",
20863
21822
  index.h("h5", null),
20864
- index.h(sqmTaskCardView.TaskCardView, Object.assign({}, coupleActions, { progress: 22 })),
21823
+ index.h(TaskCardView, Object.assign({}, oneAction, { progress: 1 }, expireRepeat)),
20865
21824
  " ",
20866
21825
  index.h("h5", null)),
20867
21826
  index.h("div", { style: resizable },
20868
- index.h("h4", null, "Many Actions"),
20869
- index.h(sqmTaskCardView.TaskCardView, Object.assign({}, manyActions, { progress: 100 })),
20870
- " ",
20871
- index.h("h5", null),
20872
- index.h(sqmTaskCardView.TaskCardView, Object.assign({}, manyActions, { progress: 500 })),
21827
+ index.h("h4", null, "A Couple Actions"),
21828
+ index.h(TaskCardView, Object.assign({}, coupleActions, { progress: 1 }, expire)),
20873
21829
  " ",
20874
21830
  index.h("h5", null),
20875
- index.h(sqmTaskCardView.TaskCardView, Object.assign({}, manyActions, { progress: 650 })),
21831
+ index.h(TaskCardView, Object.assign({}, coupleActions, { progress: 5 }, expire)),
20876
21832
  " ",
20877
21833
  index.h("h5", null),
20878
- index.h(sqmTaskCardView.TaskCardView, Object.assign({}, manyActions, { progress: 1000 })),
20879
- " ",
21834
+ index.h(TaskCardView, Object.assign({}, coupleActions, { progress: 1 }, expireRepeat)),
20880
21835
  index.h("h5", null),
20881
- index.h(sqmTaskCardView.TaskCardView, Object.assign({}, manyActions, { progress: 1200 })),
21836
+ index.h(TaskCardView, Object.assign({}, coupleActions, { progress: 5 }, expireRepeat)),
21837
+ index.h("h5", null)),
21838
+ index.h("div", { style: resizable },
21839
+ index.h("h4", null, "Many Actions"),
21840
+ index.h(TaskCardView, Object.assign({}, manyActions, { progress: 100 }, expire)),
20882
21841
  " ",
20883
21842
  index.h("h5", null),
20884
- index.h(sqmTaskCardView.TaskCardView, Object.assign({}, manyActions, { progress: 1500 })),
21843
+ index.h(TaskCardView, Object.assign({}, manyActions, { progress: 500 }, expire)),
20885
21844
  " ",
20886
21845
  index.h("h5", null),
20887
- index.h(sqmTaskCardView.TaskCardView, Object.assign({}, manyActions, { progress: 1700 })),
20888
- " ",
21846
+ index.h(TaskCardView, Object.assign({}, manyActions, { progress: 100 }, expireRepeat)),
20889
21847
  index.h("h5", null),
20890
- index.h(sqmTaskCardView.TaskCardView, Object.assign({}, manyActions, { progress: 2200 })),
20891
- " ",
21848
+ index.h(TaskCardView, Object.assign({}, manyActions, { progress: 500 }, expireRepeat)),
20892
21849
  index.h("h5", null))));
20893
21850
  };
20894
- // export const Repeatable = () => {
20895
- // const oneAction = {
20896
- // points: 20,
20897
- // cardTitle: "Complete a survey",
20898
- // description:
20899
- // "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
20900
- // repeatable: 0,
20901
- // buttonText: "Take survey",
20902
- // buttonOnClick: () => {},
20903
- // };
20904
- // const coupleActions = {
20905
- // points: 40,
20906
- // cardTitle: "Comment on 5 articles",
20907
- // goal: 5,
20908
- // steps: 1,
20909
- // repeatable: true,
20910
- // description:
20911
- // "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
20912
- // buttonText: "Start reading",
20913
- // buttonOnClick: () => {},
20914
- // };
20915
- // const manyActions = {
20916
- // points: 150,
20917
- // cardTitle: "Spend $500 at our Store",
20918
- // goal: 500,
20919
- // repeatable: true,
20920
- // unit: "$",
20921
- // description:
20922
- // "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
20923
- // buttonText: "Visit our Store",
20924
- // buttonOnClick: () => {},
20925
- // };
20926
- // return (
20927
- // <div style={{ display: "inline-flex", gap: "32px" }}>
20928
- // <div style={resizable}>
20929
- // <h4>One Action</h4>
20930
- // <TaskCardView {...oneAction} /> <h5 />
20931
- // <TaskCardView {...oneAction} repeatable={1} complete /> <h5 />
20932
- // </div>
20933
- // <div style={resizable}>
20934
- // <h4>A Couple Actions</h4>
20935
- // <TaskCardView {...coupleActions} progress={1} /> <h5 />
20936
- // <TaskCardView {...coupleActions} progress={5} /> <h5 />
20937
- // <TaskCardView {...coupleActions} progress={7} /> <h5 />
20938
- // <TaskCardView {...coupleActions} progress={10} /> <h5 />
20939
- // <TaskCardView {...coupleActions} progress={12} /> <h5 />
20940
- // </div>
20941
- // <div style={resizable}>
20942
- // <h4>Many Actions</h4>
20943
- // <TaskCardView {...manyActions} progress={100} /> <h5 />
20944
- // <TaskCardView {...manyActions} progress={500} /> <h5 />
20945
- // <TaskCardView {...manyActions} progress={650} /> <h5 />
20946
- // <TaskCardView {...manyActions} progress={1000} /> <h5 />
20947
- // <TaskCardView {...manyActions} progress={1200} /> <h5 />
20948
- // </div>
20949
- // </div>
20950
- // );
20951
- // };
20952
- // export const RepeatableWithExpiry = () => {
20953
- // const oneAction = {
20954
- // points: 20,
20955
- // cardTitle: "Complete a survey",
20956
- // expire: "Nov 30, 2021",
20957
- // description:
20958
- // "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
20959
- // repeatable: 0,
20960
- // buttonText: "Take survey",
20961
- // buttonOnClick: () => {},
20962
- // };
20963
- // const coupleActions = {
20964
- // points: 40,
20965
- // cardTitle: "Comment on 5 articles",
20966
- // expire: "Nov 30, 2021",
20967
- // goal: 5,
20968
- // steps: 1,
20969
- // repeatable: true,
20970
- // description:
20971
- // "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
20972
- // buttonText: "Start reading",
20973
- // buttonOnClick: () => {},
20974
- // };
20975
- // const manyActions = {
20976
- // points: 150,
20977
- // cardTitle: "Spend $500 at our Store",
20978
- // expire: "Nov 30, 2021",
20979
- // goal: 500,
20980
- // repeatable: true,
20981
- // unit: "$",
20982
- // description:
20983
- // "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
20984
- // buttonText: "Visit our Store",
20985
- // buttonOnClick: () => {},
20986
- // };
20987
- // return (
20988
- // <div style={{ display: "inline-flex", gap: "32px" }}>
20989
- // <div style={resizable}>
20990
- // <h4>One Action</h4>
20991
- // <TaskCardView {...oneAction} /> <h5 />
20992
- // <TaskCardView {...oneAction} repeatable={1} complete /> <h5 />
20993
- // </div>
20994
- // <div style={resizable}>
20995
- // <h4>A Couple Actions</h4>
20996
- // <TaskCardView {...coupleActions} progress={1} /> <h5 />
20997
- // <TaskCardView {...coupleActions} progress={5} /> <h5 />
20998
- // <TaskCardView {...coupleActions} progress={7} /> <h5 />
20999
- // <TaskCardView {...coupleActions} progress={10} /> <h5 />
21000
- // <TaskCardView {...coupleActions} progress={12} /> <h5 />
21001
- // </div>
21002
- // <div style={resizable}>
21003
- // <h4>Many Actions</h4>
21004
- // <TaskCardView {...manyActions} progress={100} /> <h5 />
21005
- // <TaskCardView {...manyActions} progress={500} /> <h5 />
21006
- // <TaskCardView {...manyActions} progress={650} /> <h5 />
21007
- // <TaskCardView {...manyActions} progress={1000} /> <h5 />
21008
- // <TaskCardView {...manyActions} progress={1200} /> <h5 />
21009
- // </div>
21010
- // </div>
21011
- // );
21012
- // };
21013
- // export const ProgressBar = () => {
21014
- // const props = {
21015
- // goal: 5,
21016
- // };
21017
- // return (
21018
- // <div>
21019
- // <MatrixStory
21020
- // matrix={{ progress: [1, 2, 5], steps: [0, 1], repeatable: [false] }}
21021
- // props={props}
21022
- // Component={ProgressBarView}
21023
- // />
21024
- // <MatrixStory
21025
- // matrix={{ progress: [2, 5, 7, 12], steps: [0, 1], repeatable: [true] }}
21026
- // props={props}
21027
- // Component={ProgressBarView}
21028
- // />
21029
- // </div>
21030
- // );
21031
- // };
21032
-
21033
- const TaskCard = /*#__PURE__*/Object.freeze({
21851
+ const ProgressBar$1 = () => {
21852
+ const props = {
21853
+ progress: 0,
21854
+ goal: 500,
21855
+ progressBarUnit: "$",
21856
+ };
21857
+ return (index.h("div", null,
21858
+ index.h(MatrixStory, { matrix: { progress: [-100, 0, 100, 500, 1000] }, props: props, Component: ProgressBarView })));
21859
+ };
21860
+ const ProgressBarSteps = () => {
21861
+ const props = {
21862
+ progress: 0,
21863
+ steps: true,
21864
+ goal: 5,
21865
+ progressBarUnit: "$",
21866
+ };
21867
+ return (index.h("div", null,
21868
+ index.h(MatrixStory, { matrix: { progress: [-1, 0, 1, 5, 7] }, props: props, Component: ProgressBarView })));
21869
+ };
21870
+ const ProgressBarRepeatable = () => {
21871
+ const props = {
21872
+ progress: 0,
21873
+ goal: 500,
21874
+ progressBarUnit: "$",
21875
+ repeatable: true,
21876
+ };
21877
+ return (index.h("div", null,
21878
+ index.h(MatrixStory, { matrix: { progress: [100, 500, 650, 1200] }, props: props, Component: ProgressBarView })));
21879
+ };
21880
+ const ProgressBarStepsRepeatable = () => {
21881
+ const props = {
21882
+ progress: 0,
21883
+ steps: true,
21884
+ goal: 5,
21885
+ progressBarUnit: "$",
21886
+ repeatable: true,
21887
+ };
21888
+ return (index.h("div", null,
21889
+ index.h(MatrixStory, { matrix: { progress: [1, 5, 7, 12] }, props: props, Component: ProgressBarView })));
21890
+ };
21891
+
21892
+ const TaskCard$1 = /*#__PURE__*/Object.freeze({
21034
21893
  __proto__: null,
21035
21894
  'default': TaskCard_stories,
21036
- Default: Default$a,
21037
- NotRepeatable: NotRepeatable,
21038
- NotRepeatableWithExpiry: NotRepeatableWithExpiry,
21039
- Repeatable: Repeatable,
21040
- RepeatableWithExpiry: RepeatableWithExpiry
21895
+ TaskCardNotRepeatable: TaskCardNotRepeatable,
21896
+ TaskCardRepeatable: TaskCardRepeatable,
21897
+ TaskCardDateExpires: TaskCardDateExpires,
21898
+ TaskCardLoading: TaskCardLoading,
21899
+ TaskCardExpired: TaskCardExpired,
21900
+ ProgressBar: ProgressBar$1,
21901
+ ProgressBarSteps: ProgressBarSteps,
21902
+ ProgressBarRepeatable: ProgressBarRepeatable,
21903
+ ProgressBarStepsRepeatable: ProgressBarStepsRepeatable
21041
21904
  });
21042
21905
 
21043
21906
  const portalTemplate = "<sqm-portal-frame>\r\n <a slot=\"header\" href=\"/\">\r\n <sqm-text style=\"height: 60px\">\r\n <img\r\n style=\"height: 60px\"\r\n src=\"https://res.cloudinary.com/saasquatch/image/upload/v1634255445/squatch-assets/Copy_of_saasquatch-logo-tree-large-horizontal.png\"\r\n />\r\n </sqm-text>\r\n </a>\r\n <sqb-program-section program-id=\"referral-program\">\r\n <sqm-router>\r\n <template\r\n path=\"/:path(\\bregister\\b|\\bemailVerification\\b|\\blogin\\b|\\bverifyEmail\\b|\\bforgotPassword\\b|\\bresetPassword\\b|\\blogout\\b)\"\r\n >\r\n <sqm-graphql-client-provider\r\n domain=\"https://managed-identity.saasquatch.com\"\r\n >\r\n <sqm-hero\r\n background=\"https://images.unsplash.com/photo-1599676821464-3555954838dc?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=1939&q=80\"\r\n >\r\n <sqm-router>\r\n <template path=\"/register\">\r\n <sqm-portal-register>\r\n <sqm-name-fields slot=\"formData\"></sqm-name-fields>\r\n </sqm-portal-register>\r\n </template>\r\n\r\n <template path=\"/emailVerification\">\r\n <sqm-portal-protected-route\r\n redirect-to=\"/login\"\r\n ></sqm-portal-protected-route>\r\n <sqm-portal-email-verification></sqm-portal-email-verification>\r\n </template>\r\n\r\n <template path=\"/login\">\r\n <sqm-portal-login></sqm-portal-login>\r\n </template>\r\n\r\n <template path=\"/verifyEmail\">\r\n <sqm-portal-verify-email></sqm-portal-verify-email>\r\n </template>\r\n\r\n <template path=\"/forgotPassword\">\r\n <sqm-portal-forgot-password\r\n email-label=\"Business Email\"\r\n ></sqm-portal-forgot-password>\r\n </template>\r\n\r\n <template path=\"/resetPassword\">\r\n <sqm-portal-reset-password\r\n confirm-password=\"true\"\r\n ></sqm-portal-reset-password>\r\n </template>\r\n <template path=\"/logout\">\r\n <sqm-portal-logout next-page=\"/login\"></sqm-portal-logout>\r\n </template>\r\n </sqm-router>\r\n </sqm-hero>\r\n </sqm-graphql-client-provider>\r\n </template>\r\n </sqm-router>\r\n <sqm-router>\r\n <template path=\"/:path(\\bactivity\\b|\\beditProfile\\b)?\">\r\n <sqm-divided-layout\r\n direction=\"row\"\r\n style=\"\r\n border-top: 1px solid #eaeaea;\r\n border-bottom: 1px solid #eaeaea;\r\n \"\r\n >\r\n <sqm-navigation-sidebar>\r\n <sqm-navigation-sidebar-item\r\n path=\"/\"\r\n icon=\"house\"\r\n label=\"Dashboard\"\r\n ></sqm-navigation-sidebar-item>\r\n <sqm-navigation-sidebar-item\r\n path=\"/activity\"\r\n icon=\"bar-chart\"\r\n label=\"Activity\"\r\n ></sqm-navigation-sidebar-item>\r\n <sqm-navigation-sidebar-item\r\n path=\"/editProfile\"\r\n icon=\"person\"\r\n label=\"Edit Profile\"\r\n ></sqm-navigation-sidebar-item>\r\n <sqm-navigation-sidebar-item\r\n path=\"/logout\"\r\n icon=\"box-arrow-right\"\r\n label=\"Logout\"\r\n ></sqm-navigation-sidebar-item>\r\n </sqm-navigation-sidebar>\r\n <sqm-divided-layout direction=\"column\">\r\n <sqm-router>\r\n <template path=\"/\">\r\n <sqm-portal-protected-route\r\n require-email-verification=\"true\"\r\n redirect-to=\"/login\"\r\n redirect-to-unverified=\"/emailVerification\"\r\n ></sqm-portal-protected-route>\r\n <sqb-widget\r\n widget-type=\"p/referral-program/w/referrerWidget\"\r\n track-loads=\"true\"\r\n ></sqb-widget>\r\n </template>\r\n <template path=\"/editProfile\">\r\n <sqm-portal-protected-route\r\n require-email-verification=\"true\"\r\n redirect-to=\"/login\"\r\n redirect-to-unverified=\"/emailVerification\"\r\n ></sqm-portal-protected-route>\r\n <sqm-portal-container direction=\"column\" gap=\"xxx-large\">\r\n <sqm-portal-profile></sqm-portal-profile> </sqm-portal-container\r\n ><sqm-portal-container direction=\"column\" gap=\"xxx-large\">\r\n <sqm-graphql-client-provider\r\n domain=\"https://managed-identity.saasquatch.com\"\r\n >\r\n <sqm-portal-change-password></sqm-portal-change-password>\r\n </sqm-graphql-client-provider>\r\n </sqm-portal-container>\r\n </template>\r\n\r\n <template path=\"/activity\">\r\n <sqm-portal-protected-route\r\n require-email-verification=\"true\"\r\n redirect-to=\"/login\"\r\n redirect-to-unverified=\"/emailVerification\"\r\n ></sqm-portal-protected-route>\r\n <sqm-portal-container\r\n direction=\"column\"\r\n padding=\"xxx-large\"\r\n gap=\"xxx-large\"\r\n >\r\n <sqm-text> <h1>Activity</h1></sqm-text>\r\n <sqm-stat-container space=\"xxxx-large\"\r\n ><sqm-big-stat\r\n flex-reverse=\"true\"\r\n alignment=\"left\"\r\n stat-type=\"/referralsCount\"\r\n ><sqm-text><p>Referrals</p></sqm-text></sqm-big-stat\r\n >\r\n <sqm-big-stat\r\n flex-reverse=\"true\"\r\n alignment=\"left\"\r\n stat-type=\"/rewardsCountFiltered/AVAILABLE\"\r\n ><sqm-text><p>Rewards Earned</p></sqm-text></sqm-big-stat\r\n >\r\n <sqm-big-stat\r\n flex-reverse=\"true\"\r\n alignment=\"left\"\r\n stat-type=\"/rewardBalance/CREDIT/CENTS\"\r\n ><sqm-text><p>Reward Balance</p></sqm-text></sqm-big-stat\r\n >\r\n </sqm-stat-container>\r\n <sqm-referral-table>\r\n <sqm-referral-table-user-column></sqm-referral-table-user-column>\r\n <sqm-referral-table-rewards-column></sqm-referral-table-rewards-column>\r\n <sqm-referral-table-status-column></sqm-referral-table-status-column>\r\n <sqm-referral-table-date-column\r\n column-title=\"Referred\"\r\n date-shown=\"dateReferralStarted\"\r\n ></sqm-referral-table-date-column> </sqm-referral-table\r\n ></sqm-portal-container>\r\n </template>\r\n </sqm-router>\r\n </sqm-divided-layout>\r\n </sqm-divided-layout>\r\n </template>\r\n </sqm-router>\r\n </sqb-program-section>\r\n <sqm-portal-footer\r\n slot=\"footer\"\r\n support-email=\"support@example.com\"\r\n terms-link=\"https://example.com\"\r\n faq-link=\"https://example.com\"\r\n terms-text=\"Terms And Conditions\"\r\n faq-text=\"FAQ\"\r\n show-powered-by=\"true\"\r\n ></sqm-portal-footer>\r\n</sqm-portal-frame>\r\n";
@@ -24052,7 +24915,7 @@ const ReferralIframeReadme = "# sqm-referral-iframe\r\n\r\n\r\n\r\n<!-- Auto Gen
24052
24915
 
24053
24916
  const ForgotPasswordReadme = "# sqm-portal-forgot-password\r\n\r\n\r\n\r\n<!-- Auto Generated Below -->\r\n\r\n\r\n## Properties\r\n\r\n| Property | Attribute | Description | Type | Default |\r\n| ------------- | -------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------- |\r\n| `demoData` | -- | | `{ states?: { error: string; loading: boolean; success: boolean; }; content?: { secondaryButton: any; messageSlot: any; emailLabel?: string; submitLabel?: string; }; }` | `undefined` |\r\n| `emailLabel` | `email-label` | | `string` | `\"Email\"` |\r\n| `submitLabel` | `submit-label` | | `string` | `\"Request Password Reset\"` |\r\n\r\n\r\n## Dependencies\r\n\r\n### Depends on\r\n\r\n- [sqm-form-message](../sqm-form-message)\r\n\r\n### Graph\r\n```mermaid\r\ngraph TD;\r\n sqm-portal-forgot-password --> sqm-form-message\r\n style sqm-portal-forgot-password fill:#f9f,stroke:#333,stroke-width:4px\r\n```\r\n\r\n----------------------------------------------\r\n\r\n*Built with [StencilJS](https://stenciljs.com/)*\r\n";
24054
24917
 
24055
- const RegisterReadme = "# sqm-portal-register\r\n\r\n\r\n\r\n<!-- Auto Generated Below -->\n\n\n## Properties\n\n| Property | Attribute | Description | Type | Default |\n| -------------------------- | ---------------------------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------- |\n| `confirmPassword` | `confirm-password` | | `boolean` | `false` |\n| `confirmPasswordLabel` | `confirm-password-label` | | `string` | `\"Confirm Password\"` |\n| `demoData` | -- | | `{ states?: { error: string; loading: boolean; confirmPassword: boolean; hideInputs: boolean; validationState?: FormState; enablePasswordValidation?: boolean; }; refs?: { formRef: any; }; content?: { formData?: any; passwordField?: any; secondaryButton?: any; emailLabel?: string; passwordLabel?: string; submitLabel?: string; pageLabel?: string; confirmPasswordLabel: string; }; }` | `undefined` |\n| `emailLabel` | `email-label` | | `string` | `\"Email\"` |\n| `enablePasswordValidation` | `enable-password-validation` | | `boolean` | `true` |\n| `hideInputs` | `hide-inputs` | | `boolean` | `false` |\n| `loginLabel` | `login-label` | | `string` | `\"Sign in\"` |\n| `nextPage` | `next-page` | | `string` | `\"/\"` |\n| `pageLabel` | `page-label` | | `string` | `\"Register\"` |\n| `passwordLabel` | `password-label` | | `string` | `\"Password\"` |\n| `submitLabel` | `submit-label` | | `string` | `\"Register\"` |\n\n\n## Dependencies\n\n### Used by\n\n - [sqm-stencilbook](../sqm-stencilbook)\n\n### Depends on\n\n- [sqm-form-message](../sqm-form-message)\n- [sqm-password-field](../sqm-password-field)\n\n### Graph\n```mermaid\ngraph TD;\n sqm-portal-register --> sqm-form-message\n sqm-portal-register --> sqm-password-field\n sqm-stencilbook --> sqm-portal-register\n style sqm-portal-register fill:#f9f,stroke:#333,stroke-width:4px\n```\n\n----------------------------------------------\n\n*Built with [StencilJS](https://stenciljs.com/)*\n";
24918
+ const RegisterReadme = "# sqm-portal-register\r\n\r\n\r\n\r\n<!-- Auto Generated Below -->\n\n\n## Properties\n\n| Property | Attribute | Description | Type | Default |\n| -------------------------- | ---------------------------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------- |\n| `confirmPassword` | `confirm-password` | | `boolean` | `false` |\n| `confirmPasswordLabel` | `confirm-password-label` | | `string` | `\"Confirm Password\"` |\n| `demoData` | -- | | `{ states?: { error: string; loading: boolean; confirmPassword: boolean; hideInputs: boolean; validationState?: FormState; enablePasswordValidation?: boolean; }; content?: { formData?: any; passwordField?: any; secondaryButton?: any; emailLabel?: string; passwordLabel?: string; submitLabel?: string; pageLabel?: string; confirmPasswordLabel: string; }; refs?: { formRef: any; }; }` | `undefined` |\n| `emailLabel` | `email-label` | | `string` | `\"Email\"` |\n| `enablePasswordValidation` | `enable-password-validation` | | `boolean` | `true` |\n| `hideInputs` | `hide-inputs` | | `boolean` | `false` |\n| `loginLabel` | `login-label` | | `string` | `\"Sign in\"` |\n| `nextPage` | `next-page` | | `string` | `\"/\"` |\n| `pageLabel` | `page-label` | | `string` | `\"Register\"` |\n| `passwordLabel` | `password-label` | | `string` | `\"Password\"` |\n| `submitLabel` | `submit-label` | | `string` | `\"Register\"` |\n\n\n## Dependencies\n\n### Used by\n\n - [sqm-stencilbook](../sqm-stencilbook)\n\n### Depends on\n\n- [sqm-form-message](../sqm-form-message)\n- [sqm-password-field](../sqm-password-field)\n\n### Graph\n```mermaid\ngraph TD;\n sqm-portal-register --> sqm-form-message\n sqm-portal-register --> sqm-password-field\n sqm-stencilbook --> sqm-portal-register\n style sqm-portal-register fill:#f9f,stroke:#333,stroke-width:4px\n```\n\n----------------------------------------------\n\n*Built with [StencilJS](https://stenciljs.com/)*\n";
24056
24919
 
24057
24920
  const EditProfileReadme = "# sqm-portal-profile\r\n\r\n\r\n\r\n<!-- Auto Generated Below -->\r\n\r\n\r\n## Properties\r\n\r\n| Property | Attribute | Description | Type | Default |\r\n| ------------------------ | --------------------------- | ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------ |\r\n| `countrytext` | `countrytext` | | `string` | `\"Country\"` |\r\n| `demoData` | -- | | `{ states?: { success: boolean; loading: boolean; submitDisabled: boolean; showCountry: boolean; formState: { country: string; firstName: string; lastName: string; errors: any; error: string; }; user: { id: string; accountId: string; firstName: string; lastName: string; email: string; countryCode: string; }; text: { firstnametext: string; lastnametext: string; emailtext: string; countrytext: string; editProfileHeader: string; editProfileSubHeader: string; submitChangeButtonText: string; }; }; }` | `undefined` |\r\n| `editProfileHeader` | `edit-profile-header` | | `string` | `\"Edit your profile\"` |\r\n| `editProfileSubHeader` | `edit-profile-sub-header` | | `string` | `\"Personal Information\"` |\r\n| `emailtext` | `emailtext` | | `string` | `\"Email\"` |\r\n| `firstnametext` | `firstnametext` | | `string` | `\"First Name\"` |\r\n| `lastnametext` | `lastnametext` | | `string` | `\"Last Name\"` |\r\n| `showCountry` | `show-country` | | `boolean` | `true` |\r\n| `submitChangeButtonText` | `submit-change-button-text` | | `string` | `\"Submit Changes\"` |\r\n\r\n\r\n## Dependencies\r\n\r\n### Depends on\r\n\r\n- [sqm-form-message](../sqm-form-message)\r\n\r\n### Graph\r\n```mermaid\r\ngraph TD;\r\n sqm-portal-profile --> sqm-form-message\r\n style sqm-portal-profile fill:#f9f,stroke:#333,stroke-width:4px\r\n```\r\n\r\n----------------------------------------------\r\n\r\n*Built with [StencilJS](https://stenciljs.com/)*\r\n";
24058
24921
 
@@ -24060,7 +24923,7 @@ const ResetPasswordReadme = "# sqm-portal-reset-password\r\n\r\n\r\n\r\n<!-- Aut
24060
24923
 
24061
24924
  const EmailVerificationReadme = "# sqm-portal-email-verification\r\n\r\n\r\n\r\n<!-- Auto Generated Below -->\r\n\r\n\r\n## Properties\r\n\r\n| Property | Attribute | Description | Type | Default |\r\n| ------------------------- | --------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- |\r\n| `demoData` | -- | | `{ states?: { error: string; loading: boolean; success: boolean; }; content?: { email: string; verifyMessage: string; emailVerificationHeader: string; resendEmailButtonText: string; }; }` | `undefined` |\r\n| `emailVerificationHeader` | `email-verification-header` | | `string` | `\"Verify your email\"` |\r\n| `resendEmailButtonText` | `resend-email-button-text` | | `string` | `\"Re-send Email\"` |\r\n| `verifyMessage` | `verify-message` | | `string` | `\"A verification email was sent to {email}. Please verify your email to continue to the portal.\"` |\r\n\r\n\r\n## Dependencies\r\n\r\n### Depends on\r\n\r\n- [sqm-form-message](../sqm-form-message)\r\n\r\n### Graph\r\n```mermaid\r\ngraph TD;\r\n sqm-portal-email-verification --> sqm-form-message\r\n style sqm-portal-email-verification fill:#f9f,stroke:#333,stroke-width:4px\r\n```\r\n\r\n----------------------------------------------\r\n\r\n*Built with [StencilJS](https://stenciljs.com/)*\r\n";
24062
24925
 
24063
- const EmailVerifiedReadme = "# sqm-portal-verify-email\r\n\r\n\r\n\r\n<!-- Auto Generated Below -->\r\n\r\n\r\n## Properties\r\n\r\n| Property | Attribute | Description | Type | Default |\r\n| ---------- | ----------- | ----------- | ---------------------------------------------------------------------------------------------------- | ----------- |\r\n| `demoData` | -- | | `{ states?: { error: string; loading: boolean; verified: boolean; }; data?: { oobCode: string; }; }` | `undefined` |\r\n| `nextPage` | `next-page` | | `string` | `\"/\"` |\r\n\r\n\r\n## Dependencies\r\n\r\n### Depends on\r\n\r\n- [sqm-form-message](../sqm-form-message)\r\n\r\n### Graph\r\n```mermaid\r\ngraph TD;\r\n sqm-portal-verify-email --> sqm-form-message\r\n style sqm-portal-verify-email fill:#f9f,stroke:#333,stroke-width:4px\r\n```\r\n\r\n----------------------------------------------\r\n\r\n*Built with [StencilJS](https://stenciljs.com/)*\r\n";
24926
+ const EmailVerifiedReadme = "# sqm-portal-verify-email\r\n\r\n\r\n\r\n<!-- Auto Generated Below -->\n\n\n## Properties\n\n| Property | Attribute | Description | Type | Default |\n| ---------- | ----------- | ----------- | ---------------------------------------------------------------------------------------------------- | ----------- |\n| `demoData` | -- | | `{ states?: { error: string; loading: boolean; verified: boolean; }; data?: { oobCode: string; }; }` | `undefined` |\n| `nextPage` | `next-page` | | `string` | `\"/\"` |\n\n\n## Dependencies\n\n### Depends on\n\n- [sqm-form-message](../sqm-form-message)\n\n### Graph\n```mermaid\ngraph TD;\n sqm-portal-verify-email --> sqm-form-message\n style sqm-portal-verify-email fill:#f9f,stroke:#333,stroke-width:4px\n```\n\n----------------------------------------------\n\n*Built with [StencilJS](https://stenciljs.com/)*\n";
24064
24927
 
24065
24928
  const PortalTemplates_stories = {
24066
24929
  title: "Templates / Portal",
@@ -24258,7 +25121,7 @@ const ProgramMenu$1 = /*#__PURE__*/Object.freeze({
24258
25121
  const PoweredByImg_stories = {
24259
25122
  title: "Powered By",
24260
25123
  };
24261
- const Default$b = () => {
25124
+ const Default$a = () => {
24262
25125
  return index.h(sqmPortalFooterView.PoweredByImg, null);
24263
25126
  };
24264
25127
  const CustomColor = () => {
@@ -24271,17 +25134,17 @@ const CustomWidthAndHeight = () => {
24271
25134
  const PoweredByImg = /*#__PURE__*/Object.freeze({
24272
25135
  __proto__: null,
24273
25136
  'default': PoweredByImg_stories,
24274
- Default: Default$b,
25137
+ Default: Default$a,
24275
25138
  CustomColor: CustomColor,
24276
25139
  CustomWidthAndHeight: CustomWidthAndHeight
24277
25140
  });
24278
25141
 
24279
- const scenario$5 = "Feature: Portal Footer\r\n\r\n Background: A user is viewing the portal\r\n Given a hosted portal\r\n And a user is viewing the portal\r\n And the portal has a footer\r\n\r\n Scenario Outline: FAQ and T&C links/text are configurable and open in a new page when clicked\r\n Given the footer has prop \"terms-link\" with value \"https://example.com/terms\"\r\n And prop \"terms-text\" with value \"Terms and Conditions\"\r\n And prop \"faq-link\" with value \"https://example.com/FAQ\"\r\n And prop \"faq-text\" with value \"Visit FAQ\"\r\n When a user clicks on the \"Visit FAQ\" link\r\n Then they will be redirected to \"https://example.com/FAQ\" in a new page\r\n When they go back to the portal\r\n And click on the \"Terms and Conditions\" link\r\n Then they will be redirected to \"https://example.com/terms\" in a new page\r\n\r\n Scenario Outline: FAQ/T&C Links are not shown if a link is not provided\r\n Given the footer does not have <linkProp>\r\n But it <mayHave> <textProp> with <value>\r\n Then the <link> will not be shown in the footer\r\n Examples:\r\n | linkProp | mayHave | textProp | value | link |\r\n | terms-link | has | termsText | Terms and Conditions | T&C Link |\r\n | faq-link | has | faqText | Visit FAQ | FAQ Link |\r\n | terms-link | doesn't have | | | T&C Link |\r\n | faq-link | doesn't have | | | FAQ Link |\r\n\r\n Scenario Outline: The support email and text is configurable but has a default\r\n Given the footer <mayHave> <emailPropWithValue>\r\n And the footer <mayAlsoHave> <textPropWithValue>\r\n Then the footer's support email text is <renderedEmailText>\r\n And the email address will be a mailto link with <mailtoEmail>\r\n When the user clicks on the email address mailto Link\r\n Then the users preferred email client will open with a draft email to <mailtoEmail>\r\n Examples:\r\n | mayHave | emailPropWithValue | mayAlsoHave | textPropWithValue | mailtoEmail | renderedEmailText |\r\n | has | support@saasquatch.com | has | For support please contact {email} | support@saasquatch.com | For support please contact support@saasquatch.com |\r\n | doesn't have | N/A | doesn't have | N/A | support@example.com | For program support, contact support@example.com |\r\n\r\n Scenario Outline: Powered by SaaSquatch is shown by default\r\n Given the footer <mayHaveProp> \"show-powered-by\" with <value>\r\n Then the powered by SaaSquatch image <mayBeShown>\r\n Examples:\r\n | mayHaveProp | value | mayBeShown |\r\n | has prop | true | is shown |\r\n | has prop | false | isn't shown |\r\n | has prop | test | is shown |\r\n | has prop | | is shown |\r\n | doesn't have prop | | is shown |\r\n\r\n Scenario: Powered By Saasquatch links out to \"https://saasquatch.com\"\r\n Given the footer has the powered by SaaSquatch image\r\n When a user clicks on it\r\n Then they will be redirected to \"https://saasquatch.com\" in a new page";
25142
+ const scenario$6 = "Feature: Portal Footer\r\n\r\n Background: A user is viewing the portal\r\n Given a hosted portal\r\n And a user is viewing the portal\r\n And the portal has a footer\r\n\r\n Scenario Outline: FAQ and T&C links/text are configurable and open in a new page when clicked\r\n Given the footer has prop \"terms-link\" with value \"https://example.com/terms\"\r\n And prop \"terms-text\" with value \"Terms and Conditions\"\r\n And prop \"faq-link\" with value \"https://example.com/FAQ\"\r\n And prop \"faq-text\" with value \"Visit FAQ\"\r\n When a user clicks on the \"Visit FAQ\" link\r\n Then they will be redirected to \"https://example.com/FAQ\" in a new page\r\n When they go back to the portal\r\n And click on the \"Terms and Conditions\" link\r\n Then they will be redirected to \"https://example.com/terms\" in a new page\r\n\r\n Scenario Outline: FAQ/T&C Links are not shown if a link is not provided\r\n Given the footer does not have <linkProp>\r\n But it <mayHave> <textProp> with <value>\r\n Then the <link> will not be shown in the footer\r\n Examples:\r\n | linkProp | mayHave | textProp | value | link |\r\n | terms-link | has | termsText | Terms and Conditions | T&C Link |\r\n | faq-link | has | faqText | Visit FAQ | FAQ Link |\r\n | terms-link | doesn't have | | | T&C Link |\r\n | faq-link | doesn't have | | | FAQ Link |\r\n\r\n Scenario Outline: The support email and text is configurable but has a default\r\n Given the footer <mayHave> <emailPropWithValue>\r\n And the footer <mayAlsoHave> <textPropWithValue>\r\n Then the footer's support email text is <renderedEmailText>\r\n And the email address will be a mailto link with <mailtoEmail>\r\n When the user clicks on the email address mailto Link\r\n Then the users preferred email client will open with a draft email to <mailtoEmail>\r\n Examples:\r\n | mayHave | emailPropWithValue | mayAlsoHave | textPropWithValue | mailtoEmail | renderedEmailText |\r\n | has | support@saasquatch.com | has | For support please contact {email} | support@saasquatch.com | For support please contact support@saasquatch.com |\r\n | doesn't have | N/A | doesn't have | N/A | support@example.com | For program support, contact support@example.com |\r\n\r\n Scenario Outline: Powered by SaaSquatch is shown by default\r\n Given the footer <mayHaveProp> \"show-powered-by\" with <value>\r\n Then the powered by SaaSquatch image <mayBeShown>\r\n Examples:\r\n | mayHaveProp | value | mayBeShown |\r\n | has prop | true | is shown |\r\n | has prop | false | isn't shown |\r\n | has prop | test | is shown |\r\n | has prop | | is shown |\r\n | doesn't have prop | | is shown |\r\n\r\n Scenario: Powered By Saasquatch links out to \"https://saasquatch.com\"\r\n Given the footer has the powered by SaaSquatch image\r\n When a user clicks on it\r\n Then they will be redirected to \"https://saasquatch.com\" in a new page";
24280
25143
 
24281
25144
  const PortalFooter_stories = {
24282
25145
  title: "Portal Footer",
24283
25146
  parameters: {
24284
- scenario: scenario$5,
25147
+ scenario: scenario$6,
24285
25148
  },
24286
25149
  };
24287
25150
  const defaultProps$9 = {
@@ -24310,12 +25173,12 @@ const PortalFooter = /*#__PURE__*/Object.freeze({
24310
25173
  FooterNoPoweredBy: FooterNoPoweredBy
24311
25174
  });
24312
25175
 
24313
- const scenario$6 = "Feature: Hero Unit\r\n\r\n Background: A portal with a hero unit exists\r\n Given a hosted portal\r\n And the portal has hero unit on the login page\r\n And a user is viewing the login page\r\n\r\n Scenario: The hero unit defaults to a single column layout\r\n Given a hero unit does not have a \"columns\" prop\r\n But the following html is wrapped by the hero unit\r\n \"\"\"\r\n <sqm-portal-login></sqm-portal-login>\r\n <div slot=\"secondary-column\">\r\n <h1 style=\"text-align:center\">Get Referring!</h1>\r\n <p style=\"text-align:center\">\r\n Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do\r\n eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim\r\n ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut\r\n aliquip ex ea commodo consequat. Duis aute irure dolor in\r\n reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla\r\n pariatur.\r\n </p>\r\n </div>\r\n \"\"\"\r\n Then only a single column will be displayed\r\n And within it will be the login component\r\n\r\n Scenario Outline: The hero unit supports single or dual column layouts\r\n Given a hero unit with prop \"columns\" having <columnValue>\r\n And it wraps <html>\r\n Then the hero unit displays <columnValue> columns\r\n Examples:\r\n | columnValue | html |\r\n | 1 | <h1>Column 1!</h1> |\r\n | 2 | <h1>Column 1!</h1><div slot=\"secondary-column\"><h1 style=\"text-align:center\">Column 2!</h1></div> |\r\n\r\n Scenario: HTML to be displayed in the second column comes from the \"secondary-column\" slot\r\n Given a hero unit with \"columns\" \"2\"\r\n And the following html\r\n \"\"\"\r\n <h1>Column 1!</h1>\r\n <div>\r\n <h1 style=\"text-align:center\">Column 2!</h1>\r\n </div>\r\n \"\"\"\r\n When the hero unit is rendered\r\n Then only one column is displayed with content\r\n And column 1 will contain the \"Column 1!\" text\r\n And column 1 will contain the \"Column 2!\" text\r\n When the div for column two is updated to have 'slot=\"secondary-column\"'\r\n Then the two columns are displayed with content\r\n And column 1 will contain the \"Column 1!\" text\r\n And column 2 will contain the \"Column 2!\" text\r\n\r\n Scenario Outline: A background for the hero unit can be set as an image or colour\r\n Given a hero unit with <backgroundPropValue>\r\n Then the background will be <background>\r\n Examples:\r\n | background | background |\r\n | https://images.unsplash.com/photo-1599676821464-3555954838d | image of misty mountains |\r\n | LightSlateGrey | light slate grey |\r\n | #00FF00 | green |\r\n | rgb(128,0,128) | purple |\r\n\r\n Scenario Outline: Wrap Direction can be configured for mobile experiences\r\n Given a hero unit with the following HTML\r\n \"\"\"\r\n <h1>Column 1!</h1>\r\n <div slot=\"secondary-column\">\r\n <h1 style=\"text-align:center\">Column 2!</h1>\r\n </div>\r\n \"\"\"\r\n And prop \"wrap-direction\" has <value>\r\n When the window width is less than 600px\r\n Then the two columns will stack\r\n And <column> will be on top\r\n Examples:\r\n | value | column |\r\n | wrap | 1 |\r\n | wrap-reverse | 2 |\r\n | | 1 |";
25176
+ const scenario$7 = "Feature: Hero Unit\r\n\r\n Background: A portal with a hero unit exists\r\n Given a hosted portal\r\n And the portal has hero unit on the login page\r\n And a user is viewing the login page\r\n\r\n Scenario: The hero unit defaults to a single column layout\r\n Given a hero unit does not have a \"columns\" prop\r\n But the following html is wrapped by the hero unit\r\n \"\"\"\r\n <sqm-portal-login></sqm-portal-login>\r\n <div slot=\"secondary-column\">\r\n <h1 style=\"text-align:center\">Get Referring!</h1>\r\n <p style=\"text-align:center\">\r\n Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do\r\n eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim\r\n ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut\r\n aliquip ex ea commodo consequat. Duis aute irure dolor in\r\n reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla\r\n pariatur.\r\n </p>\r\n </div>\r\n \"\"\"\r\n Then only a single column will be displayed\r\n And within it will be the login component\r\n\r\n Scenario Outline: The hero unit supports single or dual column layouts\r\n Given a hero unit with prop \"columns\" having <columnValue>\r\n And it wraps <html>\r\n Then the hero unit displays <columnValue> columns\r\n Examples:\r\n | columnValue | html |\r\n | 1 | <h1>Column 1!</h1> |\r\n | 2 | <h1>Column 1!</h1><div slot=\"secondary-column\"><h1 style=\"text-align:center\">Column 2!</h1></div> |\r\n\r\n Scenario: HTML to be displayed in the second column comes from the \"secondary-column\" slot\r\n Given a hero unit with \"columns\" \"2\"\r\n And the following html\r\n \"\"\"\r\n <h1>Column 1!</h1>\r\n <div>\r\n <h1 style=\"text-align:center\">Column 2!</h1>\r\n </div>\r\n \"\"\"\r\n When the hero unit is rendered\r\n Then only one column is displayed with content\r\n And column 1 will contain the \"Column 1!\" text\r\n And column 1 will contain the \"Column 2!\" text\r\n When the div for column two is updated to have 'slot=\"secondary-column\"'\r\n Then the two columns are displayed with content\r\n And column 1 will contain the \"Column 1!\" text\r\n And column 2 will contain the \"Column 2!\" text\r\n\r\n Scenario Outline: A background for the hero unit can be set as an image or colour\r\n Given a hero unit with <backgroundPropValue>\r\n Then the background will be <background>\r\n Examples:\r\n | background | background |\r\n | https://images.unsplash.com/photo-1599676821464-3555954838d | image of misty mountains |\r\n | LightSlateGrey | light slate grey |\r\n | #00FF00 | green |\r\n | rgb(128,0,128) | purple |\r\n\r\n Scenario Outline: Wrap Direction can be configured for mobile experiences\r\n Given a hero unit with the following HTML\r\n \"\"\"\r\n <h1>Column 1!</h1>\r\n <div slot=\"secondary-column\">\r\n <h1 style=\"text-align:center\">Column 2!</h1>\r\n </div>\r\n \"\"\"\r\n And prop \"wrap-direction\" has <value>\r\n When the window width is less than 600px\r\n Then the two columns will stack\r\n And <column> will be on top\r\n Examples:\r\n | value | column |\r\n | wrap | 1 |\r\n | wrap-reverse | 2 |\r\n | | 1 |";
24314
25177
 
24315
25178
  const Hero_stories = {
24316
25179
  title: "Hero Layout",
24317
25180
  parameters: {
24318
- scenario: scenario$6,
25181
+ scenario: scenario$7,
24319
25182
  },
24320
25183
  };
24321
25184
  const LoginOneColumn = () => {
@@ -24492,12 +25355,12 @@ const Hero = /*#__PURE__*/Object.freeze({
24492
25355
  TwoColumnLoginWithImgElement: TwoColumnLoginWithImgElement
24493
25356
  });
24494
25357
 
24495
- const scenario$7 = "@owner:sam\r\n@author:sam\r\n\r\nFeature: Referral Iframe\r\n\r\n Used to provide an external form for submitting referral leads using the current user's referral code\r\n\r\n Background: A user is logged in\r\n Given there is a logged in user\r\n\r\n @motivating\r\n Scenario: Referral code is passed to the iframe as a query parameter\r\n Given the \"iframe-src\" is \"https://example.com\"\r\n And the user has navigated to \"/refer\"\r\n And the user's referral code is \"BOBBYREFER\"\r\n When the iframe content is loaded\r\n Then the iframe url will be \"https://example.com?rsCode=BOBBYREFER\"\r\n\r\n @ui\r\n Scenario Outline: The height and width of the iFrame can be controlled via props\r\n Given the \"iframe-src\" is \"https://example.com\"\r\n And the iframe content is 1000x1000\r\n And the \"iframe-height\" is set to <heightValue>\r\n And the \"iframe-width\" is set to <widthValue>\r\n Then the content of the iframe will be displayed with scrollbars\r\n And the dimension of the iFrame displayed will be 500x500\r\n When the \"iframe-height\" is set to <heightValue>\r\n And the \"iframe-width\" is set to <widthValue>\r\n Then the full content of the iframe will be displayed on the page\r\n And the dimension of the iFrame displayed will be 1000x1000\r\n Examples:\r\n | heightValue | widthValue |\r\n | 500px | 500px |\r\n | 50% | 50% |\r\n\r\n @minutae\r\n Scenario Outline: The iFrame will fail fast if a iFrame source isn't provided\r\n Given \"iframe-src\" <mayBeAnAttribute>\r\n And it <mayHaveValue>\r\n When a user views the referral iFrame component\r\n Then an alert with an error message is displayed in place of the iFrame\r\n And it has a details section\r\n When \"More details\" is clicked\r\n Then the following information will be displayed\r\n | component being used |\r\n | missing attribute(s) |\r\n\r\n Examples:\r\n | mayBeAnAttribute | mayHaveValue |\r\n | is not an attribute | N/A |\r\n | is an attribute | \"\" |\r\n | is an attribute | |";
25358
+ const scenario$8 = "@owner:sam\r\n@author:sam\r\n\r\nFeature: Referral Iframe\r\n\r\n Used to provide an external form for submitting referral leads using the current user's referral code\r\n\r\n Background: A user is logged in\r\n Given there is a logged in user\r\n\r\n @motivating\r\n Scenario: Referral code is passed to the iframe as a query parameter\r\n Given the \"iframe-src\" is \"https://example.com\"\r\n And the user has navigated to \"/refer\"\r\n And the user's referral code is \"BOBBYREFER\"\r\n When the iframe content is loaded\r\n Then the iframe url will be \"https://example.com?rsCode=BOBBYREFER\"\r\n\r\n @ui\r\n Scenario Outline: The height and width of the iFrame can be controlled via props\r\n Given the \"iframe-src\" is \"https://example.com\"\r\n And the iframe content is 1000x1000\r\n And the \"iframe-height\" is set to <heightValue>\r\n And the \"iframe-width\" is set to <widthValue>\r\n Then the content of the iframe will be displayed with scrollbars\r\n And the dimension of the iFrame displayed will be 500x500\r\n When the \"iframe-height\" is set to <heightValue>\r\n And the \"iframe-width\" is set to <widthValue>\r\n Then the full content of the iframe will be displayed on the page\r\n And the dimension of the iFrame displayed will be 1000x1000\r\n Examples:\r\n | heightValue | widthValue |\r\n | 500px | 500px |\r\n | 50% | 50% |\r\n\r\n @minutae\r\n Scenario Outline: The iFrame will fail fast if a iFrame source isn't provided\r\n Given \"iframe-src\" <mayBeAnAttribute>\r\n And it <mayHaveValue>\r\n When a user views the referral iFrame component\r\n Then an alert with an error message is displayed in place of the iFrame\r\n And it has a details section\r\n When \"More details\" is clicked\r\n Then the following information will be displayed\r\n | component being used |\r\n | missing attribute(s) |\r\n\r\n Examples:\r\n | mayBeAnAttribute | mayHaveValue |\r\n | is not an attribute | N/A |\r\n | is an attribute | \"\" |\r\n | is an attribute | |";
24496
25359
 
24497
25360
  const ReferralIframe_stories = {
24498
25361
  title: "Referral Iframe",
24499
25362
  parameters: {
24500
- scenario: scenario$7,
25363
+ scenario: scenario$8,
24501
25364
  },
24502
25365
  };
24503
25366
  const props = {
@@ -24528,12 +25391,12 @@ const ReferralIframe$1 = /*#__PURE__*/Object.freeze({
24528
25391
  ReferralIframeError: ReferralIframeError
24529
25392
  });
24530
25393
 
24531
- const scenario$8 = "@owner:sam\r\n@author:sam\r\n\r\nFeature: Name Fields\r\n\r\n Fields to be used to fill the first and last name of a user during registration\r\n\r\n Background:\r\n Given the current page is \"/register\"\r\n\r\n @motivating\r\n Scenario: Both first name and last name are required\r\n Given the email field has valid input\r\n And the password field has valid input\r\n And first name field is empty\r\n And last name field is empty\r\n When register is clicked\r\n Then the name fields will be highlighted in red\r\n And the error messages will say \"Cannot be empty\"\r\n\r\n @motivating\r\n Scenario: First and last name are upserted with the SaaSquatch user\r\n Given all fields have been filled with data\r\n | firstName | lastName | email | password |\r\n | Bob | Testerson | bob@example.com | SecurePassword1 |\r\n When register is clicked\r\n Then the email verification page will be loaded\r\n And the user will be upserted\r\n And the SaaSquatch user will contain data\r\n | firstName | lastName | email |\r\n | Bob | Testerson | bob@example.com |\r\n\r\n";
25394
+ const scenario$9 = "@owner:sam\r\n@author:sam\r\n\r\nFeature: Name Fields\r\n\r\n Fields to be used to fill the first and last name of a user during registration\r\n\r\n Background:\r\n Given the current page is \"/register\"\r\n\r\n @motivating\r\n Scenario: Both first name and last name are required\r\n Given the email field has valid input\r\n And the password field has valid input\r\n And first name field is empty\r\n And last name field is empty\r\n When register is clicked\r\n Then the name fields will be highlighted in red\r\n And the error messages will say \"Cannot be empty\"\r\n\r\n @motivating\r\n Scenario: First and last name are upserted with the SaaSquatch user\r\n Given all fields have been filled with data\r\n | firstName | lastName | email | password |\r\n | Bob | Testerson | bob@example.com | SecurePassword1 |\r\n When register is clicked\r\n Then the email verification page will be loaded\r\n And the user will be upserted\r\n And the SaaSquatch user will contain data\r\n | firstName | lastName | email |\r\n | Bob | Testerson | bob@example.com |\r\n\r\n";
24532
25395
 
24533
25396
  const NameFields_stories = {
24534
25397
  title: "Name Fields",
24535
25398
  parameters: {
24536
- scenario: scenario$8,
25399
+ scenario: scenario$9,
24537
25400
  },
24538
25401
  };
24539
25402
  const props$1 = {
@@ -24571,6 +25434,251 @@ const NameFields$1 = /*#__PURE__*/Object.freeze({
24571
25434
  NameFieldsWithErrors: NameFieldsWithErrors
24572
25435
  });
24573
25436
 
25437
+ const baseResponse = (data) => ({
25438
+ states: {
25439
+ content: null,
25440
+ redeemStage: "chooseReward",
25441
+ amount: 0,
25442
+ exchangeError: false,
25443
+ loading: false,
25444
+ selectedItem: null,
25445
+ selectedStep: null,
25446
+ },
25447
+ data: {
25448
+ exchangeList: data,
25449
+ },
25450
+ callbacks: {
25451
+ exchangeReward: null,
25452
+ resetState: null,
25453
+ setStage: null,
25454
+ setExchangeState: null,
25455
+ refs: null,
25456
+ },
25457
+ refs: null,
25458
+ });
25459
+ const baseReward$2 = {
25460
+ key: "",
25461
+ name: "",
25462
+ description: "",
25463
+ imageUrl: "",
25464
+ available: true,
25465
+ unavailableReason: null,
25466
+ unavailableReasonCode: null,
25467
+ ruleType: "FIXED_GLOBAL_REWARD",
25468
+ sourceUnit: "POINT",
25469
+ sourceValue: 10,
25470
+ prettySourceValue: "10 SaaSquatch Points",
25471
+ sourceMinValue: null,
25472
+ prettySourceMinValue: null,
25473
+ sourceMaxValue: null,
25474
+ prettySourceMaxValue: null,
25475
+ destinationMinValue: null,
25476
+ prettyDestinationMinValue: null,
25477
+ destinationMaxValue: null,
25478
+ prettyDestinationMaxValue: null,
25479
+ globalRewardKey: "",
25480
+ destinationUnit: null,
25481
+ steps: [],
25482
+ };
25483
+ const notEnoughPoints = {
25484
+ available: false,
25485
+ unavailableReasonCode: "INSUFFICIENT_REDEEMABLE_CREDIT",
25486
+ };
25487
+ const usTax = {
25488
+ available: false,
25489
+ unavailableReasonCode: "US_TAX",
25490
+ };
25491
+ const imageUrl = (props) => ({
25492
+ imageUrl: props,
25493
+ });
25494
+ const description = (props) => ({
25495
+ description: props,
25496
+ });
25497
+ const fixedValue = (props) => ({
25498
+ prettySourceValue: props,
25499
+ });
25500
+ const variableValue = (min, max, text) => ({
25501
+ ruleType: "VARIABLE_CREDIT_REWARD",
25502
+ sourceMinValue: min,
25503
+ prettySourceMinValue: min + " " + text,
25504
+ sourceMaxValue: max,
25505
+ prettySourceMaxValue: max + " " + text,
25506
+ });
25507
+ const test = {
25508
+ ...baseResponse([
25509
+ {
25510
+ ...baseReward$2,
25511
+ ...description("Free swag with a promo code"),
25512
+ ...imageUrl("https://i.imgur.com/Ds7M19I.png"),
25513
+ ...fixedValue("40 SaaSquatch Points"),
25514
+ },
25515
+ {
25516
+ ...baseReward$2,
25517
+ ...description("Visa® Prepaid Card USD"),
25518
+ ...imageUrl("https://i.imgur.com/4s3q2zz.png"),
25519
+ ...variableValue(20, 80, "SaaSquatch Points"),
25520
+ },
25521
+ {
25522
+ ...baseReward$2,
25523
+ ...description("A very exclusive gift box"),
25524
+ ...imageUrl("https://i.imgur.com/XuiJi4l.png"),
25525
+ ...fixedValue("30 SaaSquatch Points"),
25526
+ },
25527
+ {
25528
+ ...baseReward$2,
25529
+ ...description("$50 Store credit"),
25530
+ ...imageUrl("https://i.imgur.com/WkCMVSE.png"),
25531
+ ...fixedValue("100 SaaSquatch Points"),
25532
+ },
25533
+ {
25534
+ ...baseReward$2,
25535
+ ...description("Variable amount of store credit"),
25536
+ ...imageUrl("https://i.imgur.com/Jn2fE0s.png"),
25537
+ ...variableValue(20, 100, "SaaSquatch Points"),
25538
+ },
25539
+ {
25540
+ ...baseReward$2,
25541
+ ...notEnoughPoints,
25542
+ ...description("A very rare cactus"),
25543
+ ...imageUrl("https://i.imgur.com/CvCdpXc.png"),
25544
+ ...fixedValue("2000 SaaSquatch Points"),
25545
+ },
25546
+ {
25547
+ ...baseReward$2,
25548
+ ...usTax,
25549
+ ...description("$1000 Store credit"),
25550
+ ...imageUrl("https://i.imgur.com/I9FCh9Z.png"),
25551
+ ...fixedValue("2000 SaaSquatch Points"),
25552
+ },
25553
+ {
25554
+ ...baseReward$2,
25555
+ ...notEnoughPoints,
25556
+ ...description("A holiday gift box"),
25557
+ ...imageUrl("https://i.imgur.com/HBJS1WH.png"),
25558
+ ...fixedValue("100 SaaSquatch Points"),
25559
+ },
25560
+ ]),
25561
+ };
25562
+ const test2 = {
25563
+ states: {
25564
+ content: {
25565
+ text: {
25566
+ buttonText: "Exchange Rewards",
25567
+ ignored: true,
25568
+ },
25569
+ },
25570
+ redeemStage: "chooseAmount",
25571
+ amount: 0,
25572
+ exchangeError: false,
25573
+ loading: false,
25574
+ selectedItem: {
25575
+ key: "r4",
25576
+ name: "Salmon Coins",
25577
+ description: "Points for Salmon Coins",
25578
+ imageUrl: "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAoHCBUWFRgWFRYYGRgZGh4cHBocHR4aHxwdGRwZHBwfHh4cIS4lHB4rHxoYJjgnKy8xNTU1GiQ7QD00Py40NTEBDAwMEA8QHhISHzQrJCs0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NP/AABEIAIABiQMBIgACEQEDEQH/xAAcAAEAAQUBAQAAAAAAAAAAAAAABAECAwUGBwj/xAA+EAABAwICBgYHBwQCAwAAAAABAAIRAyEEMQUSQVFhcQYTgZGhsQciMkJScvAUYoKSwdHhorLC8SMzFUNj/8QAGAEBAQEBAQAAAAAAAAAAAAAAAAECAwT/xAAfEQEBAQEBAQEAAwEBAAAAAAAAARECEiExE0FRYQP/2gAMAwEAAhEDEQA/APZkREBERAREQEREBERAREQEREBERAREQERY6jw0EkgACSTYADMk7AgvVjHgzBBixgzBXmfSjpqapNLDuLaeTqgs58Zhl/Vbx28BnA0Lj3UXNcx0G0tmxHwkW1tvLhks3qRZHryqtdonSjK7dZtnCzmzJaf1HFbFWXUERFQREQEREBERAREQEREBERAREQEREBERAREQEREBERAREQEREBERAREQEREBERAREQEREBFSVqdNafoYVoNaoAT7LBdzvlaLxxyG0oNlUqBoLnEAASSTAAFySTkF5H0z6WHEuNKiSKANx7JqkXl20MFoHfsAidKemVTFeo31KPwAgl0ZF7hY7IaLA39aBHNsIO0cv34eaCVSeBlcnblb/FqnYatxz3WLhw+FnHMrVMfx7/MjyCkMI5znx+Y7flCx1NajqNGaUdTIex2qRYRkRuj3h+y9D0Lp2nXETq1APWb5xv5ZjxXj9Ovt8dsdmXIHmVKw+OIg62rGWqQIINvWs1vZJWeZeVuV7gi5Xoj0j+0g03kGowSSMnNkCTYAOkjK17cOqXSXWBERUEREBERAREQEREBERAREQEREBERBRFjq1WtaXOcGtAkuJAAG8k2C5LS/TukyW0GGq74j6jO83PcAd6DslQFeI6Y6VYmvOvWcG/BS9RvIwZcODiV1vomonq69QWa57Wht82N1i6+ZIe0diD0JERAREQEREBERARFgxOJZTaX1HtY0ZucQAOZNkGdFxmkvSJg2SGa9Y5eo2G/mdEji2VzmO9JWIdalTp0xvcS93+IHcUHqyiYvH0qQmpUYwb3ua3+4rxTG9IsbV9vEVI3NPVjuZC1XUyST7RvfM85zQezYrptgGW68OO5jXP8AFojxWoxHpMw49ilVfxOowH+onwXmzcKdqudhrG0oOyr+k+qfYwzG/M9zvANatfX9ImOd7Ios5NJI/M4+S55lCQREFXvoaosJU0ScV0u0g+ZxL28GtYzxa2fFaKs173F73ue45uc4uceZcSStuyiI8+zmqfZNvDJNGlGGVww5W21BFh2eCubSMAxCmrjUCkruqK2v2dUNAxZTVazUdlJU7A6Rq0rs1J3vp06jvzPYXeKyCiQL5jzhUZhrXAngg2+H6c41lmmnx/42j+2FLZ6RcbtFA/gd+j1z4o8Fa2lJNoTTHV0/SVifeo0Ty1m+bipdL0nO9/DDm2p+hZ+q4p9A7B3rG7D7ldR6NR9JlA+1Qqj5Sx3m4KfR9IOCd7RqM+ZhP9msvKjQVr6B2Jo9oodLcC/LEsHzSz+8BbLDaRo1P+urTf8AK9rvIrwQUSrTSDtxummPohF4Dh8VXZ/11qrAPhe9o7gYUmp0kxzmln2mrB3EB35wNYd6uo9oxukqNETWqspg5a7mtnlJute3pbgSYGJp9pgd5svC6mHc5xcXFzjmXEknmTcqVo3Btc8Nq1RSZHt6jn8hqtuVLf8AFkfQVGs17Q5rg5pyIIIPIjNZFxnQgYXDsdTZjadUvdrBtqcWizC4mTtPALswVZUVREVBEWr0tpujh2k1HXiQwXc7k3ntMBBs1y+nOmFKjLaUVXjODDW/M7aeA3XIXHae6XVq8tE06RkBjbufwc7ad7R6oyOstA8SBrmBsYMvC7nclm0TdJ6Zq4l01Hl8GzR6rGn7rbxzu6+ajOpW9cwPhH6/RVGHdYcBJ7hYfVlewxlnvzPfkPBc63GsxNODkQBsi8cBGXYAvbui+jxQwtFgEHUDncXP9Z09pK8r6N4QV8XSY4Swv1nWMEMBeQTx1YjivbF1n4wIiKgiIgIoOkdJUaDdatUaxuzWMExsAzceAuuG016RjduFpz/9KgMfhYDPeRyQeh1KgaC5xAAuSTAA4k5LldJ9PsHSkNc6s7dTEt/OYaRyleZY/FVq/rYis525rnta0cmWaOwBR6VJvZs4q4mur0j6Q8U+RRYykN//AGO4GXANH5SuWxlWrWdr13ve7e8zHyjJo4CFIpU5dnEe7CzMpgkGO02gBTYIlHCNOWaq7CxnCmsLGky4H9O7MqSXMd7Jnz7Vf0a84Y7M1e3DAGTErOQcoVGAgXud6xeo1jC+iDsmLgHfCyNZa43LIAeCrqu4f6UvS4w06bRIBvtG76/VXhuYiwyWRtMzO+yv1Dv3qejEcuEScuSqy4BG0LK6mdpsVXqSs+lxHfRsdWATwVWstfwUjqztOfJWll4m5k5d6noxH1A4R5KoZsj+Fnbh4yt2BVFMzF8s7J6XGBzIyEo1ucgjmpXUcSqvpwJv5p6MRXU4KPZAsCeA4qUKMDWEmc8haMzKvFDinpMQxTtzWGphSQIMR4rZ9TxKtFDVMTmdt8k9JiA6lA9bZmVa2nrXGV4Wy6kn/SCieCejGt+z7xmqNw42dotmtmKBz3oaJ2Af7V0xrRQWB2GcTIIjzW2dhycx9cVUUjuWtRqeom8Kx1K4EEzt3dq2tXCuIgerfNXtoHIieJj9E1WndhQsuHxFWkJp1XsH3HOb4A3WxNI5kW7FjfhpvfMfUKWkS8J0xxzBPWB42B7GnxbB8Vs6HpHrCzsOxzvuuczwId5rROpDYIUX7MdbIRGe8/tmp7MbLSXS/F1zGv1TDbVpktJ5vnW7iBwWrNSZtebn6vzOfFVdRGcXG/gsRBDshzlX2YvNM5iBPvHyaNg4eG1YjTGwEnaTf67SFKaRffynyusVWmTcz2sJ7tdat2J/axur7zm8p1u5rLDvV9erAsCecADs/hVYHDIv7NRo8FHxTnfAT+L9LrEm1b+Oz9GGj9Z9XEOAloFNsTm71nk615jU/MV6UuX9HmC6vBMMQajnVD+Iw3+lrV1C7MiIiAuO9IHSKthWU20GEvqlw19XWDA3VyGRcS4RNrGxXYrnOk2lMTRNPqKTHtdOs5xIAgthoIyLpME2tkUHj+OOIc7rq7aznEj13tI5Aa1o3NFuCuwrdbWE6riLS3IjxFoyBXqjelDXtLK+FqesIcwalQXzBDi0kfhXKaVwNBjvUa4U3e44arqZ+66TLfEdsiejHLvwuIBa6wMga4aHsc0DIyQGk2sYNjvKtpawqOLWwwxbjAkwbiTPet7UoPp2JljvZeNvBw913gdig1KV5XK3LrUmzGLDTrtaTMmOU2/lS37ABbb/AAsOFoE1GQPeb5hSXsHblO1T18Xz9Ryxu5VwLTDzuj/L9JVXtUmizOMnF3c0GPM9y1OrSxjartiFiqAufVakUoP1hJEZrK6mSRBi97Z71cwZdir9d4WNXFdVXNEqx0ERvVW2Fgp6XyuLFY5h1gda0XEZ9queyYuREG31krnH+fruU9LimomoMz2LIFR0C5OXYI4p6MYxTOtMjVjLirnTcNF4tOXarmNMkmI2b+9Zm7Pr6/hPRjBTa7Ii+/YVke0xbPYs4CAJ6MYg3KyvaxXGYnM7BvVackXEHd2/68U9GMb6YIIOX6K3qwIHYJ+tyyUmOvr6udonLjO1XagsSMtvZCejGCjh2tsNu03klZQxYsSx9tRwF7yFlkNgE3yE7SrOk8mp9fXasLcOQ4nXJnJuwfWaz6xmIsRnbPkriP3VnR5Y9S/P/StbB+uav2fXFY2MDRAgBb1PK5zARBEqxrCTIJABiIF/4V7XAHNXdYO1X6mLKtEOBaQSCLqw4Yauq31Rsjv2rKao+vFKeHcSS1r3TsDSc+Q4KWUYxTsNvNW1mgA2mPFTv/H4g5Uan5CPNYq2isRBmg8j5Z8FPPRsatzgXECLfV9ywOpif45fXapr6DwdUtLTuIIPcVb1WrcxuG4fynMpsQyyPLb+gPkotRzQbhp5kDwICmVXjeQOYjucIBUWq8jcR94FvcW2K758xz36xlrfgj8MjwJUSs1v3B4f3BSw5o90s4tgjvb+yxYydWQ6RxA8wYWZ+rXqfo9x/WYNjSQTSJpmDsEFv9JA7CuqXlPotx5biKlLJr6etH3mERH4XOmNwXqy6siIiArHNBEG4KvRBp8XoNjrsJpncAHM7WnIfKWrVVKGKpWcwPZvpme9jr90rrEQcBUbQMyzVM3nWaAeAB1QeS1dbRjM2vjg6/iP2XpOJwTH+00ExEizo5i8cFrH9Gqcy2AeLWu8gFiytS44puHYy4cHOi0ZDZKgVMPORlegO0PUbZmpHzOb4AR4qK/RNfiB90yfF58li87+rOscTTwT5HqnmRAHG+alDDRyFu/+JK6N2BLTdpHF0yVKo4VgF4KvM35C2OKqtDZLnBvMxMhRnYpnuBzvlB8yt5pvo/TZrVWAu2lusZ7Jz5LRMqUzsaOcHzlZ65y/VnSprH4I+ZzR5lOsd8LOx7VIAaBIcR2D9WfqrqYJMes7dZpn8oXOyNzWClUJIBaR4/QUkMU+ngY4k5/sPFX/AGXZ9bFm81djWOaRECZsrw1T/syDDeaxjSG1nmq9XkpzMMq9QfBXE1DDFka3fkpXUHcqmgdmcJhqKykGiGgDkq6ql9QqUsKAIE773vxKmLqMGqrWKaMOrm4fbClVE1FaaUrYjDqvUKfVa80bz3KvUeS2LcNfKyzNw4GasqfGpOFJtcRe23f2LL9iO7gtoQR7LHu+Vrj5BafFaRfJaPVjOxkcxs7V2541z66g/CATrEfsoVUMBzJ2WvdYMRUnN2tO0u1e45FYX1CPasD8Q1f62+qe0Ld5iemdzm7bc7HslZcO9jXAlrXfdfrDuDSCe2QorfxAb7Fve2W94UzDwLWjgBHhY9wUsw/XUaG0i1zmsZh2NnMtgQNp9n9V1C0fR3AajNciC4WERDc9m+3gt4u/O59crm/FURFpEfE4Zjxqva1w3ET3blz2keh9N96bi0/C712nhJ9bvJ5LqUQeTaX6P1qMl7SGj32+s3tOwcHRwXPPBbmNXc5t2nmNy95IXM6W6H0Ksup/8Tz8Ilp5sy7oWbB5WwbQPxM/Vv8AEJUo6wkAO4tMH9j2Qttpbo5Xw51ns9Uf+xhJb2mJbycAOK1vWA3zO8eq79ncslj7rSnRrGNw+Mo1HEta18O1rQ14LHE2yAdO3Je7r54xFyYMjcQAe79oXsvQfSn2jCUy6demOrfOZLAIPa3VPMncuusujREQEREBERAREQEREFpaCIN1FqaPpu92OVvJTEQaitoVpye4c4P7LWV+i0/A7iRB7wupRZvMqy2OHf0OvIZB3tcP8lJo6EcwWYRvPtE9sldeiniL6rlRgnDNju4qx2F4fWxdakJeIeq5A0An2ZdaWDcO5WdQz4W9wWP4v+r7rlxhQs1LBt2roDhGfC3uT7Iz4fNanGJ6rmK1WgDAlxytsO6+SjPxLB7rwOQPkV02J0PRqTrNgxGsLOHbt5GQua0hoavSksHWM+7JcObMxzaT8oTrn5+Lz1/qjcVSPvgfN6v91ipjKQNxF1znXcOBvEcJH6iVJ0bpHq3TAc33mOEC+4gEA5XcvPLNyt38+N6KKuZQnIE8gt9hyxzQ5oaQdwH1KkQuv8Mv9se655mCecmHtt5rMNFvPwt8fJbtFqf+PKe61bNED3nk8gB5ypFLR7GmYk/eMxyGSmItTjmfkS21VRcXgqdQRUY10ZEi45HMHkpSLaOS0l0Qa6TRcWnc4m/4oJI+YOXLYvRVagfWa5g+JsBp5gkscTwIPBeqqhErN5laleTUmkH2Rzb/AMZ7Wmx71v8AQOB6yqJ9lvrOnbGw75MeK6itoOg6/VgH7stHcLHuUjBYFlIEMETcnMlSc1fXxMREW2BERAREQEREBc3pbodha8nV6t596nDZ5tjVPOJ4rpEQeU6U9H+Ibem5lYbB7Du5xj+rsW89HuiMThzVFZmoxwbAJBlwJuIOUE35dncopn1dVREVQREQEREBERAREQEREBERAREQEREBERAREQEREGuxuiqNW72An4hLXfmbBjhktFi+h+2nV5B4y/EyI7l1qLN5l/VlsaDo9oytQLmvc0sI2OJOtaDBYItO07Fv0RWTJhbqqIiqCIiAiIgIiICIiAiIgIiICIiAiIgIiICIiAiIg//Z",
25579
+ available: true,
25580
+ unavailableReason: null,
25581
+ unavailableReasonCode: null,
25582
+ ruleType: "VARIABLE_CREDIT_REWARD",
25583
+ sourceUnit: "POINT",
25584
+ sourceValue: null,
25585
+ prettySourceValue: null,
25586
+ sourceMinValue: 1,
25587
+ prettySourceMinValue: "1 Point",
25588
+ sourceMaxValue: 100,
25589
+ prettySourceMaxValue: "100 Points",
25590
+ destinationMinValue: 1,
25591
+ prettyDestinationMinValue: "1 Salmon Coin",
25592
+ destinationMaxValue: 100,
25593
+ prettyDestinationMaxValue: "100 Salmons",
25594
+ globalRewardKey: null,
25595
+ destinationUnit: "TESTUNIT",
25596
+ steps: [
25597
+ {
25598
+ sourceValue: 1,
25599
+ prettySourceValue: "1 Point",
25600
+ destinationValue: 1,
25601
+ prettyDestinationValue: "1 Salmon Coin",
25602
+ available: true,
25603
+ unavailableReasonCode: null,
25604
+ },
25605
+ {
25606
+ sourceValue: 2,
25607
+ prettySourceValue: "2 Points",
25608
+ destinationValue: 2,
25609
+ prettyDestinationValue: "2 Salmons",
25610
+ available: true,
25611
+ unavailableReasonCode: null,
25612
+ },
25613
+ {
25614
+ sourceValue: 3,
25615
+ prettySourceValue: "3 Points",
25616
+ destinationValue: 3,
25617
+ prettyDestinationValue: "3 Salmons",
25618
+ available: true,
25619
+ unavailableReasonCode: null,
25620
+ },
25621
+ {
25622
+ sourceValue: 4,
25623
+ prettySourceValue: "4 Points",
25624
+ destinationValue: 4,
25625
+ prettyDestinationValue: "4 Salmons",
25626
+ available: true,
25627
+ unavailableReasonCode: null,
25628
+ },
25629
+ {
25630
+ sourceValue: 5,
25631
+ prettySourceValue: "5 Points",
25632
+ destinationValue: 5,
25633
+ prettyDestinationValue: "5 Salmons",
25634
+ available: true,
25635
+ unavailableReasonCode: null,
25636
+ },
25637
+ ],
25638
+ },
25639
+ selectedStep: null,
25640
+ },
25641
+ data: {
25642
+ exchangeList: null,
25643
+ },
25644
+ callbacks: {
25645
+ exchangeReward: null,
25646
+ resetState: null,
25647
+ setStage: null,
25648
+ setExchangeState: null,
25649
+ refs: {
25650
+ drawerRef: {},
25651
+ },
25652
+ },
25653
+ refs: null,
25654
+ };
25655
+
25656
+ const RewardExchangeList_stories = {
25657
+ title: "Components/Reward Exchange List",
25658
+ };
25659
+ const resizable$1 = {
25660
+ width: "683px",
25661
+ minWidth: "260px",
25662
+ resize: "horizontal",
25663
+ height: "fit-content",
25664
+ overflow: "hidden",
25665
+ };
25666
+ const Default$b = () => {
25667
+ return (index.h("div", { style: resizable$1 },
25668
+ index.h(RewardExchangeView, Object.assign({}, test))));
25669
+ };
25670
+ const Default2 = () => {
25671
+ return (index.h("div", { style: { ...resizable$1, height: "700px" } },
25672
+ index.h(RewardExchangeView, Object.assign({}, test2))));
25673
+ };
25674
+
25675
+ const RewardExchangeList = /*#__PURE__*/Object.freeze({
25676
+ __proto__: null,
25677
+ 'default': RewardExchangeList_stories,
25678
+ Default: Default$b,
25679
+ Default2: Default2
25680
+ });
25681
+
24574
25682
  function deepFreeze(obj) {
24575
25683
  if (obj instanceof Map) {
24576
25684
  obj.clear = obj.delete = obj.set = function () {
@@ -27151,7 +28259,9 @@ const CucumberAddon = ({ story }, children) => {
27151
28259
  // No scenario or invalid. Ignoring.
27152
28260
  }
27153
28261
  return (index.h("div", null,
27154
- result && index.h("pre", { innerHTML: result.value }),
28262
+ index.h("details", null,
28263
+ index.h("summary", null, "Specs"),
28264
+ result && index.h("pre", { innerHTML: result.value })),
27155
28265
  children));
27156
28266
  };
27157
28267
 
@@ -27188,7 +28298,7 @@ const stories = [
27188
28298
  ReferralTableRewardsCell$1,
27189
28299
  UserName,
27190
28300
  PasswordField,
27191
- TaskCard,
28301
+ TaskCard$1,
27192
28302
  PortalTemplates,
27193
28303
  ProgramMenu$1,
27194
28304
  PoweredByImg,
@@ -27196,7 +28306,10 @@ const stories = [
27196
28306
  Hero,
27197
28307
  ReferralIframe$1,
27198
28308
  NameFields$1,
28309
+ RewardExchangeList,
27199
28310
  UseRewardExchangeList,
28311
+ UseTaskCard,
28312
+ UseRewardsTable
27200
28313
  ];
27201
28314
  const StencilStorybook = class {
27202
28315
  constructor(hostRef) {
@@ -27236,6 +28349,83 @@ const TableRow = class {
27236
28349
  }
27237
28350
  };
27238
28351
 
28352
+ const TaskCard$2 = class {
28353
+ constructor(hostRef) {
28354
+ index.registerInstance(this, hostRef);
28355
+ this.ignored = true;
28356
+ /**
28357
+ * @uiName Reward Amount
28358
+ */
28359
+ this.rewardAmount = 0;
28360
+ /**
28361
+ * @uiName Reward Unit
28362
+ */
28363
+ this.rewardUnit = "Points";
28364
+ /**
28365
+ * @uiName Title Text
28366
+ */
28367
+ this.cardTitle = "Title Text";
28368
+ /**
28369
+ * @uiName Description Text
28370
+ */
28371
+ this.description = "Description Text";
28372
+ /**
28373
+ * @uiName Goal Repeatable
28374
+ */
28375
+ this.repeatable = false;
28376
+ /**
28377
+ * @uiName Show Progress Bar
28378
+ */
28379
+ this.showProgressBar = false;
28380
+ /**
28381
+ * @uiName Goal Progress Source
28382
+ */
28383
+ this.progressSource = "";
28384
+ /**
28385
+ * @uiName Goal Completion Number
28386
+ */
28387
+ this.goal = 1;
28388
+ /**
28389
+ * @uiName Progress Bar Steps
28390
+ */
28391
+ this.steps = false;
28392
+ /**
28393
+ * @uiName Show Goal Expiry
28394
+ */
28395
+ this.showExpiry = false;
28396
+ /**
28397
+ * @uiName Date Goal Expires
28398
+ * @uiWidget DateRange
28399
+ * @uiOptions {"allowPastDates":true, "months": 1}
28400
+ */
28401
+ this.dateExpires = "/";
28402
+ /**
28403
+ * @uiName CTA Button Text
28404
+ */
28405
+ this.buttonText = "Complete Action";
28406
+ /**
28407
+ * @uiName CTA Button Link
28408
+ */
28409
+ this.buttonLink = "https://example.com/";
28410
+ /**
28411
+ * Select what type of stat to display for the goal. Manual paths are also supported.
28412
+ *
28413
+ * @uiWidget StatTypeSelectWidget
28414
+ * @uiName Stat Type
28415
+ * @uiOptions {"version": 1.1}
28416
+ */
28417
+ this.statType = "/programGoals/count/Referral-Started%2Freferrals";
28418
+ _extends.h$1(this);
28419
+ }
28420
+ disconnectedCallback() { }
28421
+ render() {
28422
+ const { props } = index_module.j() ? useDemoBigStat.useDemoBigStat(this) : useDemoBigStat.useBigStat(this);
28423
+ const { value, statvalue } = props;
28424
+ console.log(props, index_module.j());
28425
+ return (index.h(TaskCardView, Object.assign({}, utils.getProps(this), { progress: value, loading: value === undefined })));
28426
+ }
28427
+ };
28428
+
27239
28429
  const debug$2 = _extends.browser("sq:global");
27240
28430
  const textStyles = `
27241
28431
  sqm-text {
@@ -27308,7 +28498,7 @@ function UserNameView(props) {
27308
28498
  return index.h(index.Host, null, props.loading ? props.loadingText : props.username);
27309
28499
  }
27310
28500
 
27311
- const GET_USER_NAME = index$1.gql `
28501
+ const GET_USER_NAME = sqmLeaderboardRankView.gql `
27312
28502
  query getUserName {
27313
28503
  viewer {
27314
28504
  ... on User {
@@ -27380,11 +28570,14 @@ exports.sqm_referral_table_rewards_cell = ReferralTableRewardsCell;
27380
28570
  exports.sqm_referral_table_status_cell = ReferralTableStatusCell;
27381
28571
  exports.sqm_referral_table_user_cell = ReferralTableUserCell;
27382
28572
  exports.sqm_reward_exchange_list = SqmRewardExchangeList;
28573
+ exports.sqm_rewards_table = RewardsTable;
28574
+ exports.sqm_rewards_table_column = RewardsTableColumn;
27383
28575
  exports.sqm_router = SqmRouter;
27384
28576
  exports.sqm_share_button = ShareButton;
27385
28577
  exports.sqm_share_link = ShareLink;
27386
28578
  exports.sqm_stencilbook = StencilStorybook;
27387
28579
  exports.sqm_table_cell = TableCell$1;
27388
28580
  exports.sqm_table_row = TableRow;
28581
+ exports.sqm_task_card = TaskCard$2;
27389
28582
  exports.sqm_text = Text;
27390
28583
  exports.sqm_user_name = UserName$1;