@saasquatch/mint-components 1.3.2-0 → 1.3.2-12

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 (294) 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} +1961 -529
  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-reward-exchange-list/RewardExchangeList.stories.js +21 -0
  43. package/dist/collection/components/sqm-reward-exchange-list/RewardExchangeListData.js +218 -0
  44. package/dist/collection/components/sqm-reward-exchange-list/SVGs.js +8 -0
  45. package/dist/collection/components/sqm-reward-exchange-list/progressBar.js +32 -41
  46. package/dist/collection/components/sqm-reward-exchange-list/sqm-reward-exchange-list-view.js +171 -88
  47. package/dist/collection/components/sqm-reward-exchange-list/sqm-reward-exchange-list.js +23 -22
  48. package/dist/collection/components/sqm-reward-exchange-list/useRewardExchangeList.js +9 -5
  49. package/dist/collection/components/sqm-rewards-table/UseRewardsTable.stories.js +53 -0
  50. package/dist/collection/components/sqm-rewards-table/sqm-rewards-table-column.js +120 -0
  51. package/dist/collection/components/sqm-rewards-table/useRewardsTable.js +11 -16
  52. package/dist/collection/components/{sqm-rewards-table → sqm-router}/Router.stories.js +0 -0
  53. package/dist/collection/components/sqm-share-button/sqm-share-button.js +1 -1
  54. package/dist/collection/components/sqm-stencilbook/CucumberAddon.js +3 -1
  55. package/dist/collection/components/sqm-stencilbook/sqm-stencilbook.js +9 -1
  56. package/dist/collection/components/sqm-task-card/SVGs.js +0 -6
  57. package/dist/collection/components/sqm-task-card/TaskCard.stories.js +144 -105
  58. package/dist/collection/components/sqm-task-card/UseTaskCard.stories.js +41 -0
  59. package/dist/collection/components/sqm-task-card/progress-bar/SVGs.js +7 -0
  60. package/dist/collection/components/sqm-task-card/progress-bar/progress-bar-view.js +311 -0
  61. package/dist/collection/components/sqm-task-card/progress-bar/progress-bar.stories.js +53 -0
  62. package/dist/collection/components/sqm-task-card/sqm-task-card-view.js +33 -313
  63. package/dist/collection/components/sqm-task-card/sqm-task-card.js +228 -30
  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} +1934 -505
  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-af06ea5b.system.entry.js → p-4052b948.system.entry.js} +1 -1
  163. package/dist/mint-components/{p-57a53dbd.system.entry.js → p-412a9226.system.entry.js} +1 -1
  164. package/dist/mint-components/p-44d0fc80.system.entry.js +1 -0
  165. package/dist/mint-components/{p-844f9bad.entry.js → p-45c752a0.entry.js} +1 -1
  166. package/dist/mint-components/{p-f1e1086e.js → p-46a4269a.js} +17 -2
  167. package/dist/mint-components/p-52802c88.entry.js +13 -0
  168. package/dist/mint-components/p-5480e4ee.entry.js +1 -0
  169. package/dist/mint-components/{p-db723323.system.entry.js → p-55508395.system.entry.js} +1 -1
  170. package/dist/mint-components/{p-844fd903.js → p-563253e8.js} +1 -1
  171. package/dist/mint-components/p-60855d33.system.js +1 -0
  172. package/dist/mint-components/p-67ae18d1.system.entry.js +1 -0
  173. package/dist/mint-components/{p-434ee9c1.js → p-6882070c.js} +1 -1
  174. package/dist/mint-components/{p-1ac9c24b.system.entry.js → p-69bcf4fa.system.entry.js} +1 -1
  175. package/dist/mint-components/p-6bf0a4d9.system.entry.js +1 -0
  176. package/dist/mint-components/p-6e245fa3.system.entry.js +1 -0
  177. package/dist/mint-components/{p-a4a00461.entry.js → p-723ebe45.entry.js} +1 -1
  178. package/dist/mint-components/{p-5dfc6804.system.entry.js → p-73148868.system.entry.js} +1 -1
  179. package/dist/mint-components/{p-6cdc70f4.entry.js → p-8435a22d.entry.js} +1 -1
  180. package/dist/mint-components/p-883a32e7.entry.js +1 -0
  181. package/dist/mint-components/p-9c554ca0.system.js +1 -0
  182. package/dist/mint-components/{p-d3787c3a.entry.js → p-9d6dbb2d.entry.js} +1 -1
  183. package/dist/mint-components/p-9e4fee30.system.entry.js +1 -0
  184. package/dist/mint-components/{p-2bce988c.js → p-a2c3cff3.js} +1 -1
  185. package/dist/mint-components/{p-d9cc041f.entry.js → p-a4c2c7ed.entry.js} +1 -1
  186. package/dist/mint-components/{p-1813b9b9.system.js → p-a6094ff9.system.js} +1 -1
  187. package/dist/mint-components/{p-aba21f90.entry.js → p-ade44a4e.entry.js} +1 -1
  188. package/dist/mint-components/p-b1bb07db.entry.js +1 -0
  189. package/dist/mint-components/p-b47179b8.system.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-2f171597.entry.js → p-b8bd2607.entry.js} +1 -1
  192. package/dist/mint-components/{p-0688c9c2.system.entry.js → p-be2738b0.system.entry.js} +1 -1
  193. package/dist/mint-components/{p-82ab88fe.system.js → p-c6114bfe.system.js} +1 -1
  194. package/dist/mint-components/{p-16535642.system.entry.js → p-c79c608d.system.entry.js} +1 -1
  195. package/dist/mint-components/{p-505f5c59.system.entry.js → p-cca9026f.system.entry.js} +1 -1
  196. package/dist/mint-components/{p-71d942af.entry.js → p-cd410a05.entry.js} +2 -2
  197. package/dist/mint-components/{p-a0cfd3d9.system.js → p-cdeae699.system.js} +1 -1
  198. package/dist/mint-components/{p-3fd33dee.system.entry.js → p-d174d0bc.system.entry.js} +1 -1
  199. package/dist/mint-components/p-d21e0dbd.js +1 -0
  200. package/dist/mint-components/p-d2e71fe0.entry.js +335 -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 +3 -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 +5 -3
  216. package/dist/types/components/sqm-reward-exchange-list/sqm-reward-exchange-list.d.ts +2 -3
  217. package/dist/types/components/sqm-reward-exchange-list/useRewardExchangeList.d.ts +4 -7
  218. package/dist/types/components/sqm-rewards-table/UseRewardsTable.stories.d.ts +16 -0
  219. package/dist/types/components/sqm-rewards-table/sqm-rewards-table-column.d.ts +20 -0
  220. package/dist/types/components/sqm-rewards-table/useRewardsTable.d.ts +33 -0
  221. package/dist/types/components/{sqm-rewards-table → sqm-router}/Router.stories.d.ts +0 -0
  222. package/dist/types/components/sqm-task-card/SVGs.d.ts +0 -1
  223. package/dist/types/components/sqm-task-card/TaskCard.stories.d.ts +3 -1
  224. package/dist/types/components/sqm-task-card/UseTaskCard.stories.d.ts +10 -0
  225. package/dist/types/components/sqm-task-card/progress-bar/SVGs.d.ts +1 -0
  226. package/dist/types/components/sqm-task-card/progress-bar/progress-bar-view.d.ts +10 -0
  227. package/dist/types/components/sqm-task-card/progress-bar/progress-bar.stories.d.ts +12 -0
  228. package/dist/types/components/sqm-task-card/sqm-task-card-view.d.ts +10 -17
  229. package/dist/types/components/sqm-task-card/sqm-task-card.d.ts +45 -11
  230. package/dist/types/components.d.ts +120 -32
  231. package/dist/types/global/android.d.ts +7 -0
  232. package/dist/types/global/demo.d.ts +1 -0
  233. package/dist/types/global/styles.d.ts +1 -1
  234. package/dist/types/stories/features.d.ts +4 -0
  235. package/dist/types/stories/templates.d.ts +4 -0
  236. package/grapesjs/grapesjs.js +1 -1
  237. package/package.json +1 -1
  238. package/dist/cjs/sqm-leaderboard-rank-view-35015d30.js +0 -10
  239. package/dist/cjs/sqm-rewards-table.cjs.entry.js +0 -332
  240. package/dist/cjs/sqm-task-card-view-cb11e56f.js +0 -472
  241. package/dist/cjs/sqm-task-card.cjs.entry.js +0 -32
  242. package/dist/cjs/tslib.es6-0e81fab1.js +0 -56
  243. package/dist/cjs/useChildElements-428ca5b8.js +0 -21
  244. package/dist/collection/components/sqm-reward-exchange-list/assets/Leftward Arrow.svg +0 -3
  245. package/dist/esm/sqm-leaderboard-rank-view-da91f5f3.js +0 -8
  246. package/dist/esm/sqm-rewards-table.entry.js +0 -328
  247. package/dist/esm/sqm-task-card-view-6a082a21.js +0 -469
  248. package/dist/esm/sqm-task-card.entry.js +0 -28
  249. package/dist/esm/tslib.es6-7ac9d7e4.js +0 -53
  250. package/dist/esm/useChildElements-506f00d0.js +0 -19
  251. package/dist/esm-es5/index-2f5dd0a1.js +0 -1
  252. package/dist/esm-es5/sqm-divided-layout_27.entry.js +0 -1
  253. package/dist/esm-es5/sqm-leaderboard-rank-view-da91f5f3.js +0 -1
  254. package/dist/esm-es5/sqm-rewards-table.entry.js +0 -1
  255. package/dist/esm-es5/sqm-task-card-view-6a082a21.js +0 -1
  256. package/dist/esm-es5/sqm-task-card.entry.js +0 -1
  257. package/dist/esm-es5/tslib.es6-7ac9d7e4.js +0 -15
  258. package/dist/esm-es5/useChildElements-506f00d0.js +0 -1
  259. package/dist/esm-es5/useDemoBigStat-b71fe122.js +0 -1
  260. package/dist/mint-components/assets/Leftward Arrow.svg +0 -3
  261. package/dist/mint-components/p-11c75956.entry.js +0 -1
  262. package/dist/mint-components/p-12fb9197.entry.js +0 -1
  263. package/dist/mint-components/p-189219ee.system.js +0 -1
  264. package/dist/mint-components/p-21dfdeb8.entry.js +0 -1
  265. package/dist/mint-components/p-23a0bdae.entry.js +0 -1
  266. package/dist/mint-components/p-2ae9c535.js +0 -1
  267. package/dist/mint-components/p-405a9253.js +0 -227
  268. package/dist/mint-components/p-550b4579.system.entry.js +0 -1
  269. package/dist/mint-components/p-55e02769.entry.js +0 -13
  270. package/dist/mint-components/p-58d9b2f0.js +0 -15
  271. package/dist/mint-components/p-6d545e13.entry.js +0 -1
  272. package/dist/mint-components/p-70837c1c.entry.js +0 -49
  273. package/dist/mint-components/p-795a7259.system.entry.js +0 -1
  274. package/dist/mint-components/p-7c138c84.entry.js +0 -1
  275. package/dist/mint-components/p-7c261ea0.system.entry.js +0 -1
  276. package/dist/mint-components/p-8034f81c.system.entry.js +0 -1
  277. package/dist/mint-components/p-86cd9f79.entry.js +0 -286
  278. package/dist/mint-components/p-8c16f04e.js +0 -1
  279. package/dist/mint-components/p-91d39961.system.js +0 -1
  280. package/dist/mint-components/p-b3af1c6f.js +0 -1
  281. package/dist/mint-components/p-bf04a8e1.system.entry.js +0 -1
  282. package/dist/mint-components/p-bf055b6c.system.js +0 -1
  283. package/dist/mint-components/p-c3866bfa.system.entry.js +0 -1
  284. package/dist/mint-components/p-c9c4f31b.system.entry.js +0 -1
  285. package/dist/mint-components/p-d0913f8d.system.js +0 -1
  286. package/dist/mint-components/p-dd6a666e.system.js +0 -15
  287. package/dist/mint-components/p-dfc3cf82.js +0 -1
  288. package/dist/mint-components/p-e19a57a4.system.entry.js +0 -1
  289. package/dist/mint-components/p-e22eed7b.entry.js +0 -1
  290. package/dist/mint-components/p-e2ebe90c.entry.js +0 -1
  291. package/dist/mint-components/p-ecbabf6e.system.js +0 -1
  292. package/dist/mint-components/p-f41ab9e1.system.js +0 -1
  293. package/dist/mint-components/p-f87d8f53.system.js +0 -1
  294. package/dist/mint-components/p-fcaa5886.system.entry.js +0 -1
@@ -1,10 +1,9 @@
1
1
  import { h, r as registerInstance, c as Host, d as getAssetPath } from './index-17b4da69.js';
2
2
  import { m as h$1, j as useState, e as useEffect, f as useRef, n as d$2, y as y$1, b as browser, u as useReducer, c as createCommonjsModule, a as commonjsGlobal, k as useMemo } from './extends-3a3f9fe2.js';
3
- import { i as intl, a as insertCSS } from './global-5ecbf81a.js';
3
+ import { i as intl, a as insertCSS } from './global-90da933f.js';
4
4
  import { u as useCallback } from './use-callback-b38a1523.js';
5
- import { d as dist, T as T$1, e as en, b as be, j as j$1, Z as Ze, r as rn, D as De, q as qe, P as P$1, E as Ee, M as M$1, a as sn, c as an, x as x$1, f as D$1, L as L$1, N as Ne } from './index.module-f80561db.js';
5
+ import { d as dist, T as T$1, e as en, b as be, j as j$1, Z as Ze, r as rn, D as De, q as qe, P as P$1, E as Ee, M as M$1, a as sn, c as an, x as x$1, f as D$1, L as L$1, N as Ne, A as A$1 } from './index.module-90d2c3ad.js';
6
6
  import { j as jsonpointer } from './jsonpointer-388a7082.js';
7
- import './tslib.es6-7ac9d7e4.js';
8
7
  import { j as jss, c as create } from './jss-preset-default.esm-71fae192.js';
9
8
  import { g as getProps, a as getMissingProps } from './utils-454405f5.js';
10
9
  import { c as cjs } from './cjs-bdfb4486.js';
@@ -12,24 +11,21 @@ import { E as ErrorStyles, H as HostBlock, A as AuthWrapper, a as AuthColumn, b
12
11
  import { P as PortalContainerView } from './sqm-portal-container-view-73757ca5.js';
13
12
  import { P as PortalSectionView } from './sqm-portal-section-view-f0876545.js';
14
13
  import { T as TextSpanView } from './sqm-text-span-view-1781df94.js';
15
- import { g as gql } from './index-2f5dd0a1.js';
16
- import { u as useRerenderListener } from './re-render-9ab5fe0f.js';
17
- import { u as useChildElements } from './useChildElements-506f00d0.js';
18
- import { p as pathToRegexp, B as BigStatView, u as useBigStat, a as useDemoBigStat } from './useDemoBigStat-b71fe122.js';
14
+ import { g as gql, L as LeaderboardRankView } from './sqm-leaderboard-rank-view-47844836.js';
15
+ import { u as useRerenderListener, a as useRequestRerender } from './re-render-e06f2f7f.js';
16
+ import { p as pathToRegexp, B as BigStatView, u as useBigStat, a as useDemoBigStat } from './useDemoBigStat-c3b955b7.js';
19
17
  import { S as ShareLinkView } from './sqm-share-link-view-9282b8e8.js';
20
- import { L as LeaderboardView, u as useLeaderboard, S as ShadowViewAddon } from './ShadowViewAddon-fff5d35d.js';
21
- import { L as LeaderboardRankView } from './sqm-leaderboard-rank-view-da91f5f3.js';
18
+ import { L as LeaderboardView, u as useLeaderboard, S as ShadowViewAddon } from './ShadowViewAddon-a3f510db.js';
22
19
  import { N as NavigationSidebarView } from './sqm-navigation-sidebar-view-2242502c.js';
23
- import { N as NavigationSidebarItemView } from './sqm-navigation-sidebar-item-view-8a3f374b.js';
20
+ import { N as NavigationSidebarItemView } from './sqm-navigation-sidebar-item-view-f2304ad9.js';
24
21
  import { S as StatContainerView } from './sqm-stat-container-view-4133feb6.js';
25
- import { P as PortalProfileView } from './sqm-portal-profile-view-824c8242.js';
22
+ import { P as PortalProfileView } from './sqm-portal-profile-view-b67467b4.js';
26
23
  import { P as PortalForgotPasswordView } from './sqm-portal-forgot-password-view-e3a6a716.js';
27
- import { P as PortalEmailVerificationView } from './sqm-portal-email-verification-view-90781be2.js';
24
+ import { P as PortalEmailVerificationView } from './sqm-portal-email-verification-view-8cefe480.js';
28
25
  import { P as PortalResetPasswordView$1 } from './sqm-portal-reset-password-view-a4e50da2.js';
29
26
  import { P as PortalVerifyEmailView } from './sqm-portal-verify-email-view-6f18bac2.js';
30
27
  import { A as AssetCardView } from './sqm-asset-card-view-6f360937.js';
31
- import { T as TaskCardView, P as ProgressBar$2 } from './sqm-task-card-view-6a082a21.js';
32
- import { P as PoweredByImg$1, a as PortalFooterView } from './sqm-portal-footer-view-c317518e.js';
28
+ import { P as PoweredByImg$1, a as PortalFooterView } from './sqm-portal-footer-view-d9fe0bf8.js';
33
29
  import { H as HeroView } from './sqm-hero-view-bfd8abd1.js';
34
30
  import { N as NameFieldsView } from './sqm-name-fields-view-4162fb7b.js';
35
31
 
@@ -5876,6 +5872,21 @@ function ReferralTableView(props) {
5876
5872
  h("sl-button", { size: "small", loading: states.loading, disabled: !states.hasNext, onClick: callbacks.nextPage, exportparts: "base: defaultbutton-base" }, data.textOverrides.moreLabel))));
5877
5873
  }
5878
5874
 
5875
+ function useChildElements() {
5876
+ const host = P$1();
5877
+ const initialState = host.children.length ? Array.from(host.children) : [];
5878
+ const [childElements, setChildElements] = useState(initialState);
5879
+ useEffect(() => {
5880
+ const observer = new MutationObserver(() => {
5881
+ const children = Array.from(host.children);
5882
+ setChildElements([...children]);
5883
+ });
5884
+ observer.observe(host, { childList: true });
5885
+ return () => observer.disconnect();
5886
+ }, [host]);
5887
+ return childElements;
5888
+ }
5889
+
5879
5890
  const GET_REFERRER_DATA = gql `
5880
5891
  query getReferrals($programId: ID, $rewardFilter: RewardFilterInput) {
5881
5892
  viewer {
@@ -14766,6 +14777,8 @@ const GET_EXCHANGE_LIST = dist.gql `
14766
14777
  prettySourceValue
14767
14778
  destinationValue
14768
14779
  prettyDestinationValue
14780
+ available
14781
+ unavailableReasonCode
14769
14782
  }
14770
14783
  }
14771
14784
  totalCount
@@ -14784,7 +14797,7 @@ const EXCHANGE = dist.gql `
14784
14797
  }
14785
14798
  }
14786
14799
  `;
