@cleartrip/ct-design-header 1.2.0-SNAPSHOT-header-test.0 → 1.2.0-SNAPSHOT-scss-test-v1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { __assign } from 'tslib';
1
+ import { __assign, __makeTemplateObject } from 'tslib';
2
2
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
3
3
  import { Container } from '@cleartrip/ct-design-container';
4
4
  import { Typography } from '@cleartrip/ct-design-typography';
@@ -7,366 +7,488 @@ import { Divider } from '@cleartrip/ct-design-divider';
7
7
  import { Offers, BusinessBag, ChevronDown, MyTrips, SupportIcon, ArrowRight, MyAccount, SavedCard, Travellers, HiFive, Wallet, SettingsCog, PrivacyRights, HeaderChevronRight, FkVip, FkPremium, InsiderIcon, InsiderElite, Supercoin, Signout, CTLogo, Fkcompany } from '@cleartrip/ct-design-icons';
8
8
  import { useState, useRef, useEffect, useCallback, useMemo } from 'react';
9
9
  import { Shimmer } from '@cleartrip/ct-design-shimmer';
10
+ import styled from 'styled-components';
10
11
 
11
12
  var OFFERS_URL = 'all-offers/?categories=flights';
12
13
  var MY_TRIPS_URL = '/account/trips';
13
14
  var SUPPORT_URL = '/support';
14
- var NAVBAR_OPTIONS = [
15
- {
16
- lefticon: Offers,
17
- text: 'Offers',
18
- isHoverable: false,
19
- isClickable: true,
20
- link: OFFERS_URL,
21
- },
22
- {
23
- lefticon: BusinessBag,
24
- text: 'Business',
25
- rightIcon: ChevronDown,
26
- isHoverable: true,
27
- },
28
- {
29
- lefticon: MyTrips,
30
- text: 'My Trips',
31
- isHoverable: false,
32
- isClickable: true,
33
- link: MY_TRIPS_URL,
34
- },
35
- {
36
- lefticon: SupportIcon,
37
- text: 'Support',
38
- isHoverable: false,
39
- isClickable: true,
40
- link: SUPPORT_URL,
41
- },
42
- ];
15
+ var NAVBAR_OPTIONS = [{
16
+ lefticon: Offers,
17
+ text: 'Offers',
18
+ isHoverable: false,
19
+ isClickable: true,
20
+ link: OFFERS_URL
21
+ }, {
22
+ lefticon: BusinessBag,
23
+ text: 'Business',
24
+ rightIcon: ChevronDown,
25
+ isHoverable: true
26
+ }, {
27
+ lefticon: MyTrips,
28
+ text: 'My Trips',
29
+ isHoverable: false,
30
+ isClickable: true,
31
+ link: MY_TRIPS_URL
32
+ }, {
33
+ lefticon: SupportIcon,
34
+ text: 'Support',
35
+ isHoverable: false,
36
+ isClickable: true,
37
+ link: SUPPORT_URL
38
+ }];
43
39
  var LOBS = {
44
- FLIGHTS: 'Flights',
45
- HOTELS: 'Hotels',
46
- TRAIN: 'Trains',
47
- PACKAGES: 'Packages',
48
- BUSES: 'Buses',
40
+ FLIGHTS: 'Flights',
41
+ HOTELS: 'Hotels',
42
+ TRAIN: 'Trains',
43
+ PACKAGES: 'Packages',
44
+ BUSES: 'Buses'
49
45
  };
50
- var LOB_DATA = [
51
- {
52
- title: LOBS.FLIGHTS,
53
- image: 'https://rukmini-ct.flixcart.com/f_auto,w_48,h_48,dpr_2/offermgmt-prod/offermgmt/images/banner/flight_uhp.png?cache=true',
54
- link: '/flights',
55
- },
56
- {
57
- title: LOBS.HOTELS,
58
- image: 'https://rukmini-ct.flixcart.com/f_auto,w_48,h_48,dpr_2/offermgmt-prod/offermgmt/images/banner/hotel_uhp.png?cache=true',
59
- link: '/hotels',
60
- },
61
- {
62
- title: LOBS.BUSES,
63
- image: 'https://rukmini-ct.flixcart.com/f_auto,w_40,h_40,dpr_2/offermgmt-prod/offermgmt/images/banner/bus_uhp.png?cache=true',
64
- link: '/bus',
65
- },
66
- {
67
- title: LOBS.TRAIN,
68
- image: 'https://rukmini-ct.flixcart.com/f_auto,w_40,h_40,dpr_2/offermgmt-prod/offermgmt/images/banner/train_uhp.png?cache=true',
69
- link: '/',
70
- },
71
- {
72
- title: LOBS.PACKAGES,
73
- image: 'https://rukmini-ct.flixcart.com/f_auto,w_40,h_40,dpr_2/offermgmt-prod/offermgmt/images/banner/holiday_uhp.png?cache=true',
74
- link: '/#',
75
- },
76
- ];
77
- var bdConfig = [
78
- {
79
- title: 'AgentBox',
80
- subtitle: 'For travel agents',
81
- details: 'One-stop travel solution offering the best deals to our travel agency partners',
82
- },
83
- {
84
- title: 'OutOfOffice',
85
- subtitle: 'For startups, corporates and SMEs',
86
- details: 'Manage corporate business travel, smartly',
87
- },
88
- {
89
- title: 'MICE',
90
- subtitle: 'For corporate events',
91
- details: 'An end-to-end management solution for all your corporate events',
92
- },
93
- {
94
- title: 'API',
95
- subtitle: 'For developers',
96
- details: 'Unlock seamless integration and scale with our powerful, reliable APIs',
97
- },
98
- ];
46
+ var LOB_DATA = [{
47
+ title: LOBS.FLIGHTS,
48
+ image: 'https://rukmini-ct.flixcart.com/f_auto,w_48,h_48,dpr_2/offermgmt-prod/offermgmt/images/banner/flight_uhp.png?cache=true',
49
+ link: '/flights'
50
+ }, {
51
+ title: LOBS.HOTELS,
52
+ image: 'https://rukmini-ct.flixcart.com/f_auto,w_48,h_48,dpr_2/offermgmt-prod/offermgmt/images/banner/hotel_uhp.png?cache=true',
53
+ link: '/hotels'
54
+ }, {
55
+ title: LOBS.BUSES,
56
+ image: 'https://rukmini-ct.flixcart.com/f_auto,w_40,h_40,dpr_2/offermgmt-prod/offermgmt/images/banner/bus_uhp.png?cache=true',
57
+ link: '/bus'
58
+ }, {
59
+ title: LOBS.TRAIN,
60
+ image: 'https://rukmini-ct.flixcart.com/f_auto,w_40,h_40,dpr_2/offermgmt-prod/offermgmt/images/banner/train_uhp.png?cache=true',
61
+ link: '/'
62
+ }, {
63
+ title: LOBS.PACKAGES,
64
+ image: 'https://rukmini-ct.flixcart.com/f_auto,w_40,h_40,dpr_2/offermgmt-prod/offermgmt/images/banner/holiday_uhp.png?cache=true',
65
+ link: '/#'
66
+ }];
67
+ var bdConfig = [{
68
+ title: 'AgentBox',
69
+ subtitle: 'For travel agents',
70
+ details: 'One-stop travel solution offering the best deals to our travel agency partners'
71
+ }, {
72
+ title: 'OutOfOffice',
73
+ subtitle: 'For startups, corporates and SMEs',
74
+ details: 'Manage corporate business travel, smartly'
75
+ }, {
76
+ title: 'MICE',
77
+ subtitle: 'For corporate events',
78
+ details: 'An end-to-end management solution for all your corporate events'
79
+ }, {
80
+ title: 'API',
81
+ subtitle: 'For developers',
82
+ details: 'Unlock seamless integration and scale with our powerful, reliable APIs'
83
+ }];
99
84
  var BUSINESS_DROPDOWN_HEADING = 'Other business services';
100
85
 
101
86
  var LobsHeader = function (_a) {
102
- var selectedLOB = _a.selectedLOB;
103
- return (jsx(Container, __assign({ className: 'flex p-4 flex-middle flex-center p-sticky', css: {
104
- gap: 40,
105
- height: 64,
106
- background: ' #F3F5FA',
107
- top: 64,
108
- zIndex: 2,
109
- } }, { children: LOB_DATA.map(function (item, index) {
110
- return (jsxs(Container, __assign({ className: 'flex flex-middle c-pointer', css: {
111
- gap: 8,
112
- background: selectedLOB === item.title ? '#FFFFFF' : 'transparent',
113
- borderRadius: selectedLOB === item.title ? '40px' : '0',
114
- padding: selectedLOB === item.title ? '8px 16px 8px 8px' : '0',
115
- }, onClick: function () {
116
- window.location.href = item.link;
117
- } }, { children: [jsx("img", { src: item.image, alt: item.title, width: 32, height: 32 }), jsx(Typography, __assign({ variant: 'P1', style: { fontWeight: selectedLOB === item.title ? 600 : 500 }, isClickable: true }, { children: item.title }))] }), index));
118
- }) })));
87
+ var selectedLOB = _a.selectedLOB;
88
+ return jsx(Container, __assign({
89
+ className: 'flex p-4 flex-middle flex-center p-sticky',
90
+ css: {
91
+ gap: 40,
92
+ height: 64,
93
+ background: ' #F3F5FA',
94
+ top: 64,
95
+ zIndex: 2
96
+ }
97
+ }, {
98
+ children: LOB_DATA.map(function (item, index) {
99
+ return jsxs(Container, __assign({
100
+ className: 'flex flex-middle c-pointer',
101
+ css: {
102
+ gap: 8,
103
+ background: selectedLOB === item.title ? '#FFFFFF' : 'transparent',
104
+ borderRadius: selectedLOB === item.title ? '40px' : '0',
105
+ padding: selectedLOB === item.title ? '8px 16px 8px 8px' : '0'
106
+ },
107
+ onClick: function () {
108
+ window.location.href = item.link;
109
+ }
110
+ }, {
111
+ children: [jsx("img", {
112
+ src: item.image,
113
+ alt: item.title,
114
+ width: 32,
115
+ height: 32
116
+ }), jsx(Typography, __assign({
117
+ variant: 'P1',
118
+ style: {
119
+ fontWeight: selectedLOB === item.title ? 600 : 500
120
+ },
121
+ isClickable: true
122
+ }, {
123
+ children: item.title
124
+ }))]
125
+ }), index);
126
+ })
127
+ }));
119
128
  };
120
129
 
