@cleartrip/ct-design-header 1.2.0-SNAPSHOT-remove-hover-delay-test.0 → 1.2.0-SNAPSHOT-final-header-test.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/dist/BusinessDropdown/index.d.ts.map +1 -1
  2. package/dist/Header.d.ts.map +1 -1
  3. package/dist/LobsHeader/index.d.ts +1 -2
  4. package/dist/LobsHeader/index.d.ts.map +1 -1
  5. package/dist/RewardsSection/LoyaltyChips.d.ts +1 -1
  6. package/dist/RewardsSection/LoyaltyChips.d.ts.map +1 -1
  7. package/dist/RewardsSection/index.d.ts +1 -2
  8. package/dist/RewardsSection/index.d.ts.map +1 -1
  9. package/dist/UserAccount/UserAccountDropdown.d.ts.map +1 -1
  10. package/dist/UserAccount/accountOptions.d.ts +1 -0
  11. package/dist/UserAccount/accountOptions.d.ts.map +1 -1
  12. package/dist/UserAccount/index.d.ts +1 -2
  13. package/dist/UserAccount/index.d.ts.map +1 -1
  14. package/dist/constants.d.ts +21 -24
  15. package/dist/constants.d.ts.map +1 -1
  16. package/dist/context/HeaderProvider.d.ts +8 -0
  17. package/dist/context/HeaderProvider.d.ts.map +1 -0
  18. package/dist/ct-design-header.browser.cjs.js +1 -1
  19. package/dist/ct-design-header.browser.cjs.js.map +1 -1
  20. package/dist/ct-design-header.browser.esm.js +1 -1
  21. package/dist/ct-design-header.browser.esm.js.map +1 -1
  22. package/dist/ct-design-header.cjs.js +402 -231
  23. package/dist/ct-design-header.cjs.js.map +1 -1
  24. package/dist/ct-design-header.esm.js +404 -233
  25. package/dist/ct-design-header.esm.js.map +1 -1
  26. package/dist/ct-design-header.umd.js +414 -234
  27. package/dist/ct-design-header.umd.js.map +1 -1
  28. package/dist/index.d.ts +1 -0
  29. package/dist/index.d.ts.map +1 -1
  30. package/dist/type.d.ts +4 -6
  31. package/dist/type.d.ts.map +1 -1
  32. package/dist/utils.d.ts +15 -0
  33. package/dist/utils.d.ts.map +1 -0
  34. package/package.json +9 -8
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react/jsx-runtime'), require('@cleartrip/ct-design-container'), require('@cleartrip/ct-design-typography'), require('@cleartrip/ct-design-button'), require('@cleartrip/ct-design-divider'), require('@cleartrip/ct-design-icons'), require('react'), require('@cleartrip/ct-design-shimmer')) :
3
- typeof define === 'function' && define.amd ? define(['exports', 'react/jsx-runtime', '@cleartrip/ct-design-container', '@cleartrip/ct-design-typography', '@cleartrip/ct-design-button', '@cleartrip/ct-design-divider', '@cleartrip/ct-design-icons', 'react', '@cleartrip/ct-design-shimmer'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.CTDesignSystemHeader = {}, global.jsxRuntime, global.ctDesignContainer, global.ctDesignTypography, global.ctDesignButton, global.ctDesignDivider, global.ctDesignIcons, global.React, global.ctDesignShimmer));
5
- })(this, (function (exports, jsxRuntime, ctDesignContainer, ctDesignTypography, ctDesignButton, ctDesignDivider, ctDesignIcons, react, ctDesignShimmer) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react/jsx-runtime'), require('react'), require('@cleartrip/ct-design-container'), require('@cleartrip/ct-design-typography'), require('@cleartrip/ct-design-button'), require('@cleartrip/ct-design-divider'), require('@cleartrip/ct-design-icons'), require('@cleartrip/ct-design-shimmer')) :
3
+ typeof define === 'function' && define.amd ? define(['exports', 'react/jsx-runtime', 'react', '@cleartrip/ct-design-container', '@cleartrip/ct-design-typography', '@cleartrip/ct-design-button', '@cleartrip/ct-design-divider', '@cleartrip/ct-design-icons', '@cleartrip/ct-design-shimmer'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.CTDesignSystemHeader = {}, global.jsxRuntime, global.React, global.ctDesignContainer, global.ctDesignTypography, global.ctDesignButton, global.ctDesignDivider, global.ctDesignIcons, global.ctDesignShimmer));
5
+ })(this, (function (exports, jsxRuntime, react, ctDesignContainer, ctDesignTypography, ctDesignButton, ctDesignDivider, ctDesignIcons, ctDesignShimmer) { 'use strict';
6
6
 
7
7
  /******************************************************************************
8
8
  Copyright (c) Microsoft Corporation.
@@ -30,6 +30,15 @@
30
30
  };
31
31
  return __assign.apply(this, arguments);
32
32
  };
33
+ function __spreadArray(to, from, pack) {
34
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
35
+ if (ar || !(i in from)) {
36
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
37
+ ar[i] = from[i];
38
+ }
39
+ }
40
+ return to.concat(ar || Array.prototype.slice.call(from));
41
+ }
33
42
  typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
34
43
  var e = new Error(message);
35
44
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
@@ -41,23 +50,27 @@
41
50
  var NAVBAR_OPTIONS = [{
42
51
  lefticon: ctDesignIcons.Offers,
43
52
  text: 'Offers',
53
+ ravenActionName: 'offers',
44
54
  isHoverable: false,
45
55
  isClickable: true,
46
56
  link: OFFERS_URL
47
57
  }, {
48
58
  lefticon: ctDesignIcons.BusinessBag,
49
59
  text: 'Business',
60
+ ravenActionName: 'business',
50
61
  rightIcon: ctDesignIcons.ChevronDown,
51
62
  isHoverable: true
52
63
  }, {
53
64
  lefticon: ctDesignIcons.MyTrips,
54
65
  text: 'My Trips',
66
+ ravenActionName: 'mytrips',
55
67
  isHoverable: false,
56
68
  isClickable: true,
57
69
  link: MY_TRIPS_URL
58
70
  }, {
59
71
  lefticon: ctDesignIcons.SupportIcon,
60
72
  text: 'Support',
73
+ ravenActionName: 'support',
61
74
  isHoverable: false,
62
75
  isClickable: true,
63
76
  link: SUPPORT_URL
@@ -93,24 +106,57 @@
93
106
  var bdConfig = [{
94
107
  title: 'AgentBox',
95
108
  subtitle: 'For travel agents',
96
- details: 'One-stop travel solution offering the best deals to our travel agency partners'
109
+ details: 'One-stop travel solution offering the best deals to our travel agency partners',
110
+ link: 'https://agency.cleartrip.com'
97
111
  }, {
98
112
  title: 'OutOfOffice',
99
113
  subtitle: 'For startups, corporates and SMEs',
100
- details: 'Manage corporate business travel, smartly'
114
+ details: 'Manage corporate business travel, smartly',
115
+ link: 'https://ooo.cleartrip.com/',
116
+ ravenActionName: 'ooo'
101
117
  }, {
102
118
  title: 'MICE',
103
119
  subtitle: 'For corporate events',
104
- details: 'An end-to-end management solution for all your corporate events'
120
+ details: 'An end-to-end management solution for all your corporate events',
121
+ link: '/mice'
105
122
  }, {
106
123
  title: 'API',
107
124
  subtitle: 'For developers',
108
- details: 'Unlock seamless integration and scale with our powerful, reliable APIs'
125
+ details: 'Unlock seamless integration and scale with our powerful, reliable APIs',
126
+ link: '/api'
109
127
  }];
110
128
  var BUSINESS_DROPDOWN_HEADING = 'Other business services';
129
+ exports.RAVEN_PAGE_NAMES = void 0;
130
+ (function (RAVEN_PAGE_NAMES) {
131
+ RAVEN_PAGE_NAMES["UNIFIED_HOME"] = "unified_homepage";
132
+ RAVEN_PAGE_NAMES["HOTELS_HOME"] = "hotels_homepage";
133
+ RAVEN_PAGE_NAMES["FLIGHTS_HOME"] = "flights_homepage";
134
+ })(exports.RAVEN_PAGE_NAMES || (exports.RAVEN_PAGE_NAMES = {}));
135
+ var RAVEN_PLATFORMS;
136
+ (function (RAVEN_PLATFORMS) {
137
+ RAVEN_PLATFORMS["DESKTOP"] = "desktop";
138
+ })(RAVEN_PLATFORMS || (RAVEN_PLATFORMS = {}));
139
+
140
+ var HeaderContext = react.createContext(undefined);
141
+ var useHeaderContext = function () {
142
+ var context = react.useContext(HeaderContext);
143
+ if (!context) {
144
+ throw new Error('useHeaderContext must be used within a HeaderProvider');
145
+ }
146
+ return context;
147
+ };
148
+ var HeaderProvider = function (_a) {
149
+ var value = _a.value,
150
+ children = _a.children;
151
+ return jsxRuntime.jsx(HeaderContext.Provider, __assign({
152
+ value: value
153
+ }, {
154
+ children: children
155
+ }));
156
+ };
111
157
 
112
- var LobsHeader = function (_a) {
113
- var selectedLOB = _a.selectedLOB;
158
+ var LobsHeader = function () {
159
+ var selectedLOB = useHeaderContext().selectedLOB;
114
160
  return jsxRuntime.jsx(ctDesignContainer.Container, __assign({
115
161
  className: 'flex p-4 flex-middle flex-center p-sticky',
116
162
  css: {
@@ -347,18 +393,83 @@
347
393
  };
348
394
  };
349
395
 
396
+ var stringifyPayload = function (payload) {
397
+ var keys = Object.keys(payload);
398
+ var numericValues = [];
399
+ keys.forEach(function (key) {
400
+ if (numericValues.includes(key)) {
401
+ payload[key] = Number(payload[key]);
402
+ } else {
403
+ payload[key] = '' + payload[key];
404
+ }
405
+ });
406
+ return payload;
407
+ };
408
+ var isServer = function () {
409
+ return typeof window === 'undefined' || !window;
410
+ };
411
+ var getQueryParam = function (queryParam) {
412
+ if (isServer()) {
413
+ return '';
414
+ }
415
+ var urlParams = new URLSearchParams(window.location.search);
416
+ return urlParams.get(queryParam);
417
+ };
418
+ var ravenLoyaltyTypes = function (loyaltyType) {
419
+ switch (loyaltyType) {
420
+ case 'FkVip':
421
+ return 'fk_vip';
422
+ case 'FkPremium':
423
+ return 'fk_plus_premium';
424
+ case 'InsiderIcon':
425
+ return 'myntra_insidericon';
426
+ case 'InsiderElite':
427
+ return 'myntra_insiderelite';
428
+ default:
429
+ return '';
430
+ }
431
+ };
432
+ var ravenSDKTrigger = function (isUserLoggedIn, eventName, ravenPayload, customRavenPayload, ravenPushCallback, pageName) {
433
+ var _a;
434
+ var commonPayload = {
435
+ page_name: pageName,
436
+ platform: RAVEN_PLATFORMS.DESKTOP,
437
+ login_status: isUserLoggedIn ? 'yes' : 'no',
438
+ domain: (_a = window === null || window === void 0 ? void 0 : window.location) === null || _a === void 0 ? void 0 : _a.host
439
+ };
440
+ var newRavenPayload = stringifyPayload(ravenPayload);
441
+ var parsedCustomRavenPayload = stringifyPayload(customRavenPayload);
442
+ try {
443
+ ravenPushCallback(eventName, __assign(__assign(__assign({}, commonPayload), newRavenPayload), parsedCustomRavenPayload));
444
+ } catch (err) {
445
+ console.log(err);
446
+ return;
447
+ }
448
+ };
449
+
350
450
  var BusinessDropdownContent = function (_a) {
351
451
  var isOpen = _a.isOpen;
352
- var _b = react.useState(0),
353
- leftPosition = _b[0],
354
- setLeftPosition = _b[1];
452
+ var _b = useHeaderContext(),
453
+ isUserLoggedIn = _b.isUserLoggedIn,
454
+ ravenPushCallback = _b.ravenPushCallback,
455
+ ravenPageName = _b.ravenPageName,
456
+ ravenEventName = _b.ravenEventName,
457
+ loyaltyType = _b.loyaltyType,
458
+ _c = _b.ravenPayload,
459
+ ravenPayload = _c === void 0 ? {} : _c;
460
+ var _d = react.useState(0),
461
+ leftPosition = _d[0],
462
+ setLeftPosition = _d[1];
355
463
  var containerRef = useDropdownAnimation(isOpen).containerRef;
356
464
  react.useEffect(function () {
357
465
  var updatePosition = function () {
358
466
  if (containerRef.current) {
359
467
  var screenWidth = window.innerWidth;
360
468
  var containerWidth = containerRef.current.offsetWidth || 0;
361
- setLeftPosition((screenWidth - containerWidth) / 2);
469
+ var newLeft = (screenWidth - containerWidth) / 2;
470
+ if (newLeft !== leftPosition) {
471
+ setLeftPosition(newLeft);
472
+ }
362
473
  }
363
474
  };
364
475
  updatePosition();
@@ -366,7 +477,22 @@
366
477
  return function () {
367
478
  return window.removeEventListener('resize', updatePosition);
368
479
  };
369
- }, []);
480
+ }, [containerRef, leftPosition]);
481
+ var handleBusinessDropdownClick = react.useCallback(function (link, title, ravenActionName) {
482
+ var _a;
483
+ var utmSource = (_a = getQueryParam('utm_source')) !== null && _a !== void 0 ? _a : 'organic';
484
+ var actionName = ravenActionName ? "".concat(ravenActionName, "_business_click") : title ? "".concat(title.toLowerCase(), "_business_click") : '';
485
+ var defaultPayload = {
486
+ action_name: actionName,
487
+ action_type: 'click',
488
+ u_utm_source: utmSource,
489
+ loyalty_type: ravenLoyaltyTypes(loyaltyType)
490
+ };
491
+ if (link) {
492
+ ravenSDKTrigger(isUserLoggedIn, ravenEventName, defaultPayload, ravenPayload, ravenPushCallback, ravenPageName);
493
+ window.location.href = link;
494
+ }
495
+ }, [isUserLoggedIn, ravenEventName, ravenPayload, ravenPushCallback, ravenPageName, loyaltyType]);
370
496
  return jsxRuntime.jsxs(ctDesignContainer.Container, __assign({
371
497
  ref: containerRef,
372
498
  className: 'bg-neutral-100 o-hidden',
@@ -403,11 +529,16 @@
403
529
  children: bdConfig.map(function (_a) {
404
530
  var title = _a.title,
405
531
  subtitle = _a.subtitle,
406
- details = _a.details;
532
+ details = _a.details,
533
+ link = _a.link,
534
+ ravenActionName = _a.ravenActionName;
407
535
  return jsxRuntime.jsxs(ctDesignContainer.Container, __assign({
408
536
  css: {
409
537
  width: '200px'
410
538
  },
539
+ onClick: function () {
540
+ return handleBusinessDropdownClick(link, title, ravenActionName);
541
+ },
411
542
  className: 'bd-hover-container c-pointer'
412
543
  }, {
413
544
  children: [jsxRuntime.jsxs(ctDesignContainer.Container, __assign({
@@ -443,22 +574,16 @@
443
574
  }));
444
575
  };
445
576
  var AnimatedArrow = function () {
446
- return jsxRuntime.jsxs(ctDesignContainer.Container, __assign({
577
+ return jsxRuntime.jsx(ctDesignContainer.Container, __assign({
447
578
  className: 'bd-arrow-container'
448
579
  }, {
449
- children: [jsxRuntime.jsx(ctDesignContainer.Container, __assign({
450
- className: 'bd-arrow-wrapper'
451
- }, {
452
- children: jsxRuntime.jsx(ctDesignIcons.ArrowRight, {})
453
- })), jsxRuntime.jsx(ctDesignContainer.Container, __assign({
454
- className: 'bd-arrow-wrapper'
455
- }, {
456
- children: jsxRuntime.jsx(ctDesignIcons.ArrowRight, {})
457
- })), jsxRuntime.jsx(ctDesignContainer.Container, __assign({
458
- className: 'bd-arrow-wrapper'
459
- }, {
460
- children: jsxRuntime.jsx(ctDesignIcons.ArrowRight, {})
461
- }))]
580
+ children: __spreadArray([], Array(3), true).map(function (_, index) {
581
+ return jsxRuntime.jsx(ctDesignContainer.Container, __assign({
582
+ className: 'bd-arrow-wrapper'
583
+ }, {
584
+ children: jsxRuntime.jsx(ctDesignIcons.ArrowRight, {})
585
+ }), index);
586
+ })
462
587
  }));
463
588
  };
464
589
 
@@ -511,6 +636,7 @@
511
636
  redirectionLink: 'accounts/personal-data-dashboard'
512
637
  }];
513
638
  var SIGN_OUT_TEXT = 'Logout';
639
+ var MY_ACCOUNT_TEXT = 'My Account';
514
640
  var LOGGEDIN_USER_TEXT = 'You are logged in with';
515
641
  var HEADER_ACCOUNTS_OPTIONS_OPEN_BTN_ID = 'header-acc-btn';
516
642
  var ACCOUNT_OPTIONS_CONTAINER_ID = 'account-options';
@@ -521,13 +647,33 @@
521
647
  borderGradient = _a.borderGradient,
522
648
  backgroundGradient = _a.backgroundGradient,
523
649
  handleChipClick = _a.handleChipClick;
524
- var _b = react.useState(false),
525
- isHovered = _b[0],
526
- setIsHovered = _b[1];
527
- var handleClick = function () {
528
- window.location.href = '/';
529
- handleChipClick && handleChipClick();
530
- };
650
+ var _b = useHeaderContext(),
651
+ loyaltyType = _b.loyaltyType,
652
+ isUserLoggedIn = _b.isUserLoggedIn,
653
+ ravenPushCallback = _b.ravenPushCallback,
654
+ ravenPageName = _b.ravenPageName,
655
+ _c = _b.ravenPayload,
656
+ ravenPayload = _c === void 0 ? {} : _c,
657
+ ravenEventName = _b.ravenEventName;
658
+ var _d = react.useState(false),
659
+ isHovered = _d[0],
660
+ setIsHovered = _d[1];
661
+ var handleClick = react.useCallback(function () {
662
+ var _a;
663
+ if (handleChipClick) {
664
+ handleChipClick();
665
+ } else {
666
+ var utmSource = (_a = getQueryParam('utm_source')) !== null && _a !== void 0 ? _a : 'organic';
667
+ var defaultPayload = {
668
+ action_name: "loyalty_account_click",
669
+ action_type: 'click',
670
+ u_utm_source: utmSource,
671
+ loyaltyType: ravenLoyaltyTypes(loyaltyType)
672
+ };
673
+ ravenSDKTrigger(isUserLoggedIn, ravenEventName, defaultPayload, ravenPayload, ravenPushCallback, ravenPageName);
674
+ window.location.href = '/all-offers/loyalty-october';
675
+ }
676
+ }, [handleChipClick, loyaltyType, isUserLoggedIn, ravenEventName, ravenPayload, ravenPushCallback, ravenPageName]);
531
677
  return jsxRuntime.jsxs(ctDesignContainer.Container, __assign({
532
678
  className: 'flex p-relative flex-middle flex-center br-8 o-hidden c-pointer',
533
679
  style: {
@@ -626,17 +772,39 @@
626
772
  handleChipClick = _a.handleChipClick,
627
773
  value = _a.value,
628
774
  type = _a.type;
629
- var _b = react.useState(false),
630
- isHovered = _b[0],
631
- setIsHovered = _b[1];
632
- var handleDefaultClick = function () {
633
- if (type === 'supercoins') {
634
- window.location.href = '/supercoins';
635
- } else if (type === 'wallet') {
636
- window.location.href = '/wallet';
775
+ var _b = useHeaderContext(),
776
+ loyaltyType = _b.loyaltyType,
777
+ isUserLoggedIn = _b.isUserLoggedIn,
778
+ ravenPushCallback = _b.ravenPushCallback,
779
+ ravenPageName = _b.ravenPageName,
780
+ ravenEventName = _b.ravenEventName,
781
+ _c = _b.ravenPayload,
782
+ ravenPayload = _c === void 0 ? {} : _c;
783
+ var _d = react.useState(false),
784
+ isHovered = _d[0],
785
+ setIsHovered = _d[1];
786
+ var handleDefaultClick = react.useCallback(function () {
787
+ var _a;
788
+ if (handleChipClick) {
789
+ handleChipClick();
790
+ } else {
791
+ var utmSource = (_a = getQueryParam('utm_source')) !== null && _a !== void 0 ? _a : 'organic';
792
+ var defaultPayload = {
793
+ action_name: "".concat(type, "_account_click"),
794
+ action_type: 'click',
795
+ u_utm_source: utmSource,
796
+ loyaltyType: ravenLoyaltyTypes(loyaltyType)
797
+ };
798
+ ravenSDKTrigger(isUserLoggedIn, ravenEventName, defaultPayload, ravenPayload, ravenPushCallback, ravenPageName);
799
+ var redirectUrls = {
800
+ supercoin: '/all-offers/supercoins/',
801
+ wallet: '/accounts/wallet'
802
+ };
803
+ if (redirectUrls[type]) {
804
+ window.location.href = redirectUrls[type];
805
+ }
637
806
  }
638
- handleChipClick && handleChipClick();
639
- };
807
+ }, [handleChipClick, type, loyaltyType, isUserLoggedIn, ravenEventName, ravenPayload, ravenPushCallback, ravenPageName]);
640
808
  return jsxRuntime.jsxs(ctDesignContainer.Container, __assign({
641
809
  className: "flex flex-middle justify-center br-8 c-pointer",
642
810
  style: {
@@ -676,21 +844,22 @@
676
844
  }))]
677
845
  }));
678
846
  };
679
- var RewardsSection = function (props) {
680
- var selectedLoyaltyType = props.loyaltyType,
681
- _a = props.fkSupercoinBurnBalance,
682
- superCoinBalance = _a === void 0 ? 0 : _a,
683
- _b = props.walletBalance,
684
- walletBalance = _b === void 0 ? 0 : _b,
685
- loyaltyLoading = props.loyaltyLoading,
686
- superCoinsLoading = props.superCoinsLoading,
687
- walletLoading = props.walletLoading,
688
- walletChipClick = props.walletChipClick,
689
- supercoinsChipClick = props.supercoinsChipClick,
690
- loyaltyChipClick = props.loyaltyChipClick,
691
- hideWalletChip = props.hideWalletChip,
692
- hideSupercoinsChip = props.hideSupercoinsChip,
693
- hideLoyaltyChip = props.hideLoyaltyChip;
847
+ var RewardsSection = function () {
848
+ var _a = useHeaderContext(),
849
+ selectedLoyaltyType = _a.loyaltyType,
850
+ _b = _a.fkSupercoinBurnBalance,
851
+ superCoinBalance = _b === void 0 ? 0 : _b,
852
+ _c = _a.walletBalance,
853
+ walletBalance = _c === void 0 ? 0 : _c,
854
+ loyaltyLoading = _a.loyaltyLoading,
855
+ superCoinsLoading = _a.superCoinsLoading,
856
+ walletLoading = _a.walletLoading,
857
+ walletChipClick = _a.walletChipClick,
858
+ supercoinsChipClick = _a.supercoinsChipClick,
859
+ loyaltyChipClick = _a.loyaltyChipClick,
860
+ hideWalletChip = _a.hideWalletChip,
861
+ hideSupercoinsChip = _a.hideSupercoinsChip,
862
+ hideLoyaltyChip = _a.hideLoyaltyChip;
694
863
  return jsxRuntime.jsxs(ctDesignContainer.Container, __assign({
695
864
  className: 'flex p-4 pt-0 flex-start flex-gap-1',
696
865
  style: {
@@ -717,7 +886,7 @@
717
886
  }),
718
887
  value: superCoinBalance,
719
888
  handleChipClick: supercoinsChipClick,
720
- type: 'supercoins'
889
+ type: 'supercoin'
721
890
  }), walletLoading ? jsxRuntime.jsx(ctDesignShimmer.Shimmer, {
722
891
  width: '50px',
723
892
  height: '32px',
@@ -734,53 +903,58 @@
734
903
  }));
735
904
  };
736
905
 
737
- var AccountDropdownContent = function (props) {
738
- var _a = props || {},
739
- handleLogout = _a.handleLogout,
740
- userName = _a.userName,
741
- userMobileNumber = _a.userMobileNumber,
742
- countryCode = _a.countryCode,
743
- userDetailsLoading = _a.userDetailsLoading,
744
- superCoinBalance = _a.fkSupercoinBurnBalance,
745
- walletBalance = _a.walletBalance,
746
- loyaltyType = _a.loyaltyType,
747
- loyaltyLoading = _a.loyaltyLoading,
748
- walletLoading = _a.walletLoading,
749
- superCoinsLoading = _a.superCoinsLoading,
750
- walletChipClick = _a.walletChipClick,
751
- supercoinsChipClick = _a.supercoinsChipClick,
752
- loyaltyChipClick = _a.loyaltyChipClick,
753
- hideLoyaltyChip = _a.hideLoyaltyChip,
754
- hideSupercoinsChip = _a.hideSupercoinsChip,
755
- hideWalletChip = _a.hideWalletChip,
756
- isOpen = _a.isOpen;
906
+ var AccountDropdownContent = function (_a) {
907
+ var isOpen = _a.isOpen;
908
+ var _b = useHeaderContext(),
909
+ handleLogoutClick = _b.handleLogoutClick,
910
+ userName = _b.userName,
911
+ userMobileNumber = _b.userMobileNumber,
912
+ countryCode = _b.countryCode,
913
+ userDetailsLoading = _b.userDetailsLoading,
914
+ loyaltyType = _b.loyaltyType,
915
+ isUserLoggedIn = _b.isUserLoggedIn,
916
+ ravenEventName = _b.ravenEventName,
917
+ ravenPageName = _b.ravenPageName,
918
+ _c = _b.ravenPayload,
919
+ ravenPayload = _c === void 0 ? {} : _c,
920
+ ravenPushCallback = _b.ravenPushCallback;
757
921
  var containerRef = useDropdownAnimation(isOpen).containerRef;
758
- var _b = react.useMemo(function () {
759
- var userGreeting = userName && "Hello ".concat(userName, "!");
760
- var phoneNumber = countryCode && userMobileNumber ? "".concat(countryCode, " ").concat(userMobileNumber) : '';
922
+ var _d = react.useMemo(function () {
761
923
  return {
762
- userGreeting: userGreeting,
763
- phoneNumber: phoneNumber
924
+ userGreeting: userName ? "Hello ".concat(userName, "!") : '',
925
+ phoneNumber: countryCode && userMobileNumber ? "".concat(countryCode, " ").concat(userMobileNumber) : ''
764
926
  };
765
927
  }, [userName, userMobileNumber, countryCode]),
766
- userGreeting = _b.userGreeting,
767
- phoneNumber = _b.phoneNumber;
768
- var handleRedirectClick = function (redirectLink) {
769
- return function () {
770
- window.location.href = redirectLink;
928
+ userGreeting = _d.userGreeting,
929
+ phoneNumber = _d.phoneNumber;
930
+ var generateRavenPayload = function (actionName) {
931
+ var _a;
932
+ return {
933
+ action_name: actionName.toLowerCase().replace(/[\s-]/g, '') + '_account_click',
934
+ action_type: 'click',
935
+ u_utm_source: (_a = getQueryParam('utm_source')) !== null && _a !== void 0 ? _a : 'organic',
936
+ loyalty_type: ravenLoyaltyTypes(loyaltyType)
771
937
  };
772
938
  };
773
- react.useEffect(function () {
939
+ var handleAccountOptionsClick = react.useCallback(function (text, redirectLink) {
940
+ ravenSDKTrigger(isUserLoggedIn, ravenEventName, generateRavenPayload(text), ravenPayload, ravenPushCallback, ravenPageName);
941
+ window.location.href = redirectLink;
942
+ }, [isUserLoggedIn, ravenEventName, ravenPayload, ravenPushCallback, ravenPageName]);
943
+ var handleLogout = react.useCallback(function () {
944
+ ravenSDKTrigger(isUserLoggedIn, ravenEventName, generateRavenPayload(SIGN_OUT_TEXT), ravenPayload, ravenPushCallback, ravenPageName);
945
+ handleLogoutClick();
946
+ }, [isUserLoggedIn, ravenEventName, ravenPayload, ravenPushCallback, ravenPageName, handleLogoutClick]);
947
+ var positionAccountOptionsDiv = react.useCallback(function () {
774
948
  var headerAccBtn = document.getElementById(HEADER_ACCOUNTS_OPTIONS_OPEN_BTN_ID);
775
949
  var accountOptionsElem = document.getElementById(ACCOUNT_OPTIONS_CONTAINER_ID);
776
- var positionAccountOptionsDiv = function () {
777
- var headerBtnRight = headerAccBtn === null || headerAccBtn === void 0 ? void 0 : headerAccBtn.getBoundingClientRect().right;
778
- if (accountOptionsElem && headerBtnRight) {
779
- accountOptionsElem.style.left = "".concat(headerBtnRight - ACCOUNT_OPTIONS_CONTAINER_WIDTH, "px");
780
- }
781
- };
782
- positionAccountOptionsDiv();
950
+ if (headerAccBtn && accountOptionsElem) {
951
+ var headerBtnRight = headerAccBtn.getBoundingClientRect().right;
952
+ accountOptionsElem.style.left = "".concat(headerBtnRight - ACCOUNT_OPTIONS_CONTAINER_WIDTH, "px");
953
+ }
783
954
  }, []);
955
+ react.useEffect(function () {
956
+ positionAccountOptionsDiv();
957
+ }, [positionAccountOptionsDiv]);
784
958
  var renderUserData = function () {
785
959
  var renderContent = function (loading, content, variant, color) {
786
960
  return jsxRuntime.jsx(ctDesignTypography.Typography, __assign({
@@ -821,20 +995,7 @@
821
995
  height: '72px'
822
996
  }, {
823
997
  children: renderUserData()
824
- })), jsxRuntime.jsx(RewardsSection, {
825
- fkSupercoinBurnBalance: superCoinBalance,
826
- walletBalance: walletBalance,
827
- loyaltyType: loyaltyType,
828
- loyaltyLoading: loyaltyLoading,
829
- superCoinsLoading: superCoinsLoading,
830
- walletLoading: walletLoading,
831
- walletChipClick: walletChipClick,
832
- supercoinsChipClick: supercoinsChipClick,
833
- loyaltyChipClick: loyaltyChipClick,
834
- hideLoyaltyChip: hideLoyaltyChip,
835
- hideSupercoinsChip: hideSupercoinsChip,
836
- hideWalletChip: hideWalletChip
837
- }), jsxRuntime.jsxs(ctDesignContainer.Container, __assign({
998
+ })), jsxRuntime.jsx(RewardsSection, {}), jsxRuntime.jsxs(ctDesignContainer.Container, __assign({
838
999
  className: 'p-2 flex flex-column',
839
1000
  backgroundColor: 'white',
840
1001
  style: {
@@ -849,7 +1010,9 @@
849
1010
  redirectionLink = _a.redirectionLink;
850
1011
  return jsxRuntime.jsx(ctDesignContainer.Container, __assign({
851
1012
  className: 'p-2 br-8 c-pointer hoverable-container',
852
- onClick: handleRedirectClick(redirectionLink)
1013
+ onClick: function () {
1014
+ return handleAccountOptionsClick(text, redirectionLink);
1015
+ }
853
1016
  }, {
854
1017
  children: jsxRuntime.jsxs(ctDesignContainer.Container, __assign({
855
1018
  className: 'flex c-pointer',
@@ -888,33 +1051,48 @@
888
1051
  }));
889
1052
  };
890
1053
 
891
- var UserAccount = function (props) {
892
- var handleLogout = props.handleLogout,
893
- userDetailsLoading = props.userDetailsLoading,
894
- userName = props.userName,
895
- userMobileNumber = props.userMobileNumber,
896
- countryCode = props.countryCode,
897
- fkSupercoinBurnBalance = props.fkSupercoinBurnBalance,
898
- walletBalance = props.walletBalance,
899
- loyaltyType = props.loyaltyType,
900
- walletLoading = props.walletLoading,
901
- superCoinsLoading = props.superCoinsLoading,
902
- loyaltyLoading = props.loyaltyLoading,
903
- loyaltyChipClick = props.loyaltyChipClick,
904
- supercoinsChipClick = props.supercoinsChipClick,
905
- walletChipClick = props.walletChipClick,
906
- hideLoyaltyChip = props.hideLoyaltyChip,
907
- hideSupercoinsChip = props.hideSupercoinsChip,
908
- hideWalletChip = props.hideWalletChip,
909
- isNovacThemeEnabled = props.isNovacThemeEnabled;
910
- var _a = useHoverDropdown({
1054
+ var UserAccount = function () {
1055
+ var _a = useHeaderContext(),
1056
+ isNovacThemeEnabled = _a.isNovacThemeEnabled,
1057
+ ravenEventName = _a.ravenEventName,
1058
+ _b = _a.ravenPayload,
1059
+ ravenPayload = _b === void 0 ? {} : _b,
1060
+ ravenPushCallback = _a.ravenPushCallback,
1061
+ isUserLoggedIn = _a.isUserLoggedIn,
1062
+ loyaltyType = _a.loyaltyType,
1063
+ ravenPageName = _a.ravenPageName;
1064
+ var _c = useHoverDropdown({
911
1065
  openDelay: 0
912
1066
  }),
913
- isDropdownVisible = _a.isDropdownVisible,
914
- handleOnMouseEnter = _a.handleOnMouseEnter,
915
- handleOnMouseLeave = _a.handleOnMouseLeave,
916
- handleDropdownMouseEnter = _a.handleDropdownMouseEnter,
917
- handleDropdownMouseLeave = _a.handleDropdownMouseLeave;
1067
+ isDropdownVisible = _c.isDropdownVisible,
1068
+ handleOnMouseEnter = _c.handleOnMouseEnter,
1069
+ handleOnMouseLeave = _c.handleOnMouseLeave,
1070
+ handleDropdownMouseEnter = _c.handleDropdownMouseEnter,
1071
+ handleDropdownMouseLeave = _c.handleDropdownMouseLeave;
1072
+ var _d = react.useState(false),
1073
+ scrolled = _d[0],
1074
+ setScrolled = _d[1];
1075
+ react.useEffect(function () {
1076
+ var handleScroll = function () {
1077
+ setScrolled(window.scrollY >= 100);
1078
+ };
1079
+ window.addEventListener('scroll', handleScroll);
1080
+ return function () {
1081
+ return window.removeEventListener('scroll', handleScroll);
1082
+ };
1083
+ }, []);
1084
+ var effectiveNovacThemeEnabled = isNovacThemeEnabled && !scrolled;
1085
+ var triggerRavenEventOnHover = react.useCallback(function () {
1086
+ var _a;
1087
+ var utmSource = (_a = getQueryParam('utm_source')) !== null && _a !== void 0 ? _a : 'organic';
1088
+ var defaultPayload = {
1089
+ action_name: "".concat(MY_ACCOUNT_TEXT.toLowerCase().replace(/[\s-]/g, ''), "_header_hover"),
1090
+ action_type: 'hover',
1091
+ u_utm_source: utmSource,
1092
+ loyalty_type: ravenLoyaltyTypes(loyaltyType)
1093
+ };
1094
+ ravenSDKTrigger(isUserLoggedIn, ravenEventName, defaultPayload, ravenPayload, ravenPushCallback, ravenPageName);
1095
+ }, [isUserLoggedIn, ravenEventName, ravenPayload, ravenPushCallback, ravenPageName, loyaltyType]);
918
1096
  return jsxRuntime.jsxs(ctDesignContainer.Container, {
919
1097
  children: [jsxRuntime.jsxs(ctDesignContainer.Container, __assign({
920
1098
  className: "flex px-3 py-2 flex-middle br-12 h-100p c-pointer",
@@ -923,26 +1101,27 @@
923
1101
  height: 64
924
1102
  },
925
1103
  onMouseEnter: function () {
926
- return handleOnMouseEnter(0);
1104
+ handleOnMouseEnter(0);
1105
+ triggerRavenEventOnHover();
927
1106
  },
928
1107
  onMouseLeave: handleOnMouseLeave,
929
1108
  id: HEADER_ACCOUNTS_OPTIONS_OPEN_BTN_ID
930
1109
  }, {
931
1110
  children: [jsxRuntime.jsx(ctDesignIcons.MyAccount, {
932
- color: isDropdownVisible ? '#FF4F17' : isNovacThemeEnabled ? '#FFF' : '#1A1A1A'
1111
+ color: isDropdownVisible ? '#FF4F17' : effectiveNovacThemeEnabled ? '#FFF' : '#1A1A1A'
933
1112
  }), jsxRuntime.jsxs(ctDesignContainer.Container, __assign({
934
1113
  className: 'flex flex-row flex-middle'
935
1114
  }, {
936
1115
  children: [jsxRuntime.jsx(ctDesignTypography.Typography, __assign({
937
1116
  variant: 'B2',
938
1117
  className: 'c-pointer',
939
- color: isDropdownVisible ? 'secondary' : isNovacThemeEnabled ? 'neutral' : 'primary'
1118
+ color: isDropdownVisible ? 'secondary' : effectiveNovacThemeEnabled ? 'neutral' : 'primary'
940
1119
  }, {
941
- children: "My Account"
1120
+ children: MY_ACCOUNT_TEXT
942
1121
  })), jsxRuntime.jsx(ctDesignIcons.ChevronDown, {
943
1122
  width: 20,
944
1123
  height: 20,
945
- fill: isDropdownVisible ? '#FF4F17' : isNovacThemeEnabled ? '#FFF' : '#1A1A1A'
1124
+ fill: isDropdownVisible ? '#FF4F17' : effectiveNovacThemeEnabled ? '#FFF' : '#1A1A1A'
946
1125
  })]
947
1126
  }))]
948
1127
  })), jsxRuntime.jsx(HeaderAnimatedMask, __assign({
@@ -953,23 +1132,6 @@
953
1132
  onMaskClick: handleDropdownMouseLeave
954
1133
  }, {
955
1134
  children: jsxRuntime.jsx(AccountDropdownContent, {
956
- handleLogout: handleLogout,
957
- userDetailsLoading: userDetailsLoading,
958
- userName: userName,
959
- userMobileNumber: userMobileNumber,
960
- countryCode: countryCode,
961
- loyaltyType: loyaltyType,
962
- walletBalance: walletBalance,
963
- fkSupercoinBurnBalance: fkSupercoinBurnBalance,
964
- walletLoading: walletLoading,
965
- superCoinsLoading: superCoinsLoading,
966
- loyaltyLoading: loyaltyLoading,
967
- loyaltyChipClick: loyaltyChipClick,
968
- walletChipClick: walletChipClick,
969
- supercoinsChipClick: supercoinsChipClick,
970
- hideLoyaltyChip: hideLoyaltyChip,
971
- hideSupercoinsChip: hideSupercoinsChip,
972
- hideWalletChip: hideWalletChip,
973
1135
  isOpen: isDropdownVisible
974
1136
  })
975
1137
  }))]
@@ -977,49 +1139,86 @@
977
1139
  };
978
1140
 
979
1141
  var Header = function (props) {
980
- var superCoinsLoading = props.superCoinsLoading,
981
- fkSupercoinBurnBalance = props.fkSupercoinBurnBalance,
982
- onLoginButtonClick = props.onLoginButtonClick,
983
- _a = props.showAllLobs,
984
- showAllLobs = _a === void 0 ? false : _a,
985
- selectedLOB = props.selectedLOB,
986
- isUserLoggedIn = props.isUserLoggedIn,
987
- handleLogoutClick = props.handleLogoutClick,
988
- walletBalance = props.walletBalance,
989
- walletLoading = props.walletLoading,
990
- loyaltyLoading = props.loyaltyLoading,
991
- loyaltyType = props.loyaltyType,
992
- userDetailsLoading = props.userDetailsLoading,
993
- userName = props.userName,
994
- userMobileNumber = props.userMobileNumber,
995
- countryCode = props.countryCode,
996
- loyaltyChipClick = props.loyaltyChipClick,
997
- supercoinsChipClick = props.supercoinsChipClick,
998
- walletChipClick = props.walletChipClick,
999
- hideLoyaltyChip = props.hideLoyaltyChip,
1000
- hideSupercoinsChip = props.hideSupercoinsChip,
1001
- hideWalletChip = props.hideWalletChip;
1002
- props.ravenPayload;
1003
- props.ravenPushCallback;
1004
- var _c = props.isNovacThemeEnabled,
1005
- isNovacThemeEnabled = _c === void 0 ? false : _c;
1006
- var _d = useHoverDropdown({
1142
+ return jsxRuntime.jsx(HeaderProvider, __assign({
1143
+ value: props
1144
+ }, {
1145
+ children: jsxRuntime.jsx(HeaderContent, {})
1146
+ }));
1147
+ };
1148
+ var HeaderContent = function () {
1149
+ var _a;
1150
+ var _b = useHeaderContext(),
1151
+ onLoginButtonClick = _b.onLoginButtonClick,
1152
+ _c = _b.showAllLobs,
1153
+ showAllLobs = _c === void 0 ? false : _c,
1154
+ isUserLoggedIn = _b.isUserLoggedIn,
1155
+ loyaltyType = _b.loyaltyType,
1156
+ _d = _b.isNovacThemeEnabled,
1157
+ isNovacThemeEnabled = _d === void 0 ? false : _d,
1158
+ _e = _b.ravenPayload,
1159
+ ravenPayload = _e === void 0 ? {} : _e,
1160
+ ravenPushCallback = _b.ravenPushCallback,
1161
+ ravenPageName = _b.ravenPageName,
1162
+ ravenEventName = _b.ravenEventName;
1163
+ var _f = react.useState(false),
1164
+ scrolled = _f[0],
1165
+ setScrolled = _f[1];
1166
+ react.useEffect(function () {
1167
+ var handleScroll = function () {
1168
+ setScrolled(window.scrollY >= 100);
1169
+ };
1170
+ window.addEventListener('scroll', handleScroll);
1171
+ return function () {
1172
+ return window.removeEventListener('scroll', handleScroll);
1173
+ };
1174
+ }, []);
1175
+ var effectiveNovacThemeEnabled = isNovacThemeEnabled && !scrolled;
1176
+ var headerBackground = effectiveNovacThemeEnabled ? 'transparent' : '#F7FAFF';
1177
+ var _g = useHoverDropdown({
1007
1178
  openDelay: 0
1008
1179
  }),
1009
- isDropdownVisible = _d.isDropdownVisible,
1010
- hoveredElemIndex = _d.hoveredElemIndex,
1011
- handleOnMouseEnter = _d.handleOnMouseEnter,
1012
- handleOnMouseLeave = _d.handleOnMouseLeave,
1013
- handleDropdownMouseEnter = _d.handleDropdownMouseEnter,
1014
- handleDropdownMouseLeave = _d.handleDropdownMouseLeave;
1180
+ isDropdownVisible = _g.isDropdownVisible,
1181
+ hoveredElemIndex = _g.hoveredElemIndex,
1182
+ handleOnMouseEnter = _g.handleOnMouseEnter,
1183
+ handleOnMouseLeave = _g.handleOnMouseLeave,
1184
+ handleDropdownMouseEnter = _g.handleDropdownMouseEnter,
1185
+ handleDropdownMouseLeave = _g.handleDropdownMouseLeave;
1186
+ var utmSource = (_a = getQueryParam('utm_source')) !== null && _a !== void 0 ? _a : 'organic';
1187
+ var createPayload = react.useCallback(function (actionName, actionType) {
1188
+ return {
1189
+ action_name: actionName,
1190
+ action_type: actionType,
1191
+ u_utm_source: utmSource,
1192
+ loyalty_type: ravenLoyaltyTypes(loyaltyType)
1193
+ };
1194
+ }, [utmSource, loyaltyType]);
1195
+ var handleNavbarOptionsClick = react.useCallback(function (option) {
1196
+ if (option.isClickable && option.link) {
1197
+ var actionName = "".concat(option.text.toLowerCase().replace(/\s/g, ''), "_header_click");
1198
+ var payload = createPayload(actionName, 'click');
1199
+ ravenSDKTrigger(isUserLoggedIn, ravenEventName, payload, ravenPayload, ravenPushCallback, ravenPageName);
1200
+ window.location.href = option.link;
1201
+ }
1202
+ }, [createPayload, isUserLoggedIn, ravenEventName, ravenPayload, ravenPushCallback, ravenPageName]);
1203
+ var handleHomeClick = react.useCallback(function () {
1204
+ var payload = createPayload('home_header_click', 'click');
1205
+ ravenSDKTrigger(isUserLoggedIn, ravenEventName, payload, ravenPayload, ravenPushCallback, ravenPageName);
1206
+ window.location.href = '/';
1207
+ }, [createPayload, isUserLoggedIn, ravenEventName, ravenPayload, ravenPushCallback, ravenPageName]);
1208
+ var triggerRavenEventOnHover = react.useCallback(function (option) {
1209
+ var actionName = "".concat(option.text.toLowerCase().replace(/\s/g, ''), "_header_hover");
1210
+ var payload = createPayload(actionName, 'hover');
1211
+ ravenSDKTrigger(isUserLoggedIn, ravenEventName, payload, ravenPayload, ravenPushCallback, ravenPageName);
1212
+ }, [createPayload, isUserLoggedIn, ravenEventName, ravenPayload, ravenPushCallback, ravenPageName]);
1015
1213
  return jsxRuntime.jsxs(jsxRuntime.Fragment, {
1016
1214
  children: [jsxRuntime.jsx(ctDesignContainer.Container, __assign({
1017
1215
  className: 'flex t-0 p-sticky w-100p flex-middle flex-center flex-gap-6 flex-no-shrink',
1018
1216
  style: {
1019
1217
  zIndex: 1000,
1020
1218
  height: 64,
1021
- borderBottom: isNovacThemeEnabled ? '' : '1px solid #E6E6E6',
1022
- background: isNovacThemeEnabled ? '' : '#F7FAFF'
1219
+ borderBottom: effectiveNovacThemeEnabled ? '' : '1px solid #E6E6E6',
1220
+ background: headerBackground,
1221
+ transition: 'background-color 0.3s ease-in-out, border-bottom 0.3s ease-in-out'
1023
1222
  }
1024
1223
  }, {
1025
1224
  children: jsxRuntime.jsxs(ctDesignContainer.Container, __assign({
@@ -1031,10 +1230,11 @@
1031
1230
  }
1032
1231
  }, {
1033
1232
  children: [jsxRuntime.jsxs(ctDesignContainer.Container, __assign({
1034
- className: 'flex flex-row flex-center flex-middle'
1233
+ className: 'flex flex-row flex-center flex-middle c-pointer',
1234
+ onClick: handleHomeClick
1035
1235
  }, {
1036
1236
  children: [jsxRuntime.jsx(ctDesignIcons.CTLogo, {
1037
- fillColor: isNovacThemeEnabled ? '#FFF' : '#FF4F17'
1237
+ fillColor: effectiveNovacThemeEnabled ? '#FFF' : '#FF4F17'
1038
1238
  }), jsxRuntime.jsx(ctDesignDivider.Divider, {
1039
1239
  style: {
1040
1240
  width: 12,
@@ -1044,7 +1244,7 @@
1044
1244
  borderBottom: '1px solid #e0e0e0'
1045
1245
  }
1046
1246
  }), jsxRuntime.jsx(ctDesignIcons.Fkcompany, {
1047
- color: isNovacThemeEnabled ? '#FFF' : '#1A1A1A'
1247
+ color: effectiveNovacThemeEnabled ? '#FFF' : '#1A1A1A'
1048
1248
  })]
1049
1249
  })), jsxRuntime.jsxs(ctDesignContainer.Container, __assign({
1050
1250
  className: 'flex flex-row flex-middle flex-center flex-cg-6'
@@ -1057,7 +1257,10 @@
1057
1257
  return jsxRuntime.jsxs(ctDesignContainer.Container, {
1058
1258
  children: [jsxRuntime.jsxs(ctDesignContainer.Container, __assign({
1059
1259
  onMouseEnter: function () {
1060
- return handleOnMouseEnter(index);
1260
+ handleOnMouseEnter(index);
1261
+ if (option.isHoverable) {
1262
+ triggerRavenEventOnHover(option);
1263
+ }
1061
1264
  },
1062
1265
  onMouseLeave: handleOnMouseLeave,
1063
1266
  className: 'flex flex-row flex-middle px-3 py-2 c-pointer p-relative',
@@ -1066,26 +1269,24 @@
1066
1269
  height: 64
1067
1270
  },
1068
1271
  onClick: function () {
1069
- if (option.isClickable) {
1070
- window.location.href = option.link;
1071
- }
1272
+ return handleNavbarOptionsClick(option);
1072
1273
  }
1073
1274
  }, {
1074
1275
  children: [jsxRuntime.jsx(option.lefticon, {
1075
- color: isHovered ? '#FF4F17' : isNovacThemeEnabled ? '#FFF' : '#1A1A1A'
1276
+ color: isHovered ? '#FF4F17' : effectiveNovacThemeEnabled ? '#FFF' : '#1A1A1A'
1076
1277
  }), jsxRuntime.jsxs(ctDesignContainer.Container, __assign({
1077
1278
  className: 'flex flex-row flex-middle'
1078
1279
  }, {
1079
1280
  children: [jsxRuntime.jsx(ctDesignTypography.Typography, __assign({
1080
1281
  variant: 'B2',
1081
- color: isHovered ? 'secondary' : isNovacThemeEnabled ? 'neutral' : 'primary',
1282
+ color: isHovered ? 'secondary' : effectiveNovacThemeEnabled ? 'neutral' : 'primary',
1082
1283
  isClickable: true
1083
1284
  }, {
1084
1285
  children: option.text
1085
1286
  })), option.rightIcon && jsxRuntime.jsx(option.rightIcon, {
1086
1287
  width: 20,
1087
1288
  height: 20,
1088
- fill: isHovered ? '#FF4F17' : isNovacThemeEnabled ? '#FFF' : '#1A1A1A'
1289
+ fill: isHovered ? '#FF4F17' : effectiveNovacThemeEnabled ? '#FFF' : '#1A1A1A'
1089
1290
  })]
1090
1291
  }))]
1091
1292
  }), "nav-option-".concat(index)), jsxRuntime.jsx(HeaderAnimatedMask, __assign({
@@ -1112,40 +1313,21 @@
1112
1313
  children: isUserLoggedIn ? jsxRuntime.jsx(ctDesignContainer.Container, __assign({
1113
1314
  className: 'flex flex-row flex-middle'
1114
1315
  }, {
1115
- children: jsxRuntime.jsx(UserAccount, {
1116
- handleLogout: handleLogoutClick,
1117
- superCoinsLoading: superCoinsLoading,
1118
- fkSupercoinBurnBalance: fkSupercoinBurnBalance,
1119
- walletBalance: walletBalance,
1120
- walletLoading: walletLoading,
1121
- loyaltyLoading: loyaltyLoading,
1122
- loyaltyType: loyaltyType,
1123
- userDetailsLoading: userDetailsLoading,
1124
- userName: userName,
1125
- userMobileNumber: userMobileNumber,
1126
- countryCode: countryCode,
1127
- walletChipClick: walletChipClick,
1128
- supercoinsChipClick: supercoinsChipClick,
1129
- loyaltyChipClick: loyaltyChipClick,
1130
- hideLoyaltyChip: hideLoyaltyChip,
1131
- hideSupercoinsChip: hideSupercoinsChip,
1132
- hideWalletChip: hideWalletChip,
1133
- isNovacThemeEnabled: isNovacThemeEnabled
1134
- })
1316
+ children: jsxRuntime.jsx(UserAccount, {})
1135
1317
  })) : jsxRuntime.jsx(ctDesignButton.Button, __assign({
1136
- className: "fw-400 fs-14 ".concat(isNovacThemeEnabled ? 'novac-login-button' : 'login-button'),
1318
+ className: "fw-400 fs-14 ".concat(effectiveNovacThemeEnabled ? 'novac-login-button' : 'login-button'),
1137
1319
  onClick: onLoginButtonClick,
1138
1320
  style: {
1139
1321
  width: 153,
1140
1322
  height: 40,
1141
- border: isNovacThemeEnabled ? '1px solid #FFF' : '1px solid #1A1A1A'
1323
+ border: effectiveNovacThemeEnabled ? '1px solid #FFF' : '1px solid #1A1A1A'
1142
1324
  },
1143
1325
  loading: false
1144
1326
  }, {
1145
1327
  children: jsxRuntime.jsx(ctDesignTypography.Typography, __assign({
1146
1328
  componentNode: 'span',
1147
1329
  variant: 'L2',
1148
- color: isNovacThemeEnabled ? 'neutral' : 'primary'
1330
+ color: effectiveNovacThemeEnabled ? 'neutral' : 'primary'
1149
1331
  }, {
1150
1332
  children: "Login"
1151
1333
  }))
@@ -1153,9 +1335,7 @@
1153
1335
  })]
1154
1336
  }))]
1155
1337
  }))
1156
- })), showAllLobs && jsxRuntime.jsx(LobsHeader, {
1157
- selectedLOB: selectedLOB
1158
- })]
1338
+ })), showAllLobs && jsxRuntime.jsx(LobsHeader, {})]
1159
1339
  });
1160
1340
  };
1161
1341