@micromag/screen-keypad 0.4.70 → 0.4.74

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 (3) hide show
  1. package/es/index.d.ts +4 -2
  2. package/es/index.js +1574 -753
  3. package/package.json +24 -23
package/es/index.js CHANGED
@@ -1,16 +1,14 @@
1
1
  import { FormattedMessage, defineMessage } from 'react-intl';
2
- import _objectSpread from '@babel/runtime/helpers/objectSpread2';
3
- import _defineProperty from '@babel/runtime/helpers/defineProperty';
4
- import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
2
+ import { c } from 'react/compiler-runtime';
5
3
  import { animated } from '@react-spring/web';
6
4
  import classNames from 'classnames';
7
5
  import isEmpty from 'lodash/isEmpty';
8
6
  import isString from 'lodash/isString';
9
- import { useRef, useState, useMemo, useEffect, useCallback } from 'react';
7
+ import { useRef, useState, useEffect } from 'react';
10
8
  import { Close, ScreenElement } from '@micromag/core/components';
11
9
  import { usePlaybackContext, usePlaybackMediaRef, useScreenState, useScreenSize, useViewerContext, useViewerWebView, useViewerInteraction, useScreenRenderContext } from '@micromag/core/contexts';
12
10
  import { useTrackScreenEvent, useDimensionObserver, useDragProgress } from '@micromag/core/hooks';
13
- import { isHeaderFilled, isFooterFilled, getFooterProps, isTextFilled, camelCase, getStyleFromBox } from '@micromag/core/utils';
11
+ import { isHeaderFilled, isFooterFilled, getFooterProps, isTextFilled, camelCase, mergeRefs, getStyleFromBox } from '@micromag/core/utils';
14
12
  import Background from '@micromag/element-background';
15
13
  import Button, { RichButton } from '@micromag/element-button';
16
14
  import CallToAction from '@micromag/element-call-to-action';
@@ -27,7 +25,7 @@ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
27
25
 
28
26
  var styles = {"container":"micromag-screen-keypad-container","isPlaceholder":"micromag-screen-keypad-isPlaceholder","layout":"micromag-screen-keypad-layout","background":"micromag-screen-keypad-background","fixedHeader":"micromag-screen-keypad-fixedHeader","open":"micromag-screen-keypad-open","close":"micromag-screen-keypad-close","closeIcon":"micromag-screen-keypad-closeIcon","header":"micromag-screen-keypad-header","footer":"micromag-screen-keypad-footer","inner":"micromag-screen-keypad-inner","title":"micromag-screen-keypad-title","subtitle":"micromag-screen-keypad-subtitle","emptyTitle":"micromag-screen-keypad-emptyTitle","emptyText":"micromag-screen-keypad-emptyText","grid":"micromag-screen-keypad-grid","item":"micromag-screen-keypad-item","button":"micromag-screen-keypad-button","withSquareItems":"micromag-screen-keypad-withSquareItems","isEmpty":"micromag-screen-keypad-isEmpty","disableHover":"micromag-screen-keypad-disableHover","isLink":"micromag-screen-keypad-isLink","imagePlaceholder":"micromag-screen-keypad-imagePlaceholder","buttonPlaceholder":"micromag-screen-keypad-buttonPlaceholder","buttonLabel":"micromag-screen-keypad-buttonLabel","empty":"micromag-screen-keypad-empty","emptyButtonVisual":"micromag-screen-keypad-emptyButtonVisual","emptyButtonLabel":"micromag-screen-keypad-emptyButtonLabel","popupBackdrop":"micromag-screen-keypad-popupBackdrop","popup":"micromag-screen-keypad-popup","popupButton":"micromag-screen-keypad-popupButton","popupScroll":"micromag-screen-keypad-popupScroll","popupInner":"micromag-screen-keypad-popupInner","withShadow":"micromag-screen-keypad-withShadow","popupContent":"micromag-screen-keypad-popupContent","popupVisualImage":"micromag-screen-keypad-popupVisualImage","popupVisualVideo":"micromag-screen-keypad-popupVisualVideo","placeholder":"micromag-screen-keypad-placeholder","popupHeading":"micromag-screen-keypad-popupHeading","popupVisual":"micromag-screen-keypad-popupVisual","contentSplit":"micromag-screen-keypad-contentSplit","emptyHeading":"micromag-screen-keypad-emptyHeading","emptyVisual":"micromag-screen-keypad-emptyVisual","emptyContent":"micromag-screen-keypad-emptyContent","emptyCTA":"micromag-screen-keypad-emptyCTA","popupCTA":"micromag-screen-keypad-popupCTA","contentBottom":"micromag-screen-keypad-contentBottom"};
29
27
 
