@popmenu/common-ui 0.127.0 → 0.127.1

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 (165) hide show
  1. package/build/cjs/components/Avatar/AvatarProps.d.ts +2 -2
  2. package/build/cjs/components/Button/Button.d.ts +1 -1
  3. package/build/cjs/components/Button/ButtonProps.d.ts +1 -1
  4. package/build/cjs/components/Button/ButtonStyles.d.ts +1 -1
  5. package/build/cjs/components/Chip/Chip.d.ts +1 -1
  6. package/build/cjs/components/Chip/ChipProps.d.ts +2 -2
  7. package/build/cjs/components/CollapsibleText/CollapsibleTextStyles.d.ts +2 -2
  8. package/build/cjs/components/Divider/DividerProps.d.ts +1 -1
  9. package/build/cjs/components/FollowerAuthenticationDialog/FollowerAuthenticationAltActions.d.ts +0 -1
  10. package/build/cjs/components/FollowerAuthenticationDialog/FollowerAuthenticationBody.d.ts +0 -1
  11. package/build/cjs/components/FollowerAuthenticationDialog/FollowerAuthenticationCloseButton.d.ts +0 -1
  12. package/build/cjs/components/FollowerAuthenticationDialog/FollowerAuthenticationDialog.d.ts +0 -1
  13. package/build/cjs/components/FollowerAuthenticationDialog/FollowerAuthenticationDialogProps.d.ts +6 -6
  14. package/build/cjs/components/FollowerAuthenticationDialog/FollowerAuthenticationFooter.d.ts +0 -1
  15. package/build/cjs/components/FollowerAuthenticationDialog/FollowerAuthenticationForm.d.ts +0 -1
  16. package/build/cjs/components/FollowerAuthenticationDialog/FollowerAuthenticationGraphic.d.ts +0 -1
  17. package/build/cjs/components/FollowerAuthenticationDialog/FollowerAuthenticationInfo.d.ts +0 -1
  18. package/build/cjs/components/FollowerAuthenticationDialog/FollowerAuthenticationTitle.d.ts +0 -1
  19. package/build/cjs/components/FollowerAuthenticationDialog/context.d.ts +0 -1
  20. package/build/cjs/components/Icon/IconStyles.d.ts +1 -1
  21. package/build/cjs/components/IconButton/IconButtonProps.d.ts +1 -1
  22. package/build/cjs/components/Link/LinkStyles.d.ts +1 -1
  23. package/build/cjs/components/NumberField/NumberField.d.ts +0 -1
  24. package/build/cjs/components/NumberField/NumberFieldStyles.d.ts +1 -1
  25. package/build/cjs/components/SplitInput/SplitInputStyles.d.ts +1 -1
  26. package/build/cjs/components/Tooltip/TooltipProps.d.ts +1 -1
  27. package/build/cjs/components/Typography/Typography.d.ts +1 -1
  28. package/build/cjs/components/Typography/TypographyProps.d.ts +3 -3
  29. package/build/cjs/components/Typography/TypographyStyles.d.ts +1 -1
  30. package/build/cjs/hooks/useTabs/useTabsResult.d.ts +3 -3
  31. package/build/cjs/index.js +412 -437
  32. package/build/cjs/index.js.map +1 -1
  33. package/build/cjs/types/index.d.ts +2 -2
  34. package/build/esm/components/Avatar/Avatar.js +9 -10
  35. package/build/esm/components/Avatar/Avatar.js.map +1 -1
  36. package/build/esm/components/Avatar/AvatarProps.d.ts +2 -2
  37. package/build/esm/components/Avatar/avatar.styles.js +11 -11
  38. package/build/esm/components/Avatar/avatar.styles.js.map +1 -1
  39. package/build/esm/components/Avatar/util/useImageProps.js +9 -8
  40. package/build/esm/components/Avatar/util/useImageProps.js.map +1 -1
  41. package/build/esm/components/BrowserSilhouette/BrowserSilhouette.js +2 -3
  42. package/build/esm/components/BrowserSilhouette/BrowserSilhouette.js.map +1 -1
  43. package/build/esm/components/BrowserSilhouette/browserSilhouette.styles.js +5 -5
  44. package/build/esm/components/BrowserSilhouette/browserSilhouette.styles.js.map +1 -1
  45. package/build/esm/components/Button/Button.d.ts +1 -1
  46. package/build/esm/components/Button/Button.js +7 -8
  47. package/build/esm/components/Button/Button.js.map +1 -1
  48. package/build/esm/components/Button/ButtonProps.d.ts +1 -1
  49. package/build/esm/components/Button/ButtonStyles.d.ts +1 -1
  50. package/build/esm/components/Button/ButtonStyles.js +3 -6
  51. package/build/esm/components/Button/ButtonStyles.js.map +1 -1
  52. package/build/esm/components/Checkbox/Checkbox.js +5 -5
  53. package/build/esm/components/Checkbox/Checkbox.js.map +1 -1
  54. package/build/esm/components/Chip/Chip.d.ts +1 -1
  55. package/build/esm/components/Chip/Chip.js +7 -8
  56. package/build/esm/components/Chip/Chip.js.map +1 -1
  57. package/build/esm/components/Chip/ChipProps.d.ts +2 -2
  58. package/build/esm/components/Chip/ChipStyles.js +19 -19
  59. package/build/esm/components/Chip/ChipStyles.js.map +1 -1
  60. package/build/esm/components/CollapsibleText/CollapsibleText.js +19 -20
  61. package/build/esm/components/CollapsibleText/CollapsibleText.js.map +1 -1
  62. package/build/esm/components/CollapsibleText/CollapsibleTextStyles.d.ts +2 -2
  63. package/build/esm/components/CollapsibleText/CollapsibleTextStyles.js +5 -6
  64. package/build/esm/components/CollapsibleText/CollapsibleTextStyles.js.map +1 -1
  65. package/build/esm/components/Divider/Divider.js +11 -15
  66. package/build/esm/components/Divider/Divider.js.map +1 -1
  67. package/build/esm/components/Divider/DividerProps.d.ts +1 -1
  68. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationAltActions.d.ts +0 -1
  69. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationAltActions.js +26 -26
  70. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationAltActions.js.map +1 -1
  71. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationBody.d.ts +0 -1
  72. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationBody.js +1 -1
  73. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationBody.js.map +1 -1
  74. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationCloseButton.d.ts +0 -1
  75. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationCloseButton.js +6 -6
  76. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationCloseButton.js.map +1 -1
  77. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationContent.js +4 -4
  78. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationContent.js.map +1 -1
  79. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationDialog.d.ts +0 -1
  80. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationDialog.js +11 -15
  81. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationDialog.js.map +1 -1
  82. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationDialogProps.d.ts +6 -6
  83. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationFooter.d.ts +0 -1
  84. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationFooter.js +2 -2
  85. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationFooter.js.map +1 -1
  86. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationForm.d.ts +0 -1
  87. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationForm.js +49 -52
  88. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationForm.js.map +1 -1
  89. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationGraphic.d.ts +0 -1
  90. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationGraphic.js +4 -4
  91. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationGraphic.js.map +1 -1
  92. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationInfo.d.ts +0 -1
  93. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationInfo.js +3 -3
  94. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationInfo.js.map +1 -1
  95. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationTitle.d.ts +0 -1
  96. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationTitle.js +3 -3
  97. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationTitle.js.map +1 -1
  98. package/build/esm/components/FollowerAuthenticationDialog/context.d.ts +0 -1
  99. package/build/esm/components/FollowerAuthenticationDialog/context.js +4 -4
  100. package/build/esm/components/FollowerAuthenticationDialog/context.js.map +1 -1
  101. package/build/esm/components/FollowerAuthenticationDialog/theme.js +1 -1
  102. package/build/esm/components/FollowerAuthenticationDialog/theme.js.map +1 -1
  103. package/build/esm/components/Icon/Icon.js +12 -8
  104. package/build/esm/components/Icon/Icon.js.map +1 -1
  105. package/build/esm/components/Icon/IconStyles.d.ts +1 -1
  106. package/build/esm/components/Icon/IconStyles.js +7 -9
  107. package/build/esm/components/Icon/IconStyles.js.map +1 -1
  108. package/build/esm/components/IconButton/IconButton.js +2 -3
  109. package/build/esm/components/IconButton/IconButton.js.map +1 -1
  110. package/build/esm/components/IconButton/IconButtonProps.d.ts +1 -1
  111. package/build/esm/components/Link/Link.js +4 -5
  112. package/build/esm/components/Link/Link.js.map +1 -1
  113. package/build/esm/components/Link/LinkStyles.d.ts +1 -1
  114. package/build/esm/components/Link/LinkStyles.js +8 -8
  115. package/build/esm/components/Link/LinkStyles.js.map +1 -1
  116. package/build/esm/components/NumberField/NumberField.d.ts +0 -1
  117. package/build/esm/components/NumberField/NumberField.js +14 -9
  118. package/build/esm/components/NumberField/NumberField.js.map +1 -1
  119. package/build/esm/components/NumberField/NumberFieldStyles.d.ts +1 -1
  120. package/build/esm/components/NumberField/NumberFieldStyles.js +4 -4
  121. package/build/esm/components/NumberField/NumberFieldStyles.js.map +1 -1
  122. package/build/esm/components/Paper/Paper.js +12 -16
  123. package/build/esm/components/Paper/Paper.js.map +1 -1
  124. package/build/esm/components/PaperContent/PaperContent.js +2 -2
  125. package/build/esm/components/PaperContent/PaperContent.js.map +1 -1
  126. package/build/esm/components/Radio/Radio.js +5 -5
  127. package/build/esm/components/Radio/Radio.js.map +1 -1
  128. package/build/esm/components/SplitInput/SplitInput.js +4 -6
  129. package/build/esm/components/SplitInput/SplitInput.js.map +1 -1
  130. package/build/esm/components/SplitInput/SplitInputStyles.d.ts +1 -1
  131. package/build/esm/components/SplitInput/SplitInputStyles.js +4 -4
  132. package/build/esm/components/SplitInput/SplitInputStyles.js.map +1 -1
  133. package/build/esm/components/Switch/Switch.js +6 -6
  134. package/build/esm/components/Switch/Switch.js.map +1 -1
  135. package/build/esm/components/Switch/switch.styles.js +2 -2
  136. package/build/esm/components/Switch/switch.styles.js.map +1 -1
  137. package/build/esm/components/TabPanel/TabPanel.js +2 -2
  138. package/build/esm/components/TabPanel/TabPanel.js.map +1 -1
  139. package/build/esm/components/ToggleButton/ToggleButton.js +5 -6
  140. package/build/esm/components/ToggleButton/ToggleButton.js.map +1 -1
  141. package/build/esm/components/ToggleButton/ToggleButtonStyles.js +4 -4
  142. package/build/esm/components/ToggleButton/ToggleButtonStyles.js.map +1 -1
  143. package/build/esm/components/ToggleButtonGroup/ToggleButtonGroup.js +6 -7
  144. package/build/esm/components/ToggleButtonGroup/ToggleButtonGroup.js.map +1 -1
  145. package/build/esm/components/ToggleButtonGroup/ToggleButtonGroupStyles.js +2 -2
  146. package/build/esm/components/ToggleButtonGroup/ToggleButtonGroupStyles.js.map +1 -1
  147. package/build/esm/components/Tooltip/Tooltip.js +3 -4
  148. package/build/esm/components/Tooltip/Tooltip.js.map +1 -1
  149. package/build/esm/components/Tooltip/TooltipProps.d.ts +1 -1
  150. package/build/esm/components/Tooltip/TooltipStyles.js +5 -8
  151. package/build/esm/components/Tooltip/TooltipStyles.js.map +1 -1
  152. package/build/esm/components/Typography/Typography.d.ts +1 -1
  153. package/build/esm/components/Typography/Typography.js +4 -6
  154. package/build/esm/components/Typography/Typography.js.map +1 -1
  155. package/build/esm/components/Typography/TypographyProps.d.ts +3 -3
  156. package/build/esm/components/Typography/TypographyStyles.d.ts +1 -1
  157. package/build/esm/components/Typography/TypographyStyles.js +29 -47
  158. package/build/esm/components/Typography/TypographyStyles.js.map +1 -1
  159. package/build/esm/hooks/useCollapsibleText.js +7 -7
  160. package/build/esm/hooks/useCollapsibleText.js.map +1 -1
  161. package/build/esm/hooks/useTabs/useTabs.js +15 -15
  162. package/build/esm/hooks/useTabs/useTabs.js.map +1 -1
  163. package/build/esm/hooks/useTabs/useTabsResult.d.ts +3 -3
  164. package/build/esm/types/index.d.ts +2 -2
  165. package/package.json +2 -2