121
130
  var useDelayedUnmount = function (show, unmountDelay) {
122
- var _a = useState(show), showComponent = _a[0], setShowComponent = _a[1];
123
- var timerRef = useRef();
124
- useEffect(function () {
125
- if (!show) {
126
- timerRef.current = setTimeout(function () {
127
- setShowComponent(false);
128
- }, unmountDelay);
129
- }
130
- else {
131
- setShowComponent(show);
132
- }
133
- return function () {
134
- (timerRef === null || timerRef === void 0 ? void 0 : timerRef.current) && clearTimeout(timerRef.current);
135
- };
136
- }, [show]);
137
- return showComponent;
131
+ var _a = useState(show),
132
+ showComponent = _a[0],
133
+ setShowComponent = _a[1];
134
+ var timerRef = useRef();
135
+ useEffect(function () {
136
+ if (!show) {
137
+ timerRef.current = setTimeout(function () {
138
+ setShowComponent(false);
139
+ }, unmountDelay);
140
+ } else {
141
+ setShowComponent(show);
142
+ }
143
+ return function () {
144
+ (timerRef === null || timerRef === void 0 ? void 0 : timerRef.current) && clearTimeout(timerRef.current);
145
+ };
146
+ }, [show]);
147
+ return showComponent;
138
148
  };
139
149
  var useMountTransition = function (isMounted, unmountDelay) {
140
- var _a = useState(false), hasTransitionedIn = _a[0], setHasTransitionedIn = _a[1];
141
- var timeoutIdRef = useRef();
142
- useEffect(function () {
143
- if (isMounted && !hasTransitionedIn) {
144
- setTimeout(function () {
145
- setHasTransitionedIn(true);
146
- }, 0);
147
- }
148
- else if (!isMounted && hasTransitionedIn) {
149
- timeoutIdRef.current = setTimeout(function () { return setHasTransitionedIn(false); }, unmountDelay);
150
- }
151
- return function () {
152
- if (timeoutIdRef && timeoutIdRef.current) {
153
- clearTimeout(timeoutIdRef.current);
154
- }
155
- };
156
- }, [unmountDelay, isMounted]);
157
- return hasTransitionedIn;
150
+ var _a = useState(false),
151
+ hasTransitionedIn = _a[0],
152
+ setHasTransitionedIn = _a[1];
153
+ var timeoutIdRef = useRef();
154
+ useEffect(function () {
155
+ if (isMounted && !hasTransitionedIn) {
156
+ setTimeout(function () {
157
+ setHasTransitionedIn(true);
158
+ }, 0);
159
+ } else if (!isMounted && hasTransitionedIn) {
160
+ timeoutIdRef.current = setTimeout(function () {
161
+ return setHasTransitionedIn(false);
162
+ }, unmountDelay);
163
+ }
164
+ return function () {
165
+ if (timeoutIdRef && timeoutIdRef.current) {
166
+ clearTimeout(timeoutIdRef.current);
167
+ }
168
+ };
169
+ }, [unmountDelay, isMounted]);
170
+ return hasTransitionedIn;
158
171
  };
159
172
 
160
173
  function HeaderAnimatedMask(_a) {
161
- var children = _a.children, onMaskClick = _a.onMaskClick, show = _a.show, marginTop = _a.marginTop, handleDropdownMouseEnter = _a.handleDropdownMouseEnter, handleDropdownMouseLeave = _a.handleDropdownMouseLeave;
162
- useEffect(function () {
163
- if (show) {
164
- document.body.style.overflow = 'hidden';
165
- }
166
- return function () {
167
- document.body.style.overflow = 'initial';
168
- };
169
- }, [show]);
170
- var showFlagProxy = useDelayedUnmount(show, 300);
171
- var triggerTransition = useMountTransition(show, 100);
172
- var triggerOpenTransition = triggerTransition;
173
- console.log(show, showFlagProxy, 'custom hook');
174
- return (jsxs(Fragment, { children: [showFlagProxy && (jsx(Container, { id: 'mask-container', css: {
175
- position: 'fixed',
176
- backgroundColor: '#000',
177
- opacity: triggerOpenTransition ? 0.4 : 0,
178
- width: '100%',
179
- height: '100vh',
180
- left: 0,
181
- top: marginTop || 0,
182
- zIndex: 9,
183
- transition: 'opacity 300ms ease-in',
184
- }, onClick: onMaskClick })), showFlagProxy && (jsx(Container, __assign({ onMouseEnter: handleDropdownMouseEnter, onMouseLeave: handleDropdownMouseLeave }, { children: children })))] }));
174
+ var children = _a.children,
175
+ onMaskClick = _a.onMaskClick,
176
+ show = _a.show,
177
+ marginTop = _a.marginTop,
178
+ handleDropdownMouseEnter = _a.handleDropdownMouseEnter,
179
+ handleDropdownMouseLeave = _a.handleDropdownMouseLeave;
180
+ useEffect(function () {
181
+ if (show) {
182
+ document.body.style.overflow = 'hidden';
183
+ }
184
+ return function () {
185
+ document.body.style.overflow = 'initial';
186
+ };
187
+ }, [show]);
188
+ var showFlagProxy = useDelayedUnmount(show, 300);
189
+ var triggerTransition = useMountTransition(show, 100);
190
+ var triggerOpenTransition = triggerTransition;
191
+ console.log(show, showFlagProxy, 'custom hook');
192
+ return jsxs(Fragment, {
193
+ children: [showFlagProxy && jsx(Container, {
194
+ id: 'mask-container',
195
+ css: {
196
+ position: 'fixed',
197
+ backgroundColor: '#000',
198
+ opacity: triggerOpenTransition ? 0.4 : 0,
199
+ width: '100%',
200
+ height: '100vh',
201
+ left: 0,
202
+ top: marginTop || 0,
203
+ zIndex: 9,
204
+ transition: 'opacity 300ms ease-in'
205
+ },
206
+ onClick: onMaskClick
207
+ }), showFlagProxy && jsx(Container, __assign({
208
+ onMouseEnter: handleDropdownMouseEnter,
209
+ onMouseLeave: handleDropdownMouseLeave
210
+ }, {
211
+ children: children
212
+ }))]
213
+ });
185
214
  }
186
215
 
187
216
  var MIN_CLOSE_DELAY = 150;
