@saasquatch/mint-components 1.13.5-0 → 1.14.0-0

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 (147) hide show
  1. package/dist/cjs/{ShadowViewAddon-14a02da4.js → AutoColor-3b59126f.js} +1137 -1137
  2. package/dist/cjs/ErrorView-b2fcf954.js +35 -0
  3. package/dist/cjs/IndirectTaxDetailsView-409dae6f.js +646 -0
  4. package/dist/cjs/data-6d96b89c.js +137 -0
  5. package/dist/cjs/loader.cjs.js +1 -1
  6. package/dist/cjs/mint-components.cjs.js +1 -1
  7. package/dist/cjs/parseStates-d1effc19.js +16 -0
  8. package/dist/cjs/{sqm-banking-info-form_17.cjs.entry.js → sqm-banking-info-form_10.cjs.entry.js} +209 -1885
  9. package/dist/cjs/sqm-big-stat_41.cjs.entry.js +30 -30
  10. package/dist/cjs/sqm-code-verification.cjs.entry.js +349 -0
  11. package/dist/cjs/sqm-invoice-table-data-cell_5.cjs.entry.js +84 -0
  12. package/dist/cjs/sqm-stencilbook.cjs.entry.js +12390 -11094
  13. package/dist/cjs/sqm-tax-and-cash.cjs.entry.js +1221 -0
  14. package/dist/cjs/sqm-widget-verification-controller.cjs.entry.js +11 -3
  15. package/dist/cjs/sqm-widget-verification.cjs.entry.js +17 -6
  16. package/dist/cjs/utils-8257e7ab.js +105 -0
  17. package/dist/collection/components/sqm-stencilbook/sqm-stencilbook.js +78 -78
  18. package/dist/collection/components/sqm-widget-verification/sqm-code-verification/sqm-code-verification.js +37 -3
  19. package/dist/collection/components/sqm-widget-verification/sqm-widget-verification-controller.js +39 -5
  20. package/dist/collection/components/sqm-widget-verification/sqm-widget-verification.js +41 -6
  21. package/dist/collection/components/tax-and-cash/TaxForm.stories.js +12 -8
  22. package/dist/collection/components/tax-and-cash/sqm-banking-info-form/sqm-banking-info-form-view.js +1 -1
  23. package/dist/collection/components/tax-and-cash/sqm-banking-info-form/sqm-banking-info-form.js +2 -2
  24. package/dist/collection/components/tax-and-cash/sqm-banking-info-form/useBankingInfoForm.js +1 -1
  25. package/dist/collection/components/tax-and-cash/sqm-docusign-form/sqm-docusign-form-view.js +1 -1
  26. package/dist/collection/components/tax-and-cash/sqm-docusign-form/sqm-docusign-form.js +1 -1
  27. package/dist/collection/components/tax-and-cash/sqm-docusign-form/useDocusignForm.js +2 -2
  28. package/dist/collection/components/tax-and-cash/sqm-indirect-tax-form/sqm-indirect-tax-form-view.js +2 -2
  29. package/dist/collection/components/tax-and-cash/sqm-indirect-tax-form/sqm-indirect-tax-form.js +1 -1
  30. package/dist/collection/components/tax-and-cash/sqm-indirect-tax-form/useIndirectTaxForm.js +2 -2
  31. package/dist/collection/components/tax-and-cash/sqm-payout-details-card/sqm-payout-details-card.js +26 -1
  32. package/dist/collection/components/tax-and-cash/sqm-payout-details-card/usePayoutDetailsCard.js +2 -2
  33. package/dist/collection/components/tax-and-cash/sqm-tax-and-cash/sqm-tax-and-cash.js +75 -41
  34. package/dist/collection/components/tax-and-cash/sqm-tax-and-cash/useTaxAndCash.js +1 -1
  35. package/dist/collection/components/tax-and-cash/sqm-tax-and-cash-dashboard/sqm-tax-and-cash-dashboard.js +62 -3
  36. package/dist/collection/components/tax-and-cash/sqm-tax-and-cash-dashboard/useTaxAndCashDashboard.js +3 -3
  37. package/dist/collection/components/tax-and-cash/sqm-user-info-form/sqm-user-info-form-view.js +5 -4
  38. package/dist/collection/components/tax-and-cash/sqm-user-info-form/sqm-user-info-form.js +49 -11
  39. package/dist/collection/components/tax-and-cash/sqm-user-info-form/useUserInfoForm.js +3 -3
  40. package/dist/collection/utils/parseStates.js +12 -0
  41. package/dist/esm/{ShadowViewAddon-23a6afab.js → AutoColor-d8d7f31d.js} +1141 -1141
  42. package/dist/esm/ErrorView-48e2b969.js +33 -0
  43. package/dist/esm/IndirectTaxDetailsView-c321099a.js +639 -0
  44. package/dist/esm/data-a05c78ae.js +121 -0
  45. package/dist/esm/loader.js +1 -1
  46. package/dist/esm/mint-components.js +1 -1
  47. package/dist/esm/parseStates-ed75e224.js +14 -0
  48. package/dist/esm/{sqm-banking-info-form_17.entry.js → sqm-banking-info-form_10.entry.js} +133 -1802
  49. package/dist/esm/sqm-big-stat_41.entry.js +1 -1
  50. package/dist/esm/sqm-code-verification.entry.js +345 -0
  51. package/dist/esm/sqm-invoice-table-data-cell_5.entry.js +76 -0
  52. package/dist/esm/sqm-stencilbook.entry.js +10501 -9205
  53. package/dist/esm/sqm-tax-and-cash.entry.js +1217 -0
  54. package/dist/esm/sqm-widget-verification-controller.entry.js +12 -4
  55. package/dist/esm/sqm-widget-verification.entry.js +17 -6
  56. package/dist/esm/utils-7c96856c.js +97 -0
  57. package/dist/esm-es5/AutoColor-d8d7f31d.js +1 -0
  58. package/dist/esm-es5/ErrorView-48e2b969.js +1 -0
  59. package/dist/esm-es5/IndirectTaxDetailsView-c321099a.js +1 -0
  60. package/dist/esm-es5/data-a05c78ae.js +1 -0
  61. package/dist/esm-es5/loader.js +1 -1
  62. package/dist/esm-es5/mint-components.js +1 -1
  63. package/dist/esm-es5/parseStates-ed75e224.js +1 -0
  64. package/dist/esm-es5/sqm-banking-info-form_10.entry.js +1 -0
  65. package/dist/esm-es5/sqm-big-stat_41.entry.js +1 -1
  66. package/dist/esm-es5/sqm-code-verification.entry.js +1 -0
  67. package/dist/esm-es5/sqm-invoice-table-data-cell_5.entry.js +1 -0
  68. package/dist/esm-es5/sqm-stencilbook.entry.js +1 -1
  69. package/dist/esm-es5/sqm-tax-and-cash.entry.js +1 -0
  70. package/dist/esm-es5/sqm-widget-verification-controller.entry.js +1 -1
  71. package/dist/esm-es5/sqm-widget-verification.entry.js +1 -1
  72. package/dist/esm-es5/utils-7c96856c.js +1 -0
  73. package/dist/mint-components/mint-components.esm.js +1 -1
  74. package/dist/mint-components/p-0603a39f.js +1 -0
  75. package/dist/mint-components/p-0a37a288.system.entry.js +1 -0
  76. package/dist/mint-components/p-0b8f6a39.entry.js +11 -0
  77. package/dist/mint-components/p-115dfc03.system.js +1 -0
  78. package/dist/mint-components/p-13f3a647.js +1 -0
  79. package/dist/mint-components/p-1a7453c6.system.js +1 -0
  80. package/dist/mint-components/p-33d79be3.entry.js +93 -0
  81. package/dist/mint-components/p-37996351.system.js +1 -1
  82. package/dist/mint-components/p-3a62a7e2.system.js +1 -0
  83. package/dist/mint-components/p-4a46897f.system.js +1 -0
  84. package/dist/mint-components/p-4d11920f.entry.js +1 -0
  85. package/dist/mint-components/p-5510be1e.system.entry.js +1 -0
  86. package/dist/mint-components/p-6ef506ba.entry.js +16 -0
  87. package/dist/mint-components/{p-33ed6f1c.system.entry.js → p-70adcf4f.system.entry.js} +1 -1
  88. package/dist/mint-components/p-70d3d873.system.entry.js +1 -0
  89. package/dist/mint-components/p-7e0bf3de.system.entry.js +1 -0
  90. package/dist/mint-components/p-83acd617.js +1 -0
  91. package/dist/mint-components/p-84a78d09.entry.js +1 -0
  92. package/dist/mint-components/{p-01010af0.entry.js → p-84ed9923.entry.js} +5 -5
  93. package/dist/mint-components/p-889ec1df.system.entry.js +1 -0
  94. package/dist/mint-components/p-8a784f2a.system.entry.js +1 -0
  95. package/dist/mint-components/p-93e4a3c3.system.js +1 -0
  96. package/dist/mint-components/p-98a48fc4.system.entry.js +1 -0
  97. package/dist/mint-components/p-9acb5038.js +1 -0
  98. package/dist/mint-components/p-a38ca165.entry.js +9 -0
  99. package/dist/mint-components/p-c75a3b4a.js +103 -0
  100. package/dist/mint-components/p-d75c462c.entry.js +1 -0
  101. package/dist/mint-components/p-ea7f379d.js +394 -0
  102. package/dist/mint-components/p-f8175201.system.js +1 -0
  103. package/dist/types/components/sqm-widget-verification/sqm-code-verification/sqm-code-verification.d.ts +6 -0
  104. package/dist/types/components/sqm-widget-verification/sqm-widget-verification-controller.d.ts +5 -0
  105. package/dist/types/components/sqm-widget-verification/sqm-widget-verification.d.ts +5 -0
  106. package/dist/types/components/tax-and-cash/TaxForm.stories.d.ts +0 -1
  107. package/dist/types/components/tax-and-cash/sqm-docusign-form/sqm-docusign-form-view.d.ts +1 -1
  108. package/dist/types/components/tax-and-cash/sqm-docusign-form/useDocusignForm.d.ts +2 -2
  109. package/dist/types/components/tax-and-cash/sqm-payout-details-card/sqm-payout-details-card.d.ts +4 -0
  110. package/dist/types/components/tax-and-cash/sqm-payout-status-alert/usePayoutStatus.d.ts +1 -1
  111. package/dist/types/components/tax-and-cash/sqm-tax-and-cash/sqm-tax-and-cash.d.ts +11 -10
  112. package/dist/types/components/tax-and-cash/sqm-tax-and-cash/useTaxAndCash.d.ts +1 -1
  113. package/dist/types/components/tax-and-cash/sqm-tax-and-cash-dashboard/sqm-tax-and-cash-dashboard-view.d.ts +1 -1
  114. package/dist/types/components/tax-and-cash/sqm-tax-and-cash-dashboard/sqm-tax-and-cash-dashboard.d.ts +10 -0
  115. package/dist/types/components/tax-and-cash/sqm-user-info-form/small-views/IndirectTaxDetailsView.d.ts +1 -1
  116. package/dist/types/components/tax-and-cash/sqm-user-info-form/sqm-user-info-form.d.ts +7 -0
  117. package/dist/types/components/tax-and-cash/sqm-user-info-form/useUserInfoForm.d.ts +1 -1
  118. package/dist/types/components/tax-and-cash/utils.d.ts +1 -1
  119. package/dist/types/components.d.ts +96 -89
  120. package/dist/types/global/android.d.ts +7 -0
  121. package/dist/types/global/demo.d.ts +2 -0
  122. package/dist/types/stories/features.d.ts +4 -0
  123. package/dist/types/stories/templates.d.ts +4 -0
  124. package/dist/types/utils/parseStates.d.ts +1 -0
  125. package/docs/docs.docx +0 -0
  126. package/docs/raisins.json +1 -1
  127. package/grapesjs/grapesjs.js +1 -1
  128. package/package.json +2 -1
  129. package/dist/cjs/sqm-invoice-table-view-baded4af.js +0 -2067
  130. package/dist/esm/sqm-invoice-table-view-af69cd33.js +0 -2050
  131. package/dist/esm-es5/ShadowViewAddon-23a6afab.js +0 -1
  132. package/dist/esm-es5/sqm-banking-info-form_17.entry.js +0 -1
  133. package/dist/esm-es5/sqm-invoice-table-view-af69cd33.js +0 -1
  134. package/dist/mint-components/p-33c96e14.entry.js +0 -16
  135. package/dist/mint-components/p-38b5f028.system.entry.js +0 -1
  136. package/dist/mint-components/p-6427e963.entry.js +0 -1
  137. package/dist/mint-components/p-7e7cbccf.system.js +0 -1
  138. package/dist/mint-components/p-9320582e.system.js +0 -1
  139. package/dist/mint-components/p-962f3200.js +0 -1
  140. package/dist/mint-components/p-9cf80e85.system.entry.js +0 -1
  141. package/dist/mint-components/p-b93fd99c.system.entry.js +0 -1
  142. package/dist/mint-components/p-c36506f6.system.entry.js +0 -1
  143. package/dist/mint-components/p-d3d74266.js +0 -394
  144. package/dist/mint-components/p-f29eda2f.entry.js +0 -205
  145. package/dist/mint-components/p-f2cc6a6f.entry.js +0 -9
  146. /package/dist/collection/components/tax-and-cash/{sqm-tax-and-cash/data.js → data.js} +0 -0
  147. /package/dist/types/components/tax-and-cash/{sqm-tax-and-cash/data.d.ts → data.d.ts} +0 -0
@@ -1,11 +1,11 @@
1
1
  import { h, c as Host, d as getAssetPath, g as getElement } from './index-91e7729f.js';
2
- import { k as useState, b as browser, u as useMemo } from './stencil-hooks.module-4bc38af4.js';
2
+ import { b as browser, u as useMemo, k as useState } from './stencil-hooks.module-4bc38af4.js';
3
3
  import { i as intl } from './global-be1f9992.js';
4
- import { d as dist, H, J, F as Fn, w as wn, $ as $e, B, g as getEnvironmentSDK, L } from './index.module-89a79f66.js';
4
+ import { H, L, J, d as dist, w as wn, F as Fn, $ as $e, B, g as getEnvironmentSDK } from './index.module-89a79f66.js';
5
5
  import { c as cjs } from './cjs-bdfb4486.js';
6
6
  import { l as luxonLocale } from './utils-334c1e34.js';
7
7
  import { c as createStyleSheet, j as jss, a as create } from './JSS-67b5cff8.js';
8
- import { a as REFERRAL_CODES_NAMESPACE, S as SET_CODE_COPIED, C as CopyTextView } from './copy-text-view-459a2e35.js';
8
+ import { C as CopyTextView, a as REFERRAL_CODES_NAMESPACE, S as SET_CODE_COPIED } from './copy-text-view-459a2e35.js';
9
9
  import { H as HostBlock, A as AuthWrapper, a as AuthColumn, b as AuthButtonsContainer, E as ErrorStyles } from './mixins-83f90fa1.js';
10
10
  import { u as useChildElements } from './useChildElements-7945ae56.js';
11
11
  import { l as luxon } from './luxon-8d51c92b.js';
@@ -14,6 +14,41 @@ import { p as pathToRegexp } from './index-ffa26b43.js';
14
14
  import { a as isValidColor, b as isMobile } from './utilities-5b0ca040.js';
15
15
  import { a as PortalSectionView, P as PortalContainerView } from './sqm-portal-container-view-1683ae32.js';
16
16
 
17
+ function BigStatView(props) {
18
+ const { statvalue, flexReverse, alignment } = props;
19
+ // Dependent on props, not feasiable to move out
20
+ const style = {
21
+ Container: {
22
+ display: "flex",
23
+ height: "inherit",
24
+ "justify-content": "space-between",
25
+ "flex-direction": `${flexReverse ? "column-reverse" : "column"}`,
26
+ "align-items": `${alignment === "left"
27
+ ? "flex-start"
28
+ : alignment === "right"
29
+ ? "flex-end"
30
+ : "center"}`,
31
+ },
32
+ Stat: {
33
+ "font-size": "var(--sl-font-size-x-large)",
34
+ "text-align": alignment,
35
+ },
36
+ Description: {
37
+ "font-size": "var(--sl-font-size-small)",
38
+ "font-weight": "var(--sl-font-weight-normal)",
39
+ color: "var(--sl-color-gray-600)",
40
+ "text-transform": "uppercase",
41
+ "text-align": alignment,
42
+ },
43
+ };
44
+ const sheet = createStyleSheet(style);
45
+ const styleString = sheet.toString();
46
+ return (h("div", { part: "stat-wrapper", class: sheet.classes.Container },
47
+ h("style", { type: "text/css" }, styleString),
48
+ h("div", { part: "stat-value", class: sheet.classes.Stat }, statvalue),
49
+ h("div", { part: "stat-description", class: sheet.classes.Description }, props.labelSlot)));
50
+ }
51
+
17
52
  const medium = {
18
53
  facebook: { color: "#1877f2", text: "#fff", icon: "facebook" },
19
54
  twitter: { color: "#000000", text: "#fff", icon: "twitter-x" },
@@ -89,428 +124,159 @@ function ShareButtonView(props, children) {
89
124
  !props.hidetext && children)));
90
125
  }
91
126
 