@@ -2,16 +2,13 @@
2
2
 
3
3
  var core = require('@material-ui/core');
4
4
  var lab = require('@material-ui/lab');
5
- var tslib = require('tslib');
6
5
  var webIcons = require('@popmenu/web-icons');
7
6
  var React = require('react');
8
7
  var classNames = require('classnames');
9
8
 
10
- var useIconStyles = core.makeStyles(function (_a) {
11
- var spacing = _a.spacing, palette = _a.palette;
12
- var getFontSize = function (_a) {
13
- var size = _a.size;
14
- var sizes = {
9
+ const useIconStyles = core.makeStyles(({ spacing, palette }) => {
10
+ const getFontSize = ({ size }) => {
11
+ const sizes = {
15
12
  inherit: 'inherit',
16
13
  small: spacing(1.5),
17
14
  medium: spacing(2),
@@ -22,12 +19,12 @@ var useIconStyles = core.makeStyles(function (_a) {
22
19
  return 'inherit';
23
20
  return sizes[size];
24
21
  };
25
- var getColor = function (props) {
26
- var semanticColors = ['primary', 'secondary', 'info', 'success', 'warning', 'error'];
27
- var value = 'inherit';
22
+ const getColor = (props) => {
23
+ const semanticColors = ['primary', 'secondary', 'info', 'success', 'warning', 'error'];
24
+ let value = 'inherit';
28
25
  if (props.color) {
29
26
  if (semanticColors.includes(props.color.split('.')[0])) {
30
- var _a = props.color.split('.'), color = _a[0], _b = _a[1], variant = _b === void 0 ? 'main' : _b;
27
+ const [color, variant = 'main'] = props.color.split('.');
31
28
  // @ts-expect-error - todo.
32
29
  value = palette[color][variant];
33
30
  }
@@ -48,20 +45,25 @@ var useIconStyles = core.makeStyles(function (_a) {
48
45
  };
49
46
  });
50
47
 
51
- var iconStaticClassName = 'pop-icon';
52
- var Icon = function (_a) {
53
- var className = _a.className, _b = _a.color, color = _b === void 0 ? 'inherit' : _b, icon = _a.icon, _c = _a.size, size = _c === void 0 ? 'inherit' : _c, restProps = tslib.__rest(_a, ["className", "color", "icon", "size"]);
54
- var hasAccessibleAttr = Boolean(restProps['aria-describedby'] || restProps['aria-label']);
48
+ const iconStaticClassName = 'pop-icon';
49
+ const Icon = ({ className, color = 'inherit', icon, size = 'inherit', ...restProps }) => {
50
+ const hasAccessibleAttr = Boolean(restProps['aria-describedby'] || restProps['aria-label']);
55
51
  if (!hasAccessibleAttr && restProps['aria-hidden'] === undefined) {
56
52
  restProps['aria-hidden'] = true;
57
53
  }
58
- var classes = useIconStyles({ color: color, size: size });
59
- var isValid = true;
54
+ const classes = useIconStyles({ color, size });
55
+ let isValid = true;
60
56
  if (!icon || (typeof icon === 'function' && icon({}) === undefined)) {
61
57
  isValid = false;
62
58
  }
63
59
  return isValid
64
- ? React.createElement(icon, tslib.__assign({ className: classNames([classes.root, iconStaticClassName, className]), color: color, width: undefined, height: undefined }, restProps))
60
+ ? React.createElement(icon, {
61
+ className: classNames([classes.root, iconStaticClassName, className]),
62
+ color,
63
+ width: undefined,
64
+ height: undefined,
65
+ ...restProps,
66
+ })
65
67
  : null;
66
68
  };
67
69
  Icon.displayName = 'Icon';
@@ -72,29 +74,31 @@ var LoadingStatus;
72
74
  LoadingStatus["LOADED"] = "LOADED";
73
75
  LoadingStatus["PENDING"] = "PENDING";
74
76
  })(LoadingStatus || (LoadingStatus = {}));
75
- var useImgProps = function (avatarProps) {
76
- var _a = React.useState(LoadingStatus.PENDING), loaded = _a[0], setLoaded = _a[1];
77
- var imgProps = tslib.__assign(tslib.__assign({}, avatarProps.imgProps), { onLoad: function (event) {
78
- var _a, _b;
77
+ const useImgProps = (avatarProps) => {
78
+ const [loaded, setLoaded] = React.useState(LoadingStatus.PENDING);
79
+ const imgProps = {
80
+ ...avatarProps.imgProps,
81
+ onLoad: (event) => {
79
82
  setLoaded(LoadingStatus.LOADED);
80
- (_b = (_a = avatarProps.imgProps) === null || _a === void 0 ? void 0 : _a.onLoad) === null || _b === void 0 ? void 0 : _b.call(_a, event);
81
- } });
82
- return { imgProps: imgProps, loaded: loaded };
83
+ avatarProps.imgProps?.onLoad?.(event);
84
+ },
85
+ };
86
+ return { imgProps, loaded };
83
87
  };
84
88
 
85
- var getAvatarDimensions = function (theme, props) {
86
- var factors = {
89
+ const getAvatarDimensions = (theme, props) => {
90
+ const factors = {
87
91
  'extra-small': 3,
88
92
  small: 4,
89
93
  medium: 5,
90
94
  large: 6,
91
95
  'extra-large': 12.5,
92
96
  };
93
- var sizeFactor = factors[props.size || 'medium'];
97
+ const sizeFactor = factors[props.size || 'medium'];
94
98
  return theme.spacing(sizeFactor);
95
99
  };
96
- var getAvatarFontSize = function (props) {
97
- var fontSizes = {
100
+ const getAvatarFontSize = (props) => {
101
+ const fontSizes = {
98
102
  'extra-small': '0.75rem',
99
103
  small: '1rem',
100
104
  medium: '1rem',
@@ -103,29 +107,29 @@ var getAvatarFontSize = function (props) {
103
107
  };
104
108
  return fontSizes[props.size];
105
109
  };
106
- var useAvatarStyles = core.makeStyles(function (theme) { return ({
107
- root: function (props) { return ({
110
+ const useAvatarStyles = core.makeStyles((theme) => ({
111
+ root: (props) => ({
108
112
  width: getAvatarDimensions(theme, props),
109
113
  height: getAvatarDimensions(theme, props),
110
114
  fontSize: getAvatarFontSize(props),
111
115
  backgroundColor: props.loaded === LoadingStatus.LOADED ? 'transparent' : props.background,
112
116
  color: theme.palette.getContrastText(props.background),
113
117
  objectFit: props.fit,
114
- }); },
115
- fallback: function (props) { return ({
118
+ }),
119
+ fallback: (props) => ({
116
120
  fontSize: getAvatarDimensions(theme, props),
117
121
  strokeWidth: 1,
118
- }); },
119
- }); });
122
+ }),
123
+ }));
120
124
 
121
- var Avatar = React.forwardRef(function (props, ref) {
122
- var children = props.children, src = props.src, alt = props.alt, fallback = props.fallback, muiProps = tslib.__rest(props, ["children", "src", "alt", "fallback"]);
123
- var _a = useImgProps(props), imgProps = _a.imgProps, loaded = _a.loaded;
124
- var classes = useAvatarStyles(tslib.__assign(tslib.__assign({}, props), { loaded: loaded }));
125
- var displayAltTextFallback = src && alt;
126
- var displayNoFallback = fallback === 'none';
127
- var displayCustomFallback = fallback !== 'none' && typeof fallback !== 'undefined';
128
- var Fallback;
125
+ const Avatar = React.forwardRef((props, ref) => {
126
+ const { children, src, alt, fallback, ...muiProps } = props;
127
+ const { imgProps, loaded } = useImgProps(props);
128
+ const classes = useAvatarStyles({ ...props, loaded });
129
+ const displayAltTextFallback = src && alt;
130
+ const displayNoFallback = fallback === 'none';
131
+ const displayCustomFallback = fallback !== 'none' && typeof fallback !== 'undefined';
132
+ let Fallback;
129
133
  if (displayAltTextFallback) {
130
134
  Fallback = null;
131
135
  }
@@ -138,7 +142,7 @@ var Avatar = React.forwardRef(function (props, ref) {
138
142
  else {
139
143
  Fallback = React.createElement(Icon, { icon: webIcons.User, className: classes.fallback });
140
144
  }
141
- return (React.createElement(core.Avatar, tslib.__assign({ ref: ref, classes: { root: classes.root }, src: src, alt: alt }, muiProps, { imgProps: imgProps }), children || Fallback));
145
+ return (React.createElement(core.Avatar, { ref: ref, classes: { root: classes.root }, src: src, alt: alt, ...muiProps, imgProps: imgProps }, children || Fallback));
142
146
  });
143
147
  Avatar.defaultProps = {
144
148
  size: 'medium',
@@ -147,30 +151,29 @@ Avatar.defaultProps = {
147
151
  };
148
152
  Avatar.displayName = 'Avatar';
149
153
 
150
- var useBrowserSilhouetteStyles = core.makeStyles(function (theme) { return ({
154
+ const useBrowserSilhouetteStyles = core.makeStyles((theme) => ({
151
155
  circle: {
152
156
  backgroundColor: theme.palette.grey[300],
153
157
  borderRadius: '50%',
154
158
  height: theme.spacing(0.65),
155
159
  width: theme.spacing(0.65),
156
- margin: theme.spacing(1) + "px 0 " + theme.spacing(1) + "px " + theme.spacing(1) + "px",
160
+ margin: `${theme.spacing(1)}px 0 ${theme.spacing(1)}px ${theme.spacing(1)}px`,
157
161
  },
158
162
  container: {
159
- border: "1px solid " + theme.palette.secondary.light,
163
+ border: `1px solid ${theme.palette.secondary.light}`,
160
164
  borderRadius: theme.spacing(0.5),
161
165
  flexGrow: 1,
162
166
  },
163
167
  titleBar: {
164
168
  display: 'flex',
165
169
  flexDirection: 'row',
166
- borderBottom: "1px solid " + theme.palette.secondary.light,
170
+ borderBottom: `1px solid ${theme.palette.secondary.light}`,
167
171
  width: '100%',
168
172
  },
169
- }); });
173
+ }));
170
174
 
171
- var BrowserSilhouette = function (_a) {
172
- var children = _a.children;
173
- var classes = useBrowserSilhouetteStyles();
175
+ const BrowserSilhouette = ({ children }) => {
176
+ const classes = useBrowserSilhouetteStyles();
174
177
  return (React.createElement(core.Box, { display: "flex" },
175
178
  React.createElement("div", { className: classes.container },
176
179
  React.createElement("div", { className: classes.titleBar },
@@ -180,42 +183,40 @@ var BrowserSilhouette = function (_a) {
180
183
  children)));
181
184
  };
182
185
 
183
- var useButtonStyles = core.makeStyles(function () { return ({
186
+ const useButtonStyles = core.makeStyles(() => ({
184
187
  root: {
185
188
  minWidth: 'unset',
186
189
  },
187
190
  label: {
188
- textTransform: function (_a) {
189
- var textTransform = _a.textTransform;
190
- return textTransform;
191
- },
191
+ textTransform: ({ textTransform }) => textTransform,
192
192
  },
193
- }); });
193
+ }));
194
194
 
195
- var Button = function (props) {
196
- props.textTransform; var loading = props.loading, classesOverride = props.classes, className = props.className, ButtonRef = props.ButtonRef, muiProps = tslib.__rest(props, ["textTransform", "loading", "classes", "className", "ButtonRef"]);
197
- props.classes; var styleProps = tslib.__rest(props, ["classes"]);
198
- var classes = useButtonStyles(styleProps);
199
- var typography = core.useTheme().typography;
200
- var loadingIndicator = {
195
+ const Button = (props) => {
196
+ const { textTransform, loading, classes: classesOverride, className, ButtonRef, ...muiProps } = props;
197
+ const { classes: remove, ...styleProps } = props;
198
+ const classes = useButtonStyles(styleProps);
199
+ const { typography } = core.useTheme();
200
+ const loadingIndicator = {
201
201
  startIcon: React.createElement(core.CircularProgress, { color: "inherit", size: typography.button.fontSize }),
202
202
  disabled: true,
203
203
  };
204
- return (React.createElement(core.Button, tslib.__assign({ ref: ButtonRef, classes: tslib.__assign(tslib.__assign({}, classes), classesOverride), className: classNames([className, 'pm-button']) }, muiProps, (loading && loadingIndicator))));
204
+ return (React.createElement(core.Button, { ref: ButtonRef, classes: { ...classes, ...classesOverride }, className: classNames([className, 'pm-button']), ...muiProps, ...(loading && loadingIndicator) }));
205
205
  };
206
206
  Button.displayName = 'Button';
207
207
 
208
- var Checkbox = React.forwardRef(function (props, ref) {
209
- var label = props.label, disabled = props.disabled, LabelProps = props.LabelProps, muiProps = tslib.__rest(props, ["label", "disabled", "LabelProps"]);
210
- var control = React.createElement(core.Checkbox, tslib.__assign({ disabled: label ? undefined : disabled }, muiProps));
211
- return label ? (React.createElement(core.FormControlLabel, tslib.__assign({ disabled: disabled, inputRef: ref, control: control, label: label }, LabelProps))) : (control);
208
+ const Checkbox = React.forwardRef((props, ref) => {
209
+ const { disabled, LabelProps, ...muiProps } = props;
210
+ const label = LabelProps?.label || props.label;
211
+ const control = React.createElement(core.Checkbox, { disabled: label ? undefined : disabled, ...muiProps });
212
+ return label ? (React.createElement(core.FormControlLabel, { disabled: disabled, inputRef: ref, control: control, ...LabelProps, label: label })) : (control);
212
213
  });
213
214
  Checkbox.displayName = 'Checkbox';
214
215
 
215
- var getBackground = function (theme) { return function (props) {
216
- var variant = props.variant, severity = props.severity;
217
- var background = theme.palette.grey[100];
218
- var backgrounds = {
216
+ const getBackground = (theme) => (props) => {
217
+ const { variant, severity } = props;
218
+ let background = theme.palette.grey[100];
219
+ const backgrounds = {
219
220
  outlined: 'none',
220
221
  error: 'error.main',
221
222
  warning: 'warning.main',
@@ -226,17 +227,17 @@ var getBackground = function (theme) { return function (props) {
226
227
  background = backgrounds[variant];
227
228
  }
228
229
  else if (severity) {
229
- var _a = backgrounds[severity].split('.'), color = _a[0], colorVariant = _a[1];
230
+ const [color, colorVariant] = backgrounds[severity].split('.');
230
231
  // @ts-expect-error - todo.
231
232
  background = theme.palette[color][colorVariant];
232
233
  }
233
234
  return background;
234
- }; };
235
- var getColor = function (theme) { return function (props) {
236
- var variant = props.variant, severity = props.severity;
237
- var textColor;
235
+ };
236
+ const getColor = (theme) => (props) => {
237
+ const { variant, severity } = props;
238
+ let textColor;
238
239
  if (variant === 'outlined' && severity) {
239
- var textColors = {
240
+ const textColors = {
240
241
  error: theme.palette.error.main,
241
242
  info: theme.palette.info.main,
242
243
  warning: theme.palette.warning.dark,
@@ -248,7 +249,7 @@ var getColor = function (theme) { return function (props) {
248
249
  textColor = theme.palette.grey[700];
249
250
  }
250
251
  else if ((variant === 'default' || variant === undefined) && severity) {
251
- var textColors = {
252
+ const textColors = {
252
253
  error: theme.palette.common.white,
253
254
  info: theme.palette.secondary.main,
254
255
  warning: theme.palette.secondary.main,
@@ -257,12 +258,12 @@ var getColor = function (theme) { return function (props) {
257
258
  textColor = textColors[severity];
258
259
  }
259
260
  return textColor;
260
- }; };
261
- var getBorder = function (theme) { return function (props) {
262
- var variant = props.variant, severity = props.severity;
263
- var borderColor;
261
+ };
262
+ const getBorder = (theme) => (props) => {
263
+ const { variant, severity } = props;
264
+ let borderColor;
264
265
  if (variant === 'outlined' && severity) {
265
- var borderColors = {
266
+ const borderColors = {
266
267
  error: theme.palette.error.main,
267
268
  info: theme.palette.info.main,
268
269
  warning: theme.palette.warning.dark,
@@ -271,10 +272,10 @@ var getBorder = function (theme) { return function (props) {
271
272
  borderColor = borderColors[severity];
272
273
  }
273
274
  return borderColor;
274
- }; };
275
+ };
275
276
  // using `any` here is a bit of cheating but it doesn't matter since this doesn't depend on
276
277
  // any component-specific props
277
- var useChipStyles = core.makeStyles(function (theme) { return ({
278
+ const useChipStyles = core.makeStyles((theme) => ({
278
279
  root: {
279
280
  background: getBackground(theme),
280
281
  color: getColor(theme),
@@ -289,44 +290,44 @@ var useChipStyles = core.makeStyles(function (theme) { return ({
289
290
  deleteIcon: {
290
291
  color: theme.palette.grey[500],
291
292
  },
292
- }); });
293
+ }));
293
294
 
294
- var IconDictionary = {
295
+ const IconDictionary = {
295
296
  error: webIcons.Error,
296
297
  info: webIcons.Info,
297
298
  success: webIcons.CheckCircle,
298
299
  warning: webIcons.Warning,
299
300
  };
300
- var Chip = function (props) {
301
- var severity = props.severity, restProps = tslib.__rest(props, ["severity"]);
302
- var classes = useChipStyles(props);
303
- var icon = severity ? React.createElement(IconDictionary[severity]) : undefined;
304
- var deleteIcon = React.createElement(webIcons.XCircle);
305
- return React.createElement(core.Chip, tslib.__assign({ classes: classes, icon: icon, deleteIcon: deleteIcon }, restProps));
301
+ const Chip = (props) => {
302
+ const { severity, ...restProps } = props;
303
+ const classes = useChipStyles(props);
304
+ const icon = severity ? React.createElement(IconDictionary[severity]) : undefined;
305
+ const deleteIcon = React.createElement(webIcons.XCircle);
306
+ return React.createElement(core.Chip, { classes: classes, icon: icon, deleteIcon: deleteIcon, ...restProps });
306
307
  };
307
308
  Chip.displayName = 'Chip';
308
309
 
309
- var weights = {
310
+ const weights = {
310
311
  regular: 400,
311
312
  medium: 500,
312
313
  'semi-bold': 600,
313
314
  bold: 700,
314
315
  };
315
- var getCustomColor = function (theme, color) {
316
- var isCommonColor = color && ['white', 'black'].includes(color);
317
- var isGreyColor = color && color.match(/^grey\.\d{3}/);
318
- var isSemanticColor = color && color.match(/(primary|secondary|info|success|error|warning).?(light|dark)?/);
319
- var isTextColor = color && ['textPrimary', 'textSecondary'].includes(color);
316
+ const getCustomColor = (theme, color) => {
317
+ const isCommonColor = color && ['white', 'black'].includes(color);
318
+ const isGreyColor = color && color.match(/^grey\.\d{3}/);
319
+ const isSemanticColor = color && color.match(/(primary|secondary|info|success|error|warning).?(light|dark)?/);
320
+ const isTextColor = color && ['textPrimary', 'textSecondary'].includes(color);
320
321
  switch (true) {
321
322
  case isCommonColor:
322
323
  // @ts-expect-error - todo.
323
324
  return theme.palette.common[color];
324
325
  case Boolean(isGreyColor):
325
- var scale = color.split('.')[1];
326
+ const scale = color.split('.')[1];
326
327
  // @ts-expect-error - todo.
327
328
  return theme.palette.grey[scale] || theme.palette.grey[900];
328
329
  case Boolean(isSemanticColor):
329
- var _a = color.split('.'), paletteKey = _a[0], _b = _a[1], variant = _b === void 0 ? 'main' : _b;
330
+ const [paletteKey, variant = 'main'] = color.split('.');
330
331
  // @ts-expect-error - todo.
331
332
  return theme.palette[paletteKey][variant];
332
333
  case isTextColor:
@@ -336,102 +337,82 @@ var getCustomColor = function (theme, color) {
336
337
  return undefined;
337
338
  }
338
339
  };
339
- var useTypographyStyles = core.makeStyles(function (theme) {
340
- var _a;
341
- return ({
342
- root: (_a = {},
343
- _a["& ." + iconStaticClassName] = {
344
- position: 'relative',
345
- top: '0.125em',
346
- padding: '0 0.125em',
347
- boxSizing: 'content-box',
348
- },
349
- _a.fontFamily = theme.typography.fontFamily,
350
- _a.fontWeight = function (_a) {
351
- var variant = _a.variant, weight = _a.weight;
352
- return (weight ? weights[weight] : theme.typography[variant].fontWeight);
353
- },
354
- _a.fontSize = function (_a) {
355
- var variant = _a.variant;
356
- return theme.typography[variant].fontSize;
357
- },
358
- _a.lineHeight = function (_a) {
359
- var variant = _a.variant;
360
- return theme.typography[variant].lineHeight;
361
- },
362
- _a.textTransform = function (_a) {
363
- var variant = _a.variant;
364
- return theme.typography[variant].textTransform;
365
- },
366
- _a.color = function (_a) {
367
- var color = _a.color, variant = _a.variant;
368
- return (color && getCustomColor(theme, color)) || theme.typography[variant].color;
369
- },
370
- _a),
371
- caption: {
372
- display: 'inline',
373
- },
374
- overline: {
375
- display: 'inline',
340
+ const useTypographyStyles = core.makeStyles((theme) => ({
341
+ root: {
342
+ [`& .${iconStaticClassName}`]: {
343
+ position: 'relative',
344
+ top: '0.125em',
345
+ padding: '0 0.125em',
346
+ boxSizing: 'content-box',
376
347
  },
377
- });
378
- });
348
+ fontFamily: theme.typography.fontFamily,
349
+ fontWeight: ({ variant, weight }) => (weight ? weights[weight] : theme.typography[variant].fontWeight),
350
+ fontSize: ({ variant }) => theme.typography[variant].fontSize,
351
+ lineHeight: ({ variant }) => theme.typography[variant].lineHeight,
352
+ textTransform: ({ variant }) => theme.typography[variant].textTransform,
353
+ color: ({ color, variant }) => (color && getCustomColor(theme, color)) || theme.typography[variant].color,
354
+ },
355
+ caption: {
356
+ display: 'inline',
357
+ },
358
+ overline: {
359
+ display: 'inline',
360
+ },
361
+ }));
379
362
 
380
- var Typography = function (_a) {
381
- var TypographyRef = _a.TypographyRef, color = _a.color, _b = _a.variant, variant = _b === void 0 ? 'body1' : _b, weight = _a.weight, restProps = tslib.__rest(_a, ["TypographyRef", "color", "variant", "weight"]);
382
- var classes = useTypographyStyles({ color: color, variant: variant, weight: weight });
383
- var variantMapping = { subtitle1: 'p' };
384
- return (React.createElement(core.Typography, tslib.__assign({ classes: classes, variant: variant, variantMapping: variantMapping, ref: TypographyRef }, restProps)));
363
+ const Typography = ({ TypographyRef, color, variant = 'body1', weight, ...restProps }) => {
364
+ const classes = useTypographyStyles({ color, variant, weight });
365
+ const variantMapping = { subtitle1: 'p' };
366
+ return (React.createElement(core.Typography, { classes: classes, variant: variant, variantMapping: variantMapping, ref: TypographyRef, ...restProps }));
385
367
  };
386
368
  Typography.displayName = 'Typography';
387
369
 
388
- var getFadeStop = function (_a, typographyVariant) {
389
- var typography = _a.typography;
370
+ const getFadeStop = ({ typography }, typographyVariant) => {
390
371
  // @ts-expect-error - todo.
391
372
  return !isNaN(Number(typography[typographyVariant].lineHeight))
392
373
  ? // @ts-expect-error - todo.
393
- typography[typographyVariant].lineHeight + "rem"
374
+ `${typography[typographyVariant].lineHeight}rem`
394
375
  : // @ts-expect-error - todo.
395
376
  typography[typographyVariant].lineHeight;
396
377
  };
397
- var useCollapsibleTextStyles = core.makeStyles(function (theme) { return ({
378
+ const useCollapsibleTextStyles = core.makeStyles((theme) => ({
398
379
  overlay: {
399
380
  position: 'absolute',
400
381
  top: 0,
401
382
  left: 0,
402
383
  height: '100%',
403
384
  width: '100%',
404
- background: function (props) { return "linear-gradient(to top, white, #FFF0 " + getFadeStop(theme, props.typographyVariant) + ")"; },
385
+ background: (props) => `linear-gradient(to top, white, #FFF0 ${getFadeStop(theme, props.typographyVariant)})`,
405
386
  },
406
- }); });
387
+ }));
407
388
 
408
- var CollapsibleText = function (props) {
409
- var text = props.text, open = props.open, _a = props.previewLines, previewLines = _a === void 0 ? 2 : _a, _b = props.typographyVariant, typographyVariant = _b === void 0 ? 'body1' : _b; props.collapseState; var restProps = tslib.__rest(props, ["text", "open", "previewLines", "typographyVariant", "collapseState"]);
410
- var collapseState = React.useState(false);
411
- var typographyRef = React.useRef(null);
412
- var classes = useCollapsibleTextStyles(tslib.__assign(tslib.__assign({}, props), { previewLines: previewLines, typographyVariant: typographyVariant }));
413
- var theme = core.useTheme();
414
- var _c = props.collapseState ? props.collapseState : collapseState, collapsible = _c[0], setCollapsible = _c[1];
415
- var typographyEntryLineHeightRem = parseFloat(theme.typography[typographyVariant].lineHeight);
416
- var collapsedSizeRem = previewLines * typographyEntryLineHeightRem;
417
- var documentFontSize = parseFloat(getComputedStyle(document.documentElement).fontSize);
418
- var collapsedSizePx = collapsedSizeRem * documentFontSize;
419
- React.useEffect(function () {
420
- var typographyNode = typographyRef.current;
421
- var observer = new ResizeObserver(function (entries) {
422
- var typographyEntry = entries.find(function (entry) { return entry.target === typographyNode; });
389
+ const CollapsibleText = (props) => {
390
+ const { text, open, previewLines = 2, typographyVariant = 'body1', collapseState: _exclude, ...restProps } = props;
391
+ const collapseState = React.useState(false);
392
+ const typographyRef = React.useRef(null);
393
+ const classes = useCollapsibleTextStyles({ ...props, previewLines, typographyVariant });
394
+ const theme = core.useTheme();
395
+ const [collapsible, setCollapsible] = props.collapseState ? props.collapseState : collapseState;
396
+ const typographyEntryLineHeightRem = parseFloat(theme.typography[typographyVariant].lineHeight);
397
+ const collapsedSizeRem = previewLines * typographyEntryLineHeightRem;
398
+ const documentFontSize = parseFloat(getComputedStyle(document.documentElement).fontSize);
399
+ const collapsedSizePx = collapsedSizeRem * documentFontSize;
400
+ React.useEffect(() => {
401
+ const typographyNode = typographyRef.current;
402
+ const observer = new ResizeObserver((entries) => {
403
+ const typographyEntry = entries.find((entry) => entry.target === typographyNode);
423
404
  if (typographyEntry) {
424
- var typographyEntryHeight = typographyEntry.contentRect.height;
425
- var isCollapsible = typographyEntryHeight > collapsedSizePx;
405
+ const typographyEntryHeight = typographyEntry.contentRect.height;
406
+ const isCollapsible = typographyEntryHeight > collapsedSizePx;
426
407
  setCollapsible(isCollapsible);
427
408
  }
428
409
  });
429
410
  observer.observe(typographyNode);
430
- return function () {
411
+ return () => {
431
412
  observer.unobserve(typographyNode);
432
413
  };
433
414
  }, []);
434
- return (React.createElement(core.Box, tslib.__assign({ position: "relative", overflow: "hidden" }, restProps),
415
+ return (React.createElement(core.Box, { position: "relative", overflow: "hidden", ...restProps },
435
416
  React.createElement(core.Collapse, { in: open, collapsedSize: collapsedSizePx + 'px' },
436
417
  React.createElement(Typography, { TypographyRef: typographyRef, variant: typographyVariant }, text)),
437
418
  collapsible && !open && React.createElement(core.Box, { className: classes.overlay })));
@@ -446,15 +427,14 @@ var SemanticColors;
446
427
  SemanticColors["SECONDARY_DARK"] = "secondary.dark";
447
428
  SemanticColors["SECONDARY_LIGHT"] = "secondary.light";
448
429
  })(SemanticColors || (SemanticColors = {}));
449
- var useStyles$5 = core.makeStyles(function (theme) { return ({
430
+ const useStyles$5 = core.makeStyles((theme) => ({
450
431
  dividerRoot: {
451
432
  gap: theme.spacing(2),
452
433
  },
453
434
  textRoot: {
454
- color: function (_a) {
455
- var textColor = _a.textColor;
435
+ color: ({ textColor }) => {
456
436
  if (textColor && Object.values(SemanticColors).includes(textColor)) {
457
- var _b = textColor.split('.'), semanticColor = _b[0], shade = _b[1];
437
+ const [semanticColor, shade] = textColor.split('.');
458
438
  // @ts-expect-error - todo.
459
439
  return theme.palette[semanticColor][shade];
460
440
  }
@@ -465,13 +445,12 @@ var useStyles$5 = core.makeStyles(function (theme) { return ({
465
445
  return 'black';
466
446
  }
467
447
  },
468
- textTransform: function (props) { return props.textTransform; },
448
+ textTransform: (props) => props.textTransform,
469
449
  },
470
450
  dividerLine: {
471
- backgroundColor: function (_a) {
472
- var dividerColor = _a.dividerColor;
451
+ backgroundColor: ({ dividerColor }) => {
473
452
  if (dividerColor && Object.values(SemanticColors).includes(dividerColor)) {
474
- var _b = dividerColor.split('.'), semanticColor = _b[0], shade = _b[1];
453
+ const [semanticColor, shade] = dividerColor.split('.');
475
454
  // @ts-expect-error - todo.
476
455
  return theme.palette[semanticColor][shade];
477
456
  }
@@ -483,52 +462,29 @@ var useStyles$5 = core.makeStyles(function (theme) { return ({
483
462
  }
484
463
  },
485
464
  },
486
- }); });
487
- var Divider = function (_a) {
488
- var TypographyProps = _a.TypographyProps, className = _a.className, dividerColor = _a.dividerColor, text = _a.text, textColor = _a.textColor, _b = _a.textTransform, textTransform = _b === void 0 ? 'lowercase' : _b;
489
- var classes = useStyles$5({ dividerColor: dividerColor, textColor: textColor, textTransform: textTransform });
490
- var casingOffset = textTransform === 'lowercase' ? '.25rem' : 'unset';
465
+ }));
466
+ const Divider = ({ TypographyProps, className, dividerColor, text, textColor, textTransform = 'lowercase', }) => {
467
+ const classes = useStyles$5({ dividerColor, textColor, textTransform });
468
+ const casingOffset = textTransform === 'lowercase' ? '.25rem' : 'unset';
491
469
  return (React.createElement(core.Box, { className: classNames([classes.dividerRoot, className]), display: "flex", alignItems: "center" },
492
470
  React.createElement(core.Box, { className: classes.dividerLine, display: "flex", flexGrow: 1, height: "1px", marginTop: casingOffset }),
493
471
  text && (React.createElement(React.Fragment, null,
494
- React.createElement(Typography, tslib.__assign({ className: classes.textRoot }, TypographyProps), text),
472
+ React.createElement(Typography, { className: classes.textRoot, ...TypographyProps }, text),
495
473
  React.createElement(core.Box, { className: classes.dividerLine, display: "flex", flexGrow: 1, height: "1px", marginTop: casingOffset })))));
496
474
  };
497
475
  Divider.displayName = 'Divider';
498
476
 
499
- var useStyles$4 = core.makeStyles(function () { return ({
500
- root: {
501
- display: 'flex',
502
- flexDirection: 'column',
503
- alignItems: 'center',
504
- gridGap: 16,
505
- },
506
- }); });
507
- var FollowerAuthenticationContent = function (props) {
508
- var classes = useStyles$4();
509
- return React.createElement(core.DialogContent, { classes: classes }, props.children);
510
- };
511
-
512
- var FollowerAuthenticationDialogContext = React.createContext(null);
513
- var FollowerAuthenticationDialogContextProvider = FollowerAuthenticationDialogContext.Provider;
514
- var useFollowerAuthenticationDialogContext = function () {
515
- var context = React.useContext(FollowerAuthenticationDialogContext);
477
+ const FollowerAuthenticationDialogContext = React.createContext(null);
478
+ const FollowerAuthenticationDialogContextProvider = FollowerAuthenticationDialogContext.Provider;
479
+ const useFollowerAuthenticationDialogContext = () => {
480
+ const context = React.useContext(FollowerAuthenticationDialogContext);
516
481
  if (!context) {
517
482
  throw new Error('useFollowerAuthenticationDialogContext must be called within FollowerAuthenticationDialogContextProvider');
518
483
  }
519
484
  return context;
520
485
  };
521
486
 
522
- var FollowerAuthenticationGraphic = function () {
523
- var _a = useFollowerAuthenticationDialogContext(), state = _a.state, messages = _a.messages, graphics = _a.graphics;
524
- var graphic = graphics[state.value];
525
- if (!graphic)
526
- return null;
527
- return (React.createElement(core.Box, null,
528
- React.createElement("img", { src: graphic, alt: messages[state.value + "GraphicAlt"] })));
529
- };
530
-
531
- var useStyles$3 = core.makeStyles(function () { return ({
487
+ const useStyles$4 = core.makeStyles(() => ({
532
488
  form: {
533
489
  display: 'flex',
534
490
  flexDirection: 'column',
@@ -536,38 +492,37 @@ var useStyles$3 = core.makeStyles(function () { return ({
536
492
  width: '100%',
537
493
  gridGap: 16,
538
494
  },
539
- }); });
540
- var northAmericanPhoneRegex = /^(\()?[2-9]{1}\d{2}(\))?[-\s.]?[2-9]{1}\d{2}[-\s.]?\d{4}$/;
541
- var ukPhoneRegex = /^((\+?44\s?|0044\s?)(\s?\d{3,5}|\(\d{3,5}\))(\s?\d{3,4})(\s?\d{3,4})$|^07\d{9}$)/;
542
- var validatePhoneNumber = function (phone) {
495
+ }));
496
+ const northAmericanPhoneRegex = /^(\()?[2-9]{1}\d{2}(\))?[-\s.]?[2-9]{1}\d{2}[-\s.]?\d{4}$/;
497
+ const ukPhoneRegex = /^((\+?44\s?|0044\s?)(\s?\d{3,5}|\(\d{3,5}\))(\s?\d{3,4})(\s?\d{3,4})$|^07\d{9}$)/;
498
+ const validatePhoneNumber = (phone) => {
543
499
  if (!phone)
544
500
  return false;
545
501
  return northAmericanPhoneRegex.test(phone) || ukPhoneRegex.test(phone);
546
502
  };
547
- var FollowerAuthenticationForm = function () {
548
- var _a = useFollowerAuthenticationDialogContext(), state = _a.state, messages = _a.messages, locationOptions = _a.locationOptions, onActionButtonClick = _a.onActionButtonClick, loading = _a.loading;
549
- var classes = useStyles$3();
503
+ const FollowerAuthenticationForm = () => {
504
+ const { state, messages, locationOptions, onActionButtonClick, loading } = useFollowerAuthenticationDialogContext();
505
+ const classes = useStyles$4();
550
506
  // sign-up form state
551
- var formRef = React.useRef(null);
552
- var _b = React.useState(false), formValidity = _b[0], setFormValidity = _b[1];
553
- var _c = React.useState(), showPhoneErrorText = _c[0], setShowPhoneErrorText = _c[1];
554
- var _d = React.useState(), showEmailErrorText = _d[0], setShowEmailErrorText = _d[1];
555
- var _e = React.useState(), showLocationErrorText = _e[0], setShowLocationErrorText = _e[1];
556
- var _f = React.useState(state.context.phone || ''), signUpPhoneValue = _f[0], setSignUpPhoneValue = _f[1];
557
- var _g = React.useState(state.context.email || ''), signUpEmailValue = _g[0], setSignUpEmailValue = _g[1];
558
- var checkFieldValidity = function (e) {
559
- var _a, _b;
560
- var fieldName = e.target.name;
561
- var fieldValue = e.target.value;
507
+ const formRef = React.useRef(null);
508
+ const [formValidity, setFormValidity] = React.useState(false);
509
+ const [showPhoneErrorText, setShowPhoneErrorText] = React.useState();
510
+ const [showEmailErrorText, setShowEmailErrorText] = React.useState();
511
+ const [showLocationErrorText, setShowLocationErrorText] = React.useState();
512
+ const [signUpPhoneValue, setSignUpPhoneValue] = React.useState(state.context.phone || '');
513
+ const [signUpEmailValue, setSignUpEmailValue] = React.useState(state.context.email || '');
514
+ const checkFieldValidity = (e) => {
515
+ const fieldName = e.target.name;
516
+ const fieldValue = e.target.value;
562
517
  switch (fieldName) {
563
518
  case 'phone':
564
- var isPhoneValid = validatePhoneNumber(fieldValue);
519
+ const isPhoneValid = validatePhoneNumber(fieldValue);
565
520
  setSignUpPhoneValue(fieldValue);
566
521
  setShowPhoneErrorText(!isPhoneValid && fieldValue.length > 0);
567
522
  break;
568
523
  case 'email':
569
- var emailField = (_a = formRef.current) === null || _a === void 0 ? void 0 : _a.elements.namedItem(fieldName);
570
- var isEmailValid = (_b = emailField === null || emailField === void 0 ? void 0 : emailField.validity.valid) !== null && _b !== void 0 ? _b : false;
524
+ const emailField = formRef.current?.elements.namedItem(fieldName);
525
+ const isEmailValid = emailField?.validity.valid ?? false;
571
526
  setSignUpEmailValue(fieldValue);
572
527
  setShowEmailErrorText(!isEmailValid && fieldValue.length > 0);
573
528
  break;
@@ -576,52 +531,51 @@ var FollowerAuthenticationForm = function () {
576
531
  break;
577
532
  }
578
533
  };
579
- React.useEffect(function () {
534
+ React.useEffect(() => {
580
535
  setSignUpPhoneValue(state.context.phone || '');
581
536
  setSignUpEmailValue(state.context.email || '');
582
537
  }, [state.context.phone, state.context.email]);
583
- React.useEffect(function () {
584
- var _a, _b, _c;
538
+ React.useEffect(() => {
585
539
  // Validate pre-filled values (only in signUp state)
586
540
  if (state.value === 'signUp') {
587
541
  if (signUpPhoneValue) {
588
- var isPhoneValid = validatePhoneNumber(signUpPhoneValue);
542
+ const isPhoneValid = validatePhoneNumber(signUpPhoneValue);
589
543
  setShowPhoneErrorText(!isPhoneValid);
590
544
  }
591
545
  if (signUpEmailValue) {
592
- var emailField = (_a = formRef.current) === null || _a === void 0 ? void 0 : _a.elements.namedItem('email');
593
- var isEmailValid = (_b = emailField === null || emailField === void 0 ? void 0 : emailField.validity.valid) !== null && _b !== void 0 ? _b : false;
546
+ const emailField = formRef.current?.elements.namedItem('email');
547
+ const isEmailValid = emailField?.validity.valid ?? false;
594
548
  setShowEmailErrorText(!isEmailValid);
595
549
  }
596
550
  }
597
- var hasValidPhone = Boolean(signUpPhoneValue) && !showPhoneErrorText;
598
- var hasValidEmail = Boolean(signUpEmailValue) && !showEmailErrorText;
599
- var locationField = (_c = formRef.current) === null || _c === void 0 ? void 0 : _c.elements.namedItem('location');
600
- var hasValidLocation = locationField ? Boolean(locationField.value) : true;
601
- var hasValidContact = hasValidPhone || hasValidEmail;
551
+ const hasValidPhone = Boolean(signUpPhoneValue) && !showPhoneErrorText;
552
+ const hasValidEmail = Boolean(signUpEmailValue) && !showEmailErrorText;
553
+ const locationField = formRef.current?.elements.namedItem('location');
554
+ const hasValidLocation = locationField ? Boolean(locationField.value) : true;
555
+ const hasValidContact = hasValidPhone || hasValidEmail;
602
556
  setFormValidity(hasValidContact && hasValidLocation);
603
557
  }, [state.value, signUpPhoneValue, signUpEmailValue, showPhoneErrorText, showEmailErrorText, showLocationErrorText]);
604
- var handleSubmit = function (e) {
558
+ const handleSubmit = (e) => {
605
559
  e.preventDefault();
606
- var form = e.target;
607
- var formData = new FormData(form);
608
- var values = Object.fromEntries(formData.entries());
560
+ const form = e.target;
561
+ const formData = new FormData(form);
562
+ const values = Object.fromEntries(formData.entries());
609
563
  onActionButtonClick('submit-form', values);
610
564
  };
611
- var formProps = {
565
+ const formProps = {
612
566
  id: 'follower-authentication-form',
613
567
  className: classes.form,
614
568
  onSubmit: handleSubmit,
615
569
  };
616
570
  switch (state.value) {
617
571
  case 'initial':
618
- return (React.createElement("form", tslib.__assign({}, formProps),
572
+ return (React.createElement("form", { ...formProps },
619
573
  React.createElement(core.TextField, { disabled: loading, label: messages.initialInputLabel, key: "identifier-input", id: "identifier-input", name: "identifier" }),
620
574
  React.createElement(core.Button, { disabled: loading, type: "submit" }, messages.initialCtaButtonLabel)));
621
575
  case 'signUp':
622
- return (React.createElement("form", tslib.__assign({ ref: formRef }, formProps, { onInvalid: function (e) {
576
+ return (React.createElement("form", { ref: formRef, ...formProps, onInvalid: (e) => {
623
577
  e.preventDefault();
624
- } }),
578
+ } },
625
579
  React.createElement(core.TextField, { disabled: loading, label: messages.signUpPhoneInputLabel, key: "phone-input", id: "phone-input", name: "phone", onChange: checkFieldValidity, error: showPhoneErrorText, helperText: showPhoneErrorText && messages.signUpPhoneErrorText, inputProps: {
626
580
  required: signUpEmailValue ? false : true,
627
581
  }, defaultValue: state.context.phone }),
@@ -630,27 +584,27 @@ var FollowerAuthenticationForm = function () {
630
584
  required: signUpPhoneValue ? false : true,
631
585
  type: 'email',
632
586
  }, defaultValue: state.context.email }),
633
- React.createElement(core.TextField, { disabled: loading, select: true, onChange: checkFieldValidity, label: messages.signUpLocationInputLabel, error: showLocationErrorText, helperText: showLocationErrorText && messages.signUpLocationErrorText, key: "location-input", id: "location-input", inputProps: { required: true }, name: "location" }, locationOptions.map(function (locationOption) { return (React.createElement(core.MenuItem, { "data-cy": 'option', key: locationOption.value, value: locationOption.value }, locationOption.label)); })),
587
+ React.createElement(core.TextField, { disabled: loading, select: true, onChange: checkFieldValidity, label: messages.signUpLocationInputLabel, error: showLocationErrorText, helperText: showLocationErrorText && messages.signUpLocationErrorText, key: "location-input", id: "location-input", inputProps: { required: true }, name: "location" }, locationOptions.map((locationOption) => (React.createElement(core.MenuItem, { "data-cy": 'option', key: locationOption.value, value: locationOption.value }, locationOption.label)))),
634
588
  React.createElement(core.Typography, { style: { alignSelf: 'start' } }, messages.signUpBirthdaySectionLabel),
635
589
  React.createElement(core.TextField, { disabled: loading, label: messages.signUpMonthInputLabel, key: "birthday-month-input", id: "birthday-month-input", name: "birthdayMonth" }),
636
590
  React.createElement(core.TextField, { disabled: loading, label: messages.signUpDayInputLabel, key: "birthday-date-input", id: "birthday-date-input", name: "birthdayDate" }),
637
591
  React.createElement(core.Button, { disabled: loading || !formValidity, type: "submit" }, messages.signUp)));
638
592
  case 'emailFound':
639
- return (React.createElement("form", tslib.__assign({}, formProps),
593
+ return (React.createElement("form", { ...formProps },
640
594
  React.createElement(core.TextField, { disabled: loading, label: messages.emailFoundInputLabel, key: "email-input", id: "email-input", name: "email", value: state.context.email }),
641
595
  React.createElement(core.Button, { disabled: loading, type: "submit" }, messages.emailFoundCtaButtonLabel)));
642
596
  case 'emailAuthCode':
643
- return (React.createElement("form", tslib.__assign({}, formProps),
597
+ return (React.createElement("form", { ...formProps },
644
598
  React.createElement(core.TextField, { disabled: loading, label: messages.emailAuthCodeInputLabel, key: "code-input", id: "code-input", name: "code" }),
645
599
  React.createElement(core.Button, { disabled: loading, type: "submit" }, messages.signIn)));
646
600
  case 'indirectUserFound': {
647
601
  if (state.context.email) {
648
- return (React.createElement("form", tslib.__assign({}, formProps),
602
+ return (React.createElement("form", { ...formProps },
649
603
  React.createElement(core.TextField, { disabled: loading, label: messages.emailFoundInputLabel, key: "email-input", id: "email-input", name: "email", value: state.context.email }),
650
604
  React.createElement(core.Button, { disabled: loading, type: "submit" }, messages.indirectUserFoundCtaButtonLabel)));
651
605
  }
652
606
  else if (state.context.phone) {
653
- return (React.createElement("form", tslib.__assign({}, formProps),
607
+ return (React.createElement("form", { ...formProps },
654
608
  React.createElement(core.TextField, { disabled: loading, label: messages.phoneFoundInputLabel, key: "phone-input", id: "phone-input", name: "phone", value: state.context.phone }),
655
609
  React.createElement(core.Button, { disabled: loading, type: "submit" }, messages.indirectUserFoundCtaButtonLabel)));
656
610
  }
@@ -658,25 +612,25 @@ var FollowerAuthenticationForm = function () {
658
612
  return null;
659
613
  }
660
614
  case 'emailPasswordSignIn':
661
- return (React.createElement("form", tslib.__assign({}, formProps),
615
+ return (React.createElement("form", { ...formProps },
662
616
  React.createElement(core.TextField, { disabled: loading, label: messages.emailFoundInputLabel, key: "email-input", id: "email-input", name: "email", value: state.context.email, InputLabelProps: { shrink: true } }),
663
617
  React.createElement(core.TextField, { disabled: loading, label: messages.passwordInputLabel, key: "password-input", id: "password-input", name: "password", inputProps: { type: 'password' } }),
664
618
  React.createElement(core.Button, { disabled: loading, type: "submit" }, messages.signIn)));
665
619
  case 'phoneFound':
666
- return (React.createElement("form", tslib.__assign({}, formProps),
620
+ return (React.createElement("form", { ...formProps },
667
621
  React.createElement(core.TextField, { disabled: loading, label: messages.phoneFoundInputLabel, key: "phone-input", id: "phone-input", name: "phone", value: state.context.phone }),
668
622
  React.createElement(core.Button, { disabled: loading, type: "submit" }, messages.phoneFoundCtaButtonLabel)));
669
623
  case 'phoneAuthCode':
670
- return (React.createElement("form", tslib.__assign({}, formProps),
624
+ return (React.createElement("form", { ...formProps },
671
625
  React.createElement(core.TextField, { disabled: loading, label: messages.phoneAuthCodeInputLabel, key: "code-input", id: "code-input", name: "code", autoComplete: "one-time-code" }),
672
626
  React.createElement(core.Button, { disabled: loading, type: "submit" }, messages.signIn)));
673
627
  case 'phonePasswordSignIn':
674
- return (React.createElement("form", tslib.__assign({}, formProps),
628
+ return (React.createElement("form", { ...formProps },
675
629
  React.createElement(core.TextField, { disabled: loading, label: messages.phoneFoundInputLabel, key: "phone-input", id: "phone-input", name: "phone", value: state.context.phone, InputLabelProps: { shrink: true } }),
676
630
  React.createElement(core.TextField, { disabled: loading, label: messages.passwordInputLabel, key: "password-input", id: "password-input", name: "password", inputProps: { type: 'password' } }),
677
631
  React.createElement(core.Button, { disabled: loading, type: "submit" }, messages.signIn)));
678
632
  case 'requirePhone':
679
- return (React.createElement("form", tslib.__assign({}, formProps),
633
+ return (React.createElement("form", { ...formProps },
680
634
  React.createElement(core.TextField, { disabled: loading, label: messages.requirePhoneInputLabel, key: "phone-input", id: "phone-input", name: "phone", value: state.context.phone }),
681
635
  React.createElement(core.Button, { disabled: loading, type: "submit" }, messages.requirePhoneCtaButtonLabel)));
682
636
  case 'welcome':
@@ -686,25 +640,25 @@ var FollowerAuthenticationForm = function () {
686
640
  }
687
641
  };
688
642
 
689
- var useStyles$2 = core.makeStyles(function () { return ({
643
+ const useStyles$3 = core.makeStyles(() => ({
690
644
  main: {
691
645
  width: '100%',
692
646
  display: 'flex',
693
647
  flexDirection: 'column',
694
648
  gridGap: 16,
695
649
  },
696
- }); });
697
- var FollowerAuthenticationAltActions = function () {
698
- var _a = useFollowerAuthenticationDialogContext(), state = _a.state, messages = _a.messages, logos = _a.logos, loading = _a.loading, onActionButtonClick = _a.onActionButtonClick;
699
- var classes = useStyles$2();
650
+ }));
651
+ const FollowerAuthenticationAltActions = () => {
652
+ const { state, messages, logos, loading, onActionButtonClick } = useFollowerAuthenticationDialogContext();
653
+ const classes = useStyles$3();
700
654
  switch (state.value) {
701
655
  case 'initial':
702
656
  return (React.createElement(core.Box, { className: classes.main },
703
657
  React.createElement(core.Divider, null),
704
- React.createElement(core.Button, { variant: "outlined", startIcon: logos.facebook, onClick: function () {
658
+ React.createElement(core.Button, { variant: "outlined", startIcon: logos.facebook, onClick: () => {
705
659
  onActionButtonClick('sign-in-with-facebook');
706
660
  } }, messages.continueWithFacebookButtonLabel),
707
- React.createElement(core.Button, { variant: "outlined", startIcon: logos.google, onClick: function () {
661
+ React.createElement(core.Button, { variant: "outlined", startIcon: logos.google, onClick: () => {
708
662
  onActionButtonClick('sign-in-with-google');
709
663
  } }, messages.continueWithGoogleButtonLabel)));
710
664
  case 'signUp':
@@ -712,53 +666,53 @@ var FollowerAuthenticationAltActions = function () {
712
666
  case 'emailFound':
713
667
  return (React.createElement(core.Box, { className: classes.main },
714
668
  React.createElement(core.Divider, null),
715
- React.createElement(core.Button, { variant: "outlined", onClick: function () {
669
+ React.createElement(core.Button, { variant: "outlined", onClick: () => {
716
670
  onActionButtonClick('sign-in-with-password');
717
671
  } }, messages.signInWithPassword)));
718
672
  case 'emailAuthCode':
719
673
  return (React.createElement(core.Box, { className: classes.main },
720
- React.createElement(core.Button, { disabled: loading, variant: "outlined", onClick: function () {
721
- var form = document.querySelector('#follower-authentication-form');
722
- var formData = new FormData(form);
723
- var values = Object.fromEntries(formData.entries());
674
+ React.createElement(core.Button, { disabled: loading, variant: "outlined", onClick: () => {
675
+ const form = document.querySelector('#follower-authentication-form');
676
+ const formData = new FormData(form);
677
+ const values = Object.fromEntries(formData.entries());
724
678
  onActionButtonClick('request-auth-code-email', values);
725
679
  } }, messages.resendAuthCode)));
726
680
  case 'indirectUserFound':
727
681
  return (React.createElement(core.Box, { className: classes.main },
728
682
  React.createElement(core.Divider, null),
729
- React.createElement(core.Button, { variant: "outlined", onClick: function () {
683
+ React.createElement(core.Button, { variant: "outlined", onClick: () => {
730
684
  onActionButtonClick('use-different-account');
731
685
  } }, messages.indirectUserFoundCtaButtonLabelAlt)));
732
686
  case 'emailPasswordSignIn':
733
687
  return (React.createElement(core.Box, { className: classes.main },
734
688
  React.createElement(core.Divider, null),
735
- React.createElement(core.Button, { variant: "outlined", onClick: function () {
736
- var form = document.querySelector('#follower-authentication-form');
737
- var formData = new FormData(form);
738
- var values = Object.fromEntries(formData.entries());
689
+ React.createElement(core.Button, { variant: "outlined", onClick: () => {
690
+ const form = document.querySelector('#follower-authentication-form');
691
+ const formData = new FormData(form);
692
+ const values = Object.fromEntries(formData.entries());
739
693
  onActionButtonClick('request-auth-code-email', values);
740
694
  } }, messages.emailFoundCtaButtonLabel)));
741
695
  case 'phoneFound':
742
696
  return null;
743
697
  case 'phoneAuthCode':
744
698
  return (React.createElement(core.Box, { className: classes.main },
745
- React.createElement(core.Button, { disabled: loading, variant: "outlined", onClick: function () {
746
- var form = document.querySelector('#follower-authentication-form');
747
- var formData = new FormData(form);
748
- var values = Object.fromEntries(formData.entries());
699
+ React.createElement(core.Button, { disabled: loading, variant: "outlined", onClick: () => {
700
+ const form = document.querySelector('#follower-authentication-form');
701
+ const formData = new FormData(form);
702
+ const values = Object.fromEntries(formData.entries());
749
703
  onActionButtonClick('request-auth-code-sms', values);
750
704
  } }, messages.resendAuthCode)));
751
705
  case 'phonePasswordSignIn':
752
706
  return (React.createElement(core.Box, { className: classes.main },
753
707
  React.createElement(core.Divider, null),
754
- React.createElement(core.Button, { variant: "outlined", onClick: function () {
755
- var form = document.querySelector('#follower-authentication-form');
756
- var formData = new FormData(form);
757
- var values = Object.fromEntries(formData.entries());
708
+ React.createElement(core.Button, { variant: "outlined", onClick: () => {
709
+ const form = document.querySelector('#follower-authentication-form');
710
+ const formData = new FormData(form);
711
+ const values = Object.fromEntries(formData.entries());
758
712
  onActionButtonClick('request-auth-code-sms', values);
759
713
  } }, messages.phoneFoundCtaButtonLabel)));
760
714
  case 'welcome':
761
- return (React.createElement(core.Button, { onClick: function () {
715
+ return (React.createElement(core.Button, { onClick: () => {
762
716
  onActionButtonClick('close');
763
717
  } }, messages.done));
764
718
  default:
@@ -766,53 +720,75 @@ var FollowerAuthenticationAltActions = function () {
766
720
  }
767
721
  };
768
722
 
769
- var FollowerAuthenticationBody = function () {
723
+ const FollowerAuthenticationBody = () => {
770
724
  return (React.createElement(React.Fragment, null,
771
725
  React.createElement(FollowerAuthenticationForm, null),
772
726
  React.createElement(FollowerAuthenticationAltActions, null)));
773
727
  };
774
728
 
775
- var FollowerAuthenticationFooter = function () {
776
- var _a = useFollowerAuthenticationDialogContext(), messages = _a.messages, logos = _a.logos;
729
+ const useStyles$2 = core.makeStyles(() => ({
730
+ root: {
731
+ position: 'absolute',
732
+ top: 0,
733
+ right: 0,
734
+ },
735
+ }));
736
+ const FollowerAuthenticationCloseButton = () => {
737
+ const { messages, onActionButtonClick } = useFollowerAuthenticationDialogContext();
738
+ const classes = useStyles$2();
739
+ const handleClose = () => {
740
+ onActionButtonClick('close');
741
+ };
742
+ return (React.createElement(core.IconButton, { classes: classes, "aria-label": messages.closeButtonLabel, onClick: handleClose },
743
+ React.createElement(webIcons.X, null)));
744
+ };
745
+
746
+ const useStyles$1 = core.makeStyles(() => ({
747
+ root: {
748
+ display: 'flex',
749
+ flexDirection: 'column',
750
+ alignItems: 'center',
751
+ gridGap: 16,
752
+ },
753
+ }));
754
+ const FollowerAuthenticationContent = (props) => {
755
+ const classes = useStyles$1();
756
+ return React.createElement(core.DialogContent, { classes: classes }, props.children);
757
+ };
758
+
759
+ const FollowerAuthenticationFooter = () => {
760
+ const { messages, logos } = useFollowerAuthenticationDialogContext();
777
761
  return (React.createElement(core.Box, { display: "flex", gridGap: 8 },
778
762
  React.createElement(core.Typography, { variant: "body2" }, messages.poweredBy),
779
763
  logos.popmenu));
780
764
  };
781
765
 
782
- var FollowerAuthenticationTitle = function () {
783
- var _a = useFollowerAuthenticationDialogContext(), state = _a.state, messages = _a.messages;
784
- var title = messages[state.value + "Title"];
766
+ const FollowerAuthenticationGraphic = () => {
767
+ const { state, messages, graphics } = useFollowerAuthenticationDialogContext();
768
+ const graphic = graphics[state.value];
769
+ if (!graphic)
770
+ return null;
785
771
  return (React.createElement(core.Box, null,
786
- React.createElement(core.Typography, { variant: "h1", align: "center" }, title)));
772
+ React.createElement("img", { src: graphic, alt: messages[`${state.value}GraphicAlt`] })));
787
773
  };
788
774
 
789
- var FollowerAuthenticationInfo = function () {
790
- var _a = useFollowerAuthenticationDialogContext(), state = _a.state, messages = _a.messages;
791
- var info = messages[state.value + "Info"];
775
+ const FollowerAuthenticationInfo = () => {
776
+ const { state, messages } = useFollowerAuthenticationDialogContext();
777
+ const info = messages[`${state.value}Info`];
792
778
  if (!info)
793
779
  return null;
794
780
  return (React.createElement(core.Box, null,
795
781
  React.createElement(core.Typography, { align: "center" }, info)));
796
782
  };
797
783
 
798
- var useStyles$1 = core.makeStyles(function () { return ({
799
- root: {
800
- position: 'absolute',
801
- top: 0,
802
- right: 0,
803
- },
804
- }); });
805
- var FollowerAuthenticationCloseButton = function () {
806
- var _a = useFollowerAuthenticationDialogContext(), messages = _a.messages, onActionButtonClick = _a.onActionButtonClick;
807
- var classes = useStyles$1();
808
- var handleClose = function () {
809
- onActionButtonClick('close');
810
- };
811
- return (React.createElement(core.IconButton, { classes: classes, "aria-label": messages.closeButtonLabel, onClick: handleClose },
812
- React.createElement(webIcons.X, null)));
784
+ const FollowerAuthenticationTitle = () => {
785
+ const { state, messages } = useFollowerAuthenticationDialogContext();
786
+ const title = messages[`${state.value}Title`];
787
+ return (React.createElement(core.Box, null,
788
+ React.createElement(core.Typography, { variant: "h1", align: "center" }, title)));
813
789
  };
814
790
 
815
- var theme = {
791
+ const theme = {
816
792
  palette: {
817
793
  primary: { main: '#2E3042' },
818
794
  },
@@ -846,14 +822,11 @@ var theme = {
846
822
  },
847
823
  };
848
824
 
849
- var FollowerAuthenticationDialog = function (props) {
850
- var open = props.open, restProps = tslib.__rest(props, ["open"]);
851
- var theme$1 = core.createTheme(theme);
852
- var fullScreen = core.useMediaQuery(function (_a) {
853
- var breakpoints = _a.breakpoints;
854
- return breakpoints.down('sm');
855
- });
856
- var handleClose = function () {
825
+ const FollowerAuthenticationDialog = (props) => {
826
+ const { open, ...restProps } = props;
827
+ const theme$1 = core.createTheme(theme);
828
+ const fullScreen = core.useMediaQuery((theme) => theme.breakpoints.down('sm'));
829
+ const handleClose = () => {
857
830
  restProps.onActionButtonClick('close');
858
831
  };
859
832
  return (React.createElement(core.ThemeProvider, { theme: theme$1 },
@@ -868,40 +841,41 @@ var FollowerAuthenticationDialog = function (props) {
868
841
  React.createElement(FollowerAuthenticationFooter, null))))));
869
842
  };
870
843
 
871
- var IconButton = React.forwardRef(function (props, ref) {
872
- return React.createElement(core.IconButton, tslib.__assign({ ref: ref }, props));
844
+ const IconButton = React.forwardRef((props, ref) => {
845
+ return React.createElement(core.IconButton, { ref: ref, ...props });
873
846
  });
874
847
  IconButton.displayName = 'IconButton';
875
848
  IconButton.defaultProps = {
876
849
  color: 'secondary',
877
850
  };
878
851
 
879
- var useLinkStyles = core.makeStyles(function (theme) { return ({
880
- root: function (props) {
881
- var _a;
882
- return (tslib.__assign(tslib.__assign({ display: 'flex' }, (props.color === undefined && { color: theme.palette.info.main })), (_a = {}, _a["& ." + iconStaticClassName] = {
852
+ const useLinkStyles = core.makeStyles((theme) => ({
853
+ root: (props) => ({
854
+ display: 'flex',
855
+ ...(props.color === undefined && { color: theme.palette.info.main }),
856
+ [`& .${iconStaticClassName}`]: {
883
857
  alignSelf: 'center',
884
- }, _a)));
885
- },
886
- }); });
858
+ },
859
+ }),
860
+ }));
887
861
 
888
862
  // eslint-disable-next-line react/display-name -- false positive
889
- var Link = React.forwardRef(function (props, ref) {
890
- var children = props.children, muiProps = tslib.__rest(props, ["children"]);
891
- var classes = useLinkStyles(props);
892
- return (React.createElement(core.Link, tslib.__assign({ ref: ref, classes: { root: classes.root } }, muiProps), children));
863
+ const Link = React.forwardRef((props, ref) => {
864
+ const { children, ...muiProps } = props;
865
+ const classes = useLinkStyles(props);
866
+ return (React.createElement(core.Link, { ref: ref, classes: { root: classes.root }, ...muiProps }, children));
893
867
  });
894
868
  Link.defaultProps = {
895
869
  variant: 'body1',
896
870
  };
897
871
  Link.displayName = 'Link';
898
872
 
899
- var useNumberFieldStyles = core.makeStyles(function () { return ({
873
+ const useNumberFieldStyles = core.makeStyles(() => ({
900
874
  root: {
901
875
  height: 56,
902
876
  },
903
- }); });
904
- var useNumberInputStyles = core.makeStyles(function (theme) { return ({
877
+ }));
878
+ const useNumberInputStyles = core.makeStyles((theme) => ({
905
879
  root: {
906
880
  height: '100%',
907
881
  width: 'min-content',
@@ -922,55 +896,59 @@ var useNumberInputStyles = core.makeStyles(function (theme) { return ({
922
896
  adornedEnd: {
923
897
  padding: 0,
924
898
  },
925
- }); });
899
+ }));
926
900
 
927
- var NumberField = function (props) {
928
- var onIncrement = props.onIncrement, onDecrement = props.onDecrement, _a = props.endAdornmentButtonProps, endAdornmentButtonProps = _a === void 0 ? {} : _a, _b = props.startAdornmentButtonProps, startAdornmentButtonProps = _b === void 0 ? {} : _b, _c = props.InputProps, InputProps = _c === void 0 ? {} : _c, classes = props.classes, restProps = tslib.__rest(props, ["onIncrement", "onDecrement", "endAdornmentButtonProps", "startAdornmentButtonProps", "InputProps", "classes"]);
929
- var _d = InputProps, inputClassesOverride = _d.classes, restInputProps = tslib.__rest(_d, ["classes"]);
930
- var fieldClasses = useNumberFieldStyles(props);
931
- var inputClasses = useNumberInputStyles(props);
932
- return (React.createElement(core.TextField, tslib.__assign({ classes: tslib.__assign(tslib.__assign({}, fieldClasses), classes), variant: "filled", type: "number", defaultValue: 0, InputProps: tslib.__assign({ classes: tslib.__assign(tslib.__assign({}, inputClasses), inputClassesOverride), disableUnderline: true, endAdornment: (React.createElement(IconButton, tslib.__assign({ style: { fontSize: 20 }, onClick: onIncrement }, endAdornmentButtonProps),
933
- React.createElement(Icon, { icon: webIcons.PlusCircle }))), startAdornment: (React.createElement(IconButton, tslib.__assign({ style: { fontSize: 20 }, onClick: onDecrement }, startAdornmentButtonProps),
934
- React.createElement(Icon, { icon: webIcons.MinusCircle }))) }, restInputProps) }, restProps)));
901
+ const NumberField = (props) => {
902
+ const { onIncrement, onDecrement, endAdornmentButtonProps = {}, startAdornmentButtonProps = {}, InputProps = {}, classes, ...restProps } = props;
903
+ const { classes: inputClassesOverride, ...restInputProps } = InputProps;
904
+ const fieldClasses = useNumberFieldStyles(props);
905
+ const inputClasses = useNumberInputStyles(props);
906
+ return (React.createElement(core.TextField, { classes: { ...fieldClasses, ...classes }, variant: "filled", type: "number", defaultValue: 0, InputProps: {
907
+ classes: { ...inputClasses, ...inputClassesOverride },
908
+ disableUnderline: true,
909
+ endAdornment: (React.createElement(IconButton, { style: { fontSize: 20 }, onClick: onIncrement, ...endAdornmentButtonProps },
910
+ React.createElement(Icon, { icon: webIcons.PlusCircle }))),
911
+ startAdornment: (React.createElement(IconButton, { style: { fontSize: 20 }, onClick: onDecrement, ...startAdornmentButtonProps },
912
+ React.createElement(Icon, { icon: webIcons.MinusCircle }))),
913
+ ...restInputProps,
914
+ }, ...restProps }));
935
915
  };
936
916
 
937
- var useStyles = core.makeStyles(function (_a) {
938
- var spacing = _a.spacing;
939
- return ({
940
- root: {
941
- '&:last-child': {
942
- marginBottom: 0,
943
- },
944
- marginBottom: spacing(4),
945
- padding: spacing(4),
917
+ const useStyles = core.makeStyles(({ spacing }) => ({
918
+ root: {
919
+ '&:last-child': {
920
+ marginBottom: 0,
946
921
  },
947
- });
948
- });
949
- var Paper = React.forwardRef(function (props, ref) {
950
- var legacyStyles = props.legacyStyles, restProps = tslib.__rest(props, ["legacyStyles"]);
951
- var classes = useStyles(props);
952
- return React.createElement(core.Paper, tslib.__assign({}, ref, { classes: tslib.__assign({}, (legacyStyles && classes)) }, restProps));
922
+ marginBottom: spacing(4),
923
+ padding: spacing(4),
924
+ },
925
+ }));
926
+ const Paper = React.forwardRef((props, ref) => {
927
+ const { legacyStyles, ...restProps } = props;
928
+ const classes = useStyles(props);
929
+ return React.createElement(core.Paper, { ...ref, classes: { ...(legacyStyles && classes) }, ...restProps });
953
930
  });
954
931
  Paper.displayName = 'Paper';
955
932
  Paper.defaultProps = {
956
933
  legacyStyles: false,
957
934
  };
958
935
 
959
- var PaperContent = function (props) {
960
- var children = props.children;
936
+ const PaperContent = (props) => {
937
+ const { children } = props;
961
938
  return React.createElement(core.Box, { padding: 4 }, children);
962
939
  };
963
940
 
964
- var Radio = React.forwardRef(function (props, ref) {
965
- var label = props.label, disabled = props.disabled, LabelProps = props.LabelProps, muiProps = tslib.__rest(props, ["label", "disabled", "LabelProps"]);
966
- var control = React.createElement(core.Radio, tslib.__assign({ disabled: label ? undefined : disabled }, muiProps));
967
- return label ? (React.createElement(core.FormControlLabel, tslib.__assign({ disabled: disabled, inputRef: ref, control: control, label: label }, LabelProps))) : (control);
941
+ const Radio = React.forwardRef((props, ref) => {
942
+ const { disabled, LabelProps, ...muiProps } = props;
943
+ const label = LabelProps?.label || props.label;
944
+ const control = React.createElement(core.Radio, { disabled: label ? undefined : disabled, ...muiProps });
945
+ return label ? (React.createElement(core.FormControlLabel, { disabled: disabled, inputRef: ref, control: control, ...LabelProps, label: label })) : (control);
968
946
  });
969
947
  Radio.displayName = 'Radio';
970
948
 
971
- var useSplitInputStyles = core.makeStyles(function () { return ({
949
+ const useSplitInputStyles = core.makeStyles(() => ({
972
950
  textfield: {
973
- background: function (props) { return (props.backgroundTransparency ? '#FFFFFF44' : 'none'); },
951
+ background: (props) => (props.backgroundTransparency ? '#FFFFFF44' : 'none'),
974
952
  borderTopLeftRadius: 4,
975
953
  borderBottomLeftRadius: 4,
976
954
  '& fieldset': {
@@ -985,24 +963,23 @@ var useSplitInputStyles = core.makeStyles(function () { return ({
985
963
  alignSelf: 'stretch',
986
964
  },
987
965
  input: {
988
- color: function (props) { return props.inputTextColor || 'inherit'; },
966
+ color: (props) => props.inputTextColor || 'inherit',
989
967
  '&$focused fieldset': {
990
968
  top: -4,
991
969
  },
992
970
  },
993
971
  focused: {},
994
- }); });
972
+ }));
995
973
 
996
- var SplitInput = function (_a) {
997
- var ButtonProps = _a.ButtonProps, TextFieldProps = _a.TextFieldProps, _b = _a.backgroundTransparency, backgroundTransparency = _b === void 0 ? true : _b, buttonLabel = _a.buttonLabel, _c = _a.color, color = _c === void 0 ? 'primary' : _c, inputTextColor = _a.inputTextColor, onChange = _a.onChange, onClick = _a.onClick;
998
- var classes = useSplitInputStyles({ backgroundTransparency: backgroundTransparency, inputTextColor: inputTextColor });
974
+ const SplitInput = ({ ButtonProps, TextFieldProps, backgroundTransparency = true, buttonLabel, color = 'primary', inputTextColor, onChange, onClick, }) => {
975
+ const classes = useSplitInputStyles({ backgroundTransparency, inputTextColor });
999
976
  return (React.createElement(core.Box, { display: "flex" },
1000
- React.createElement(core.TextField, tslib.__assign({ classes: { root: classes.textfield }, InputProps: { classes: { root: classes.input, focused: classes.focused } }, color: color, variant: "outlined", onChange: onChange }, TextFieldProps)),
1001
- React.createElement(Button, tslib.__assign({ classes: { root: classes.button }, disableElevation: true, color: color, variant: "contained", onClick: onClick }, ButtonProps), buttonLabel)));
977
+ React.createElement(core.TextField, { classes: { root: classes.textfield }, InputProps: { classes: { root: classes.input, focused: classes.focused } }, color: color, variant: "outlined", onChange: onChange, ...TextFieldProps }),
978
+ React.createElement(Button, { classes: { root: classes.button }, disableElevation: true, color: color, variant: "contained", onClick: onClick, ...ButtonProps }, buttonLabel)));
1002
979
  };
1003
980
  SplitInput.displayName = 'SplitInput';
1004
981
 
1005
- var useSwitchStyles = core.makeStyles(function (theme) { return ({
982
+ const useSwitchStyles = core.makeStyles((theme) => ({
1006
983
  checked: {
1007
984
  '& $thumb': {
1008
985
  background: theme.palette.success.main,
@@ -1013,115 +990,113 @@ var useSwitchStyles = core.makeStyles(function (theme) { return ({
1013
990
  },
1014
991
  thumb: {},
1015
992
  track: {},
1016
- }); });
993
+ }));
1017
994
 
1018
- var Switch = React.forwardRef(function (props, ref) {
1019
- var label = props.label, disabled = props.disabled, LabelProps = props.LabelProps, muiProps = tslib.__rest(props, ["label", "disabled", "LabelProps"]);
1020
- var classes = useSwitchStyles(props);
1021
- var control = React.createElement(core.Switch, tslib.__assign({ classes: classes, disabled: label ? undefined : disabled }, muiProps));
1022
- return label ? (React.createElement(core.FormControlLabel, tslib.__assign({ disabled: disabled, inputRef: ref, control: control, label: label }, LabelProps))) : (control);
995
+ const Switch = React.forwardRef((props, ref) => {
996
+ const { disabled, LabelProps, ...muiProps } = props;
997
+ const label = LabelProps?.label || props.label;
998
+ const classes = useSwitchStyles(props);
999
+ const control = React.createElement(core.Switch, { classes: classes, disabled: label ? undefined : disabled, ...muiProps });
1000
+ return label ? (React.createElement(core.FormControlLabel, { disabled: disabled, inputRef: ref, control: control, ...LabelProps, label: label })) : (control);
1023
1001
  });
1024
1002
  Switch.displayName = 'Switch';
1025
1003
 
1026
- var TabPanel = function (props) {
1027
- var children = props.children, show = props.show;
1004
+ const TabPanel = (props) => {
1005
+ const { children, show } = props;
1028
1006
  return show ? React.createElement(core.Box, null, children) : null;
1029
1007
  };
1030
1008
 
1031
- var useToggleButtonStyles = core.makeStyles(function (theme) { return ({
1009
+ const useToggleButtonStyles = core.makeStyles((theme) => ({
1032
1010
  root: {
1033
1011
  color: theme.palette.text.primary,
1034
1012
  },
1035
1013
  selected: {
1036
1014
  '&&': {
1037
1015
  '&:hover': {
1038
- backgroundColor: function (props) { return theme.palette[props.color || 'primary'].dark; },
1016
+ backgroundColor: (props) => theme.palette[props.color || 'primary'].dark,
1039
1017
  },
1040
- backgroundColor: function (props) { return theme.palette[props.color || 'primary'].main; },
1018
+ backgroundColor: (props) => theme.palette[props.color || 'primary'].main,
1041
1019
  color: 'white',
1042
1020
  },
1043
1021
  },
1044
- }); });
1022
+ }));
1045
1023
 
1046
- var ToggleButton = React.forwardRef(function (props, ref) {
1047
- var children = props.children, muiProps = tslib.__rest(props, ["children"]);
1048
- var classes = useToggleButtonStyles(props);
1049
- return (React.createElement(lab.ToggleButton, tslib.__assign({ ref: ref, classes: {
1024
+ const ToggleButton = React.forwardRef((props, ref) => {
1025
+ const { children, ...muiProps } = props;
1026
+ const classes = useToggleButtonStyles(props);
1027
+ return (React.createElement(lab.ToggleButton, { ref: ref, classes: {
1050
1028
  root: classes.root,
1051
1029
  selected: classes.selected,
1052
- } }, muiProps), children));
1030
+ }, ...muiProps }, children));
1053
1031
  });
1054
1032
  ToggleButton.defaultProps = {
1055
1033
  color: 'primary',
1056
1034
  };
1057
1035
  ToggleButton.displayName = 'ToggleButton';
1058
1036
 
1059
- var useToggleButtonGroupStyles = core.makeStyles(function (theme) { return ({
1037
+ const useToggleButtonGroupStyles = core.makeStyles((theme) => ({
1060
1038
  root: {
1061
1039
  '&&': {
1062
1040
  backgroundColor: theme.palette.grey[300],
1063
1041
  },
1064
1042
  },
1065
- }); });
1043
+ }));
1066
1044
 
1067
- var ToggleButtonGroup = React.forwardRef(function (props, ref) {
1068
- var children = props.children, _a = props.color, color = _a === void 0 ? 'primary' : _a, muiProps = tslib.__rest(props, ["children", "color"]);
1069
- var classes = useToggleButtonGroupStyles(props);
1070
- var childrenWithProps = React.Children.map(children, function (child) {
1045
+ const ToggleButtonGroup = React.forwardRef((props, ref) => {
1046
+ const { children, color = 'primary', ...muiProps } = props;
1047
+ const classes = useToggleButtonGroupStyles(props);
1048
+ const childrenWithProps = React.Children.map(children, (child) => {
1071
1049
  if (!React.isValidElement(child)) {
1072
1050
  return null;
1073
1051
  }
1074
- return React.cloneElement(child, { color: color });
1052
+ return React.cloneElement(child, { color });
1075
1053
  });
1076
- return (React.createElement(lab.ToggleButtonGroup, tslib.__assign({ ref: ref, classes: { root: classes.root } }, muiProps), childrenWithProps));
1054
+ return (React.createElement(lab.ToggleButtonGroup, { ref: ref, classes: { root: classes.root }, ...muiProps }, childrenWithProps));
1077
1055
  });
1078
1056
  ToggleButtonGroup.displayName = 'ToggleButtonGroup';
1079
1057
 
1080
- var useTooltipStyles = core.makeStyles(function (_a) {
1081
- var typography = _a.typography;
1082
- return ({
1083
- tooltip: {
1084
- fontSize: typography.pxToRem(16),
1085
- },
1086
- });
1087
- });
1058
+ const useTooltipStyles = core.makeStyles(({ typography }) => ({
1059
+ tooltip: {
1060
+ fontSize: typography.pxToRem(16),
1061
+ },
1062
+ }));
1088
1063
 
1089
- var Tooltip = React.forwardRef(function (props, ref) {
1090
- var classes = useTooltipStyles(props);
1091
- return React.createElement(core.Tooltip, tslib.__assign({ ref: ref, classes: classes }, props));
1064
+ const Tooltip = React.forwardRef((props, ref) => {
1065
+ const classes = useTooltipStyles(props);
1066
+ return React.createElement(core.Tooltip, { ref: ref, classes: classes, ...props });
1092
1067
  });
1093
1068
  Tooltip.displayName = 'Tooltip';
1094
1069
 
1095
- var useCollapsibleText = function () {
1096
- var _a = React.useState(false), open = _a[0], setOpen = _a[1];
1097
- var collapseState = React.useState(false);
1098
- var toggle = function () { return collapseState[0] && setOpen(!open); };
1070
+ const useCollapsibleText = () => {
1071
+ const [open, setOpen] = React.useState(false);
1072
+ const collapseState = React.useState(false);
1073
+ const toggle = () => collapseState[0] && setOpen(!open);
1099
1074
  return {
1100
1075
  collapsibleText: {
1101
- open: open,
1102
- collapseState: collapseState,
1076
+ open,
1077
+ collapseState,
1103
1078
  },
1104
- toggle: toggle,
1079
+ toggle,
1105
1080
  };
1106
1081
  };
1107
1082
 
1108
- var useTabs = function (options) {
1109
- var initialTab = options.initialTab;
1110
- var genTabId = function (id) { return ("tab-" + id).toLowerCase().replace(/ /g, '-'); };
1111
- var genPanelId = function (id) { return ("tab-panel-" + id).toLowerCase().replace(/ /g, '-'); };
1112
- var _a = React.useState(genTabId(initialTab)), activeTab = _a[0], setActiveTab = _a[1];
1113
- var handleChange = function (_, nextTab) { return setActiveTab(nextTab); };
1114
- var TabsProps = { onChange: handleChange, value: activeTab };
1115
- var useTab = function (baseId) {
1116
- var tabId = genTabId(baseId);
1117
- var tabPanelId = genPanelId(baseId);
1118
- var tabProps = {
1083
+ const useTabs = (options) => {
1084
+ const { initialTab } = options;
1085
+ const genTabId = (id) => `tab-${id}`.toLowerCase().replace(/ /g, '-');
1086
+ const genPanelId = (id) => `tab-panel-${id}`.toLowerCase().replace(/ /g, '-');
1087
+ const [activeTab, setActiveTab] = React.useState(genTabId(initialTab));
1088
+ const handleChange = (_, nextTab) => setActiveTab(nextTab);
1089
+ const TabsProps = { onChange: handleChange, value: activeTab };
1090
+ const useTab = (baseId) => {
1091
+ const tabId = genTabId(baseId);
1092
+ const tabPanelId = genPanelId(baseId);
1093
+ const tabProps = {
1119
1094
  id: tabId,
1120
1095
  label: baseId,
1121
1096
  value: tabId,
1122
1097
  'aria-controls': tabPanelId,
1123
1098
  };
1124
- var panelProps = {
1099
+ const panelProps = {
1125
1100
  id: tabPanelId,
1126
1101
  role: 'tabpanel',
1127
1102
  show: activeTab === tabId,
@@ -1130,9 +1105,9 @@ var useTabs = function (options) {
1130
1105
  return [tabProps, panelProps];
1131
1106
  };
1132
1107
  return {
1133
- TabsProps: TabsProps,
1134
- useTab: useTab,
1135
- setActiveTab: function (tabId) { return setActiveTab(tabId); },
1108
+ TabsProps,
1109
+ useTab,
1110
+ setActiveTab: (tabId) => setActiveTab(tabId),
1136
1111
  };
1137
1112
  };
1138
1113