30
- var placeholders = [{
28
+ const placeholders = [{
31
29
  id: '1'
32
30
  }, {
33
31
  id: '2'
@@ -46,7 +44,7 @@ var placeholders = [{
46
44
  }, {
47
45
  id: '9'
48
46
  }];
49
- var placeholderPopupBoxStyles = {
47
+ const placeholderPopupBoxStyles = {
50
48
  padding: {
51
49
  left: 30,
52
50
  top: 30,
@@ -54,465 +52,849 @@ var placeholderPopupBoxStyles = {
54
52
  bottom: 30
55
53
  }
56
54
  };
57
- function KeypadScreen(_ref) {
58
- var _ref$items = _ref.items,
59
- items = _ref$items === void 0 ? null : _ref$items,
60
- _ref$title = _ref.title,
61
- title = _ref$title === void 0 ? null : _ref$title,
62
- _ref$subtitle = _ref.subtitle,
63
- subtitle = _ref$subtitle === void 0 ? null : _ref$subtitle,
64
- _ref$layout = _ref.layout,
65
- layout = _ref$layout === void 0 ? null : _ref$layout,
66
- _ref$spacing = _ref.spacing,
67
- spacing = _ref$spacing === void 0 ? 20 : _ref$spacing,
68
- _ref$keypadLayout = _ref.keypadLayout,
69
- keypadLayout = _ref$keypadLayout === void 0 ? null : _ref$keypadLayout,
70
- _ref$buttonStyles = _ref.buttonStyles,
71
- buttonStyles = _ref$buttonStyles === void 0 ? null : _ref$buttonStyles,
72
- _ref$popupStyles = _ref.popupStyles,
73
- popupStyles = _ref$popupStyles === void 0 ? null : _ref$popupStyles,
74
- _ref$header = _ref.header,
75
- header = _ref$header === void 0 ? null : _ref$header,
76
- _ref$footer = _ref.footer,
77
- footer = _ref$footer === void 0 ? null : _ref$footer,
78
- _ref$background = _ref.background,
79
- background = _ref$background === void 0 ? null : _ref$background,
80
- _ref$current = _ref.current,
81
- current = _ref$current === void 0 ? true : _ref$current,
82
- _ref$preload = _ref.preload,
83
- preload = _ref$preload === void 0 ? true : _ref$preload,
84
- _ref$withoutCloseButt = _ref.withoutCloseButton,
85
- withoutCloseButton = _ref$withoutCloseButt === void 0 ? false : _ref$withoutCloseButt,
86
- _ref$className = _ref.className,
87
- className = _ref$className === void 0 ? null : _ref$className;
88
- var containerRef = useRef(null);
89
- var popupInnerRef = useRef(null);
90
- var trackScreenEvent = useTrackScreenEvent('keypad');
91
- var _usePlaybackContext = usePlaybackContext(),
92
- muted = _usePlaybackContext.muted;
93
- var _usePlaybackMediaRef = usePlaybackMediaRef(current, true),
94
- mediaRef = _usePlaybackMediaRef.ref,
95
- _usePlaybackMediaRef$ = _usePlaybackMediaRef.isCurrent,
96
- isCurrentMedia = _usePlaybackMediaRef$ === void 0 ? false : _usePlaybackMediaRef$;
97
- var screenState = useScreenState();
98
- var _useScreenSize = useScreenSize(),
99
- width = _useScreenSize.width,
100
- height = _useScreenSize.height,
101
- resolution = _useScreenSize.resolution;
102
- var _useViewerContext = useViewerContext(),
103
- viewerTopHeight = _useViewerContext.topHeight,
104
- viewerBottomHeight = _useViewerContext.bottomHeight,
105
- viewerBottomSidesWidth = _useViewerContext.bottomSidesWidth;
106
- var _useViewerWebView = useViewerWebView(),
107
- openWebView = _useViewerWebView.open;
108
- var _useViewerInteraction = useViewerInteraction(),
109
- enableInteraction = _useViewerInteraction.enableInteraction,
110
- disableInteraction = _useViewerInteraction.disableInteraction;
111
- var _useScreenRenderConte = useScreenRenderContext(),
112
- isView = _useScreenRenderConte.isView,
113
- isPreview = _useScreenRenderConte.isPreview,
114
- isPlaceholder = _useScreenRenderConte.isPlaceholder,
115
- isEdit = _useScreenRenderConte.isEdit;
116
- var hasHeader = isHeaderFilled(header);
117
- var hasFooter = isFooterFilled(footer);
118
- var footerProps = getFooterProps(footer, {
119
- isView: isView,
120
- current: current,
121
- openWebView: openWebView,
122
- isPreview: isPreview
123
- });
124
- var hasTitle = isTextFilled(title);
125
- var _ref2 = title || {},
126
- _ref2$textStyle = _ref2.textStyle,
127
- titleTextStyle = _ref2$textStyle === void 0 ? null : _ref2$textStyle;
128
- var hasSubtitle = isTextFilled(subtitle);
129
- var _useDimensionObserver = useDimensionObserver(),
130
- headerRef = _useDimensionObserver.ref,
131
- _useDimensionObserver2 = _useDimensionObserver.height,
132
- headerHeight = _useDimensionObserver2 === void 0 ? 0 : _useDimensionObserver2;
133
- var _useDimensionObserver3 = useDimensionObserver(),
134
- footerRef = _useDimensionObserver3.ref,
135
- _useDimensionObserver4 = _useDimensionObserver3.height,
136
- footerHeight = _useDimensionObserver4 === void 0 ? 0 : _useDimensionObserver4;
137
- var _useState = useState(false),
138
- _useState2 = _slicedToArray(_useState, 2);
139
- _useState2[0];
140
- var setPopupDragDisabled = _useState2[1];
141
- var backgroundPlaying = current && (isView || isEdit) && (isCurrentMedia || !isView);
142
- var mediaShouldLoad = !isPlaceholder && (current || preload);
143
- var isInteractivePreview = isEdit && screenState === null;
144
- var isNotInteractive = isEdit && screenState !== null;
145
- var _ref3 = keypadLayout || {},
146
- _ref3$columnAlign = _ref3.columnAlign,
147
- columnAlign = _ref3$columnAlign === void 0 ? null : _ref3$columnAlign,
148
- _ref3$columns = _ref3.columns,
149
- columns = _ref3$columns === void 0 ? null : _ref3$columns,
150
- _ref3$spacing = _ref3.spacing,
151
- columnSpacing = _ref3$spacing === void 0 ? null : _ref3$spacing,
152
- _ref3$withSquareItems = _ref3.withSquareItems,
153
- withSquareItems = _ref3$withSquareItems === void 0 ? false : _ref3$withSquareItems;
154
- var _ref4 = buttonStyles || {},
155
- _ref4$layout = _ref4.layout,
156
- buttonLayout = _ref4$layout === void 0 ? null : _ref4$layout,
157
- _ref4$textStyle = _ref4.textStyle,
158
- buttonTextStyle = _ref4$textStyle === void 0 ? null : _ref4$textStyle,
159
- _ref4$labelBoxStyle = _ref4.labelBoxStyle,
160
- buttonLabelBoxStyle = _ref4$labelBoxStyle === void 0 ? null : _ref4$labelBoxStyle,
161
- _ref4$boxStyle = _ref4.boxStyle,
162
- buttonBoxStyle = _ref4$boxStyle === void 0 ? null : _ref4$boxStyle,
163
- _ref4$visualWidth = _ref4.visualWidth,
164
- buttonVisualWidth = _ref4$visualWidth === void 0 ? null : _ref4$visualWidth;
165
- var _ref5 = popupStyles || {},
166
- _ref5$layout = _ref5.layout,
167
- popupLayout = _ref5$layout === void 0 ? null : _ref5$layout,
168
- _ref5$headingTextStyl = _ref5.headingTextStyle,
169
- headingTextStyle = _ref5$headingTextStyl === void 0 ? null : _ref5$headingTextStyl,
170
- _ref5$contentTextStyl = _ref5.contentTextStyle,
171
- contentTextStyle = _ref5$contentTextStyl === void 0 ? null : _ref5$contentTextStyl,
172
- _ref5$button = _ref5.button,
173
- popupButtons = _ref5$button === void 0 ? null : _ref5$button,
174
- _ref5$boxStyle = _ref5.boxStyle,
175
- popupBoxStyle = _ref5$boxStyle === void 0 ? null : _ref5$boxStyle;
176
- var _ref6 = popupButtons || {},
177
- _ref6$buttonTextStyle = _ref6.buttonTextStyle,
178
- popupButtonsTextStyle = _ref6$buttonTextStyle === void 0 ? null : _ref6$buttonTextStyle,
179
- _ref6$boxStyle = _ref6.boxStyle,
180
- popupButtonsBoxStyle = _ref6$boxStyle === void 0 ? null : _ref6$boxStyle;
181
- var popupLayoutClassName = useMemo(function () {
182
- return popupLayout !== null ? camelCase(popupLayout) : '';
183
- }, [popupLayout]);
184
- var _useState3 = useState(false),
185
- _useState4 = _slicedToArray(_useState3, 2),
186
- showPopup = _useState4[0],
187
- setShowPopup = _useState4[1];
188
- var _useState5 = useState(null),
189
- _useState6 = _slicedToArray(_useState5, 2),
190
- popup = _useState6[0],
191
- setPopup = _useState6[1];
192
- var _ref7 = popup || {},
193
- _ref7$heading = _ref7.heading,
194
- popupHeading = _ref7$heading === void 0 ? null : _ref7$heading,
195
- _ref7$content = _ref7.content,
196
- popupContent = _ref7$content === void 0 ? null : _ref7$content,
197
- _ref7$largeVisual = _ref7.largeVisual,
198
- largeVisual = _ref7$largeVisual === void 0 ? null : _ref7$largeVisual,
199
- _ref7$button = _ref7.button,
200
- popupButton = _ref7$button === void 0 ? null : _ref7$button,
201
- _ref7$popupBoxStyle = _ref7.popupBoxStyle,
202
- singlePopupBoxStyle = _ref7$popupBoxStyle === void 0 ? null : _ref7$popupBoxStyle;
203
- var _ref8 = largeVisual || {},
204
- _ref8$metadata = _ref8.metadata,
205
- metadata = _ref8$metadata === void 0 ? null : _ref8$metadata;
206
- var _ref9 = metadata || {},
207
- _ref9$width = _ref9.width,
208
- largeVisualWidth = _ref9$width === void 0 ? 0 : _ref9$width,
209
- _ref9$height = _ref9.height,
210
- largeVisualHeight = _ref9$height === void 0 ? 0 : _ref9$height;
211
- var largeVisualRatio = largeVisualWidth > 0 && largeVisualHeight > 0 ? largeVisualWidth / largeVisualHeight : null;
212
- var hasPopupHeading = isTextFilled(popupHeading);
213
- var _ref0 = popupHeading || {},
214
- _ref0$textStyle = _ref0.textStyle,
215
- popupHeadingTextStyle = _ref0$textStyle === void 0 ? null : _ref0$textStyle;
216
- var hasPopupContent = isTextFilled(popupContent);
217
- var _ref1 = popupContent || {},
218
- _ref1$textStyle = _ref1.textStyle,
219
- popupContentTextStyle = _ref1$textStyle === void 0 ? null : _ref1$textStyle;
220
- var _ref10 = popupButton || {},
221
- _ref10$label = _ref10.label,
222
- buttonLabel = _ref10$label === void 0 ? null : _ref10$label,
223
- _ref10$url = _ref10.url,
224
- buttonUrl = _ref10$url === void 0 ? null : _ref10$url,
225
- _ref10$inWebView = _ref10.inWebView,
226
- popupInWebView = _ref10$inWebView === void 0 ? false : _ref10$inWebView,
227
- _ref10$boxStyle = _ref10.boxStyle,
228
- popupButtonBoxStyle = _ref10$boxStyle === void 0 ? null : _ref10$boxStyle;
229
-
230
- // Skips a render loop when opening a popup
231
- var _useState7 = useState(false),
232
- _useState8 = _slicedToArray(_useState7, 2),
233
- showNextPopup = _useState8[0],
234
- setShowNextPopup = _useState8[1];
235
- useEffect(function () {
236
- if (showNextPopup) {
237
- setShowNextPopup(false);
238
- setShowPopup(true);
239
- }
240
- }, [showNextPopup, setShowPopup, setShowNextPopup]);
241
- var onItemClick = useCallback(function (e, item, index) {
242
- e.stopPropagation();
243
- if (isNotInteractive) {
244
- return;
245
- }
246
- var _ref11 = item || {},
247
- _ref11$label = _ref11.label,
248
- itemLabel = _ref11$label === void 0 ? null : _ref11$label,
249
- _ref11$heading = _ref11.heading,
250
- heading = _ref11$heading === void 0 ? null : _ref11$heading,
251
- _ref11$inWebView = _ref11.inWebView,
252
- inWebView = _ref11$inWebView === void 0 ? false : _ref11$inWebView,
253
- _ref11$url = _ref11.url,
254
- url = _ref11$url === void 0 ? null : _ref11$url;
255
- if (inWebView && url !== null) {
256
- openWebView({
257
- url: url
258
- });
259
- } else {
260
- setPopup(item);
261
- setShowNextPopup(true);
262
- }
263
- var _ref12 = heading || {},
264
- _ref12$body = _ref12.body,
265
- headingBody = _ref12$body === void 0 ? null : _ref12$body;
266
- var finalLabel = isString(itemLabel) ? itemLabel : (itemLabel || {}).body || null;
267
- trackScreenEvent('click_item', ["#".concat(index + 1), finalLabel || headingBody || ''].filter(function (it) {
268
- return !isEmpty(it);
269
- }).join(' '), {
270
- linkType: 'keypad_item',
271
- linkUrl: url || null
55
+ function KeypadScreen(t0) {
56
+ const $ = c(315);
57
+ const {
58
+ items: t1,
59
+ title: t2,
60
+ subtitle: t3,
61
+ layout: t4,
62
+ spacing: t5,
63
+ keypadLayout: t6,
64
+ buttonStyles: t7,
65
+ popupStyles: t8,
66
+ header: t9,
67
+ footer: t10,
68
+ background: t11,
69
+ current: t12,
70
+ preload: t13,
71
+ withoutCloseButton: t14,
72
+ mediaRef: t15,
73
+ className: t16
74
+ } = t0;
75
+ const items = t1 === undefined ? null : t1;
76
+ const title = t2 === undefined ? null : t2;
77
+ const subtitle = t3 === undefined ? null : t3;
78
+ const layout = t4 === undefined ? null : t4;
79
+ const spacing = t5 === undefined ? 20 : t5;
80
+ const keypadLayout = t6 === undefined ? null : t6;
81
+ const buttonStyles = t7 === undefined ? null : t7;
82
+ const popupStyles = t8 === undefined ? null : t8;
83
+ const header = t9 === undefined ? null : t9;
84
+ const footer = t10 === undefined ? null : t10;
85
+ const background = t11 === undefined ? null : t11;
86
+ const current = t12 === undefined ? true : t12;
87
+ const preload = t13 === undefined ? true : t13;
88
+ const withoutCloseButton = t14 === undefined ? false : t14;
89
+ const customMediaRef = t15 === undefined ? null : t15;
90
+ const className = t16 === undefined ? null : t16;
91
+ const containerRef = useRef(null);
92
+ const popupInnerRef = useRef(null);
93
+ const trackScreenEvent = useTrackScreenEvent("keypad");
94
+ const {
95
+ muted
96
+ } = usePlaybackContext();
97
+ const {
98
+ ref: mediaRef,
99
+ isCurrent: t17
100
+ } = usePlaybackMediaRef(current, true);
101
+ const isCurrentMedia = t17 === undefined ? false : t17;
102
+ const screenState = useScreenState();
103
+ const {
104
+ width,
105
+ height,
106
+ resolution
107
+ } = useScreenSize();
108
+ const {
109
+ topHeight: viewerTopHeight,
110
+ bottomHeight: viewerBottomHeight,
111
+ bottomSidesWidth: viewerBottomSidesWidth
112
+ } = useViewerContext();
113
+ const {
114
+ open: openWebView
115
+ } = useViewerWebView();
116
+ const {
117
+ enableInteraction,
118
+ disableInteraction
119
+ } = useViewerInteraction();
120
+ const {
121
+ isView,
122
+ isPreview,
123
+ isPlaceholder,
124
+ isEdit
125
+ } = useScreenRenderContext();
126
+ let t18;
127
+ if ($[0] !== header) {
128
+ t18 = isHeaderFilled(header);
129
+ $[0] = header;
130
+ $[1] = t18;
131
+ } else {
132
+ t18 = $[1];
133
+ }
134
+ const hasHeader = t18;
135
+ let t19;
136
+ if ($[2] !== footer) {
137
+ t19 = isFooterFilled(footer);
138
+ $[2] = footer;
139
+ $[3] = t19;
140
+ } else {
141
+ t19 = $[3];
142
+ }
143
+ const hasFooter = t19;
144
+ let t20;
145
+ if ($[4] !== current || $[5] !== footer || $[6] !== isPreview || $[7] !== isView || $[8] !== openWebView) {
146
+ t20 = getFooterProps(footer, {
147
+ isView,
148
+ current,
149
+ openWebView,
150
+ isPreview
272
151
  });
273
- }, [setPopup, setShowPopup, trackScreenEvent, openWebView, isNotInteractive]);
274
- var onCloseModal = useCallback(function () {
275
- var isShowPopup = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
276
- if (isNotInteractive) {
277
- return;
278
- }
279
- if (isShowPopup) {
280
- trackScreenEvent('close_modal');
281
- }
282
- setShowPopup(false);
283
- setPopupDragDisabled(false);
284
- }, [setShowPopup, setPopupDragDisabled, trackScreenEvent, isNotInteractive]);
285
- var onClickClose = useCallback(function (e) {
286
- if (isNotInteractive) {
287
- return;
288
- }
289
- e.preventDefault();
290
- e.stopPropagation();
291
- onCloseModal(showPopup);
292
- }, [onCloseModal, isNotInteractive, showPopup]);
293
- var onClickCta = useCallback(function () {
294
- var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
295
- if (e !== null) {
152
+ $[4] = current;
153
+ $[5] = footer;
154
+ $[6] = isPreview;
155
+ $[7] = isView;
156
+ $[8] = openWebView;
157
+ $[9] = t20;
158
+ } else {
159
+ t20 = $[9];
160
+ }
161
+ const footerProps = t20;
162
+ let t21;
163
+ if ($[10] !== title) {
164
+ t21 = isTextFilled(title);
165
+ $[10] = title;
166
+ $[11] = t21;
167
+ } else {
168
+ t21 = $[11];
169
+ }
170
+ const hasTitle = t21;
171
+ let t22;
172
+ if ($[12] !== title) {
173
+ t22 = title || {};
174
+ $[12] = title;
175
+ $[13] = t22;
176
+ } else {
177
+ t22 = $[13];
178
+ }
179
+ const {
180
+ textStyle: t23
181
+ } = t22;
182
+ const titleTextStyle = t23 === undefined ? null : t23;
183
+ let t24;
184
+ if ($[14] !== subtitle) {
185
+ t24 = isTextFilled(subtitle);
186
+ $[14] = subtitle;
187
+ $[15] = t24;
188
+ } else {
189
+ t24 = $[15];
190
+ }
191
+ const hasSubtitle = t24;
192
+ const {
193
+ ref: headerRef,
194
+ height: t25
195
+ } = useDimensionObserver();
196
+ const headerHeight = t25 === undefined ? 0 : t25;
197
+ const {
198
+ ref: footerRef,
199
+ height: t26
200
+ } = useDimensionObserver();
201
+ const footerHeight = t26 === undefined ? 0 : t26;
202
+ const [, setPopupDragDisabled] = useState(false);
203
+ const backgroundPlaying = current && (isView || isEdit) && (isCurrentMedia || !isView);
204
+ const mediaShouldLoad = !isPlaceholder && (current || preload);
205
+ const isInteractivePreview = isEdit && screenState === null;
206
+ const isNotInteractive = isEdit && screenState !== null;
207
+ const {
208
+ columnAlign: t27,
209
+ columns: t28,
210
+ spacing: t29,
211
+ withSquareItems: t30
212
+ } = keypadLayout || {};
213
+ const columnAlign = t27 === undefined ? null : t27;
214
+ const columns = t28 === undefined ? null : t28;
215
+ const columnSpacing = t29 === undefined ? null : t29;
216
+ const withSquareItems = t30 === undefined ? false : t30;
217
+ let t31;
218
+ if ($[16] !== buttonStyles) {
219
+ t31 = buttonStyles || {};
220
+ $[16] = buttonStyles;
221
+ $[17] = t31;
222
+ } else {
223
+ t31 = $[17];
224
+ }
225
+ const {
226
+ layout: t32,
227
+ textStyle: t33,
228
+ labelBoxStyle: t34,
229
+ boxStyle: t35,
230
+ visualWidth: t36
231
+ } = t31;
232
+ const buttonLayout = t32 === undefined ? null : t32;
233
+ const buttonTextStyle = t33 === undefined ? null : t33;
234
+ const buttonLabelBoxStyle = t34 === undefined ? null : t34;
235
+ const buttonBoxStyle = t35 === undefined ? null : t35;
236
+ const buttonVisualWidth = t36 === undefined ? null : t36;
237
+ let t37;
238
+ if ($[18] !== popupStyles) {
239
+ t37 = popupStyles || {};
240
+ $[18] = popupStyles;
241
+ $[19] = t37;
242
+ } else {
243
+ t37 = $[19];
244
+ }
245
+ const {
246
+ layout: t38,
247
+ headingTextStyle: t39,
248
+ contentTextStyle: t40,
249
+ button: t41,
250
+ boxStyle: t42
251
+ } = t37;
252
+ const popupLayout = t38 === undefined ? null : t38;
253
+ const headingTextStyle = t39 === undefined ? null : t39;
254
+ const contentTextStyle = t40 === undefined ? null : t40;
255
+ const popupButtons = t41 === undefined ? null : t41;
256
+ const popupBoxStyle = t42 === undefined ? null : t42;
257
+ let t43;
258
+ if ($[20] !== popupButtons) {
259
+ t43 = popupButtons || {};
260
+ $[20] = popupButtons;
261
+ $[21] = t43;
262
+ } else {
263
+ t43 = $[21];
264
+ }
265
+ const {
266
+ buttonTextStyle: t44,
267
+ boxStyle: t45
268
+ } = t43;
269
+ const popupButtonsTextStyle = t44 === undefined ? null : t44;
270
+ const popupButtonsBoxStyle = t45 === undefined ? null : t45;
271
+ const popupLayoutClassName = popupLayout !== null ? camelCase(popupLayout) : "";
272
+ const [showPopup, setShowPopup] = useState(false);
273
+ const [popup, setPopup] = useState(null);
274
+ let t46;
275
+ if ($[22] !== popup) {
276
+ t46 = popup || {};
277
+ $[22] = popup;
278
+ $[23] = t46;
279
+ } else {
280
+ t46 = $[23];
281
+ }
282
+ const {
283
+ heading: t47,
284
+ content: t48,
285
+ largeVisual: t49,
286
+ button: t50,
287
+ popupBoxStyle: t51
288
+ } = t46;
289
+ const popupHeading = t47 === undefined ? null : t47;
290
+ const popupContent = t48 === undefined ? null : t48;
291
+ const largeVisual = t49 === undefined ? null : t49;
292
+ const popupButton = t50 === undefined ? null : t50;
293
+ const singlePopupBoxStyle = t51 === undefined ? null : t51;
294
+ let t52;
295
+ if ($[24] !== largeVisual) {
296
+ t52 = largeVisual || {};
297
+ $[24] = largeVisual;
298
+ $[25] = t52;
299
+ } else {
300
+ t52 = $[25];
301
+ }
302
+ const {
303
+ metadata: t53
304
+ } = t52;
305
+ const metadata = t53 === undefined ? null : t53;
306
+ let t54;
307
+ if ($[26] !== metadata) {
308
+ t54 = metadata || {};
309
+ $[26] = metadata;
310
+ $[27] = t54;
311
+ } else {
312
+ t54 = $[27];
313
+ }
314
+ const {
315
+ width: t55,
316
+ height: t56
317
+ } = t54;
318
+ const largeVisualWidth = t55 === undefined ? 0 : t55;
319
+ const largeVisualHeight = t56 === undefined ? 0 : t56;
320
+ const largeVisualRatio = largeVisualWidth > 0 && largeVisualHeight > 0 ? largeVisualWidth / largeVisualHeight : null;
321
+ let t57;
322
+ if ($[28] !== popupHeading) {
323
+ t57 = isTextFilled(popupHeading);
324
+ $[28] = popupHeading;
325
+ $[29] = t57;
326
+ } else {
327
+ t57 = $[29];
328
+ }
329
+ const hasPopupHeading = t57;
330
+ let t58;
331
+ if ($[30] !== popupHeading) {
332
+ t58 = popupHeading || {};
333
+ $[30] = popupHeading;
334
+ $[31] = t58;
335
+ } else {
336
+ t58 = $[31];
337
+ }
338
+ const {
339
+ textStyle: t59
340
+ } = t58;
341
+ const popupHeadingTextStyle = t59 === undefined ? null : t59;
342
+ let t60;
343
+ if ($[32] !== popupContent) {
344
+ t60 = isTextFilled(popupContent);
345
+ $[32] = popupContent;
346
+ $[33] = t60;
347
+ } else {
348
+ t60 = $[33];
349
+ }
350
+ const hasPopupContent = t60;
351
+ let t61;
352
+ if ($[34] !== popupContent) {
353
+ t61 = popupContent || {};
354
+ $[34] = popupContent;
355
+ $[35] = t61;
356
+ } else {
357
+ t61 = $[35];
358
+ }
359
+ const {
360
+ textStyle: t62
361
+ } = t61;
362
+ const popupContentTextStyle = t62 === undefined ? null : t62;
363
+ let t63;
364
+ if ($[36] !== popupButton) {
365
+ t63 = popupButton || {};
366
+ $[36] = popupButton;
367
+ $[37] = t63;
368
+ } else {
369
+ t63 = $[37];
370
+ }
371
+ const {
372
+ label: t64,
373
+ url: t65,
374
+ inWebView: t66,
375
+ boxStyle: t67
376
+ } = t63;
377
+ const buttonLabel = t64 === undefined ? null : t64;
378
+ const buttonUrl = t65 === undefined ? null : t65;
379
+ const popupInWebView = t66 === undefined ? false : t66;
380
+ const popupButtonBoxStyle = t67 === undefined ? null : t67;
381
+ const [showNextPopup, setShowNextPopup] = useState(false);
382
+ let t68;
383
+ let t69;
384
+ if ($[38] !== showNextPopup) {
385
+ t68 = () => {
386
+ if (showNextPopup) {
387
+ setShowNextPopup(false);
388
+ setShowPopup(true);
389
+ }
390
+ };
391
+ t69 = [showNextPopup, setShowPopup, setShowNextPopup];
392
+ $[38] = showNextPopup;
393
+ $[39] = t68;
394
+ $[40] = t69;
395
+ } else {
396
+ t68 = $[39];
397
+ t69 = $[40];
398
+ }
399
+ useEffect(t68, t69);
400
+ let t70;
401
+ if ($[41] !== isNotInteractive || $[42] !== openWebView || $[43] !== trackScreenEvent) {
402
+ t70 = (e, item, index) => {
296
403
  e.stopPropagation();
297
- }
298
- }, []);
299
- var _useState9 = useState(null),
300
- _useState0 = _slicedToArray(_useState9, 2),
301
- popupDragDirection = _useState0[0],
302
- setPopupDragDirection = _useState0[1];
303
- var onPopupScrollHeightChange = useCallback(function (_ref13) {
304
- var _ref13$scrolleeHeight = _ref13.scrolleeHeight,
305
- scrolleeHeight = _ref13$scrolleeHeight === void 0 ? 0 : _ref13$scrolleeHeight;
306
- if (Math.floor(scrolleeHeight) >= Math.floor(height)) {
307
- setPopupDragDirection('top');
308
- } else {
309
- setPopupDragDirection('bottom');
310
- }
311
- }, [height]);
312
- var computePopupProgress = useCallback(function (_ref14) {
313
- var _ref14$active = _ref14.active,
314
- dragActive = _ref14$active === void 0 ? false : _ref14$active,
315
- _ref14$movement = _slicedToArray(_ref14.movement, 2),
316
- _ref14$movement$ = _ref14$movement[1],
317
- my = _ref14$movement$ === void 0 ? null : _ref14$movement$,
318
- _ref14$velocity = _slicedToArray(_ref14.velocity, 2),
319
- _ref14$velocity$ = _ref14$velocity[1],
320
- vy = _ref14$velocity$ === void 0 ? null : _ref14$velocity$;
321
- var damper = 0.5;
322
- var windowHeight = typeof window !== 'undefined' ? window.innerHeight : 0;
323
- var delta = windowHeight > 0 && my !== null ? Math.abs(my) / windowHeight : 0;
324
- var reachedThreshold = vy !== null ? vy > 1 || delta > 0.3 : false;
325
- var progress = 0;
326
- if (popupDragDirection === 'top' && my !== null && my < 0) {
327
- progress = delta * damper * -1;
328
- } else if (popupDragDirection === 'bottom' && my !== null && my > 0) {
329
- progress = delta * damper;
330
- }
331
- if (!dragActive) {
332
- if (reachedThreshold) {
333
- onCloseModal(true);
334
- return 1;
404
+ if (isNotInteractive) {
405
+ return;
335
406
  }
336
- return 0;
337
- }
338
- return progress;
339
- }, [onCloseModal, popupDragDirection]);
340
- useEffect(function () {
341
- if (showPopup) {
342
- disableInteraction();
343
- } else {
344
- enableInteraction();
345
- }
346
- }, [showPopup, enableInteraction, disableInteraction]);
347
- useEffect(function () {
348
- function handleClickOutside(e) {
349
- if (!current && isView || popupInnerRef.current && !popupInnerRef.current.contains(e.target) && containerRef.current && containerRef.current.contains(e.target) && !isInteractivePreview && !isEdit && showPopup) {
350
- e.preventDefault();
351
- e.stopPropagation();
352
- onCloseModal(showPopup);
407
+ const {
408
+ label: t71,
409
+ heading: t72,
410
+ inWebView: t73,
411
+ url: t74
412
+ } = item || {};
413
+ const itemLabel = t71 === undefined ? null : t71;
414
+ const heading = t72 === undefined ? null : t72;
415
+ const inWebView = t73 === undefined ? false : t73;
416
+ const url = t74 === undefined ? null : t74;
417
+ if (inWebView && url !== null) {
418
+ openWebView({
419
+ url
420
+ });
421
+ } else {
422
+ setPopup(item);
423
+ setShowNextPopup(true);
353
424
  }
354
- }
355
- document.addEventListener('mouseup', handleClickOutside);
356
- return function () {
357
- document.removeEventListener('mouseup', handleClickOutside);
358
- };
359
- }, [current, popupInnerRef, containerRef, isInteractivePreview, isEdit, showPopup]);
360
- var onPopupScrollBottom = useCallback(function () {
361
- setPopupDragDisabled(false);
362
- }, [setPopupDragDisabled]);
363
- var onPopupScrollNotBottom = useCallback(function () {
364
- setPopupDragDisabled(true);
365
- }, [setPopupDragDisabled]);
366
- var onScrolledTrigger = useCallback(function () {
367
- var trigger = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
368
- if (trigger !== null) {
369
- var scrollPercent = Math.round(trigger * 100);
370
- trackScreenEvent('scroll', scrollPercent, {
371
- scrollPercent: scrollPercent
425
+ const {
426
+ body: t75
427
+ } = heading || {};
428
+ const headingBody = t75 === undefined ? null : t75;
429
+ const finalLabel = isString(itemLabel) ? itemLabel : (itemLabel || {}).body || null;
430
+ trackScreenEvent("click_item", [`#${index + 1}`, finalLabel || headingBody || ""].filter(_temp).join(" "), {
431
+ linkType: "keypad_item",
432
+ linkUrl: url || null
372
433
  });
373
- }
374
- }, [trackScreenEvent]);
375
- var onTap = useCallback(function () {
376
- onCloseModal(showPopup);
377
- }, [onCloseModal, showPopup]);
378
- var onResolve = useCallback(function () {}, []);
379
- var _useDragProgress = useDragProgress({
380
- disabled: true,
381
- // !isView || popupDragDisabled, // TODO: remove drag/popupDragDisabled if we're cool with it
382
- progress: showPopup ? 0 : 1,
383
- computeProgress: computePopupProgress,
384
- onResolve: onResolve,
385
- springParams: {
386
- config: {
387
- tension: 300,
388
- friction: 30
434
+ };
435
+ $[41] = isNotInteractive;
436
+ $[42] = openWebView;
437
+ $[43] = trackScreenEvent;
438
+ $[44] = t70;
439
+ } else {
440
+ t70 = $[44];
441
+ }
442
+ const onItemClick = t70;
443
+ let t71;
444
+ if ($[45] !== isNotInteractive || $[46] !== trackScreenEvent) {
445
+ t71 = t72 => {
446
+ const isShowPopup = t72 === undefined ? false : t72;
447
+ if (isNotInteractive) {
448
+ return;
449
+ }
450
+ if (isShowPopup) {
451
+ trackScreenEvent("close_modal");
452
+ }
453
+ setShowPopup(false);
454
+ setPopupDragDisabled(false);
455
+ };
456
+ $[45] = isNotInteractive;
457
+ $[46] = trackScreenEvent;
458
+ $[47] = t71;
459
+ } else {
460
+ t71 = $[47];
461
+ }
462
+ const onCloseModal = t71;
463
+ let t72;
464
+ if ($[48] !== isNotInteractive || $[49] !== onCloseModal || $[50] !== showPopup) {
465
+ t72 = e_0 => {
466
+ if (isNotInteractive) {
467
+ return;
468
+ }
469
+ e_0.preventDefault();
470
+ e_0.stopPropagation();
471
+ onCloseModal(showPopup);
472
+ };
473
+ $[48] = isNotInteractive;
474
+ $[49] = onCloseModal;
475
+ $[50] = showPopup;
476
+ $[51] = t72;
477
+ } else {
478
+ t72 = $[51];
479
+ }
480
+ const onClickClose = t72;
481
+ const onClickCta = _temp2;
482
+ const [popupDragDirection, setPopupDragDirection] = useState(null);
483
+ let t73;
484
+ if ($[52] !== height) {
485
+ t73 = t74 => {
486
+ const {
487
+ scrolleeHeight: t75
488
+ } = t74;
489
+ const scrolleeHeight = t75 === undefined ? 0 : t75;
490
+ if (Math.floor(scrolleeHeight) >= Math.floor(height)) {
491
+ setPopupDragDirection("top");
492
+ } else {
493
+ setPopupDragDirection("bottom");
494
+ }
495
+ };
496
+ $[52] = height;
497
+ $[53] = t73;
498
+ } else {
499
+ t73 = $[53];
500
+ }
501
+ const onPopupScrollHeightChange = t73;
502
+ let t74;
503
+ if ($[54] !== onCloseModal || $[55] !== popupDragDirection) {
504
+ t74 = t75 => {
505
+ const {
506
+ active: t76,
507
+ movement: t77,
508
+ velocity: t78
509
+ } = t75;
510
+ const dragActive = t76 === undefined ? false : t76;
511
+ const [, t79] = t77;
512
+ const my = t79 === undefined ? null : t79;
513
+ const [, t80] = t78;
514
+ const vy = t80 === undefined ? null : t80;
515
+ const windowHeight = typeof window !== "undefined" ? window.innerHeight : 0;
516
+ const delta = windowHeight > 0 && my !== null ? Math.abs(my) / windowHeight : 0;
517
+ const reachedThreshold = vy !== null ? vy > 1 || delta > 0.3 : false;
518
+ let progress = 0;
519
+ if (popupDragDirection === "top" && my !== null && my < 0) {
520
+ progress = delta * 0.5 * -1;
521
+ } else {
522
+ if (popupDragDirection === "bottom" && my !== null && my > 0) {
523
+ progress = delta * 0.5;
389
524
  }
390
- },
391
- dragOptions: {
392
- filterTaps: true,
393
- preventDefault: true,
394
- stopPropagation: true
395
- },
396
- onTap: onTap
397
- }),
398
- bindPopupDrag = _useDragProgress.bind,
399
- popupSpring = _useDragProgress.progress,
400
- popupTransitioning = _useDragProgress.transitioning;
401
- useEffect(function () {
402
- var keyup = function keyup(e) {
403
- if (e.key === 'Escape') {
404
- if (showPopup) {
525
+ }
526
+ if (!dragActive) {
527
+ if (reachedThreshold) {
528
+ onCloseModal(true);
529
+ return 1;
530
+ }
531
+ return 0;
532
+ }
533
+ return progress;
534
+ };
535
+ $[54] = onCloseModal;
536
+ $[55] = popupDragDirection;
537
+ $[56] = t74;
538
+ } else {
539
+ t74 = $[56];
540
+ }
541
+ const computePopupProgress = t74;
542
+ let t75;
543
+ let t76;
544
+ if ($[57] !== disableInteraction || $[58] !== enableInteraction || $[59] !== showPopup) {
545
+ t75 = () => {
546
+ if (showPopup) {
547
+ disableInteraction();
548
+ } else {
549
+ enableInteraction();
550
+ }
551
+ };
552
+ t76 = [showPopup, enableInteraction, disableInteraction];
553
+ $[57] = disableInteraction;
554
+ $[58] = enableInteraction;
555
+ $[59] = showPopup;
556
+ $[60] = t75;
557
+ $[61] = t76;
558
+ } else {
559
+ t75 = $[60];
560
+ t76 = $[61];
561
+ }
562
+ useEffect(t75, t76);
563
+ let t77;
564
+ if ($[62] !== current || $[63] !== isEdit || $[64] !== isInteractivePreview || $[65] !== isView || $[66] !== onCloseModal || $[67] !== showPopup) {
565
+ t77 = () => {
566
+ const handleClickOutside = function handleClickOutside(e_2) {
567
+ if (!current && isView || popupInnerRef.current && !popupInnerRef.current.contains(e_2.target) && containerRef.current && containerRef.current.contains(e_2.target) && !isInteractivePreview && !isEdit && showPopup) {
568
+ e_2.preventDefault();
569
+ e_2.stopPropagation();
405
570
  onCloseModal(showPopup);
406
571
  }
572
+ };
573
+ document.addEventListener("mouseup", handleClickOutside);
574
+ return () => {
575
+ document.removeEventListener("mouseup", handleClickOutside);
576
+ };
577
+ };
578
+ $[62] = current;
579
+ $[63] = isEdit;
580
+ $[64] = isInteractivePreview;
581
+ $[65] = isView;
582
+ $[66] = onCloseModal;
583
+ $[67] = showPopup;
584
+ $[68] = t77;
585
+ } else {
586
+ t77 = $[68];
587
+ }
588
+ let t78;
589
+ if ($[69] !== current || $[70] !== isEdit || $[71] !== isInteractivePreview || $[72] !== showPopup) {
590
+ t78 = [current, popupInnerRef, containerRef, isInteractivePreview, isEdit, showPopup];
591
+ $[69] = current;
592
+ $[70] = isEdit;
593
+ $[71] = isInteractivePreview;
594
+ $[72] = showPopup;
595
+ $[73] = t78;
596
+ } else {
597
+ t78 = $[73];
598
+ }
599
+ useEffect(t77, t78);
600
+ let t79;
601
+ if ($[74] === Symbol.for("react.memo_cache_sentinel")) {
602
+ t79 = () => {
603
+ setPopupDragDisabled(false);
604
+ };
605
+ $[74] = t79;
606
+ } else {
607
+ t79 = $[74];
608
+ }
609
+ const onPopupScrollBottom = t79;
610
+ let t80;
611
+ if ($[75] === Symbol.for("react.memo_cache_sentinel")) {
612
+ t80 = () => {
613
+ setPopupDragDisabled(true);
614
+ };
615
+ $[75] = t80;
616
+ } else {
617
+ t80 = $[75];
618
+ }
619
+ const onPopupScrollNotBottom = t80;
620
+ let t81;
621
+ if ($[76] !== trackScreenEvent) {
622
+ t81 = t82 => {
623
+ const trigger = t82 === undefined ? null : t82;
624
+ if (trigger !== null) {
625
+ const scrollPercent = Math.round(trigger * 100);
626
+ trackScreenEvent("scroll", scrollPercent, {
627
+ scrollPercent
628
+ });
407
629
  }
408
630
  };
409
- document.addEventListener('keyup', keyup);
410
- return function () {
411
- document.removeEventListener('keyup', keyup);
631
+ $[76] = trackScreenEvent;
632
+ $[77] = t81;
633
+ } else {
634
+ t81 = $[77];
635
+ }
636
+ const onScrolledTrigger = t81;
637
+ let t82;
638
+ if ($[78] !== onCloseModal || $[79] !== showPopup) {
639
+ t82 = () => {
640
+ onCloseModal(showPopup);
412
641
  };
413
- }, [showPopup, onCloseModal]);
414
- var gridItems = useMemo(function () {
415
- return (items === null || items.length === 0 ? placeholders : items).map(function (item, index) {
416
- var _ref15 = item || {},
417
- _ref15$id = _ref15.id,
418
- id = _ref15$id === void 0 ? null : _ref15$id,
419
- _ref15$label = _ref15.label,
420
- itemLabel = _ref15$label === void 0 ? null : _ref15$label,
421
- _ref15$visual = _ref15.visual,
422
- visual = _ref15$visual === void 0 ? null : _ref15$visual,
423
- _ref15$boxStyle = _ref15.boxStyle,
424
- boxStyle = _ref15$boxStyle === void 0 ? null : _ref15$boxStyle,
425
- _ref15$heading = _ref15.heading,
426
- heading = _ref15$heading === void 0 ? null : _ref15$heading,
427
- _ref15$content = _ref15.content,
428
- content = _ref15$content === void 0 ? null : _ref15$content,
429
- _ref15$url = _ref15.url,
430
- url = _ref15$url === void 0 ? null : _ref15$url,
431
- _ref15$inWebView = _ref15.inWebView,
432
- inWebView = _ref15$inWebView === void 0 ? false : _ref15$inWebView,
433
- _ref15$largeVisual = _ref15.largeVisual,
434
- popupLargeVisual = _ref15$largeVisual === void 0 ? null : _ref15$largeVisual;
435
- var _ref16 = visual || {},
436
- _ref16$url = _ref16.url,
437
- visualUrl = _ref16$url === void 0 ? null : _ref16$url;
438
- var _ref17 = heading || {},
439
- _ref17$body = _ref17.body,
440
- headingBody = _ref17$body === void 0 ? null : _ref17$body;
441
- var _ref18 = content || {},
442
- _ref18$body = _ref18.body,
443
- contentBody = _ref18$body === void 0 ? null : _ref18$body;
444
- var finalLabel = isString(itemLabel) ? {
445
- body: itemLabel
446
- } : itemLabel || {};
447
- var _ref19 = finalLabel || {},
448
- _ref19$textStyle = _ref19.textStyle,
449
- finalLabelTextStyle = _ref19$textStyle === void 0 ? null : _ref19$textStyle;
450
- var _ref20 = finalLabel || {},
451
- _ref20$body = _ref20.body,
452
- finalBody = _ref20$body === void 0 ? null : _ref20$body;
453
- var key = finalBody || visualUrl || id;
454
- var itemIsEmpty = finalBody === null && visual === null;
455
- var isExternalLink = url !== null && !inWebView;
456
- var isPopupEmpty = (heading === null || headingBody === null || headingBody === '') && (content === null || contentBody === null || contentBody === '') && popupLargeVisual === null;
457
- return /*#__PURE__*/jsx("div", {
458
- className: styles.item,
459
- children: /*#__PURE__*/jsx(RichButton, {
460
- className: classNames([styles.button, _defineProperty(_defineProperty(_defineProperty({}, styles.isEmpty, itemIsEmpty), styles.isLink, url !== null), styles.disableHover, isPopupEmpty && url === null)]),
461
- layout: buttonLayout || null,
462
- external: isExternalLink,
463
- href: isExternalLink ? url : null,
464
- focusable: current,
465
- onClick: !isPopupEmpty || url !== null && !isExternalLink ? function (e) {
466
- return onItemClick(e, item, index);
467
- } : null
468
- // style={{
469
- // ...getStyleFromAlignment(alignment, true, 'flex-start'),
470
- // }}
471
- ,
472
- textStyle: _objectSpread(_objectSpread({}, buttonTextStyle), finalLabelTextStyle),
473
- buttonStyle: _objectSpread(_objectSpread({}, buttonBoxStyle), boxStyle),
474
- label: finalLabel,
475
- labelBoxStyle: buttonLabelBoxStyle,
476
- visual: visual,
477
- visualWidth: buttonVisualWidth !== null ? "".concat(buttonVisualWidth, "%") : null,
478
- resolution: resolution,
479
- textClassName: styles.buttonLabel
480
- })
481
- }, key);
482
- });
483
- }, [items, screenState, buttonBoxStyle, buttonTextStyle, buttonLayout, isNotInteractive]);
484
- useEffect(function () {
485
- if (screenState === 'popup' && isPlaceholder) {
486
- setPopup(placeholderPopupBoxStyles);
487
- setShowPopup(true);
488
- }
489
- if (screenState === 'keypad') {
490
- setPopup(null);
491
- setShowPopup(false);
492
- }
493
- if (screenState != null && screenState.includes('popup')) {
494
- var index = screenState.split('.').pop();
495
- var found = items[index];
496
- setPopup(found);
497
- setShowPopup(true);
498
- }
499
- if (screenState == null && !isView) {
500
- setPopup(null);
501
- setShowPopup(false);
502
- }
503
- }, [screenState, items, isView]);
504
-
505
- // Clear popup contents after close transition completes
506
- useEffect(function () {
507
- if (isView && screenState === null && !showPopup && !popupTransitioning) {
508
- setPopup(null);
642
+ $[78] = onCloseModal;
643
+ $[79] = showPopup;
644
+ $[80] = t82;
645
+ } else {
646
+ t82 = $[80];
647
+ }
648
+ const onTap = t82;
649
+ const onResolve = _temp3;
650
+ const t83 = showPopup ? 0 : 1;
651
+ let t84;
652
+ let t85;
653
+ if ($[81] === Symbol.for("react.memo_cache_sentinel")) {
654
+ t84 = {
655
+ config: {
656
+ tension: 300,
657
+ friction: 30
658
+ }
659
+ };
660
+ t85 = {
661
+ filterTaps: true,
662
+ preventDefault: true,
663
+ stopPropagation: true
664
+ };
665
+ $[81] = t84;
666
+ $[82] = t85;
667
+ } else {
668
+ t84 = $[81];
669
+ t85 = $[82];
670
+ }
671
+ let t86;
672
+ if ($[83] !== computePopupProgress || $[84] !== onTap || $[85] !== t83) {
673
+ t86 = {
674
+ disabled: true,
675
+ progress: t83,
676
+ computeProgress: computePopupProgress,
677
+ onResolve,
678
+ springParams: t84,
679
+ dragOptions: t85,
680
+ onTap
681
+ };
682
+ $[83] = computePopupProgress;
683
+ $[84] = onTap;
684
+ $[85] = t83;
685
+ $[86] = t86;
686
+ } else {
687
+ t86 = $[86];
688
+ }
689
+ const {
690
+ bind: bindPopupDrag,
691
+ progress: popupSpring,
692
+ transitioning: popupTransitioning
693
+ } = useDragProgress(t86);
694
+ let t87;
695
+ let t88;
696
+ if ($[87] !== onCloseModal || $[88] !== showPopup) {
697
+ t87 = () => {
698
+ const keyup = e_3 => {
699
+ if (e_3.key === "Escape") {
700
+ if (showPopup) {
701
+ onCloseModal(showPopup);
702
+ }
703
+ }
704
+ };
705
+ document.addEventListener("keyup", keyup);
706
+ return () => {
707
+ document.removeEventListener("keyup", keyup);
708
+ };
709
+ };
710
+ t88 = [showPopup, onCloseModal];
711
+ $[87] = onCloseModal;
712
+ $[88] = showPopup;
713
+ $[89] = t87;
714
+ $[90] = t88;
715
+ } else {
716
+ t87 = $[89];
717
+ t88 = $[90];
718
+ }
719
+ useEffect(t87, t88);
720
+ const t89 = items === null || items.length === 0 ? placeholders : items;
721
+ let t90;
722
+ if ($[91] !== buttonBoxStyle || $[92] !== buttonLabelBoxStyle || $[93] !== buttonLayout || $[94] !== buttonTextStyle || $[95] !== buttonVisualWidth || $[96] !== current || $[97] !== onItemClick || $[98] !== resolution || $[99] !== t89) {
723
+ let t91;
724
+ if ($[101] !== buttonBoxStyle || $[102] !== buttonLabelBoxStyle || $[103] !== buttonLayout || $[104] !== buttonTextStyle || $[105] !== buttonVisualWidth || $[106] !== current || $[107] !== onItemClick || $[108] !== resolution) {
725
+ t91 = (item_0, index_0) => {
726
+ const {
727
+ id: t92,
728
+ label: t93,
729
+ visual: t94,
730
+ boxStyle: t95,
731
+ heading: t96,
732
+ content: t97,
733
+ url: t98,
734
+ inWebView: t99,
735
+ largeVisual: t100
736
+ } = item_0 || {};
737
+ const id = t92 === undefined ? null : t92;
738
+ const itemLabel_0 = t93 === undefined ? null : t93;
739
+ const visual = t94 === undefined ? null : t94;
740
+ const boxStyle = t95 === undefined ? null : t95;
741
+ const heading_0 = t96 === undefined ? null : t96;
742
+ const content = t97 === undefined ? null : t97;
743
+ const url_0 = t98 === undefined ? null : t98;
744
+ const inWebView_0 = t99 === undefined ? false : t99;
745
+ const popupLargeVisual = t100 === undefined ? null : t100;
746
+ const {
747
+ url: t101
748
+ } = visual || {};
749
+ const visualUrl = t101 === undefined ? null : t101;
750
+ const {
751
+ body: t102
752
+ } = heading_0 || {};
753
+ const headingBody_0 = t102 === undefined ? null : t102;
754
+ const {
755
+ body: t103
756
+ } = content || {};
757
+ const contentBody = t103 === undefined ? null : t103;
758
+ const finalLabel_0 = isString(itemLabel_0) ? {
759
+ body: itemLabel_0
760
+ } : itemLabel_0 || {};
761
+ const {
762
+ textStyle: t104
763
+ } = finalLabel_0 || {};
764
+ const finalLabelTextStyle = t104 === undefined ? null : t104;
765
+ const {
766
+ body: t105
767
+ } = finalLabel_0 || {};
768
+ const finalBody = t105 === undefined ? null : t105;
769
+ const key = finalBody || visualUrl || id;
770
+ const itemIsEmpty = finalBody === null && visual === null;
771
+ const isExternalLink = url_0 !== null && !inWebView_0;
772
+ const isPopupEmpty = (heading_0 === null || headingBody_0 === null || headingBody_0 === "") && (content === null || contentBody === null || contentBody === "") && popupLargeVisual === null;
773
+ return /*#__PURE__*/jsx("div", {
774
+ className: styles.item,
775
+ children: /*#__PURE__*/jsx(RichButton, {
776
+ className: classNames([styles.button, {
777
+ [styles.isEmpty]: itemIsEmpty,
778
+ [styles.isLink]: url_0 !== null,
779
+ [styles.disableHover]: isPopupEmpty && url_0 === null
780
+ }]),
781
+ layout: buttonLayout || null,
782
+ external: isExternalLink,
783
+ href: isExternalLink ? url_0 : null,
784
+ focusable: current,
785
+ onClick: !isPopupEmpty || url_0 !== null && !isExternalLink ? e_4 => onItemClick(e_4, item_0, index_0) : null,
786
+ textStyle: {
787
+ ...buttonTextStyle,
788
+ ...finalLabelTextStyle
789
+ },
790
+ buttonStyle: {
791
+ ...buttonBoxStyle,
792
+ ...boxStyle
793
+ },
794
+ label: finalLabel_0,
795
+ labelBoxStyle: buttonLabelBoxStyle,
796
+ visual: visual,
797
+ visualWidth: buttonVisualWidth !== null ? `${buttonVisualWidth}%` : null,
798
+ resolution: resolution,
799
+ textClassName: styles.buttonLabel
800
+ })
801
+ }, key);
802
+ };
803
+ $[101] = buttonBoxStyle;
804
+ $[102] = buttonLabelBoxStyle;
805
+ $[103] = buttonLayout;
806
+ $[104] = buttonTextStyle;
807
+ $[105] = buttonVisualWidth;
808
+ $[106] = current;
809
+ $[107] = onItemClick;
810
+ $[108] = resolution;
811
+ $[109] = t91;
812
+ } else {
813
+ t91 = $[109];
509
814
  }
510
- }, [isView, screenState, showPopup, popupTransitioning]);
511
- return /*#__PURE__*/jsxs("div", {
512
- ref: containerRef,
513
- className: classNames([styles.container, className, _defineProperty(_defineProperty({}, styles.isPlaceholder, isPlaceholder), styles.withSquareItems, withSquareItems)]),
514
- "data-screen-ready": true,
515
- children: [!isPlaceholder ? /*#__PURE__*/jsx(Background, {
815
+ t90 = t89.map(t91);
816
+ $[91] = buttonBoxStyle;
817
+ $[92] = buttonLabelBoxStyle;
818
+ $[93] = buttonLayout;
819
+ $[94] = buttonTextStyle;
820
+ $[95] = buttonVisualWidth;
821
+ $[96] = current;
822
+ $[97] = onItemClick;
823
+ $[98] = resolution;
824
+ $[99] = t89;
825
+ $[100] = t90;
826
+ } else {
827
+ t90 = $[100];
828
+ }
829
+ const gridItems = t90;
830
+ let t91;
831
+ if ($[110] !== isPlaceholder || $[111] !== isView || $[112] !== items || $[113] !== screenState) {
832
+ t91 = () => {
833
+ if (screenState === "popup" && isPlaceholder) {
834
+ setPopup(placeholderPopupBoxStyles);
835
+ setShowPopup(true);
836
+ }
837
+ if (screenState === "keypad") {
838
+ setPopup(null);
839
+ setShowPopup(false);
840
+ }
841
+ if (screenState !== null && screenState.includes("popup")) {
842
+ const index_1 = screenState.split(".").pop();
843
+ const found = items[index_1];
844
+ setPopup(found);
845
+ setShowPopup(true);
846
+ }
847
+ if (screenState === null && !isView) {
848
+ setPopup(null);
849
+ setShowPopup(false);
850
+ }
851
+ };
852
+ $[110] = isPlaceholder;
853
+ $[111] = isView;
854
+ $[112] = items;
855
+ $[113] = screenState;
856
+ $[114] = t91;
857
+ } else {
858
+ t91 = $[114];
859
+ }
860
+ let t92;
861
+ if ($[115] !== isView || $[116] !== items || $[117] !== screenState) {
862
+ t92 = [screenState, items, isView];
863
+ $[115] = isView;
864
+ $[116] = items;
865
+ $[117] = screenState;
866
+ $[118] = t92;
867
+ } else {
868
+ t92 = $[118];
869
+ }
870
+ useEffect(t91, t92);
871
+ let t93;
872
+ let t94;
873
+ if ($[119] !== isView || $[120] !== popupTransitioning || $[121] !== screenState || $[122] !== showPopup) {
874
+ t93 = () => {
875
+ if (isView && screenState === null && !showPopup && !popupTransitioning) {
876
+ setPopup(null);
877
+ }
878
+ };
879
+ t94 = [isView, screenState, showPopup, popupTransitioning];
880
+ $[119] = isView;
881
+ $[120] = popupTransitioning;
882
+ $[121] = screenState;
883
+ $[122] = showPopup;
884
+ $[123] = t93;
885
+ $[124] = t94;
886
+ } else {
887
+ t93 = $[123];
888
+ t94 = $[124];
889
+ }
890
+ useEffect(t93, t94);
891
+ const t95 = classNames([styles.container, className, {
892
+ [styles.isPlaceholder]: isPlaceholder,
893
+ [styles.withSquareItems]: withSquareItems
894
+ }]);
895
+ let t96;
896
+ if ($[125] !== background || $[126] !== backgroundPlaying || $[127] !== customMediaRef || $[128] !== height || $[129] !== isPlaceholder || $[130] !== mediaRef || $[131] !== mediaShouldLoad || $[132] !== muted || $[133] !== resolution || $[134] !== width) {
897
+ t96 = !isPlaceholder ? /*#__PURE__*/jsx(Background, {
516
898
  background: background,
517
899
  width: width,
518
900
  height: height,
@@ -520,10 +902,29 @@ function KeypadScreen(_ref) {
520
902
  playing: backgroundPlaying,
521
903
  muted: muted,
522
904
  shouldLoad: mediaShouldLoad,
523
- mediaRef: mediaRef,
905
+ mediaRef: mergeRefs(mediaRef, customMediaRef),
524
906
  className: styles.background
525
- }) : null, isView && !isPlaceholder && !withoutCloseButton ? /*#__PURE__*/jsx(animated.div, {
526
- className: classNames([styles.fixedHeader, _defineProperty({}, styles.open, showPopup)]),
907
+ }) : null;
908
+ $[125] = background;
909
+ $[126] = backgroundPlaying;
910
+ $[127] = customMediaRef;
911
+ $[128] = height;
912
+ $[129] = isPlaceholder;
913
+ $[130] = mediaRef;
914
+ $[131] = mediaShouldLoad;
915
+ $[132] = muted;
916
+ $[133] = resolution;
917
+ $[134] = width;
918
+ $[135] = t96;
919
+ } else {
920
+ t96 = $[135];
921
+ }
922
+ let t97;
923
+ if ($[136] !== isPlaceholder || $[137] !== isPreview || $[138] !== isView || $[139] !== onClickClose || $[140] !== showPopup || $[141] !== withoutCloseButton) {
924
+ t97 = isView && !isPlaceholder && !withoutCloseButton ? /*#__PURE__*/jsx(animated.div, {
925
+ className: classNames([styles.fixedHeader, {
926
+ [styles.open]: showPopup
927
+ }]),
527
928
  children: /*#__PURE__*/jsx("div", {
528
929
  className: styles.buttons,
529
930
  children: /*#__PURE__*/jsx(Button, {
@@ -537,201 +938,699 @@ function KeypadScreen(_ref) {
537
938
  })
538
939
  })
539
940
  })
540
- }) : null, /*#__PURE__*/jsxs(Container, {
941
+ }) : null;
942
+ $[136] = isPlaceholder;
943
+ $[137] = isPreview;
944
+ $[138] = isView;
945
+ $[139] = onClickClose;
946
+ $[140] = showPopup;
947
+ $[141] = withoutCloseButton;
948
+ $[142] = t97;
949
+ } else {
950
+ t97 = $[142];
951
+ }
952
+ const t98 = !showPopup;
953
+ const t99 = !showPopup;
954
+ const t100 = isPreview || isPlaceholder || showPopup;
955
+ let t101;
956
+ if ($[143] !== current || $[144] !== footerHeight || $[145] !== hasFooter || $[146] !== hasHeader || $[147] !== headerHeight || $[148] !== isPlaceholder || $[149] !== isPreview || $[150] !== spacing || $[151] !== viewerBottomHeight || $[152] !== viewerTopHeight) {
957
+ t101 = !isPlaceholder ? {
958
+ paddingLeft: spacing,
959
+ paddingRight: spacing,
960
+ paddingTop: (hasHeader ? headerHeight : spacing) + (current && !isPreview ? viewerTopHeight : 0),
961
+ paddingBottom: (hasFooter ? footerHeight : spacing) + (current && !isPreview ? viewerBottomHeight : 0)
962
+ } : null;
963
+ $[143] = current;
964
+ $[144] = footerHeight;
965
+ $[145] = hasFooter;
966
+ $[146] = hasHeader;
967
+ $[147] = headerHeight;
968
+ $[148] = isPlaceholder;
969
+ $[149] = isPreview;
970
+ $[150] = spacing;
971
+ $[151] = viewerBottomHeight;
972
+ $[152] = viewerTopHeight;
973
+ $[153] = t101;
974
+ } else {
975
+ t101 = $[153];
976
+ }
977
+ let t102;
978
+ if ($[154] !== hasHeader || $[155] !== header || $[156] !== headerRef || $[157] !== isPlaceholder || $[158] !== isPreview || $[159] !== spacing || $[160] !== viewerTopHeight) {
979
+ t102 = !isPlaceholder && hasHeader ? /*#__PURE__*/jsx("div", {
980
+ ref: headerRef,
981
+ className: styles.header,
982
+ style: {
983
+ paddingTop: spacing / 2,
984
+ paddingLeft: spacing,
985
+ paddingRight: spacing,
986
+ paddingBottom: spacing,
987
+ transform: !isPreview ? `translate(0, ${viewerTopHeight}px)` : null
988
+ },
989
+ children: /*#__PURE__*/jsx(Header, {
990
+ ...header
991
+ })
992
+ }) : null;
993
+ $[154] = hasHeader;
994
+ $[155] = header;
995
+ $[156] = headerRef;
996
+ $[157] = isPlaceholder;
997
+ $[158] = isPreview;
998
+ $[159] = spacing;
999
+ $[160] = viewerTopHeight;
1000
+ $[161] = t102;
1001
+ } else {
1002
+ t102 = $[161];
1003
+ }
1004
+ let t103;
1005
+ let t104;
1006
+ if ($[162] === Symbol.for("react.memo_cache_sentinel")) {
1007
+ t103 = /*#__PURE__*/jsx(FormattedMessage, {
1008
+ id: "BSTWf8",
1009
+ defaultMessage: "Title"
1010
+ });
1011
+ t104 = classNames([styles.empty, styles.emptyHeading]);
1012
+ $[162] = t103;
1013
+ $[163] = t104;
1014
+ } else {
1015
+ t103 = $[162];
1016
+ t104 = $[163];
1017
+ }
1018
+ const t105 = !hasTitle;
1019
+ let t106;
1020
+ if ($[164] !== hasTitle || $[165] !== title || $[166] !== titleTextStyle) {
1021
+ t106 = hasTitle ? /*#__PURE__*/jsx(Heading, {
1022
+ className: styles.title,
1023
+ ...title,
1024
+ textStyle: titleTextStyle
1025
+ }) : null;
1026
+ $[164] = hasTitle;
1027
+ $[165] = title;
1028
+ $[166] = titleTextStyle;
1029
+ $[167] = t106;
1030
+ } else {
1031
+ t106 = $[167];
1032
+ }
1033
+ let t107;
1034
+ if ($[168] !== t105 || $[169] !== t106) {
1035
+ t107 = /*#__PURE__*/jsx(ScreenElement, {
1036
+ placeholder: "Title",
1037
+ emptyLabel: t103,
1038
+ emptyClassName: t104,
1039
+ isEmpty: t105,
1040
+ children: t106
1041
+ });
1042
+ $[168] = t105;
1043
+ $[169] = t106;
1044
+ $[170] = t107;
1045
+ } else {
1046
+ t107 = $[170];
1047
+ }
1048
+ let t108;
1049
+ let t109;
1050
+ if ($[171] === Symbol.for("react.memo_cache_sentinel")) {
1051
+ t108 = /*#__PURE__*/jsx(FormattedMessage, {
1052
+ id: "ZG8/oK",
1053
+ defaultMessage: "Subtitle"
1054
+ });
1055
+ t109 = classNames([styles.empty, styles.emptyHeading]);
1056
+ $[171] = t108;
1057
+ $[172] = t109;
1058
+ } else {
1059
+ t108 = $[171];
1060
+ t109 = $[172];
1061
+ }
1062
+ const t110 = !hasSubtitle;
1063
+ let t111;
1064
+ if ($[173] !== hasSubtitle || $[174] !== subtitle) {
1065
+ t111 = hasSubtitle ? /*#__PURE__*/jsx(Text, {
1066
+ className: styles.subtitle,
1067
+ ...subtitle
1068
+ }) : null;
1069
+ $[173] = hasSubtitle;
1070
+ $[174] = subtitle;
1071
+ $[175] = t111;
1072
+ } else {
1073
+ t111 = $[175];
1074
+ }
1075
+ let t112;
1076
+ if ($[176] !== t110 || $[177] !== t111) {
1077
+ t112 = /*#__PURE__*/jsx(ScreenElement, {
1078
+ placeholder: "Subtitle",
1079
+ emptyLabel: t108,
1080
+ emptyClassName: t109,
1081
+ isEmpty: t110,
1082
+ children: t111
1083
+ });
1084
+ $[176] = t110;
1085
+ $[177] = t111;
1086
+ $[178] = t112;
1087
+ } else {
1088
+ t112 = $[178];
1089
+ }
1090
+ let t113;
1091
+ if ($[179] !== isPlaceholder) {
1092
+ t113 = classNames([styles.grid, {
1093
+ [styles.gridPlaceholder]: isPlaceholder
1094
+ }]);
1095
+ $[179] = isPlaceholder;
1096
+ $[180] = t113;
1097
+ } else {
1098
+ t113 = $[180];
1099
+ }
1100
+ const t114 = isPlaceholder ? 3 : columns;
1101
+ const t115 = isPlaceholder ? 2 : columnSpacing;
1102
+ let t116;
1103
+ if ($[181] !== columnAlign || $[182] !== gridItems || $[183] !== t113 || $[184] !== t114 || $[185] !== t115) {
1104
+ t116 = /*#__PURE__*/jsx(Keypad, {
1105
+ className: t113,
1106
+ align: columnAlign,
1107
+ columns: t114,
1108
+ spacing: t115,
1109
+ items: gridItems
1110
+ });
1111
+ $[181] = columnAlign;
1112
+ $[182] = gridItems;
1113
+ $[183] = t113;
1114
+ $[184] = t114;
1115
+ $[185] = t115;
1116
+ $[186] = t116;
1117
+ } else {
1118
+ t116 = $[186];
1119
+ }
1120
+ let t117;
1121
+ if ($[187] !== layout || $[188] !== t101 || $[189] !== t102 || $[190] !== t107 || $[191] !== t112 || $[192] !== t116 || $[193] !== width) {
1122
+ t117 = /*#__PURE__*/jsxs(Layout, {
1123
+ className: styles.layout,
1124
+ verticalAlign: layout,
1125
+ width: width,
1126
+ style: t101,
1127
+ children: [t102, t107, t112, t116]
1128
+ });
1129
+ $[187] = layout;
1130
+ $[188] = t101;
1131
+ $[189] = t102;
1132
+ $[190] = t107;
1133
+ $[191] = t112;
1134
+ $[192] = t116;
1135
+ $[193] = width;
1136
+ $[194] = t117;
1137
+ } else {
1138
+ t117 = $[194];
1139
+ }
1140
+ let t118;
1141
+ if ($[195] === Symbol.for("react.memo_cache_sentinel")) {
1142
+ t118 = classNames([styles.popupBackdrop]);
1143
+ $[195] = t118;
1144
+ } else {
1145
+ t118 = $[195];
1146
+ }
1147
+ let t119;
1148
+ if ($[196] !== popupSpring) {
1149
+ t119 = popupSpring.to(_temp4);
1150
+ $[196] = popupSpring;
1151
+ $[197] = t119;
1152
+ } else {
1153
+ t119 = $[197];
1154
+ }
1155
+ let t120;
1156
+ if ($[198] !== t119) {
1157
+ t120 = /*#__PURE__*/jsx(animated.div, {
1158
+ className: t118,
1159
+ style: {
1160
+ opacity: t119
1161
+ }
1162
+ });
1163
+ $[198] = t119;
1164
+ $[199] = t120;
1165
+ } else {
1166
+ t120 = $[199];
1167
+ }
1168
+ let t121;
1169
+ if ($[200] !== popupSpring) {
1170
+ t121 = popupSpring.to(_temp5);
1171
+ $[200] = popupSpring;
1172
+ $[201] = t121;
1173
+ } else {
1174
+ t121 = $[201];
1175
+ }
1176
+ let t122;
1177
+ if ($[202] !== popupSpring) {
1178
+ t122 = popupSpring.to(_temp6);
1179
+ $[202] = popupSpring;
1180
+ $[203] = t122;
1181
+ } else {
1182
+ t122 = $[203];
1183
+ }
1184
+ let t123;
1185
+ if ($[204] !== t121 || $[205] !== t122) {
1186
+ t123 = {
1187
+ transform: t121,
1188
+ pointerEvents: t122
1189
+ };
1190
+ $[204] = t121;
1191
+ $[205] = t122;
1192
+ $[206] = t123;
1193
+ } else {
1194
+ t123 = $[206];
1195
+ }
1196
+ let t124;
1197
+ if ($[207] !== bindPopupDrag) {
1198
+ t124 = bindPopupDrag();
1199
+ $[207] = bindPopupDrag;
1200
+ $[208] = t124;
1201
+ } else {
1202
+ t124 = $[208];
1203
+ }
1204
+ const t125 = isPreview || isPlaceholder;
1205
+ const t126 = !showPopup ? 1 : null;
1206
+ const t127 = styles[popupLayoutClassName];
1207
+ const t128 = popupBoxStyle === null;
1208
+ let t129;
1209
+ if ($[209] !== t127 || $[210] !== t128) {
1210
+ t129 = classNames([styles.popupInner, t127, {
1211
+ [styles.withShadow]: t128
1212
+ }]);
1213
+ $[209] = t127;
1214
+ $[210] = t128;
1215
+ $[211] = t129;
1216
+ } else {
1217
+ t129 = $[211];
1218
+ }
1219
+ let t130;
1220
+ if ($[212] === Symbol.for("react.memo_cache_sentinel")) {
1221
+ t130 = getStyleFromBox(placeholderPopupBoxStyles);
1222
+ $[212] = t130;
1223
+ } else {
1224
+ t130 = $[212];
1225
+ }
1226
+ let t131;
1227
+ if ($[213] !== popupBoxStyle) {
1228
+ t131 = getStyleFromBox(popupBoxStyle);
1229
+ $[213] = popupBoxStyle;
1230
+ $[214] = t131;
1231
+ } else {
1232
+ t131 = $[214];
1233
+ }
1234
+ let t132;
1235
+ if ($[215] !== singlePopupBoxStyle) {
1236
+ t132 = getStyleFromBox(singlePopupBoxStyle);
1237
+ $[215] = singlePopupBoxStyle;
1238
+ $[216] = t132;
1239
+ } else {
1240
+ t132 = $[216];
1241
+ }
1242
+ let t133;
1243
+ if ($[217] !== t131 || $[218] !== t132) {
1244
+ t133 = {
1245
+ ...t130,
1246
+ ...t131,
1247
+ ...t132
1248
+ };
1249
+ $[217] = t131;
1250
+ $[218] = t132;
1251
+ $[219] = t133;
1252
+ } else {
1253
+ t133 = $[219];
1254
+ }
1255
+ let t134;
1256
+ let t135;
1257
+ if ($[220] === Symbol.for("react.memo_cache_sentinel")) {
1258
+ t134 = /*#__PURE__*/jsx(FormattedMessage, {
1259
+ id: "IE7U/Q",
1260
+ defaultMessage: "Heading"
1261
+ });
1262
+ t135 = classNames([styles.empty, styles.emptyHeading]);
1263
+ $[220] = t134;
1264
+ $[221] = t135;
1265
+ } else {
1266
+ t134 = $[220];
1267
+ t135 = $[221];
1268
+ }
1269
+ const t136 = !hasPopupHeading;
1270
+ let t137;
1271
+ if ($[222] !== hasPopupHeading || $[223] !== headingTextStyle || $[224] !== popupHeading || $[225] !== popupHeadingTextStyle) {
1272
+ t137 = hasPopupHeading ? /*#__PURE__*/jsx(Heading, {
1273
+ className: styles.popupHeading,
1274
+ ...popupHeading,
1275
+ textStyle: {
1276
+ ...headingTextStyle,
1277
+ ...popupHeadingTextStyle
1278
+ }
1279
+ }) : null;
1280
+ $[222] = hasPopupHeading;
1281
+ $[223] = headingTextStyle;
1282
+ $[224] = popupHeading;
1283
+ $[225] = popupHeadingTextStyle;
1284
+ $[226] = t137;
1285
+ } else {
1286
+ t137 = $[226];
1287
+ }
1288
+ let t138;
1289
+ if ($[227] !== t136 || $[228] !== t137) {
1290
+ t138 = /*#__PURE__*/jsx(ScreenElement, {
1291
+ emptyLabel: t134,
1292
+ emptyClassName: t135,
1293
+ isEmpty: t136,
1294
+ children: t137
1295
+ });
1296
+ $[227] = t136;
1297
+ $[228] = t137;
1298
+ $[229] = t138;
1299
+ } else {
1300
+ t138 = $[229];
1301
+ }
1302
+ let t139;
1303
+ let t140;
1304
+ if ($[230] === Symbol.for("react.memo_cache_sentinel")) {
1305
+ t139 = /*#__PURE__*/jsx(FormattedMessage, {
1306
+ id: "JRZoe6",
1307
+ defaultMessage: "Content"
1308
+ });
1309
+ t140 = classNames([styles.empty, styles.emptyContent]);
1310
+ $[230] = t139;
1311
+ $[231] = t140;
1312
+ } else {
1313
+ t139 = $[230];
1314
+ t140 = $[231];
1315
+ }
1316
+ const t141 = !hasPopupContent;
1317
+ let t142;
1318
+ if ($[232] !== contentTextStyle || $[233] !== hasPopupContent || $[234] !== popupContent || $[235] !== popupContentTextStyle) {
1319
+ t142 = hasPopupContent ? /*#__PURE__*/jsx(Text, {
1320
+ className: styles.popupContent,
1321
+ ...popupContent,
1322
+ textStyle: {
1323
+ ...contentTextStyle,
1324
+ ...popupContentTextStyle
1325
+ }
1326
+ }) : null;
1327
+ $[232] = contentTextStyle;
1328
+ $[233] = hasPopupContent;
1329
+ $[234] = popupContent;
1330
+ $[235] = popupContentTextStyle;
1331
+ $[236] = t142;
1332
+ } else {
1333
+ t142 = $[236];
1334
+ }
1335
+ let t143;
1336
+ if ($[237] !== t141 || $[238] !== t142) {
1337
+ t143 = /*#__PURE__*/jsx(ScreenElement, {
1338
+ placeholder: "popupContent",
1339
+ emptyLabel: t139,
1340
+ emptyClassName: t140,
1341
+ isEmpty: t141,
1342
+ children: t142
1343
+ });
1344
+ $[237] = t141;
1345
+ $[238] = t142;
1346
+ $[239] = t143;
1347
+ } else {
1348
+ t143 = $[239];
1349
+ }
1350
+ let t144;
1351
+ let t145;
1352
+ if ($[240] === Symbol.for("react.memo_cache_sentinel")) {
1353
+ t144 = /*#__PURE__*/jsx(FormattedMessage, {
1354
+ id: "z4Pr+g",
1355
+ defaultMessage: "Visual (Image or Video)"
1356
+ });
1357
+ t145 = classNames([styles.empty, styles.emptyVisual]);
1358
+ $[240] = t144;
1359
+ $[241] = t145;
1360
+ } else {
1361
+ t144 = $[240];
1362
+ t145 = $[241];
1363
+ }
1364
+ const t146 = largeVisual === null;
1365
+ let t147;
1366
+ if ($[242] !== largeVisual || $[243] !== largeVisualRatio || $[244] !== resolution) {
1367
+ t147 = largeVisual !== null ? /*#__PURE__*/jsx(Visual, {
1368
+ className: styles.popupVisual,
1369
+ imageClassName: styles.popupVisualImage,
1370
+ videoClassName: styles.popupVisualVideo,
1371
+ media: largeVisual,
1372
+ resolution: resolution,
1373
+ ratio: largeVisualRatio,
1374
+ width: "100%",
1375
+ height: "auto"
1376
+ }) : null;
1377
+ $[242] = largeVisual;
1378
+ $[243] = largeVisualRatio;
1379
+ $[244] = resolution;
1380
+ $[245] = t147;
1381
+ } else {
1382
+ t147 = $[245];
1383
+ }
1384
+ let t148;
1385
+ if ($[246] !== t146 || $[247] !== t147) {
1386
+ t148 = /*#__PURE__*/jsx(ScreenElement, {
1387
+ placeholder: "image",
1388
+ emptyLabel: t144,
1389
+ emptyClassName: t145,
1390
+ isEmpty: t146,
1391
+ children: t147
1392
+ });
1393
+ $[246] = t146;
1394
+ $[247] = t147;
1395
+ $[248] = t148;
1396
+ } else {
1397
+ t148 = $[248];
1398
+ }
1399
+ let t149;
1400
+ let t150;
1401
+ if ($[249] === Symbol.for("react.memo_cache_sentinel")) {
1402
+ t149 = /*#__PURE__*/jsx(FormattedMessage, {
1403
+ id: "N7Kj8z",
1404
+ defaultMessage: "Button"
1405
+ });
1406
+ t150 = classNames([styles.empty, styles.emptyCTA]);
1407
+ $[249] = t149;
1408
+ $[250] = t150;
1409
+ } else {
1410
+ t149 = $[249];
1411
+ t150 = $[250];
1412
+ }
1413
+ const t151 = popupButton === null;
1414
+ let t152;
1415
+ if ($[251] !== buttonLabel || $[252] !== buttonUrl || $[253] !== onClickCta || $[254] !== openWebView || $[255] !== popupButton || $[256] !== popupButtonBoxStyle || $[257] !== popupButtonsBoxStyle || $[258] !== popupButtonsTextStyle || $[259] !== popupInWebView) {
1416
+ t152 = popupButton !== null ? /*#__PURE__*/jsx(CallToAction, {
1417
+ className: styles.popupCTA,
1418
+ label: {
1419
+ ...popupButtonsTextStyle,
1420
+ ...buttonLabel
1421
+ },
1422
+ url: buttonUrl,
1423
+ onClick: onClickCta,
1424
+ inWebView: popupInWebView,
1425
+ openWebView: openWebView,
1426
+ type: "click",
1427
+ boxStyle: {
1428
+ ...popupButtonsBoxStyle,
1429
+ ...popupButtonBoxStyle
1430
+ }
1431
+ }) : null;
1432
+ $[251] = buttonLabel;
1433
+ $[252] = buttonUrl;
1434
+ $[253] = onClickCta;
1435
+ $[254] = openWebView;
1436
+ $[255] = popupButton;
1437
+ $[256] = popupButtonBoxStyle;
1438
+ $[257] = popupButtonsBoxStyle;
1439
+ $[258] = popupButtonsTextStyle;
1440
+ $[259] = popupInWebView;
1441
+ $[260] = t152;
1442
+ } else {
1443
+ t152 = $[260];
1444
+ }
1445
+ let t153;
1446
+ if ($[261] !== t151 || $[262] !== t152) {
1447
+ t153 = /*#__PURE__*/jsx(ScreenElement, {
1448
+ placeholder: "button",
1449
+ emptyLabel: t149,
1450
+ emptyClassName: t150,
1451
+ isEmpty: t151,
1452
+ children: t152
1453
+ });
1454
+ $[261] = t151;
1455
+ $[262] = t152;
1456
+ $[263] = t153;
1457
+ } else {
1458
+ t153 = $[263];
1459
+ }
1460
+ let t154;
1461
+ if ($[264] !== t129 || $[265] !== t133 || $[266] !== t138 || $[267] !== t143 || $[268] !== t148 || $[269] !== t153) {
1462
+ t154 = /*#__PURE__*/jsxs("div", {
1463
+ ref: popupInnerRef,
1464
+ className: t129,
1465
+ style: t133,
1466
+ children: [t138, t143, t148, t153]
1467
+ });
1468
+ $[264] = t129;
1469
+ $[265] = t133;
1470
+ $[266] = t138;
1471
+ $[267] = t143;
1472
+ $[268] = t148;
1473
+ $[269] = t153;
1474
+ $[270] = t154;
1475
+ } else {
1476
+ t154 = $[270];
1477
+ }
1478
+ let t155;
1479
+ if ($[271] !== onPopupScrollBottom || $[272] !== onPopupScrollHeightChange || $[273] !== onPopupScrollNotBottom || $[274] !== t125 || $[275] !== t126 || $[276] !== t154) {
1480
+ t155 = /*#__PURE__*/jsx(Scroll, {
1481
+ disabled: t125,
1482
+ verticalAlign: "middle",
1483
+ withArrow: false,
1484
+ scrollPosition: t126,
1485
+ onScrolledBottom: onPopupScrollBottom,
1486
+ onScrolledNotBottom: onPopupScrollNotBottom,
1487
+ onScrollHeightChange: onPopupScrollHeightChange,
1488
+ className: styles.popupScroll,
1489
+ withShadow: true,
1490
+ children: t154
1491
+ });
1492
+ $[271] = onPopupScrollBottom;
1493
+ $[272] = onPopupScrollHeightChange;
1494
+ $[273] = onPopupScrollNotBottom;
1495
+ $[274] = t125;
1496
+ $[275] = t126;
1497
+ $[276] = t154;
1498
+ $[277] = t155;
1499
+ } else {
1500
+ t155 = $[277];
1501
+ }
1502
+ let t156;
1503
+ if ($[278] !== t123 || $[279] !== t124 || $[280] !== t155) {
1504
+ t156 = /*#__PURE__*/jsx(animated.div, {
1505
+ className: styles.popup,
1506
+ style: t123,
1507
+ ...t124,
1508
+ children: t155
1509
+ });
1510
+ $[278] = t123;
1511
+ $[279] = t124;
1512
+ $[280] = t155;
1513
+ $[281] = t156;
1514
+ } else {
1515
+ t156 = $[281];
1516
+ }
1517
+ let t157;
1518
+ if ($[282] !== t120 || $[283] !== t156) {
1519
+ t157 = /*#__PURE__*/jsxs(Fragment, {
1520
+ children: [t120, t156]
1521
+ });
1522
+ $[282] = t120;
1523
+ $[283] = t156;
1524
+ $[284] = t157;
1525
+ } else {
1526
+ t157 = $[284];
1527
+ }
1528
+ let t158;
1529
+ if ($[285] !== height || $[286] !== layout || $[287] !== onScrolledTrigger || $[288] !== t100 || $[289] !== t117 || $[290] !== t157 || $[291] !== t98 || $[292] !== t99 || $[293] !== width) {
1530
+ t158 = /*#__PURE__*/jsxs(Scroll, {
1531
+ width: width,
1532
+ height: height,
1533
+ verticalAlign: layout,
1534
+ withArrow: t98,
1535
+ withShadow: t99,
1536
+ disabled: t100,
1537
+ onScrolledTrigger: onScrolledTrigger,
1538
+ children: [t117, t157]
1539
+ });
1540
+ $[285] = height;
1541
+ $[286] = layout;
1542
+ $[287] = onScrolledTrigger;
1543
+ $[288] = t100;
1544
+ $[289] = t117;
1545
+ $[290] = t157;
1546
+ $[291] = t98;
1547
+ $[292] = t99;
1548
+ $[293] = width;
1549
+ $[294] = t158;
1550
+ } else {
1551
+ t158 = $[294];
1552
+ }
1553
+ let t159;
1554
+ if ($[295] !== current || $[296] !== footerProps || $[297] !== footerRef || $[298] !== hasFooter || $[299] !== isPlaceholder || $[300] !== isPreview || $[301] !== spacing || $[302] !== viewerBottomHeight || $[303] !== viewerBottomSidesWidth) {
1555
+ t159 = !isPlaceholder && hasFooter ? /*#__PURE__*/jsx("div", {
1556
+ ref: footerRef,
1557
+ className: styles.footer,
1558
+ style: {
1559
+ transform: current && !isPreview ? `translate(0, -${viewerBottomHeight}px)` : null,
1560
+ paddingLeft: Math.max(spacing / 2, viewerBottomSidesWidth),
1561
+ paddingRight: Math.max(spacing / 2, viewerBottomSidesWidth),
1562
+ paddingBottom: spacing / 2,
1563
+ paddingTop: spacing
1564
+ },
1565
+ children: /*#__PURE__*/jsx(Footer, {
1566
+ ...footerProps
1567
+ })
1568
+ }) : null;
1569
+ $[295] = current;
1570
+ $[296] = footerProps;
1571
+ $[297] = footerRef;
1572
+ $[298] = hasFooter;
1573
+ $[299] = isPlaceholder;
1574
+ $[300] = isPreview;
1575
+ $[301] = spacing;
1576
+ $[302] = viewerBottomHeight;
1577
+ $[303] = viewerBottomSidesWidth;
1578
+ $[304] = t159;
1579
+ } else {
1580
+ t159 = $[304];
1581
+ }
1582
+ let t160;
1583
+ if ($[305] !== height || $[306] !== t158 || $[307] !== t159 || $[308] !== width) {
1584
+ t160 = /*#__PURE__*/jsxs(Container, {
541
1585
  width: width,
542
1586
  height: height,
543
1587
  className: styles.inner,
544
- children: [/*#__PURE__*/jsxs(Scroll, {
545
- width: width,
546
- height: height,
547
- verticalAlign: layout,
548
- withArrow: !showPopup,
549
- withShadow: !showPopup,
550
- disabled: isPreview || isPlaceholder || showPopup,
551
- onScrolledTrigger: onScrolledTrigger,
552
- children: [/*#__PURE__*/jsxs(Layout, {
553
- className: styles.layout,
554
- verticalAlign: layout,
555
- width: width,
556
- style: !isPlaceholder ? {
557
- paddingLeft: spacing,
558
- paddingRight: spacing,
559
- paddingTop: (hasHeader ? headerHeight : spacing) + (current && !isPreview ? viewerTopHeight : 0),
560
- paddingBottom: (hasFooter ? footerHeight : spacing) + (current && !isPreview ? viewerBottomHeight : 0)
561
- } : null,
562
- children: [!isPlaceholder && hasHeader ? /*#__PURE__*/jsx("div", {
563
- ref: headerRef,
564
- className: styles.header,
565
- style: {
566
- paddingTop: spacing / 2,
567
- paddingLeft: spacing,
568
- paddingRight: spacing,
569
- paddingBottom: spacing,
570
- transform: !isPreview ? "translate(0, ".concat(viewerTopHeight, "px)") : null
571
- },
572
- children: /*#__PURE__*/jsx(Header, _objectSpread({}, header))
573
- }) : null, /*#__PURE__*/jsx(ScreenElement, {
574
- placeholder: "Title",
575
- emptyLabel: /*#__PURE__*/jsx(FormattedMessage, {
576
- id: "BSTWf8",
577
- defaultMessage: [{
578
- "type": 0,
579
- "value": "Title"
580
- }]
581
- }),
582
- emptyClassName: classNames([styles.empty, styles.emptyHeading]),
583
- isEmpty: !hasTitle,
584
- children: hasTitle ? /*#__PURE__*/jsx(Heading, _objectSpread(_objectSpread({
585
- className: styles.title
586
- }, title), {}, {
587
- textStyle: titleTextStyle
588
- })) : null
589
- }), /*#__PURE__*/jsx(ScreenElement, {
590
- placeholder: "Subtitle",
591
- emptyLabel: /*#__PURE__*/jsx(FormattedMessage, {
592
- id: "ZG8/oK",
593
- defaultMessage: [{
594
- "type": 0,
595
- "value": "Subtitle"
596
- }]
597
- }),
598
- emptyClassName: classNames([styles.empty, styles.emptyHeading]),
599
- isEmpty: !hasSubtitle,
600
- children: hasSubtitle ? /*#__PURE__*/jsx(Text, _objectSpread({
601
- className: styles.subtitle
602
- }, subtitle)) : null
603
- }), /*#__PURE__*/jsx(Keypad, {
604
- className: classNames([styles.grid, _defineProperty({}, styles.gridPlaceholder, isPlaceholder)]),
605
- align: columnAlign,
606
- columns: isPlaceholder ? 3 : columns,
607
- spacing: isPlaceholder ? 2 : columnSpacing,
608
- items: gridItems
609
- })]
610
- }), /*#__PURE__*/jsxs(Fragment, {
611
- children: [/*#__PURE__*/jsx(animated.div, {
612
- className: classNames([styles.popupBackdrop]),
613
- style: {
614
- opacity: popupSpring.to(function (p) {
615
- return 1 - Math.abs(p);
616
- })
617
- }
618
- }), /*#__PURE__*/jsx(animated.div, _objectSpread(_objectSpread({
619
- className: styles.popup,
620
- style: {
621
- transform: popupSpring.to(function (p) {
622
- return "translateY(".concat(100 * p, "%) scale(").concat(1 - Math.abs(p * 0.5), ")");
623
- }),
624
- pointerEvents: popupSpring.to(function (p) {
625
- return Math.abs(p) > 0.5 ? 'none' : 'auto';
626
- })
627
- }
628
- }, bindPopupDrag()), {}, {
629
- children: /*#__PURE__*/jsx(Scroll, {
630
- disabled: isPreview || isPlaceholder,
631
- verticalAlign: "middle",
632
- withArrow: false,
633
- scrollPosition: !showPopup ? 1 : null,
634
- onScrolledBottom: onPopupScrollBottom,
635
- onScrolledNotBottom: onPopupScrollNotBottom,
636
- onScrollHeightChange: onPopupScrollHeightChange,
637
- className: styles.popupScroll,
638
- withShadow: true,
639
- children: /*#__PURE__*/jsxs("div", {
640
- ref: popupInnerRef,
641
- className: classNames([styles.popupInner, styles[popupLayoutClassName], _defineProperty({}, styles.withShadow, popupBoxStyle === null)]),
642
- style: _objectSpread(_objectSpread(_objectSpread({}, getStyleFromBox(placeholderPopupBoxStyles)), getStyleFromBox(popupBoxStyle)), getStyleFromBox(singlePopupBoxStyle)),
643
- children: [/*#__PURE__*/jsx(ScreenElement, {
644
- emptyLabel: /*#__PURE__*/jsx(FormattedMessage, {
645
- id: "IE7U/Q",
646
- defaultMessage: [{
647
- "type": 0,
648
- "value": "Heading"
649
- }]
650
- }),
651
- emptyClassName: classNames([styles.empty, styles.emptyHeading]),
652
- isEmpty: !hasPopupHeading,
653
- children: hasPopupHeading ? /*#__PURE__*/jsx(Heading, _objectSpread(_objectSpread({
654
- className: styles.popupHeading
655
- }, popupHeading), {}, {
656
- textStyle: _objectSpread(_objectSpread({}, headingTextStyle), popupHeadingTextStyle)
657
- })) : null
658
- }), /*#__PURE__*/jsx(ScreenElement, {
659
- placeholder: "popupContent",
660
- emptyLabel: /*#__PURE__*/jsx(FormattedMessage, {
661
- id: "JRZoe6",
662
- defaultMessage: [{
663
- "type": 0,
664
- "value": "Content"
665
- }]
666
- }),
667
- emptyClassName: classNames([styles.empty, styles.emptyContent]),
668
- isEmpty: !hasPopupContent,
669
- children: hasPopupContent ? /*#__PURE__*/jsx(Text, _objectSpread(_objectSpread({
670
- className: styles.popupContent
671
- }, popupContent), {}, {
672
- textStyle: _objectSpread(_objectSpread({}, contentTextStyle), popupContentTextStyle)
673
- })) : null
674
- }), /*#__PURE__*/jsx(ScreenElement, {
675
- placeholder: "image",
676
- emptyLabel: /*#__PURE__*/jsx(FormattedMessage, {
677
- id: "z4Pr+g",
678
- defaultMessage: [{
679
- "type": 0,
680
- "value": "Visual (Image or Video)"
681
- }]
682
- }),
683
- emptyClassName: classNames([styles.empty, styles.emptyVisual]),
684
- isEmpty: largeVisual === null,
685
- children: largeVisual !== null ? /*#__PURE__*/jsx(Visual, {
686
- className: styles.popupVisual,
687
- imageClassName: styles.popupVisualImage,
688
- videoClassName: styles.popupVisualVideo,
689
- media: largeVisual,
690
- resolution: resolution,
691
- ratio: largeVisualRatio,
692
- width: "100%",
693
- height: "auto"
694
- }) : null
695
- }), /*#__PURE__*/jsx(ScreenElement, {
696
- placeholder: "button",
697
- emptyLabel: /*#__PURE__*/jsx(FormattedMessage, {
698
- id: "N7Kj8z",
699
- defaultMessage: [{
700
- "type": 0,
701
- "value": "Button"
702
- }]
703
- }),
704
- emptyClassName: classNames([styles.empty, styles.emptyCTA]),
705
- isEmpty: popupButton === null,
706
- children: popupButton !== null ? /*#__PURE__*/jsx(CallToAction, {
707
- className: styles.popupCTA,
708
- label: _objectSpread(_objectSpread({}, popupButtonsTextStyle), buttonLabel),
709
- url: buttonUrl,
710
- onClick: onClickCta,
711
- inWebView: popupInWebView,
712
- openWebView: openWebView,
713
- type: "click",
714
- boxStyle: _objectSpread(_objectSpread({}, popupButtonsBoxStyle), popupButtonBoxStyle)
715
- }) : null
716
- })]
717
- })
718
- })
719
- }))]
720
- })]
721
- }), !isPlaceholder && hasFooter ? /*#__PURE__*/jsx("div", {
722
- ref: footerRef,
723
- className: styles.footer,
724
- style: {
725
- transform: current && !isPreview ? "translate(0, -".concat(viewerBottomHeight, "px)") : null,
726
- paddingLeft: Math.max(spacing / 2, viewerBottomSidesWidth),
727
- paddingRight: Math.max(spacing / 2, viewerBottomSidesWidth),
728
- paddingBottom: spacing / 2,
729
- paddingTop: spacing
730
- },
731
- children: /*#__PURE__*/jsx(Footer, _objectSpread({}, footerProps))
732
- }) : null]
733
- })]
734
- });
1588
+ children: [t158, t159]
1589
+ });
1590
+ $[305] = height;
1591
+ $[306] = t158;
1592
+ $[307] = t159;
1593
+ $[308] = width;
1594
+ $[309] = t160;
1595
+ } else {
1596
+ t160 = $[309];
1597
+ }
1598
+ let t161;
1599
+ if ($[310] !== t160 || $[311] !== t95 || $[312] !== t96 || $[313] !== t97) {
1600
+ t161 = /*#__PURE__*/jsxs("div", {
1601
+ ref: containerRef,
1602
+ className: t95,
1603
+ "data-screen-ready": true,
1604
+ children: [t96, t97, t160]
1605
+ });
1606
+ $[310] = t160;
1607
+ $[311] = t95;
1608
+ $[312] = t96;
1609
+ $[313] = t97;
1610
+ $[314] = t161;
1611
+ } else {
1612
+ t161 = $[314];
1613
+ }
1614
+ return t161;
1615
+ }
1616
+ function _temp6(p_1) {
1617
+ return Math.abs(p_1) > 0.5 ? "none" : "auto";
1618
+ }
1619
+ function _temp5(p_0) {
1620
+ return `translateY(${100 * p_0}%) scale(${1 - Math.abs(p_0 * 0.5)})`;
1621
+ }
1622
+ function _temp4(p) {
1623
+ return 1 - Math.abs(p);
1624
+ }
1625
+ function _temp3() {}
1626
+ function _temp2(t0) {
1627
+ const e_1 = t0 === undefined ? null : t0;
1628
+ if (e_1 !== null) {
1629
+ e_1.stopPropagation();
1630
+ }
1631
+ }
1632
+ function _temp(it) {
1633
+ return !isEmpty(it);
735
1634
  }
736
1635
 
737
1636
  var definition = [{
@@ -740,19 +1639,13 @@ var definition = [{
740
1639
  group: {
741
1640
  label: defineMessage({
742
1641
  id: "cGItoy",
743
- defaultMessage: [{
744
- "type": 0,
745
- "value": "List"
746
- }]
1642
+ defaultMessage: "List"
747
1643
  }),
748
1644
  order: 4
749
1645
  },
750
1646
  title: defineMessage({
751
1647
  id: "75nZbY",
752
- defaultMessage: [{
753
- "type": 0,
754
- "value": "Keypad"
755
- }]
1648
+ defaultMessage: "Keypad"
756
1649
  }),
757
1650
  layouts: ['top', 'middle', 'bottom'],
758
1651
  component: KeypadScreen,
@@ -760,10 +1653,7 @@ var definition = [{
760
1653
  id: 'keypad',
761
1654
  label: defineMessage({
762
1655
  id: "Z4f5qh",
763
- defaultMessage: [{
764
- "type": 0,
765
- "value": "Buttons"
766
- }]
1656
+ defaultMessage: "Buttons"
767
1657
  }),
768
1658
  fields: [{
769
1659
  name: 'layout',
@@ -771,20 +1661,14 @@ var definition = [{
771
1661
  defaultValue: 'middle',
772
1662
  label: defineMessage({
773
1663
  id: "4iBXj2",
774
- defaultMessage: [{
775
- "type": 0,
776
- "value": "Layout"
777
- }]
1664
+ defaultMessage: "Layout"
778
1665
  })
779
1666
  }, {
780
1667
  name: 'items',
781
1668
  type: 'buttons',
782
1669
  label: defineMessage({
783
1670
  id: "fbUW2U",
784
- defaultMessage: [{
785
- "type": 0,
786
- "value": "Items"
787
- }]
1671
+ defaultMessage: "Items"
788
1672
  }),
789
1673
  isSection: true
790
1674
  }, {
@@ -800,10 +1684,7 @@ var definition = [{
800
1684
  },
801
1685
  label: defineMessage({
802
1686
  id: "FjuRaw",
803
- defaultMessage: [{
804
- "type": 0,
805
- "value": "Keypad settings"
806
- }]
1687
+ defaultMessage: "Keypad settings"
807
1688
  })
808
1689
  }, {
809
1690
  name: 'buttonStyles',
@@ -819,10 +1700,7 @@ var definition = [{
819
1700
  },
820
1701
  label: defineMessage({
821
1702
  id: "Arl5Ze",
822
- defaultMessage: [{
823
- "type": 0,
824
- "value": "Button styles"
825
- }]
1703
+ defaultMessage: "Button styles"
826
1704
  }),
827
1705
  isList: true
828
1706
  }]
@@ -830,10 +1708,7 @@ var definition = [{
830
1708
  id: 'popups',
831
1709
  label: defineMessage({
832
1710
  id: "FYm4w+",
833
- defaultMessage: [{
834
- "type": 0,
835
- "value": "Popups"
836
- }]
1711
+ defaultMessage: "Popups"
837
1712
  }),
838
1713
  fields: [{
839
1714
  name: 'popupStyles',
@@ -846,40 +1721,28 @@ var definition = [{
846
1721
  type: 'card-layout',
847
1722
  label: defineMessage({
848
1723
  id: "OPxJx/",
849
- defaultMessage: [{
850
- "type": 0,
851
- "value": "Layout"
852
- }]
1724
+ defaultMessage: "Layout"
853
1725
  })
854
1726
  }, {
855
1727
  name: 'headingTextStyle',
856
1728
  type: 'text-style-form',
857
1729
  label: defineMessage({
858
1730
  id: "zrK6ak",
859
- defaultMessage: [{
860
- "type": 0,
861
- "value": "Heading text style"
862
- }]
1731
+ defaultMessage: "Heading text style"
863
1732
  })
864
1733
  }, {
865
1734
  name: 'contentTextStyle',
866
1735
  type: 'text-style-form',
867
1736
  label: defineMessage({
868
1737
  id: "z9nSIG",
869
- defaultMessage: [{
870
- "type": 0,
871
- "value": "Content text style"
872
- }]
1738
+ defaultMessage: "Content text style"
873
1739
  })
874
1740
  }, {
875
1741
  name: 'boxStyle',
876
1742
  type: 'box-style-form',
877
1743
  label: defineMessage({
878
1744
  id: "p1pghO",
879
- defaultMessage: [{
880
- "type": 0,
881
- "value": "Box style"
882
- }]
1745
+ defaultMessage: "Box style"
883
1746
  })
884
1747
  }, {
885
1748
  name: 'button',
@@ -887,30 +1750,21 @@ var definition = [{
887
1750
  isList: true,
888
1751
  label: defineMessage({
889
1752
  id: "i6bmbD",
890
- defaultMessage: [{
891
- "type": 0,
892
- "value": "Button"
893
- }]
1753
+ defaultMessage: "Button"
894
1754
  }),
895
1755
  fields: [{
896
1756
  name: 'buttonTextStyle',
897
1757
  type: 'text-style-form',
898
1758
  label: defineMessage({
899
1759
  id: "p5RHzq",
900
- defaultMessage: [{
901
- "type": 0,
902
- "value": "Button text style"
903
- }]
1760
+ defaultMessage: "Button text style"
904
1761
  })
905
1762
  }, {
906
1763
  name: 'buttonStyle',
907
1764
  type: 'box-style-form',
908
1765
  label: defineMessage({
909
1766
  id: "nno1Pq",
910
- defaultMessage: [{
911
- "type": 0,
912
- "value": "Button style"
913
- }]
1767
+ defaultMessage: "Button style"
914
1768
  })
915
1769
  }]
916
1770
  }]
@@ -919,10 +1773,7 @@ var definition = [{
919
1773
  id: 'popup',
920
1774
  label: defineMessage({
921
1775
  id: "sSahY1",
922
- defaultMessage: [{
923
- "type": 0,
924
- "value": "Popup"
925
- }]
1776
+ defaultMessage: "Popup"
926
1777
  }),
927
1778
  defaultValue: [],
928
1779
  repeatable: true,
@@ -932,20 +1783,14 @@ var definition = [{
932
1783
  type: 'heading-element',
933
1784
  label: defineMessage({
934
1785
  id: "6iR9Mt",
935
- defaultMessage: [{
936
- "type": 0,
937
- "value": "Heading"
938
- }]
1786
+ defaultMessage: "Heading"
939
1787
  })
940
1788
  }, {
941
1789
  name: 'content',
942
1790
  type: 'text-element',
943
1791
  label: defineMessage({
944
1792
  id: "uoF5Pv",
945
- defaultMessage: [{
946
- "type": 0,
947
- "value": "Content"
948
- }]
1793
+ defaultMessage: "Content"
949
1794
  }),
950
1795
  theme: {
951
1796
  label: {
@@ -957,30 +1802,21 @@ var definition = [{
957
1802
  type: 'visual',
958
1803
  label: defineMessage({
959
1804
  id: "HwqzVR",
960
- defaultMessage: [{
961
- "type": 0,
962
- "value": "Visual"
963
- }]
1805
+ defaultMessage: "Visual"
964
1806
  })
965
1807
  }, {
966
1808
  name: 'popupBoxStyle',
967
1809
  type: 'box-style-form',
968
1810
  label: defineMessage({
969
1811
  id: "p1pghO",
970
- defaultMessage: [{
971
- "type": 0,
972
- "value": "Box style"
973
- }]
1812
+ defaultMessage: "Box style"
974
1813
  })
975
1814
  }, {
976
1815
  name: 'button',
977
1816
  type: 'button-link',
978
1817
  label: defineMessage({
979
1818
  id: "i6bmbD",
980
- defaultMessage: [{
981
- "type": 0,
982
- "value": "Button"
983
- }]
1819
+ defaultMessage: "Button"
984
1820
  }),
985
1821
  theme: {
986
1822
  label: {
@@ -997,10 +1833,7 @@ var definition = [{
997
1833
  },
998
1834
  label: defineMessage({
999
1835
  id: "N25iDO",
1000
- defaultMessage: [{
1001
- "type": 0,
1002
- "value": "Title"
1003
- }]
1836
+ defaultMessage: "Title"
1004
1837
  })
1005
1838
  }, {
1006
1839
  name: 'subtitle',
@@ -1010,30 +1843,21 @@ var definition = [{
1010
1843
  },
1011
1844
  label: defineMessage({
1012
1845
  id: "EcZYpr",
1013
- defaultMessage: [{
1014
- "type": 0,
1015
- "value": "Subtitle"
1016
- }]
1846
+ defaultMessage: "Subtitle"
1017
1847
  })
1018
1848
  }, {
1019
1849
  name: 'background',
1020
1850
  type: 'background',
1021
1851
  label: defineMessage({
1022
1852
  id: "+MPZRu",
1023
- defaultMessage: [{
1024
- "type": 0,
1025
- "value": "Background"
1026
- }]
1853
+ defaultMessage: "Background"
1027
1854
  })
1028
1855
  }, {
1029
1856
  name: 'header',
1030
1857
  type: 'header',
1031
1858
  label: defineMessage({
1032
1859
  id: "rhuDxI",
1033
- defaultMessage: [{
1034
- "type": 0,
1035
- "value": "Header"
1036
- }]
1860
+ defaultMessage: "Header"
1037
1861
  }),
1038
1862
  theme: {
1039
1863
  badge: {
@@ -1048,10 +1872,7 @@ var definition = [{
1048
1872
  type: 'footer',
1049
1873
  label: defineMessage({
1050
1874
  id: "g4nybp",
1051
- defaultMessage: [{
1052
- "type": 0,
1053
- "value": "Footer"
1054
- }]
1875
+ defaultMessage: "Footer"
1055
1876
  }),
1056
1877
  theme: {
1057
1878
  callToAction: {