92
- const style$1 = {
93
- Leaderboard: {
94
- "& table": {
127
+ function StatContainerView(props, children) {
128
+ const divideSpace = () => {
129
+ const spaceValue = getComputedStyle(document.documentElement).getPropertyValue(`--sl-spacing-${props.space}`);
130
+ return `${Math.floor(parseInt(spaceValue) / 2)}rem`;
131
+ };
132
+ // Dependent on props, not feasiable to move out
133
+ const style = {
134
+ StatContainer: {
95
135
  width: "100%",
96
- borderCollapse: "collapse",
97
- },
98
- "& th": {
99
- textAlign: "left",
100
- padding: "var(--sl-spacing-medium)",
101
- paddingTop: "0",
102
- fontSize: "var(--sl-font-size-medium)",
103
- fontWeight: "var(--sl-font-weight-semibold)",
136
+ display: props.display || "grid",
137
+ "grid-template-columns": "repeat(auto-fill, minmax(130px, auto))",
138
+ gap: divideSpace(),
139
+ // First set of styles applies when shadow DOM is disabled, second set applies when shadow DOM is enabled
140
+ "& > *": {
141
+ "border-right": "1px solid #EAEAEA",
142
+ "padding-right": divideSpace(),
143
+ },
144
+ "& > :last-child": {
145
+ "border-right": "none",
146
+ },
147
+ "& > ::slotted(*)": {
148
+ "border-right": "1px solid #EAEAEA",
149
+ "padding-right": divideSpace(),
150
+ height: "100%",
151
+ },
152
+ "& > ::slotted(*:last-child)": {
153
+ "border-right": "none",
154
+ },
155
+ "@media screen and (max-width: 430px)": {
156
+ "& > ::slotted(*)": {
157
+ borderRight: "none",
158
+ },
159
+ },
104
160
  },
105
- "& tr:not(:first-child)": {
106
- borderTop: "1px solid var(--sl-color-neutral-200)",
161
+ StatFrame: {
162
+ display: "flex",
107
163
  },
108
- "& td": {
109
- fontSize: "var(--sl-font-size-medium)",
110
- fontWeight: "var(--sl-font-weight-normal)",
164
+ BorderFix: {
165
+ "border-right": "1px solid transparent",
166
+ width: "0px",
167
+ "margin-left": "-1px",
111
168
  },
112
- "& .ellipses": {
113
- textAlign: "left",
169
+ };
170
+ const sheet = createStyleSheet(style);
171
+ const styleString = sheet.toString();
172
+ return (h("div", { class: sheet.classes.StatFrame, part: "sqm-base" },
173
+ h("div", { class: sheet.classes.StatContainer, part: "sqm-inner-container" },
174
+ h("style", { type: "text/css" }, styleString),
175
+ children),
176
+ h("div", { class: sheet.classes.BorderFix, part: "sqm-border" })));
177
+ }
178
+
179
+ function PortalChangePasswordView(props) {
180
+ const { states, callbacks } = props;
181
+ const style = {
182
+ Dialog: {
114
183
  padding: "0",
115
- color: "var(--sl-color-neutral-500)",
116
- paddingLeft: "25%",
117
- },
118
- "& .highlight": {
119
- background: "var(--sl-color-primary-50)",
120
- },
121
- "& td, th": {
122
- color: "var(--sl-color-gray-800)",
123
- padding: "var(--sl-spacing-medium)",
124
- },
125
- "& .User": {
126
- width: "100%",
184
+ "&::part(close-button)": {
185
+ "margin-top": "var(--sl-spacing-medium)",
186
+ },
187
+ "&::part(body)": {
188
+ padding: "0 var(--sl-spacing-x-large) var(--sl-spacing-x-large) var(--sl-spacing-x-large)",
189
+ },
127
190
  },
128
- "& .Score": {
129
- width: "auto",
130
- whiteSpace: "nowrap",
191
+ Error: {
192
+ "&::part(erroralert-base)": {
193
+ "margin-bottom": "15px",
194
+ },
131
195
  },
132
- "& .Rank": {
133
- whiteSpace: "nowrap",
196
+ Success: {
197
+ "&::part(successalert-base)": {
198
+ "margin-bottom": "15px",
199
+ },
134
200
  },
135
- "& .fullWidth": {
136
- width: "100%",
201
+ InputContainer: {
202
+ "& > :not(:last-child)": {
203
+ "margin-bottom": "var(--sl-spacing-x-large)",
204
+ },
137
205
  },
138
- },
139
- };
140
- const sheet$1 = createStyleSheet(style$1);
141
- const styleString$1 = sheet$1.toString();
142
- const vanillaStyle = `
143
- :host{
144
- display: block;
145
- }
146
- `;
147
- function LeaderboardView(props) {
148
- var _a, _b, _c;
149
- const { states, data, elements } = props;
150
- const { styles } = states;
151
- if (states.isEssentials) {
152
- return (h("sqm-empty", { "empty-state-image": "https://res.cloudinary.com/saasquatch/image/upload/v1715360191/squatch-assets/Leaderboard_Not_Available.svg", "empty-state-header": "Leaderboards aren\u2019t available on your plan", "empty-state-text": "Contact {supportText} to upgrade your plan and start leveraging gamification in your program.", "support-text": "Support" }));
153
- }
154
- if (states.loading) {
155
- return (h("div", { class: sheet$1.classes.Leaderboard, style: { width: styles.width || "100%" } },
156
- h("style", { type: "text/css" },
157
- styleString$1,
158
- vanillaStyle),
159
- h("table", null, [...Array(10)].map(() => {
160
- return (h("tr", null,
161
- h("td", null,
162
- h("sl-skeleton", null))));
163
- }))));
164
- }
165
- if (!states.hasLeaders)
166
- return elements.empty;
167
- let userSeenFlag = false;
168
- const getUsersName = (user) => {
169
- if (!user.firstName && !user.lastInitial)
170
- return styles.anonymousUser;
171
- const { firstName, lastInitial } = user;
172
- if (firstName && lastInitial)
173
- return `${firstName} ${lastInitial}`;
174
- if (firstName || lastInitial)
175
- return firstName || lastInitial;
176
- return styles.anonymousUser;
177
- };
178
- const getRankCellText = (userRank, isViewingUsersRow) => {
179
- if (!userRank) {
180
- return styles.hideNames ? `${styles.viewingUserText}` : "-";
181
- }
182
- const viewingUserText = ` - ${styles.viewingUserText}`;
183
- return styles.rankSuffix
184
- ? intl.formatMessage({
185
- id: "rank",
186
- defaultMessage: styles.rankSuffix,
187
- }, {
188
- rank: userRank,
189
- }) + `${isViewingUsersRow && styles.hideNames ? viewingUserText : ""}`
190
- : `${userRank} ${isViewingUsersRow && styles.hideNames ? viewingUserText : ""}`;
191
- };
192
- return (h("div", { class: sheet$1.classes.Leaderboard, part: "sqm-base", style: { width: styles.width || "100%" } },
193
- h("style", { type: "text/css" },
194
- styleString$1,
195
- vanillaStyle),
196
- h("table", { part: "sqm-table" },
197
- h("tr", null,
198
- styles.showRank && (h("th", { class: `Rank ${styles.hideNames ? "fullWidth" : ""}` }, styles.rankheading)),
199
- !styles.hideNames && h("th", { class: "User" }, styles.usersheading),
200
- h("th", { class: "Score" }, styles.statsheading)), (_a = data.leaderboard) === null || _a === void 0 ? void 0 :
201
- _a.map((user) => {
202
- var _a, _b;
203
- if (user.rowNumber === ((_a = data.viewerRank) === null || _a === void 0 ? void 0 : _a.rowNumber))
204
- userSeenFlag = true;
205
- const isViewingUsersRow = !styles.hideViewer && user.rowNumber === ((_b = data.viewerRank) === null || _b === void 0 ? void 0 : _b.rowNumber);
206
- return (h("tr", { class: isViewingUsersRow ? "highlight" : "" },
207
- styles.showRank && (h("td", { class: "Rank" }, getRankCellText(user.rank, isViewingUsersRow))),
208
- !styles.hideNames && h("td", { class: "User" }, getUsersName(user)),
209
- h("td", { class: "Score" }, user.textValue)));
210
- }),
211
- !userSeenFlag && !styles.hideViewer && (h("tr", null,
212
- h("td", { colSpan: 100, class: "ellipses" },
213
- h("sl-icon", { name: "three-dots", style: { verticalAlign: "middle" } })))),
214
- !userSeenFlag && !styles.hideViewer && (h("tr", { class: "highlight" },
215
- styles.showRank && (h("td", { class: "Rank" }, getRankCellText((_b = data.viewerRank) === null || _b === void 0 ? void 0 : _b.rank, true))),
216
- !styles.hideNames && (h("td", { class: "User" }, getUsersName(data.viewerRank || {}))),
217
- h("td", { class: "Score" }, ((_c = data.viewerRank) === null || _c === void 0 ? void 0 : _c.textValue) || "0"))))));
218
- }
219
-
220
- function BigStatView(props) {
221
- const { statvalue, flexReverse, alignment } = props;
222
- // Dependent on props, not feasiable to move out
223
- const style = {
224
- Container: {
225
- display: "flex",
226
- height: "inherit",
227
- "justify-content": "space-between",
228
- "flex-direction": `${flexReverse ? "column-reverse" : "column"}`,
229
- "align-items": `${alignment === "left"
230
- ? "flex-start"
231
- : alignment === "right"
232
- ? "flex-end"
233
- : "center"}`,
206
+ CancelButton: {
207
+ width: "25%",
208
+ margin: "var(--sl-spacing-large) auto",
234
209
  },
235
- Stat: {
236
- "font-size": "var(--sl-font-size-x-large)",
237
- "text-align": alignment,
210
+ PasswordField: {
211
+ marginBottom: "var(--sl-spacing-large) !important",
212
+ display: "block",
238
213
  },
239
- Description: {
240
- "font-size": "var(--sl-font-size-small)",
241
- "font-weight": "var(--sl-font-weight-normal)",
242
- color: "var(--sl-color-gray-600)",
243
- "text-transform": "uppercase",
244
- "text-align": alignment,
214
+ ChangePasswordButton: {
215
+ paddingTop: "var(--sl-spacing-x-large)",
245
216
  },
246
217
  };
247
218
  const sheet = createStyleSheet(style);
248
219
  const styleString = sheet.toString();
249
- return (h("div", { part: "stat-wrapper", class: sheet.classes.Container },
220
+ return (h("div", null,
250
221
  h("style", { type: "text/css" }, styleString),
251
- h("div", { part: "stat-value", class: sheet.classes.Stat }, statvalue),
252
- h("div", { part: "stat-description", class: sheet.classes.Description }, props.labelSlot)));
253
- }
254
-
255
- const style$2 = {
256
- HostBlock: HostBlock,
257
- Frame: {
258
- display: "flex",
259
- "flex-direction": "column",
260
- "box-sizing": "border-box",
261
- },
262
- FooterWrapper: {
263
- width: "100%",
264
- "max-width": "100%",
265
- padding: "var(--sl-spacing-medium) var(--sl-spacing-x-large)",
266
- background: "var(--sqm-footer-background)",
267
- display: "flex",
268
- "justify-content": "flex-end",
269
- "align-items": "center",
270
- "box-sizing": "border-box",
271
- "margin-top": "auto",
272
- },
273
- HeaderWrapper: {
274
- width: "100%",
275
- "max-width": "100%",
276
- "box-sizing": "border-box",
277
- display: "flex",
278
- "justify-content": "space-between",
279
- padding: "var(--sl-spacing-small) var(--sl-spacing-large)",
280
- "align-items": "center",
281
- "background-color": "var(--sqm-header-background)",
282
- "@media screen and (max-width: 499px)": {
283
- "flex-direction": "row-reverse",
284
- "justify-content": "flex-end",
285
- padding: "0",
286
- },
287
- },
288
- };
289
- const sheet$2 = createStyleSheet(style$2);
290
- const styleString$2 = sheet$2.toString();
291
- function PortalFrameView(props, children) {
292
- const { data, notFullScreen } = props;
293
- return (h("div", { style: { minHeight: notFullScreen ? "100%" : "100vh" }, class: sheet$2.classes.Frame, part: "sqm-base" },
294
- h("style", { type: "text/css" }, styleString$2),
295
- h("div", { class: sheet$2.classes.HeaderWrapper, part: "sqm-header" },
296
- data.header,
297
- h("slot", { name: "sqm-navigation-menu" })),
298
- children,
299
- h("div", { class: sheet$2.classes.FooterWrapper, part: "sqm-footer" }, data.footer)));
300
- }
301
-
302
- const EditProfileView = (props) => {
303
- var _a, _b, _c, _d;
304
- const { states, callbacks } = props;
305
- const { text } = states;
306
- const { errors } = states.formState;
307
- if (states.showEdit) {
308
- return (h("div", { class: `CardWrapper ${!states.showEdit && "ShowEdit"}`, part: "sqm-base" },
309
- h("h2", { part: "sqm-header", style: {
310
- fontSize: "var(--sl-font-size-x-large)",
311
- margin: "0px",
312
- textAlign: "center",
313
- } }, text.editprofileheader),
314
- h("form", { class: "FormWrapper", onSubmit: callbacks.onSubmit },
315
- h("div", { class: "FormSection" },
316
- states.formState.error && (h("sqm-form-message", { type: "error", exportparts: "erroralert-icon" },
317
- h("div", { part: "erroralert-text" }, states.formState.error))),
318
- h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", value: states.formState.firstName, onInput: callbacks.onChange, label: text.firstnametext, disabled: states.loading }, (errors.firstName && errors.firstName.status !== "valid"
319
- ? { class: "ErrorStyles", helpText: text.fieldEmptyText }
320
- : []), { id: "firstName", name: "firstName", error: errors.firstName && errors.firstName.status !== "valid"
321
- ? errors.firstName.message
322
- : undefined })),
323
- h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", value: states.formState.lastName, onInput: callbacks.onChange, label: text.lastnametext, disabled: states.loading, id: "lastName", name: "lastName" }, (errors.lastName && errors.lastName.status !== "valid"
324
- ? { class: "ErrorStyles", helpText: text.fieldEmptyText }
325
- : []), { error: errors.lastName && errors.lastName.status !== "valid"
326
- ? errors.lastName.message
327
- : undefined }))),
328
- text.showregion && states.formState.currentRegion && (h("sl-input", { exportparts: "label: input-label, base: input-base", disabled: true, value: states.formState.currentRegion, label: text.currentregiontext, id: "currentRegion", name: "currentRegion" })),
329
- h("div", { class: "ButtonWrapper" },
330
- h("sl-button", { type: "primary", loading: states.loading, disabled: states.submitDisabled, onClick: (e) => {
331
- callbacks.onSubmit(e);
332
- }, submit: true, exportparts: "base: primarybutton-base" }, text.updatetext),
333
- h("sl-button", { onClick: () => {
334
- callbacks.setShowEdit(false);
335
- }, exportparts: "base: defaultbutton-base" }, text.canceltext)))));
336
- }
337
- return (h("div", { class: `CardWrapper FormWrapper ${!states.showEdit && "ShowEdit"}`, part: "sqm-base" },
338
- h("div", { class: "FormSection" },
339
- h("h2", { part: "sqm-header", style: {
340
- fontSize: "var(--sl-font-size-x-large)",
341
- marginBottom: "0px",
342
- textAlign: "center",
343
- } }, text.editprofileheader),
344
- h("div", null,
345
- h("p", { style: { fontSize: "var(--sl-font-size-medium)" } }, (_a = states.user) === null || _a === void 0 ? void 0 :
346
- _a.firstName,
347
- " ", (_b = states.user) === null || _b === void 0 ? void 0 :
348
- _b.lastName),
349
- h("p", { style: { fontSize: "var(--sl-font-size-medium)" }, title: (_c = states.user) === null || _c === void 0 ? void 0 : _c.email }, (_d = states.user) === null || _d === void 0 ? void 0 : _d.email))),
350
- h("sl-button", { type: "primary", loading: states.loading, onClick: () => {
351
- callbacks.resetForm();
352
- callbacks.setShowEdit(true);
353
- }, exportparts: "base: primarybutton-base" }, text.editprofiletext)));
354
- };
355
-
356
- const MessageLinkQuery = dist.gql `
357
- query ($programId: ID, $engagementMedium: UserEngagementMedium!) {
358
- user: viewer {
359
- ... on User {
360
- shareLink(
361
- programId: $programId
362
- engagementMedium: $engagementMedium
363
- shareMedium: DIRECT
364
- )
365
- }
366
- }
367
- }
368
- `;
369
- const WIDGET_ENGAGEMENT_EVENT = dist.gql `
370
- mutation loadEvent($eventMeta: UserAnalyticsEvent!) {
371
- createUserAnalyticsEvent(eventMeta: $eventMeta)
372
- }
373
- `;
374
- function useShareLink(props) {
375
- var _a, _b;
376
- const { programId = H() } = props;
377
- const user = J();
378
- const engagementMedium = B();
379
- const contextData = Fn(REFERRAL_CODES_NAMESPACE);
380
- const { data } = wn(MessageLinkQuery, { programId, engagementMedium }, !(user === null || user === void 0 ? void 0 : user.jwt) || !!props.linkOverride || (contextData === null || contextData === void 0 ? void 0 : contextData.shareLink) !== undefined);
381
- const [sendLoadEvent] = $e(WIDGET_ENGAGEMENT_EVENT);
382
- const [setCopied, copiedRes] = $e(SET_CODE_COPIED);
383
- const copyString = (_b = ((contextData === null || contextData === void 0 ? void 0 : contextData.shareLink) || ((_a = data === null || data === void 0 ? void 0 : data.user) === null || _a === void 0 ? void 0 : _a.shareLink))) !== null && _b !== void 0 ? _b :
384
- // Shown during loading
385
- "...";
386
- const [open, setOpen] = useState(false);
387
- async function onClick() {
388
- if (contextData) {
389
- await setCopied({ referralCode: contextData.referralCode });
390
- contextData.refresh();
391
- }
392
- // Should well supported: https://developer.mozilla.org/en-US/docs/Web/API/Clipboard#browser_compatibility
393
- // Only if called from a user-initiated event
394
- navigator.clipboard.writeText(copyString);
395
- setOpen(true);
396
- setTimeout(() => setOpen(false), props.tooltiplifespan);
397
- sendLoadEvent({
398
- eventMeta: {
399
- programId,
400
- id: user === null || user === void 0 ? void 0 : user.id,
401
- accountId: user === null || user === void 0 ? void 0 : user.accountId,
402
- type: "USER_REFERRAL_PROGRAM_ENGAGEMENT_EVENT",
403
- meta: {
404
- engagementMedium,
405
- shareMedium: "DIRECT",
406
- },
407
- },
408
- });
409
- }
410
- return { ...props, onClick, open, copyString: copyString };
222
+ h("sl-dialog", { class: sheet.classes.Dialog, open: states.open, "onSl-hide": () => callbacks.setOpen(false) },
223
+ h(PortalSectionView, Object.assign({}, {
224
+ labelMargin: "x-large",
225
+ padding: "none",
226
+ label: (h(TextSpanView, Object.assign({}, { type: "h2" }), states.content.modalChangePasswordHeader)),
227
+ content: (h(PortalContainerView, Object.assign({}, { direction: "column", padding: "none", gap: "32px" }),
228
+ states.error && (h("sqm-form-message", { class: sheet.classes.Error, type: "error", exportparts: "erroralert-icon" },
229
+ h("div", { part: "erroralert-text" }, states.error))),
230
+ states.success && (h("sqm-form-message", { class: sheet.classes.Success, type: "success", exportparts: "successalert-icon" },
231
+ h("div", { part: "successalert-text" }, states.content.successMessage))),
232
+ h("sl-form", { "onSl-submit": callbacks.submit },
233
+ h("div", { class: sheet.classes.InputContainer },
234
+ h("sqm-password-field", { exportparts: "input-label: input-label", class: sheet.classes.PasswordField, fieldLabel: states.content.passwordFieldLabel, meetsRequirementsText: states.content.meetsRequirementsText, doesNotMeetRequirementsText: states.content.doesNotMeetRequirementsText, minErrorText: states.content.minErrorText, uppercaseErrorText: states.content.uppercaseErrorText, lowercaseErrorText: states.content.lowercaseErrorText, hasErrorText: states.content.hasErrorText }),
235
+ h("sl-input", { exportparts: "label: input-label, base: input-base", name: "/confirmPassword", label: states.content.confirmPasswordFieldLabel, required: true, togglePassword: true, disabled: states.loading, type: "password" })),
236
+ h(PortalContainerView, Object.assign({}, { direction: "row", padding: "none", gap: "20px" }),
237
+ h("sl-button", { class: sheet.classes.ChangePasswordButton, type: "primary", submit: true, loading: states.loading }, states.content.changePasswordButtonText),
238
+ h("sl-button", { class: sheet.classes.CancelButton, type: "text", onClick: () => callbacks.setOpen(false) }, states.content.cancelText))))),
239
+ }))),
240
+ h(PortalSectionView, Object.assign({}, {
241
+ labelMargin: "x-large",
242
+ padding: "xxx-large",
243
+ label: (h(TextSpanView, Object.assign({}, { type: "h2" }), states.content.portalChangePasswordHeader)),
244
+ content: (h("sl-button", { onClick: () => callbacks.setOpen(true) }, states.content.portalChangePasswordButtonText)),
245
+ }),
246
+ h("style", { type: "text/css" }, styleString))));
411
247
  }
412
248
 
413
- const MessageLinkQuery$1 = dist.gql `
414
- query (
415
- $programId: ID
416
- $engagementMedium: UserEngagementMedium!
417
- $shareMedium: ReferralShareMedium!
418
- ) {
419
- viewer {
420
- ... on User {
421
- messageLink(
422
- programId: $programId
423
- engagementMedium: $engagementMedium
424
- shareMedium: $shareMedium
425
- )
426
- shareLink(programId: $programId, engagementMedium: $engagementMedium)
427
- }
428
- }
429
- }
430
- `;
431
- function NativeShare(props, directLink, undefinedErrorText, unsupportedPlatformText) {
432
- const title = props.sharetitle || "Share title";
433
- const text = props.sharetext || "Share text";
434
- if (directLink === "undefined") {
435
- return alert(undefinedErrorText);
436
- }
437
- if (window.navigator.share) {
438
- window.navigator
439
- .share({
440
- title,
441
- text,
442
- url: directLink,
443
- })
444
- .catch((error) => console.error("Error on web share", error));
445
- }
446
- else {
447
- alert(unsupportedPlatformText);
448
- }
449
- }
450
- function FacebookShare(directLink, messageLink, errorText) {
451
- if (messageLink === "undefined" || directLink === "undefined") {
452
- return alert(errorText);
453
- }
454
- if (typeof SquatchAndroid.shareOnFacebook !== "undefined") {
455
- return SquatchAndroid.shareOnFacebook(directLink, messageLink);
456
- }
457
- else {
458
- return GenericShare(messageLink, errorText);
459
- }
460
- }
461
- function GenericShare(messageLink, errorText) {
462
- return messageLink ? (window.location.href = messageLink) : alert(errorText);
463
- }
464
- function useShareButton(props) {
465
- var _a, _b, _c, _d;
466
- const { sharetitle, sharetext, medium } = props;
467
- const programId = props.programId ? props.programId : H();
468
- const user = J();
469
- const engagementMedium = B();
470
- const variables = {
471
- engagementMedium,
472
- programId: programId,
473
- shareMedium: medium.toUpperCase(),
474
- };
475
- const contextData = Fn(REFERRAL_CODES_NAMESPACE);
476
- const overrideData = contextData === null || contextData === void 0 ? void 0 : contextData[medium];
477
- // only queries if a programId is available
478
- const res = wn(MessageLinkQuery$1, variables, !(user === null || user === void 0 ? void 0 : user.jwt) || !programId || overrideData !== undefined);
479
- const [setCopied, copiedRes] = $e(SET_CODE_COPIED);
480
- const directLink = (overrideData === null || overrideData === void 0 ? void 0 : overrideData.shareLink) || ((_b = (_a = res === null || res === void 0 ? void 0 : res.data) === null || _a === void 0 ? void 0 : _a.viewer) === null || _b === void 0 ? void 0 : _b.shareLink);
481
- const environment = getEnvironmentSDK();
482
- const hide = (medium.toLocaleUpperCase() === "SMS" &&
483
- window.orientation === undefined) ||
484
- (medium.toLocaleUpperCase() === "DIRECT" && !window.navigator.share);
485
- const messageLink = (overrideData === null || overrideData === void 0 ? void 0 : overrideData.messageLink) || ((_d = (_c = res.data) === null || _c === void 0 ? void 0 : _c.viewer) === null || _d === void 0 ? void 0 : _d.messageLink);
486
- async function onClick() {
487
- if (overrideData) {
488
- await setCopied({ referralCode: contextData.referralCode });
489
- contextData.refresh();
490
- }
491
- if (medium.toLocaleUpperCase() === "FACEBOOK" &&
492
- environment.type === "SquatchAndroid") {
493
- FacebookShare(directLink, messageLink, props.errorText);
494
- }
495
- else if (medium.toLocaleUpperCase() === "DIRECT") {
496
- NativeShare({ sharetitle, sharetext }, directLink, props.errorText, props.unsupportedPlatformText);
497
- }
498
- }
499
- const isPlainLink = !(medium.toLocaleUpperCase() === "FACEBOOK" &&
500
- environment.type === "SquatchAndroid") &&
501
- medium.toLocaleUpperCase() !== "DIRECT" &&
502
- messageLink;
503
- const userAgent = window.navigator.userAgent.toLowerCase(), safari = /safari/.test(userAgent), ios = /iphone|ipod|ipad/.test(userAgent);
504
- const openInSameTab = ios && !safari;
505
- return {
506
- ...props,
507
- loading: res.loading && !(overrideData === null || overrideData === void 0 ? void 0 : overrideData.messageLink),
508
- messageLink,
509
- isPlainLink,
510
- onClick,
511
- openInSameTab,
512
- hide,
513
- };
249
+ function PoweredByImg({ color = "#A6A6A6", width = 120, height = 16, }) {
250
+ return (h("svg", { width: width, height: height, viewBox: "0 0 1662 254", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
251
+ h("path", { d: "M801.082 253.58L869.382 1.67969", stroke: color, "stroke-width": "3" }),
252
+ h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M125.682 42.48C123.882 42.48 121.982 42.78 120.382 43.48C118.682 44.18 117.182 45.18 115.882 46.48C114.582 47.68 113.582 49.28 112.882 50.98C112.182 52.68 111.882 54.48 111.982 56.28C112.282 59.68 113.882 63.08 116.382 65.38C118.982 67.78 122.382 68.98 125.782 68.98C129.282 68.98 132.682 67.58 135.182 65.38C137.782 62.98 139.382 59.78 139.582 56.28C139.582 54.38 139.282 52.68 138.682 50.98C137.982 49.28 136.982 47.78 135.682 46.48C134.382 45.18 132.882 44.18 131.182 43.48C129.282 42.78 127.582 42.48 125.682 42.48Z", fill: color }),
253
+ h("path", { d: "M135.882 89.2798H115.582V187.58H135.882V89.2798Z", fill: color }),
254
+ h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M231.481 104.18C238.781 93.4799 251.181 87.3799 266.281 87.3799C290.981 87.3799 307.581 103.28 307.381 127.08V187.48H286.781V132.38C286.781 116.38 278.281 107.18 263.381 107.18C248.481 107.18 237.981 117.68 237.981 132.68V187.48H217.281V132.38C217.281 116.38 208.781 107.18 193.881 107.18C178.981 107.18 168.481 117.68 168.481 132.68V187.48H147.981V89.3799H168.681V97.8799C178.081 88.8799 190.181 87.4799 197.081 87.4799C211.881 87.4799 224.381 93.5799 231.481 104.18Z", fill: color }),
255
+ h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M370.781 87.48C358.581 87.48 347.981 91.38 339.981 98.38V89.28H319.481V226.08H339.981V177.78C347.881 185.08 358.581 188.78 370.781 188.78C398.781 188.78 419.881 166.88 419.881 138.08C419.981 109.28 398.781 87.48 370.781 87.48ZM368.881 169.58C351.481 169.58 338.881 156.38 338.881 138.28C338.881 120.38 351.381 106.98 368.881 106.98C386.281 106.98 398.881 120.08 398.881 138.28C398.881 156.48 386.381 169.58 368.881 169.58Z", fill: color }),
256
+ h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M701.782 169.88C707.682 169.88 714.082 167.58 719.582 163.98L721.482 162.88L731.482 178.68L729.782 179.88C721.282 186.28 710.982 189.58 700.382 189.58C678.082 189.58 665.782 176.38 665.782 152.28V108.68H645.682V89.3799H665.782V59.8799H686.482V89.2798H725.682V108.48H686.482V151.88C686.482 163.38 691.982 169.88 701.782 169.88Z", fill: color }),
257
+ h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M551.282 239.88C549.982 239.88 548.782 240.28 547.682 240.88C546.682 241.58 545.782 242.58 545.382 243.68C544.882 244.78 544.782 246.08 545.082 247.28C545.282 248.58 545.882 249.68 546.882 250.48C547.782 251.38 548.882 251.98 550.082 252.28C551.382 252.48 552.582 252.38 553.782 251.98C554.882 251.48 555.982 250.78 556.582 249.68C557.282 248.68 557.582 247.38 557.582 246.18C557.582 244.48 556.982 242.88 555.682 241.68C554.482 240.48 552.882 239.88 551.282 239.88Z", fill: color }),
258
+ h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M586.182 210.78C592.282 210.78 597.582 213.08 601.082 217.18L601.482 217.68L596.282 223.08L595.782 222.58C594.482 221.18 593.082 220.18 591.382 219.48C589.682 218.78 587.882 218.38 586.082 218.48C578.882 218.48 573.682 224.08 573.682 231.58C573.682 239.18 578.882 244.78 586.082 244.78C589.782 244.68 593.282 243.18 595.882 240.58L596.382 240.08L601.382 245.68L600.982 246.08C597.182 250.18 591.982 252.18 586.082 252.18C574.082 252.18 565.382 243.58 565.382 231.58C565.582 219.48 574.182 210.78 586.182 210.78Z", fill: color }),
259
+ h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M633.782 210.78C621.682 210.78 612.582 219.68 612.582 231.38C612.582 243.08 621.682 251.98 633.782 251.98C645.882 251.98 654.882 243.08 654.882 231.38C655.082 219.78 645.982 210.78 633.782 210.78ZM633.782 244.78C626.382 244.78 620.782 239.28 620.782 231.58C620.782 223.88 626.182 218.48 633.782 218.48C641.182 218.48 646.782 224.08 646.782 231.58C646.782 238.98 641.382 244.78 633.782 244.78Z", fill: color }),
260
+ h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M723.982 228.78C723.982 222.18 720.382 218.28 714.082 218.28C707.682 218.28 703.382 222.78 702.982 228.98V252.18H695.082V228.68C695.082 222.08 691.482 218.18 685.182 218.18C680.082 218.18 674.482 221.48 674.482 228.88V252.08H666.582V211.38H674.482V214.78L676.682 213.28C679.582 211.38 683.082 210.48 686.582 210.48C692.082 210.48 696.782 212.48 699.882 216.08L700.882 217.28L701.882 216.08C704.782 212.48 709.582 210.48 715.182 210.48C725.082 210.48 731.982 217.08 731.982 226.38V251.88H724.082V228.68H723.982V228.78Z", fill: color }),
261
+ h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M511.681 89.4797V98.7797C503.681 91.4797 493.181 87.6797 480.981 87.6797C452.981 87.6797 431.981 109.68 431.981 138.68C431.981 167.78 453.081 189.68 480.981 189.68C493.181 189.68 503.681 185.78 511.681 178.38V187.68H532.381V89.4797H511.681ZM482.881 169.88C465.481 169.88 452.781 156.58 452.781 138.48C452.781 120.48 465.281 106.98 482.881 106.98C500.481 106.98 512.781 120.08 512.781 138.48C512.781 156.68 500.181 169.88 482.881 169.88Z", fill: color }),
262
+ h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M595.281 107.08C604.181 107.08 611.781 110.38 618.781 116.98L620.481 118.68L633.981 104.58L632.581 102.98C623.781 92.98 610.781 87.48 595.781 87.48C565.981 87.48 544.481 109.08 544.481 138.48C544.481 167.98 565.981 189.48 595.781 189.48C610.481 189.48 623.681 183.98 632.581 174.08L633.981 172.58L620.981 158.18L619.281 159.88C612.481 166.48 603.981 169.98 595.481 169.98C578.381 169.98 565.681 156.68 565.681 138.58C565.581 120.58 577.881 107.08 595.281 107.08Z", fill: color }),
263
+ h("path", { d: "M135.882 89.2798H115.582V187.58H135.882V89.2798Z", fill: color }),
264
+ h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M231.481 104.18C238.781 93.4799 251.181 87.3799 266.281 87.3799C290.981 87.3799 307.581 103.28 307.381 127.08V187.48H286.781V132.38C286.781 116.38 278.281 107.18 263.381 107.18C248.481 107.18 237.981 117.68 237.981 132.68V187.48H217.281V132.38C217.281 116.38 208.781 107.18 193.881 107.18C178.981 107.18 168.481 117.68 168.481 132.68V187.48H147.981V89.3799H168.681V97.8799C178.081 88.8799 190.181 87.4799 197.081 87.4799C211.881 87.4799 224.381 93.5799 231.481 104.18Z", fill: color }),
265
+ h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M370.781 87.48C358.581 87.48 347.981 91.38 339.981 98.38V89.28H319.481V226.08H339.981V177.78C347.881 185.08 358.581 188.78 370.781 188.78C398.781 188.78 419.881 166.88 419.881 138.08C419.981 109.28 398.781 87.48 370.781 87.48ZM368.881 169.58C351.481 169.58 338.881 156.38 338.881 138.28C338.881 120.38 351.381 106.98 368.881 106.98C386.281 106.98 398.881 120.08 398.881 138.28C398.881 156.48 386.381 169.58 368.881 169.58Z", fill: color }),
266
+ h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M701.782 169.88C707.682 169.88 714.082 167.58 719.582 163.98L721.482 162.88L731.482 178.68L729.782 179.88C721.282 186.28 710.982 189.58 700.382 189.58C678.082 189.58 665.782 176.38 665.782 152.28V108.68H645.682V89.3799H665.782V59.8799H686.482V89.2798H725.682V108.48H686.482V151.88C686.482 163.38 691.982 169.88 701.782 169.88Z", fill: color }),
267
+ h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M511.681 89.4797V98.7797C503.681 91.4797 493.181 87.6797 480.981 87.6797C452.981 87.6797 431.981 109.68 431.981 138.68C431.981 167.78 453.081 189.68 480.981 189.68C493.181 189.68 503.681 185.78 511.681 178.38V187.68H532.381V89.4797H511.681ZM482.881 169.88C465.481 169.88 452.781 156.58 452.781 138.48C452.781 120.48 465.281 106.98 482.881 106.98C500.481 106.98 512.781 120.08 512.781 138.48C512.781 156.68 500.181 169.88 482.881 169.88Z", fill: color }),
268
+ h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M595.281 107.08C604.181 107.08 611.781 110.38 618.781 116.98L620.481 118.68L633.981 104.58L632.581 102.98C623.781 92.98 610.781 87.48 595.781 87.48C565.981 87.48 544.481 109.08 544.481 138.48C544.481 167.98 565.981 189.48 595.781 189.48C610.481 189.48 623.681 183.98 632.581 174.08L633.981 172.58L620.981 158.18L619.281 159.88C612.481 166.48 603.981 169.98 595.481 169.98C578.381 169.98 565.681 156.68 565.681 138.58C565.581 120.58 577.881 107.08 595.281 107.08Z", fill: color }),
269
+ h("path", { d: "M34.6815 112.78C40.6815 112.78 46.5815 114.18 51.8815 116.68C57.2815 119.18 62.0815 122.78 65.9815 127.28C67.9815 122.68 69.0815 117.78 69.0815 112.88C69.0815 108.38 68.1815 103.88 66.4815 99.8799C64.6815 95.6799 62.1815 91.9799 58.9815 88.8799C55.7815 85.7799 51.9815 83.2799 47.7815 81.4799C43.5815 79.7799 39.0815 78.8799 34.5815 78.8799C30.0815 78.8799 25.5815 79.6799 21.3815 81.4799C17.1815 83.1799 13.3815 85.7799 10.1815 88.8799C6.98154 91.9799 4.48154 95.7799 2.68154 99.8799C0.881541 104.08 0.081543 108.38 0.081543 112.88C0.181543 117.88 1.18154 122.78 3.18154 127.28C7.08154 122.68 11.8815 119.18 17.1815 116.68C22.7815 113.98 28.7815 112.68 34.6815 112.78Z", fill: color }),
270
+ h("path", { d: "M69.1817 153.48C69.1817 146.68 67.1817 140.18 63.2817 134.48C59.4817 128.88 54.0817 124.48 47.7817 121.88C41.4817 119.28 34.4817 118.68 27.7817 119.88C21.0817 121.28 14.8817 124.48 10.0817 129.28C5.28166 134.08 1.88166 140.08 0.681661 146.78C-0.718339 153.48 0.0816607 160.18 2.68166 166.48C5.28166 172.78 9.68166 178.08 15.4817 181.78C21.0817 185.58 27.7817 187.48 34.6817 187.48C43.7817 187.38 52.5817 183.88 59.0817 177.38C65.6817 170.98 69.1817 162.58 69.1817 153.48Z", fill: color }),
271
+ h("path", { d: "M69.1817 34.9799C69.1817 28.1799 67.1817 21.6799 63.2817 15.9799C59.4817 10.3799 54.1817 5.9799 47.7817 3.3799C41.4817 0.779901 34.4817 0.1799 27.7817 1.3799C21.0817 2.7799 14.8817 5.97986 10.0817 10.7799C5.28166 15.5799 1.88166 21.5799 0.681661 28.2799C-0.718339 34.9799 0.0816607 41.6799 2.68166 47.9799C5.28166 54.2799 9.68166 59.5799 15.4817 63.2799C21.0817 67.0799 27.7817 68.9799 34.6817 68.9799C43.8817 68.9799 52.6817 65.3799 59.1817 58.9799C65.5817 52.6799 69.1817 43.8799 69.1817 34.9799Z", fill: color }),
272
+ h("path", { d: "M962.664 203.95C953.044 203.95 945.244 201.285 939.264 195.955C933.284 190.495 930.294 183.41 930.294 174.7C930.294 165.08 933.739 157.605 940.629 152.275C947.649 146.945 957.464 144.28 970.074 144.28H993.864V138.43C993.864 129.72 991.589 123.09 987.039 118.54C982.619 113.86 976.184 111.52 967.734 111.52C962.014 111.52 956.749 112.885 951.939 115.615C947.129 118.345 943.229 122.18 940.239 127.12L933.999 120.295C937.639 114.575 942.384 110.22 948.234 107.23C954.214 104.11 960.974 102.55 968.514 102.55C979.694 102.55 988.404 105.605 994.644 111.715C1001.01 117.695 1004.2 126.015 1004.2 136.675V184.255C1004.2 188.805 1004.98 194.72 1006.54 202H997.569C996.399 199.14 995.554 194.07 995.034 186.79H994.644C990.874 192.25 986.259 196.475 980.799 199.465C975.339 202.455 969.294 203.95 962.664 203.95ZM962.664 195.175C968.124 195.175 973.259 194.07 978.069 191.86C982.879 189.52 986.714 186.465 989.574 182.695C992.434 178.795 993.864 174.7 993.864 170.41V152.665H969.489C960.389 152.665 953.239 154.615 948.039 158.515C942.969 162.415 940.434 167.81 940.434 174.7C940.434 180.68 942.514 185.62 946.674 189.52C950.834 193.29 956.164 195.175 962.664 195.175Z", fill: color }),
273
+ h("path", { d: "M1067.55 203.95C1055.07 203.95 1045.25 199.27 1038.1 189.91C1030.95 180.55 1027.38 167.745 1027.38 151.495C1027.38 136.415 1031.02 124.52 1038.3 115.81C1045.71 106.97 1055.72 102.55 1068.33 102.55C1074.7 102.55 1080.55 104.045 1085.88 107.035C1091.21 110.025 1095.5 114.25 1098.75 119.71H1099.14V57.3101H1109.67V178.21C1109.67 189.13 1109.86 197.06 1110.25 202H1100.89C1100.63 197.84 1100.5 192.12 1100.5 184.84H1100.11C1097.12 190.69 1092.7 195.37 1086.85 198.88C1081 202.26 1074.57 203.95 1067.55 203.95ZM1068.13 195.175C1077.23 195.175 1084.64 192.185 1090.36 186.205C1096.21 180.225 1099.14 172.49 1099.14 163V146.815C1099.14 135.895 1096.41 127.25 1090.95 120.88C1085.49 114.38 1078.08 111.13 1068.72 111.13C1059.1 111.13 1051.49 114.77 1045.9 122.05C1040.44 129.2 1037.71 139.145 1037.71 151.885C1037.71 165.275 1040.44 175.87 1045.9 183.67C1051.36 191.34 1058.77 195.175 1068.13 195.175Z", fill: color }),
274
+ h("path", { d: "M1208.57 104.5L1172.3 202H1161.96L1125.5 104.5H1136.61L1167.03 189.715L1197.45 104.5H1208.57Z", fill: color }),
275
+ h("path", { d: "M1261.51 203.95C1252.54 203.95 1244.61 201.87 1237.72 197.71C1230.96 193.55 1225.7 187.635 1221.93 179.965C1218.29 172.295 1216.47 163.39 1216.47 153.25C1216.47 143.11 1218.29 134.205 1221.93 126.535C1225.7 118.865 1230.96 112.95 1237.72 108.79C1244.61 104.63 1252.54 102.55 1261.51 102.55C1270.48 102.55 1278.35 104.63 1285.11 108.79C1292 112.95 1297.33 118.865 1301.1 126.535C1304.87 134.205 1306.75 143.11 1306.75 153.25C1306.75 163.39 1304.87 172.295 1301.1 179.965C1297.33 187.635 1292 193.55 1285.11 197.71C1278.35 201.87 1270.48 203.95 1261.51 203.95ZM1261.51 195.37C1268.4 195.37 1274.45 193.615 1279.65 190.105C1284.98 186.595 1289.07 181.655 1291.93 175.285C1294.79 168.915 1296.22 161.57 1296.22 153.25C1296.22 144.93 1294.79 137.585 1291.93 131.215C1289.07 124.845 1284.98 119.905 1279.65 116.395C1274.45 112.885 1268.4 111.13 1261.51 111.13C1254.75 111.13 1248.71 112.885 1243.38 116.395C1238.18 119.905 1234.15 124.845 1231.29 131.215C1228.43 137.585 1227 144.93 1227 153.25C1227 161.57 1228.43 168.915 1231.29 175.285C1234.15 181.655 1238.18 186.595 1243.38 190.105C1248.71 193.615 1254.75 195.37 1261.51 195.37Z", fill: color }),
276
+ h("path", { d: "M1366.03 203.95C1352.25 203.95 1341.52 199.53 1333.85 190.69C1326.31 181.72 1322.54 169.24 1322.54 153.25C1322.54 137.39 1326.38 124.975 1334.05 116.005C1341.72 107.035 1352.38 102.55 1366.03 102.55C1373.57 102.55 1380.26 104.11 1386.11 107.23C1391.96 110.22 1396.77 114.575 1400.54 120.295L1394.3 126.34C1391.31 121.66 1387.28 118.02 1382.21 115.42C1377.27 112.69 1371.88 111.325 1366.03 111.325C1355.76 111.325 1347.63 115.03 1341.65 122.44C1335.8 129.85 1332.88 140.12 1332.88 153.25C1332.88 166.38 1335.8 176.65 1341.65 184.06C1347.63 191.47 1355.76 195.175 1366.03 195.175C1371.88 195.175 1377.27 193.875 1382.21 191.275C1387.28 188.545 1391.31 184.84 1394.3 180.16L1400.54 186.205C1396.77 191.925 1391.96 196.345 1386.11 199.465C1380.26 202.455 1373.57 203.95 1366.03 203.95Z", fill: color }),
277
+ h("path", { d: "M1446.55 203.95C1436.93 203.95 1429.13 201.285 1423.15 195.955C1417.17 190.495 1414.18 183.41 1414.18 174.7C1414.18 165.08 1417.62 157.605 1424.51 152.275C1431.53 146.945 1441.35 144.28 1453.96 144.28H1477.75V138.43C1477.75 129.72 1475.47 123.09 1470.92 118.54C1466.5 113.86 1460.07 111.52 1451.62 111.52C1445.9 111.52 1440.63 112.885 1435.82 115.615C1431.01 118.345 1427.11 122.18 1424.12 127.12L1417.88 120.295C1421.52 114.575 1426.27 110.22 1432.12 107.23C1438.1 104.11 1444.86 102.55 1452.4 102.55C1463.58 102.55 1472.29 105.605 1478.53 111.715C1484.9 117.695 1488.08 126.015 1488.08 136.675V184.255C1488.08 188.805 1488.86 194.72 1490.42 202H1481.45C1480.28 199.14 1479.44 194.07 1478.92 186.79H1478.53C1474.76 192.25 1470.14 196.475 1464.68 199.465C1459.22 202.455 1453.18 203.95 1446.55 203.95ZM1446.55 195.175C1452.01 195.175 1457.14 194.07 1461.95 191.86C1466.76 189.52 1470.6 186.465 1473.46 182.695C1476.32 178.795 1477.75 174.7 1477.75 170.41V152.665H1453.37C1444.27 152.665 1437.12 154.615 1431.92 158.515C1426.85 162.415 1424.32 167.81 1424.32 174.7C1424.32 180.68 1426.4 185.62 1430.56 189.52C1434.72 193.29 1440.05 195.175 1446.55 195.175Z", fill: color }),
278
+ h("path", { d: "M1547.14 203.95C1539.08 203.95 1532.97 201.48 1528.81 196.54C1524.65 191.47 1522.57 184.19 1522.57 174.7V113.275H1505.02V104.5H1522.57V77.9801L1532.32 74.6651H1533.1V104.5H1560.59V113.275H1533.1V172.555C1533.1 180.355 1534.33 186.01 1536.8 189.52C1539.27 193.03 1543.17 194.785 1548.5 194.785C1553.83 194.785 1558.06 194.005 1561.18 192.445L1562.35 200.83C1558.19 202.91 1553.12 203.95 1547.14 203.95Z", fill: color }),
279
+ h("path", { d: "M1661.53 157.54H1589.77C1590.42 169.37 1593.54 178.535 1599.13 185.035C1604.85 191.535 1612.65 194.785 1622.53 194.785C1628.51 194.785 1633.97 193.485 1638.91 190.885C1643.98 188.285 1647.95 184.645 1650.81 179.965L1657.24 186.4C1653.34 192.12 1648.4 196.475 1642.42 199.465C1636.57 202.455 1629.94 203.95 1622.53 203.95C1609.01 203.95 1598.35 199.465 1590.55 190.495C1582.88 181.525 1579.05 169.175 1579.05 153.445C1579.05 137.585 1582.82 125.17 1590.36 116.2C1597.9 107.1 1608.23 102.55 1621.36 102.55C1633.84 102.55 1643.66 106.84 1650.81 115.42C1657.96 124 1661.53 135.895 1661.53 151.105V157.54ZM1651.39 147.4C1651.39 136.48 1648.66 127.77 1643.2 121.27C1637.74 114.77 1630.46 111.52 1621.36 111.52C1611.74 111.52 1604.2 114.77 1598.74 121.27C1593.28 127.77 1590.29 137.065 1589.77 149.155H1651.39V147.4Z", fill: color })));
514
280
  }
515
281
 
516
282
  const debug = browser("sq:useBigStat");
@@ -1397,372 +1163,100 @@ function useBigStat(props) {
1397
1163
  value: 0,
1398
1164
  statvalue: "!!!",
1399
1165
  flexReverse,
1400
- alignment,
1401
- loading: false,
1402
- },
1403
- label: "BAD PROP TYPE",
1404
- };
1405
- }
1406
- const result = re.exec(statType);
1407
- const queryName = result[1];
1408
- const statPath = StatPaths.find((pattern) => pattern.name === queryName);
1409
- // Get a list all possible keys in path
1410
- const keys = [];
1411
- const regex = pathToRegexp(statPath === null || statPath === void 0 ? void 0 : statPath.route, keys, {
1412
- strict: false,
1413
- sensitive: false,
1414
- end: true,
1415
- });
1416
- const allQueryArgs = regex.exec(statType);
1417
- // Retrieve all key values in order including undefined
1418
- const queryArgs = keys.map((_, i) => allQueryArgs[i + 1] ? decodeURIComponent(allQueryArgs[i + 1]) : undefined);
1419
- // remove query name from list
1420
- queryArgs.shift();
1421
- const label = queries[queryName].label;
1422
- const stat = (userIdent === null || userIdent === void 0 ? void 0 : userIdent.jwt) && queries[queryName].query(programId, locale, ...queryArgs);
1423
- debug("stat:", stat);
1424
- return {
1425
- props: {
1426
- value: stat === null || stat === void 0 ? void 0 : stat.value,
1427
- statvalue: (_a = stat === null || stat === void 0 ? void 0 : stat.statvalue) !== null && _a !== void 0 ? _a : LOADING,
1428
- loading: stat === null || stat === void 0 ? void 0 : stat.loading,
1429
- flexReverse,
1430
- alignment,
1431
- },
1432
- label,
1433
- };
1434
- }
1435
-
1436
- function useDemoBigStat(props) {
1437
- const { statType } = props;
1438
- const re = useMemo(() => StatPatterns.find((re) => re.exec(statType)), [statType]);
1439
- // triggers a re-render if the label is manually changed
1440
- useChildElements();
1441
- if (!(re === null || re === void 0 ? void 0 : re.exec(statType))) {
1442
- return {
1443
- props: {
1444
- value: 0,
1445
- statvalue: "!!!",
1166
+ alignment,
1446
1167
  loading: false,
1447
- flexReverse: false,
1448
- alignment: "center",
1449
1168
  },
1450
1169
  label: "BAD PROP TYPE",
1451
1170
  };
1452
1171
  }
1453
1172
  const result = re.exec(statType);
1454
1173
  const queryName = result[1];
1174
+ const statPath = StatPaths.find((pattern) => pattern.name === queryName);
1175
+ // Get a list all possible keys in path
1176
+ const keys = [];
1177
+ const regex = pathToRegexp(statPath === null || statPath === void 0 ? void 0 : statPath.route, keys, {
1178
+ strict: false,
1179
+ sensitive: false,
1180
+ end: true,
1181
+ });
1182
+ const allQueryArgs = regex.exec(statType);
1183
+ // Retrieve all key values in order including undefined
1184
+ const queryArgs = keys.map((_, i) => allQueryArgs[i + 1] ? decodeURIComponent(allQueryArgs[i + 1]) : undefined);
1185
+ // remove query name from list
1186
+ queryArgs.shift();
1455
1187
  const label = queries[queryName].label;
1188
+ const stat = (userIdent === null || userIdent === void 0 ? void 0 : userIdent.jwt) && queries[queryName].query(programId, locale, ...queryArgs);
1189
+ debug("stat:", stat);
1456
1190
  return {
1457
- props: cjs({
1458
- statvalue: "12345",
1459
- value: 0,
1460
- flexReverse: false,
1461
- alignment: "center",
1462
- }, props.demoData || {}, { arrayMerge: (_, a) => a }),
1463
- label: label !== null && label !== void 0 ? label : "Demo Label",
1464
- };
1465
- }
1466
-
1467
- function StatContainerView(props, children) {
1468
- const divideSpace = () => {
1469
- const spaceValue = getComputedStyle(document.documentElement).getPropertyValue(`--sl-spacing-${props.space}`);
1470
- return `${Math.floor(parseInt(spaceValue) / 2)}rem`;
1471
- };
1472
- // Dependent on props, not feasiable to move out
1473
- const style = {
1474
- StatContainer: {
1475
- width: "100%",
1476
- display: props.display || "grid",
1477
- "grid-template-columns": "repeat(auto-fill, minmax(130px, auto))",
1478
- gap: divideSpace(),
1479
- // First set of styles applies when shadow DOM is disabled, second set applies when shadow DOM is enabled
1480
- "& > *": {
1481
- "border-right": "1px solid #EAEAEA",
1482
- "padding-right": divideSpace(),
1483
- },
1484
- "& > :last-child": {
1485
- "border-right": "none",
1486
- },
1487
- "& > ::slotted(*)": {
1488
- "border-right": "1px solid #EAEAEA",
1489
- "padding-right": divideSpace(),
1490
- height: "100%",
1491
- },
1492
- "& > ::slotted(*:last-child)": {
1493
- "border-right": "none",
1494
- },
1495
- "@media screen and (max-width: 430px)": {
1496
- "& > ::slotted(*)": {
1497
- borderRight: "none",
1498
- },
1499
- },
1500
- },
1501
- StatFrame: {
1502
- display: "flex",
1503
- },
1504
- BorderFix: {
1505
- "border-right": "1px solid transparent",
1506
- width: "0px",
1507
- "margin-left": "-1px",
1508
- },
1509
- };
1510
- const sheet = createStyleSheet(style);
1511
- const styleString = sheet.toString();
1512
- return (h("div", { class: sheet.classes.StatFrame, part: "sqm-base" },
1513
- h("div", { class: sheet.classes.StatContainer, part: "sqm-inner-container" },
1514
- h("style", { type: "text/css" }, styleString),
1515
- children),
1516
- h("div", { class: sheet.classes.BorderFix, part: "sqm-border" })));
1517
- }
1518
-
1519
- function PortalChangePasswordView(props) {
1520
- const { states, callbacks } = props;
1521
- const style = {
1522
- Dialog: {
1523
- padding: "0",
1524
- "&::part(close-button)": {
1525
- "margin-top": "var(--sl-spacing-medium)",
1526
- },
1527
- "&::part(body)": {
1528
- padding: "0 var(--sl-spacing-x-large) var(--sl-spacing-x-large) var(--sl-spacing-x-large)",
1529
- },
1530
- },
1531
- Error: {
1532
- "&::part(erroralert-base)": {
1533
- "margin-bottom": "15px",
1534
- },
1535
- },
1536
- Success: {
1537
- "&::part(successalert-base)": {
1538
- "margin-bottom": "15px",
1539
- },
1540
- },
1541
- InputContainer: {
1542
- "& > :not(:last-child)": {
1543
- "margin-bottom": "var(--sl-spacing-x-large)",
1544
- },
1545
- },
1546
- CancelButton: {
1547
- width: "25%",
1548
- margin: "var(--sl-spacing-large) auto",
1549
- },
1550
- PasswordField: {
1551
- marginBottom: "var(--sl-spacing-large) !important",
1552
- display: "block",
1553
- },
1554
- ChangePasswordButton: {
1555
- paddingTop: "var(--sl-spacing-x-large)",
1556
- },
1557
- };
1558
- const sheet = createStyleSheet(style);
1559
- const styleString = sheet.toString();
1560
- return (h("div", null,
1561
- h("style", { type: "text/css" }, styleString),
1562
- h("sl-dialog", { class: sheet.classes.Dialog, open: states.open, "onSl-hide": () => callbacks.setOpen(false) },
1563
- h(PortalSectionView, Object.assign({}, {
1564
- labelMargin: "x-large",
1565
- padding: "none",
1566
- label: (h(TextSpanView, Object.assign({}, { type: "h2" }), states.content.modalChangePasswordHeader)),
1567
- content: (h(PortalContainerView, Object.assign({}, { direction: "column", padding: "none", gap: "32px" }),
1568
- states.error && (h("sqm-form-message", { class: sheet.classes.Error, type: "error", exportparts: "erroralert-icon" },
1569
- h("div", { part: "erroralert-text" }, states.error))),
1570
- states.success && (h("sqm-form-message", { class: sheet.classes.Success, type: "success", exportparts: "successalert-icon" },
1571
- h("div", { part: "successalert-text" }, states.content.successMessage))),
1572
- h("sl-form", { "onSl-submit": callbacks.submit },
1573
- h("div", { class: sheet.classes.InputContainer },
1574
- h("sqm-password-field", { exportparts: "input-label: input-label", class: sheet.classes.PasswordField, fieldLabel: states.content.passwordFieldLabel, meetsRequirementsText: states.content.meetsRequirementsText, doesNotMeetRequirementsText: states.content.doesNotMeetRequirementsText, minErrorText: states.content.minErrorText, uppercaseErrorText: states.content.uppercaseErrorText, lowercaseErrorText: states.content.lowercaseErrorText, hasErrorText: states.content.hasErrorText }),
1575
- h("sl-input", { exportparts: "label: input-label, base: input-base", name: "/confirmPassword", label: states.content.confirmPasswordFieldLabel, required: true, togglePassword: true, disabled: states.loading, type: "password" })),
1576
- h(PortalContainerView, Object.assign({}, { direction: "row", padding: "none", gap: "20px" }),
1577
- h("sl-button", { class: sheet.classes.ChangePasswordButton, type: "primary", submit: true, loading: states.loading }, states.content.changePasswordButtonText),
1578
- h("sl-button", { class: sheet.classes.CancelButton, type: "text", onClick: () => callbacks.setOpen(false) }, states.content.cancelText))))),
1579
- }))),
1580
- h(PortalSectionView, Object.assign({}, {
1581
- labelMargin: "x-large",
1582
- padding: "xxx-large",
1583
- label: (h(TextSpanView, Object.assign({}, { type: "h2" }), states.content.portalChangePasswordHeader)),
1584
- content: (h("sl-button", { onClick: () => callbacks.setOpen(true) }, states.content.portalChangePasswordButtonText)),
1585
- }),
1586
- h("style", { type: "text/css" }, styleString))));
1587
- }
1588
-
1589
- const style$3 = {
1590
- Wrapper: { ...AuthWrapper, "max-width": "600px" },
1591
- Column: AuthColumn,
1592
- HostBlock: HostBlock,
1593
- ":host": {
1594
- margin: "0 auto",
1595
- width: "100%",
1596
- },
1597
- ButtonsContainer: AuthButtonsContainer,
1598
- ErrorStyle: ErrorStyles,
1599
- };
1600
- const vanillaStyle$1 = `
1601
- sqm-portal-register {
1602
- margin: 0 auto;
1603
- width: 100%;
1604
- display: block;
1605
- }
1606
-
1607
- :host{
1608
- display: block;
1609
- }
1610
-
1611
- :host([hidden]) {
1612
- display: none;
1613
- }
1614
- `;
1615
- const sheet$3 = createStyleSheet(style$3);
1616
- const styleString$3 = sheet$3.toString();
1617
- function PortalRegisterView(props) {
1618
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
1619
- const { states, refs, callbacks, content } = props;
1620
- if (states.error) {
1621
- window.scrollTo({ top: 0, left: 0, behavior: "smooth" });
1622
- }
1623
- return (h("div", { class: sheet$3.classes.Wrapper, part: "sqm-base" },
1624
- h("style", { type: "text/css" },
1625
- vanillaStyle$1,
1626
- styleString$3),
1627
- h(TextSpanView, { type: "h3" }, content.pageLabel),
1628
- h("sl-form", { class: sheet$3.classes.Column, "onSl-submit": callbacks.submit, ref: (el) => (refs.formRef.current = el), novalidate: true },
1629
- states.error && (h("sqm-form-message", { type: "error", exportparts: "erroralert-icon" },
1630
- h("div", { part: "erroralert-text" }, props.states.error))),
1631
- content.formData,
1632
- !states.hideInputs && (h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", type: "email", name: "/email", label: content.emailLabel || "Email", disabled: states.loading, required: true, validationError: ({ value }) => {
1633
- if (!value) {
1634
- return content.requiredFieldErrorMessage;
1635
- }
1636
- // this matches shoelace validation, but could be better
1637
- if (!value.includes("@")) {
1638
- return content.invalidEmailErrorMessage;
1639
- }
1640
- } }, (((_b = (_a = states.registrationFormState) === null || _a === void 0 ? void 0 : _a.validationErrors) === null || _b === void 0 ? void 0 : _b.email) ? {
1641
- class: sheet$3.classes.ErrorStyle,
1642
- helpText: ((_d = (_c = states.registrationFormState) === null || _c === void 0 ? void 0 : _c.validationErrors) === null || _d === void 0 ? void 0 : _d.email) ||
1643
- content.requiredFieldErrorMessage,
1644
- }
1645
- : [])))),
1646
- !states.hideInputs && (h("sqm-password-field", { fieldLabel: content.passwordLabel, "disable-validation": states.disablePasswordValidation, meetsRequirementsText: content.meetsRequirementsText, doesNotMeetRequirementsText: content.doesNotMeetRequirementsText, minErrorText: content.minErrorText, uppercaseErrorText: content.uppercaseErrorText, lowercaseErrorText: content.lowercaseErrorText, hasErrorText: content.hasErrorText })),
1647
- content.passwordField,
1648
- !states.hideInputs && states.confirmPassword && (h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", type: "password", name: "/confirmPassword", label: content.confirmPasswordLabel, disabled: states.loading || ((_e = states.registrationFormState) === null || _e === void 0 ? void 0 : _e.disabled), required: true }, (((_g = (_f = states.registrationFormState) === null || _f === void 0 ? void 0 : _f.initialData) === null || _g === void 0 ? void 0 : _g.confirmPassword) ? {
1649
- value: (_j = (_h = states.registrationFormState) === null || _h === void 0 ? void 0 : _h.initialData) === null || _j === void 0 ? void 0 : _j.confirmPassword,
1650
- }
1651
- : {}), (((_l = (_k = states.registrationFormState) === null || _k === void 0 ? void 0 : _k.validationErrors) === null || _l === void 0 ? void 0 : _l.confirmPassword) ? {
1652
- class: sheet$3.classes.ErrorStyle,
1653
- helpText: ((_o = (_m = states.registrationFormState) === null || _m === void 0 ? void 0 : _m.validationErrors) === null || _o === void 0 ? void 0 : _o.confirmPassword) || content.requiredFieldErrorMessage,
1654
- }
1655
- : [])))),
1656
- content.terms,
1657
- h("div", { class: sheet$3.classes.ButtonsContainer },
1658
- h("sl-button", { submit: true, loading: states.loading, exportparts: "base: primarybutton-base", type: "primary" }, content.submitLabel || "Register"),
1659
- content.secondaryButton))));
1660
- }
1661
-
1662
- const style$4 = {
1663
- ErrorStyle: {
1664
- "&::part(control)": {
1665
- background: "var(--sl-color-danger-10)",
1666
- borderColor: "var(--sl-color-danger-500)",
1667
- outline: "var(--sl-color-danger-500)",
1668
- },
1669
- "&:host": {
1670
- "--focus-ring": "0 0 0 var(--sl-focus-ring-width) red !important",
1671
- },
1672
- },
1673
- ErrorMessageStyle: {
1674
- margin: 0,
1675
- marginTop: "5px",
1676
- color: "var(--sl-color-danger-500)",
1677
- fontSize: "var(--sl-input-help-text-font-size-medium)",
1678
- fontFamily: "var(--sl-font-sans)",
1679
- fontWeight: "var(--sl-font-weight-normal)",
1680
- },
1681
- FieldContainer: {
1682
- "margin-bottom": "var(--sl-spacing-large)",
1683
- },
1684
- };
1685
- const vanillaStyle$2 = `
1686
- :host {
1687
- margin: 0 auto;
1688
- width: 100%;
1689
- display: block;
1690
- }
1691
- sl-checkbox::part(label){
1692
- font-size: var(--sl-input-label-font-size-small);
1693
- font-weight: var(--sl-font-weight-normal);
1694
- line-height: 20px;
1695
- }
1696
- sl-checkbox::part(base){
1697
- align-items: start;
1191
+ props: {
1192
+ value: stat === null || stat === void 0 ? void 0 : stat.value,
1193
+ statvalue: (_a = stat === null || stat === void 0 ? void 0 : stat.statvalue) !== null && _a !== void 0 ? _a : LOADING,
1194
+ loading: stat === null || stat === void 0 ? void 0 : stat.loading,
1195
+ flexReverse,
1196
+ alignment,
1197
+ },
1198
+ label,
1199
+ };
1698
1200
  }
1699
- `;
1700
- jss.setup(create());
1701
- const sheet$4 = jss.createStyleSheet(style$4);
1702
- const styleString$4 = sheet$4.toString();
1703
- function CheckboxFieldView(props) {
1704
- var _b, _c;
1705
- const { states, content, callbacks } = props;
1706
- return (h("div", { class: sheet$4.classes.FieldContainer, part: "sqm-base" },
1707
- h("style", { type: "text/css" },
1708
- vanillaStyle$2,
1709
- styleString$4),
1710
- h("sl-checkbox", Object.assign({ exportparts: "label: input-label, base: input-base", name: `/${content.checkboxName}`, checked: states.checked, "onSl-change": (e) => {
1711
- e.target.value = e.target.checked;
1712
- callbacks.setChecked(e.target.value);
1713
- } }, (!content.checkboxOptional ? { required: false } : []), { disabled: ((_b = states.registrationFormState) === null || _b === void 0 ? void 0 : _b.loading) || ((_c = states.registrationFormState) === null || _c === void 0 ? void 0 : _c.disabled), required: false }), intl.formatMessage({
1714
- id: content.checkboxName + "-message",
1715
- defaultMessage: content.checkboxLabel,
1716
- }, {
1717
- labelLink: (h("a", { href: content.checkboxLabelLink, target: "_blank" }, content.checkboxLabelLinkText || content.checkboxLabelLink)),
1718
- }))));
1201
+
1202
+ function useDemoBigStat(props) {
1203
+ const { statType } = props;
1204
+ const re = useMemo(() => StatPatterns.find((re) => re.exec(statType)), [statType]);
1205
+ // triggers a re-render if the label is manually changed
1206
+ useChildElements();
1207
+ if (!(re === null || re === void 0 ? void 0 : re.exec(statType))) {
1208
+ return {
1209
+ props: {
1210
+ value: 0,
1211
+ statvalue: "!!!",
1212
+ loading: false,
1213
+ flexReverse: false,
1214
+ alignment: "center",
1215
+ },
1216
+ label: "BAD PROP TYPE",
1217
+ };
1218
+ }
1219
+ const result = re.exec(statType);
1220
+ const queryName = result[1];
1221
+ const label = queries[queryName].label;
1222
+ return {
1223
+ props: cjs({
1224
+ statvalue: "12345",
1225
+ value: 0,
1226
+ flexReverse: false,
1227
+ alignment: "center",
1228
+ }, props.demoData || {}, { arrayMerge: (_, a) => a }),
1229
+ label: label !== null && label !== void 0 ? label : "Demo Label",
1230
+ };
1719
1231
  }
1720
1232
 
1721
- function ChangeMarktingView(props) {
1722
- const { states, callbacks } = props;
1723
- const { text, formState } = states;
1724
- const { error } = formState;
1233
+ function CardFeedView(props, children) {
1234
+ // Dependent on props, not feasiable to move out
1725
1235
  const style = {
1726
1236
  Container: {
1727
- display: "flex",
1728
- flexDirection: "column",
1729
- gap: "var(--sl-spacing-x-small)",
1730
- padding: "0 var(--sl-spacing-xxx-large) var(--sl-spacing-xxx-large)",
1731
- },
1732
- SubmitButton: { marginBottom: "var(--sl-spacing-medium)" },
1733
- Error: {
1734
- "&::part(erroralert-base)": {
1735
- "margin-bottom": "15px",
1736
- },
1737
- },
1738
- Success: {
1739
- "&::part(successalert-base)": {
1740
- "margin-bottom": "15px",
1237
+ columnGap: props.gap + "px",
1238
+ columnWidth: props.width + "px",
1239
+ "& > div": {
1240
+ marginBottom: "24px",
1741
1241
  },
1742
1242
  },
1743
1243
  };
1744
1244
  const sheet = createStyleSheet(style);
1745
1245
  const styleString = sheet.toString();
1746
- return (h("div", { class: sheet.classes.Container, part: "sqm-base" },
1747
- h("style", { type: "text/css" }, styleString),
1748
- h(TextSpanView, Object.assign({}, { type: "h2" }), text.emailPreferencesHeader),
1749
- h("sl-form", { "onSl-submit": callbacks.onSubmit },
1750
- h(CheckboxFieldView, { states: {
1751
- checked: states.formState.marketingEmailOptIn,
1752
- }, content: {
1753
- checkboxLabel: text.marketingCheckboxLabel,
1754
- checkboxName: "marketingEmailOptIn",
1755
- }, callbacks: {
1756
- setChecked: callbacks.setChecked,
1757
- } }),
1758
- h("sl-button", { class: sheet.classes.SubmitButton, type: "primary", submit: true, loading: states.loading, disabled: states.submitDisabled }, text.submitChangeButtonText),
1759
- error && (h("sqm-form-message", { class: sheet.classes.Error, type: "error", exportparts: "erroralert-icon" },
1760
- h("div", { part: "erroralert-text" }, error))),
1761
- states.success && (h("sqm-form-message", { class: sheet.classes.Success, type: "success", exportparts: "successalert-icon" },
1762
- h("div", { part: "successalert-text" }, states.text.successMessage))))));
1246
+ const vanillaStyle = `
1247
+ :host{
1248
+ display: block;
1249
+ }
1250
+
1251
+ `;
1252
+ return (h("div", null,
1253
+ h("style", { type: "text/css" },
1254
+ styleString,
1255
+ vanillaStyle),
1256
+ h("div", { class: sheet.classes.Container, part: "sqm-base" }, children)));
1763
1257
  }
1764
1258
 
1765
- const style$5 = {
1259
+ const style$1 = {
1766
1260
  Description: {
1767
1261
  "& input[type=checkbox]": {
1768
1262
  display: "none",
@@ -1801,13 +1295,13 @@ const style$5 = {
1801
1295
  },
1802
1296
  },
1803
1297
  };
1804
- const sheet$5 = createStyleSheet(style$5);
1805
- const styleString$5 = sheet$5.toString();
1298
+ const sheet$1 = createStyleSheet(style$1);
1299
+ const styleString$1 = sheet$1.toString();
1806
1300
  function Details(props) {
1807
1301
  const rid = Math.random().toString(36).slice(2);
1808
1302
  return (h("div", { style: { opacity: props.opacity } },
1809
- h("style", { type: "text/css" }, styleString$5),
1810
- h("span", { class: sheet$5.classes.Description },
1303
+ h("style", { type: "text/css" }, styleString$1),
1304
+ h("span", { class: sheet$1.classes.Description },
1811
1305
  h("input", { type: "checkbox", id: "details-" + rid }),
1812
1306
  h("label", { class: "details", htmlFor: "details-" + rid },
1813
1307
  h("sl-icon", { exportparts: "base: chevron-icon", name: "chevron-down" })),
@@ -1829,7 +1323,7 @@ const GreyGift = () => {
1829
1323
  h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M14 2.70949C14 3.59565 12.6694 4.93746 12 5H9V16H7.00179V5H4.58792C3.21247 4.70182 2 3.64537 2 2.52072C2 1.42474 2.47603 0.556701 3.34184 0.182041C4.16921 -0.175986 5.12452 0.0203328 5.87976 0.544666C6.80676 1.18825 7.32679 2.3963 7.79856 3.49226C7.83996 3.58845 7.88099 3.68378 7.9219 3.77778C7.96173 3.68865 8.00186 3.59793 8.0425 3.50608C8.50995 2.44948 9.04359 1.24325 9.9404 0.59563C10.7332 0.0231438 11.741 -0.193157 12.6121 0.198945C13.5129 0.604397 14 1.53453 14 2.70949ZM10.6123 1.5C11.0928 1.15305 11.668 1.09012 12.1597 1.5C12.5879 1.85694 12.6108 2.02497 12.6658 2.42926L12.6755 2.5C12.6755 3.09851 12.1597 4 11.6439 4C11.2785 4 10.9914 3.99691 10.7224 3.99402C10.2319 3.98875 9.80131 3.98412 9.06496 4C9.20533 3.72786 9.31743 3.46669 9.42434 3.21761C9.71026 2.55143 9.95907 1.97176 10.6123 1.5ZM4.93861 1.5C4.70607 1.33855 4.17281 1.4106 3.95166 1.5063C3.76894 1.58537 3.49602 1.82658 3.49602 2.52072C3.49602 3.19524 4.58792 3.77778 4.58792 3.77778C4.58792 3.77778 5.45441 4 7.00179 4C6.47506 2.69451 5.7289 2.04867 4.93861 1.5Z", fill: "#828282" })));
1830
1324
  };
1831
1325
 
1832
- const style$6 = {
1326
+ const style$2 = {
1833
1327
  ProgressBar: {
1834
1328
  "& .progress-bar": {
1835
1329
  height: "0",
@@ -1941,14 +1435,14 @@ const style$6 = {
1941
1435
  },
1942
1436
  },
1943
1437
  };
1944
- const sheet$6 = createStyleSheet(style$6, { classNamePrefix: "sqm-prog-bar" });
1945
- const styleString$6 = sheet$6.toString();
1438
+ const sheet$2 = createStyleSheet(style$2, { classNamePrefix: "sqm-prog-bar" });
1439
+ const styleString$2 = sheet$2.toString();
1946
1440
  function ProgressBarView(props) {
1947
1441
  const { progress = 0, goal = 1, steps = false, progressBarUnit = "", repeatable = false, complete = false, expired = false, finite = 0, opacity = "1", } = props;
1948
1442
  let aggregate = buildProgressBar(repeatable, steps, props);
1949
1443
  const { columns, items } = aggregate;
1950
- return (h("div", { class: sheet$6.classes.ProgressBar, "data-expired": expired, "data-complete": complete, "data-steps": steps, "data-done": goal <= progress, style: { opacity: opacity } },
1951
- h("style", { type: "text/css" }, styleString$6),
1444
+ return (h("div", { class: sheet$2.classes.ProgressBar, "data-expired": expired, "data-complete": complete, "data-steps": steps, "data-done": goal <= progress, style: { opacity: opacity } },
1445
+ h("style", { type: "text/css" }, styleString$2),
1952
1446
  h("div", { class: (!Boolean(finite) && progress >= 2 * goal) ||
1953
1447
  (Boolean(finite) && progress > 2 * goal)
1954
1448
  ? "progress-bar repeatable-steps"
@@ -2239,7 +1733,7 @@ const arrow_left_right = () => {
2239
1733
  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" })));
2240
1734
  };
2241
1735
 
2242
- const style$7 = {
1736
+ const style$3 = {
2243
1737
  TaskCard: {
2244
1738
  display: "inline-block",
2245
1739
  width: "100%",
@@ -2393,8 +1887,8 @@ const style$7 = {
2393
1887
  },
2394
1888
  },
2395
1889
  };
2396
- const sheet$7 = createStyleSheet(style$7);
2397
- const styleString$7 = sheet$7.toString();
1890
+ const sheet$3 = createStyleSheet(style$3);
1891
+ const styleString$3 = sheet$3.toString();
2398
1892
  function TaskCardView(props) {
2399
1893
  var _a, _b;
2400
1894
  const { callbacks, states, content } = props;
@@ -2430,11 +1924,11 @@ function TaskCardView(props) {
2430
1924
  }
2431
1925
 
2432
1926
  `;
2433
- return (h("div", { class: sheet$7.classes.TaskCard, part: "sqm-base" },
1927
+ return (h("div", { class: sheet$3.classes.TaskCard, part: "sqm-base" },
2434
1928
  h("style", { type: "text/css" },
2435
- styleString$7,
1929
+ styleString$3,
2436
1930
  vanillaStyle),
2437
- !states.loading && taskNotStarted && (h("div", { class: sheet$7.classes.NotStarted },
1931
+ !states.loading && taskNotStarted && (h("div", { class: sheet$3.classes.NotStarted },
2438
1932
  h("span", { class: "icon" },
2439
1933
  h("sl-icon", { name: "info-circle-fill" })),
2440
1934
  intl.formatMessage({
@@ -2445,7 +1939,7 @@ function TaskCardView(props) {
2445
1939
  .setLocale(luxonLocale(states.locale))
2446
1940
  .toLocaleString(luxon.DateTime.DATETIME_MED),
2447
1941
  }))),
2448
- !states.loading && taskEnded && (h("div", { class: sheet$7.classes.Ended },
1942
+ !states.loading && taskEnded && (h("div", { class: sheet$3.classes.Ended },
2449
1943
  h("span", { class: "icon" },
2450
1944
  h("sl-icon", { exportparts: "base: task-card-icon", name: "exclamation-triangle-fill" })),
2451
1945
  intl.formatMessage({
@@ -2465,7 +1959,7 @@ function TaskCardView(props) {
2465
1959
  ? "main complete"
2466
1960
  : "main" },
2467
1961
  h("div", { class: "container", part: "sqm-card-container", "data-subdue": taskComplete || taskUnavailable },
2468
- h("div", { class: sheet$7.classes.Header, style: { opacity: taskComplete || taskUnavailable ? "0.45" : "1" } }, states.loading ? (h("sl-skeleton", { style: { width: "22%", margin: "0" } })) : (h("div", null,
1962
+ h("div", { class: sheet$3.classes.Header, style: { opacity: taskComplete || taskUnavailable ? "0.45" : "1" } }, states.loading ? (h("sl-skeleton", { style: { width: "22%", margin: "0" } })) : (h("div", null,
2469
1963
  showComplete && (h("span", { class: taskUnavailable ? "icon neutral" : "icon" }, taskComplete ? checkmark_filled$1 : checkmark_circle$1)),
2470
1964
  h("span", { part: "sqm-value", class: "value" }, content.rewardAmount),
2471
1965
  h("span", { part: "sqm-unit", class: "text" }, content.rewardUnit)))),
@@ -2481,7 +1975,7 @@ function TaskCardView(props) {
2481
1975
  } }, content.cardTitle)),
2482
1976
  states.loading ? (h("sl-skeleton", { style: { margin: "var(--sl-spacing-medium) 0" } })) : (content.description && (h(Details, Object.assign({}, props, { opacity: taskComplete || taskUnavailable ? "0.45" : "1" })))),
2483
1977
  content.showProgressBar && states.loading ? (h("sl-skeleton", { style: { margin: "var(--sl-spacing-medium) 0" } })) : (content.showProgressBar && (h(ProgressBarView, Object.assign({}, props.content, props.states, { opacity: taskComplete || taskUnavailable ? "0.45" : "1", complete: taskComplete, expired: taskUnavailable })))),
2484
- h("div", { class: sheet$7.classes.Footer, "data-subdue": taskComplete || taskUnavailable }, states.loading ? (h("sl-skeleton", { style: { width: "25%", marginLeft: "auto" } })) : (h("div", { style: { display: "contents" } },
1978
+ h("div", { class: sheet$3.classes.Footer, "data-subdue": taskComplete || taskUnavailable }, states.loading ? (h("sl-skeleton", { style: { width: "25%", marginLeft: "auto" } })) : (h("div", { style: { display: "contents" } },
2485
1979
  h("span", { class: "text" },
2486
1980
  content.repeatable && (h("div", null,
2487
1981
  h("span", { class: repetitions > 0
@@ -2519,109 +2013,396 @@ function TaskCardView(props) {
2519
2013
  } }, content.buttonText)))))))));
2520
2014
  }
2521
2015
 
2522
- function PoweredByImg({ color = "#A6A6A6", width = 120, height = 16, }) {
2523
- return (h("svg", { width: width, height: height, viewBox: "0 0 1662 254", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
2524
- h("path", { d: "M801.082 253.58L869.382 1.67969", stroke: color, "stroke-width": "3" }),
2525
- h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M125.682 42.48C123.882 42.48 121.982 42.78 120.382 43.48C118.682 44.18 117.182 45.18 115.882 46.48C114.582 47.68 113.582 49.28 112.882 50.98C112.182 52.68 111.882 54.48 111.982 56.28C112.282 59.68 113.882 63.08 116.382 65.38C118.982 67.78 122.382 68.98 125.782 68.98C129.282 68.98 132.682 67.58 135.182 65.38C137.782 62.98 139.382 59.78 139.582 56.28C139.582 54.38 139.282 52.68 138.682 50.98C137.982 49.28 136.982 47.78 135.682 46.48C134.382 45.18 132.882 44.18 131.182 43.48C129.282 42.78 127.582 42.48 125.682 42.48Z", fill: color }),
2526
- h("path", { d: "M135.882 89.2798H115.582V187.58H135.882V89.2798Z", fill: color }),
2527
- h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M231.481 104.18C238.781 93.4799 251.181 87.3799 266.281 87.3799C290.981 87.3799 307.581 103.28 307.381 127.08V187.48H286.781V132.38C286.781 116.38 278.281 107.18 263.381 107.18C248.481 107.18 237.981 117.68 237.981 132.68V187.48H217.281V132.38C217.281 116.38 208.781 107.18 193.881 107.18C178.981 107.18 168.481 117.68 168.481 132.68V187.48H147.981V89.3799H168.681V97.8799C178.081 88.8799 190.181 87.4799 197.081 87.4799C211.881 87.4799 224.381 93.5799 231.481 104.18Z", fill: color }),
2528
- h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M370.781 87.48C358.581 87.48 347.981 91.38 339.981 98.38V89.28H319.481V226.08H339.981V177.78C347.881 185.08 358.581 188.78 370.781 188.78C398.781 188.78 419.881 166.88 419.881 138.08C419.981 109.28 398.781 87.48 370.781 87.48ZM368.881 169.58C351.481 169.58 338.881 156.38 338.881 138.28C338.881 120.38 351.381 106.98 368.881 106.98C386.281 106.98 398.881 120.08 398.881 138.28C398.881 156.48 386.381 169.58 368.881 169.58Z", fill: color }),
2529
- h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M701.782 169.88C707.682 169.88 714.082 167.58 719.582 163.98L721.482 162.88L731.482 178.68L729.782 179.88C721.282 186.28 710.982 189.58 700.382 189.58C678.082 189.58 665.782 176.38 665.782 152.28V108.68H645.682V89.3799H665.782V59.8799H686.482V89.2798H725.682V108.48H686.482V151.88C686.482 163.38 691.982 169.88 701.782 169.88Z", fill: color }),
2530
- h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M551.282 239.88C549.982 239.88 548.782 240.28 547.682 240.88C546.682 241.58 545.782 242.58 545.382 243.68C544.882 244.78 544.782 246.08 545.082 247.28C545.282 248.58 545.882 249.68 546.882 250.48C547.782 251.38 548.882 251.98 550.082 252.28C551.382 252.48 552.582 252.38 553.782 251.98C554.882 251.48 555.982 250.78 556.582 249.68C557.282 248.68 557.582 247.38 557.582 246.18C557.582 244.48 556.982 242.88 555.682 241.68C554.482 240.48 552.882 239.88 551.282 239.88Z", fill: color }),
2531
- h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M586.182 210.78C592.282 210.78 597.582 213.08 601.082 217.18L601.482 217.68L596.282 223.08L595.782 222.58C594.482 221.18 593.082 220.18 591.382 219.48C589.682 218.78 587.882 218.38 586.082 218.48C578.882 218.48 573.682 224.08 573.682 231.58C573.682 239.18 578.882 244.78 586.082 244.78C589.782 244.68 593.282 243.18 595.882 240.58L596.382 240.08L601.382 245.68L600.982 246.08C597.182 250.18 591.982 252.18 586.082 252.18C574.082 252.18 565.382 243.58 565.382 231.58C565.582 219.48 574.182 210.78 586.182 210.78Z", fill: color }),
2532
- h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M633.782 210.78C621.682 210.78 612.582 219.68 612.582 231.38C612.582 243.08 621.682 251.98 633.782 251.98C645.882 251.98 654.882 243.08 654.882 231.38C655.082 219.78 645.982 210.78 633.782 210.78ZM633.782 244.78C626.382 244.78 620.782 239.28 620.782 231.58C620.782 223.88 626.182 218.48 633.782 218.48C641.182 218.48 646.782 224.08 646.782 231.58C646.782 238.98 641.382 244.78 633.782 244.78Z", fill: color }),
2533
- h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M723.982 228.78C723.982 222.18 720.382 218.28 714.082 218.28C707.682 218.28 703.382 222.78 702.982 228.98V252.18H695.082V228.68C695.082 222.08 691.482 218.18 685.182 218.18C680.082 218.18 674.482 221.48 674.482 228.88V252.08H666.582V211.38H674.482V214.78L676.682 213.28C679.582 211.38 683.082 210.48 686.582 210.48C692.082 210.48 696.782 212.48 699.882 216.08L700.882 217.28L701.882 216.08C704.782 212.48 709.582 210.48 715.182 210.48C725.082 210.48 731.982 217.08 731.982 226.38V251.88H724.082V228.68H723.982V228.78Z", fill: color }),
2534
- h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M511.681 89.4797V98.7797C503.681 91.4797 493.181 87.6797 480.981 87.6797C452.981 87.6797 431.981 109.68 431.981 138.68C431.981 167.78 453.081 189.68 480.981 189.68C493.181 189.68 503.681 185.78 511.681 178.38V187.68H532.381V89.4797H511.681ZM482.881 169.88C465.481 169.88 452.781 156.58 452.781 138.48C452.781 120.48 465.281 106.98 482.881 106.98C500.481 106.98 512.781 120.08 512.781 138.48C512.781 156.68 500.181 169.88 482.881 169.88Z", fill: color }),
2535
- h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M595.281 107.08C604.181 107.08 611.781 110.38 618.781 116.98L620.481 118.68L633.981 104.58L632.581 102.98C623.781 92.98 610.781 87.48 595.781 87.48C565.981 87.48 544.481 109.08 544.481 138.48C544.481 167.98 565.981 189.48 595.781 189.48C610.481 189.48 623.681 183.98 632.581 174.08L633.981 172.58L620.981 158.18L619.281 159.88C612.481 166.48 603.981 169.98 595.481 169.98C578.381 169.98 565.681 156.68 565.681 138.58C565.581 120.58 577.881 107.08 595.281 107.08Z", fill: color }),
2536
- h("path", { d: "M135.882 89.2798H115.582V187.58H135.882V89.2798Z", fill: color }),
2537
- h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M231.481 104.18C238.781 93.4799 251.181 87.3799 266.281 87.3799C290.981 87.3799 307.581 103.28 307.381 127.08V187.48H286.781V132.38C286.781 116.38 278.281 107.18 263.381 107.18C248.481 107.18 237.981 117.68 237.981 132.68V187.48H217.281V132.38C217.281 116.38 208.781 107.18 193.881 107.18C178.981 107.18 168.481 117.68 168.481 132.68V187.48H147.981V89.3799H168.681V97.8799C178.081 88.8799 190.181 87.4799 197.081 87.4799C211.881 87.4799 224.381 93.5799 231.481 104.18Z", fill: color }),
2538
- h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M370.781 87.48C358.581 87.48 347.981 91.38 339.981 98.38V89.28H319.481V226.08H339.981V177.78C347.881 185.08 358.581 188.78 370.781 188.78C398.781 188.78 419.881 166.88 419.881 138.08C419.981 109.28 398.781 87.48 370.781 87.48ZM368.881 169.58C351.481 169.58 338.881 156.38 338.881 138.28C338.881 120.38 351.381 106.98 368.881 106.98C386.281 106.98 398.881 120.08 398.881 138.28C398.881 156.48 386.381 169.58 368.881 169.58Z", fill: color }),
2539
- h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M701.782 169.88C707.682 169.88 714.082 167.58 719.582 163.98L721.482 162.88L731.482 178.68L729.782 179.88C721.282 186.28 710.982 189.58 700.382 189.58C678.082 189.58 665.782 176.38 665.782 152.28V108.68H645.682V89.3799H665.782V59.8799H686.482V89.2798H725.682V108.48H686.482V151.88C686.482 163.38 691.982 169.88 701.782 169.88Z", fill: color }),
2540
- h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M511.681 89.4797V98.7797C503.681 91.4797 493.181 87.6797 480.981 87.6797C452.981 87.6797 431.981 109.68 431.981 138.68C431.981 167.78 453.081 189.68 480.981 189.68C493.181 189.68 503.681 185.78 511.681 178.38V187.68H532.381V89.4797H511.681ZM482.881 169.88C465.481 169.88 452.781 156.58 452.781 138.48C452.781 120.48 465.281 106.98 482.881 106.98C500.481 106.98 512.781 120.08 512.781 138.48C512.781 156.68 500.181 169.88 482.881 169.88Z", fill: color }),
2541
- h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M595.281 107.08C604.181 107.08 611.781 110.38 618.781 116.98L620.481 118.68L633.981 104.58L632.581 102.98C623.781 92.98 610.781 87.48 595.781 87.48C565.981 87.48 544.481 109.08 544.481 138.48C544.481 167.98 565.981 189.48 595.781 189.48C610.481 189.48 623.681 183.98 632.581 174.08L633.981 172.58L620.981 158.18L619.281 159.88C612.481 166.48 603.981 169.98 595.481 169.98C578.381 169.98 565.681 156.68 565.681 138.58C565.581 120.58 577.881 107.08 595.281 107.08Z", fill: color }),
2542
- h("path", { d: "M34.6815 112.78C40.6815 112.78 46.5815 114.18 51.8815 116.68C57.2815 119.18 62.0815 122.78 65.9815 127.28C67.9815 122.68 69.0815 117.78 69.0815 112.88C69.0815 108.38 68.1815 103.88 66.4815 99.8799C64.6815 95.6799 62.1815 91.9799 58.9815 88.8799C55.7815 85.7799 51.9815 83.2799 47.7815 81.4799C43.5815 79.7799 39.0815 78.8799 34.5815 78.8799C30.0815 78.8799 25.5815 79.6799 21.3815 81.4799C17.1815 83.1799 13.3815 85.7799 10.1815 88.8799C6.98154 91.9799 4.48154 95.7799 2.68154 99.8799C0.881541 104.08 0.081543 108.38 0.081543 112.88C0.181543 117.88 1.18154 122.78 3.18154 127.28C7.08154 122.68 11.8815 119.18 17.1815 116.68C22.7815 113.98 28.7815 112.68 34.6815 112.78Z", fill: color }),
2543
- h("path", { d: "M69.1817 153.48C69.1817 146.68 67.1817 140.18 63.2817 134.48C59.4817 128.88 54.0817 124.48 47.7817 121.88C41.4817 119.28 34.4817 118.68 27.7817 119.88C21.0817 121.28 14.8817 124.48 10.0817 129.28C5.28166 134.08 1.88166 140.08 0.681661 146.78C-0.718339 153.48 0.0816607 160.18 2.68166 166.48C5.28166 172.78 9.68166 178.08 15.4817 181.78C21.0817 185.58 27.7817 187.48 34.6817 187.48C43.7817 187.38 52.5817 183.88 59.0817 177.38C65.6817 170.98 69.1817 162.58 69.1817 153.48Z", fill: color }),
2544
- h("path", { d: "M69.1817 34.9799C69.1817 28.1799 67.1817 21.6799 63.2817 15.9799C59.4817 10.3799 54.1817 5.9799 47.7817 3.3799C41.4817 0.779901 34.4817 0.1799 27.7817 1.3799C21.0817 2.7799 14.8817 5.97986 10.0817 10.7799C5.28166 15.5799 1.88166 21.5799 0.681661 28.2799C-0.718339 34.9799 0.0816607 41.6799 2.68166 47.9799C5.28166 54.2799 9.68166 59.5799 15.4817 63.2799C21.0817 67.0799 27.7817 68.9799 34.6817 68.9799C43.8817 68.9799 52.6817 65.3799 59.1817 58.9799C65.5817 52.6799 69.1817 43.8799 69.1817 34.9799Z", fill: color }),
2545
- h("path", { d: "M962.664 203.95C953.044 203.95 945.244 201.285 939.264 195.955C933.284 190.495 930.294 183.41 930.294 174.7C930.294 165.08 933.739 157.605 940.629 152.275C947.649 146.945 957.464 144.28 970.074 144.28H993.864V138.43C993.864 129.72 991.589 123.09 987.039 118.54C982.619 113.86 976.184 111.52 967.734 111.52C962.014 111.52 956.749 112.885 951.939 115.615C947.129 118.345 943.229 122.18 940.239 127.12L933.999 120.295C937.639 114.575 942.384 110.22 948.234 107.23C954.214 104.11 960.974 102.55 968.514 102.55C979.694 102.55 988.404 105.605 994.644 111.715C1001.01 117.695 1004.2 126.015 1004.2 136.675V184.255C1004.2 188.805 1004.98 194.72 1006.54 202H997.569C996.399 199.14 995.554 194.07 995.034 186.79H994.644C990.874 192.25 986.259 196.475 980.799 199.465C975.339 202.455 969.294 203.95 962.664 203.95ZM962.664 195.175C968.124 195.175 973.259 194.07 978.069 191.86C982.879 189.52 986.714 186.465 989.574 182.695C992.434 178.795 993.864 174.7 993.864 170.41V152.665H969.489C960.389 152.665 953.239 154.615 948.039 158.515C942.969 162.415 940.434 167.81 940.434 174.7C940.434 180.68 942.514 185.62 946.674 189.52C950.834 193.29 956.164 195.175 962.664 195.175Z", fill: color }),
2546
- h("path", { d: "M1067.55 203.95C1055.07 203.95 1045.25 199.27 1038.1 189.91C1030.95 180.55 1027.38 167.745 1027.38 151.495C1027.38 136.415 1031.02 124.52 1038.3 115.81C1045.71 106.97 1055.72 102.55 1068.33 102.55C1074.7 102.55 1080.55 104.045 1085.88 107.035C1091.21 110.025 1095.5 114.25 1098.75 119.71H1099.14V57.3101H1109.67V178.21C1109.67 189.13 1109.86 197.06 1110.25 202H1100.89C1100.63 197.84 1100.5 192.12 1100.5 184.84H1100.11C1097.12 190.69 1092.7 195.37 1086.85 198.88C1081 202.26 1074.57 203.95 1067.55 203.95ZM1068.13 195.175C1077.23 195.175 1084.64 192.185 1090.36 186.205C1096.21 180.225 1099.14 172.49 1099.14 163V146.815C1099.14 135.895 1096.41 127.25 1090.95 120.88C1085.49 114.38 1078.08 111.13 1068.72 111.13C1059.1 111.13 1051.49 114.77 1045.9 122.05C1040.44 129.2 1037.71 139.145 1037.71 151.885C1037.71 165.275 1040.44 175.87 1045.9 183.67C1051.36 191.34 1058.77 195.175 1068.13 195.175Z", fill: color }),
2547
- h("path", { d: "M1208.57 104.5L1172.3 202H1161.96L1125.5 104.5H1136.61L1167.03 189.715L1197.45 104.5H1208.57Z", fill: color }),
2548
- h("path", { d: "M1261.51 203.95C1252.54 203.95 1244.61 201.87 1237.72 197.71C1230.96 193.55 1225.7 187.635 1221.93 179.965C1218.29 172.295 1216.47 163.39 1216.47 153.25C1216.47 143.11 1218.29 134.205 1221.93 126.535C1225.7 118.865 1230.96 112.95 1237.72 108.79C1244.61 104.63 1252.54 102.55 1261.51 102.55C1270.48 102.55 1278.35 104.63 1285.11 108.79C1292 112.95 1297.33 118.865 1301.1 126.535C1304.87 134.205 1306.75 143.11 1306.75 153.25C1306.75 163.39 1304.87 172.295 1301.1 179.965C1297.33 187.635 1292 193.55 1285.11 197.71C1278.35 201.87 1270.48 203.95 1261.51 203.95ZM1261.51 195.37C1268.4 195.37 1274.45 193.615 1279.65 190.105C1284.98 186.595 1289.07 181.655 1291.93 175.285C1294.79 168.915 1296.22 161.57 1296.22 153.25C1296.22 144.93 1294.79 137.585 1291.93 131.215C1289.07 124.845 1284.98 119.905 1279.65 116.395C1274.45 112.885 1268.4 111.13 1261.51 111.13C1254.75 111.13 1248.71 112.885 1243.38 116.395C1238.18 119.905 1234.15 124.845 1231.29 131.215C1228.43 137.585 1227 144.93 1227 153.25C1227 161.57 1228.43 168.915 1231.29 175.285C1234.15 181.655 1238.18 186.595 1243.38 190.105C1248.71 193.615 1254.75 195.37 1261.51 195.37Z", fill: color }),
2549
- h("path", { d: "M1366.03 203.95C1352.25 203.95 1341.52 199.53 1333.85 190.69C1326.31 181.72 1322.54 169.24 1322.54 153.25C1322.54 137.39 1326.38 124.975 1334.05 116.005C1341.72 107.035 1352.38 102.55 1366.03 102.55C1373.57 102.55 1380.26 104.11 1386.11 107.23C1391.96 110.22 1396.77 114.575 1400.54 120.295L1394.3 126.34C1391.31 121.66 1387.28 118.02 1382.21 115.42C1377.27 112.69 1371.88 111.325 1366.03 111.325C1355.76 111.325 1347.63 115.03 1341.65 122.44C1335.8 129.85 1332.88 140.12 1332.88 153.25C1332.88 166.38 1335.8 176.65 1341.65 184.06C1347.63 191.47 1355.76 195.175 1366.03 195.175C1371.88 195.175 1377.27 193.875 1382.21 191.275C1387.28 188.545 1391.31 184.84 1394.3 180.16L1400.54 186.205C1396.77 191.925 1391.96 196.345 1386.11 199.465C1380.26 202.455 1373.57 203.95 1366.03 203.95Z", fill: color }),
2550
- h("path", { d: "M1446.55 203.95C1436.93 203.95 1429.13 201.285 1423.15 195.955C1417.17 190.495 1414.18 183.41 1414.18 174.7C1414.18 165.08 1417.62 157.605 1424.51 152.275C1431.53 146.945 1441.35 144.28 1453.96 144.28H1477.75V138.43C1477.75 129.72 1475.47 123.09 1470.92 118.54C1466.5 113.86 1460.07 111.52 1451.62 111.52C1445.9 111.52 1440.63 112.885 1435.82 115.615C1431.01 118.345 1427.11 122.18 1424.12 127.12L1417.88 120.295C1421.52 114.575 1426.27 110.22 1432.12 107.23C1438.1 104.11 1444.86 102.55 1452.4 102.55C1463.58 102.55 1472.29 105.605 1478.53 111.715C1484.9 117.695 1488.08 126.015 1488.08 136.675V184.255C1488.08 188.805 1488.86 194.72 1490.42 202H1481.45C1480.28 199.14 1479.44 194.07 1478.92 186.79H1478.53C1474.76 192.25 1470.14 196.475 1464.68 199.465C1459.22 202.455 1453.18 203.95 1446.55 203.95ZM1446.55 195.175C1452.01 195.175 1457.14 194.07 1461.95 191.86C1466.76 189.52 1470.6 186.465 1473.46 182.695C1476.32 178.795 1477.75 174.7 1477.75 170.41V152.665H1453.37C1444.27 152.665 1437.12 154.615 1431.92 158.515C1426.85 162.415 1424.32 167.81 1424.32 174.7C1424.32 180.68 1426.4 185.62 1430.56 189.52C1434.72 193.29 1440.05 195.175 1446.55 195.175Z", fill: color }),
2551
- h("path", { d: "M1547.14 203.95C1539.08 203.95 1532.97 201.48 1528.81 196.54C1524.65 191.47 1522.57 184.19 1522.57 174.7V113.275H1505.02V104.5H1522.57V77.9801L1532.32 74.6651H1533.1V104.5H1560.59V113.275H1533.1V172.555C1533.1 180.355 1534.33 186.01 1536.8 189.52C1539.27 193.03 1543.17 194.785 1548.5 194.785C1553.83 194.785 1558.06 194.005 1561.18 192.445L1562.35 200.83C1558.19 202.91 1553.12 203.95 1547.14 203.95Z", fill: color }),
2552
- h("path", { d: "M1661.53 157.54H1589.77C1590.42 169.37 1593.54 178.535 1599.13 185.035C1604.85 191.535 1612.65 194.785 1622.53 194.785C1628.51 194.785 1633.97 193.485 1638.91 190.885C1643.98 188.285 1647.95 184.645 1650.81 179.965L1657.24 186.4C1653.34 192.12 1648.4 196.475 1642.42 199.465C1636.57 202.455 1629.94 203.95 1622.53 203.95C1609.01 203.95 1598.35 199.465 1590.55 190.495C1582.88 181.525 1579.05 169.175 1579.05 153.445C1579.05 137.585 1582.82 125.17 1590.36 116.2C1597.9 107.1 1608.23 102.55 1621.36 102.55C1633.84 102.55 1643.66 106.84 1650.81 115.42C1657.96 124 1661.53 135.895 1661.53 151.105V157.54ZM1651.39 147.4C1651.39 136.48 1648.66 127.77 1643.2 121.27C1637.74 114.77 1630.46 111.52 1621.36 111.52C1611.74 111.52 1604.2 114.77 1598.74 121.27C1593.28 127.77 1590.29 137.065 1589.77 149.155H1651.39V147.4Z", fill: color })));
2016
+ const style$4 = {
2017
+ Wrapper: { ...AuthWrapper, "max-width": "600px" },
2018
+ Column: AuthColumn,
2019
+ HostBlock: HostBlock,
2020
+ ":host": {
2021
+ margin: "0 auto",
2022
+ width: "100%",
2023
+ },
2024
+ ButtonsContainer: AuthButtonsContainer,
2025
+ ErrorStyle: ErrorStyles,
2026
+ };
2027
+ const vanillaStyle = `
2028
+ sqm-portal-register {
2029
+ margin: 0 auto;
2030
+ width: 100%;
2031
+ display: block;
2032
+ }
2033
+
2034
+ :host{
2035
+ display: block;
2036
+ }
2037
+
2038
+ :host([hidden]) {
2039
+ display: none;
2040
+ }
2041
+ `;
2042
+ const sheet$4 = createStyleSheet(style$4);
2043
+ const styleString$4 = sheet$4.toString();
2044
+ function PortalRegisterView(props) {
2045
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
2046
+ const { states, refs, callbacks, content } = props;
2047
+ if (states.error) {
2048
+ window.scrollTo({ top: 0, left: 0, behavior: "smooth" });
2049
+ }
2050
+ return (h("div", { class: sheet$4.classes.Wrapper, part: "sqm-base" },
2051
+ h("style", { type: "text/css" },
2052
+ vanillaStyle,
2053
+ styleString$4),
2054
+ h(TextSpanView, { type: "h3" }, content.pageLabel),
2055
+ h("sl-form", { class: sheet$4.classes.Column, "onSl-submit": callbacks.submit, ref: (el) => (refs.formRef.current = el), novalidate: true },
2056
+ states.error && (h("sqm-form-message", { type: "error", exportparts: "erroralert-icon" },
2057
+ h("div", { part: "erroralert-text" }, props.states.error))),
2058
+ content.formData,
2059
+ !states.hideInputs && (h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", type: "email", name: "/email", label: content.emailLabel || "Email", disabled: states.loading, required: true, validationError: ({ value }) => {
2060
+ if (!value) {
2061
+ return content.requiredFieldErrorMessage;
2062
+ }
2063
+ // this matches shoelace validation, but could be better
2064
+ if (!value.includes("@")) {
2065
+ return content.invalidEmailErrorMessage;
2066
+ }
2067
+ } }, (((_b = (_a = states.registrationFormState) === null || _a === void 0 ? void 0 : _a.validationErrors) === null || _b === void 0 ? void 0 : _b.email) ? {
2068
+ class: sheet$4.classes.ErrorStyle,
2069
+ helpText: ((_d = (_c = states.registrationFormState) === null || _c === void 0 ? void 0 : _c.validationErrors) === null || _d === void 0 ? void 0 : _d.email) ||
2070
+ content.requiredFieldErrorMessage,
2071
+ }
2072
+ : [])))),
2073
+ !states.hideInputs && (h("sqm-password-field", { fieldLabel: content.passwordLabel, "disable-validation": states.disablePasswordValidation, meetsRequirementsText: content.meetsRequirementsText, doesNotMeetRequirementsText: content.doesNotMeetRequirementsText, minErrorText: content.minErrorText, uppercaseErrorText: content.uppercaseErrorText, lowercaseErrorText: content.lowercaseErrorText, hasErrorText: content.hasErrorText })),
2074
+ content.passwordField,
2075
+ !states.hideInputs && states.confirmPassword && (h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", type: "password", name: "/confirmPassword", label: content.confirmPasswordLabel, disabled: states.loading || ((_e = states.registrationFormState) === null || _e === void 0 ? void 0 : _e.disabled), required: true }, (((_g = (_f = states.registrationFormState) === null || _f === void 0 ? void 0 : _f.initialData) === null || _g === void 0 ? void 0 : _g.confirmPassword) ? {
2076
+ value: (_j = (_h = states.registrationFormState) === null || _h === void 0 ? void 0 : _h.initialData) === null || _j === void 0 ? void 0 : _j.confirmPassword,
2077
+ }
2078
+ : {}), (((_l = (_k = states.registrationFormState) === null || _k === void 0 ? void 0 : _k.validationErrors) === null || _l === void 0 ? void 0 : _l.confirmPassword) ? {
2079
+ class: sheet$4.classes.ErrorStyle,
2080
+ helpText: ((_o = (_m = states.registrationFormState) === null || _m === void 0 ? void 0 : _m.validationErrors) === null || _o === void 0 ? void 0 : _o.confirmPassword) || content.requiredFieldErrorMessage,
2081
+ }
2082
+ : [])))),
2083
+ content.terms,
2084
+ h("div", { class: sheet$4.classes.ButtonsContainer },
2085
+ h("sl-button", { submit: true, loading: states.loading, exportparts: "base: primarybutton-base", type: "primary" }, content.submitLabel || "Register"),
2086
+ content.secondaryButton))));
2087
+ }
2088
+
2089
+ const style$5 = {
2090
+ ErrorStyle: {
2091
+ "&::part(control)": {
2092
+ background: "var(--sl-color-danger-10)",
2093
+ borderColor: "var(--sl-color-danger-500)",
2094
+ outline: "var(--sl-color-danger-500)",
2095
+ },
2096
+ "&:host": {
2097
+ "--focus-ring": "0 0 0 var(--sl-focus-ring-width) red !important",
2098
+ },
2099
+ },
2100
+ ErrorMessageStyle: {
2101
+ margin: 0,
2102
+ marginTop: "5px",
2103
+ color: "var(--sl-color-danger-500)",
2104
+ fontSize: "var(--sl-input-help-text-font-size-medium)",
2105
+ fontFamily: "var(--sl-font-sans)",
2106
+ fontWeight: "var(--sl-font-weight-normal)",
2107
+ },
2108
+ FieldContainer: {
2109
+ "margin-bottom": "var(--sl-spacing-large)",
2110
+ },
2111
+ };
2112
+ const vanillaStyle$1 = `
2113
+ :host {
2114
+ margin: 0 auto;
2115
+ width: 100%;
2116
+ display: block;
2117
+ }
2118
+ sl-checkbox::part(label){
2119
+ font-size: var(--sl-input-label-font-size-small);
2120
+ font-weight: var(--sl-font-weight-normal);
2121
+ line-height: 20px;
2122
+ }
2123
+ sl-checkbox::part(base){
2124
+ align-items: start;
2125
+ }
2126
+ `;
2127
+ jss.setup(create());
2128
+ const sheet$5 = jss.createStyleSheet(style$5);
2129
+ const styleString$5 = sheet$5.toString();
2130
+ function CheckboxFieldView(props) {
2131
+ var _b, _c;
2132
+ const { states, content, callbacks } = props;
2133
+ return (h("div", { class: sheet$5.classes.FieldContainer, part: "sqm-base" },
2134
+ h("style", { type: "text/css" },
2135
+ vanillaStyle$1,
2136
+ styleString$5),
2137
+ h("sl-checkbox", Object.assign({ exportparts: "label: input-label, base: input-base", name: `/${content.checkboxName}`, checked: states.checked, "onSl-change": (e) => {
2138
+ e.target.value = e.target.checked;
2139
+ callbacks.setChecked(e.target.value);
2140
+ } }, (!content.checkboxOptional ? { required: false } : []), { disabled: ((_b = states.registrationFormState) === null || _b === void 0 ? void 0 : _b.loading) || ((_c = states.registrationFormState) === null || _c === void 0 ? void 0 : _c.disabled), required: false }), intl.formatMessage({
2141
+ id: content.checkboxName + "-message",
2142
+ defaultMessage: content.checkboxLabel,
2143
+ }, {
2144
+ labelLink: (h("a", { href: content.checkboxLabelLink, target: "_blank" }, content.checkboxLabelLinkText || content.checkboxLabelLink)),
2145
+ }))));
2553
2146
  }
2554
2147
 
2555
- const vanillaStyle$3 = `
2148
+ const style$6 = {
2149
+ HostBlock: HostBlock,
2150
+ couponCodeLabel: {
2151
+ margin: "var(--sl-spacing-x-small) 0",
2152
+ color: "var(--sl-color-gray-500)",
2153
+ fontSize: "var(--sl-font-size-small)",
2154
+ },
2155
+ };
2156
+ const vanillaStyle$2 = `
2556
2157
  :host{
2557
- margin: 0 auto;
2158
+ display: block;
2558
2159
  width: 100%;
2559
2160
  }
2560
- a{
2561
- cursor:pointer;
2562
- color: inherit;
2563
- text-decoration: none;
2564
- }
2565
2161
  `;
2566
- function PortalFooterView(props) {
2567
- const style = {
2568
- RowContainer: {
2569
- display: "flex",
2570
- "& > :not(:last-child)": {
2571
- "margin-right": "var(--sl-spacing-large)",
2572
- },
2162
+ const sheet$6 = createStyleSheet(style$6);
2163
+ const styleString$6 = sheet$6.toString();
2164
+ function CouponCodeView(props) {
2165
+ const error = !props.loading && props.error;
2166
+ return (h("div", null,
2167
+ h("style", { type: "text/css" },
2168
+ styleString$6,
2169
+ vanillaStyle$2),
2170
+ h("p", { class: sheet$6.classes.couponCodeLabel, style: { textAlign: props.textAlign } }, props.couponCodeLabel),
2171
+ error ? (h("sqm-form-message", { type: props.errorType, exportparts: "erroralert-icon" },
2172
+ h("div", { part: "erroralert-text" }, props.errorText))) : (h(CopyTextView, Object.assign({}, props)))));
2173
+ }
2174
+
2175
+ const style$7 = {
2176
+ ErrorStyle: {
2177
+ "--sl-input-border-color": "var(--sl-color-danger-500)",
2178
+ "--sl-input-background-color": "var(--sl-color-danger-10)",
2179
+ "--sl-input-border-color-focus": "var(--sl-color-danger-500)",
2180
+ "--sl-input-border-color-hover": "var(--sl-color-danger-500)",
2181
+ },
2182
+ ErrorMessageStyle: {
2183
+ margin: 0,
2184
+ color: "var(--sl-color-danger-500)",
2185
+ fontSize: "var(--sl-input-help-text-font-size-medium)",
2186
+ },
2187
+ FieldContainer: {
2188
+ "margin-bottom": "var(--sl-spacing-large)",
2189
+ },
2190
+ };
2191
+ const vanillaStyle$3 = `
2192
+ :host {
2193
+ margin: 0 auto;
2194
+ width: 100%;
2195
+ display: block;
2196
+ }
2197
+ sl-select::part(label){
2198
+ font-size: var(--sl-input-label-font-size-small);
2199
+ font-weight: var(--sl-font-weight-semibold);
2200
+ }
2201
+ `;
2202
+ jss.setup(create());
2203
+ const sheet$7 = jss.createStyleSheet(style$7);
2204
+ const styleString$7 = sheet$7.toString();
2205
+ function DropdownFieldView(props) {
2206
+ var _a, _b, _c, _d, _e, _f, _g;
2207
+ const { states, content } = props;
2208
+ const validationErrors = (_a = states === null || states === void 0 ? void 0 : states.registrationFormState) === null || _a === void 0 ? void 0 : _a.validationErrors;
2209
+ return (h("div", { class: sheet$7.classes.FieldContainer, part: "sqm-base" },
2210
+ h("style", { type: "text/css" },
2211
+ vanillaStyle$3,
2212
+ styleString$7),
2213
+ h("sl-select", Object.assign({ exportparts: "label: input-label, base: input-base", label: content.dropdownLabel, name: `/${content.dropdownName}` }, (!content.dropdownOptional ? { required: true } : []), { disabled: ((_b = states.registrationFormState) === null || _b === void 0 ? void 0 : _b.loading) || ((_c = states.registrationFormState) === null || _c === void 0 ? void 0 : _c.disabled) }, (((_e = (_d = states.registrationFormState) === null || _d === void 0 ? void 0 : _d.initialData) === null || _e === void 0 ? void 0 : _e[content.dropdownName]) ? {
2214
+ value: (_g = (_f = states.registrationFormState) === null || _f === void 0 ? void 0 : _f.initialData) === null || _g === void 0 ? void 0 : _g[content.dropdownName],
2215
+ }
2216
+ : {}), ((validationErrors === null || validationErrors === void 0 ? void 0 : validationErrors[content.dropdownName]) ? {
2217
+ class: sheet$7.classes.ErrorStyle,
2218
+ }
2219
+ : [])), content.selectOptions),
2220
+ (validationErrors === null || validationErrors === void 0 ? void 0 : validationErrors[content.dropdownName]) && (h("p", { class: sheet$7.classes.ErrorMessageStyle }, intl.formatMessage({
2221
+ id: `errorMessage-${content.dropdownName}`,
2222
+ defaultMessage: content.errorMessage,
2223
+ })))));
2224
+ }
2225
+
2226
+ const EditProfileView = (props) => {
2227
+ var _a, _b, _c, _d;
2228
+ const { states, callbacks } = props;
2229
+ const { text } = states;
2230
+ const { errors } = states.formState;
2231
+ if (states.showEdit) {
2232
+ return (h("div", { class: `CardWrapper ${!states.showEdit && "ShowEdit"}`, part: "sqm-base" },
2233
+ h("h2", { part: "sqm-header", style: {
2234
+ fontSize: "var(--sl-font-size-x-large)",
2235
+ margin: "0px",
2236
+ textAlign: "center",
2237
+ } }, text.editprofileheader),
2238
+ h("form", { class: "FormWrapper", onSubmit: callbacks.onSubmit },
2239
+ h("div", { class: "FormSection" },
2240
+ states.formState.error && (h("sqm-form-message", { type: "error", exportparts: "erroralert-icon" },
2241
+ h("div", { part: "erroralert-text" }, states.formState.error))),
2242
+ h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", value: states.formState.firstName, onInput: callbacks.onChange, label: text.firstnametext, disabled: states.loading }, (errors.firstName && errors.firstName.status !== "valid"
2243
+ ? { class: "ErrorStyles", helpText: text.fieldEmptyText }
2244
+ : []), { id: "firstName", name: "firstName", error: errors.firstName && errors.firstName.status !== "valid"
2245
+ ? errors.firstName.message
2246
+ : undefined })),
2247
+ h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", value: states.formState.lastName, onInput: callbacks.onChange, label: text.lastnametext, disabled: states.loading, id: "lastName", name: "lastName" }, (errors.lastName && errors.lastName.status !== "valid"
2248
+ ? { class: "ErrorStyles", helpText: text.fieldEmptyText }
2249
+ : []), { error: errors.lastName && errors.lastName.status !== "valid"
2250
+ ? errors.lastName.message
2251
+ : undefined }))),
2252
+ text.showregion && states.formState.currentRegion && (h("sl-input", { exportparts: "label: input-label, base: input-base", disabled: true, value: states.formState.currentRegion, label: text.currentregiontext, id: "currentRegion", name: "currentRegion" })),
2253
+ h("div", { class: "ButtonWrapper" },
2254
+ h("sl-button", { type: "primary", loading: states.loading, disabled: states.submitDisabled, onClick: (e) => {
2255
+ callbacks.onSubmit(e);
2256
+ }, submit: true, exportparts: "base: primarybutton-base" }, text.updatetext),
2257
+ h("sl-button", { onClick: () => {
2258
+ callbacks.setShowEdit(false);
2259
+ }, exportparts: "base: defaultbutton-base" }, text.canceltext)))));
2260
+ }
2261
+ return (h("div", { class: `CardWrapper FormWrapper ${!states.showEdit && "ShowEdit"}`, part: "sqm-base" },
2262
+ h("div", { class: "FormSection" },
2263
+ h("h2", { part: "sqm-header", style: {
2264
+ fontSize: "var(--sl-font-size-x-large)",
2265
+ marginBottom: "0px",
2266
+ textAlign: "center",
2267
+ } }, text.editprofileheader),
2268
+ h("div", null,
2269
+ h("p", { style: { fontSize: "var(--sl-font-size-medium)" } }, (_a = states.user) === null || _a === void 0 ? void 0 :
2270
+ _a.firstName,
2271
+ " ", (_b = states.user) === null || _b === void 0 ? void 0 :
2272
+ _b.lastName),
2273
+ h("p", { style: { fontSize: "var(--sl-font-size-medium)" }, title: (_c = states.user) === null || _c === void 0 ? void 0 : _c.email }, (_d = states.user) === null || _d === void 0 ? void 0 : _d.email))),
2274
+ h("sl-button", { type: "primary", loading: states.loading, onClick: () => {
2275
+ callbacks.resetForm();
2276
+ callbacks.setShowEdit(true);
2277
+ }, exportparts: "base: primarybutton-base" }, text.editprofiletext)));
2278
+ };
2279
+
2280
+ const style$8 = {
2281
+ Leaderboard: {
2282
+ "& table": {
2283
+ width: "100%",
2284
+ borderCollapse: "collapse",
2573
2285
  },
2574
- Container: {
2575
- display: "flex",
2576
- "flex-direction": "column",
2577
- "align-items": "center",
2578
- "font-size": "var(--sl-font-size-small)",
2579
- color: "var(--sl-color-gray-600)",
2580
- "padding-top": `var(--sl-spacing-${props.paddingTop})`,
2581
- "padding-right": `var(--sl-spacing-${props.paddingRight})`,
2582
- "padding-bottom": `var(--sl-spacing-${props.paddingBottom})`,
2583
- "padding-left": `var(--sl-spacing-${props.paddingLeft})`,
2584
- "row-gap": `var(--sl-spacing-small)`,
2585
- "& a:hover": {
2586
- color: "var(--sl-color-gray-900)",
2587
- },
2286
+ "& th": {
2287
+ textAlign: "left",
2288
+ padding: "var(--sl-spacing-medium)",
2289
+ paddingTop: "0",
2290
+ fontSize: "var(--sl-font-size-medium)",
2291
+ fontWeight: "var(--sl-font-weight-semibold)",
2588
2292
  },
2589
- SupportText: {
2590
- textAlign: "center",
2591
- margin: 0,
2293
+ "& tr:not(:first-child)": {
2294
+ borderTop: "1px solid var(--sl-color-neutral-200)",
2592
2295
  },
2593
- PoweredByLink: {
2594
- color: "var(--sl-color-gray-400)",
2595
- "font-size": "var(--sl-font-size-small)",
2596
- display: "flex",
2597
- alignItems: "center",
2598
- svg: {
2599
- marginTop: "2px",
2600
- shapeRendering: "geometricprecision",
2601
- },
2602
- "&:hover, &:hover *": {
2603
- color: "var(--sl-color-gray-900)",
2604
- },
2296
+ "& td": {
2297
+ fontSize: "var(--sl-font-size-medium)",
2298
+ fontWeight: "var(--sl-font-weight-normal)",
2299
+ },
2300
+ "& .ellipses": {
2301
+ textAlign: "left",
2302
+ padding: "0",
2303
+ color: "var(--sl-color-neutral-500)",
2304
+ paddingLeft: "25%",
2305
+ },
2306
+ "& .highlight": {
2307
+ background: "var(--sl-color-primary-50)",
2308
+ },
2309
+ "& td, th": {
2310
+ color: "var(--sl-color-gray-800)",
2311
+ padding: "var(--sl-spacing-medium)",
2312
+ },
2313
+ "& .User": {
2314
+ width: "100%",
2315
+ },
2316
+ "& .Score": {
2317
+ width: "auto",
2318
+ whiteSpace: "nowrap",
2319
+ },
2320
+ "& .Rank": {
2321
+ whiteSpace: "nowrap",
2322
+ },
2323
+ "& .fullWidth": {
2324
+ width: "100%",
2605
2325
  },
2326
+ },
2327
+ };
2328
+ const sheet$8 = createStyleSheet(style$8);
2329
+ const styleString$8 = sheet$8.toString();
2330
+ const vanillaStyle$4 = `
2331
+ :host{
2332
+ display: block;
2333
+ }
2334
+ `;
2335
+ function LeaderboardView(props) {
2336
+ var _a, _b, _c;
2337
+ const { states, data, elements } = props;
2338
+ const { styles } = states;
2339
+ if (states.isEssentials) {
2340
+ return (h("sqm-empty", { "empty-state-image": "https://res.cloudinary.com/saasquatch/image/upload/v1715360191/squatch-assets/Leaderboard_Not_Available.svg", "empty-state-header": "Leaderboards aren\u2019t available on your plan", "empty-state-text": "Contact {supportText} to upgrade your plan and start leveraging gamification in your program.", "support-text": "Support" }));
2341
+ }
2342
+ if (states.loading) {
2343
+ return (h("div", { class: sheet$8.classes.Leaderboard, style: { width: styles.width || "100%" } },
2344
+ h("style", { type: "text/css" },
2345
+ styleString$8,
2346
+ vanillaStyle$4),
2347
+ h("table", null, [...Array(10)].map(() => {
2348
+ return (h("tr", null,
2349
+ h("td", null,
2350
+ h("sl-skeleton", null))));
2351
+ }))));
2352
+ }
2353
+ if (!states.hasLeaders)
2354
+ return elements.empty;
2355
+ let userSeenFlag = false;
2356
+ const getUsersName = (user) => {
2357
+ if (!user.firstName && !user.lastInitial)
2358
+ return styles.anonymousUser;
2359
+ const { firstName, lastInitial } = user;
2360
+ if (firstName && lastInitial)
2361
+ return `${firstName} ${lastInitial}`;
2362
+ if (firstName || lastInitial)
2363
+ return firstName || lastInitial;
2364
+ return styles.anonymousUser;
2606
2365
  };
2607
- const sheet = createStyleSheet(style);
2608
- const styleString = sheet.toString();
2609
- return (h("div", { class: sheet.classes.Container, part: "sqm-base" },
2366
+ const getRankCellText = (userRank, isViewingUsersRow) => {
2367
+ if (!userRank) {
2368
+ return styles.hideNames ? `${styles.viewingUserText}` : "-";
2369
+ }
2370
+ const viewingUserText = ` - ${styles.viewingUserText}`;
2371
+ return styles.rankSuffix
2372
+ ? intl.formatMessage({
2373
+ id: "rank",
2374
+ defaultMessage: styles.rankSuffix,
2375
+ }, {
2376
+ rank: userRank,
2377
+ }) + `${isViewingUsersRow && styles.hideNames ? viewingUserText : ""}`
2378
+ : `${userRank} ${isViewingUsersRow && styles.hideNames ? viewingUserText : ""}`;
2379
+ };
2380
+ return (h("div", { class: sheet$8.classes.Leaderboard, part: "sqm-base", style: { width: styles.width || "100%" } },
2610
2381
  h("style", { type: "text/css" },
2611
- vanillaStyle$3,
2612
- styleString),
2613
- h("div", { class: sheet.classes.RowContainer },
2614
- props.faqLink && (h("a", { target: "_blank", href: props.faqLink }, props.faqText)),
2615
- props.termsLink && (h("a", { target: "_blank", href: props.termsLink }, props.termsText))),
2616
- !props.hideSupportText && (h("p", { class: sheet.classes.SupportText }, intl.formatMessage({
2617
- id: "supportFooter",
2618
- defaultMessage: props.supportText,
2619
- }, {
2620
- email: (h("a", { target: "_blank", href: `mailto:${props.supportEmail}` }, props.supportEmail)),
2621
- }))),
2622
- !props.hidePoweredBy && (h("a", { class: sheet.classes.PoweredByLink, target: "_blank", href: props.poweredByLink },
2623
- "Powered by ",
2624
- h(PoweredByImg, { color: "currentColor" })))));
2382
+ styleString$8,
2383
+ vanillaStyle$4),
2384
+ h("table", { part: "sqm-table" },
2385
+ h("tr", null,
2386
+ styles.showRank && (h("th", { class: `Rank ${styles.hideNames ? "fullWidth" : ""}` }, styles.rankheading)),
2387
+ !styles.hideNames && h("th", { class: "User" }, styles.usersheading),
2388
+ h("th", { class: "Score" }, styles.statsheading)), (_a = data.leaderboard) === null || _a === void 0 ? void 0 :
2389
+ _a.map((user) => {
2390
+ var _a, _b;
2391
+ if (user.rowNumber === ((_a = data.viewerRank) === null || _a === void 0 ? void 0 : _a.rowNumber))
2392
+ userSeenFlag = true;
2393
+ const isViewingUsersRow = !styles.hideViewer && user.rowNumber === ((_b = data.viewerRank) === null || _b === void 0 ? void 0 : _b.rowNumber);
2394
+ return (h("tr", { class: isViewingUsersRow ? "highlight" : "" },
2395
+ styles.showRank && (h("td", { class: "Rank" }, getRankCellText(user.rank, isViewingUsersRow))),
2396
+ !styles.hideNames && h("td", { class: "User" }, getUsersName(user)),
2397
+ h("td", { class: "Score" }, user.textValue)));
2398
+ }),
2399
+ !userSeenFlag && !styles.hideViewer && (h("tr", null,
2400
+ h("td", { colSpan: 100, class: "ellipses" },
2401
+ h("sl-icon", { name: "three-dots", style: { verticalAlign: "middle" } })))),
2402
+ !userSeenFlag && !styles.hideViewer && (h("tr", { class: "highlight" },
2403
+ styles.showRank && (h("td", { class: "Rank" }, getRankCellText((_b = data.viewerRank) === null || _b === void 0 ? void 0 : _b.rank, true))),
2404
+ !styles.hideNames && (h("td", { class: "User" }, getUsersName(data.viewerRank || {}))),
2405
+ h("td", { class: "Score" }, ((_c = data.viewerRank) === null || _c === void 0 ? void 0 : _c.textValue) || "0"))))));
2625
2406
  }
2626
2407
 
2627
2408
  const paddingList = [
@@ -2707,49 +2488,297 @@ function HeroView(props) {
2707
2488
  "&:last-of-type": {
2708
2489
  background: `no-repeat center/cover ${parseBackground(states.secondaryBackground)}`,
2709
2490
  },
2710
- "@media screen and (min-width: 1023px)": { flex: "1 1 0" },
2711
- minHeight: `${states.minHeight}px`,
2712
- display: "block",
2491
+ "@media screen and (min-width: 1023px)": { flex: "1 1 0" },
2492
+ minHeight: `${states.minHeight}px`,
2493
+ display: "block",
2494
+ },
2495
+ SingleColumnContainer: {
2496
+ background: `no-repeat center/cover ${parseBackground(states.background)}`,
2497
+ minHeight: `${states.minHeight}px`,
2498
+ },
2499
+ Container: {
2500
+ width: "100%",
2501
+ maxWidth: "var(--sqm-max-width)",
2502
+ margin: "0 auto",
2503
+ flex: 1,
2504
+ display: "flex",
2505
+ flexDirection: "column",
2506
+ minHeight: "100%",
2507
+ },
2508
+ };
2509
+ const sheet = createStyleSheet(style);
2510
+ const styleString = sheet.toString();
2511
+ const vanillaStyle = `
2512
+ :host{
2513
+ height: 100%;
2514
+ display: contents;
2515
+ }
2516
+ sqm-hero{
2517
+ height: 100%;
2518
+ display: contents;
2519
+ }
2520
+ img{
2521
+ max-width: 100%;
2522
+ height: auto;
2523
+ }
2524
+
2525
+ `;
2526
+ // NOTE: Spacing on the columns is controlled on the slots itself. For example using inline styling
2527
+ return (h("div", { class: sheet.classes.Container, part: "sqm-base" },
2528
+ h("style", { type: "text/css" },
2529
+ vanillaStyle,
2530
+ styleString),
2531
+ states.columns == 2 ? (h("div", { class: sheet.classes.TwoColumnContainer, part: "sqm-two-col-container" },
2532
+ h("div", { part: "sqm-two-col-primary-col", class: `${sheet.classes.ColumnWrapper} ${sheet.classes.ColumnPadding}` }, content.primaryColumn),
2533
+ h("div", { part: "sqm-two-col-secondary-col", class: `${sheet.classes.ColumnWrapper} ${sheet.classes.ColumnPadding}` }, content.secondaryColumn))) : (h("div", { part: "sqm-single-col", class: `${sheet.classes.SingleColumnContainer} ${sheet.classes.ColumnPadding}` }, content.primaryColumn))));
2534
+ }
2535
+
2536
+ const style$9 = {
2537
+ ErrorStyle: ErrorStyles,
2538
+ FieldContainer: {
2539
+ "margin-bottom": "var(--sl-spacing-large)",
2540
+ },
2541
+ };
2542
+ const vanillaStyle$5 = `
2543
+ :host {
2544
+ margin: 0 auto;
2545
+ width: 100%;
2546
+ display: block;
2547
+ }
2548
+ `;
2549
+ jss.setup(create());
2550
+ const sheet$9 = jss.createStyleSheet(style$9);
2551
+ const styleString$9 = sheet$9.toString();
2552
+ function InputFieldView(props) {
2553
+ var _a, _b, _c, _d, _e, _f, _g;
2554
+ const { states, content } = props;
2555
+ const validationErrors = (_a = states === null || states === void 0 ? void 0 : states.registrationFormState) === null || _a === void 0 ? void 0 : _a.validationErrors;
2556
+ return (h("div", { class: sheet$9.classes.FieldContainer, part: "sqm-base" },
2557
+ h("style", { type: "text/css" },
2558
+ vanillaStyle$5,
2559
+ styleString$9),
2560
+ h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", name: `/${content.fieldName}`, type: content.fieldType, label: content.fieldLabel }, (!content.fieldOptional ? { required: true } : []), { disabled: ((_b = states.registrationFormState) === null || _b === void 0 ? void 0 : _b.loading) || ((_c = states.registrationFormState) === null || _c === void 0 ? void 0 : _c.disabled) }, (((_e = (_d = states.registrationFormState) === null || _d === void 0 ? void 0 : _d.initialData) === null || _e === void 0 ? void 0 : _e[content.fieldName]) ? {
2561
+ value: (_g = (_f = states.registrationFormState) === null || _f === void 0 ? void 0 : _f.initialData) === null || _g === void 0 ? void 0 : _g[content.fieldName],
2562
+ }
2563
+ : {}), ((validationErrors === null || validationErrors === void 0 ? void 0 : validationErrors[content.fieldName]) ? {
2564
+ class: sheet$9.classes.ErrorStyle,
2565
+ helpText: intl.formatMessage({
2566
+ id: `errorMessage-${content.fieldName}`,
2567
+ defaultMessage: content.errorMessage || (validationErrors === null || validationErrors === void 0 ? void 0 : validationErrors[content.fieldName]),
2568
+ }),
2569
+ }
2570
+ : [])))));
2571
+ }
2572
+
2573
+ const style$a = {
2574
+ ErrorStyle: ErrorStyles,
2575
+ FieldsContainer: {
2576
+ "& sl-input": {
2577
+ "margin-bottom": "var(--sl-spacing-large)",
2578
+ },
2579
+ },
2580
+ };
2581
+ const vanillaStyle$6 = `
2582
+ :host {
2583
+ margin: 0 auto;
2584
+ width: 100%;
2585
+ display: block;
2586
+ }
2587
+
2588
+ sl-input::part(label){
2589
+ font-size: var(--sl-input-label-font-size-small);
2590
+ font-weight: var(--sl-font-weight-semibold);
2591
+ }
2592
+ `;
2593
+ const sheet$a = createStyleSheet(style$a);
2594
+ const styleString$a = sheet$a.toString();
2595
+ function NameFieldsView(props) {
2596
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
2597
+ const { states } = props;
2598
+ const validationErrors = (_a = states === null || states === void 0 ? void 0 : states.registrationFormState) === null || _a === void 0 ? void 0 : _a.validationErrors;
2599
+ return (h("div", { class: sheet$a.classes.FieldsContainer },
2600
+ h("style", { type: "text/css" },
2601
+ vanillaStyle$6,
2602
+ styleString$a),
2603
+ h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", name: "/firstName", type: "text", label: states.content.firstNameLabel, required: true, disabled: ((_b = states.registrationFormState) === null || _b === void 0 ? void 0 : _b.loading) || ((_c = states.registrationFormState) === null || _c === void 0 ? void 0 : _c.disabled) }, (((_e = (_d = states.registrationFormState) === null || _d === void 0 ? void 0 : _d.initialData) === null || _e === void 0 ? void 0 : _e.firstName) ? {
2604
+ value: (_g = (_f = states.registrationFormState) === null || _f === void 0 ? void 0 : _f.initialData) === null || _g === void 0 ? void 0 : _g.firstName,
2605
+ }
2606
+ : {}), ((validationErrors === null || validationErrors === void 0 ? void 0 : validationErrors.firstName) ? {
2607
+ class: sheet$a.classes.ErrorStyle,
2608
+ helpText: (validationErrors === null || validationErrors === void 0 ? void 0 : validationErrors.firstName) || "Cannot be empty",
2609
+ }
2610
+ : []))),
2611
+ h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", name: "/lastName", type: "text", label: states.content.lastNameLabel, required: true, disabled: ((_h = states.registrationFormState) === null || _h === void 0 ? void 0 : _h.loading) || ((_j = states.registrationFormState) === null || _j === void 0 ? void 0 : _j.disabled) }, (((_l = (_k = states.registrationFormState) === null || _k === void 0 ? void 0 : _k.initialData) === null || _l === void 0 ? void 0 : _l.lastName) ? {
2612
+ value: (_o = (_m = states.registrationFormState) === null || _m === void 0 ? void 0 : _m.initialData) === null || _o === void 0 ? void 0 : _o.lastName,
2613
+ }
2614
+ : {}), ((validationErrors === null || validationErrors === void 0 ? void 0 : validationErrors.lastName) ? {
2615
+ class: sheet$a.classes.ErrorStyle,
2616
+ helpText: (validationErrors === null || validationErrors === void 0 ? void 0 : validationErrors.lastName) || "Cannot be empty",
2617
+ }
2618
+ : [])))));
2619
+ }
2620
+
2621
+ function ChangeMarktingView(props) {
2622
+ const { states, callbacks } = props;
2623
+ const { text, formState } = states;
2624
+ const { error } = formState;
2625
+ const style = {
2626
+ Container: {
2627
+ display: "flex",
2628
+ flexDirection: "column",
2629
+ gap: "var(--sl-spacing-x-small)",
2630
+ padding: "0 var(--sl-spacing-xxx-large) var(--sl-spacing-xxx-large)",
2631
+ },
2632
+ SubmitButton: { marginBottom: "var(--sl-spacing-medium)" },
2633
+ Error: {
2634
+ "&::part(erroralert-base)": {
2635
+ "margin-bottom": "15px",
2636
+ },
2637
+ },
2638
+ Success: {
2639
+ "&::part(successalert-base)": {
2640
+ "margin-bottom": "15px",
2641
+ },
2642
+ },
2643
+ };
2644
+ const sheet = createStyleSheet(style);
2645
+ const styleString = sheet.toString();
2646
+ return (h("div", { class: sheet.classes.Container, part: "sqm-base" },
2647
+ h("style", { type: "text/css" }, styleString),
2648
+ h(TextSpanView, Object.assign({}, { type: "h2" }), text.emailPreferencesHeader),
2649
+ h("sl-form", { "onSl-submit": callbacks.onSubmit },
2650
+ h(CheckboxFieldView, { states: {
2651
+ checked: states.formState.marketingEmailOptIn,
2652
+ }, content: {
2653
+ checkboxLabel: text.marketingCheckboxLabel,
2654
+ checkboxName: "marketingEmailOptIn",
2655
+ }, callbacks: {
2656
+ setChecked: callbacks.setChecked,
2657
+ } }),
2658
+ h("sl-button", { class: sheet.classes.SubmitButton, type: "primary", submit: true, loading: states.loading, disabled: states.submitDisabled }, text.submitChangeButtonText),
2659
+ error && (h("sqm-form-message", { class: sheet.classes.Error, type: "error", exportparts: "erroralert-icon" },
2660
+ h("div", { part: "erroralert-text" }, error))),
2661
+ states.success && (h("sqm-form-message", { class: sheet.classes.Success, type: "success", exportparts: "successalert-icon" },
2662
+ h("div", { part: "successalert-text" }, states.text.successMessage))))));
2663
+ }
2664
+
2665
+ const vanillaStyle$7 = `
2666
+ :host{
2667
+ margin: 0 auto;
2668
+ width: 100%;
2669
+ }
2670
+ a{
2671
+ cursor:pointer;
2672
+ color: inherit;
2673
+ text-decoration: none;
2674
+ }
2675
+ `;
2676
+ function PortalFooterView(props) {
2677
+ const style = {
2678
+ RowContainer: {
2679
+ display: "flex",
2680
+ "& > :not(:last-child)": {
2681
+ "margin-right": "var(--sl-spacing-large)",
2682
+ },
2683
+ },
2684
+ Container: {
2685
+ display: "flex",
2686
+ "flex-direction": "column",
2687
+ "align-items": "center",
2688
+ "font-size": "var(--sl-font-size-small)",
2689
+ color: "var(--sl-color-gray-600)",
2690
+ "padding-top": `var(--sl-spacing-${props.paddingTop})`,
2691
+ "padding-right": `var(--sl-spacing-${props.paddingRight})`,
2692
+ "padding-bottom": `var(--sl-spacing-${props.paddingBottom})`,
2693
+ "padding-left": `var(--sl-spacing-${props.paddingLeft})`,
2694
+ "row-gap": `var(--sl-spacing-small)`,
2695
+ "& a:hover": {
2696
+ color: "var(--sl-color-gray-900)",
2697
+ },
2713
2698
  },
2714
- SingleColumnContainer: {
2715
- background: `no-repeat center/cover ${parseBackground(states.background)}`,
2716
- minHeight: `${states.minHeight}px`,
2699
+ SupportText: {
2700
+ textAlign: "center",
2701
+ margin: 0,
2717
2702
  },
2718
- Container: {
2719
- width: "100%",
2720
- maxWidth: "var(--sqm-max-width)",
2721
- margin: "0 auto",
2722
- flex: 1,
2703
+ PoweredByLink: {
2704
+ color: "var(--sl-color-gray-400)",
2705
+ "font-size": "var(--sl-font-size-small)",
2723
2706
  display: "flex",
2724
- flexDirection: "column",
2725
- minHeight: "100%",
2707
+ alignItems: "center",
2708
+ svg: {
2709
+ marginTop: "2px",
2710
+ shapeRendering: "geometricprecision",
2711
+ },
2712
+ "&:hover, &:hover *": {
2713
+ color: "var(--sl-color-gray-900)",
2714
+ },
2726
2715
  },
2727
2716
  };
2728
2717
  const sheet = createStyleSheet(style);
2729
2718
  const styleString = sheet.toString();
2730
- const vanillaStyle = `
2731
- :host{
2732
- height: 100%;
2733
- display: contents;
2734
- }
2735
- sqm-hero{
2736
- height: 100%;
2737
- display: contents;
2738
- }
2739
- img{
2740
- max-width: 100%;
2741
- height: auto;
2742
- }
2743
-
2744
- `;
2745
- // NOTE: Spacing on the columns is controlled on the slots itself. For example using inline styling
2746
2719
  return (h("div", { class: sheet.classes.Container, part: "sqm-base" },
2747
2720
  h("style", { type: "text/css" },
2748
- vanillaStyle,
2721
+ vanillaStyle$7,
2749
2722
  styleString),
2750
- states.columns == 2 ? (h("div", { class: sheet.classes.TwoColumnContainer, part: "sqm-two-col-container" },
2751
- h("div", { part: "sqm-two-col-primary-col", class: `${sheet.classes.ColumnWrapper} ${sheet.classes.ColumnPadding}` }, content.primaryColumn),
2752
- h("div", { part: "sqm-two-col-secondary-col", class: `${sheet.classes.ColumnWrapper} ${sheet.classes.ColumnPadding}` }, content.secondaryColumn))) : (h("div", { part: "sqm-single-col", class: `${sheet.classes.SingleColumnContainer} ${sheet.classes.ColumnPadding}` }, content.primaryColumn))));
2723
+ h("div", { class: sheet.classes.RowContainer },
2724
+ props.faqLink && (h("a", { target: "_blank", href: props.faqLink }, props.faqText)),
2725
+ props.termsLink && (h("a", { target: "_blank", href: props.termsLink }, props.termsText))),
2726
+ !props.hideSupportText && (h("p", { class: sheet.classes.SupportText }, intl.formatMessage({
2727
+ id: "supportFooter",
2728
+ defaultMessage: props.supportText,
2729
+ }, {
2730
+ email: (h("a", { target: "_blank", href: `mailto:${props.supportEmail}` }, props.supportEmail)),
2731
+ }))),
2732
+ !props.hidePoweredBy && (h("a", { class: sheet.classes.PoweredByLink, target: "_blank", href: props.poweredByLink },
2733
+ "Powered by ",
2734
+ h(PoweredByImg, { color: "currentColor" })))));
2735
+ }
2736
+
2737
+ const style$b = {
2738
+ HostBlock: HostBlock,
2739
+ Frame: {
2740
+ display: "flex",
2741
+ "flex-direction": "column",
2742
+ "box-sizing": "border-box",
2743
+ },
2744
+ FooterWrapper: {
2745
+ width: "100%",
2746
+ "max-width": "100%",
2747
+ padding: "var(--sl-spacing-medium) var(--sl-spacing-x-large)",
2748
+ background: "var(--sqm-footer-background)",
2749
+ display: "flex",
2750
+ "justify-content": "flex-end",
2751
+ "align-items": "center",
2752
+ "box-sizing": "border-box",
2753
+ "margin-top": "auto",
2754
+ },
2755
+ HeaderWrapper: {
2756
+ width: "100%",
2757
+ "max-width": "100%",
2758
+ "box-sizing": "border-box",
2759
+ display: "flex",
2760
+ "justify-content": "space-between",
2761
+ padding: "var(--sl-spacing-small) var(--sl-spacing-large)",
2762
+ "align-items": "center",
2763
+ "background-color": "var(--sqm-header-background)",
2764
+ "@media screen and (max-width: 499px)": {
2765
+ "flex-direction": "row-reverse",
2766
+ "justify-content": "flex-end",
2767
+ padding: "0",
2768
+ },
2769
+ },
2770
+ };
2771
+ const sheet$b = createStyleSheet(style$b);
2772
+ const styleString$b = sheet$b.toString();
2773
+ function PortalFrameView(props, children) {
2774
+ const { data, notFullScreen } = props;
2775
+ return (h("div", { style: { minHeight: notFullScreen ? "100%" : "100vh" }, class: sheet$b.classes.Frame, part: "sqm-base" },
2776
+ h("style", { type: "text/css" }, styleString$b),
2777
+ h("div", { class: sheet$b.classes.HeaderWrapper, part: "sqm-header" },
2778
+ data.header,
2779
+ h("slot", { name: "sqm-navigation-menu" })),
2780
+ children,
2781
+ h("div", { class: sheet$b.classes.FooterWrapper, part: "sqm-footer" }, data.footer)));
2753
2782
  }
2754
2783
 
2755
2784
  function ReferralIframeView(props) {
@@ -2780,142 +2809,6 @@ function ReferralIframeView(props) {
2780
2809
  h("iframe", { class: sheet.classes.IFrame, src: `${content.iframeSrc}?rsCode=${data.shareCode}` })));
2781
2810
  }
2782
2811
 
2783
- const style$8 = {
2784
- ErrorStyle: ErrorStyles,
2785
- FieldsContainer: {
2786
- "& sl-input": {
2787
- "margin-bottom": "var(--sl-spacing-large)",
2788
- },
2789
- },
2790
- };
2791
- const vanillaStyle$4 = `
2792
- :host {
2793
- margin: 0 auto;
2794
- width: 100%;
2795
- display: block;
2796
- }
2797
-
2798
- sl-input::part(label){
2799
- font-size: var(--sl-input-label-font-size-small);
2800
- font-weight: var(--sl-font-weight-semibold);
2801
- }
2802
- `;
2803
- const sheet$8 = createStyleSheet(style$8);
2804
- const styleString$8 = sheet$8.toString();
2805
- function NameFieldsView(props) {
2806
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
2807
- const { states } = props;
2808
- const validationErrors = (_a = states === null || states === void 0 ? void 0 : states.registrationFormState) === null || _a === void 0 ? void 0 : _a.validationErrors;
2809
- return (h("div", { class: sheet$8.classes.FieldsContainer },
2810
- h("style", { type: "text/css" },
2811
- vanillaStyle$4,
2812
- styleString$8),
2813
- h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", name: "/firstName", type: "text", label: states.content.firstNameLabel, required: true, disabled: ((_b = states.registrationFormState) === null || _b === void 0 ? void 0 : _b.loading) || ((_c = states.registrationFormState) === null || _c === void 0 ? void 0 : _c.disabled) }, (((_e = (_d = states.registrationFormState) === null || _d === void 0 ? void 0 : _d.initialData) === null || _e === void 0 ? void 0 : _e.firstName) ? {
2814
- value: (_g = (_f = states.registrationFormState) === null || _f === void 0 ? void 0 : _f.initialData) === null || _g === void 0 ? void 0 : _g.firstName,
2815
- }
2816
- : {}), ((validationErrors === null || validationErrors === void 0 ? void 0 : validationErrors.firstName) ? {
2817
- class: sheet$8.classes.ErrorStyle,
2818
- helpText: (validationErrors === null || validationErrors === void 0 ? void 0 : validationErrors.firstName) || "Cannot be empty",
2819
- }
2820
- : []))),
2821
- h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", name: "/lastName", type: "text", label: states.content.lastNameLabel, required: true, disabled: ((_h = states.registrationFormState) === null || _h === void 0 ? void 0 : _h.loading) || ((_j = states.registrationFormState) === null || _j === void 0 ? void 0 : _j.disabled) }, (((_l = (_k = states.registrationFormState) === null || _k === void 0 ? void 0 : _k.initialData) === null || _l === void 0 ? void 0 : _l.lastName) ? {
2822
- value: (_o = (_m = states.registrationFormState) === null || _m === void 0 ? void 0 : _m.initialData) === null || _o === void 0 ? void 0 : _o.lastName,
2823
- }
2824
- : {}), ((validationErrors === null || validationErrors === void 0 ? void 0 : validationErrors.lastName) ? {
2825
- class: sheet$8.classes.ErrorStyle,
2826
- helpText: (validationErrors === null || validationErrors === void 0 ? void 0 : validationErrors.lastName) || "Cannot be empty",
2827
- }
2828
- : [])))));
2829
- }
2830
-
2831
- const style$9 = {
2832
- ErrorStyle: {
2833
- "--sl-input-border-color": "var(--sl-color-danger-500)",
2834
- "--sl-input-background-color": "var(--sl-color-danger-10)",
2835
- "--sl-input-border-color-focus": "var(--sl-color-danger-500)",
2836
- "--sl-input-border-color-hover": "var(--sl-color-danger-500)",
2837
- },
2838
- ErrorMessageStyle: {
2839
- margin: 0,
2840
- color: "var(--sl-color-danger-500)",
2841
- fontSize: "var(--sl-input-help-text-font-size-medium)",
2842
- },
2843
- FieldContainer: {
2844
- "margin-bottom": "var(--sl-spacing-large)",
2845
- },
2846
- };
2847
- const vanillaStyle$5 = `
2848
- :host {
2849
- margin: 0 auto;
2850
- width: 100%;
2851
- display: block;
2852
- }
2853
- sl-select::part(label){
2854
- font-size: var(--sl-input-label-font-size-small);
2855
- font-weight: var(--sl-font-weight-semibold);
2856
- }
2857
- `;
2858
- jss.setup(create());
2859
- const sheet$9 = jss.createStyleSheet(style$9);
2860
- const styleString$9 = sheet$9.toString();
2861
- function DropdownFieldView(props) {
2862
- var _a, _b, _c, _d, _e, _f, _g;
2863
- const { states, content } = props;
2864
- const validationErrors = (_a = states === null || states === void 0 ? void 0 : states.registrationFormState) === null || _a === void 0 ? void 0 : _a.validationErrors;
2865
- return (h("div", { class: sheet$9.classes.FieldContainer, part: "sqm-base" },
2866
- h("style", { type: "text/css" },
2867
- vanillaStyle$5,
2868
- styleString$9),
2869
- h("sl-select", Object.assign({ exportparts: "label: input-label, base: input-base", label: content.dropdownLabel, name: `/${content.dropdownName}` }, (!content.dropdownOptional ? { required: true } : []), { disabled: ((_b = states.registrationFormState) === null || _b === void 0 ? void 0 : _b.loading) || ((_c = states.registrationFormState) === null || _c === void 0 ? void 0 : _c.disabled) }, (((_e = (_d = states.registrationFormState) === null || _d === void 0 ? void 0 : _d.initialData) === null || _e === void 0 ? void 0 : _e[content.dropdownName]) ? {
2870
- value: (_g = (_f = states.registrationFormState) === null || _f === void 0 ? void 0 : _f.initialData) === null || _g === void 0 ? void 0 : _g[content.dropdownName],
2871
- }
2872
- : {}), ((validationErrors === null || validationErrors === void 0 ? void 0 : validationErrors[content.dropdownName]) ? {
2873
- class: sheet$9.classes.ErrorStyle,
2874
- }
2875
- : [])), content.selectOptions),
2876
- (validationErrors === null || validationErrors === void 0 ? void 0 : validationErrors[content.dropdownName]) && (h("p", { class: sheet$9.classes.ErrorMessageStyle }, intl.formatMessage({
2877
- id: `errorMessage-${content.dropdownName}`,
2878
- defaultMessage: content.errorMessage,
2879
- })))));
2880
- }
2881
-
2882
- const style$a = {
2883
- ErrorStyle: ErrorStyles,
2884
- FieldContainer: {
2885
- "margin-bottom": "var(--sl-spacing-large)",
2886
- },
2887
- };
2888
- const vanillaStyle$6 = `
2889
- :host {
2890
- margin: 0 auto;
2891
- width: 100%;
2892
- display: block;
2893
- }
2894
- `;
2895
- jss.setup(create());
2896
- const sheet$a = jss.createStyleSheet(style$a);
2897
- const styleString$a = sheet$a.toString();
2898
- function InputFieldView(props) {
2899
- var _a, _b, _c, _d, _e, _f, _g;
2900
- const { states, content } = props;
2901
- const validationErrors = (_a = states === null || states === void 0 ? void 0 : states.registrationFormState) === null || _a === void 0 ? void 0 : _a.validationErrors;
2902
- return (h("div", { class: sheet$a.classes.FieldContainer, part: "sqm-base" },
2903
- h("style", { type: "text/css" },
2904
- vanillaStyle$6,
2905
- styleString$a),
2906
- h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", name: `/${content.fieldName}`, type: content.fieldType, label: content.fieldLabel }, (!content.fieldOptional ? { required: true } : []), { disabled: ((_b = states.registrationFormState) === null || _b === void 0 ? void 0 : _b.loading) || ((_c = states.registrationFormState) === null || _c === void 0 ? void 0 : _c.disabled) }, (((_e = (_d = states.registrationFormState) === null || _d === void 0 ? void 0 : _d.initialData) === null || _e === void 0 ? void 0 : _e[content.fieldName]) ? {
2907
- value: (_g = (_f = states.registrationFormState) === null || _f === void 0 ? void 0 : _f.initialData) === null || _g === void 0 ? void 0 : _g[content.fieldName],
2908
- }
2909
- : {}), ((validationErrors === null || validationErrors === void 0 ? void 0 : validationErrors[content.fieldName]) ? {
2910
- class: sheet$a.classes.ErrorStyle,
2911
- helpText: intl.formatMessage({
2912
- id: `errorMessage-${content.fieldName}`,
2913
- defaultMessage: content.errorMessage || (validationErrors === null || validationErrors === void 0 ? void 0 : validationErrors[content.fieldName]),
2914
- }),
2915
- }
2916
- : [])))));
2917
- }
2918
-
2919
2812
  const CheckMark = () => (h("svg", { width: 12, height: 10, fill: "none", xmlns: "http://www.w3.org/2000/svg" },
2920
2813
  h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M11.58.23c.475.371.56 1.057.19 1.532L5.69 9.554a1.091 1.091 0 0 1-1.631.1L.32 5.915a1.09 1.09 0 1 1 1.542-1.542L4.73 7.239 10.049.42A1.09 1.09 0 0 1 11.58.23Z", fill: "#fff" })));
2921
2814
  const CheckmarkFilled = () => (h("svg", { width: "18", height: "18", viewBox: "0 0 18 18", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
@@ -3002,7 +2895,7 @@ function ProgressBar({ stageCount, currentStage, }) {
3002
2895
  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, stage: stage })))));