14787
- function useRewardExchangeList(_) {
14800
+ function useRewardExchangeList(props) {
14788
14801
  var _a, _b, _c, _d;
14789
14802
  const drawerRef = useRef();
14790
14803
  const [exchangeState, setExchangeState] = useReducer((state, next) => ({
@@ -14793,14 +14806,14 @@ function useRewardExchangeList(_) {
14793
14806
  }), {
14794
14807
  selectedItem: undefined,
14795
14808
  selectedStep: undefined,
14796
- redeemStage: "",
14809
+ redeemStage: "chooseReward",
14797
14810
  amount: 0,
14798
14811
  exchangeError: false,
14799
14812
  });
14800
14813
  const { selectedItem, selectedStep, redeemStage, amount, exchangeError } = exchangeState;
14801
14814
  const user = T$1();
14802
14815
  const [exchange, { data: exchangeResponse, errors }] = be(EXCHANGE);
14803
- const { data } = en(GET_EXCHANGE_LIST, !(user === null || user === void 0 ? void 0 : user.jwt));
14816
+ const { data, loading } = en(GET_EXCHANGE_LIST, !(user === null || user === void 0 ? void 0 : user.jwt));
14804
14817
  useEffect(() => {
14805
14818
  var _a, _b;
14806
14819
  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) {
@@ -14871,7 +14884,6 @@ function useRewardExchangeList(_) {
14871
14884
  globalRewardKey: selectedItem.globalRewardKey,
14872
14885
  };
14873
14886
  }
14874
- console.log(exchangeVariables);
14875
14887
  exchange({ exchangeRewardInput: exchangeVariables });
14876
14888
  }
14877
14889
  const resetState = useCallback((e) => {
@@ -14900,14 +14912,17 @@ function useRewardExchangeList(_) {
14900
14912
  function setStage(stage) {
14901
14913
  setExchangeState({ redeemStage: stage });
14902
14914
  }
14903
- console.log(exchangeResponse, exchangeResponse === null || exchangeResponse === void 0 ? void 0 : exchangeResponse.data, errors);
14904
14915
  return {
14905
14916
  states: {
14917
+ content: {
14918
+ text: props,
14919
+ },
14906
14920
  selectedItem,
14907
14921
  redeemStage,
14908
14922
  amount,
14909
14923
  selectedStep,
14910
14924
  exchangeError,
14925
+ loading,
14911
14926
  },
14912
14927
  data: {
14913
14928
  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,
@@ -14926,6 +14941,12 @@ function useRewardExchangeList(_) {
14926
14941
  };
14927
14942
  }
14928
14943
 
14944
+ const ExchangeArrows = () => (h("svg", { width: "30", height: "30", viewBox: "0 0 30 30", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
14945
+ h("circle", { cx: "15", cy: "15", r: "15", fill: "white" }),
14946
+ 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" })));
14947
+ const CheckMark = () => (h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "10", height: "7", viewBox: "0 0 10 7", fill: "none" },
14948
+ 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" })));
14949
+
14929
14950
  function Dot({ active, completed, incomplete, }) {
14930
14951
  return (h("div", { style: {
14931
14952
  flex: "0 0 0",
@@ -14940,60 +14961,50 @@ function Dot({ active, completed, incomplete, }) {
14940
14961
  justifyContent: "center",
14941
14962
  columnGap: "50px",
14942
14963
  marginRight: "-2px",
14964
+ boxSizing: "content-box",
14943
14965
  } },
14944
14966
  h("div", { style: {
14945
14967
  backgroundColor: completed ? "#9E9E9E" : "#FFF",
14946
14968
  border: active
14947
- ? "2px solid #9E9E9E"
14969
+ ? "3px solid #9E9E9E"
14948
14970
  : incomplete
14949
- ? "2px solid #E5E5E5"
14950
- : "none",
14971
+ ? "3px solid #E5E5E5"
14972
+ : "3px solid #9E9E9E",
14951
14973
  borderRadius: "50%",
14952
- width: completed ? "12px" : "8px",
14953
- height: completed ? "12px" : "8px",
14954
- margin: "-4px auto 0px",
14974
+ width: "10px",
14975
+ height: "10px",
14976
+ margin: "-6px auto 0px",
14955
14977
  zIndex: "1",
14956
- } })));
14978
+ boxSizing: "content-box",
14979
+ } }, completed && (h("div", { style: { top: "-6px", position: "relative" } },
14980
+ h(CheckMark, null))))));
14981
+ }
14982
+ function ProgressLine({ incomplete = false, active = false }) {
14983
+ return (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
+ } }));
14957
14998
  }
14958
14999
  function Progress({ active, completed, incomplete }) {
14959
15000
  return [
14960
- h("div", { style: {
14961
- content: "''",
14962
- flex: "0.5 0.5 0",
14963
- height: "4px",
14964
- borderRadius: "4px",
14965
- background: incomplete ? "#E5E5E5" : "#9E9E9E",
14966
- position: "relative",
14967
- bottom: "0",
14968
- left: "0",
14969
- display: "flex",
14970
- justifyContent: "center",
14971
- columnGap: "50px",
14972
- marginRight: "-2px",
14973
- } }),
15001
+ h(ProgressLine, { incomplete: incomplete }),
14974
15002
  h(Dot, { active: active, completed: completed, incomplete: incomplete }),
14975
- h("div", { style: {
14976
- content: "''",
14977
- flex: "0.5 0.5 0",
14978
- height: "4px",
14979
- borderRadius: "4px",
14980
- background: incomplete || active ? "#E5E5E5" : "#9E9E9E",
14981
- position: "relative",
14982
- bottom: "0",
14983
- left: "0",
14984
- display: "flex",
14985
- justifyContent: "center",
14986
- columnGap: "50px",
14987
- marginRight: "-2px",
14988
- } }),
15003
+ h(ProgressLine, { incomplete: incomplete, active: active }),
14989
15004
  ];
14990
15005
  }
14991
- function ProgressBar({ stage }) {
14992
- console.log({ stage });
14993
- return (h("div", { style: { display: "flex", columnGap: "-2px" } },
14994
- h(Progress, { active: stage === 0, completed: stage > 0, incomplete: stage < 0 }),
14995
- h(Progress, { active: stage === 1, completed: stage > 1, incomplete: stage < 1 }),
14996
- h(Progress, { active: stage === 2, completed: stage > 2, incomplete: stage < 2 })));
15006
+ function ProgressBar({ stageCount, currentStage, }) {
15007
+ return (h("div", { style: { display: "flex", columnGap: "-2px" } }, Array.from(Array(stageCount).keys()).map((stage) => (h(Progress, { active: currentStage === stage, completed: currentStage > stage, incomplete: currentStage < stage })))));
14997
15008
  }
14998
15009
 
14999
15010
  const stageList = ["chooseReward", "chooseAmount", "confirmation", "success"];
@@ -15005,38 +15016,43 @@ const stageProgressList = {
15005
15016
  function RewardExchangeView(props) {
15006
15017
  const style = {
15007
15018
  Container: {
15019
+ padding: "var(--sl-spacing-medium)",
15008
15020
  position: "relative",
15009
- display: "flex",
15010
15021
  },
15011
15022
  CardContainer: {
15012
- "&:hover": {
15013
- boxShadow: "0 3px 10px #87ceeb6e!important",
15023
+ "&:active": {
15024
+ //boxShadow: "0 3px 10px #87ceeb6e!important",
15014
15025
  },
15015
15026
  },
15016
15027
  Base: {
15017
- display: "block",
15028
+ display: "flex",
15018
15029
  cursor: "pointer",
15019
15030
  textAlign: "center",
15031
+ height: "120px",
15020
15032
  "&::part(base)": {
15033
+ boxShadow: "none",
15021
15034
  width: "100%",
15022
- height: "170px",
15035
+ // maxWidth: "350px",
15023
15036
  display: "flex",
15024
- justifyContent: "space-between",
15025
- alignItems: "center",
15037
+ margin: "0 auto",
15026
15038
  },
15027
15039
  "&::part(body)": {
15028
- padding: "10px 0",
15040
+ padding: 0,
15041
+ display: "flex",
15042
+ width: "100%",
15029
15043
  },
15030
15044
  },
15031
15045
  Drawer: {
15032
15046
  "&::part(base)": {
15033
15047
  minWidth: "400px",
15048
+ maxWidth: "700px",
15034
15049
  width: "50%",
15035
15050
  margin: "0 auto",
15036
15051
  right: "0",
15037
15052
  },
15038
15053
  "&::part(panel)": {
15039
15054
  height: "85vh",
15055
+ width: "100%",
15040
15056
  },
15041
15057
  },
15042
15058
  FullImage: {
@@ -15046,8 +15062,9 @@ function RewardExchangeView(props) {
15046
15062
  },
15047
15063
  PreviewImage: {
15048
15064
  objectFit: "contain",
15049
- maxWidth: "100%",
15050
- height: "75px",
15065
+ width: "120px",
15066
+ height: "120px",
15067
+ flex: 0.33,
15051
15068
  },
15052
15069
  InputBox: {
15053
15070
  width: "100%",
@@ -15062,7 +15079,9 @@ function RewardExchangeView(props) {
15062
15079
  },
15063
15080
  },
15064
15081
  Buttons: {
15065
- bottom: "0",
15082
+ marginLeft: "auto",
15083
+ width: "100%",
15084
+ maxWidth: "300px",
15066
15085
  },
15067
15086
  Button: {
15068
15087
  margin: "10px 0",
@@ -15070,6 +15089,51 @@ function RewardExchangeView(props) {
15070
15089
  textAlign: "center",
15071
15090
  cursor: "pointer",
15072
15091
  },
15092
+ ProgressBar: {
15093
+ fontSize: "80%",
15094
+ marginBottom: "20px",
15095
+ "& .text-area": {
15096
+ marginTop: "5px",
15097
+ display: "flex",
15098
+ justifyContent: "center",
15099
+ textAlign: "center",
15100
+ whiteSpace: "nowrap",
15101
+ marginBottom: "6px",
15102
+ "& .text": {
15103
+ flex: "1 1 0",
15104
+ },
15105
+ "& .text.subdued": {
15106
+ color: "#BDBDBD",
15107
+ },
15108
+ },
15109
+ },
15110
+ KutayCard: {
15111
+ "&::part(base)": {
15112
+ boxShadow: "none",
15113
+ },
15114
+ },
15115
+ KutayButton: {
15116
+ display: "flex",
15117
+ flexWrap: "wrap",
15118
+ margin: "var(--sl-spacing-medium) 0",
15119
+ "& .cancel": {
15120
+ width: "150px",
15121
+ marginLeft: "auto",
15122
+ marginRight: "var(--sl-spacing-medium)",
15123
+ "&::part(base)": {
15124
+ fontWeight: "var(--sl-font-weight-normal)",
15125
+ color: "var(--sl-color-neutral-1000)",
15126
+ },
15127
+ },
15128
+ "& .continue": {
15129
+ width: "150px",
15130
+ "&::part(base)": {
15131
+ background: "var(--sl-color-neutral-500)",
15132
+ fontWeight: "var(--sl-font-weight-normal)",
15133
+ color: "var(--sl-color-neutral-0)",
15134
+ },
15135
+ },
15136
+ },
15073
15137
  };
15074
15138
  // JSS config
15075
15139
  jss.setup(create());
@@ -15078,79 +15142,121 @@ function RewardExchangeView(props) {
15078
15142
  const { states, data, callbacks, refs } = props;
15079
15143
  const { selectedItem, selectedStep } = states;
15080
15144
  function getInput() {
15081
- var _a;
15145
+ var _a, _b;
15082
15146
  const item = states.selectedItem;
15083
15147
  if (!item || (item === null || item === void 0 ? void 0 : item.ruleType) === "FIXED_GLOBAL_REWARD")
15084
15148
  return h("span", null);
15149
+ if (!((_a = item.steps) === null || _a === void 0 ? void 0 : _a.length)) {
15150
+ return h("p", null,
15151
+ "Not enough ",
15152
+ item.sourceUnit,
15153
+ " to redeem for this reward.");
15154
+ }
15085
15155
  return (h("sl-select", { style: { width: "auto" }, label: "Select amount to receive", class: sheet.classes.Select, value: states.selectedStep, "onSl-select": (e) => {
15086
15156
  var _a, _b, _c, _d, _e;
15087
15157
  return callbacks.setExchangeState({
15088
15158
  amount: (_c = (_b = (_a = e.detail) === null || _a === void 0 ? void 0 : _a.item) === null || _b === void 0 ? void 0 : _b.value) === null || _c === void 0 ? void 0 : _c.sourceValue,
15089
15159
  selectedStep: (_e = (_d = e.detail) === null || _d === void 0 ? void 0 : _d.item) === null || _e === void 0 ? void 0 : _e.value,
15090
15160
  });
15091
- } }, (_a = item === null || item === void 0 ? void 0 : item.steps) === null || _a === void 0 ? void 0 : _a.map((step) => (h("sl-menu-item", { value: step },
15161
+ } }, (_b = item.steps) === null || _b === void 0 ? void 0 : _b.map((step) => (h("sl-menu-item", { value: step, disabled: !step.available },
15092
15162
  step.prettyDestinationValue,
15093
- h("span", { slot: "suffix", style: { fontSize: "75%" } }, step.prettySourceValue))))));
15163
+ h("div", { slot: "suffix", style: { fontSize: "75%", float: "right" } },
15164
+ step.prettySourceValue,
15165
+ step.unavailableReasonCode && (h("p", { style: { fontSize: "70%", color: "#F2994A" } }, step.unavailableReasonCode))))))));
15094
15166
  }
15095
15167
  function chooseReward() {
15096
15168
  var _a;
15097
- const nextStage = (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.ruleType) === "FIXED_GLOBAL_REWARD"
15098
- ? "confirmation"
15099
- : "chooseAmount";
15100
- console.log({ nextStage, ruleType: selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.ruleType });
15101
- return (h("div", { style: {
15102
- display: "flex",
15103
- justifyContent: "center",
15104
- flexWrap: "wrap",
15105
- alignItems: "center",
15106
- columnGap: "12px",
15107
- rowGap: "12px",
15108
- } }, (_a = data.exchangeList) === null || _a === void 0 ? void 0 :
15109
- _a.map((item) => {
15169
+ const nextStage = "chooseAmount";
15170
+ // console.log({ nextStage, ruleType: selectedItem?.ruleType });
15171
+ return [
15172
+ h("div", { style: {
15173
+ display: "grid",
15174
+ justifyContent: "center",
15175
+ gap: "20px",
15176
+ gridTemplateColumns: "repeat(auto-fill, minmax(300px, 1fr))",
15177
+ } }, (_a = data.exchangeList) === null || _a === void 0 ? void 0 : _a.map((item) => {
15110
15178
  const style = {
15111
- boxShadow: item.key === (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.key) ? "0 1px 8px #87ceeb" : "none",
15179
+ boxShadow: item.key === (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.key)
15180
+ ? "0 0 0 2px var(--sl-color-primary-500)"
15181
+ : "none",
15112
15182
  marginBottom: "10px 0",
15183
+ borderRadius: "var(--sl-border-radius-medium)",
15113
15184
  flex: "1",
15114
- minWidth: "45%",
15185
+ minWidth: "100%",
15186
+ color: !item.available && "#eee",
15115
15187
  };
15116
- return (h("div", { key: item.key, class: sheet.classes.CardContainer, style: style },
15117
- h("sl-card", { class: sheet.classes.Base, onClick: () => callbacks.setExchangeState({ selectedItem: item }), disabled: !item.available },
15188
+ const amount = item.ruleType === "FIXED_GLOBAL_REWARD"
15189
+ ? item.prettySourceValue
15190
+ : `${item.sourceMinValue} to ${item.prettySourceMaxValue}`;
15191
+ return (h("div", { key: item.key, class: item.available ? sheet.classes.CardContainer : "", style: style },
15192
+ h("sl-card", { class: sheet.classes.Base, onClick: () => item.available &&
15193
+ callbacks.setExchangeState({ selectedItem: item }) },
15194
+ item.key === (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.key) && (h("div", { style: {
15195
+ width: "18px",
15196
+ height: "18px",
15197
+ borderRadius: "50%",
15198
+ background: "var(--sl-color-primary-500)",
15199
+ position: "relative",
15200
+ margin: "-9px",
15201
+ left: "350px",
15202
+ } },
15203
+ h("div", { style: { position: "relative", top: "-6px" } },
15204
+ h(CheckMark, null)))),
15205
+ // item?.imageUrl &&
15118
15206
  h("img", { class: sheet.classes.PreviewImage, src: (item === null || item === void 0 ? void 0 : item.imageUrl) || getAssetPath("./assets/Reward-icon.png") }),
15119
- h("p", null, item.description))));
15120
- }),
15121
- h("div", { class: sheet.classes.Buttons },
15122
- h("sl-button", { onClick: () => callbacks.setStage(nextStage), style: { display: "block" }, class: sheet.classes.Button, disabled: !states.selectedItem }, "Continue"),
15123
- 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"))));
15207
+ h("p", { style: {
15208
+ textAlign: "left",
15209
+ margin: "0",
15210
+ flex: "1",
15211
+ fontSize: "90%",
15212
+ padding: "8px",
15213
+ } },
15214
+ h("b", null, item.description),
15215
+ h("p", { style: { margin: "0" } }, amount),
15216
+ item.unavailableReasonCode && (h("p", { style: {
15217
+ fontSize: "70%",
15218
+ color: "#F2994A",
15219
+ marginTop: "0",
15220
+ } }, item.unavailableReasonCode ===
15221
+ "INSUFFICIENT_REDEEMABLE_CREDIT"
15222
+ ? "Not enough points"
15223
+ : item.unavailableReasonCode))))));
15224
+ })),
15225
+ h("div", { class: sheet.classes.KutayButton },
15226
+ h("sl-button", { class: "continue", size: "large", onClick: () => callbacks.setStage(nextStage), disabled: !states.selectedItem }, "Continue")),
15227
+ ];
15124
15228
  }
15125
15229
  function chooseAmount() {
15126
15230
  const input = getInput();
15127
15231
  return (h("div", null,
15128
15232
  h("div", { style: { width: "50%", margin: "0 auto" } }, (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.imageUrl) && (h("img", { class: sheet.classes.FullImage, src: selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.imageUrl }))),
15233
+ h("p", null, selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.description),
15129
15234
  h("div", { class: sheet.classes.InputBox }, input),
15130
- h("div", { class: sheet.classes.Buttons },
15131
- h("sl-button", { onClick: () => callbacks.setStage("confirmation"), disabled: input && !states.amount, style: { display: "block" }, class: sheet.classes.Button }, "Continue"),
15132
- h("a", { onClick: () => callbacks.setStage("chooseReward"), style: { display: "block" }, class: sheet.classes.Button }, "Back"))));
15235
+ h("div", { class: sheet.classes.KutayButton },
15236
+ h("sl-button", { class: "cancel", size: "large", type: "text", onClick: () => callbacks.setStage("chooseReward") }, "Cancel"),
15237
+ h("sl-button", { class: "continue", size: "large", onClick: () => callbacks.setStage("confirmation"), disabled: states.selectedItem.ruleType !== "FIXED_GLOBAL_REWARD" ||
15238
+ (input && !states.amount) }, "Continue to confirmation"))));
15133
15239
  }
15134
- console.log({ selectedItem, selectedStep });
15240
+ // console.log({ selectedItem, selectedStep });
15135
15241
  function confirmation() {
15136
- console.log("confirmation:", { selectedItem });
15137
- const redemptionAmount = () => {
15138
- var _a;
15139
- if ((selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.ruleType) === "FIXED_GLOBAL_REWARD") {
15140
- 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}`;
15141
- }
15142
- else {
15143
- const amount = states.amount;
15144
- 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}`;
15145
- return `Redeem ${amount} ${selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.sourceUnit} for ${reward}`;
15146
- }
15147
- };
15148
- const previousStage = (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.ruleType) === "FIXED_GLOBAL_REWARD"
15149
- ? "chooseReward"
15150
- : "chooseAmount";
15242
+ const previousStage = "chooseAmount";
15151
15243
  return (h("div", null,
15152
- h("h2", null, "Confirm your redemption:"),
15153
- redemptionAmount(),
15244
+ h("h2", null, "Confirm and redeem"),
15245
+ h("div", { style: { textAlign: "center" } },
15246
+ h("p", null,
15247
+ h("b", null, selectedStep === null || selectedStep === void 0 ? void 0 : selectedStep.prettySourceValue)),
15248
+ h("p", null,
15249
+ h(ExchangeArrows, null)),
15250
+ h("div", { class: sheet.classes.CardContainer, style: {
15251
+ boxShadow: "none",
15252
+ marginBottom: "10px",
15253
+ flex: "1",
15254
+ minWidth: "100%",
15255
+ } },
15256
+ h("sl-card", { class: sheet.classes.Base },
15257
+ h("img", { class: sheet.classes.PreviewImage, src: (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.imageUrl) ||
15258
+ getAssetPath("./assets/Reward-icon.png") }),
15259
+ h("p", { style: { marginBottom: "0", flex: "1" } }, selectedStep === null || selectedStep === void 0 ? void 0 : selectedStep.prettyDestinationValue)))),
15154
15260
  h("div", { class: sheet.classes.Buttons },
15155
15261
  h("sl-button", { onClick: callbacks.exchangeReward, style: { display: "block" }, class: sheet.classes.Button }, "Redeem"),
15156
15262
  h("a", { onClick: () => callbacks.setStage(previousStage), style: { display: "block" }, class: sheet.classes.Button }, "Back"))));
@@ -15159,8 +15265,7 @@ function RewardExchangeView(props) {
15159
15265
  return (h("div", { style: { textAlign: "center" } },
15160
15266
  h("img", { class: sheet.classes.FullImage, src: getAssetPath("./assets/Reward-icon.png") }),
15161
15267
  h("p", { style: { color: "forestgreen" } }, "Reward Redeemed"),
15162
- (data === null || data === void 0 ? void 0 : data.fuelTankCode) && h("pre", null, data === null || data === void 0 ? void 0 : data.fuelTankCode),
15163
- 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")));
15268
+ (data === null || data === void 0 ? void 0 : data.fuelTankCode) && h("pre", null, data === null || data === void 0 ? void 0 : data.fuelTankCode)));
15164
15269
  }
15165
15270
  const stages = {
15166
15271
  chooseReward: () => chooseReward(),
@@ -15171,71 +15276,48 @@ function RewardExchangeView(props) {
15171
15276
  const currentStage = stages[states.redeemStage];
15172
15277
  function stageMap() {
15173
15278
  const stageNumber = stageList.indexOf(states.redeemStage);
15174
- return (h("div", { style: { fontSize: "80%" } },
15175
- h(ProgressBar, { stage: stageNumber }),
15176
- h("div", { style: {
15177
- marginTop: "5px",
15178
- display: "flex",
15179
- justifyContent: "center",
15180
- textAlign: "center",
15181
- whiteSpace: "nowrap",
15182
- marginBottom: "10px",
15183
- } }, Object.keys(stageProgressList).map((stage) => {
15184
- if (stage === states.redeemStage)
15185
- return (h("b", { style: { flex: "1 1 0" } },
15186
- " ",
15187
- stageProgressList[stage]));
15188
- return h("i", { style: { flex: "1 1 0" } }, stageProgressList[stage]);
15189
- }))));
15279
+ return (h("div", { class: sheet.classes.ProgressBar },
15280
+ h("div", { class: "text-area" }, Object.keys(stageProgressList).map((stage) => {
15281
+ if (stage === states.redeemStage) {
15282
+ return h("span", { class: "text" }, stageProgressList[stage]);
15283
+ }
15284
+ else {
15285
+ return (h("span", { class: "text subdued" }, stageProgressList[stage]));
15286
+ }
15287
+ })),
15288
+ h(ProgressBar, { stageCount: 3, currentStage: stageNumber })));
15190
15289
  }
15191
- const Label = () => {
15192
- if (states.redeemStage === "success")
15193
- return "";
15194
- let previousStage = "";
15195
- if (states.redeemStage === "confirmation") {
15196
- previousStage =
15197
- (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.ruleType) === "FIXED_GLOBAL_REWARD"
15198
- ? "chooseReward"
15199
- : "chooseAmount";
15200
- }
15201
- else if (states.redeemStage === "chooseAmount") {
15202
- previousStage = "chooseReward";
15203
- }
15204
- const LeftArrow = () => (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" } },
15205
- 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" })));
15206
- return (h("div", { slot: "label" },
15207
- h("a", { style: { cursor: "pointer", fontSize: "80%", color: "#858585" }, onClick: () => callbacks.setStage(previousStage) },
15208
- h(LeftArrow, null),
15209
- " Back")));
15210
- };
15290
+ console.log(props);
15211
15291
  return (h("div", { class: sheet.classes.Container },
15212
15292
  h("style", { type: "text/css" }, styleString),
15213
15293
  h("div", null,
15214
- h("sl-drawer", { ref: (ref) => (refs.drawerRef.current = ref), placement: "right", class: sheet.classes.Drawer, open: stageList.indexOf(states.redeemStage) >= 0 },
15215
- h(Label, null),
15216
- stageMap(),
15217
- currentStage && currentStage(),
15218
- states.exchangeError && "Something went wrong. Please contact support or try again."),
15219
- h("sl-button", { onClick: () => callbacks.openDrawer() }, "Redeem Rewards"))));
15294
+ stageMap(),
15295
+ currentStage && currentStage(),
15296
+ states.exchangeError &&
15297
+ "Something went wrong. Please contact support or try again.")));
15220
15298
  }
15221
15299
 
15222
15300
  const SqmRewardExchangeList = class {
15223
15301
  constructor(hostRef) {
15224
15302
  registerInstance(this, hostRef);
15225
15303
  this.ignored = true;
15304
+ /**
15305
+ * @uiName Exchange button text
15306
+ */
15307
+ this.buttonText = "Exchange Rewards";
15226
15308
  h$1(this);
15227
15309
  }
15228
15310
  disconnectedCallback() { }
15229
15311
  render() {
15230
- const missingProps = getMissingProps([
15231
- {
15232
- attribute: "listType",
15233
- value: this.listType,
15234
- },
15235
- ]);
15236
- if (missingProps) {
15237
- return h(RequiredPropsError, { missingProps: missingProps });
15238
- }
15312
+ // const missingProps = getMissingProps([
15313
+ // {
15314
+ // attribute: "listType",
15315
+ // value: this.listType,
15316
+ // },
15317
+ // ]);
15318
+ // if (missingProps) {
15319
+ // return <RequiredPropsError missingProps={missingProps} />;
15320
+ // }
15239
15321
  const { states, data, callbacks, refs } = j$1()
15240
15322
  ? useRewardExchangeListDemo(getProps(this))
15241
15323
  : useRewardExchangeList(getProps(this));
@@ -15247,13 +15329,13 @@ function useRewardExchangeListDemo(props) {
15247
15329
  return cjs({
15248
15330
  states: {
15249
15331
  content: {
15250
- listType: "https://example.com",
15251
- ...props,
15332
+ text: props,
15252
15333
  },
15253
- redeemStage: "",
15334
+ redeemStage: "chooseReward",
15254
15335
  amount: 0,
15255
15336
  selectedStep: undefined,
15256
15337
  exchangeError: false,
15338
+ loading: false,
15257
15339
  },
15258
15340
  data: {
15259
15341
  shareCode: "SHARECODE123",
@@ -15270,146 +15352,484 @@ function useRewardExchangeListDemo(props) {
15270
15352
  }, props.demoData || {}, { arrayMerge: (_, a) => a });
15271
15353
  }
15272
15354
 
15273
- const debug$1 = browser("sq:useRouter");
15274
- function matchPath(pattern, page) {
15275
- if (!pattern)
15276
- return;
15277
- const regexp = pathToRegexp(pattern);
15278
- return regexp.exec(page);
15279
- }
15280
- function useRouter() {
15281
- const location = an();
15282
- const host = P$1();
15283
- const [slot, setSlot] = useState(undefined);
15284
- const [container, setContainer] = useState(undefined);
15285
- const page = location.pathname;
15286
- // convert sqm-routes into templates
15287
- useEffect(() => {
15288
- const routes = host.querySelectorAll(`sqm-route`);
15289
- const routesArray = Array.from(routes);
15290
- routesArray.forEach((route) => {
15291
- const newTemplate = document.createElement("template");
15292
- newTemplate.setAttribute("path", route.path);
15293
- newTemplate.innerHTML = route.innerHTML;
15294
- route.parentNode.appendChild(newTemplate);
15295
- route.parentNode.removeChild(route);
15296
- });
15297
- }, []);
15298
- useEffect(() => {
15299
- var _a, _b;
15300
- if (!container || !slot) {
15301
- debug$1("DOM not ready for navigation rendering on:", page);
15302
- return;
15303
- }
15304
- // <template>
15305
- const templates = slot.querySelectorAll(`template`);
15306
- const templatesArray = Array.from(templates);
15307
- const template = templatesArray.find((template) => {
15308
- var _a, _b, _c;
15309
- //@ts-ignore
15310
- const path = (_b = (_a = template.attributes) === null || _a === void 0 ? void 0 : _a.path) === null || _b === void 0 ? void 0 : _b.nodeValue;
15311
- if ((_c = matchPath(path, page)) === null || _c === void 0 ? void 0 : _c.length)
15312
- return template;
15313
- });
15314
- //@ts-ignore - can't access template attributes directly
15315
- 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;
15316
- debug$1({
15317
- containerDatasetPage: container.dataset.page,
15318
- templatePath,
15319
- page,
15320
- });
15321
- // if no routes found, and the old route doesn't match the new route
15322
- if (!template) {
15323
- // No matching page, display nothing
15324
- debug$1("No matching page found for ", page, ", so render nothing");
15325
- container.innerHTML = "";
15326
- container.dataset.page = page;
15327
- return;
15328
- }
15329
- debug$1("Page updated to ", page, template);
15330
- // if pathToRegexp results truthy or page is an exact match
15331
- if (!!matchPath(templatePath, container.dataset.page)) {
15332
- debug$1("don't rerender");
15333
- // Same page, do not re-render
15334
- // Reduces dom mutations, speeds up page speed
15335
- }
15336
- else if (template) {
15337
- container.innerHTML = template.innerHTML;
15338
- container.dataset.page = page;
15339
- }
15340
- }, [slot, container, page]);
15341
- return {
15342
- callbacks: {
15343
- setSlot,
15344
- setContainer,
15345
- },
15346
- };
15347
- }
15348
-
15349
- const sqmRouterCss = "sqm-router{display:contents}";
15350
-
15351
- const SqmRouter = class {
15352
- constructor(hostRef) {
15353
- registerInstance(this, hostRef);
15354
- this.ignored = true;
15355
- h$1(this);
15356
- }
15357
- disconnectedCallback() { }
15358
- render() {
15359
- const { callbacks } = useRouter();
15360
- return (h(Host, null, h("div", { ref: callbacks.setSlot, style: { display: "none" } }, h("slot", null)), h("div", { style: { display: "contents" }, ref: callbacks.setContainer })));
15361
- }
15362
- };
15363
- SqmRouter.style = sqmRouterCss;
15364
-
15365
15355
  const style$7 = {
15366
- HostBlock: HostBlock,
15367
- buttonStyle: {
15368
- display: "block",
15356
+ THead: {
15357
+ padding: "var(--sl-spacing-small) var(--sl-spacing-medium) var(--sl-spacing-small) 0",
15358
+ "text-align": "left",
15359
+ },
15360
+ TCell: {
15361
+ padding: "var(--sl-spacing-small) var(--sl-spacing-medium) var(--sl-spacing-small) 0",
15362
+ },
15363
+ TRow: {
15364
+ "border-top": "1px solid #EAEAEA",
15365
+ },
15366
+ Table: {
15367
+ "border-collapse": "collapse",
15368
+ width: "100%",
15369
+ },
15370
+ ButtonContainer: {
15371
+ display: "flex",
15372
+ "justify-content": "flex-end",
15373
+ "margin-top": "var(--sl-spacing-small)",
15374
+ ...gap({ direction: "row", size: "var(--sl-spacing-small)" }),
15369
15375
  },
15370
15376
  };
15371
15377
  jss.setup(create());
15372
15378
  const sheet$7 = jss.createStyleSheet(style$7);
15373
15379
  const styleString$7 = sheet$7.toString();
15374
- function ShareButtonView(props, children) {
15375
- return props.hide ? (h(Host, { style: { display: "none" } })) : (h("div", null,
15380
+ function GenericTableView(props) {
15381
+ const { states, data, callbacks, elements } = props;
15382
+ const { columns, rows } = elements;
15383
+ const { show } = states;
15384
+ return (h("div", null,
15376
15385
  h("style", { type: "text/css" }, styleString$7),
15377
- 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` },
15378
- !props.hideicon && (h("sl-icon", { slot: props.iconslot, name: props.icon ? props.icon : props.medium, exportparts: "icon" })),
15379
- !props.hidetext && children)));
15386
+ h("table", { class: sheet$7.classes.Table },
15387
+ data.textOverrides.showLabels && (h("thead", null,
15388
+ h("tr", null, columns === null || columns === void 0 ? void 0 : columns.map((column) => (h("th", { class: sheet$7.classes.THead },
15389
+ h(TextSpanView, { type: "h3" }, column))))))),
15390
+ h("tbody", null,
15391
+ show === "loading" && elements.loadingElement,
15392
+ show === "empty" && elements.emptyElement,
15393
+ show === "rows" && (rows === null || rows === void 0 ? void 0 : rows.map((row, i) => (h("tr", { class: sheet$7.classes.TRow, style: {
15394
+ borderTop: `${!data.textOverrides.showLabels && i === 0 ? "none" : ""}`,
15395
+ }, part: "table-row" }, row.map((cell) => (h("td", { class: sheet$7.classes.TCell },
15396
+ h(TextSpanView, { type: "p" }, cell)))))))))),
15397
+ h("div", { class: sheet$7.classes.ButtonContainer, part: states.namespace + "-button-wrapper" },
15398
+ h("sl-button", { size: "small", disabled: !states.hasPrev, loading: show === "loading", onClick: callbacks.prevPage, exportparts: "base: defaultbutton-base" }, data.textOverrides.prevLabel),
15399
+ h("sl-button", { size: "small", loading: show === "loading", disabled: !states.hasNext, onClick: callbacks.nextPage, exportparts: "base: defaultbutton-base" }, data.textOverrides.moreLabel))));
15400
+ }
15401
+
15402
+ function LoadingSlot$1() {
15403
+ return (h("slot", { name: "loading" },
15404
+ h(LoadingSkeleton, null)));
15405
+ }
15406
+ function LoadingSkeleton() {
15407
+ return (h("div", { style: { width: "100%" } },
15408
+ h("sl-skeleton", { style: { marginBottom: "28px" } }),
15409
+ h("sl-skeleton", { style: { marginBottom: "28px" } }),
15410
+ h("sl-skeleton", { style: { marginBottom: "28px" } }),
15411
+ h("sl-skeleton", { style: { marginBottom: "28px" } }),
15412
+ h("sl-skeleton", null)));
15413
+ }
15414
+ function EmptySlot$1({ label }) {
15415
+ return (h("slot", { name: "empty" },
15416
+ h(EmptySkeleton, { label: label })));
15417
+ }
15418
+ function EmptySkeleton({ label }) {
15419
+ return (h("div", { style: { width: "100%" } },
15420
+ h("sqm-text", null,
15421
+ h("h3", { style: { color: "#777777" } }, label))));
15380
15422
  }
15381
15423
 
15382
- const MessageLinkQuery = gql `
15383
- query (
15384
- $programId: ID
15385
- $engagementMedium: UserEngagementMedium!
15386
- $shareMedium: ReferralShareMedium!
15424
+ const CSS_NAMESPACE = "sqm-rewards-table";
15425
+ const GET_REWARDS = gql `
15426
+ query getRewards(
15427
+ $limit: Int!
15428
+ $offset: Int!
15429
+ $rewardFilter: RewardFilterInput
15387
15430
  ) {
15388
15431
  viewer {
15389
15432
  ... on User {
15390
- messageLink(
15391
- programId: $programId
15392
- engagementMedium: $engagementMedium
15393
- shareMedium: $shareMedium
15394
- )
15395
- shareLink(programId: $programId, engagementMedium: $engagementMedium)
15396
- }
15397
- }
15398
- }
15399
- `;
15400
- function NativeShare(props, directLink) {
15401
- const title = props.sharetitle || "Share title";
15402
- const text = props.sharetext || "Share text";
15403
- if (directLink === "undefined") {
15404
- return alert("error: message link undefined!");
15405
- }
15406
- if (window.navigator.share) {
15407
- window.navigator
15408
- .share({
15409
- title,
15410
- text,
15411
- url: directLink,
15412
- })
15433
+ id
15434
+ rewards(limit: $limit, offset: $offset, filter: $rewardFilter) {
15435
+ totalCount
15436
+ count
15437
+ data {
15438
+ id
15439
+ type
15440
+ value
15441
+ unit
15442
+ name
15443
+ dateGiven
15444
+ dateExpires
15445
+ dateCancelled
15446
+ dateRedeemed
15447
+ dateScheduledFor
15448
+ fuelTankCode
15449
+ fuelTankType
15450
+ currency
15451
+ prettyValue
15452
+ statuses
15453
+ globalRewardKey
15454
+ programRewardKey
15455
+ rewardRedemptionTransactions {
15456
+ data {
15457
+ exchangedRewards {
15458
+ data {
15459
+ prettyValue
15460
+ type
15461
+ fuelTankCode
15462
+ globalRewardKey
15463
+ }
15464
+ }
15465
+ }
15466
+ }
15467
+ }
15468
+ }
15469
+ }
15470
+ }
15471
+ }
15472
+ `;
15473
+ function useRewardsTable(props, emptyElement, loadingElement) {
15474
+ var _a, _b;
15475
+ const user = T$1();
15476
+ const programIdContext = M$1();
15477
+ // Default to context, overriden by props
15478
+ const programId = (_a = props.programId) !== null && _a !== void 0 ? _a : programIdContext;
15479
+ const rewardFilter = {
15480
+ userId_eq: user === null || user === void 0 ? void 0 : user.id,
15481
+ accountId_eq: user === null || user === void 0 ? void 0 : user.accountId,
15482
+ // If no program ID, shows all programs
15483
+ ...(programId
15484
+ ? programId === "classic"
15485
+ ? { programId_exists: false }
15486
+ : { programId_eq: programId }
15487
+ : {}),
15488
+ };
15489
+ const [content, setContent] = useReducer((state, next) => ({
15490
+ ...state,
15491
+ ...next,
15492
+ }), {
15493
+ columns: [],
15494
+ rows: [],
15495
+ loading: false,
15496
+ page: 0,
15497
+ });
15498
+ const { envelope: rewardsData, states, callbacks, } = 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; }, {
15499
+ limit: props.perPage,
15500
+ offset: 0,
15501
+ }, {
15502
+ rewardFilter,
15503
+ }, !(user === null || user === void 0 ? void 0 : user.jwt));
15504
+ const tick = useRerenderListener();
15505
+ const components = useChildElements();
15506
+ const data = rewardsData === null || rewardsData === void 0 ? void 0 : rewardsData.data;
15507
+ async function getComponentData(components) {
15508
+ // filter out loading and empty states from columns array
15509
+ const columnComponents = components.filter((component) => component.slot !== "loading" && component.slot !== "empty");
15510
+ // get the column titles (renderLabel is asynchronous)
15511
+ const columnsPromise = columnComponents === null || columnComponents === void 0 ? void 0 : columnComponents.map(async (c) => tryMethod$1(c, () => c.renderLabel()));
15512
+ // get the column cells (renderCell is asynchronous)
15513
+ const cellsPromise = data === null || data === void 0 ? void 0 : data.map(async (r) => {
15514
+ const cellPromise = columnComponents === null || columnComponents === void 0 ? void 0 : columnComponents.map(async (c) => tryMethod$1(c, () => c.renderCell([r], c)));
15515
+ const cells = await Promise.all(cellPromise);
15516
+ return cells;
15517
+ });
15518
+ const rows = cellsPromise && (await Promise.all(cellsPromise)).filter((i) => i);
15519
+ setContent({ rows });
15520
+ const columns = columnsPromise && (await Promise.all(columnsPromise));
15521
+ // Set the content to render and finish loading components
15522
+ setContent({ columns, loading: false, page: states.currentPage });
15523
+ }
15524
+ useEffect(() => {
15525
+ setContent({ loading: true });
15526
+ rewardsData && getComponentData(components);
15527
+ }, [rewardsData, components, tick]);
15528
+ 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);
15529
+ console.log(states.loading, content.loading, rewardsData);
15530
+ const show =
15531
+ // 1 - Loading if loading
15532
+ states.loading || content.loading
15533
+ ? "loading"
15534
+ : // 2 - Empty if empty
15535
+ isEmpty
15536
+ ? "empty"
15537
+ : // 3 - Then show rows
15538
+ "rows";
15539
+ return {
15540
+ states: {
15541
+ hasNext: states.currentPage < states.pageCount - 1,
15542
+ hasPrev: states.currentPage > 0,
15543
+ show,
15544
+ namespace: CSS_NAMESPACE,
15545
+ },
15546
+ data: {
15547
+ textOverrides: {
15548
+ showLabels: props.showLabels,
15549
+ prevLabel: props.prevLabel,
15550
+ moreLabel: props.moreLabel,
15551
+ },
15552
+ },
15553
+ elements: {
15554
+ columns: content.columns,
15555
+ rows: content.rows,
15556
+ emptyElement,
15557
+ loadingElement,
15558
+ },
15559
+ callbacks: {
15560
+ nextPage: () => {
15561
+ callbacks.setCurrentPage(states.currentPage + 1);
15562
+ },
15563
+ prevPage: () => {
15564
+ callbacks.setCurrentPage(states.currentPage - 1);
15565
+ },
15566
+ },
15567
+ };
15568
+ }
15569
+ function generateUserError$1(e) {
15570
+ try {
15571
+ return JSON.stringify(e);
15572
+ }
15573
+ catch (e) {
15574
+ return "An unknown error";
15575
+ }
15576
+ }
15577
+ async function tryMethod$1(c, callback) {
15578
+ const tag = c.tagName.toLowerCase();
15579
+ await customElements.whenDefined(tag);
15580
+ let labelPromise;
15581
+ try {
15582
+ labelPromise = callback();
15583
+ }
15584
+ catch (e) {
15585
+ // renderLabel did not return a promise, so this method probably doesn't exist
15586
+ // therefore, we IGNORE the label
15587
+ if (callback.name === "renderReferrerCell") {
15588
+ console.error("column does not have a renderReferrerCell method.");
15589
+ }
15590
+ else {
15591
+ console.error("label promise failed", e);
15592
+ }
15593
+ return h("span", null);
15594
+ }
15595
+ try {
15596
+ return await labelPromise;
15597
+ }
15598
+ catch (e) {
15599
+ // The column returned a promise, and that promise failed.
15600
+ // This should not happen so we fail fast
15601
+ console.error("Error rendering label", e);
15602
+ const userError = generateUserError$1(e);
15603
+ return (h("details", null,
15604
+ h("summary", null, "Error"),
15605
+ userError));
15606
+ }
15607
+ }
15608
+
15609
+ const RewardsTable = class {
15610
+ constructor(hostRef) {
15611
+ registerInstance(this, hostRef);
15612
+ /** @uiName Number of rewards per page */
15613
+ this.perPage = 3;
15614
+ /** @uiName Show column labels */
15615
+ this.showLabels = true;
15616
+ /** @uiName Previous button text */
15617
+ this.prevLabel = "Prev";
15618
+ /** @uiName View More button text */
15619
+ this.moreLabel = "Next";
15620
+ /** @uiName Show Referred by user in table */
15621
+ this.showReferrer = false;
15622
+ h$1(this);
15623
+ }
15624
+ disconnectedCallback() { }
15625
+ render() {
15626
+ const empty = h(EmptySlot$1, { label: "No Rewards Yet" });
15627
+ const loading = h(LoadingSlot$1, null);
15628
+ const { states, data, callbacks, elements } = j$1()
15629
+ ? useRewardsTableDemo(this)
15630
+ : useRewardsTable(this, empty, loading);
15631
+ return (h(GenericTableView, { states: states, data: data, callbacks: callbacks, elements: elements }));
15632
+ }
15633
+ };
15634
+ function useRewardsTableDemo(props) {
15635
+ return cjs({
15636
+ states: {
15637
+ hasPrev: false,
15638
+ hasNext: false,
15639
+ loading: false,
15640
+ namespace: CSS_NAMESPACE,
15641
+ },
15642
+ callbacks: {
15643
+ prevPage: () => console.log("Prev"),
15644
+ nextPage: () => console.log("Next"),
15645
+ },
15646
+ data: {
15647
+ textOverrides: {
15648
+ showLabels: props.showLabels,
15649
+ prevLabel: props.prevLabel,
15650
+ moreLabel: props.moreLabel,
15651
+ },
15652
+ referralData: [],
15653
+ },
15654
+ elements: {
15655
+ emptyElement: h(EmptySkeleton, { label: "No Rewards Yet" }),
15656
+ loadingElement: h(LoadingSkeleton, null),
15657
+ // TODO: This should be smarter
15658
+ columns: [h("div", null, "Name"), h("div", null, "Email"), h("div", null, "DOB")],
15659
+ rows: [],
15660
+ },
15661
+ }, props.demoData || {}, { arrayMerge: (_, a) => a });
15662
+ }
15663
+
15664
+ const RewardsTableColumn = class {
15665
+ constructor(hostRef) {
15666
+ registerInstance(this, hostRef);
15667
+ /**
15668
+ * @uiName Reward column title
15669
+ */
15670
+ this.columnTitle = "Rewards";
15671
+ /**
15672
+ * @uiName Hide dropdown details of reward
15673
+ */
15674
+ this.hideDetails = false;
15675
+ h$1(this);
15676
+ }
15677
+ disconnectedCallback() { }
15678
+ //@ts-ignore
15679
+ async renderCell(data) {
15680
+ // TODO: Do the right thing with many rewards, pending rewards, canceled rewards
15681
+ console.log({ data });
15682
+ return (h("sqm-referral-table-rewards-cell", { rewards: data, hideDetails: this.hideDetails }));
15683
+ }
15684
+ async renderLabel() {
15685
+ return this.columnTitle;
15686
+ }
15687
+ render() {
15688
+ useRequestRerender([this.columnTitle]);
15689
+ return h(Host, { style: { display: "none" } });
15690
+ }
15691
+ };
15692
+
15693
+ const debug$1 = browser("sq:useRouter");
15694
+ function matchPath(pattern, page) {
15695
+ if (!pattern)
15696
+ return;
15697
+ const regexp = pathToRegexp(pattern);
15698
+ return regexp.exec(page);
15699
+ }
15700
+ function useRouter() {
15701
+ const location = an();
15702
+ const host = P$1();
15703
+ const [slot, setSlot] = useState(undefined);
15704
+ const [container, setContainer] = useState(undefined);
15705
+ const page = location.pathname;
15706
+ // convert sqm-routes into templates
15707
+ useEffect(() => {
15708
+ const routes = host.querySelectorAll(`sqm-route`);
15709
+ const routesArray = Array.from(routes);
15710
+ routesArray.forEach((route) => {
15711
+ const newTemplate = document.createElement("template");
15712
+ newTemplate.setAttribute("path", route.path);
15713
+ newTemplate.innerHTML = route.innerHTML;
15714
+ route.parentNode.appendChild(newTemplate);
15715
+ route.parentNode.removeChild(route);
15716
+ });
15717
+ }, []);
15718
+ useEffect(() => {
15719
+ var _a, _b;
15720
+ if (!container || !slot) {
15721
+ debug$1("DOM not ready for navigation rendering on:", page);
15722
+ return;
15723
+ }
15724
+ // <template>
15725
+ const templates = slot.querySelectorAll(`template`);
15726
+ const templatesArray = Array.from(templates);
15727
+ const template = templatesArray.find((template) => {
15728
+ var _a, _b, _c;
15729
+ //@ts-ignore
15730
+ const path = (_b = (_a = template.attributes) === null || _a === void 0 ? void 0 : _a.path) === null || _b === void 0 ? void 0 : _b.nodeValue;
15731
+ if ((_c = matchPath(path, page)) === null || _c === void 0 ? void 0 : _c.length)
15732
+ return template;
15733
+ });
15734
+ //@ts-ignore - can't access template attributes directly
15735
+ 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;
15736
+ debug$1({
15737
+ containerDatasetPage: container.dataset.page,
15738
+ templatePath,
15739
+ page,
15740
+ });
15741
+ // if no routes found, and the old route doesn't match the new route
15742
+ if (!template) {
15743
+ // No matching page, display nothing
15744
+ debug$1("No matching page found for ", page, ", so render nothing");
15745
+ container.innerHTML = "";
15746
+ container.dataset.page = page;
15747
+ return;
15748
+ }
15749
+ debug$1("Page updated to ", page, template);
15750
+ // if pathToRegexp results truthy or page is an exact match
15751
+ if (!!matchPath(templatePath, container.dataset.page)) {
15752
+ debug$1("don't rerender");
15753
+ // Same page, do not re-render
15754
+ // Reduces dom mutations, speeds up page speed
15755
+ }
15756
+ else if (template) {
15757
+ container.innerHTML = template.innerHTML;
15758
+ container.dataset.page = page;
15759
+ }
15760
+ }, [slot, container, page]);
15761
+ return {
15762
+ callbacks: {
15763
+ setSlot,
15764
+ setContainer,
15765
+ },
15766
+ };
15767
+ }
15768
+
15769
+ const sqmRouterCss = "sqm-router{display:contents}";
15770
+
15771
+ const SqmRouter = class {
15772
+ constructor(hostRef) {
15773
+ registerInstance(this, hostRef);
15774
+ this.ignored = true;
15775
+ h$1(this);
15776
+ }
15777
+ disconnectedCallback() { }
15778
+ render() {
15779
+ const { callbacks } = useRouter();
15780
+ return (h(Host, null, h("div", { ref: callbacks.setSlot, style: { display: "none" } }, h("slot", null)), h("div", { style: { display: "contents" }, ref: callbacks.setContainer })));
15781
+ }
15782
+ };
15783
+ SqmRouter.style = sqmRouterCss;
15784
+
15785
+ const style$8 = {
15786
+ HostBlock: HostBlock,
15787
+ buttonStyle: {
15788
+ display: "block",
15789
+ },
15790
+ };
15791
+ jss.setup(create());
15792
+ const sheet$8 = jss.createStyleSheet(style$8);
15793
+ const styleString$8 = sheet$8.toString();
15794
+ function ShareButtonView(props, children) {
15795
+ return props.hide ? (h(Host, { style: { display: "none" } })) : (h("div", null,
15796
+ h("style", { type: "text/css" }, styleString$8),
15797
+ 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` },
15798
+ !props.hideicon && (h("sl-icon", { slot: props.iconslot, name: props.icon ? props.icon : props.medium, exportparts: "icon" })),
15799
+ !props.hidetext && children)));
15800
+ }
15801
+
15802
+ const MessageLinkQuery = gql `
15803
+ query (
15804
+ $programId: ID
15805
+ $engagementMedium: UserEngagementMedium!
15806
+ $shareMedium: ReferralShareMedium!
15807
+ ) {
15808
+ viewer {
15809
+ ... on User {
15810
+ messageLink(
15811
+ programId: $programId
15812
+ engagementMedium: $engagementMedium
15813
+ shareMedium: $shareMedium
15814
+ )
15815
+ shareLink(programId: $programId, engagementMedium: $engagementMedium)
15816
+ }
15817
+ }
15818
+ }
15819
+ `;
15820
+ function NativeShare(props, directLink) {
15821
+ const title = props.sharetitle || "Share title";
15822
+ const text = props.sharetext || "Share text";
15823
+ if (directLink === "undefined") {
15824
+ return alert("error: message link undefined!");
15825
+ }
15826
+ if (window.navigator.share) {
15827
+ window.navigator
15828
+ .share({
15829
+ title,
15830
+ text,
15831
+ url: directLink,
15832
+ })
15413
15833
  .catch((error) => console.error("Error on web share", error));
15414
15834
  }
15415
15835
  else {
@@ -17112,11 +17532,12 @@ const BigStat_stories = {
17112
17532
  title: "Components/Big Stat",
17113
17533
  };
17114
17534
  const Default$1 = () => {
17115
- const props = { statvalue: "9.900,00" };
17535
+ const props = { value: 990000, statvalue: "9.900,00" };
17116
17536
  return h(BigStatView, Object.assign({}, props), "Big stat");
17117
17537
  };
17118
17538
  const LeftAlign = () => {
17119
17539
  const props = {
17540
+ value: 500,
17120
17541
  statvalue: "500",
17121
17542
  alignment: "left",
17122
17543
  };
@@ -17124,6 +17545,7 @@ const LeftAlign = () => {
17124
17545
  };
17125
17546
  const RightAlign = () => {
17126
17547
  const props = {
17548
+ value: 500,
17127
17549
  statvalue: "500",
17128
17550
  alignment: "right",
17129
17551
  };
@@ -17131,6 +17553,7 @@ const RightAlign = () => {
17131
17553
  };
17132
17554
  const FlexReverse = () => {
17133
17555
  const props = {
17556
+ value: 500,
17134
17557
  statvalue: "500",
17135
17558
  flexReverse: true,
17136
17559
  };
@@ -17138,6 +17561,7 @@ const FlexReverse = () => {
17138
17561
  };
17139
17562
  const FlexReverseRight = () => {
17140
17563
  const props = {
17564
+ value: 500,
17141
17565
  statvalue: "500",
17142
17566
  flexReverse: true,
17143
17567
  alignment: "right",
@@ -17146,6 +17570,7 @@ const FlexReverseRight = () => {
17146
17570
  };
17147
17571
  const FlexReverseLeft = () => {
17148
17572
  const props = {
17573
+ value: 500,
17149
17574
  statvalue: "500",
17150
17575
  flexReverse: true,
17151
17576
  alignment: "left",
@@ -17154,12 +17579,14 @@ const FlexReverseLeft = () => {
17154
17579
  };
17155
17580
  const NoStatValue = () => {
17156
17581
  const props = {
17582
+ value: 0,
17157
17583
  statvalue: "...",
17158
17584
  };
17159
17585
  return h(BigStatView, Object.assign({}, props), "Big stat");
17160
17586
  };
17161
17587
  const InvalidStatValue = () => {
17162
17588
  const props = {
17589
+ value: 0,
17163
17590
  statvalue: "!!!",
17164
17591
  };
17165
17592
  return h(BigStatView, Object.assign({}, props), "Big stat");
@@ -17885,6 +18312,9 @@ const RewardBalanceCashUSD = createHookStory(() => {
17885
18312
  const ProgramGoals = createHookStory(() => {
17886
18313
  const dummy = encodeURIComponent("Paid-Member-Goal/referrals");
17887
18314
  return View(`/programGoals/count/${dummy}`, "/(programGoals)/:metricType/:goalId");
18315
+ });
18316
+ const CustomField = createHookStory(() => {
18317
+ return View(`/customFields/thingCount`, "/(customFields)/:customField");
17888
18318
  });
17889
18319
 
17890
18320
  const UseBigStat = /*#__PURE__*/Object.freeze({
@@ -17916,7 +18346,8 @@ const UseBigStat = /*#__PURE__*/Object.freeze({
17916
18346
  RewardsAvailableWithSlash: RewardsAvailableWithSlash,
17917
18347
  RewardBalance: RewardBalance,
17918
18348
  RewardBalanceCashUSD: RewardBalanceCashUSD,
17919
- ProgramGoals: ProgramGoals
18349
+ ProgramGoals: ProgramGoals,
18350
+ CustomField: CustomField
17920
18351
  });
17921
18352
 
17922
18353
  function setupGraphQL$4() {
@@ -18223,18 +18654,100 @@ const UseRewardExchangeList = /*#__PURE__*/Object.freeze({
18223
18654
  VariableCreditReward: VariableCreditReward
18224
18655
  });
18225
18656
 
18657
+ const UseRewardsTable_stories = {
18658
+ title: "Hooks / useRewardsTable",
18659
+ };
18660
+ function setupGraphQL$7() {
18661
+ const id = "testestest";
18662
+ const accountId = id;
18663
+ //@ts-ignore
18664
+ window.widgetIdent = {
18665
+ tenantAlias: "test_a8b41jotf8a1v",
18666
+ appDomain: "https://staging.referralsaasquatch.com",
18667
+ };
18668
+ useEffect(() => {
18669
+ L$1({
18670
+ accountId,
18671
+ id,
18672
+ jwt: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjp7ImFjY291bnRJZCI6InRlc3Rlc3Rlc3QiLCJpZCI6InRlc3Rlc3Rlc3QifX0.qYnU5hNeIj9C_G3NogfG7btgCPGZC7JRXY0MG6a63zs",
18673
+ });
18674
+ return () => {
18675
+ window.widgetIdent = undefined;
18676
+ L$1(undefined);
18677
+ };
18678
+ }, []);
18679
+ return { id, accountId };
18680
+ }
18681
+ const RewardsTableWithProgram = createHookStory(() => {
18682
+ setupGraphQL$7();
18683
+ A$1("sam-partner-test-2");
18684
+ return (h("sqm-rewards-table", null,
18685
+ h("sqm-rewards-table-column", null)));
18686
+ });
18687
+ const RewardsTableNoProgram = createHookStory(() => {
18688
+ setupGraphQL$7();
18689
+ A$1(undefined);
18690
+ return (h("sqm-rewards-table", null,
18691
+ h("sqm-rewards-table-column", null)));
18692
+ });
18693
+
18694
+ const UseRewardsTable = /*#__PURE__*/Object.freeze({
18695
+ __proto__: null,
18696
+ 'default': UseRewardsTable_stories,
18697
+ RewardsTableWithProgram: RewardsTableWithProgram,
18698
+ RewardsTableNoProgram: RewardsTableNoProgram
18699
+ });
18700
+
18701
+ const JWT = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjp7ImlkIjoic2FtK2tsaXBAc2Fhc3F1YXQuY2giLCJhY2NvdW50SWQiOiJzYW0ra2xpcEBzYWFzcXVhdC5jaCJ9fQ.FMNZ6oajyr6SiCcRqKKdyPqvNTvWROQ60MKAyfvWGfc";
18702
+ const UseTaskCard_stories = {
18703
+ title: "Hooks / useTaskCard",
18704
+ };
18705
+ function setupGraphQL$8() {
18706
+ const id = "sam+klip@saasquat.ch";
18707
+ const accountId = id;
18708
+ const programId = "klip-referral-program";
18709
+ //@ts-ignore
18710
+ window.widgetIdent = {
18711
+ tenantAlias: "test_a74miwdpofztj",
18712
+ appDomain: "https://staging.referralsaasquatch.com",
18713
+ programId,
18714
+ };
18715
+ useEffect(() => {
18716
+ L$1({
18717
+ accountId,
18718
+ id,
18719
+ jwt: JWT,
18720
+ });
18721
+ return () => {
18722
+ window.widgetIdent = undefined;
18723
+ L$1(undefined);
18724
+ };
18725
+ }, []);
18726
+ return { id, accountId };
18727
+ }
18728
+ const TaskCard = createHookStory(() => {
18729
+ setupGraphQL$8();
18730
+ return (h("sqm-task-card", { "card-title": "Comment on 5 articles", "button-text": "Start reading", goal: 5, steps: true, "show-progress-bar": true }));
18731
+ });
18732
+
18733
+ const UseTaskCard = /*#__PURE__*/Object.freeze({
18734
+ __proto__: null,
18735
+ 'default': UseTaskCard_stories,
18736
+ TaskCard: TaskCard
18737
+ });
18738
+
18226
18739
  const NewPortal_stories = {
18227
18740
  title: "New Portal",
18228
18741
  };
18229
- const style$8 = {
18742
+ const style$9 = {
18230
18743
  HeaderSubtitleBold: {
18231
18744
  "font-weight": 500,
18232
18745
  "text-decoration": "underline",
18233
18746
  },
18234
18747
  };
18235
18748
  jss.setup(create());
18236
- const sheet$8 = jss.createStyleSheet(style$8);
18237
- const styleString$8 = sheet$8.toString();
18749
+ const sheet$9 = jss.createStyleSheet(style$9);
18750
+ const styleString$9 = sheet$9.toString();
18238
18751
  const barProps = {
18239
18752
  data: {
18240
18753
  programs: [
@@ -18329,7 +18842,7 @@ const Dashboard = () => {
18329
18842
  hide: false,
18330
18843
  };
18331
18844
  return (h("sqm-divided-layout", { direction: "row" },
18332
- h("style", { type: "text/css" }, styleString$8),
18845
+ h("style", { type: "text/css" }, styleString$9),
18333
18846
  h(Sidebar, null),
18334
18847
  h("sqm-divided-layout", { direction: "column" },
18335
18848
  h(PortalContainerView, Object.assign({}, { direction: "column", padding: "xxx-large", gap: "xxx-large" }),
@@ -18342,10 +18855,10 @@ const Dashboard = () => {
18342
18855
  h("h1", null, "John Smith"))),
18343
18856
  })),
18344
18857
  h(StatContainerView, Object.assign({}, { space: "64px" }),
18345
- h(BigStatView, Object.assign({}, { statvalue: "2,345" }), "Clicks"),
18346
- h(BigStatView, Object.assign({}, { statvalue: "58" }), "Referrals"),
18347
- h(BigStatView, Object.assign({}, { statvalue: "$10,540" }), "Earned"),
18348
- h(BigStatView, Object.assign({}, { statvalue: "$2,305" }), "Awaiting Payout"))),
18858
+ h(BigStatView, Object.assign({}, { statvalue: "2,345", value: 234500 }), "Clicks"),
18859
+ h(BigStatView, Object.assign({}, { statvalue: "58", value: 58 }), "Referrals"),
18860
+ h(BigStatView, Object.assign({}, { statvalue: "$10,540", value: 1054000 }), "Earned"),
18861
+ h(BigStatView, Object.assign({}, { statvalue: "$2,305", value: 230500 }), "Awaiting Payout"))),
18349
18862
  h(PortalContainerView, Object.assign({}, { direction: "column", padding: "xxx-large", gap: "xxx-large" }),
18350
18863
  h(PortalSectionView, Object.assign({}, {
18351
18864
  labelMargin: "x-large",
@@ -18387,7 +18900,7 @@ const Dashboard = () => {
18387
18900
  };
18388
18901
  const EditProfile$2 = () => {
18389
18902
  return (h("sqm-divided-layout", { direction: "row" },
18390
- h("style", { type: "text/css" }, styleString$8),
18903
+ h("style", { type: "text/css" }, styleString$9),
18391
18904
  h(Sidebar, null),
18392
18905
  h("sqm-divided-layout", { direction: "column" },
18393
18906
  h(PortalProfileView, Object.assign({}, {
@@ -18451,7 +18964,7 @@ const EditProfile$2 = () => {
18451
18964
  };
18452
18965
  const Commissions = () => {
18453
18966
  return (h("sqm-divided-layout", { direction: "row" },
18454
- h("style", { type: "text/css" }, styleString$8),
18967
+ h("style", { type: "text/css" }, styleString$9),
18455
18968
  h(Sidebar, null),
18456
18969
  h("sqm-divided-layout", { direction: "column" },
18457
18970
  h(PortalContainerView, Object.assign({}, { direction: "column", padding: "xxx-large", gap: "xxx-large" }),
@@ -18464,19 +18977,19 @@ const Commissions = () => {
18464
18977
  h("p", null,
18465
18978
  "for the",
18466
18979
  " ",
18467
- h("span", { class: sheet$8.classes.HeaderSubtitleBold }, "Partner Program #1"),
18980
+ h("span", { class: sheet$9.classes.HeaderSubtitleBold }, "Partner Program #1"),
18468
18981
  " ",
18469
18982
  "program"))),
18470
18983
  })),
18471
18984
  h(StatContainerView, Object.assign({}, { space: "64px" }),
18472
- h(BigStatView, Object.assign({}, { statvalue: "$ 1,000" }), "Total Earned"),
18473
- h(BigStatView, Object.assign({}, { statvalue: "$ 800" }), "Available"),
18474
- h(BigStatView, Object.assign({}, { statvalue: "$ 180" }), "Pending"),
18475
- h(BigStatView, Object.assign({}, { statvalue: "$ 20" }), "Redeemed"))))));
18985
+ h(BigStatView, Object.assign({}, { statvalue: "$ 1,000", value: 100000 }), "Total Earned"),
18986
+ h(BigStatView, Object.assign({}, { statvalue: "$ 800", value: 80000 }), "Available"),
18987
+ h(BigStatView, Object.assign({}, { statvalue: "$ 180", value: 18000 }), "Pending"),
18988
+ h(BigStatView, Object.assign({}, { statvalue: "$ 20", value: 2000 }), "Redeemed"))))));
18476
18989
  };
18477
18990
  const Activity = () => {
18478
18991
  return (h("sqm-divided-layout", { direction: "row" },
18479
- h("style", { type: "text/css" }, styleString$8),
18992
+ h("style", { type: "text/css" }, styleString$9),
18480
18993
  h(Sidebar, null),
18481
18994
  h("sqm-divided-layout", { direction: "column" },
18482
18995
  h(PortalContainerView, Object.assign({}, { direction: "column", padding: "xxx-large", gap: "xxx-large" }),
@@ -18489,7 +19002,7 @@ const Activity = () => {
18489
19002
  h("p", null,
18490
19003
  "for the",
18491
19004
  " ",
18492
- h("span", { class: sheet$8.classes.HeaderSubtitleBold }, "Partner Program #1"),
19005
+ h("span", { class: sheet$9.classes.HeaderSubtitleBold }, "Partner Program #1"),
18493
19006
  " ",
18494
19007
  "program"))),
18495
19008
  })),
@@ -18499,10 +19012,10 @@ const Activity = () => {
18499
19012
  label: (h("sqm-text", null,
18500
19013
  h("h3", null, "Referral Activity"))),
18501
19014
  content: (h(StatContainerView, Object.assign({}, { space: "64px" }),
18502
- h(BigStatView, Object.assign({}, { statvalue: "1,000" }), "Total Referrals"),
18503
- h(BigStatView, Object.assign({}, { statvalue: "800" }), "Converted"),
18504
- h(BigStatView, Object.assign({}, { statvalue: "180" }), "Pending"),
18505
- h(BigStatView, Object.assign({}, { statvalue: "20" }), "Disqualified"))),
19015
+ h(BigStatView, Object.assign({}, { statvalue: "1,000", value: 100000 }), "Total Referrals"),
19016
+ h(BigStatView, Object.assign({}, { statvalue: "800", value: 800 }), "Converted"),
19017
+ h(BigStatView, Object.assign({}, { statvalue: "180", value: 180 }), "Pending"),
19018
+ h(BigStatView, Object.assign({}, { statvalue: "20", value: 20 }), "Disqualified"))),
18506
19019
  }))),
18507
19020
  h(PortalSectionView, Object.assign({}, {
18508
19021
  labelMargin: "x-large",
@@ -18510,9 +19023,9 @@ const Activity = () => {
18510
19023
  label: (h("sqm-text", null,
18511
19024
  h("h3", null, "Traffic Generated"))),
18512
19025
  content: (h(StatContainerView, Object.assign({}, { space: "64px" }),
18513
- h(BigStatView, Object.assign({}, { statvalue: "1,000" }), "Clicks"),
18514
- h(BigStatView, Object.assign({}, { statvalue: "800" }), "From share link"),
18515
- h(BigStatView, Object.assign({}, { statvalue: "180" }), "From share mediums"))),
19026
+ h(BigStatView, Object.assign({}, { statvalue: "1,000", value: 1000 }), "Clicks"),
19027
+ h(BigStatView, Object.assign({}, { statvalue: "800", value: 800 }), "From share link"),
19028
+ h(BigStatView, Object.assign({}, { statvalue: "180", value: 180 }), "From share mediums"))),
18516
19029
  })))));
18517
19030
  };
18518
19031
 
@@ -20517,71 +21030,505 @@ const PasswordField = /*#__PURE__*/Object.freeze({
20517
21030
  ValidationError: ValidationError
20518
21031
  });
20519
21032
 
20520
- /**
20521
- * Displays a cartesian product of the input props
20522
- *
20523
- * @returns
20524
- */
20525
- function MatrixStory({ matrix, props, Component, }) {
20526
- const propMatrix = Object.keys(matrix).map((propKey) => {
20527
- const propValues = matrix[propKey];
20528
- return propValues.map((val) => {
20529
- return {
20530
- [propKey]: val,
20531
- };
20532
- });
20533
- });
20534
- const combinations = cartesian(...propMatrix);
20535
- const propsCombinations = combinations.map((combo) => {
20536
- return combo.reduce((props, prop) => {
20537
- return {
20538
- ...props,
20539
- ...prop,
20540
- };
20541
- }, {});
20542
- });
20543
- return propsCombinations.map((combo) => {
20544
- const example = { ...props, ...combo };
20545
- return (h("div", null,
20546
- h(PropsTable, { values: example }),
20547
- h("hr", null),
20548
- h(Component, Object.assign({}, example))));
20549
- });
20550
- }
20551
- function PropsTable({ values }) {
20552
- return (h("table", null,
20553
- h("tbody", null, Object.keys(values).map((key) => {
20554
- return (h("tr", null,
20555
- h("th", null, key),
20556
- h("td", null, JSON.stringify(values[key]))));
20557
- }))));
20558
- }
20559
- /**
20560
- * Source: https://stackoverflow.com/questions/15298912/javascript-generating-combinations-from-n-arrays-with-m-elements
20561
- *
20562
- * TODO: Could replace with a fork of https://www.npmjs.com/package/cartesian
20563
- *
20564
- * @param args - an array of arrays
20565
- * @returns combinations of the elements in those array
20566
- */
20567
- function cartesian(...args) {
20568
- var r = [], max = args.length - 1;
20569
- function helper(arr, i) {
20570
- for (var j = 0, l = args[i].length; j < l; j++) {
20571
- var a = arr.slice(0); // clone arr
20572
- a.push(args[i][j]);
20573
- if (i == max)
20574
- r.push(a);
20575
- else
20576
- helper(a, i + 1);
21033
+ const checkmark_circle = () => {
21034
+ return (h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 18 18" },
21035
+ 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" })));
21036
+ };
21037
+ const arrow_left_right = () => {
21038
+ return (h("svg", { width: 11, height: 12, fill: "none", xmlns: "http://www.w3.org/2000/svg" },
21039
+ 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" })));
21040
+ };
21041
+
21042
+ const gift = () => {
21043
+ return (h("svg", { width: 16, height: 16, fill: "none", xmlns: "http://www.w3.org/2000/svg" },
21044
+ 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)" }),
21045
+ h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M1.5 9v1h13V9h-13z", fill: "var(--sl-color-primary-300)" }),
21046
+ 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)" })));
21047
+ };
21048
+
21049
+ function ProgressBarView(props) {
21050
+ const { progress = 0, goal = 1, steps = false, progressBarUnit = "", repeatable = false, complete = false, } = props;
21051
+ console.log("progress bar props", props);
21052
+ const gift1 = gift();
21053
+ const gift2 = gift();
21054
+ const gift3 = gift();
21055
+ var items = [];
21056
+ var columns = "";
21057
+ var repetitions = Math.floor(progress / goal);
21058
+ if (repeatable) {
21059
+ if (steps) {
21060
+ addStepsRepeatable();
21061
+ }
21062
+ else {
21063
+ addLinearRepeatable();
20577
21064
  }
20578
21065
  }
20579
- helper([], 0);
20580
- return r;
21066
+ // non repeatable
21067
+ else {
21068
+ if (steps) {
21069
+ addSteps();
21070
+ }
21071
+ else {
21072
+ addLinear();
21073
+ }
21074
+ }
21075
+ const style = {
21076
+ ProgressBar: {
21077
+ "& .progress-bar": {
21078
+ height: "15px",
21079
+ marginTop: steps ? "var(--sl-spacing-x-medium)" : "var(--sl-spacing-large)",
21080
+ marginBottom: "var(--sl-spacing-xx-large)",
21081
+ marginRight: "var(--sl-spacing-x-small)",
21082
+ fontSize: "var(--sl-font-size-x-small)",
21083
+ display: "grid",
21084
+ gridTemplateColumns: columns,
21085
+ lineHeight: "45px",
21086
+ userSelect: "none",
21087
+ },
21088
+ "& .progress-bar.repeatable-steps": {
21089
+ marginLeft: "var(--sl-spacing-x-small)",
21090
+ },
21091
+ "& .filled:after": {
21092
+ content: '""',
21093
+ display: "flex",
21094
+ width: "100%",
21095
+ height: "4px",
21096
+ borderRadius: "4px",
21097
+ backgroundColor: complete ? "var(--sl-color-success-500)" : "var(--sl-color-primary-500)",
21098
+ },
21099
+ "& .progress": {
21100
+ display: "block",
21101
+ textAlign: "center",
21102
+ marginLeft: "-100px",
21103
+ marginRight: "-100px",
21104
+ },
21105
+ "& .progress::after": {
21106
+ content: '""',
21107
+ width: "12px",
21108
+ height: "12px",
21109
+ display: "flex",
21110
+ backgroundColor: complete ? "var(--sl-color-success-500)" : "var(--sl-color-primary-500)",
21111
+ borderRadius: "50%",
21112
+ position: "relative",
21113
+ left: "47%",
21114
+ top: "-85%",
21115
+ },
21116
+ "& .progress.bg:after": {
21117
+ width: "0",
21118
+ height: "0",
21119
+ border: "none",
21120
+ },
21121
+ "& .progress.top": {
21122
+ position: "relative",
21123
+ top: "-40px",
21124
+ },
21125
+ "& .progress.top:after": {
21126
+ top: "-16%",
21127
+ },
21128
+ "& .empty": {
21129
+ display: "block",
21130
+ textAlign: "center",
21131
+ marginLeft: "-100px",
21132
+ marginRight: "-100px",
21133
+ },
21134
+ "& .empty::after": {
21135
+ content: '""',
21136
+ width: "12px",
21137
+ height: "12px",
21138
+ border: "2px solid #E0E0E0",
21139
+ margin: "-2px",
21140
+ display: "flex",
21141
+ backgroundColor: "white",
21142
+ borderRadius: "50%",
21143
+ position: "relative",
21144
+ left: "47%",
21145
+ top: "-85%",
21146
+ },
21147
+ "& .empty.bg:after": {
21148
+ width: "0",
21149
+ height: "0",
21150
+ border: "none",
21151
+ },
21152
+ "& .remain:after": {
21153
+ content: '""',
21154
+ display: "flex",
21155
+ width: "100%",
21156
+ height: "4px",
21157
+ borderRadius: "4px",
21158
+ backgroundColor: "#E0E0E0",
21159
+ },
21160
+ "& .gift.bw": {
21161
+ filter: "grayscale(100%)",
21162
+ },
21163
+ "& .gift.start": {
21164
+ transform: "scale(80%)",
21165
+ top: "-20px",
21166
+ },
21167
+ "& .gift": {
21168
+ textAlign: "center",
21169
+ marginLeft: "-100px",
21170
+ marginRight: "-100px",
21171
+ position: "relative",
21172
+ display: "list-item",
21173
+ listStyleType: "none",
21174
+ top: "-18px",
21175
+ filter: goal <= progress ? "" : "grayscale(100%)",
21176
+ zIndex: "1",
21177
+ },
21178
+ },
21179
+ };
21180
+ jss.setup(create());
21181
+ const sheet = jss.createStyleSheet(style);
21182
+ const styleString = sheet.toString();
21183
+ return (h("div", { class: sheet.classes.ProgressBar },
21184
+ h("style", { type: "text/css" }, styleString),
21185
+ h("div", { class: repetitions > 1 ? "progress-bar repeatable-steps" : "progress-bar" }, items)));
21186
+ function clamp(x, min, max) {
21187
+ return Math.min(Math.max(x, min), max);
21188
+ }
21189
+ function addLinear() {
21190
+ const ratio = progress / goal;
21191
+ columns =
21192
+ clamp(ratio, 0, 1) + "fr 0fr " + clamp(1 - ratio, 0, 1) + "fr 0fr 0fr";
21193
+ items.push(h("div", { class: "filled" }));
21194
+ items.push(h("div", { class: clamp(progress, 0, goal) == goal ? "progress top bg" : "progress top" }, clamp(progress, 0, goal) == goal
21195
+ ? ""
21196
+ : progressBarUnit + clamp(progress, 0, goal)));
21197
+ items.push(h("div", { class: "remain" }));
21198
+ items.push(h("div", { class: "progress bg" }, goal));
21199
+ items.push(h("div", { class: "gift" }, gift1));
21200
+ }
21201
+ function addSteps() {
21202
+ let ratio = 1 / goal;
21203
+ for (let i = 1; i < goal; i++) {
21204
+ columns += ratio + "fr 0fr ";
21205
+ if (i > progress) {
21206
+ items.push(h("div", { class: "remain" }));
21207
+ items.push(h("div", { class: "empty" }, i));
21208
+ }
21209
+ else {
21210
+ items.push(h("div", { class: "filled" }));
21211
+ items.push(h("div", { class: "progress" }, i));
21212
+ }
21213
+ }
21214
+ columns += ratio + "fr 0fr ";
21215
+ // reward success
21216
+ if (goal <= progress) {
21217
+ columns += "0fr ";
21218
+ items.push(h("div", { class: "filled" }));
21219
+ items.push(h("div", { class: "progress bg" }, goal));
21220
+ items.push(h("div", { class: "gift" }, gift1));
21221
+ }
21222
+ // reward fail
21223
+ else {
21224
+ columns += "0fr ";
21225
+ items.push(h("div", { class: "remain" }));
21226
+ items.push(h("div", { class: "empty bg" }, goal));
21227
+ items.push(h("div", { class: "gift" }, gift1));
21228
+ }
21229
+ }
21230
+ function addLinearRepeatable() {
21231
+ let repetitions = Math.floor(progress / goal);
21232
+ let ratio = ((progress % goal) / goal) * 0.5;
21233
+ // 0 repetition
21234
+ if (repetitions == 0) {
21235
+ columns = ratio + "fr 0fr " + (0.5 - ratio) + "fr 0fr 0fr 0.5fr 0fr 0fr";
21236
+ items.push(h("div", { class: "filled" }));
21237
+ items.push(h("div", { class: progress == goal ? "progress top bg" : "progress top" }, progressBarUnit + progress));
21238
+ items.push(h("div", { class: "remain" }));
21239
+ items.push(h("div", { class: "progress bg" }, progressBarUnit + goal));
21240
+ items.push(h("div", { class: "gift" }, gift1));
21241
+ items.push(h("div", { class: "remain" }));
21242
+ items.push(h("div", { class: "progress bg" }, progressBarUnit + goal * 2));
21243
+ items.push(h("div", { class: "gift bw" }, gift2));
21244
+ }
21245
+ // single repetition
21246
+ else if (repetitions == 1) {
21247
+ columns =
21248
+ "0.5fr 0fr 0fr " + ratio + "fr 0fr " + (0.5 - ratio) + "fr 0fr 0fr";
21249
+ items.push(h("div", { class: "filled" }));
21250
+ items.push(h("div", { class: "progress bg" }, progressBarUnit + goal));
21251
+ items.push(h("div", { class: "gift" }, gift1));
21252
+ items.push(h("div", { class: "filled" }));
21253
+ items.push(h("div", { class: progress == goal ? "progress top bg" : "progress top" }, progress == goal ? "" : progressBarUnit + progress));
21254
+ items.push(h("div", { class: "remain" }));
21255
+ items.push(h("div", { class: "progress bg" }, progressBarUnit + goal * 2));
21256
+ items.push(h("div", { class: "gift bw" }, gift2));
21257
+ }
21258
+ // multiple repetitions
21259
+ else {
21260
+ columns =
21261
+ "0fr 0fr 0.5fr 0fr 0fr " +
21262
+ ratio +
21263
+ "fr 0fr " +
21264
+ (0.5 - ratio) +
21265
+ "fr 0fr 0fr";
21266
+ items.push(h("div", { class: "progress bg" }, progressBarUnit + goal * (repetitions - 1)));
21267
+ items.push(h("div", { class: "gift start" }, gift1));
21268
+ items.push(h("div", { class: "filled" }));
21269
+ items.push(h("div", { class: "progress bg" }, progressBarUnit + goal * repetitions));
21270
+ items.push(h("div", { class: "gift" }, gift2));
21271
+ items.push(h("div", { class: "filled" }));
21272
+ items.push(h("div", { class: progress == goal * repetitions ? "progress top bg" : "progress top" }, progress == goal * repetitions ? "" : progressBarUnit + progress));
21273
+ items.push(h("div", { class: "remain" }));
21274
+ items.push(h("div", { class: "progress bg" }, progressBarUnit + goal * (repetitions + 1)));
21275
+ items.push(h("div", { class: "gift bw" }, gift3));
21276
+ }
21277
+ }
21278
+ function addStepsRepeatable() {
21279
+ let repetitions = Math.floor(progress / goal);
21280
+ // no or single repetition
21281
+ if (repetitions < 2) {
21282
+ let ratio = 1 / goal;
21283
+ for (let i = 1; i < goal * 2 + 1; i++) {
21284
+ columns += ratio + "fr 0fr ";
21285
+ if (i > progress) {
21286
+ if (i == goal) {
21287
+ columns += "0fr ";
21288
+ items.push(h("div", { class: "remain" }));
21289
+ items.push(h("div", { class: "empty bg" }, goal));
21290
+ items.push(h("div", { class: "gift bw" }, gift1));
21291
+ }
21292
+ else if (i == goal * 2) {
21293
+ columns += "0fr 0fr";
21294
+ items.push(h("div", { class: "remain" }));
21295
+ items.push(h("div", { class: "empty bg" }, goal * 2));
21296
+ items.push(h("div", { class: "gift bw" }, gift2));
21297
+ }
21298
+ else {
21299
+ items.push(h("div", { class: "remain" }));
21300
+ items.push(h("div", { class: "empty" }, progressBarUnit + i));
21301
+ }
21302
+ }
21303
+ else if (i == goal) {
21304
+ columns += "0fr ";
21305
+ items.push(h("div", { class: "filled" }));
21306
+ items.push(h("div", { class: "progress bg" }, i));
21307
+ items.push(h("div", { class: "gift" }, gift3));
21308
+ }
21309
+ else {
21310
+ items.push(h("div", { class: "filled" }));
21311
+ items.push(h("div", { class: "progress" }, i));
21312
+ }
21313
+ }
21314
+ }
21315
+ // case repetition many
21316
+ else {
21317
+ let position = (progress % goal) + goal;
21318
+ let ratio = 1 / goal;
21319
+ columns += "0fr 0fr ";
21320
+ items.push(h("div", { class: "progress bg" }, goal * (repetitions - 1)));
21321
+ items.push(h("div", { class: "gift start" }, gift1));
21322
+ for (let i = 1; i < goal * 2 + 1; i++) {
21323
+ columns += ratio + "fr 0fr ";
21324
+ if (i <= goal) {
21325
+ if (i == goal) {
21326
+ columns += "0fr ";
21327
+ items.push(h("div", { class: "filled" }));
21328
+ items.push(h("div", { class: "progress bg" }, i + goal * (repetitions - 1)));
21329
+ items.push(h("div", { class: "gift" }, gift2));
21330
+ }
21331
+ else {
21332
+ items.push(h("div", { class: "filled" }));
21333
+ items.push(h("div", { class: "progress" }, i + goal * (repetitions - 1)));
21334
+ }
21335
+ }
21336
+ else if (i > position) {
21337
+ if (i == goal * 2) {
21338
+ columns += "0fr 0fr";
21339
+ items.push(h("div", { class: "remain" }));
21340
+ items.push(h("div", { class: "empty bg" }, i + goal * (repetitions - 1)));
21341
+ items.push(h("div", { class: "gift bw" }, gift3));
21342
+ }
21343
+ else {
21344
+ items.push(h("div", { class: "remain" }));
21345
+ items.push(h("div", { class: "empty" }, i + goal * (repetitions - 1)));
21346
+ }
21347
+ }
21348
+ else {
21349
+ items.push(h("div", { class: "filled" }));
21350
+ items.push(h("div", { class: "progress" }, i + goal * (repetitions - 1)));
21351
+ }
21352
+ }
21353
+ }
21354
+ }
21355
+ }
21356
+
21357
+ function TaskCardView(props) {
21358
+ const { rewardAmount, cardTitle, description, showProgressBar, progress = 0, goal, rewardUnit, repeatable, showExpiry, dateExpires, buttonText, buttonLink, loading, } = props;
21359
+ console.log({ props });
21360
+ const checkmark_circle$1 = checkmark_circle();
21361
+ const arrow_left_right$1 = arrow_left_right();
21362
+ const style = {
21363
+ HostBlock: HostBlock,
21364
+ TaskCard: {
21365
+ "& .main > div": {
21366
+ margin: "var(--sl-spacing-medium)",
21367
+ },
21368
+ "& .main": {
21369
+ position: "relative",
21370
+ boxSizing: "border-box",
21371
+ minWidth: "347px",
21372
+ background: "var(--sl-color-white)",
21373
+ border: "1px solid var(--sl-color-gray-300)",
21374
+ borderRadius: "var(--sl-border-radius-medium)",
21375
+ fontSize: "var(--sl-font-size-small)",
21376
+ lineHeight: "var(--sl-line-height-dense)",
21377
+ },
21378
+ "& .main.complete": {
21379
+ background: "var(--sl-color-success-50)",
21380
+ borderColor: "var(--sl-color-success-700)",
21381
+ },
21382
+ },
21383
+ Header: {
21384
+ display: "flex",
21385
+ "& .icon": {
21386
+ alignSelf: "center",
21387
+ lineHeight: "0",
21388
+ color: "var(--sl-color-success-700)",
21389
+ fontSize: "var(--sl-font-size-large)",
21390
+ marginRight: "var(--sl-spacing-x-small)",
21391
+ },
21392
+ "& .value": {
21393
+ alignSelf: "center",
21394
+ color: "var(--sl-color-black)",
21395
+ fontSize: "var(--sl-font-size-x-large)",
21396
+ fontWeight: "var(--sl-font-weight-semibold)",
21397
+ lineHeight: "100%",
21398
+ marginRight: "var(--sl-spacing-xx-small)",
21399
+ },
21400
+ "& .text": {
21401
+ alignSelf: "end",
21402
+ textTransform: "uppercase",
21403
+ color: "var(--sl-color-gray-600)",
21404
+ fontSize: "var(--sl-font-size-x-small)",
21405
+ lineHeight: "var(--sl-font-size-medium)",
21406
+ marginRight: "var(--sl-spacing-xx-small)",
21407
+ },
21408
+ },
21409
+ Title: {
21410
+ color: "var(--sl-color-black)",
21411
+ fontSize: "var(--sl-font-size-small)",
21412
+ fontWeight: "var(--sl-font-weight-semibold)",
21413
+ },
21414
+ Footer: {
21415
+ display: "flex",
21416
+ "& .icon": {
21417
+ fontSize: "var(--sl-font-size-xx-small)",
21418
+ marginRight: "var(--sl-spacing-xx-small)",
21419
+ },
21420
+ "& .text": {
21421
+ marginTop: "auto",
21422
+ verticalAlign: "text-bottom",
21423
+ fontSize: "var(--sl-font-size-x-small)",
21424
+ color: "var(--sl-color-gray-600)",
21425
+ },
21426
+ "& .success": {
21427
+ color: "var(--sl-color-success-600)!important",
21428
+ fontWeight: "var(--sl-font-weight-semibold)",
21429
+ },
21430
+ "& .action": {
21431
+ marginTop: "auto",
21432
+ marginLeft: "auto",
21433
+ },
21434
+ "& sl-button.action::part(base) ": {
21435
+ color: "var(--sl-color-white)",
21436
+ background: "var(--sl-color-primary-500)",
21437
+ border: "1px solid var(--sl-color-primary-500)",
21438
+ borderRadius: "var(--sl-border-radius-medium)",
21439
+ },
21440
+ "& sl-button.action.completed::part(base) ": {
21441
+ border: "1px solid var(--sl-color-gray-300)!important",
21442
+ background: "var(--sl-color-gray-300)!important",
21443
+ },
21444
+ },
21445
+ };
21446
+ jss.setup(create());
21447
+ const sheet = jss.createStyleSheet(style);
21448
+ const styleString = sheet.toString();
21449
+ const showComplete = progress >= goal;
21450
+ const repetitions = showProgressBar ? Math.floor(progress / goal) : progress;
21451
+ const taskComplete = showComplete && repeatable === false;
21452
+ console.log({ showProgressBar, loading });
21453
+ return (h("div", { class: sheet.classes.TaskCard },
21454
+ h("div", { class: showComplete ? "main complete" : "main" },
21455
+ h("style", { type: "text/css" }, styleString),
21456
+ h("div", { class: sheet.classes.Header },
21457
+ showComplete && h("span", { class: "icon" }, checkmark_circle$1),
21458
+ h("span", { class: "value" }, rewardAmount),
21459
+ h("span", { class: "text" }, rewardUnit)),
21460
+ h("div", { class: sheet.classes.Title }, cardTitle),
21461
+ h(Details, { description: description }),
21462
+ showProgressBar && loading ? (h("sl-skeleton", { style: { width: "98%", margin: "0 auto" } })) : (showProgressBar && h(ProgressBarView, Object.assign({}, props, { complete: taskComplete }))),
21463
+ h("div", { class: sheet.classes.Footer },
21464
+ h("span", { class: "text" },
21465
+ repeatable && (h("div", null,
21466
+ h("span", { class: repetitions > 0 ? "icon success" : "icon" }, arrow_left_right$1),
21467
+ h("span", { class: repetitions > 0 ? "success" : "" },
21468
+ "Completed ",
21469
+ repetitions,
21470
+ " times"))),
21471
+ showExpiry && (h("span", null,
21472
+ "Ends ",
21473
+ " ",
21474
+ dateExpires))),
21475
+ h("sl-button", { class: taskComplete ? "action completed" : "action", size: "small", onClick: () => window.open(buttonLink), disabled: taskComplete }, buttonText)))));
21476
+ }
21477
+ function Details(props) {
21478
+ const style = {
21479
+ Description: {
21480
+ "& input[type=checkbox]": {
21481
+ display: "none",
21482
+ },
21483
+ "& input:checked ~ .details": {
21484
+ transform: "rotate(-180deg)",
21485
+ },
21486
+ "& .details": {
21487
+ position: "absolute",
21488
+ top: "var(--sl-spacing-medium)",
21489
+ right: "var(--sl-spacing-medium)",
21490
+ color: "var(--sl-color-gray-700)",
21491
+ fontSize: "var(--sl-font-size-large)",
21492
+ "& :hover": {
21493
+ color: "var(--sl-color-primary-700)",
21494
+ },
21495
+ transformOrigin: "50% 37%",
21496
+ transition: "transform var(--sl-transition-medium) ease",
21497
+ },
21498
+ "& input:checked ~ .summary": {
21499
+ transition: "max-height var(--sl-transition-medium) ease",
21500
+ maxHeight: "300px",
21501
+ },
21502
+ "& .summary": {
21503
+ display: "block",
21504
+ overflow: "hidden",
21505
+ color: "var(--sl-color-gray-700)",
21506
+ fontSize: "var(--sl-font-size-x-small)",
21507
+ maxHeight: "0px",
21508
+ transition: "max-height var(--sl-transition-fast) ease-out",
21509
+ },
21510
+ },
21511
+ };
21512
+ jss.setup(create());
21513
+ const sheet = jss.createStyleSheet(style);
21514
+ const styleString = sheet.toString();
21515
+ const rid = Math.random().toString(36).slice(2);
21516
+ return (h("div", null,
21517
+ h("style", { type: "text/css" }, styleString),
21518
+ h("span", { class: sheet.classes.Description },
21519
+ h("input", { type: "checkbox", id: "details-" + rid }),
21520
+ h("label", { class: "details", htmlFor: "details-" + rid },
21521
+ h("sl-icon", { name: "chevron-down" })),
21522
+ h("span", { class: "summary" }, props.description))));
20581
21523
  }
20582
21524
 
21525
+ const scenario$5 = "@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 |";
21526
+
20583
21527
  const TaskCard_stories = {
20584
- title: "Components/Task Card",
21528
+ title: "Components/Task Card/",
21529
+ parameters: {
21530
+ scenario: scenario$5,
21531
+ },
20585
21532
  };
20586
21533
  const resizable = {
20587
21534
  width: "347px",
@@ -20592,57 +21539,72 @@ const resizable = {
20592
21539
  };
20593
21540
  const NotRepeatable = () => {
20594
21541
  const oneAction = {
20595
- points: 20,
20596
- title: "Complete a survey",
21542
+ rewardAmount: 20,
21543
+ showExpiry: false,
21544
+ rewardUnit: "Points",
21545
+ cardTitle: "Complete a survey",
21546
+ repeatable: false,
20597
21547
  description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
20598
21548
  buttonText: "Take survey",
20599
- onClick: () => { },
21549
+ goal: 1,
21550
+ buttonLink: "https://example.com/",
21551
+ showProgressBar: false,
21552
+ loading: false,
20600
21553
  };
20601
21554
  const coupleActions = {
20602
- points: 40,
20603
- title: "Comment on 5 articles",
20604
- progress: 1,
21555
+ rewardAmount: 40,
21556
+ rewardUnit: "Points",
21557
+ cardTitle: "Comment on 5 articles",
21558
+ showProgressBar: true,
21559
+ showExpiry: false,
20605
21560
  goal: 5,
20606
- steps: 1,
21561
+ repeatable: false,
21562
+ steps: true,
20607
21563
  description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
20608
21564
  buttonText: "Start reading",
20609
- onClick: () => { },
21565
+ buttonLink: "https://example.com/",
21566
+ loading: false,
20610
21567
  };
20611
21568
  const manyActions = {
20612
- points: 150,
20613
- title: "Spend $500 at our Store",
20614
- progress: 230,
21569
+ rewardAmount: 150,
21570
+ rewardUnit: "Points",
21571
+ cardTitle: "Spend $500 at our Store",
21572
+ showProgressBar: true,
21573
+ showExpiry: false,
20615
21574
  goal: 500,
20616
- unit: "$",
21575
+ repeatable: false,
21576
+ progressBarUnit: "$",
20617
21577
  description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
20618
21578
  buttonText: "Visit our Store",
20619
- onClick: () => { },
21579
+ buttonLink: "https://example.com/",
21580
+ loading: false,
20620
21581
  };
20621
21582
  return (h("div", { style: { display: "inline-flex", gap: "32px" } },
20622
21583
  h("div", { style: resizable },
20623
21584
  h("h4", null, "One Action"),
20624
- h(TaskCardView, Object.assign({}, oneAction)),
21585
+ h(TaskCardView, Object.assign({}, oneAction, { progress: 0 })),
20625
21586
  " ",
20626
21587
  h("h5", null),
20627
- h(TaskCardView, Object.assign({}, oneAction, { complete: true })),
21588
+ h(TaskCardView, Object.assign({}, oneAction, { progress: 1 })),
20628
21589
  " ",
20629
21590
  h("h5", null)),
20630
21591
  h("div", { style: resizable },
20631
21592
  h("h4", null, "A Couple Actions"),
20632
- h(TaskCardView, Object.assign({}, coupleActions)),
21593
+ h(TaskCardView, Object.assign({}, coupleActions, { progress: 0 })),
21594
+ " ",
21595
+ h("h5", null),
21596
+ h(TaskCardView, Object.assign({}, coupleActions, { progress: 1 })),
20633
21597
  " ",
20634
21598
  h("h5", null),
20635
21599
  h(TaskCardView, Object.assign({}, coupleActions, { progress: 5 })),
20636
- h("h5", null,
20637
- "Progress ",
20638
- ">",
20639
- " Goal"),
20640
- h(TaskCardView, Object.assign({}, coupleActions, { progress: 9 })),
20641
21600
  " ",
20642
21601
  h("h5", null)),
20643
21602
  h("div", { style: resizable },
20644
21603
  h("h4", null, "Many Actions"),
20645
- h(TaskCardView, Object.assign({}, manyActions)),
21604
+ h(TaskCardView, Object.assign({}, manyActions, { progress: 0 })),
21605
+ " ",
21606
+ h("h5", null),
21607
+ h(TaskCardView, Object.assign({}, manyActions, { progress: 230 })),
20646
21608
  " ",
20647
21609
  h("h5", null),
20648
21610
  h(TaskCardView, Object.assign({}, manyActions, { progress: 500 })),
@@ -20651,60 +21613,75 @@ const NotRepeatable = () => {
20651
21613
  };
20652
21614
  const NotRepeatableWithExpiry = () => {
20653
21615
  const oneAction = {
20654
- points: 20,
20655
- title: "Complete a survey",
21616
+ rewardAmount: 20,
21617
+ rewardUnit: "Points",
21618
+ cardTitle: "Complete a survey",
20656
21619
  description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
20657
- expire: "Nov 30, 2021",
20658
21620
  buttonText: "Take survey",
20659
- onClick: () => { },
21621
+ goal: 1,
21622
+ showExpiry: true,
21623
+ repeatable: false,
21624
+ dateExpires: "Nov 1, 2021",
21625
+ buttonLink: "https://example.com/",
21626
+ showProgressBar: false,
21627
+ loading: false,
20660
21628
  };
20661
21629
  const coupleActions = {
20662
- points: 40,
20663
- title: "Comment on 5 articles",
20664
- progress: 1,
21630
+ rewardAmount: 40,
21631
+ rewardUnit: "Points",
21632
+ cardTitle: "Comment on 5 articles",
21633
+ showProgressBar: true,
20665
21634
  goal: 5,
20666
- steps: 1,
21635
+ steps: true,
20667
21636
  description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
20668
- expire: "Nov 30, 2021",
20669
21637
  buttonText: "Start reading",
20670
- onClick: () => { },
21638
+ showExpiry: true,
21639
+ repeatable: false,
21640
+ dateExpires: "Nov 1, 2021",
21641
+ buttonLink: "https://example.com/",
21642
+ loading: false,
20671
21643
  };
20672
21644
  const manyActions = {
20673
- points: 150,
20674
- title: "Spend $500 at our Store",
20675
- progress: 230,
21645
+ rewardAmount: 150,
21646
+ rewardUnit: "Points",
21647
+ repeatable: false,
21648
+ cardTitle: "Spend $500 at our Store",
21649
+ showProgressBar: true,
20676
21650
  goal: 500,
20677
- unit: "$",
21651
+ progressBarUnit: "$",
20678
21652
  description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
20679
- expire: "Nov 30, 2021",
20680
21653
  buttonText: "Visit our Store",
20681
- onClick: () => { },
21654
+ showExpiry: true,
21655
+ dateExpires: "Nov 1, 2021",
21656
+ buttonLink: "https://example.com/",
21657
+ loading: false,
20682
21658
  };
20683
21659
  return (h("div", { style: { display: "inline-flex", gap: "32px" } },
20684
21660
  h("div", { style: resizable },
20685
21661
  h("h4", null, "One Action"),
20686
- h(TaskCardView, Object.assign({}, oneAction)),
21662
+ h(TaskCardView, Object.assign({}, oneAction, { progress: 0 })),
20687
21663
  " ",
20688
21664
  h("h5", null),
20689
- h(TaskCardView, Object.assign({}, oneAction, { complete: true })),
21665
+ h(TaskCardView, Object.assign({}, oneAction, { progress: 1 })),
20690
21666
  " ",
20691
21667
  h("h5", null)),
20692
21668
  h("div", { style: resizable },
20693
21669
  h("h4", null, "A Couple Actions"),
20694
- h(TaskCardView, Object.assign({}, coupleActions)),
21670
+ h(TaskCardView, Object.assign({}, coupleActions, { progress: 0 })),
21671
+ " ",
21672
+ h("h5", null),
21673
+ h(TaskCardView, Object.assign({}, coupleActions, { progress: 1 })),
20695
21674
  " ",
20696
21675
  h("h5", null),
20697
21676
  h(TaskCardView, Object.assign({}, coupleActions, { progress: 5 })),
20698
- h("h5", null,
20699
- "Progress ",
20700
- ">",
20701
- " Goal"),
20702
- h(TaskCardView, Object.assign({}, coupleActions, { progress: 9 })),
20703
21677
  " ",
20704
21678
  h("h5", null)),
20705
21679
  h("div", { style: resizable },
20706
21680
  h("h4", null, "Many Actions"),
20707
- h(TaskCardView, Object.assign({}, manyActions)),
21681
+ h(TaskCardView, Object.assign({}, manyActions, { progress: 0 })),
21682
+ " ",
21683
+ h("h5", null),
21684
+ h(TaskCardView, Object.assign({}, manyActions, { progress: 230 })),
20708
21685
  " ",
20709
21686
  h("h5", null),
20710
21687
  h(TaskCardView, Object.assign({}, manyActions, { progress: 500 })),
@@ -20713,40 +21690,53 @@ const NotRepeatableWithExpiry = () => {
20713
21690
  };
20714
21691
  const Repeatable = () => {
20715
21692
  const oneAction = {
20716
- points: 20,
20717
- title: "Complete a survey",
21693
+ rewardAmount: 20,
21694
+ rewardUnit: "Points",
21695
+ showExpiry: false,
21696
+ cardTitle: "Complete a survey",
20718
21697
  description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
20719
- repeatable: 0,
20720
21698
  buttonText: "Take survey",
20721
- onClick: () => { },
21699
+ goal: 1,
21700
+ repeatable: true,
21701
+ buttonLink: "https://example.com/",
21702
+ showProgressBar: false,
21703
+ loading: false,
20722
21704
  };
20723
21705
  const coupleActions = {
20724
- points: 40,
20725
- title: "Comment on 5 articles",
20726
- goal: 5,
20727
- steps: 1,
21706
+ rewardAmount: 40,
21707
+ rewardUnit: "Points",
21708
+ showExpiry: false,
21709
+ cardTitle: "Comment on 5 articles",
21710
+ showProgressBar: true,
20728
21711
  repeatable: true,
21712
+ goal: 5,
21713
+ steps: true,
20729
21714
  description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
20730
21715
  buttonText: "Start reading",
20731
- onClick: () => { },
21716
+ buttonLink: "https://example.com/",
21717
+ loading: false,
20732
21718
  };
20733
21719
  const manyActions = {
20734
- points: 150,
20735
- title: "Spend $500 at our Store",
20736
- goal: 500,
21720
+ rewardAmount: 150,
21721
+ rewardUnit: "Points",
21722
+ showExpiry: false,
21723
+ cardTitle: "Spend $500 at our Store",
21724
+ showProgressBar: true,
20737
21725
  repeatable: true,
20738
- unit: "$",
21726
+ goal: 500,
21727
+ progressBarUnit: "$",
20739
21728
  description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
20740
21729
  buttonText: "Visit our Store",
20741
- onClick: () => { },
21730
+ buttonLink: "https://example.com/",
21731
+ loading: false,
20742
21732
  };
20743
21733
  return (h("div", { style: { display: "inline-flex", gap: "32px" } },
20744
21734
  h("div", { style: resizable },
20745
21735
  h("h4", null, "One Action"),
20746
- h(TaskCardView, Object.assign({}, oneAction)),
21736
+ h(TaskCardView, Object.assign({}, oneAction, { progress: 0 })),
20747
21737
  " ",
20748
21738
  h("h5", null),
20749
- h(TaskCardView, Object.assign({}, oneAction, { repeatable: 1, complete: true })),
21739
+ h(TaskCardView, Object.assign({}, oneAction, { progress: 1 })),
20750
21740
  " ",
20751
21741
  h("h5", null)),
20752
21742
  h("div", { style: resizable },
@@ -20762,9 +21752,6 @@ const Repeatable = () => {
20762
21752
  h("h5", null),
20763
21753
  h(TaskCardView, Object.assign({}, coupleActions, { progress: 10 })),
20764
21754
  " ",
20765
- h("h5", null),
20766
- h(TaskCardView, Object.assign({}, coupleActions, { progress: 12 })),
20767
- " ",
20768
21755
  h("h5", null)),
20769
21756
  h("div", { style: resizable },
20770
21757
  h("h4", null, "Many Actions"),
@@ -20779,50 +21766,60 @@ const Repeatable = () => {
20779
21766
  h("h5", null),
20780
21767
  h(TaskCardView, Object.assign({}, manyActions, { progress: 1000 })),
20781
21768
  " ",
20782
- h("h5", null),
20783
- h(TaskCardView, Object.assign({}, manyActions, { progress: 1200 })),
20784
- " ",
20785
21769
  h("h5", null))));
20786
21770
  };
20787
21771
  const RepeatableWithExpiry = () => {
20788
21772
  const oneAction = {
20789
- points: 20,
20790
- title: "Complete a survey",
20791
- expire: "Nov 30, 2021",
21773
+ rewardAmount: 20,
21774
+ rewardUnit: "Points",
21775
+ cardTitle: "Complete a survey",
20792
21776
  description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
20793
- repeatable: 0,
20794
21777
  buttonText: "Take survey",
20795
- onClick: () => { },
21778
+ goal: 1,
21779
+ repeatable: true,
21780
+ showExpiry: true,
21781
+ dateExpires: "Nov 1, 2021",
21782
+ buttonLink: "https://example.com/",
21783
+ showProgressBar: false,
21784
+ loading: false,
20796
21785
  };
20797
21786
  const coupleActions = {
20798
- points: 40,
20799
- title: "Comment on 5 articles",
20800
- expire: "Nov 30, 2021",
20801
- goal: 5,
20802
- steps: 1,
21787
+ rewardAmount: 40,
21788
+ rewardUnit: "Points",
21789
+ cardTitle: "Comment on 5 articles",
21790
+ showProgressBar: true,
20803
21791
  repeatable: true,
21792
+ goal: 5,
21793
+ steps: true,
20804
21794
  description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
20805
21795
  buttonText: "Start reading",
20806
- onClick: () => { },
21796
+ showExpiry: true,
21797
+ dateExpires: "Nov 1, 2021",
21798
+ buttonLink: "https://example.com/",
21799
+ loading: false,
20807
21800
  };
20808
21801
  const manyActions = {
20809
- points: 150,
20810
- title: "Spend $500 at our Store",
20811
- expire: "Nov 30, 2021",
20812
- goal: 500,
21802
+ rewardAmount: 150,
21803
+ rewardUnit: "Points",
21804
+ cardTitle: "Spend $500 at our Store",
21805
+ showProgressBar: true,
20813
21806
  repeatable: true,
20814
- unit: "$",
21807
+ goal: 500,
21808
+ progressBarUnit: "$",
20815
21809
  description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
20816
21810
  buttonText: "Visit our Store",
20817
- onClick: () => { },
21811
+ showExpiry: true,
21812
+ dateExpires: "Nov 1, 2021",
21813
+ buttonLink: "https://example.com/",
21814
+ loading: false,
20818
21815
  };
20819
21816
  return (h("div", { style: { display: "inline-flex", gap: "32px" } },
20820
21817
  h("div", { style: resizable },
20821
21818
  h("h4", null, "One Action"),
20822
- h(TaskCardView, Object.assign({}, oneAction)),
21819
+ h(TaskCardView, Object.assign({}, oneAction, { progress: 0 })),
20823
21820
  " ",
20824
21821
  h("h5", null),
20825
- h(TaskCardView, Object.assign({}, oneAction, { repeatable: 1, complete: true })),
21822
+ h(TaskCardView, Object.assign({}, oneAction, { progress: 1 })),
20826
21823
  " ",
20827
21824
  h("h5", null)),
20828
21825
  h("div", { style: resizable },
@@ -20838,9 +21835,6 @@ const RepeatableWithExpiry = () => {
20838
21835
  h("h5", null),
20839
21836
  h(TaskCardView, Object.assign({}, coupleActions, { progress: 10 })),
20840
21837
  " ",
20841
- h("h5", null),
20842
- h(TaskCardView, Object.assign({}, coupleActions, { progress: 12 })),
20843
- " ",
20844
21838
  h("h5", null)),
20845
21839
  h("div", { style: resizable },
20846
21840
  h("h4", null, "Many Actions"),
@@ -20855,28 +21849,141 @@ const RepeatableWithExpiry = () => {
20855
21849
  h("h5", null),
20856
21850
  h(TaskCardView, Object.assign({}, manyActions, { progress: 1000 })),
20857
21851
  " ",
20858
- h("h5", null),
20859
- h(TaskCardView, Object.assign({}, manyActions, { progress: 1200 })),
20860
- " ",
20861
21852
  h("h5", null))));
21853
+ };
21854
+
21855
+ const TaskCard$1 = /*#__PURE__*/Object.freeze({
21856
+ __proto__: null,
21857
+ 'default': TaskCard_stories,
21858
+ NotRepeatable: NotRepeatable,
21859
+ NotRepeatableWithExpiry: NotRepeatableWithExpiry,
21860
+ Repeatable: Repeatable,
21861
+ RepeatableWithExpiry: RepeatableWithExpiry
21862
+ });
21863
+
21864
+ /**
21865
+ * Displays a cartesian product of the input props
21866
+ *
21867
+ * @returns
21868
+ */
21869
+ function MatrixStory({ matrix, props, Component, }) {
21870
+ const propMatrix = Object.keys(matrix).map((propKey) => {
21871
+ const propValues = matrix[propKey];
21872
+ return propValues.map((val) => {
21873
+ return {
21874
+ [propKey]: val,
21875
+ };
21876
+ });
21877
+ });
21878
+ const combinations = cartesian(...propMatrix);
21879
+ const propsCombinations = combinations.map((combo) => {
21880
+ return combo.reduce((props, prop) => {
21881
+ return {
21882
+ ...props,
21883
+ ...prop,
21884
+ };
21885
+ }, {});
21886
+ });
21887
+ return propsCombinations.map((combo) => {
21888
+ const example = { ...props, ...combo };
21889
+ return (h("div", null,
21890
+ h(PropsTable, { values: example }),
21891
+ h("hr", null),
21892
+ h(Component, Object.assign({}, example))));
21893
+ });
21894
+ }
21895
+ function PropsTable({ values }) {
21896
+ return (h("table", null,
21897
+ h("tbody", null, Object.keys(values).map((key) => {
21898
+ return (h("tr", null,
21899
+ h("th", null, key),
21900
+ h("td", null, JSON.stringify(values[key]))));
21901
+ }))));
21902
+ }
21903
+ /**
21904
+ * Source: https://stackoverflow.com/questions/15298912/javascript-generating-combinations-from-n-arrays-with-m-elements
21905
+ *
21906
+ * TODO: Could replace with a fork of https://www.npmjs.com/package/cartesian
21907
+ *
21908
+ * @param args - an array of arrays
21909
+ * @returns combinations of the elements in those array
21910
+ */
21911
+ function cartesian(...args) {
21912
+ var r = [], max = args.length - 1;
21913
+ function helper(arr, i) {
21914
+ for (var j = 0, l = args[i].length; j < l; j++) {
21915
+ var a = arr.slice(0); // clone arr
21916
+ a.push(args[i][j]);
21917
+ if (i == max)
21918
+ r.push(a);
21919
+ else
21920
+ helper(a, i + 1);
21921
+ }
21922
+ }
21923
+ helper([], 0);
21924
+ return r;
21925
+ }
21926
+
21927
+ const scenario$6 = "@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 |";
21928
+
21929
+ const progressBar_stories = {
21930
+ title: "Components/Task Card Progress Bar",
21931
+ parameters: {
21932
+ scenario: scenario$6,
21933
+ },
21934
+ };
21935
+ const Default$a = () => {
21936
+ return h(ProgressBarView, null);
20862
21937
  };
20863
21938
  const ProgressBar$1 = () => {
20864
21939
  const props = {
21940
+ progress: 0,
21941
+ goal: 500,
21942
+ progressBarUnit: "$",
21943
+ };
21944
+ return (h("div", null,
21945
+ h(MatrixStory, { matrix: { progress: [-100, 0, 100, 500, 1000] }, props: props, Component: ProgressBarView })));
21946
+ };
21947
+ const ProgressBarSteps = () => {
21948
+ const props = {
21949
+ progress: 0,
21950
+ steps: true,
21951
+ goal: 5,
21952
+ progressBarUnit: "$",
21953
+ };
21954
+ return (h("div", null,
21955
+ h(MatrixStory, { matrix: { progress: [-1, 0, 1, 5, 7] }, props: props, Component: ProgressBarView })));
21956
+ };
21957
+ const ProgressBarRepeatable = () => {
21958
+ const props = {
21959
+ progress: 0,
21960
+ goal: 500,
21961
+ progressBarUnit: "$",
21962
+ repeatable: true,
21963
+ };
21964
+ return (h("div", null,
21965
+ h(MatrixStory, { matrix: { progress: [100, 500, 650, 1200] }, props: props, Component: ProgressBarView })));
21966
+ };
21967
+ const ProgressBarStepsRepeatable = () => {
21968
+ const props = {
21969
+ progress: 0,
21970
+ steps: true,
20865
21971
  goal: 5,
21972
+ progressBarUnit: "$",
21973
+ repeatable: true,
20866
21974
  };
20867
21975
  return (h("div", null,
20868
- h(MatrixStory, { matrix: { progress: [1, 2, 5], steps: [0, 1], repeatable: [false] }, props: props, Component: ProgressBar$2 }),
20869
- h(MatrixStory, { matrix: { progress: [2, 5, 7, 12], steps: [0, 1], repeatable: [true] }, props: props, Component: ProgressBar$2 })));
21976
+ h(MatrixStory, { matrix: { progress: [1, 5, 7, 12] }, props: props, Component: ProgressBarView })));
20870
21977
  };
20871
21978
 
20872
- const TaskCard = /*#__PURE__*/Object.freeze({
21979
+ const TaskCardProgressBar = /*#__PURE__*/Object.freeze({
20873
21980
  __proto__: null,
20874
- 'default': TaskCard_stories,
20875
- NotRepeatable: NotRepeatable,
20876
- NotRepeatableWithExpiry: NotRepeatableWithExpiry,
20877
- Repeatable: Repeatable,
20878
- RepeatableWithExpiry: RepeatableWithExpiry,
20879
- ProgressBar: ProgressBar$1
21981
+ 'default': progressBar_stories,
21982
+ Default: Default$a,
21983
+ ProgressBar: ProgressBar$1,
21984
+ ProgressBarSteps: ProgressBarSteps,
21985
+ ProgressBarRepeatable: ProgressBarRepeatable,
21986
+ ProgressBarStepsRepeatable: ProgressBarStepsRepeatable
20880
21987
  });
20881
21988
 
20882
21989
  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";
@@ -23891,7 +24998,7 @@ const ReferralIframeReadme = "# sqm-referral-iframe\r\n\r\n\r\n\r\n<!-- Auto Gen
23891
24998
 
23892
24999
  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";
23893
25000
 
23894
- 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";
25001
+ const RegisterReadme = "# sqm-portal-register\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| `confirmPassword` | `confirm-password` | | `boolean` | `false` |\r\n| `confirmPasswordLabel` | `confirm-password-label` | | `string` | `\"Confirm Password\"` |\r\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` |\r\n| `emailLabel` | `email-label` | | `string` | `\"Email\"` |\r\n| `enablePasswordValidation` | `enable-password-validation` | | `boolean` | `true` |\r\n| `hideInputs` | `hide-inputs` | | `boolean` | `false` |\r\n| `loginLabel` | `login-label` | | `string` | `\"Sign in\"` |\r\n| `nextPage` | `next-page` | | `string` | `\"/\"` |\r\n| `pageLabel` | `page-label` | | `string` | `\"Register\"` |\r\n| `passwordLabel` | `password-label` | | `string` | `\"Password\"` |\r\n| `submitLabel` | `submit-label` | | `string` | `\"Register\"` |\r\n\r\n\r\n## Dependencies\r\n\r\n### Used by\r\n\r\n - [sqm-stencilbook](../sqm-stencilbook)\r\n\r\n### Depends on\r\n\r\n- [sqm-form-message](../sqm-form-message)\r\n- [sqm-password-field](../sqm-password-field)\r\n\r\n### Graph\r\n```mermaid\r\ngraph TD;\r\n sqm-portal-register --> sqm-form-message\r\n sqm-portal-register --> sqm-password-field\r\n sqm-stencilbook --> sqm-portal-register\r\n style sqm-portal-register 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";
23895
25002
 
23896
25003
  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";
23897
25004
 
@@ -23899,7 +25006,7 @@ const ResetPasswordReadme = "# sqm-portal-reset-password\r\n\r\n\r\n\r\n<!-- Aut
23899
25006
 
23900
25007
  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";
23901
25008
 
23902
- 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";
25009
+ 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";
23903
25010
 
23904
25011
  const PortalTemplates_stories = {
23905
25012
  title: "Templates / Portal",
@@ -24097,7 +25204,7 @@ const ProgramMenu$1 = /*#__PURE__*/Object.freeze({
24097
25204
  const PoweredByImg_stories = {
24098
25205
  title: "Powered By",
24099
25206
  };
24100
- const Default$a = () => {
25207
+ const Default$b = () => {
24101
25208
  return h(PoweredByImg$1, null);
24102
25209
  };
24103
25210
  const CustomColor = () => {
@@ -24110,17 +25217,17 @@ const CustomWidthAndHeight = () => {
24110
25217
  const PoweredByImg = /*#__PURE__*/Object.freeze({
24111
25218
  __proto__: null,
24112
25219
  'default': PoweredByImg_stories,
24113
- Default: Default$a,
25220
+ Default: Default$b,
24114
25221
  CustomColor: CustomColor,
24115
25222
  CustomWidthAndHeight: CustomWidthAndHeight
24116
25223
  });
24117
25224
 
24118
- 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";
25225
+ const scenario$7 = "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";
24119
25226
 
24120
25227
  const PortalFooter_stories = {
24121
25228
  title: "Portal Footer",
24122
25229
  parameters: {
24123
- scenario: scenario$5,
25230
+ scenario: scenario$7,
24124
25231
  },
24125
25232
  };
24126
25233
  const defaultProps$9 = {
@@ -24149,12 +25256,12 @@ const PortalFooter = /*#__PURE__*/Object.freeze({
24149
25256
  FooterNoPoweredBy: FooterNoPoweredBy
24150
25257
  });
24151
25258
 
24152
- 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 |";
25259
+ const scenario$8 = "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 |";
24153
25260
 
24154
25261
  const Hero_stories = {
24155
25262
  title: "Hero Layout",
24156
25263
  parameters: {
24157
- scenario: scenario$6,
25264
+ scenario: scenario$8,
24158
25265
  },
24159
25266
  };
24160
25267
  const LoginOneColumn = () => {
@@ -24331,12 +25438,12 @@ const Hero = /*#__PURE__*/Object.freeze({
24331
25438
  TwoColumnLoginWithImgElement: TwoColumnLoginWithImgElement
24332
25439
  });
24333
25440
 
24334
- 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 | |";
25441
+ const scenario$9 = "@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 | |";
24335
25442
 
24336
25443
  const ReferralIframe_stories = {
24337
25444
  title: "Referral Iframe",
24338
25445
  parameters: {
24339
- scenario: scenario$7,
25446
+ scenario: scenario$9,
24340
25447
  },
24341
25448
  };
24342
25449
  const props = {
@@ -24367,12 +25474,12 @@ const ReferralIframe$1 = /*#__PURE__*/Object.freeze({
24367
25474
  ReferralIframeError: ReferralIframeError
24368
25475
  });
24369
25476
 
24370
- 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";
25477
+ const scenario$a = "@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";
24371
25478
 
24372
25479
  const NameFields_stories = {
24373
25480
  title: "Name Fields",
24374
25481
  parameters: {
24375
- scenario: scenario$8,
25482
+ scenario: scenario$a,
24376
25483
  },
24377
25484
  };
24378
25485
  const props$1 = {
@@ -24410,6 +25517,251 @@ const NameFields$1 = /*#__PURE__*/Object.freeze({
24410
25517
  NameFieldsWithErrors: NameFieldsWithErrors
24411
25518
  });
24412
25519
 
25520
+ const baseResponse = (data) => ({
25521
+ states: {
25522
+ content: null,
25523
+ redeemStage: "chooseReward",
25524
+ amount: 0,
25525
+ exchangeError: false,
25526
+ loading: false,
25527
+ selectedItem: null,
25528
+ selectedStep: null,
25529
+ },
25530
+ data: {
25531
+ exchangeList: data,
25532
+ },
25533
+ callbacks: {
25534
+ exchangeReward: null,
25535
+ openDrawer: null,
25536
+ setStage: null,
25537
+ setExchangeState: null,
25538
+ refs: null,
25539
+ },
25540
+ refs: null,
25541
+ });
25542
+ const baseReward$2 = {
25543
+ key: "",
25544
+ name: "",
25545
+ description: "",
25546
+ imageUrl: "",
25547
+ available: true,
25548
+ unavailableReason: null,
25549
+ unavailableReasonCode: null,
25550
+ ruleType: "FIXED_GLOBAL_REWARD",
25551
+ sourceUnit: "POINT",
25552
+ sourceValue: 10,
25553
+ prettySourceValue: "10 SaaSquatch Points",
25554
+ sourceMinValue: null,
25555
+ prettySourceMinValue: null,
25556
+ sourceMaxValue: null,
25557
+ prettySourceMaxValue: null,
25558
+ destinationMinValue: null,
25559
+ prettyDestinationMinValue: null,
25560
+ destinationMaxValue: null,
25561
+ prettyDestinationMaxValue: null,
25562
+ globalRewardKey: "",
25563
+ destinationUnit: null,
25564
+ steps: [],
25565
+ };
25566
+ const notEnoughPoints = {
25567
+ available: false,
25568
+ unavailableReasonCode: "INSUFFICIENT_REDEEMABLE_CREDIT",
25569
+ };
25570
+ const usTax = {
25571
+ available: false,
25572
+ unavailableReasonCode: "US_TAX",
25573
+ };
25574
+ const imageUrl = (props) => ({
25575
+ imageUrl: props,
25576
+ });
25577
+ const description = (props) => ({
25578
+ description: props,
25579
+ });
25580
+ const fixedValue = (props) => ({
25581
+ prettySourceValue: props,
25582
+ });
25583
+ const variableValue = (min, max, text) => ({
25584
+ ruleType: "VARIABLE_CREDIT_REWARD",
25585
+ sourceMinValue: min,
25586
+ prettySourceMinValue: min + " " + text,
25587
+ sourceMaxValue: max,
25588
+ prettySourceMaxValue: max + " " + text,
25589
+ });
25590
+ const test = {
25591
+ ...baseResponse([
25592
+ {
25593
+ ...baseReward$2,
25594
+ ...description("Free swag with a promo code"),
25595
+ ...imageUrl("https://i.imgur.com/Ds7M19I.png"),
25596
+ ...fixedValue("40 SaaSquatch Points"),
25597
+ },
25598
+ {
25599
+ ...baseReward$2,
25600
+ ...description("Visa® Prepaid Card USD"),
25601
+ ...imageUrl("https://i.imgur.com/4s3q2zz.png"),
25602
+ ...variableValue(20, 80, "SaaSquatch Points"),
25603
+ },
25604
+ {
25605
+ ...baseReward$2,
25606
+ ...description("A very exclusive gift box"),
25607
+ ...imageUrl("https://i.imgur.com/XuiJi4l.png"),
25608
+ ...fixedValue("30 SaaSquatch Points"),
25609
+ },
25610
+ {
25611
+ ...baseReward$2,
25612
+ ...description("$50 Store credit"),
25613
+ ...imageUrl("https://i.imgur.com/WkCMVSE.png"),
25614
+ ...fixedValue("100 SaaSquatch Points"),
25615
+ },
25616
+ {
25617
+ ...baseReward$2,
25618
+ ...description("Variable amount of store credit"),
25619
+ ...imageUrl("https://i.imgur.com/Jn2fE0s.png"),
25620
+ ...variableValue(20, 100, "SaaSquatch Points"),
25621
+ },
25622
+ {
25623
+ ...baseReward$2,
25624
+ ...notEnoughPoints,
25625
+ ...description("A very rare cactus"),
25626
+ ...imageUrl("https://i.imgur.com/CvCdpXc.png"),
25627
+ ...fixedValue("2000 SaaSquatch Points"),
25628
+ },
25629
+ {
25630
+ ...baseReward$2,
25631
+ ...usTax,
25632
+ ...description("$1000 Store credit"),
25633
+ ...imageUrl("https://i.imgur.com/I9FCh9Z.png"),
25634
+ ...fixedValue("2000 SaaSquatch Points"),
25635
+ },
25636
+ {
25637
+ ...baseReward$2,
25638
+ ...notEnoughPoints,
25639
+ ...description("A holiday gift box"),
25640
+ ...imageUrl("https://i.imgur.com/HBJS1WH.png"),
25641
+ ...fixedValue("100 SaaSquatch Points"),
25642
+ },
25643
+ ]),
25644
+ };
25645
+ const test2 = {
25646
+ states: {
25647
+ content: {
25648
+ text: {
25649
+ buttonText: "Exchange Rewards",
25650
+ ignored: true,
25651
+ },
25652
+ },
25653
+ redeemStage: "chooseAmount",
25654
+ amount: 0,
25655
+ exchangeError: false,
25656
+ loading: false,
25657
+ selectedItem: {
25658
+ key: "r4",
25659
+ name: "Salmon Coins",
25660
+ description: "Points for Salmon Coins",
25661
+ 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",
25662
+ available: true,
25663
+ unavailableReason: null,
25664
+ unavailableReasonCode: null,
25665
+ ruleType: "VARIABLE_CREDIT_REWARD",
25666
+ sourceUnit: "POINT",
25667
+ sourceValue: null,
25668
+ prettySourceValue: null,
25669
+ sourceMinValue: 1,
25670
+ prettySourceMinValue: "1 Point",
25671
+ sourceMaxValue: 100,
25672
+ prettySourceMaxValue: "100 Points",
25673
+ destinationMinValue: 1,
25674
+ prettyDestinationMinValue: "1 Salmon Coin",
25675
+ destinationMaxValue: 100,
25676
+ prettyDestinationMaxValue: "100 Salmons",
25677
+ globalRewardKey: null,
25678
+ destinationUnit: "TESTUNIT",
25679
+ steps: [
25680
+ {
25681
+ sourceValue: 1,
25682
+ prettySourceValue: "1 Point",
25683
+ destinationValue: 1,
25684
+ prettyDestinationValue: "1 Salmon Coin",
25685
+ available: true,
25686
+ unavailableReasonCode: null,
25687
+ },
25688
+ {
25689
+ sourceValue: 2,
25690
+ prettySourceValue: "2 Points",
25691
+ destinationValue: 2,
25692
+ prettyDestinationValue: "2 Salmons",
25693
+ available: true,
25694
+ unavailableReasonCode: null,
25695
+ },
25696
+ {
25697
+ sourceValue: 3,
25698
+ prettySourceValue: "3 Points",
25699
+ destinationValue: 3,
25700
+ prettyDestinationValue: "3 Salmons",
25701
+ available: true,
25702
+ unavailableReasonCode: null,
25703
+ },
25704
+ {
25705
+ sourceValue: 4,
25706
+ prettySourceValue: "4 Points",
25707
+ destinationValue: 4,
25708
+ prettyDestinationValue: "4 Salmons",
25709
+ available: true,
25710
+ unavailableReasonCode: null,
25711
+ },
25712
+ {
25713
+ sourceValue: 5,
25714
+ prettySourceValue: "5 Points",
25715
+ destinationValue: 5,
25716
+ prettyDestinationValue: "5 Salmons",
25717
+ available: true,
25718
+ unavailableReasonCode: null,
25719
+ },
25720
+ ],
25721
+ },
25722
+ selectedStep: null,
25723
+ },
25724
+ data: {
25725
+ exchangeList: null,
25726
+ },
25727
+ callbacks: {
25728
+ exchangeReward: null,
25729
+ openDrawer: null,
25730
+ setStage: null,
25731
+ setExchangeState: null,
25732
+ refs: {
25733
+ drawerRef: {},
25734
+ },
25735
+ },
25736
+ refs: null,
25737
+ };
25738
+
25739
+ const RewardExchangeList_stories = {
25740
+ title: "Components/Reward Exchange List",
25741
+ };
25742
+ const resizable$1 = {
25743
+ width: "683px",
25744
+ minWidth: "260px",
25745
+ resize: "horizontal",
25746
+ height: "fit-content",
25747
+ overflow: "hidden",
25748
+ };
25749
+ const Default$c = () => {
25750
+ return (h("div", { style: resizable$1 },
25751
+ h(RewardExchangeView, Object.assign({}, test))));
25752
+ };
25753
+ const Default2 = () => {
25754
+ return (h("div", { style: { ...resizable$1, height: "700px" } },
25755
+ h(RewardExchangeView, Object.assign({}, test2))));
25756
+ };
25757
+
25758
+ const RewardExchangeList = /*#__PURE__*/Object.freeze({
25759
+ __proto__: null,
25760
+ 'default': RewardExchangeList_stories,
25761
+ Default: Default$c,
25762
+ Default2: Default2
25763
+ });
25764
+
24413
25765
  function deepFreeze(obj) {
24414
25766
  if (obj instanceof Map) {
24415
25767
  obj.clear = obj.delete = obj.set = function () {
@@ -26990,7 +28342,9 @@ const CucumberAddon = ({ story }, children) => {
26990
28342
  // No scenario or invalid. Ignoring.
26991
28343
  }
26992
28344
  return (h("div", null,
26993
- result && h("pre", { innerHTML: result.value }),
28345
+ h("details", null,
28346
+ h("summary", null, "Specs"),
28347
+ result && h("pre", { innerHTML: result.value })),
26994
28348
  children));
26995
28349
  };
26996
28350
 
@@ -27027,7 +28381,8 @@ const stories = [
27027
28381
  ReferralTableRewardsCell$1,
27028
28382
  UserName,
27029
28383
  PasswordField,
27030
- TaskCard,
28384
+ TaskCard$1,
28385
+ TaskCardProgressBar,
27031
28386
  PortalTemplates,
27032
28387
  ProgramMenu$1,
27033
28388
  PoweredByImg,
@@ -27035,7 +28390,10 @@ const stories = [
27035
28390
  Hero,
27036
28391
  ReferralIframe$1,
27037
28392
  NameFields$1,
28393
+ RewardExchangeList,
27038
28394
  UseRewardExchangeList,
28395
+ UseTaskCard,
28396
+ UseRewardsTable
27039
28397
  ];
27040
28398
  const StencilStorybook = class {
27041
28399
  constructor(hostRef) {
@@ -27075,6 +28433,77 @@ const TableRow = class {
27075
28433
  }
27076
28434
  };
27077
28435
 
28436
+ const TaskCard$2 = class {
28437
+ constructor(hostRef) {
28438
+ registerInstance(this, hostRef);
28439
+ this.ignored = true;
28440
+ /**
28441
+ * @uiName Reward Amount
28442
+ */
28443
+ this.rewardAmount = 0;
28444
+ /**
28445
+ * @uiName Reward Unit
28446
+ */
28447
+ this.rewardUnit = "Points";
28448
+ /**
28449
+ * @uiName Title Text
28450
+ */
28451
+ this.cardTitle = "Title Text";
28452
+ /**
28453
+ * @uiName Description Text
28454
+ */
28455
+ this.description = "Description Text";
28456
+ /**
28457
+ * @uiName Goal Repeatable
28458
+ */
28459
+ this.repeatable = false;
28460
+ /**
28461
+ * @uiName Show Progress Bar
28462
+ */
28463
+ this.showProgressBar = false;
28464
+ /**
28465
+ * @uiName Goal Progress Source
28466
+ */
28467
+ this.progressSource = "";
28468
+ /**
28469
+ * @uiName Goal Completion Number
28470
+ */
28471
+ this.goal = 1;
28472
+ /**
28473
+ * @uiName Progress Bar Steps
28474
+ */
28475
+ this.steps = false;
28476
+ /**
28477
+ * @uiName Show Goal Expiry
28478
+ */
28479
+ this.showExpiry = false;
28480
+ /**
28481
+ * @uiName CTA Button Text
28482
+ */
28483
+ this.buttonText = "Complete Action";
28484
+ /**
28485
+ * @uiName CTA Button Link
28486
+ */
28487
+ this.buttonLink = "https://example.com/";
28488
+ /**
28489
+ * Select what type of stat to display for the goal. Manual paths are also supported.
28490
+ *
28491
+ * @uiWidget StatTypeSelectWidget
28492
+ * @uiName Stat Type
28493
+ * @uiOptions {"version": 1.1}
28494
+ */
28495
+ this.statType = "/programGoals/count/Referral-Started%2Freferrals";
28496
+ h$1(this);
28497
+ }
28498
+ disconnectedCallback() { }
28499
+ render() {
28500
+ const { props } = j$1() ? useDemoBigStat(this) : useBigStat(this);
28501
+ const { value, statvalue } = props;
28502
+ console.log(props, j$1());
28503
+ return (h(TaskCardView, Object.assign({}, getProps(this), { progress: value, loading: value === undefined })));
28504
+ }
28505
+ };
28506
+
27078
28507
  const debug$2 = browser("sq:global");
27079
28508
  const textStyles = `
27080
28509
  sqm-text {
@@ -27200,4 +28629,4 @@ function useUserNameDemo(props) {
27200
28629
  }, props.demoData || {}, { arrayMerge: (_, a) => a });
27201
28630
  }
27202
28631
 
27203
- export { DividedLayout as sqm_divided_layout, EditProfile as sqm_edit_profile, FormMessage as sqm_form_message, SqmHookStoryContainer as sqm_hook_story_container, NavigationMenu as sqm_navigation_menu, PortalPasswordField as sqm_password_field, PortalChangePassword as sqm_portal_change_password, PortalFrame as sqm_portal_frame, PortalLogin as sqm_portal_login, PortalRegister as sqm_portal_register, ProgramMenu as sqm_program_menu, SqmReferralIframe as sqm_referral_iframe, ReferralTable as sqm_referral_table, ReferralTableCell as sqm_referral_table_cell, ReferralTableDateCell as sqm_referral_table_date_cell, ReferralTableRewardsCell as sqm_referral_table_rewards_cell, ReferralTableStatusCell as sqm_referral_table_status_cell, ReferralTableUserCell as sqm_referral_table_user_cell, SqmRewardExchangeList as sqm_reward_exchange_list, SqmRouter as sqm_router, ShareButton as sqm_share_button, ShareLink as sqm_share_link, StencilStorybook as sqm_stencilbook, TableCell$1 as sqm_table_cell, TableRow as sqm_table_row, Text as sqm_text, UserName$1 as sqm_user_name };
28632
+ export { DividedLayout as sqm_divided_layout, EditProfile as sqm_edit_profile, FormMessage as sqm_form_message, SqmHookStoryContainer as sqm_hook_story_container, NavigationMenu as sqm_navigation_menu, PortalPasswordField as sqm_password_field, PortalChangePassword as sqm_portal_change_password, PortalFrame as sqm_portal_frame, PortalLogin as sqm_portal_login, PortalRegister as sqm_portal_register, ProgramMenu as sqm_program_menu, SqmReferralIframe as sqm_referral_iframe, ReferralTable as sqm_referral_table, ReferralTableCell as sqm_referral_table_cell, ReferralTableDateCell as sqm_referral_table_date_cell, ReferralTableRewardsCell as sqm_referral_table_rewards_cell, ReferralTableStatusCell as sqm_referral_table_status_cell, ReferralTableUserCell as sqm_referral_table_user_cell, SqmRewardExchangeList as sqm_reward_exchange_list, RewardsTable as sqm_rewards_table, RewardsTableColumn as sqm_rewards_table_column, SqmRouter as sqm_router, ShareButton as sqm_share_button, ShareLink as sqm_share_link, StencilStorybook as sqm_stencilbook, TableCell$1 as sqm_table_cell, TableRow as sqm_table_row, TaskCard$2 as sqm_task_card, Text as sqm_text, UserName$1 as sqm_user_name };