188
217
  var useHoverDropdown = function (_a) {
189
- var _b = _a === void 0 ? {} : _a, _c = _b.closeDelay, closeDelayArg = _c === void 0 ? 300 : _c, _d = _b.openDelay, openDelay = _d === void 0 ? 500 : _d;
190
- var closeDelay = Math.max(closeDelayArg, MIN_CLOSE_DELAY);
191
- var _e = useState(false), isDropdownVisible = _e[0], setIsDropdownVisible = _e[1];
192
- var _f = useState(null), hoveredElemIndex = _f[0], setHoveredElemIndex = _f[1];
193
- var timeoutRef = useRef(null);
194
- var openTimeoutRef = useRef(null);
195
- var cancelElementHover = useRef(false);
196
- var handleOnMouseEnter = useCallback(function (index) {
197
- console.log('handleOnMouseEnter');
198
- if (timeoutRef.current)
199
- clearTimeout(timeoutRef.current);
200
- if (openTimeoutRef.current)
201
- clearTimeout(openTimeoutRef.current);
202
- cancelElementHover.current = false;
203
- openTimeoutRef.current = setTimeout(function () {
204
- setIsDropdownVisible(true);
205
- if (!cancelElementHover.current) {
206
- setHoveredElemIndex(index);
207
- }
208
- }, openDelay);
209
- }, [openDelay]);
210
- var handleOnMouseLeave = useCallback(function () {
211
- console.log('handleMouseLeave');
212
- cancelElementHover.current = true;
213
- timeoutRef.current = setTimeout(function () {
214
- setIsDropdownVisible(false);
215
- setHoveredElemIndex(null);
216
- }, closeDelay);
217
- }, [closeDelay]);
218
- var handleDropdownMouseEnter = useCallback(function () {
219
- console.log('handleDropdownMouseEnter');
220
- if (timeoutRef.current)
221
- clearTimeout(timeoutRef.current);
222
- }, []);
223
- var handleDropdownMouseLeave = useCallback(function () {
224
- console.log('handleDropdownMouseLeave');
225
- cancelElementHover.current = true;
226
- (timeoutRef === null || timeoutRef === void 0 ? void 0 : timeoutRef.current) && clearTimeout(timeoutRef.current);
227
- timeoutRef.current = setTimeout(function () {
228
- setIsDropdownVisible(false);
229
- setHoveredElemIndex(null);
230
- }, closeDelay);
231
- }, []);
232
- useEffect(function () {
233
- var handleMouseLeaveWindow = function (event) {
234
- if (event.clientY <= 0) {
235
- setIsDropdownVisible(false);
236
- setHoveredElemIndex(null);
237
- }
238
- };
239
- window.addEventListener('mouseleave', handleMouseLeaveWindow);
240
- return function () {
241
- window.removeEventListener('mouseleave', handleMouseLeaveWindow);
242
- };
243
- }, []);
244
- return {
245
- isDropdownVisible: isDropdownVisible,
246
- hoveredElemIndex: hoveredElemIndex,
247
- handleOnMouseEnter: handleOnMouseEnter,
248
- handleOnMouseLeave: handleOnMouseLeave,
249
- handleDropdownMouseEnter: handleDropdownMouseEnter,
250
- handleDropdownMouseLeave: handleDropdownMouseLeave,
218
+ var _b = _a === void 0 ? {} : _a,
219
+ _c = _b.closeDelay,
220
+ closeDelayArg = _c === void 0 ? 300 : _c,
221
+ _d = _b.openDelay,
222
+ openDelay = _d === void 0 ? 500 : _d;
223
+ var closeDelay = Math.max(closeDelayArg, MIN_CLOSE_DELAY);
224
+ var _e = useState(false),
225
+ isDropdownVisible = _e[0],
226
+ setIsDropdownVisible = _e[1];
227
+ var _f = useState(null),
228
+ hoveredElemIndex = _f[0],
229
+ setHoveredElemIndex = _f[1];
230
+ var timeoutRef = useRef(null);
231
+ var openTimeoutRef = useRef(null);
232
+ var cancelElementHover = useRef(false);
233
+ var handleOnMouseEnter = useCallback(function (index) {
234
+ console.log('handleOnMouseEnter');
235
+ if (timeoutRef.current) clearTimeout(timeoutRef.current);
236
+ if (openTimeoutRef.current) clearTimeout(openTimeoutRef.current);
237
+ cancelElementHover.current = false;
238
+ openTimeoutRef.current = setTimeout(function () {
239
+ setIsDropdownVisible(true);
240
+ if (!cancelElementHover.current) {
241
+ setHoveredElemIndex(index);
242
+ }
243
+ }, openDelay);
244
+ }, [openDelay]);
245
+ var handleOnMouseLeave = useCallback(function () {
246
+ console.log('handleMouseLeave');
247
+ cancelElementHover.current = true;
248
+ timeoutRef.current = setTimeout(function () {
249
+ setIsDropdownVisible(false);
250
+ setHoveredElemIndex(null);
251
+ }, closeDelay);
252
+ }, [closeDelay]);
253
+ var handleDropdownMouseEnter = useCallback(function () {
254
+ console.log('handleDropdownMouseEnter');
255
+ if (timeoutRef.current) clearTimeout(timeoutRef.current);
256
+ }, []);
257
+ var handleDropdownMouseLeave = useCallback(function () {
258
+ console.log('handleDropdownMouseLeave');
259
+ cancelElementHover.current = true;
260
+ (timeoutRef === null || timeoutRef === void 0 ? void 0 : timeoutRef.current) && clearTimeout(timeoutRef.current);
261
+ timeoutRef.current = setTimeout(function () {
262
+ setIsDropdownVisible(false);
263
+ setHoveredElemIndex(null);
264
+ }, closeDelay);
265
+ }, []);
266
+ useEffect(function () {
267
+ var handleMouseLeaveWindow = function (event) {
268
+ if (event.clientY <= 0) {
269
+ setIsDropdownVisible(false);
270
+ setHoveredElemIndex(null);
271
+ }
272
+ };
273
+ window.addEventListener('mouseleave', handleMouseLeaveWindow);
274
+ return function () {
275
+ window.removeEventListener('mouseleave', handleMouseLeaveWindow);
251
276
  };
277
+ }, []);
278
+ return {
279
+ isDropdownVisible: isDropdownVisible,
280
+ hoveredElemIndex: hoveredElemIndex,
281
+ handleOnMouseEnter: handleOnMouseEnter,
282
+ handleOnMouseLeave: handleOnMouseLeave,
283
+ handleDropdownMouseEnter: handleDropdownMouseEnter,
284
+ handleDropdownMouseLeave: handleDropdownMouseLeave
285
+ };
252
286
  };
253
287
 
254
288
  var useDropdownAnimation = function (isOpen) {
255
- var containerRef = useRef(null);
256
- var openDropdown = function () {
289
+ var containerRef = useRef(null);
290
+ var openDropdown = function () {
291
+ if (containerRef.current) {
292
+ var fullHeight_1 = containerRef.current.scrollHeight;
293
+ containerRef.current.style.maxHeight = "".concat(fullHeight_1 / 2, "px");
294
+ containerRef.current.style.opacity = '0';
295
+ requestAnimationFrame(function () {
257
296
  if (containerRef.current) {
258
- var fullHeight_1 = containerRef.current.scrollHeight;
259
- containerRef.current.style.maxHeight = "".concat(fullHeight_1 / 2, "px");
260
- containerRef.current.style.opacity = '0';
261
- requestAnimationFrame(function () {
262
- if (containerRef.current) {
263
- containerRef.current.style.transition = 'max-height 0.3s ease-in-out, opacity 0.3s ease-in-out';
264
- containerRef.current.style.maxHeight = "".concat(fullHeight_1, "px");
265
- containerRef.current.style.opacity = '1';
266
- }
267
- });
297
+ containerRef.current.style.transition = 'max-height 0.3s ease-in-out, opacity 0.3s ease-in-out';
298
+ containerRef.current.style.maxHeight = "".concat(fullHeight_1, "px");
299
+ containerRef.current.style.opacity = '1';
268
300
  }
269
- };
270
- var closeDropdown = function () {
301
+ });
302
+ }
303
+ };
304
+ var closeDropdown = function () {
305
+ if (containerRef.current) {
306
+ var fullHeight = containerRef.current.scrollHeight;
307
+ containerRef.current.style.transition = 'max-height 0.3s ease-in-out, opacity 0.3s ease-in-out';
308
+ containerRef.current.style.maxHeight = "".concat(fullHeight / 2, "px");
309
+ containerRef.current.style.opacity = '0';
310
+ setTimeout(function () {
271
311
  if (containerRef.current) {
272
- var fullHeight = containerRef.current.scrollHeight;
273
- containerRef.current.style.transition = 'max-height 0.3s ease-in-out, opacity 0.3s ease-in-out';
274
- containerRef.current.style.maxHeight = "".concat(fullHeight / 2, "px");
275
- containerRef.current.style.opacity = '0';
276
- setTimeout(function () {
277
- if (containerRef.current) {
278
- containerRef.current.style.maxHeight = '0px';
279
- }
280
- }, 300);
312
+ containerRef.current.style.maxHeight = '0px';
281
313
  }
282
- };
283
- useEffect(function () {
284
- if (isOpen) {
285
- openDropdown();
286
- }
287
- else {
288
- closeDropdown();
289
- }
290
- }, [isOpen]);
291
- return { containerRef: containerRef };
314
+ }, 300);
315
+ }
316
+ };
317
+ useEffect(function () {
318
+ if (isOpen) {
319
+ openDropdown();
320
+ } else {
321
+ closeDropdown();
322
+ }
323
+ }, [isOpen]);
324
+ return {
325
+ containerRef: containerRef
326
+ };
292
327
  };
293
328
 
294
329
  var BusinessDropdownContent = function (_a) {
295
- var isOpen = _a.isOpen;
296
- var _b = useState(0), leftPosition = _b[0], setLeftPosition = _b[1];
297
- var containerRef = useDropdownAnimation(isOpen).containerRef;
298
- useEffect(function () {
299
- var updatePosition = function () {
300
- if (containerRef.current) {
301
- var screenWidth = window.innerWidth;
302
- var containerWidth = containerRef.current.offsetWidth || 0;
303
- setLeftPosition((screenWidth - containerWidth) / 2);
330
+ var isOpen = _a.isOpen;
331
+ var _b = useState(0),
332
+ leftPosition = _b[0],
333
+ setLeftPosition = _b[1];
334
+ var containerRef = useDropdownAnimation(isOpen).containerRef;
335
+ useEffect(function () {
336
+ var updatePosition = function () {
337
+ if (containerRef.current) {
338
+ var screenWidth = window.innerWidth;
339
+ var containerWidth = containerRef.current.offsetWidth || 0;
340
+ setLeftPosition((screenWidth - containerWidth) / 2);
341
+ }
342
+ };
343
+ updatePosition();
344
+ window.addEventListener('resize', updatePosition);
345
+ return function () {
346
+ return window.removeEventListener('resize', updatePosition);
347
+ };
348
+ }, []);
349
+ return jsxs(Container, __assign({
350
+ ref: containerRef,
351
+ className: 'bg-neutral-100 o-hidden',
352
+ css: {
353
+ top: '76px',
354
+ position: 'fixed',
355
+ left: "".concat(leftPosition, "px"),
356
+ borderRadius: 24,
357
+ boxShadow: '0px 8px 24px 0px rgba(26, 26, 26, 0.10)',
358
+ width: 'fit-content',
359
+ zIndex: 1002,
360
+ opacity: 0
361
+ }
362
+ }, {
363
+ children: [jsx(Container, __assign({
364
+ className: 'px-6 py-5',
365
+ backgroundColor: '#FFF1EC'
366
+ }, {
367
+ children: jsx(Typography, __assign({
368
+ variant: 'HM2',
369
+ style: {
370
+ lineHeight: '24px'
371
+ }
372
+ }, {
373
+ children: BUSINESS_DROPDOWN_HEADING
374
+ }))
375
+ })), jsx(Container, __assign({
376
+ className: 'flex flex-row p-6',
377
+ css: {
378
+ columnGap: '48px',
379
+ width: 'fit-content'
380
+ }
381
+ }, {
382
+ children: bdConfig.map(function (_a) {
383
+ var title = _a.title,
384
+ subtitle = _a.subtitle,
385
+ details = _a.details;
386
+ return jsxs(Container, __assign({
387
+ css: {
388
+ width: '200px'
389
+ },
390
+ className: 'bd-hover-container c-pointer'
391
+ }, {
392
+ children: [jsxs(Container, __assign({
393
+ className: 'flex flex-row flex-middle',
394
+ style: {
395
+ columnGap: '8px'
304
396
  }
305
- };
306
- updatePosition();
307
- window.addEventListener('resize', updatePosition);
308
- return function () { return window.removeEventListener('resize', updatePosition); };
309
- }, []);
310
- return (jsxs(Container, __assign({ ref: containerRef, className: 'bg-neutral-100 o-hidden', css: {
311
- top: '76px',
312
- position: 'fixed',
313
- left: "".concat(leftPosition, "px"),
314
- borderRadius: 24,
315
- boxShadow: '0px 8px 24px 0px rgba(26, 26, 26, 0.10)',
316
- width: 'fit-content',
317
- zIndex: 1002,
318
- opacity: 0,
319
- } }, { children: [jsx(Container, __assign({ className: 'px-6 py-5', backgroundColor: '#FFF1EC' }, { children: jsx(Typography, __assign({ variant: 'HM2', style: { lineHeight: '24px' } }, { children: BUSINESS_DROPDOWN_HEADING })) })), jsx(Container, __assign({ className: 'flex flex-row p-6', css: { columnGap: '48px', width: 'fit-content' } }, { children: bdConfig.map(function (_a) {
320
- var title = _a.title, subtitle = _a.subtitle, details = _a.details;
321
- return (jsxs(Container, __assign({ css: { width: '200px' }, className: 'bd-hover-container' }, { children: [jsxs(Container, __assign({ className: 'flex flex-row flex-middle', style: { columnGap: '8px' } }, { children: [jsx(Typography, __assign({ variant: 'HM2', className: 'color-orange-on-hover' }, { children: title })), jsx(AnimatedArrow, {})] })), jsx(Typography, __assign({ variant: 'B3', className: 'mt-1', css: { opacity: 0.75 } }, { children: subtitle })), jsx(Typography, __assign({ variant: 'P3', color: 'subheading', className: 'mt-3' }, { children: details }))] }), title));
322
- }) }))] })));
397
+ }, {
398
+ children: [jsx(Typography, __assign({
399
+ variant: 'HM2',
400
+ className: 'color-orange-on-hover'
401
+ }, {
402
+ children: title
403
+ })), jsx(AnimatedArrow, {})]
404
+ })), jsx(Typography, __assign({
405
+ variant: 'B3',
406
+ className: 'mt-1',
407
+ css: {
408
+ opacity: 0.75
409
+ }
410
+ }, {
411
+ children: subtitle
412
+ })), jsx(Typography, __assign({
413
+ variant: 'P3',
414
+ color: 'subheading',
415
+ className: 'mt-3'
416
+ }, {
417
+ children: details
418
+ }))]
419
+ }), title);
420
+ })
421
+ }))]
422
+ }));
323
423
  };
324
424
  var AnimatedArrow = function () {
325
- return (jsxs("div", __assign({ className: 'bd-arrow-container' }, { children: [jsx("div", __assign({ className: 'bd-arrow-wrapper' }, { children: jsx(ArrowRight, {}) })), jsx("div", __assign({ className: 'bd-arrow-wrapper' }, { children: jsx(ArrowRight, {}) })), jsx("div", __assign({ className: 'bd-arrow-wrapper' }, { children: jsx(ArrowRight, {}) }))] })));
425
+ return jsxs("div", __assign({
426
+ className: 'bd-arrow-container'
427
+ }, {
428
+ children: [jsx("div", __assign({
429
+ className: 'bd-arrow-wrapper'
430
+ }, {
431
+ children: jsx(ArrowRight, {})
432
+ })), jsx("div", __assign({
433
+ className: 'bd-arrow-wrapper'
434
+ }, {
435
+ children: jsx(ArrowRight, {})
436
+ })), jsx("div", __assign({
437
+ className: 'bd-arrow-wrapper'
438
+ }, {
439
+ children: jsx(ArrowRight, {})
440
+ }))]
441
+ }));
326
442
  };
327
443
 
328
- var ACCOUNT_OPTIONS_POPUP_CONFIG = [
329
- {
330
- text: 'My Profile',
331
- icon: jsx(MyAccount, { width: 24, height: 24 }),
332
- redirectionLink: '/accounts/profile',
333
- },
334
- {
335
- text: 'My Trips',
336
- icon: jsx(MyTrips, { width: 24, height: 24 }),
337
- redirectionLink: '/accounts/trips',
338
- },
339
- {
340
- text: 'Saved Cards',
341
- icon: jsx(SavedCard, {}),
342
- redirectionLink: '/accounts/expressway',
343
- },
344
- {
345
- text: 'Saved Travellers',
346
- icon: jsx(Travellers, { width: 24, height: 24 }),
347
- redirectionLink: '/account/travellers',
348
- },
349
- {
350
- text: 'Hi-Five',
351
- icon: jsx(HiFive, {}),
352
- redirectionLink: '/accounts/hi-five?src=fh',
353
- },
354
- {
355
- text: 'Wallet',
356
- icon: jsx(Wallet, { width: 24, height: 24 }),
357
- redirectionLink: '/accounts/wallet',
358
- },
359
- {
360
- text: 'Settings',
361
- icon: jsx(SettingsCog, { width: 24, height: 24 }),
362
- redirectionLink: '/account/settings',
363
- },
364
- {
365
- text: 'Privacy Rights',
366
- icon: jsx(PrivacyRights, {}),
367
- redirectionLink: 'accounts/personal-data-dashboard',
368
- },
369
- ];
444
+ var ACCOUNT_OPTIONS_POPUP_CONFIG = [{
445
+ text: 'My Profile',
446
+ icon: jsx(MyAccount, {
447
+ width: 24,
448
+ height: 24
449
+ }),
450
+ redirectionLink: '/accounts/profile'
451
+ }, {
452
+ text: 'My Trips',
453
+ icon: jsx(MyTrips, {
454
+ width: 24,
455
+ height: 24
456
+ }),
457
+ redirectionLink: '/accounts/trips'
458
+ }, {
459
+ text: 'Saved Cards',
460
+ icon: jsx(SavedCard, {}),
461
+ redirectionLink: '/accounts/expressway'
462
+ }, {
463
+ text: 'Saved Travellers',
464
+ icon: jsx(Travellers, {
465
+ width: 24,
466
+ height: 24
467
+ }),
468
+ redirectionLink: '/account/travellers'
469
+ }, {
470
+ text: 'Hi-Five',
471
+ icon: jsx(HiFive, {}),
472
+ redirectionLink: '/accounts/hi-five?src=fh'
473
+ }, {
474
+ text: 'Wallet',
475
+ icon: jsx(Wallet, {
476
+ width: 24,
477
+ height: 24
478
+ }),
479
+ redirectionLink: '/accounts/wallet'
480
+ }, {
481
+ text: 'Settings',
482
+ icon: jsx(SettingsCog, {
483
+ width: 24,
484
+ height: 24
485
+ }),
486
+ redirectionLink: '/account/settings'
487
+ }, {
488
+ text: 'Privacy Rights',
489
+ icon: jsx(PrivacyRights, {}),
490
+ redirectionLink: 'accounts/personal-data-dashboard'
491
+ }];
370
492
  var SIGN_OUT_TEXT = 'Logout';
371
493
  var LOGGEDIN_USER_TEXT = 'You are logged in with';
372
494
  var HEADER_ACCOUNTS_OPTIONS_OPEN_BTN_ID = 'header-acc-btn';
@@ -374,174 +496,617 @@ var ACCOUNT_OPTIONS_CONTAINER_ID = 'account-options';
374
496
  var ACCOUNT_OPTIONS_CONTAINER_WIDTH = 328;
375
497
 
376
498
  var LoyaltyChip = function (_a) {
377
- var icon = _a.icon, borderGradient = _a.borderGradient, backgroundGradient = _a.backgroundGradient, handleChipClick = _a.handleChipClick;
378
- var _b = useState(false), isHovered = _b[0], setIsHovered = _b[1];
379
- return (jsxs(Container, __assign({ className: 'flex p-relative flex-middle flex-center br-8 o-hidden c-pointer', style: {
380
- height: 32,
381
- paddingLeft: 8,
382
- transition: 'padding-right 0.2s ease-in-out',
383
- paddingRight: isHovered ? 4 : 8,
384
- }, onMouseEnter: function () { return setIsHovered(true); }, onMouseLeave: function () { return setIsHovered(false); }, onClick: handleChipClick }, { children: [jsx(Container, { style: {
385
- content: '""',
386
- position: 'absolute',
387
- inset: 0,
388
- borderRadius: 'inherit',
389
- background: backgroundGradient,
390
- zIndex: -2,
391
- } }), jsx(Container, { style: {
392
- content: '""',
393
- position: 'absolute',
394
- inset: 0,
395
- borderRadius: 'inherit',
396
- padding: '1px',
397
- background: borderGradient,
398
- WebkitMask: 'linear-gradient(white, white) content-box, linear-gradient(white, white)',
399
- WebkitMaskComposite: 'destination-out',
400
- maskComposite: 'exclude',
401
- zIndex: -1,
402
- } }), jsx(Container, __assign({ className: 'flex flex-middle p-relative' }, { children: icon })), jsx(Container, __assign({ className: 'flex flex-middle o-hidden', style: {
403
- maxWidth: isHovered ? 16 : 0,
404
- transition: 'max-width 0.2s ease-in-out, opacity 0.2s ease-in-out',
405
- opacity: isHovered ? 0.5 : 0,
406
- } }, { children: jsx(HeaderChevronRight, { color: 'white' }) }))] })));
499
+ var icon = _a.icon,
500
+ borderGradient = _a.borderGradient,
501
+ backgroundGradient = _a.backgroundGradient,
502
+ handleChipClick = _a.handleChipClick;
503
+ var _b = useState(false),
504
+ isHovered = _b[0],
505
+ setIsHovered = _b[1];
506
+ var handleClick = function () {
507
+ window.location.href = '/';
508
+ handleChipClick && handleChipClick();
509
+ };
510
+ return jsxs(Container, __assign({
511
+ className: 'flex p-relative flex-middle flex-center br-8 o-hidden c-pointer',
512
+ style: {
513
+ height: 32,
514
+ paddingLeft: 8,
515
+ transition: 'padding-right 0.2s ease-in-out',
516
+ paddingRight: isHovered ? 4 : 8
517
+ },
518
+ onMouseEnter: function () {
519
+ return setIsHovered(true);
520
+ },
521
+ onMouseLeave: function () {
522
+ return setIsHovered(false);
523
+ },
524
+ onClick: handleClick
525
+ }, {
526
+ children: [jsx(Container, {
527
+ style: {
528
+ content: '""',
529
+ position: 'absolute',
530
+ inset: 0,
531
+ borderRadius: 'inherit',
532
+ background: backgroundGradient,
533
+ zIndex: -2
534
+ }
535
+ }), jsx(Container, {
536
+ style: {
537
+ content: '""',
538
+ position: 'absolute',
539
+ inset: 0,
540
+ borderRadius: 'inherit',
541
+ padding: '1px',
542
+ background: borderGradient,
543
+ WebkitMask: 'linear-gradient(white, white) content-box, linear-gradient(white, white)',
544
+ WebkitMaskComposite: 'destination-out',
545
+ maskComposite: 'exclude',
546
+ zIndex: -1
547
+ }
548
+ }), jsx(Container, __assign({
549
+ className: 'flex flex-middle p-relative'
550
+ }, {
551
+ children: icon
552
+ })), jsx(Container, __assign({
553
+ className: 'flex flex-middle o-hidden',
554
+ style: {
555
+ maxWidth: isHovered ? 16 : 0,
556
+ transition: 'max-width 0.2s ease-in-out, opacity 0.2s ease-in-out',
557
+ opacity: isHovered ? 0.5 : 0
558
+ }
559
+ }, {
560
+ children: jsx(HeaderChevronRight, {
561
+ color: 'white'
562
+ })
563
+ }))]
564
+ }));
407
565
  };
408
566
 
409
- var _a;
410
567
  var LoyaltyType;
411
568
  (function (LoyaltyType) {
412
- LoyaltyType["FkVip"] = "FkVip";
413
- LoyaltyType["FkPremium"] = "FkPremium";
414
- LoyaltyType["InsiderIcon"] = "InsiderIcon";
415
- LoyaltyType["InsiderElite"] = "InsiderElite";
569
+ LoyaltyType["FkVip"] = "FkVip";
570
+ LoyaltyType["FkPremium"] = "FkPremium";
571
+ LoyaltyType["InsiderIcon"] = "InsiderIcon";
572
+ LoyaltyType["InsiderElite"] = "InsiderElite";
416
573
  })(LoyaltyType || (LoyaltyType = {}));
417
- var LOYALTY_DATA = (_a = {},
418
- _a[LoyaltyType.FkVip] = {
419
- icon: jsx(FkVip, {}),
420
- borderGradient: 'linear-gradient(222.13deg, rgba(243, 179, 39, 0) 2.08%, #F3B327 85.17%)',
421
- backgroundGradient: 'linear-gradient(111deg, #360042 0%, #540061 100%)',
422
- },
423
- _a[LoyaltyType.FkPremium] = {
424
- icon: jsx(FkPremium, {}),
425
- borderGradient: 'linear-gradient(230.68deg, rgba(243, 179, 39, 0) 10.1%, #F3B327 45.74%)',
426
- backgroundGradient: 'linear-gradient(180deg, #04176A 0%, #082395 100%)',
574
+
575
+ var _a;
576
+ var LOYALTY_DATA = (_a = {}, _a[LoyaltyType.FkVip] = {
577
+ icon: jsx(FkVip, {}),
578
+ borderGradient: 'linear-gradient(222.13deg, rgba(243, 179, 39, 0) 2.08%, #F3B327 85.17%)',
579
+ backgroundGradient: 'linear-gradient(111deg, #360042 0%, #540061 100%)'
580
+ }, _a[LoyaltyType.FkPremium] = {
581
+ icon: jsx(FkPremium, {}),
582
+ borderGradient: 'linear-gradient(230.68deg, rgba(243, 179, 39, 0) 10.1%, #F3B327 45.74%)',
583
+ backgroundGradient: 'linear-gradient(180deg, #04176A 0%, #082395 100%)'
584
+ }, _a[LoyaltyType.InsiderIcon] = {
585
+ icon: jsx(InsiderIcon, {}),
586
+ borderGradient: 'linear-gradient(230.68deg, rgba(208, 175, 101, 0) 10.1%, #D0AF65 45.74%)',
587
+ backgroundGradient: 'linear-gradient(111deg, #2E3042 0%, #1A1C23 100%)'
588
+ }, _a[LoyaltyType.InsiderElite] = {
589
+ icon: jsx(InsiderElite, {}),
590
+ borderGradient: 'linear-gradient(230.68deg, rgba(208, 175, 101, 0) 10.1%, #D0AF65 45.74%)',
591
+ backgroundGradient: 'linear-gradient(111deg, #2E3042 0%, #1A1C23 100%)'
592
+ }, _a);
593
+
594
+ var ExpandableItem = function (_a) {
595
+ var icon = _a.icon,
596
+ handleChipClick = _a.handleChipClick,
597
+ value = _a.value,
598
+ type = _a.type;
599
+ var _b = useState(false),
600
+ isHovered = _b[0],
601
+ setIsHovered = _b[1];
602
+ var handleDefaultClick = function () {
603
+ if (type === 'supercoins') {
604
+ window.location.href = '/supercoins';
605
+ } else if (type === 'wallet') {
606
+ window.location.href = '/wallet';
607
+ }
608
+ handleChipClick && handleChipClick();
609
+ };
610
+ return jsxs(Container, __assign({
611
+ className: "flex flex-middle justify-center br-8 c-pointer",
612
+ style: {
613
+ height: 32,
614
+ paddingLeft: 8,
615
+ paddingRight: isHovered ? 4 : 8,
616
+ transition: 'padding-right 0.2s ease-in-out',
617
+ background: isHovered ? '#ffd7ca' : '#ffe6df'
427
618
  },
428
- _a[LoyaltyType.InsiderIcon] = {
429
- icon: jsx(InsiderIcon, {}),
430
- borderGradient: 'linear-gradient(230.68deg, rgba(208, 175, 101, 0) 10.1%, #D0AF65 45.74%)',
431
- backgroundGradient: 'linear-gradient(111deg, #2E3042 0%, #1A1C23 100%)',
619
+ onMouseEnter: function () {
620
+ return setIsHovered(true);
432
621
  },
433
- _a[LoyaltyType.InsiderElite] = {
434
- icon: jsx(InsiderElite, {}),
435
- borderGradient: 'linear-gradient(230.68deg, rgba(208, 175, 101, 0) 10.1%, #D0AF65 45.74%)',
436
- backgroundGradient: 'linear-gradient(111deg, #2E3042 0%, #1A1C23 100%)',
622
+ onMouseLeave: function () {
623
+ return setIsHovered(false);
437
624
  },
438
- _a);
439
-
440
- var ExpandableItem = function (_a) {
441
- var icon = _a.icon, handleChipClick = _a.handleChipClick, value = _a.value;
442
- var _b = useState(false), isHovered = _b[0], setIsHovered = _b[1];
443
- return (jsxs(Container, __assign({ className: "flex flex-middle justify-center br-8 c-pointer", style: {
444
- height: 32,
445
- paddingLeft: 8,
446
- paddingRight: isHovered ? 4 : 8,
447
- transition: 'padding-right 0.2s ease-in-out',
448
- background: isHovered ? '#ffd7ca' : '#ffe6df',
449
- }, onMouseEnter: function () { return setIsHovered(true); }, onMouseLeave: function () { return setIsHovered(false); }, onClick: handleChipClick }, { children: [jsxs(Container, __assign({ className: 'flex flex-middle flex-gap-1' }, { children: [icon, value && (jsx(Typography, __assign({ variant: 'B3', className: 'value-text', isClickable: true }, { children: value })))] })), jsx(Container, __assign({ className: 'flex flex-middle o-hidden', style: {
450
- maxWidth: isHovered ? 16 : 0,
451
- transition: 'max-width 0.2s ease-in-out, opacity 0.2s ease-in-out',
452
- opacity: isHovered ? 1 : 0,
453
- } }, { children: jsx(HeaderChevronRight, {}) }))] })));
625
+ onClick: handleDefaultClick
626
+ }, {
627
+ children: [jsxs(Container, __assign({
628
+ className: 'flex flex-middle flex-gap-1'
629
+ }, {
630
+ children: [icon, value && jsx(Typography, __assign({
631
+ variant: 'B3',
632
+ className: 'value-text',
633
+ isClickable: true
634
+ }, {
635
+ children: value
636
+ }))]
637
+ })), jsx(Container, __assign({
638
+ className: 'flex flex-middle o-hidden',
639
+ style: {
640
+ maxWidth: isHovered ? 16 : 0,
641
+ transition: 'max-width 0.2s ease-in-out, opacity 0.2s ease-in-out',
642
+ opacity: isHovered ? 1 : 0
643
+ }
644
+ }, {
645
+ children: jsx(HeaderChevronRight, {})
646
+ }))]
647
+ }));
454
648
  };
455
649
  var RewardsSection = function (props) {
456
- var selectedLoyaltyType = props.loyaltyType, _a = props.fkSupercoinBurnBalance, superCoinBalance = _a === void 0 ? 0 : _a, _b = props.walletBalance, walletBalance = _b === void 0 ? 0 : _b, loyaltyLoading = props.loyaltyLoading, superCoinsLoading = props.superCoinsLoading, walletLoading = props.walletLoading, walletChipClick = props.walletChipClick, supercoinsChipClick = props.supercoinsChipClick, loyaltyChipClick = props.loyaltyChipClick;
457
- return (jsxs(Container, __assign({ className: 'flex p-4 pt-0 flex-start flex-gap-1', style: { alignSelf: 'stretch' } }, { children: [loyaltyLoading ? (jsx(Shimmer, { width: '50px', height: '32px', borderRadius: '8px' })) : (selectedLoyaltyType &&
458
- LOYALTY_DATA[selectedLoyaltyType] && (jsx(LoyaltyChip, { icon: LOYALTY_DATA[selectedLoyaltyType].icon, borderGradient: LOYALTY_DATA[selectedLoyaltyType].borderGradient, backgroundGradient: LOYALTY_DATA[selectedLoyaltyType].backgroundGradient, handleChipClick: loyaltyChipClick }))), superCoinsLoading ? (jsx(Shimmer, { width: '50px', height: '32px', borderRadius: '8px' })) : (jsx(ExpandableItem, { icon: jsx(Supercoin, { width: 20, height: 20 }), value: superCoinBalance, handleChipClick: supercoinsChipClick })), walletLoading ? (jsx(Shimmer, { width: '50px', height: '32px', borderRadius: '8px' })) : (jsx(ExpandableItem, { icon: jsx(Wallet, { width: 20, height: 20 }), value: walletBalance, handleChipClick: walletChipClick }))] })));
650
+ var selectedLoyaltyType = props.loyaltyType,
651
+ _a = props.fkSupercoinBurnBalance,
652
+ superCoinBalance = _a === void 0 ? 0 : _a,
653
+ _b = props.walletBalance,
654
+ walletBalance = _b === void 0 ? 0 : _b,
655
+ loyaltyLoading = props.loyaltyLoading,
656
+ superCoinsLoading = props.superCoinsLoading,
657
+ walletLoading = props.walletLoading,
658
+ walletChipClick = props.walletChipClick,
659
+ supercoinsChipClick = props.supercoinsChipClick,
660
+ loyaltyChipClick = props.loyaltyChipClick;
661
+ return jsxs(Container, __assign({
662
+ className: 'flex p-4 pt-0 flex-start flex-gap-1',
663
+ style: {
664
+ alignSelf: 'stretch'
665
+ }
666
+ }, {
667
+ children: [loyaltyLoading ? jsx(Shimmer, {
668
+ width: '50px',
669
+ height: '32px',
670
+ borderRadius: '8px'
671
+ }) : selectedLoyaltyType && LOYALTY_DATA[selectedLoyaltyType] && jsx(LoyaltyChip, {
672
+ icon: LOYALTY_DATA[selectedLoyaltyType].icon,
673
+ borderGradient: LOYALTY_DATA[selectedLoyaltyType].borderGradient,
674
+ backgroundGradient: LOYALTY_DATA[selectedLoyaltyType].backgroundGradient,
675
+ handleChipClick: loyaltyChipClick
676
+ }), superCoinsLoading ? jsx(Shimmer, {
677
+ width: '50px',
678
+ height: '32px',
679
+ borderRadius: '8px'
680
+ }) : jsx(ExpandableItem, {
681
+ icon: jsx(Supercoin, {
682
+ width: 20,
683
+ height: 20
684
+ }),
685
+ value: superCoinBalance,
686
+ handleChipClick: supercoinsChipClick,
687
+ type: 'supercoins'
688
+ }), walletLoading ? jsx(Shimmer, {
689
+ width: '50px',
690
+ height: '32px',
691
+ borderRadius: '8px'
692
+ }) : jsx(ExpandableItem, {
693
+ icon: jsx(Wallet, {
694
+ width: 20,
695
+ height: 20
696
+ }),
697
+ value: walletBalance,
698
+ handleChipClick: walletChipClick,
699
+ type: 'wallet'
700
+ })]
701
+ }));
459
702
  };
460
703
 
704
+ var HoverableContainer = /*#__PURE__*/styled(Container).withConfig({
705
+ displayName: "StyledHeader__HoverableContainer",
706
+ componentId: "sc-aht4pl-0"
707
+ })(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n padding: 8px;\n border-radius: 8px;\n cursor: pointer;\n transition: background-color 0.2s ease-in-out;\n\n &:hover {\n background-color: #ecf3ff;\n color: green;\n }\n"], ["\n padding: 8px;\n border-radius: 8px;\n cursor: pointer;\n transition: background-color 0.2s ease-in-out;\n\n &:hover {\n background-color: #ecf3ff;\n color: green;\n }\n"])));
708
+ var LogoutButton = /*#__PURE__*/styled(Container).withConfig({
709
+ displayName: "StyledHeader__LogoutButton",
710
+ componentId: "sc-aht4pl-1"
711
+ })(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n padding: 8px;\n border-radius: 8px;\n cursor: pointer;\n display: flex;\n column-gap: 8px;\n transition: background-color 0.2s ease-in-out;\n\n &:hover {\n background-color: #fbefef;\n }\n"], ["\n padding: 8px;\n border-radius: 8px;\n cursor: pointer;\n display: flex;\n column-gap: 8px;\n transition: background-color 0.2s ease-in-out;\n\n &:hover {\n background-color: #fbefef;\n }\n"])));
712
+ var templateObject_1, templateObject_2;
713
+
461
714
  var AccountDropdownContent = function (props) {
462
- var _a = props || {}, handleLogout = _a.handleLogout, userName = _a.userName, userMobileNumber = _a.userMobileNumber, countryCode = _a.countryCode, userDetailsLoading = _a.userDetailsLoading, superCoinBalance = _a.fkSupercoinBurnBalance, walletBalance = _a.walletBalance, loyaltyType = _a.loyaltyType, loyaltyLoading = _a.loyaltyLoading, walletLoading = _a.walletLoading, superCoinsLoading = _a.superCoinsLoading, walletChipClick = _a.walletChipClick, supercoinsChipClick = _a.supercoinsChipClick, loyaltyChipClick = _a.loyaltyChipClick, isOpen = _a.isOpen;
463
- var containerRef = useDropdownAnimation(isOpen).containerRef;
464
- var _b = useMemo(function () {
465
- var userGreeting = userName && "Hello ".concat(userName, "!");
466
- var phoneNumber = countryCode && userMobileNumber ? "".concat(countryCode, " ").concat(userMobileNumber) : '';
467
- return { userGreeting: userGreeting, phoneNumber: phoneNumber };
468
- }, [userName, userMobileNumber, countryCode]), userGreeting = _b.userGreeting, phoneNumber = _b.phoneNumber;
469
- var handleRedirectClick = function (redirectLink) {
470
- return function () {
471
- window.location.href = redirectLink;
472
- };
715
+ var _a = props || {},
716
+ handleLogout = _a.handleLogout,
717
+ userName = _a.userName,
718
+ userMobileNumber = _a.userMobileNumber,
719
+ countryCode = _a.countryCode,
720
+ userDetailsLoading = _a.userDetailsLoading,
721
+ superCoinBalance = _a.fkSupercoinBurnBalance,
722
+ walletBalance = _a.walletBalance,
723
+ loyaltyType = _a.loyaltyType,
724
+ loyaltyLoading = _a.loyaltyLoading,
725
+ walletLoading = _a.walletLoading,
726
+ superCoinsLoading = _a.superCoinsLoading,
727
+ walletChipClick = _a.walletChipClick,
728
+ supercoinsChipClick = _a.supercoinsChipClick,
729
+ loyaltyChipClick = _a.loyaltyChipClick,
730
+ isOpen = _a.isOpen;
731
+ var containerRef = useDropdownAnimation(isOpen).containerRef;
732
+ var _b = useMemo(function () {
733
+ var userGreeting = userName && "Hello ".concat(userName, "!");
734
+ var phoneNumber = countryCode && userMobileNumber ? "".concat(countryCode, " ").concat(userMobileNumber) : '';
735
+ return {
736
+ userGreeting: userGreeting,
737
+ phoneNumber: phoneNumber
738
+ };
739
+ }, [userName, userMobileNumber, countryCode]),
740
+ userGreeting = _b.userGreeting,
741
+ phoneNumber = _b.phoneNumber;
742
+ var handleRedirectClick = function (redirectLink) {
743
+ return function () {
744
+ window.location.href = redirectLink;
473
745
  };
474
- useEffect(function () {
475
- var headerAccBtn = document.getElementById(HEADER_ACCOUNTS_OPTIONS_OPEN_BTN_ID);
476
- var accountOptionsElem = document.getElementById(ACCOUNT_OPTIONS_CONTAINER_ID);
477
- var positionAccountOptionsDiv = function () {
478
- var headerBtnRight = headerAccBtn === null || headerAccBtn === void 0 ? void 0 : headerAccBtn.getBoundingClientRect().right;
479
- if (accountOptionsElem && headerBtnRight) {
480
- accountOptionsElem.style.left = "".concat(headerBtnRight - ACCOUNT_OPTIONS_CONTAINER_WIDTH, "px");
481
- }
482
- };
483
- positionAccountOptionsDiv();
484
- }, []);
485
- var renderUserData = function () {
486
- var renderContent = function (loading, content, variant, color) { return (jsx(Typography, __assign({ variant: variant, color: color }, { children: loading ? (jsx(Shimmer, { height: variant === 'HM3' ? '18px' : '12px', width: variant === 'HM3' ? '140px' : '200px' })) : (content) }))); };
487
- return (jsx(Container, __assign({ className: 'flex flex-column flex-gap-1' }, { children: userGreeting ? (jsxs(Fragment, { children: [renderContent(userDetailsLoading, userGreeting, 'HM3', 'primary'), renderContent(userDetailsLoading, "".concat(LOGGEDIN_USER_TEXT, " ").concat(phoneNumber), 'P3', 'subheading')] })) : (jsxs(Fragment, { children: [renderContent(userDetailsLoading, LOGGEDIN_USER_TEXT, 'P3', 'subheading'), renderContent(userDetailsLoading, phoneNumber, 'HM3', 'primary')] })) })));
746
+ };
747
+ useEffect(function () {
748
+ var headerAccBtn = document.getElementById(HEADER_ACCOUNTS_OPTIONS_OPEN_BTN_ID);
749
+ var accountOptionsElem = document.getElementById(ACCOUNT_OPTIONS_CONTAINER_ID);
750
+ var positionAccountOptionsDiv = function () {
751
+ var headerBtnRight = headerAccBtn === null || headerAccBtn === void 0 ? void 0 : headerAccBtn.getBoundingClientRect().right;
752
+ if (accountOptionsElem && headerBtnRight) {
753
+ accountOptionsElem.style.left = "".concat(headerBtnRight - ACCOUNT_OPTIONS_CONTAINER_WIDTH, "px");
754
+ }
488
755
  };
489
- return (jsxs(Container, __assign({ id: ACCOUNT_OPTIONS_CONTAINER_ID, ref: containerRef, className: 'flex flex-column br-16 o-hidden', css: { zIndex: 1002, opacity: 0, top: '76px', position: 'fixed' }, width: "".concat(ACCOUNT_OPTIONS_CONTAINER_WIDTH, "px"), background: '#FFF1EC' }, { children: [jsx(Container, __assign({ className: 'p-4', height: '72px' }, { children: renderUserData() })), jsx(RewardsSection, { fkSupercoinBurnBalance: superCoinBalance, walletBalance: walletBalance, loyaltyType: loyaltyType, loyaltyLoading: loyaltyLoading, superCoinsLoading: superCoinsLoading, walletLoading: walletLoading, walletChipClick: walletChipClick, supercoinsChipClick: supercoinsChipClick, loyaltyChipClick: loyaltyChipClick }), jsxs(Container, __assign({ className: 'p-2 flex flex-column', backgroundColor: 'white', style: {
490
- borderBottomLeftRadius: 12,
491
- borderBottomRightRadius: 12,
492
- rowGap: 8,
493
- } }, { children: [ACCOUNT_OPTIONS_POPUP_CONFIG.map(function (_a) {
494
- var text = _a.text, icon = _a.icon, redirectionLink = _a.redirectionLink;
495
- return (jsx(Container, __assign({ className: "highlight-on-hover default p-2 br-8 c-pointer" }, { children: jsxs(Container, __assign({ className: 'flex c-pointer', css: { columnGap: '8px' }, onClick: handleRedirectClick(redirectionLink) }, { children: [icon, jsx(Typography, __assign({ variant: 'P1', className: 'flex flex-middle c-pointer' }, { children: text }))] }), "account-option-".concat(text)) }), "account-option-".concat(text)));
496
- }), jsx(Divider, { style: {
497
- borderBottom: '1px dashed #E6E6E6',
498
- } }), jsxs(Container, __assign({ className: "logout-button-hover default flex p-2 br-8 c-pointer", css: { columnGap: '8px' }, onClick: handleLogout }, { children: [jsx(Signout, { height: 24, width: 24 }), jsx(Typography, __assign({ variant: 'P1', className: 'flex flex-middle c-pointer', color: 'warning' }, { children: SIGN_OUT_TEXT }))] }))] }))] })));
756
+ positionAccountOptionsDiv();
757
+ }, []);
758
+ var renderUserData = function () {
759
+ var renderContent = function (loading, content, variant, color) {
760
+ return jsx(Typography, __assign({
761
+ variant: variant,
762
+ color: color
763
+ }, {
764
+ children: loading ? jsx(Shimmer, {
765
+ height: variant === 'HM3' ? '18px' : '12px',
766
+ width: variant === 'HM3' ? '140px' : '200px'
767
+ }) : content
768
+ }));
769
+ };
770
+ return jsx(Container, __assign({
771
+ className: 'flex flex-column flex-gap-1'
772
+ }, {
773
+ children: userGreeting ? jsxs(Fragment, {
774
+ children: [renderContent(userDetailsLoading, userGreeting, 'HM3', 'primary'), renderContent(userDetailsLoading, "".concat(LOGGEDIN_USER_TEXT, " ").concat(phoneNumber), 'P3', 'subheading')]
775
+ }) : jsxs(Fragment, {
776
+ children: [renderContent(userDetailsLoading, LOGGEDIN_USER_TEXT, 'P3', 'subheading'), renderContent(userDetailsLoading, phoneNumber, 'HM3', 'primary')]
777
+ })
778
+ }));
779
+ };
780
+ return jsxs(Container, __assign({
781
+ id: ACCOUNT_OPTIONS_CONTAINER_ID,
782
+ ref: containerRef,
783
+ className: 'flex flex-column br-16 o-hidden',
784
+ css: {
785
+ zIndex: 1002,
786
+ opacity: 0,
787
+ top: '76px',
788
+ position: 'fixed'
789
+ },
790
+ width: "".concat(ACCOUNT_OPTIONS_CONTAINER_WIDTH, "px"),
791
+ background: '#FFF1EC'
792
+ }, {
793
+ children: [jsx(Container, __assign({
794
+ className: 'p-4',
795
+ height: '72px'
796
+ }, {
797
+ children: renderUserData()
798
+ })), jsx(RewardsSection, {
799
+ fkSupercoinBurnBalance: superCoinBalance,
800
+ walletBalance: walletBalance,
801
+ loyaltyType: loyaltyType,
802
+ loyaltyLoading: loyaltyLoading,
803
+ superCoinsLoading: superCoinsLoading,
804
+ walletLoading: walletLoading,
805
+ walletChipClick: walletChipClick,
806
+ supercoinsChipClick: supercoinsChipClick,
807
+ loyaltyChipClick: loyaltyChipClick
808
+ }), jsxs(Container, __assign({
809
+ className: 'p-2 flex flex-column',
810
+ backgroundColor: 'white',
811
+ style: {
812
+ borderBottomLeftRadius: 12,
813
+ borderBottomRightRadius: 12,
814
+ rowGap: 8
815
+ }
816
+ }, {
817
+ children: [ACCOUNT_OPTIONS_POPUP_CONFIG.map(function (_a) {
818
+ var text = _a.text,
819
+ icon = _a.icon,
820
+ redirectionLink = _a.redirectionLink;
821
+ return jsx(HoverableContainer, __assign({
822
+ onClick: handleRedirectClick(redirectionLink)
823
+ }, {
824
+ children: jsxs(Container, __assign({
825
+ className: 'flex c-pointer',
826
+ style: {
827
+ columnGap: '8px'
828
+ }
829
+ }, {
830
+ children: [icon, jsx(Typography, __assign({
831
+ variant: 'P1',
832
+ className: 'flex flex-middle c-pointer'
833
+ }, {
834
+ children: text
835
+ }))]
836
+ }))
837
+ }), "account-option-".concat(text));
838
+ }), jsx(Divider, {
839
+ style: {
840
+ borderBottom: '1px dashed #E6E6E6'
841
+ }
842
+ }), jsxs(LogoutButton, __assign({
843
+ onClick: handleLogout
844
+ }, {
845
+ children: [jsx(Signout, {
846
+ height: 24,
847
+ width: 24
848
+ }), jsx(Typography, __assign({
849
+ variant: 'P1',
850
+ className: 'flex flex-middle c-pointer',
851
+ color: 'warning'
852
+ }, {
853
+ children: SIGN_OUT_TEXT
854
+ }))]
855
+ }))]
856
+ }))]
857
+ }));
499
858
  };
500
859
 
501
860
  var UserAccount = function (props) {
502
- var handleLogout = props.handleLogout, userDetailsLoading = props.userDetailsLoading, userName = props.userName, userMobileNumber = props.userMobileNumber, countryCode = props.countryCode, fkSupercoinBurnBalance = props.fkSupercoinBurnBalance, walletBalance = props.walletBalance, loyaltyType = props.loyaltyType, walletLoading = props.walletLoading, superCoinsLoading = props.superCoinsLoading, loyaltyLoading = props.loyaltyLoading, loyaltyChipClick = props.loyaltyChipClick, supercoinsChipClick = props.supercoinsChipClick, walletChipClick = props.walletChipClick;
503
- var _a = useHoverDropdown({ openDelay: 500, closeDelay: 50 }), isDropdownVisible = _a.isDropdownVisible, handleOnMouseEnter = _a.handleOnMouseEnter, handleOnMouseLeave = _a.handleOnMouseLeave, handleDropdownMouseEnter = _a.handleDropdownMouseEnter, handleDropdownMouseLeave = _a.handleDropdownMouseLeave;
504
- return (jsxs(Container, { children: [jsxs(Container, __assign({ className: "flex px-3 py-2 flex-middle br-12 h-100p c-pointer", style: { columnGap: 8 }, onMouseEnter: function () { return handleOnMouseEnter(4); }, onMouseLeave: handleOnMouseLeave, id: HEADER_ACCOUNTS_OPTIONS_OPEN_BTN_ID }, { children: [jsx(MyAccount, { color: isDropdownVisible ? '#FF4F17' : '#1A1A1A' }), jsxs(Container, __assign({ className: 'flex flex-row flex-middle' }, { children: [jsx(Typography, __assign({ variant: 'B2', className: 'c-pointer', color: isDropdownVisible ? 'secondary' : 'primary' }, { children: "My Account" })), jsx(ChevronDown, { width: 20, height: 20, fill: isDropdownVisible ? '#FF4F17' : '#1A1A1A' })] }))] })), jsx(HeaderAnimatedMask, __assign({ show: isDropdownVisible, marginTop: '64px', handleDropdownMouseEnter: handleDropdownMouseEnter, handleDropdownMouseLeave: handleDropdownMouseLeave, onMaskClick: handleDropdownMouseLeave }, { children: jsx(AccountDropdownContent, { handleLogout: handleLogout, userDetailsLoading: userDetailsLoading, userName: userName, userMobileNumber: userMobileNumber, countryCode: countryCode, loyaltyType: loyaltyType, walletBalance: walletBalance, fkSupercoinBurnBalance: fkSupercoinBurnBalance, walletLoading: walletLoading, superCoinsLoading: superCoinsLoading, loyaltyLoading: loyaltyLoading, loyaltyChipClick: loyaltyChipClick, walletChipClick: walletChipClick, supercoinsChipClick: supercoinsChipClick, isOpen: isDropdownVisible }) }))] }));
861
+ var handleLogout = props.handleLogout,
862
+ userDetailsLoading = props.userDetailsLoading,
863
+ userName = props.userName,
864
+ userMobileNumber = props.userMobileNumber,
865
+ countryCode = props.countryCode,
866
+ fkSupercoinBurnBalance = props.fkSupercoinBurnBalance,
867
+ walletBalance = props.walletBalance,
868
+ loyaltyType = props.loyaltyType,
869
+ walletLoading = props.walletLoading,
870
+ superCoinsLoading = props.superCoinsLoading,
871
+ loyaltyLoading = props.loyaltyLoading,
872
+ loyaltyChipClick = props.loyaltyChipClick,
873
+ supercoinsChipClick = props.supercoinsChipClick,
874
+ walletChipClick = props.walletChipClick;
875
+ var _a = useHoverDropdown({
876
+ openDelay: 500,
877
+ closeDelay: 50
878
+ }),
879
+ isDropdownVisible = _a.isDropdownVisible,
880
+ handleOnMouseEnter = _a.handleOnMouseEnter,
881
+ handleOnMouseLeave = _a.handleOnMouseLeave,
882
+ handleDropdownMouseEnter = _a.handleDropdownMouseEnter,
883
+ handleDropdownMouseLeave = _a.handleDropdownMouseLeave;
884
+ return jsxs(Container, {
885
+ children: [jsxs(Container, __assign({
886
+ className: "flex px-3 py-2 flex-middle br-12 h-100p c-pointer",
887
+ style: {
888
+ columnGap: 8,
889
+ height: 64
890
+ },
891
+ onMouseEnter: function () {
892
+ return handleOnMouseEnter(4);
893
+ },
894
+ onMouseLeave: handleOnMouseLeave,
895
+ id: HEADER_ACCOUNTS_OPTIONS_OPEN_BTN_ID
896
+ }, {
897
+ children: [jsx(MyAccount, {
898
+ color: isDropdownVisible ? '#FF4F17' : '#1A1A1A'
899
+ }), jsxs(Container, __assign({
900
+ className: 'flex flex-row flex-middle'
901
+ }, {
902
+ children: [jsx(Typography, __assign({
903
+ variant: 'B2',
904
+ className: 'c-pointer',
905
+ color: isDropdownVisible ? 'secondary' : 'primary'
906
+ }, {
907
+ children: "My Account"
908
+ })), jsx(ChevronDown, {
909
+ width: 20,
910
+ height: 20,
911
+ fill: isDropdownVisible ? '#FF4F17' : '#1A1A1A'
912
+ })]
913
+ }))]
914
+ })), jsx(HeaderAnimatedMask, __assign({
915
+ show: isDropdownVisible,
916
+ marginTop: '64px',
917
+ handleDropdownMouseEnter: handleDropdownMouseEnter,
918
+ handleDropdownMouseLeave: handleDropdownMouseLeave,
919
+ onMaskClick: handleDropdownMouseLeave
920
+ }, {
921
+ children: jsx(AccountDropdownContent, {
922
+ handleLogout: handleLogout,
923
+ userDetailsLoading: userDetailsLoading,
924
+ userName: userName,
925
+ userMobileNumber: userMobileNumber,
926
+ countryCode: countryCode,
927
+ loyaltyType: loyaltyType,
928
+ walletBalance: walletBalance,
929
+ fkSupercoinBurnBalance: fkSupercoinBurnBalance,
930
+ walletLoading: walletLoading,
931
+ superCoinsLoading: superCoinsLoading,
932
+ loyaltyLoading: loyaltyLoading,
933
+ loyaltyChipClick: loyaltyChipClick,
934
+ walletChipClick: walletChipClick,
935
+ supercoinsChipClick: supercoinsChipClick,
936
+ isOpen: isDropdownVisible
937
+ })
938
+ }))]
939
+ });
505
940
  };
506
941
 
507
942
  var Header = function (props) {
508
- var superCoinsLoading = props.superCoinsLoading, fkSupercoinBurnBalance = props.fkSupercoinBurnBalance, onLoginButtonClick = props.onLoginButtonClick, _a = props.showAllLobs, showAllLobs = _a === void 0 ? false : _a, selectedLOB = props.selectedLOB, isUserLoggedIn = props.isUserLoggedIn, handleLogoutClick = props.handleLogoutClick, walletBalance = props.walletBalance, walletLoading = props.walletLoading, loyaltyLoading = props.loyaltyLoading, loyaltyType = props.loyaltyType, userDetailsLoading = props.userDetailsLoading, userName = props.userName, userMobileNumber = props.userMobileNumber, countryCode = props.countryCode, loyaltyChipClick = props.loyaltyChipClick, supercoinsChipClick = props.supercoinsChipClick, walletChipClick = props.walletChipClick; props.ravenPayload; props.ravenPushCallback;
509
- var _c = useHoverDropdown({
510
- openDelay: 500,
511
- }), isDropdownVisible = _c.isDropdownVisible, hoveredElemIndex = _c.hoveredElemIndex, handleOnMouseEnter = _c.handleOnMouseEnter, handleOnMouseLeave = _c.handleOnMouseLeave, handleDropdownMouseEnter = _c.handleDropdownMouseEnter, handleDropdownMouseLeave = _c.handleDropdownMouseLeave;
512
- return (jsxs(Fragment, { children: [jsx(Container, __assign({ className: 'flex t-0 p-sticky w-100p flex-middle flex-center flex-gap-6 flex-no-shrink', style: {
513
- zIndex: 1000,
514
- height: 64,
515
- borderBottom: '1px solid #E6E6E6',
516
- background: '#F7FAFF',
517
- } }, { children: jsxs(Container, __assign({ className: 'flex flex-middle flex-between flex-gap-6', style: {
518
- maxWidth: 1440,
519
- padding: '0px 28px',
520
- flex: '1 0 0',
521
- } }, { children: [jsxs(Container, __assign({ className: 'flex flex-row flex-center flex-middle' }, { children: [jsx(CTLogo, {}), jsx(Divider, { style: {
522
- width: 12,
523
- marginLeft: 2,
524
- marginRight: 2,
525
- transform: 'rotate(90deg)',
526
- borderBottom: '1px solid #e0e0e0',
527
- } }), jsx(Fkcompany, {})] })), jsxs(Container, __assign({ className: 'flex flex-row flex-middle flex-center flex-cg-6' }, { children: [jsx(Container, __assign({ className: 'flex flex-row flex-middle flex-center flex-cg-1' }, { children: NAVBAR_OPTIONS.map(function (option, index) {
528
- var isHovered = hoveredElemIndex === index;
529
- return (jsxs(Container, { children: [jsxs(Container, __assign({ onMouseEnter: function () { return handleOnMouseEnter(index); }, onMouseLeave: handleOnMouseLeave, className: 'flex flex-row flex-middle px-3 py-2 c-pointer p-relative', style: { columnGap: 8, height: 64 }, onClick: function () {
530
- if (option.isClickable) {
531
- window.location.href = option.link;
532
- }
533
- } }, { children: [jsx(option.lefticon, { color: isHovered ? '#FF4F17' : '#1A1A1A' }), jsxs(Container, __assign({ className: 'flex flex-row flex-middle' }, { children: [jsx(Typography, __assign({ variant: 'B2', color: isHovered ? 'secondary' : 'primary', isClickable: true }, { children: option.text })), option.rightIcon && (jsx(option.rightIcon, { width: 20, height: 20, fill: isHovered ? '#FF4F17' : '#1A1A1A' }))] }))] }), "nav-option-".concat(index)), jsx(HeaderAnimatedMask, __assign({ show: hoveredElemIndex === index && option.isHoverable && isDropdownVisible, marginTop: '64px', handleDropdownMouseEnter: handleDropdownMouseEnter, handleDropdownMouseLeave: handleDropdownMouseLeave, onMaskClick: handleDropdownMouseLeave }, { children: jsx(BusinessDropdownContent, { isOpen: hoveredElemIndex === index && option.isHoverable && isDropdownVisible }) }))] }));
534
- }) })), isUserLoggedIn && (jsx(Divider, { style: {
535
- width: 12,
536
- margin: '0 -18px',
537
- transform: 'rotate(90deg)',
538
- borderBottom: '1px solid #e0e0e0',
539
- } })), jsx(Container, { children: isUserLoggedIn ? (jsx(Container, __assign({ className: 'flex flex-row flex-middle' }, { children: jsx(UserAccount, { handleLogout: handleLogoutClick, superCoinsLoading: superCoinsLoading, fkSupercoinBurnBalance: fkSupercoinBurnBalance, walletBalance: walletBalance, walletLoading: walletLoading, loyaltyLoading: loyaltyLoading, loyaltyType: loyaltyType, userDetailsLoading: userDetailsLoading, userName: userName, userMobileNumber: userMobileNumber, countryCode: countryCode, walletChipClick: walletChipClick, supercoinsChipClick: supercoinsChipClick, loyaltyChipClick: loyaltyChipClick }) }))) : (jsx(Button, __assign({ className: "fw-400 fs-14 login-button", onClick: onLoginButtonClick, style: {
540
- width: 153,
541
- height: 40,
542
- border: '1px solid #1A1A1A',
543
- }, loading: false }, { children: jsx(Typography, __assign({ componentNode: 'span', variant: 'L2' }, { children: "Login" })) }))) })] }))] })) })), showAllLobs && jsx(LobsHeader, { selectedLOB: selectedLOB })] }));
943
+ var superCoinsLoading = props.superCoinsLoading,
944
+ fkSupercoinBurnBalance = props.fkSupercoinBurnBalance,
945
+ onLoginButtonClick = props.onLoginButtonClick,
946
+ _a = props.showAllLobs,
947
+ showAllLobs = _a === void 0 ? false : _a,
948
+ selectedLOB = props.selectedLOB,
949
+ isUserLoggedIn = props.isUserLoggedIn,
950
+ handleLogoutClick = props.handleLogoutClick,
951
+ walletBalance = props.walletBalance,
952
+ walletLoading = props.walletLoading,
953
+ loyaltyLoading = props.loyaltyLoading,
954
+ loyaltyType = props.loyaltyType,
955
+ userDetailsLoading = props.userDetailsLoading,
956
+ userName = props.userName,
957
+ userMobileNumber = props.userMobileNumber,
958
+ countryCode = props.countryCode,
959
+ loyaltyChipClick = props.loyaltyChipClick,
960
+ supercoinsChipClick = props.supercoinsChipClick,
961
+ walletChipClick = props.walletChipClick;
962
+ props.ravenPayload;
963
+ props.ravenPushCallback;
964
+ var _c = useHoverDropdown({
965
+ openDelay: 500
966
+ }),
967
+ isDropdownVisible = _c.isDropdownVisible,
968
+ hoveredElemIndex = _c.hoveredElemIndex,
969
+ handleOnMouseEnter = _c.handleOnMouseEnter,
970
+ handleOnMouseLeave = _c.handleOnMouseLeave,
971
+ handleDropdownMouseEnter = _c.handleDropdownMouseEnter,
972
+ handleDropdownMouseLeave = _c.handleDropdownMouseLeave;
973
+ return jsxs(Fragment, {
974
+ children: [jsx(Container, __assign({
975
+ className: 'flex t-0 p-sticky w-100p flex-middle flex-center flex-gap-6 flex-no-shrink',
976
+ style: {
977
+ zIndex: 1000,
978
+ height: 64,
979
+ borderBottom: '1px solid #E6E6E6',
980
+ background: '#F7FAFF'
981
+ }
982
+ }, {
983
+ children: jsxs(Container, __assign({
984
+ className: 'flex flex-middle flex-between flex-gap-6',
985
+ style: {
986
+ maxWidth: 1440,
987
+ padding: '0px 28px',
988
+ flex: '1 0 0'
989
+ }
990
+ }, {
991
+ children: [jsxs(Container, __assign({
992
+ className: 'flex flex-row flex-center flex-middle'
993
+ }, {
994
+ children: [jsx(CTLogo, {}), jsx(Divider, {
995
+ style: {
996
+ width: 12,
997
+ marginLeft: 2,
998
+ marginRight: 2,
999
+ transform: 'rotate(90deg)',
1000
+ borderBottom: '1px solid #e0e0e0'
1001
+ }
1002
+ }), jsx(Fkcompany, {})]
1003
+ })), jsxs(Container, __assign({
1004
+ className: 'flex flex-row flex-middle flex-center flex-cg-6'
1005
+ }, {
1006
+ children: [jsx(Container, __assign({
1007
+ className: 'flex flex-row flex-middle flex-center flex-cg-1'
1008
+ }, {
1009
+ children: NAVBAR_OPTIONS.map(function (option, index) {
1010
+ var isHovered = hoveredElemIndex === index;
1011
+ return jsxs(Container, {
1012
+ children: [jsxs(Container, __assign({
1013
+ onMouseEnter: function () {
1014
+ return handleOnMouseEnter(index);
1015
+ },
1016
+ onMouseLeave: handleOnMouseLeave,
1017
+ className: 'flex flex-row flex-middle px-3 py-2 c-pointer p-relative',
1018
+ style: {
1019
+ columnGap: 8,
1020
+ height: 64
1021
+ },
1022
+ onClick: function () {
1023
+ if (option.isClickable) {
1024
+ window.location.href = option.link;
1025
+ }
1026
+ }
1027
+ }, {
1028
+ children: [jsx(option.lefticon, {
1029
+ color: isHovered ? '#FF4F17' : '#1A1A1A'
1030
+ }), jsxs(Container, __assign({
1031
+ className: 'flex flex-row flex-middle'
1032
+ }, {
1033
+ children: [jsx(Typography, __assign({
1034
+ variant: 'B2',
1035
+ color: isHovered ? 'secondary' : 'primary',
1036
+ isClickable: true
1037
+ }, {
1038
+ children: option.text
1039
+ })), option.rightIcon && jsx(option.rightIcon, {
1040
+ width: 20,
1041
+ height: 20,
1042
+ fill: isHovered ? '#FF4F17' : '#1A1A1A'
1043
+ })]
1044
+ }))]
1045
+ }), "nav-option-".concat(index)), jsx(HeaderAnimatedMask, __assign({
1046
+ show: hoveredElemIndex === index && option.isHoverable && isDropdownVisible,
1047
+ marginTop: '64px',
1048
+ handleDropdownMouseEnter: handleDropdownMouseEnter,
1049
+ handleDropdownMouseLeave: handleDropdownMouseLeave,
1050
+ onMaskClick: handleDropdownMouseLeave
1051
+ }, {
1052
+ children: jsx(BusinessDropdownContent, {
1053
+ isOpen: hoveredElemIndex === index && option.isHoverable && isDropdownVisible
1054
+ })
1055
+ }))]
1056
+ });
1057
+ })
1058
+ })), isUserLoggedIn && jsx(Divider, {
1059
+ style: {
1060
+ width: 12,
1061
+ margin: '0 -18px',
1062
+ transform: 'rotate(90deg)',
1063
+ borderBottom: '1px solid #e0e0e0'
1064
+ }
1065
+ }), jsx(Container, {
1066
+ children: isUserLoggedIn ? jsx(Container, __assign({
1067
+ className: 'flex flex-row flex-middle'
1068
+ }, {
1069
+ children: jsx(UserAccount, {
1070
+ handleLogout: handleLogoutClick,
1071
+ superCoinsLoading: superCoinsLoading,
1072
+ fkSupercoinBurnBalance: fkSupercoinBurnBalance,
1073
+ walletBalance: walletBalance,
1074
+ walletLoading: walletLoading,
1075
+ loyaltyLoading: loyaltyLoading,
1076
+ loyaltyType: loyaltyType,
1077
+ userDetailsLoading: userDetailsLoading,
1078
+ userName: userName,
1079
+ userMobileNumber: userMobileNumber,
1080
+ countryCode: countryCode,
1081
+ walletChipClick: walletChipClick,
1082
+ supercoinsChipClick: supercoinsChipClick,
1083
+ loyaltyChipClick: loyaltyChipClick
1084
+ })
1085
+ })) : jsx(Button, __assign({
1086
+ className: "fw-400 fs-14 login-button",
1087
+ onClick: onLoginButtonClick,
1088
+ style: {
1089
+ width: 153,
1090
+ height: 40,
1091
+ border: '1px solid #1A1A1A'
1092
+ },
1093
+ loading: false
1094
+ }, {
1095
+ children: jsx(Typography, __assign({
1096
+ componentNode: 'span',
1097
+ variant: 'L2'
1098
+ }, {
1099
+ children: "Login"
1100
+ }))
1101
+ }))
1102
+ })]
1103
+ }))]
1104
+ }))
1105
+ })), showAllLobs && jsx(LobsHeader, {
1106
+ selectedLOB: selectedLOB
1107
+ })]
1108
+ });
544
1109
  };
545
1110
 
546
- export { Header };
1111
+ export { Header, LoyaltyType };
547
1112
  //# sourceMappingURL=ct-design-header.esm.js.map