3003
2896
  }
3004
2897
 
3005
- const style$b = {
2898
+ const style$c = {
3006
2899
  HostBlock: HostBlock,
3007
2900
  Container: {
3008
2901
  minWidth: "300px",
@@ -3353,8 +3246,8 @@ const style$b = {
3353
3246
  },
3354
3247
  };
3355
3248
  // JSS config
3356
- const sheet$b = createStyleSheet(style$b);
3357
- const styleString$b = sheet$b.toString();
3249
+ const sheet$c = createStyleSheet(style$c);
3250
+ const styleString$c = sheet$c.toString();
3358
3251
  const stageList = ["chooseReward", "chooseAmount", "confirmation", "success"];
3359
3252
  function RewardExchangeView(props) {
3360
3253
  const { states, data, callbacks, refs } = props;
@@ -3377,7 +3270,7 @@ function RewardExchangeView(props) {
3377
3270
  sourceUnit: item.sourceUnit,
3378
3271
  })));
3379
3272
  }
3380
- return (h("sl-select", { style: { width: "auto" }, label: (_b = states === null || states === void 0 ? void 0 : states.content) === null || _b === void 0 ? void 0 : _b.text.selectText, class: sheet$b.classes.Select, value: states.selectedStep, "onSl-select": (e) => {
3273
+ return (h("sl-select", { style: { width: "auto" }, label: (_b = states === null || states === void 0 ? void 0 : states.content) === null || _b === void 0 ? void 0 : _b.text.selectText, class: sheet$c.classes.Select, value: states.selectedStep, "onSl-select": (e) => {
3381
3274
  var _a, _b, _c, _d, _e;
3382
3275
  return callbacks.setExchangeState({
3383
3276
  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,
@@ -3385,7 +3278,7 @@ function RewardExchangeView(props) {
3385
3278
  });
3386
3279
  } }, (_c = item.steps) === null || _c === void 0 ? void 0 : _c.map((step) => {
3387
3280
  var _a, _b;
3388
- return (h("sl-menu-item", { value: step, disabled: !step.available, class: sheet$b.classes.SelectItem },
3281
+ return (h("sl-menu-item", { value: step, disabled: !step.available, class: sheet$c.classes.SelectItem },
3389
3282
  step.prettyDestinationValue,
3390
3283
  h("br", null),
3391
3284
  h("div", { class: "step-cost", slot: "suffix" },
@@ -3404,8 +3297,8 @@ function RewardExchangeView(props) {
3404
3297
  var _a;
3405
3298
  return [
3406
3299
  h("div", { part: "choose-reward-container" },
3407
- h("div", { class: sheet$b.classes.Title }, states.content.text.rewardTitle),
3408
- states.loading || states.queryError ? (loading()) : (h("div", { class: sheet$b.classes.Grid }, (_a = data.exchangeList) === null || _a === void 0 ? void 0 : _a.map((item) => {
3300
+ h("div", { class: sheet$c.classes.Title }, states.content.text.rewardTitle),
3301
+ states.loading || states.queryError ? (loading()) : (h("div", { class: sheet$c.classes.Grid }, (_a = data.exchangeList) === null || _a === void 0 ? void 0 : _a.map((item) => {
3409
3302
  var _a, _b, _c, _d, _e;
3410
3303
  const style = {
3411
3304
  boxShadow: item.key === (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.key)
@@ -3414,7 +3307,7 @@ function RewardExchangeView(props) {
3414
3307
  borderRadius: "4px",
3415
3308
  };
3416
3309
  return (h("div", { key: item.key, style: style },
3417
- h("sl-card", { exportparts: "base: exchange-card-container", class: sheet$b.classes.Card, style: {
3310
+ h("sl-card", { exportparts: "base: exchange-card-container", class: sheet$c.classes.Card, style: {
3418
3311
  cursor: item.unavailableReasonCode
3419
3312
  ? "not-allowed"
3420
3313
  : "pointer",
@@ -3431,14 +3324,14 @@ function RewardExchangeView(props) {
3431
3324
  ? "rgba(0, 0, 0, 0.05)"
3432
3325
  : "rgba(0, 0, 0, 0)",
3433
3326
  } },
3434
- h("div", { class: sheet$b.classes.Image, style: {
3327
+ h("div", { class: sheet$c.classes.Image, style: {
3435
3328
  opacity: item.unavailableReasonCode ? "0.5" : "1",
3436
3329
  } },
3437
3330
  h("img", { class: item.unavailableReasonCode
3438
3331
  ? "image subdued"
3439
3332
  : "image", src: (item === null || item === void 0 ? void 0 : item.imageUrl) ||
3440
3333
  getAssetPath("./assets/Reward-image.png") })),
3441
- h("div", { class: sheet$b.classes.TextArea, style: {
3334
+ h("div", { class: sheet$c.classes.TextArea, style: {
3442
3335
  opacity: item.unavailableReasonCode ? "0.5" : "1",
3443
3336
  } },
3444
3337
  h("div", { class: "title", style: {
@@ -3471,7 +3364,7 @@ function RewardExchangeView(props) {
3471
3364
  item.prettySourceMinValue,
3472
3365
  }))))))));
3473
3366
  }))),
3474
- h("div", { class: sheet$b.classes.Button },
3367
+ h("div", { class: sheet$c.classes.Button },
3475
3368
  h("sl-button", { exportparts: "base: primarybutton-base", class: "continue right", size: "large", onClick: () => callbacks.setStage("chooseAmount"), loading: states.loading, disabled: !states.selectedItem }, states.content.text.continueText))),
3476
3369
  ];
3477
3370
  }
@@ -3482,7 +3375,7 @@ function RewardExchangeView(props) {
3482
3375
  ? false
3483
3376
  : input && !states.amount;
3484
3377
  return (h("div", null,
3485
- h("div", { class: sheet$b.classes.ChooseAmount, part: "choose-amount-container" },
3378
+ h("div", { class: sheet$c.classes.ChooseAmount, part: "choose-amount-container" },
3486
3379
  h("div", { class: "wrapper" },
3487
3380
  h("img", { class: "image", src: (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.imageUrl) ||
3488
3381
  getAssetPath("./assets/Reward-image.png") }),
@@ -3491,7 +3384,7 @@ function RewardExchangeView(props) {
3491
3384
  ((_c = states.selectedItem) === null || _c === void 0 ? void 0 : _c.ruleType) === "FIXED_GLOBAL_REWARD" ? (h("div", { class: "points" }, input)) : (h("div", { class: "description" }, selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.description)),
3492
3385
  ((_d = states.selectedItem) === null || _d === void 0 ? void 0 : _d.ruleType) === "FIXED_GLOBAL_REWARD" ? (h("div", { class: "description" }, selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.description)) : (h("div", null, input)),
3493
3386
  h("div", { class: "space" }))),
3494
- h("div", { class: sheet$b.classes.Button },
3387
+ h("div", { class: sheet$c.classes.Button },
3495
3388
  h("sl-button", { exportparts: "base: secondarybutton-base", class: "cancel", size: "large", type: "text", onClick: () => callbacks.resetState() }, states.content.text.cancelText),
3496
3389
  h("sl-button", { exportparts: "base: primarybutton-base", class: "continue", size: "large", onClick: () => callbacks.setStage("confirmation"), disabled: isDisabled }, states.content.text.continueToConfirmationText)))));
3497
3390
  }
@@ -3499,8 +3392,8 @@ function RewardExchangeView(props) {
3499
3392
  const cost = (selectedStep === null || selectedStep === void 0 ? void 0 : selectedStep.prettySourceValue) || selectedItem.prettySourceValue;
3500
3393
  const amount = selectedStep === null || selectedStep === void 0 ? void 0 : selectedStep.prettyDestinationValue;
3501
3394
  return (h("div", null,
3502
- h("div", { class: sheet$b.classes.Confirmation, part: "confirmation-container" },
3503
- h("div", { class: sheet$b.classes.Title }, states.content.text.redeemTitle),
3395
+ h("div", { class: sheet$c.classes.Confirmation, part: "confirmation-container" },
3396
+ h("div", { class: sheet$c.classes.Title }, states.content.text.redeemTitle),
3504
3397
  h("div", { class: "wrapper" },
3505
3398
  h("div", { class: "field" }, states.content.text.rewardNameTitle),
3506
3399
  h("div", { class: "reward-item-container" },
@@ -3515,13 +3408,13 @@ function RewardExchangeView(props) {
3515
3408
  h("div", { class: "wrapper top-border padding" },
3516
3409
  h("div", { class: "field" }, states.content.text.costTitle),
3517
3410
  h("div", { class: "value" }, cost)),
3518
- h("div", { class: sheet$b.classes.Button },
3411
+ h("div", { class: sheet$c.classes.Button },
3519
3412
  h("sl-button", { class: "cancel", type: "text", size: "large", onClick: () => callbacks.setStage("chooseAmount") }, states.content.text.backText),
3520
3413
  h("sl-button", { class: "continue", size: "large", loading: states.loading, onClick: callbacks.exchangeReward }, states.content.text.redeemText)))));
3521
3414
  }
3522
3415
  function success() {
3523
3416
  var _a, _b, _c, _d, _e, _f;
3524
- return (h("div", { class: sheet$b.classes.Success, part: "success-container" },
3417
+ return (h("div", { class: sheet$c.classes.Success, part: "success-container" },
3525
3418
  h(Gift$1, null),
3526
3419
  h(Confetti, null),
3527
3420
  h("div", { class: "title" }, (_a = states.content.text) === null || _a === void 0 ? void 0 : _a.rewardRedeemedText),
@@ -3536,7 +3429,7 @@ function RewardExchangeView(props) {
3536
3429
  (data === null || data === void 0 ? void 0 : data.fuelTankCode) && (h("div", { class: "promo" },
3537
3430
  states.content.text.promoCode,
3538
3431
  h(CopyTextView, { copyString: data.fuelTankCode, tooltiptext: (_f = states === null || states === void 0 ? void 0 : states.content) === null || _f === void 0 ? void 0 : _f.text.tooltipText, open: states.open, onClick: callbacks.copyFuelTankCode }))),
3539
- h("div", { class: sheet$b.classes.Button },
3432
+ h("div", { class: sheet$c.classes.Button },
3540
3433
  h("sl-button", { class: "continue center", type: "primary", size: "large", onClick: () => callbacks.resetState(true) }, states.content.text.doneText))));
3541
3434
  }
3542
3435
  const stages = {
@@ -3548,7 +3441,7 @@ function RewardExchangeView(props) {
3548
3441
  const currentStage = stages[states.redeemStage];
3549
3442
  function stageMap() {
3550
3443
  const stageNumber = stageList.indexOf(states.redeemStage);
3551
- return (h("div", { class: sheet$b.classes.ProgressBar },
3444
+ return (h("div", { class: sheet$c.classes.ProgressBar },
3552
3445
  h("div", { class: "text-area" }, Object.keys(stageProgressList).map((stage) => {
3553
3446
  if (stageList.indexOf(stage) <= stageNumber) {
3554
3447
  return h("span", { class: "text" }, stageProgressList[stage]);
@@ -3560,10 +3453,10 @@ function RewardExchangeView(props) {
3560
3453
  h(ProgressBar, { stageCount: 3, currentStage: stageNumber })));
3561
3454
  }
3562
3455
  function loading() {
3563
- return (h("div", { class: sheet$b.classes.Grid, part: "loading-container" }, [...Array(states.content.text.skeletonCardNum)].map(() => {
3456
+ return (h("div", { class: sheet$c.classes.Grid, part: "loading-container" }, [...Array(states.content.text.skeletonCardNum)].map(() => {
3564
3457
  return (h("div", null,
3565
- h("sl-card", { class: sheet$b.classes.Card },
3566
- h("div", { class: sheet$b.classes.CardLayout },
3458
+ h("sl-card", { class: sheet$c.classes.Card },
3459
+ h("div", { class: sheet$c.classes.CardLayout },
3567
3460
  h("div", null,
3568
3461
  h("sl-skeleton", { style: {
3569
3462
  width: "100px",
@@ -3595,12 +3488,12 @@ function RewardExchangeView(props) {
3595
3488
  if (!(refs === null || refs === void 0 ? void 0 : refs.canvasRef))
3596
3489
  return;
3597
3490
  refs.canvasRef.current = canvas;
3598
- }, id: "my-canvas", class: sheet$b.classes.Confetti }));
3491
+ }, id: "my-canvas", class: sheet$c.classes.Confetti }));
3599
3492
  }
3600
3493
  if (states.noExchangeOptions)
3601
3494
  return states.content.text.empty;
3602
- return (h("div", { class: sheet$b.classes.Container, part: "sqm-base" },
3603
- h("style", { type: "text/css" }, styleString$b),
3495
+ return (h("div", { class: sheet$c.classes.Container, part: "sqm-base" },
3496
+ h("style", { type: "text/css" }, styleString$c),
3604
3497
  h("div", null,
3605
3498
  stageMap(),
3606
3499
  states.exchangeError && errorMessage(),
@@ -3984,64 +3877,205 @@ const successVariable = {
3984
3877
  }, baseStep(20, "$", 40, "Points")),
3985
3878
  };
3986
3879
  const loading = {
3987
- ...baseResponse(null, "chooseReward", null, null, false, true),
3988
- };
3989
- const empty = {
3990
- ...baseResponse(null, "chooseReward", null, null, false, false, null, true),
3991
- };
3992
-
3993
- function CardFeedView(props, children) {
3994
- // Dependent on props, not feasiable to move out
3995
- const style = {
3996
- Container: {
3997
- columnGap: props.gap + "px",
3998
- columnWidth: props.width + "px",
3999
- "& > div": {
4000
- marginBottom: "24px",
4001
- },
4002
- },
3880
+ ...baseResponse(null, "chooseReward", null, null, false, true),
3881
+ };
3882
+ const empty = {
3883
+ ...baseResponse(null, "chooseReward", null, null, false, false, null, true),
3884
+ };
3885
+
3886
+ const MessageLinkQuery = dist.gql `
3887
+ query (
3888
+ $programId: ID
3889
+ $engagementMedium: UserEngagementMedium!
3890
+ $shareMedium: ReferralShareMedium!
3891
+ ) {
3892
+ viewer {
3893
+ ... on User {
3894
+ messageLink(
3895
+ programId: $programId
3896
+ engagementMedium: $engagementMedium
3897
+ shareMedium: $shareMedium
3898
+ )
3899
+ shareLink(programId: $programId, engagementMedium: $engagementMedium)
3900
+ }
3901
+ }
3902
+ }
3903
+ `;
3904
+ function NativeShare(props, directLink, undefinedErrorText, unsupportedPlatformText) {
3905
+ const title = props.sharetitle || "Share title";
3906
+ const text = props.sharetext || "Share text";
3907
+ if (directLink === "undefined") {
3908
+ return alert(undefinedErrorText);
3909
+ }
3910
+ if (window.navigator.share) {
3911
+ window.navigator
3912
+ .share({
3913
+ title,
3914
+ text,
3915
+ url: directLink,
3916
+ })
3917
+ .catch((error) => console.error("Error on web share", error));
3918
+ }
3919
+ else {
3920
+ alert(unsupportedPlatformText);
3921
+ }
3922
+ }
3923
+ function FacebookShare(directLink, messageLink, errorText) {
3924
+ if (messageLink === "undefined" || directLink === "undefined") {
3925
+ return alert(errorText);
3926
+ }
3927
+ if (typeof SquatchAndroid.shareOnFacebook !== "undefined") {
3928
+ return SquatchAndroid.shareOnFacebook(directLink, messageLink);
3929
+ }
3930
+ else {
3931
+ return GenericShare(messageLink, errorText);
3932
+ }
3933
+ }
3934
+ function GenericShare(messageLink, errorText) {
3935
+ return messageLink ? (window.location.href = messageLink) : alert(errorText);
3936
+ }
3937
+ function useShareButton(props) {
3938
+ var _a, _b, _c, _d;
3939
+ const { sharetitle, sharetext, medium } = props;
3940
+ const programId = props.programId ? props.programId : H();
3941
+ const user = J();
3942
+ const engagementMedium = B();
3943
+ const variables = {
3944
+ engagementMedium,
3945
+ programId: programId,
3946
+ shareMedium: medium.toUpperCase(),
4003
3947
  };
4004
- const sheet = createStyleSheet(style);
4005
- const styleString = sheet.toString();
4006
- const vanillaStyle = `
4007
- :host{
4008
- display: block;
3948
+ const contextData = Fn(REFERRAL_CODES_NAMESPACE);
3949
+ const overrideData = contextData === null || contextData === void 0 ? void 0 : contextData[medium];
3950
+ // only queries if a programId is available
3951
+ const res = wn(MessageLinkQuery, variables, !(user === null || user === void 0 ? void 0 : user.jwt) || !programId || overrideData !== undefined);
3952
+ const [setCopied, copiedRes] = $e(SET_CODE_COPIED);
3953
+ const directLink = (overrideData === null || overrideData === void 0 ? void 0 : overrideData.shareLink) || ((_b = (_a = res === null || res === void 0 ? void 0 : res.data) === null || _a === void 0 ? void 0 : _a.viewer) === null || _b === void 0 ? void 0 : _b.shareLink);
3954
+ const environment = getEnvironmentSDK();
3955
+ const hide = (medium.toLocaleUpperCase() === "SMS" &&
3956
+ window.orientation === undefined) ||
3957
+ (medium.toLocaleUpperCase() === "DIRECT" && !window.navigator.share);
3958
+ const messageLink = (overrideData === null || overrideData === void 0 ? void 0 : overrideData.messageLink) || ((_d = (_c = res.data) === null || _c === void 0 ? void 0 : _c.viewer) === null || _d === void 0 ? void 0 : _d.messageLink);
3959
+ async function onClick() {
3960
+ if (overrideData) {
3961
+ await setCopied({ referralCode: contextData.referralCode });
3962
+ contextData.refresh();
4009
3963
  }
4010
-
4011
- `;
4012
- return (h("div", null,
4013
- h("style", { type: "text/css" },
4014
- styleString,
4015
- vanillaStyle),
4016
- h("div", { class: sheet.classes.Container, part: "sqm-base" }, children)));
3964
+ if (medium.toLocaleUpperCase() === "FACEBOOK" &&
3965
+ environment.type === "SquatchAndroid") {
3966
+ FacebookShare(directLink, messageLink, props.errorText);
3967
+ }
3968
+ else if (medium.toLocaleUpperCase() === "DIRECT") {
3969
+ NativeShare({ sharetitle, sharetext }, directLink, props.errorText, props.unsupportedPlatformText);
3970
+ }
3971
+ }
3972
+ const isPlainLink = !(medium.toLocaleUpperCase() === "FACEBOOK" &&
3973
+ environment.type === "SquatchAndroid") &&
3974
+ medium.toLocaleUpperCase() !== "DIRECT" &&
3975
+ messageLink;
3976
+ const userAgent = window.navigator.userAgent.toLowerCase(), safari = /safari/.test(userAgent), ios = /iphone|ipod|ipad/.test(userAgent);
3977
+ const openInSameTab = ios && !safari;
3978
+ return {
3979
+ ...props,
3980
+ loading: res.loading && !(overrideData === null || overrideData === void 0 ? void 0 : overrideData.messageLink),
3981
+ messageLink,
3982
+ isPlainLink,
3983
+ onClick,
3984
+ openInSameTab,
3985
+ hide,
3986
+ };
4017
3987
  }
4018
3988
 
4019
- const style$c = {
4020
- HostBlock: HostBlock,
4021
- couponCodeLabel: {
4022
- margin: "var(--sl-spacing-x-small) 0",
4023
- color: "var(--sl-color-gray-500)",
4024
- fontSize: "var(--sl-font-size-small)",
4025
- },
4026
- };
4027
- const vanillaStyle$7 = `
4028
- :host{
4029
- display: block;
4030
- width: 100%;
3989
+ const MessageLinkQuery$1 = dist.gql `
3990
+ query ($programId: ID, $engagementMedium: UserEngagementMedium!) {
3991
+ user: viewer {
3992
+ ... on User {
3993
+ shareLink(
3994
+ programId: $programId
3995
+ engagementMedium: $engagementMedium
3996
+ shareMedium: DIRECT
3997
+ )
3998
+ }
3999
+ }
4031
4000
  }
4032
4001
  `;
4033
- const sheet$c = createStyleSheet(style$c);
4034
- const styleString$c = sheet$c.toString();
4035
- function CouponCodeView(props) {
4036
- const error = !props.loading && props.error;
4037
- return (h("div", null,
4038
- h("style", { type: "text/css" },
4039
- styleString$c,
4040
- vanillaStyle$7),
4041
- h("p", { class: sheet$c.classes.couponCodeLabel, style: { textAlign: props.textAlign } }, props.couponCodeLabel),
4042
- error ? (h("sqm-form-message", { type: props.errorType, exportparts: "erroralert-icon" },
4043
- h("div", { part: "erroralert-text" }, props.errorText))) : (h(CopyTextView, Object.assign({}, props)))));
4002
+ const WIDGET_ENGAGEMENT_EVENT = dist.gql `
4003
+ mutation loadEvent($eventMeta: UserAnalyticsEvent!) {
4004
+ createUserAnalyticsEvent(eventMeta: $eventMeta)
4005
+ }
4006
+ `;
4007
+ function useShareLink(props) {
4008
+ var _a, _b;
4009
+ const { programId = H() } = props;
4010
+ const user = J();
4011
+ const engagementMedium = B();
4012
+ const contextData = Fn(REFERRAL_CODES_NAMESPACE);
4013
+ const { data } = wn(MessageLinkQuery$1, { programId, engagementMedium }, !(user === null || user === void 0 ? void 0 : user.jwt) || !!props.linkOverride || (contextData === null || contextData === void 0 ? void 0 : contextData.shareLink) !== undefined);
4014
+ const [sendLoadEvent] = $e(WIDGET_ENGAGEMENT_EVENT);
4015
+ const [setCopied, copiedRes] = $e(SET_CODE_COPIED);
4016
+ const copyString = (_b = ((contextData === null || contextData === void 0 ? void 0 : contextData.shareLink) || ((_a = data === null || data === void 0 ? void 0 : data.user) === null || _a === void 0 ? void 0 : _a.shareLink))) !== null && _b !== void 0 ? _b :
4017
+ // Shown during loading
4018
+ "...";
4019
+ const [open, setOpen] = useState(false);
4020
+ async function onClick() {
4021
+ if (contextData) {
4022
+ await setCopied({ referralCode: contextData.referralCode });
4023
+ contextData.refresh();
4024
+ }
4025
+ // Should well supported: https://developer.mozilla.org/en-US/docs/Web/API/Clipboard#browser_compatibility
4026
+ // Only if called from a user-initiated event
4027
+ navigator.clipboard.writeText(copyString);
4028
+ setOpen(true);
4029
+ setTimeout(() => setOpen(false), props.tooltiplifespan);
4030
+ sendLoadEvent({
4031
+ eventMeta: {
4032
+ programId,
4033
+ id: user === null || user === void 0 ? void 0 : user.id,
4034
+ accountId: user === null || user === void 0 ? void 0 : user.accountId,
4035
+ type: "USER_REFERRAL_PROGRAM_ENGAGEMENT_EVENT",
4036
+ meta: {
4037
+ engagementMedium,
4038
+ shareMedium: "DIRECT",
4039
+ },
4040
+ },
4041
+ });
4042
+ }
4043
+ return { ...props, onClick, open, copyString: copyString };
4044
+ }
4045
+
4046
+ const map = new Map();
4047
+ function withShadowView(component) {
4048
+ // TODO: Could only do this if rendered in a Stencilbook environment to prevent unintended side-effects
4049
+ const element = getElement(component);
4050
+ let renderFn = component["render"].bind(component);
4051
+ const newRenderFn = () => {
4052
+ const key = element.getAttribute("stencilbook-shadow-view");
4053
+ if (key) {
4054
+ const value = map.get(key);
4055
+ if (value) {
4056
+ return value;
4057
+ }
4058
+ }
4059
+ return renderFn();
4060
+ };
4061
+ component["render"] = newRenderFn;
4044
4062
  }
4063
+ /**
4064
+ * Any story that defines `parameters.tagname` will be used as a wrapper component around the view
4065
+ */
4066
+ const ShadowViewAddon = ({ story }, children) => {
4067
+ var _a;
4068
+ let TagName = (_a = story.parent.parameters) === null || _a === void 0 ? void 0 : _a.tagname;
4069
+ if (!TagName)
4070
+ return children;
4071
+ const randomInt = Math.round(Math.random() * 100000);
4072
+ map.set(randomInt + "", children);
4073
+ const RandomTagName = "stencilbook-shawdow-view-" + randomInt;
4074
+ // This will only re-render when the tag name changes, so we use a random tag name every time.
4075
+ // Altneratively we could try to trick Stencil to call `forceUpdate` every time.
4076
+ return (h(RandomTagName, null,
4077
+ h(TagName, { "stencilbook-shadow-view": randomInt })));
4078
+ };
4045
4079
 
4046
4080
  function t(t,n,r){return Math.min(Math.max(t,r),n)}class n extends Error{constructor(t){super(`Failed to parse color: "${t}"`);}}function r(r){if("string"!=typeof r)throw new n(r);if("transparent"===r.trim().toLowerCase())return [0,0,0,0];let e=r.trim();e=u.test(r)?function(t){const r=t.toLowerCase().trim(),e=o[function(t){let n=5381,r=t.length;for(;r;)n=33*n^t.charCodeAt(--r);return (n>>>0)%2341}(r)];if(!e)throw new n(t);return `#${e}`}(r):r;const f=s.exec(e);if(f){const t=Array.from(f).slice(1);return [...t.slice(0,3).map(t=>parseInt(_(t,2),16)),parseInt(_(t[3]||"f",2),16)/255]}const p=i.exec(e);if(p){const t=Array.from(p).slice(1);return [...t.slice(0,3).map(t=>parseInt(t,16)),parseInt(t[3]||"ff",16)/255]}const z=a.exec(e);if(z){const t=Array.from(z).slice(1);return [...t.slice(0,3).map(t=>parseInt(t,10)),parseFloat(t[3]||"1")]}const h=c.exec(e);if(h){const[e,o,_,s]=Array.from(h).slice(1).map(parseFloat);if(t(0,100,o)!==o)throw new n(r);if(t(0,100,_)!==_)throw new n(r);return [...l(e,o,_),s||1]}throw new n(r)}const e=t=>parseInt(t.replace(/_/g,""),36),o="1q29ehhb 1n09sgk7 1kl1ekf_ _yl4zsno 16z9eiv3 1p29lhp8 _bd9zg04 17u0____ _iw9zhe5 _to73___ _r45e31e _7l6g016 _jh8ouiv _zn3qba8 1jy4zshs 11u87k0u 1ro9yvyo 1aj3xael 1gz9zjz0 _3w8l4xo 1bf1ekf_ _ke3v___ _4rrkb__ 13j776yz _646mbhl _nrjr4__ _le6mbhl 1n37ehkb _m75f91n _qj3bzfz 1939yygw 11i5z6x8 _1k5f8xs 1509441m 15t5lwgf _ae2th1n _tg1ugcv 1lp1ugcv 16e14up_ _h55rw7n _ny9yavn _7a11xb_ 1ih442g9 _pv442g9 1mv16xof 14e6y7tu 1oo9zkds 17d1cisi _4v9y70f _y98m8kc 1019pq0v 12o9zda8 _348j4f4 1et50i2o _8epa8__ _ts6senj 1o350i2o 1mi9eiuo 1259yrp0 1ln80gnw _632xcoy 1cn9zldc _f29edu4 1n490c8q _9f9ziet 1b94vk74 _m49zkct 1kz6s73a 1eu9dtog _q58s1rz 1dy9sjiq __u89jo3 _aj5nkwg _ld89jo3 13h9z6wx _qa9z2ii _l119xgq _bs5arju 1hj4nwk9 1qt4nwk9 1ge6wau6 14j9zlcw 11p1edc_ _ms1zcxe _439shk6 _jt9y70f _754zsow 1la40eju _oq5p___ _x279qkz 1fa5r3rv _yd2d9ip _424tcku _8y1di2_ _zi2uabw _yy7rn9h 12yz980_ __39ljp6 1b59zg0x _n39zfzp 1fy9zest _b33k___ _hp9wq92 1il50hz4 _io472ub _lj9z3eo 19z9ykg0 _8t8iu3a 12b9bl4a 1ak5yw0o _896v4ku _tb8k8lv _s59zi6t _c09ze0p 1lg80oqn 1id9z8wb _238nba5 1kq6wgdi _154zssg _tn3zk49 _da9y6tc 1sg7cv4f _r12jvtt 1gq5fmkz 1cs9rvci _lp9jn1c _xw1tdnb 13f9zje6 16f6973h _vo7ir40 _bt5arjf _rc45e4t _hr4e100 10v4e100 _hc9zke2 _w91egv_ _sj2r1kk 13c87yx8 _vqpds__ _ni8ggk8 _tj9yqfb 1ia2j4r4 _7x9b10u 1fc9ld4j 1eq9zldr _5j9lhpx _ez9zl6o _md61fzm".split(" ").reduce((t,n)=>{const r=e(n.substring(0,3)),o=e(n.substring(3)).toString(16);let _="";for(let t=0;t<6-o.length;t++)_+="0";return t[r]=`${_}${o}`,t},{}),_=(t,n)=>Array.from(Array(n)).map(()=>t).join(""),s=new RegExp(`^#${_("([a-f0-9])",3)}([a-f0-9])?$`,"i"),i=new RegExp(`^#${_("([a-f0-9]{2})",3)}([a-f0-9]{2})?$`,"i"),a=new RegExp(`^rgba?\\(\\s*(\\d+)\\s*${_(",\\s*(\\d+)\\s*",2)}(?:,\\s*([\\d.]+))?\\s*\\)$`,"i"),c=/^hsla?\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%(?:\s*,\s*([\d.]+))?\s*\)$/i,u=/^[a-z]+$/i,f=t=>Math.round(255*t),l=(t,n,r)=>{let e=r/100;if(0===n)return [e,e,e].map(f);const o=(t%360+360)%360/60,_=(1-Math.abs(2*e-1))*(n/100),s=_*(1-Math.abs(o%2-1));let i=0,a=0,c=0;o>=0&&o<1?(i=_,a=s):o>=1&&o<2?(i=s,a=_):o>=2&&o<3?(a=_,c=s):o>=3&&o<4?(a=s,c=_):o>=4&&o<5?(i=s,c=_):o>=5&&o<6&&(i=_,c=s);const u=e-_/2;return [i+u,a+u,c+u].map(f)};function p(t){const[n,e,o,_]=r(t).map((t,n)=>3===n?t:t/255),s=Math.max(n,e,o),i=Math.min(n,e,o),a=(s+i)/2;if(s===i)return [0,0,a,_];const c=s-i;return [60*(n===s?(e-o)/c+(e<o?6:0):e===s?(o-n)/c+2:(n-e)/c+4),a>.5?c/(2-s-i):c/(s+i),a,_]}function z(n,r,e,o){return `hsla(${(n%360).toFixed()}, ${t(0,100,100*r).toFixed()}%, ${t(0,100,100*e).toFixed()}%, ${parseFloat(t(0,1,o).toFixed(3))})`}
4047
4081
 
@@ -4094,38 +4128,4 @@ function autoColorScaleCss(color, name = "primary") {
4094
4128
  return generateScale(color, name).join("\n");
4095
4129
  }
4096
4130
 
4097
- const map = new Map();
4098
- function withShadowView(component) {
4099
- // TODO: Could only do this if rendered in a Stencilbook environment to prevent unintended side-effects
4100
- const element = getElement(component);
4101
- let renderFn = component["render"].bind(component);
4102
- const newRenderFn = () => {
4103
- const key = element.getAttribute("stencilbook-shadow-view");
4104
- if (key) {
4105
- const value = map.get(key);
4106
- if (value) {
4107
- return value;
4108
- }
4109
- }
4110
- return renderFn();
4111
- };
4112
- component["render"] = newRenderFn;
4113
- }
4114
- /**
4115
- * Any story that defines `parameters.tagname` will be used as a wrapper component around the view
4116
- */
4117
- const ShadowViewAddon = ({ story }, children) => {
4118
- var _a;
4119
- let TagName = (_a = story.parent.parameters) === null || _a === void 0 ? void 0 : _a.tagname;
4120
- if (!TagName)
4121
- return children;
4122
- const randomInt = Math.round(Math.random() * 100000);
4123
- map.set(randomInt + "", children);
4124
- const RandomTagName = "stencilbook-shawdow-view-" + randomInt;
4125
- // This will only re-render when the tag name changes, so we use a random tag name every time.
4126
- // Altneratively we could try to trick Stencil to call `forceUpdate` every time.
4127
- return (h(RandomTagName, null,
4128
- h(TagName, { "stencilbook-shadow-view": randomInt })));
4129
- };
4130
-
4131
- export { loading as A, BigStatView as B, ChangeMarktingView as C, DropdownFieldView as D, EditProfileView as E, empty as F, rewardExchange as G, HeroView as H, InputFieldView as I, CardFeedView as J, CouponCodeView as K, LeaderboardView as L, ProgressBar as M, NameFieldsView as N, autoColorScaleCss as O, PortalFrameView as P, ShadowViewAddon as Q, ReferralIframeView as R, ShareButtonView as S, TaskCardView as T, useBigStat as U, withShadowView as V, demoRewardExchange as W, useShareButton as a, useDemoBigStat as b, StatContainerView as c, PortalChangePasswordView as d, PortalRegisterView as e, ProgressBarView as f, PoweredByImg as g, PortalFooterView as h, CheckboxFieldView as i, RewardExchangeView as j, rewardExchangeLongText as k, rewardExchangeSelected as l, chooseAmountFixed as m, chooseAmountFixedNoDescription as n, chooseAmountVariable as o, chooseAmountVariableNoDescription as p, chooseAmountVariableDisabled as q, rewardExchangeCustomErrorMsg as r, chooseAmountVariableUnavailable as s, confirmFixed as t, useShareLink as u, confirmVariable as v, redemptionError as w, queryError as x, success as y, successVariable as z };
4131
+ export { empty as A, BigStatView as B, CardFeedView as C, DropdownFieldView as D, EditProfileView as E, rewardExchange as F, useShareButton as G, HeroView as H, InputFieldView as I, useShareLink as J, ProgressBarView as K, LeaderboardView as L, ProgressBar as M, NameFieldsView as N, autoColorScaleCss as O, PortalChangePasswordView as P, ShadowViewAddon as Q, ReferralIframeView as R, StatContainerView as S, TaskCardView as T, useBigStat as U, withShadowView as V, demoRewardExchange as W, ShareButtonView as a, PoweredByImg as b, CheckboxFieldView as c, PortalRegisterView as d, CouponCodeView as e, ChangeMarktingView as f, PortalFooterView as g, PortalFrameView as h, RewardExchangeView as i, rewardExchangeLongText as j, rewardExchangeSelected as k, chooseAmountFixed as l, chooseAmountFixedNoDescription as m, chooseAmountVariable as n, chooseAmountVariableNoDescription as o, chooseAmountVariableDisabled as p, chooseAmountVariableUnavailable as q, rewardExchangeCustomErrorMsg as r, confirmFixed as s, confirmVariable as t, useDemoBigStat as u, redemptionError as v, queryError as w, success as x, successVariable as y, loading as z };