@cleartrip/ct-design-header 1.2.0-SNAPSHOT-header-v0.5.0 → 1.2.0-SNAPSHOT-header-v0.6.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,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e,n,i=require("tslib"),r=require("react/jsx-runtime"),t=require("react"),o=require("@cleartrip/ct-design-container"),a=require("@cleartrip/ct-design-typography"),s=require("@cleartrip/ct-design-button"),c=require("@cleartrip/ct-design-divider"),l=require("@cleartrip/ct-design-icons"),d=require("@cleartrip/ct-design-shimmer"),u=[{lefticon:l.Offers,text:"Offers",ravenActionName:"offers",isHoverable:!1,isClickable:!0,link:"all-offers/?categories=flights"},{lefticon:l.BusinessBag,text:"Business",ravenActionName:"business",rightIcon:l.ChevronDown,isHoverable:!0},{lefticon:l.MyTrips,text:"My Trips",ravenActionName:"mytrips",isHoverable:!1,isClickable:!0,link:"/account/trips"},{lefticon:l.SupportIcon,text:"Support",ravenActionName:"support",isHoverable:!1,isClickable:!0,link:"/support"}],p=[{title:"Flights",image:"https://rukmini-ct.flixcart.com/f_auto,w_32,h_32,dpr_4/offermgmt-prod/offermgmt/images/banner/Navbar_Flights.png?cache=true",link:"/flights"},{title:"Hotels",image:"https://rukmini-ct.flixcart.com/f_auto,w_32,h_32,dpr_4/offermgmt-prod/offermgmt/images/banner/Navbar_Hotels.png?cache=true",link:"/hotels"},{title:"Buses",image:"https://rukmini-ct.flixcart.com/f_auto,w_32,h_32,dpr_4/offermgmt-prod/offermgmt/images/banner/Navbar_Buses.png?cache=true",link:"/bus"},{title:"Trains",image:"https://rukmini-ct.flixcart.com/f_auto,w_32,h_32,dpr_4/offermgmt-prod/offermgmt/images/banner/Navbar_Trains.png?cache=true",link:"/pages/trains/appOnly"},{title:"Packages",image:"https://rukmini-ct.flixcart.com/f_auto,w_32,h_32,dpr_4/offermgmt-prod/offermgmt/images/banner/Navbar_Packages.png?cache=true",link:"/holidays"}],g=[{title:"AgentBox",subtitle:"For travel agents",details:"One-stop travel solution offering the best deals to our travel agency partners",link:"https://agency.cleartrip.com"},{title:"OutOfOffice",subtitle:"For startups, corporates and SMEs",details:"Manage corporate business travel, smartly",link:"https://ooo.cleartrip.com/",ravenActionName:"ooo"},{title:"MICE",subtitle:"For corporate events",details:"An end-to-end management solution for all your corporate events",link:"https://business.cleartrip.com/"},{title:"API",subtitle:"For developers",details:"Unlock seamless integration and scale with our powerful, reliable APIs",link:"https://business.cleartrip.com/api-customers/more-details"}];exports.RAVEN_PAGE_NAMES=void 0,(e=exports.RAVEN_PAGE_NAMES||(exports.RAVEN_PAGE_NAMES={})).UNIFIED_HOME="unified_homepage",e.HOTELS_HOME="hotel_home",e.FLIGHTS_HOME="flights_home",function(e){e.DESKTOP="desktop"}(n||(n={}));var h={NOVAC:{headerBackground:"transparent",hoverColor:"#FDBA12",logoFill:"#FFF",fkcompanyColor:"#FFF",typographyColor:"#FFF",loginButtonColorVariant:s.ButtonColor.NEUTRAL},DEFAULT:{headerBackground:"#FFFFFF",hoverColor:"#FF4F17",logoFill:"#FF4F17",fkcompanyColor:"#1A1A1A",typographyColor:"#1A1A1A",loginButtonColorVariant:s.ButtonColor.PRIMARY}},x=t.createContext(void 0),f=function(){var e=t.useContext(x);if(!e)throw new Error("useHeaderContext must be used within a HeaderProvider");return e},m=function(e){var n=e.value,t=e.children;return r.jsx(x.Provider,i.__assign({value:n},{children:t}))},v=function(){var e=f().selectedLOB;return r.jsx(o.Container,i.__assign({display:"flex",alignItems:"center",justifyContent:"center",padding:"16px",background:"#F3F5FA",top:"64px",zIndex:2,css:{gap:24}},{children:p.map((function(n,t){var s=n.title,c=n.link,l=n.image,d=e===s;return r.jsx("a",i.__assign({href:d?void 0:c,style:{textDecoration:"none",pointerEvents:d?"none":"auto"}},{children:r.jsxs(o.Container,i.__assign({display:"flex",alignItems:"center",width:"116px",height:"48px",justifyContent:"center",cursor:"pointer",css:{gap:8,background:d?"#FFFFFF":"transparent",borderRadius:d?"40px":"0",padding:d?"8px 16px 8px 8px":"0"}},{children:[r.jsx("img",{src:l,alt:s,width:32,height:32}),r.jsx(a.Typography,i.__assign({variant:d?a.TypographyVariant.HM3:a.TypographyVariant.B1,isClickable:!0},{children:s}))]}),t)}))}))}))};function y(e){var n=e.children,a=e.onMaskClick,s=e.show,c=e.marginTop,l=e.handleDropdownMouseEnter,d=e.handleDropdownMouseLeave;t.useEffect((function(){return s&&(document.body.style.overflow="hidden"),function(){document.body.style.overflow="initial"}}),[s]);var u=function(e,n){var i=t.useState(e),r=i[0],o=i[1],a=t.useRef();return t.useEffect((function(){return e?o(e):a.current=setTimeout((function(){o(!1)}),n),function(){(null==a?void 0:a.current)&&clearTimeout(a.current)}}),[e]),r}(s,300),p=function(e,n){var i=t.useState(!1),r=i[0],o=i[1],a=t.useRef();return t.useEffect((function(){return e&&!r?setTimeout((function(){o(!0)}),0):!e&&r&&(a.current=setTimeout((function(){return o(!1)}),n)),function(){a&&a.current&&clearTimeout(a.current)}}),[n,e]),r}(s,100),g=p;return r.jsxs(r.Fragment,{children:[u&&r.jsx(o.Container,{id:"mask-container",css:{position:"fixed",backgroundColor:"#000",opacity:g?.4:0,width:"100%",height:"100vh",left:0,top:c||0,zIndex:9,transition:"opacity 300ms ease-in"},onClick:a}),u&&r.jsx(o.Container,i.__assign({onMouseEnter:l,onMouseLeave:d},{children:n}))]})}var _,C,b,k=function(e){var n=void 0===e?{}:e,i=n.closeDelay,r=void 0===i?0:i,o=n.openDelay,a=void 0===o?500:o,s=Math.max(r,150),c=t.useState(!1),l=c[0],d=c[1],u=t.useState(null),p=u[0],g=u[1],h=t.useRef(null),x=t.useRef(null),f=t.useRef(!1),m=t.useCallback((function(e){h.current&&clearTimeout(h.current),x.current&&clearTimeout(x.current),f.current=!1,x.current=setTimeout((function(){d(!0),f.current||g(e)}),a)}),[a]),v=t.useCallback((function(){f.current=!0,h.current=setTimeout((function(){d(!1),g(null)}),s)}),[s]),y=t.useCallback((function(){h.current&&clearTimeout(h.current)}),[]),_=t.useCallback((function(){f.current=!0,(null==h?void 0:h.current)&&clearTimeout(h.current),h.current=setTimeout((function(){d(!1),g(null)}),s)}),[]);return t.useEffect((function(){var e=function(e){e.clientY<=0&&(d(!1),g(null))};return window.addEventListener("mouseleave",e),function(){window.removeEventListener("mouseleave",e)}}),[]),{isDropdownVisible:l,hoveredElemIndex:p,handleOnMouseEnter:m,handleOnMouseLeave:v,handleDropdownMouseEnter:y,handleDropdownMouseLeave:_}},w=function(e){var n=t.useRef(null);return t.useEffect((function(){e?function(){if(n.current){var e=n.current.scrollHeight;n.current.style.maxHeight="".concat(e/2,"px"),n.current.style.opacity="0",requestAnimationFrame((function(){n.current&&(n.current.style.transition="max-height 0.3s ease-in-out, opacity 0.3s ease-in-out",n.current.style.maxHeight="".concat(e,"px"),n.current.style.opacity="1")}))}}():function(){if(n.current){var e=n.current.scrollHeight;n.current.style.transition="max-height 0.3s ease-in-out, opacity 0.3s ease-in-out",n.current.style.maxHeight="".concat(e/2,"px"),n.current.style.opacity="0",setTimeout((function(){n.current&&(n.current.style.maxHeight="0px")}),300)}}()}),[e]),{containerRef:n}},j=function(e){var n=Object.keys(e),i=[];return n.forEach((function(n){i.includes(n)?e[n]=Number(e[n]):e[n]=""+e[n]})),e},F=function(e){return"undefined"!=typeof window&&window?new URLSearchParams(window.location.search).get(e):""},E=function(e){switch(e){case"FkVip":return"fk_vip";case"FkPremium":return"fk_plus_premium";case"InsiderIcon":return"myntra_insidericon";case"InsiderElite":return"myntra_insiderelite";default:return""}},L=function(e,r,t,o,a,s){var c;if("function"==typeof a){var l={page_name:s,platform:n.DESKTOP,login_status:e?"yes":"no",domain:null===(c=null===window||void 0===window?void 0:window.location)||void 0===c?void 0:c.host},d=j(t),u=j(o),p=i.__assign(i.__assign(i.__assign({},l),d),u);try{1===a.length?a({eventName:r,eventData:p}):a(r,p)}catch(e){return void console.error(e)}}else console.error("ravenPushCallback is not provided or is not a function")},T=function(e){var n=e.isOpen,s=f(),c=s.isUserLoggedIn,l=s.ravenPushCallback,d=s.ravenPageName,u=s.ravenEventName,p=s.loyaltyType,h=s.ravenPayload,x=void 0===h?{}:h,m=t.useState(0),v=m[0],y=m[1],_=w(n).containerRef;t.useEffect((function(){var e=function(){if(_.current){var e=(window.innerWidth-(_.current.offsetWidth||0))/2;e!==v&&y(e)}};return e(),window.addEventListener("resize",e),function(){return window.removeEventListener("resize",e)}}),[_,v]);var C=t.useCallback((function(e,n,i){var r,t=null!==(r=F("utm_source"))&&void 0!==r?r:"organic",o={action_name:i?"".concat(i,"_business_click"):n?"".concat(n.toLowerCase(),"_business_click"):"",action_type:"click",u_utm_source:t,loyalty_type:E(p)};e&&(L(c,u,o,x,l,d),window.location.href=e)}),[c,u,x,l,d,p]);return r.jsxs(o.Container,i.__assign({ref:_,backgroundColor:"#fff",top:"76px",position:"fixed",left:"".concat(v,"px"),borderRadius:24,boxShadow:"0px 8px 24px 0px rgba(26, 26, 26, 0.10)",width:"fit-content",zIndex:1002,css:{overflow:"hidden",opacity:0}},{children:[r.jsx(o.Container,i.__assign({padding:"20px 24px 20px 24px",backgroundColor:"#FFF1EC"},{children:r.jsx(a.Typography,i.__assign({variant:"HM2"},{children:"Other business services"}))})),r.jsx(o.Container,i.__assign({display:"flex",flexDirection:"row",padding:"24px",columnGap:"48px",width:"fit-content"},{children:g.map((function(e){var n=e.title,t=e.subtitle,s=e.details,c=e.link,l=e.ravenActionName;return r.jsxs(o.Container,i.__assign({cursor:"pointer",display:"flex",flexDirection:"column",width:"200px",rowGap:"11px",className:"bd-hover-container",onClick:function(){return C(c,n,l)}},{children:[r.jsxs(o.Container,i.__assign({display:"flex",flexDirection:"column",rowGap:"4px"},{children:[r.jsxs(o.Container,i.__assign({display:"flex",flexDirection:"row",alignItems:"center",columnGap:"8px"},{children:[r.jsx(a.Typography,i.__assign({variant:"HM2",className:"color-orange-on-hover"},{children:n})),r.jsx(I,{})]})),r.jsx(a.Typography,i.__assign({variant:"B3",css:{marginTop:"4px",opacity:.75}},{children:t}))]})),r.jsx(a.Typography,i.__assign({variant:"P3",color:"subheading",css:{marginTop:"12px"}},{children:s}))]}),n)}))}))]}))},I=function(){return r.jsx(o.Container,i.__assign({className:"bd-arrow-container"},{children:i.__spreadArray([],Array(3),!0).map((function(e,n){return r.jsx(o.Container,i.__assign({className:"bd-arrow-wrapper"},{children:r.jsx(l.ArrowRight,{})}),n)}))}))},A=[{text:"My Profile",icon:r.jsx(l.MyAccount,{width:24,height:24}),redirectionLink:"/accounts/profile"},{text:"My Trips",icon:r.jsx(l.MyTrips,{width:24,height:24}),redirectionLink:"/accounts/trips"},{text:"Saved Cards",icon:r.jsx(l.SavedCard,{}),redirectionLink:"/accounts/expressway"},{text:"Saved Travellers",icon:r.jsx(l.Travellers,{width:24,height:24}),redirectionLink:"/account/travellers"},{text:"Hi-Five",icon:r.jsx(l.HiFive,{}),redirectionLink:"/accounts/hi-five?src=fh"},{text:"Wallet",icon:r.jsx(l.Wallet,{width:24,height:24}),redirectionLink:"/accounts/wallet"},{text:"Settings",icon:r.jsx(l.SettingsCog,{width:24,height:24}),redirectionLink:"/account/settings"},{text:"Privacy Rights",icon:r.jsx(l.PrivacyRights,{}),redirectionLink:"accounts/personal-data-dashboard"}],M="Logout",N="My Account",D="You are logged in with",S="header-acc-btn",P="account-options",B=function(e){var n=e.icon,a=e.borderGradient,s=e.backgroundGradient,c=e.handleChipClick,d=e.chevronFillColor,u=f(),p=u.loyaltyType,g=u.isUserLoggedIn,h=u.ravenPushCallback,x=u.ravenPageName,m=u.ravenPayload,v=void 0===m?{}:m,y=u.ravenEventName,_=t.useState(!1),C=_[0],b=_[1],k=t.useCallback((function(){var e;if(c)c();else{var n={action_name:"loyalty_account_click",action_type:"click",u_utm_source:null!==(e=F("utm_source"))&&void 0!==e?e:"organic",loyaltyType:E(p)};L(g,y,n,v,h,x),window.location.href="/all-offers/loyalty-october"}}),[c,p,g,y,v,h,x]);return r.jsxs(o.Container,i.__assign({display:"flex",position:"relative",alignItems:"center",justifyContent:"center",borderRadius:"8px",cursor:"pointer",paddingLeft:"8px",paddingRight:C?"4px":"8px",css:{overflow:"hidden",height:32,paddingLeft:8,transition:"padding-right 0.2s ease-in-out"},onMouseEnter:function(){return b(!0)},onMouseLeave:function(){return b(!1)},onClick:k},{children:[r.jsx(o.Container,{css:{content:'""',position:"absolute",inset:0,borderRadius:"inherit",background:s,zIndex:-2}}),r.jsx(o.Container,{css:{content:'""',position:"absolute",inset:0,borderRadius:"inherit",padding:"1px",background:a,WebkitMask:"linear-gradient(white, white) content-box, linear-gradient(white, white)",WebkitMaskComposite:"destination-out",maskComposite:"exclude",zIndex:-1}}),r.jsx(o.Container,i.__assign({display:"flex",alignItems:"center",position:"relative"},{children:n})),r.jsx(o.Container,i.__assign({display:"flex",alignItems:"center",css:{overflow:"hidden",maxWidth:C?16:0,transition:"max-width 0.2s ease-in-out, opacity 0.2s ease-in-out",opacity:C?.5:0}},{children:r.jsx(l.HeaderChevronRight,{color:d})}))]}))};exports.LOBS_VALUES=void 0,(_=exports.LOBS_VALUES||(exports.LOBS_VALUES={})).FLIGHTS="Flights",_.HOTELS="Hotels",_.BUSES="Buses",_.TRAINS="Trains",_.PACKAGES="Packages",exports.LoyaltyType=void 0,(C=exports.LoyaltyType||(exports.LoyaltyType={})).FkVip="FkVip",C.FkPremium="FkPremium",C.InsiderIcon="InsiderIcon",C.InsiderElite="InsiderElite",C.CtLoyalty="CtLoyalty";var R=((b={})[exports.LoyaltyType.FkVip]={icon:r.jsx(l.FkVip,{}),borderGradient:"linear-gradient(222.13deg, rgba(243, 179, 39, 0) 2.08%, #F3B327 85.17%)",backgroundGradient:"linear-gradient(111deg, #360042 0%, #540061 100%)",chevronFillColor:"#FFF"},b[exports.LoyaltyType.FkPremium]={icon:r.jsx(l.FkPremium,{}),borderGradient:"linear-gradient(230.68deg, rgba(243, 179, 39, 0) 10.1%, #F3B327 45.74%)",backgroundGradient:"linear-gradient(180deg, #04176A 0%, #082395 100%)",chevronFillColor:"#FFF"},b[exports.LoyaltyType.InsiderIcon]={icon:r.jsx(l.InsiderIcon,{}),borderGradient:"linear-gradient(230.68deg, rgba(208, 175, 101, 0) 10.1%, #D0AF65 45.74%)",backgroundGradient:"linear-gradient(111deg, #2E3042 0%, #1A1C23 100%)",chevronFillColor:"#FFF"},b[exports.LoyaltyType.InsiderElite]={icon:r.jsx(l.InsiderElite,{}),borderGradient:"linear-gradient(230.68deg, rgba(208, 175, 101, 0) 10.1%, #D0AF65 45.74%)",backgroundGradient:"linear-gradient(111deg, #2E3042 0%, #1A1C23 100%)",chevronFillColor:"#FFF"},b[exports.LoyaltyType.CtLoyalty]={icon:r.jsx(l.CtLoyalty,{}),borderGradient:"linear-gradient(230.68deg, rgba(243, 179, 39, 0) 10.1%, #F3B327 45.74%)",backgroundGradient:"linear-gradient(110.82deg, #FFF9EC 0%, #FEE3A8 100%)",chevronFillColor:"#1A1A1A"},b),H=function(e){var n=e.icon,s=e.handleChipClick,c=e.value,d=e.type,u=f(),p=u.loyaltyType,g=u.isUserLoggedIn,h=u.ravenPushCallback,x=u.ravenPageName,m=u.ravenEventName,v=u.ravenPayload,y=void 0===v?{}:v,_=t.useState(!1),C=_[0],b=_[1],k=t.useCallback((function(){var e;if(s)s();else{var n=null!==(e=F("utm_source"))&&void 0!==e?e:"organic",i={action_name:"".concat(d,"_account_click"),action_type:"click",u_utm_source:n,loyaltyType:E(p)};L(g,m,i,y,h,x);var r={supercoin:"/all-offers/supercoins/",wallet:"/accounts/wallet"};r[d]&&(window.location.href=r[d])}}),[s,d,p,g,m,y,h,x]);return r.jsxs(o.Container,i.__assign({display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"8px",cursor:"pointer",css:{height:32,paddingLeft:8,paddingRight:C?4:8,transition:"padding-right 0.2s ease-in-out",background:C?"#ffd7ca":"#ffe6df"},onMouseEnter:function(){return b(!0)},onMouseLeave:function(){return b(!1)},onClick:k},{children:[r.jsxs(o.Container,i.__assign({display:"flex",alignItems:"center",css:{gap:"4px"}},{children:[n,r.jsx(a.Typography,i.__assign({variant:"B3",isClickable:!0},{children:c}))]})),r.jsx(o.Container,i.__assign({display:"flex",alignItems:"center",css:{overflow:"hidden",maxWidth:C?16:0,transition:"max-width 0.2s ease-in-out, opacity 0.2s ease-in-out",opacity:C?1:0}},{children:r.jsx(l.HeaderChevronRight,{})}))]}))},G=function(){var e,n=f(),t=n.loyaltyType,a=n.fkSupercoinBurnBalance,s=void 0===a?0:a,c=n.walletBalance,u=void 0===c?0:c,p=n.loyaltyLoading,g=n.superCoinsLoading,h=n.walletLoading,x=n.walletChipClick,m=n.supercoinsChipClick,v=n.loyaltyChipClick,y=n.hideWalletChip,_=n.hideSupercoinsChip,C=n.hideLoyaltyChip;return p||t&&R[t]&&!C||(g||!_)||(h||!y)?r.jsxs(o.Container,i.__assign({display:"flex",padding:"0 16px 16px 16px",justifyContent:"flex-start",css:{alignSelf:"stretch",gap:"4px"}},{children:[p?r.jsx(d.Shimmer,{width:"50px",height:"32px",borderRadius:"8px"}):t&&R[t]&&!C&&r.jsx(B,{icon:R[t].icon,borderGradient:R[t].borderGradient,backgroundGradient:R[t].backgroundGradient,chevronFillColor:(null===(e=R[t])||void 0===e?void 0:e.chevronFillColor)||"#FFF",handleChipClick:v}),g?r.jsx(d.Shimmer,{width:"50px",height:"32px",borderRadius:"8px"}):!_&&r.jsx(H,{icon:r.jsx(l.Supercoin,{width:20,height:20}),value:s,handleChipClick:m,type:"supercoin"}),h?r.jsx(d.Shimmer,{width:"50px",height:"32px",borderRadius:"8px"}):!y&&r.jsx(H,{icon:r.jsx(l.Wallet,{width:20,height:20}),value:u,handleChipClick:x,type:"wallet"})]})):null},O=function(e){var n=e.isOpen,s=f(),u=s.handleLogoutClick,p=s.userName,g=s.userMobileNumber,h=s.countryCode,x=s.userDetailsLoading,m=s.loyaltyType,v=s.isUserLoggedIn,y=s.ravenEventName,_=s.ravenPageName,C=s.ravenPayload,b=void 0===C?{}:C,k=s.ravenPushCallback,j=w(n).containerRef,T=t.useMemo((function(){return{userGreeting:p?"Hello ".concat(p,"!"):"",phoneNumber:h&&g?"".concat(h," ").concat(g):""}}),[p,g,h]),I=T.userGreeting,N=T.phoneNumber,B=function(e){var n;return{action_name:e.toLowerCase().replace(/[\s-]/g,"")+"_account_click",action_type:"click",u_utm_source:null!==(n=F("utm_source"))&&void 0!==n?n:"organic",loyalty_type:E(m)}},R=t.useCallback((function(e,n){L(v,y,B(e),b,k,_),window.location.href=n}),[v,y,b,k,_]);t.useCallback((function(){L(v,y,B(M),b,k,_),u()}),[v,y,b,k,_,u]);var H=t.useCallback((function(){var e=document.getElementById(S),n=document.getElementById(P);if(e&&n){var i=e.getBoundingClientRect().right;n.style.left="".concat(i-328,"px")}}),[]);t.useEffect((function(){H()}),[H]);var O;return r.jsxs(o.Container,i.__assign({id:P,ref:j,display:"flex",flexDirection:"column",borderRadius:"16px",zIndex:1002,top:"76px",position:"fixed",css:{opacity:0,overflow:"hidden"},width:"".concat(328,"px"),background:"#FFF1EC"},{children:[r.jsx(o.Container,i.__assign({padding:"16px",height:"76px"},{children:(O=function(e,n,t,o){return r.jsx(a.Typography,i.__assign({variant:t,color:o},{children:e?r.jsx(d.Shimmer,{height:"HM3"===t?"18px":"12px",width:"HM3"===t?"140px":"200px"}):n}))},r.jsx(o.Container,i.__assign({display:"flex",flexDirection:"column",css:{gap:"4px"}},{children:I?r.jsxs(r.Fragment,{children:[O(x,I,"HM3","primary"),O(x,"".concat(D," ").concat(N),"P3","subheading")]}):r.jsxs(r.Fragment,{children:[O(x,D,"P3","subheading"),O(x,N,"HM3","primary")]})})))})),r.jsx(G,{}),r.jsxs(o.Container,i.__assign({display:"flex",flexDirection:"column",padding:"8px",backgroundColor:"white",rowGap:"8px",css:{borderBottomLeftRadius:12,borderBottomRightRadius:12}},{children:[A.map((function(e){var n=e.text,t=e.icon,s=e.redirectionLink;return r.jsx(o.Container,i.__assign({className:"hoverable-container",padding:"8px",borderRadius:"8px",cursor:"pointer",onClick:function(){return R(n,s)}},{children:r.jsxs(o.Container,i.__assign({display:"flex",cursor:"pointer",css:{columnGap:"8px"}},{children:[t,r.jsx(a.Typography,i.__assign({variant:"P1",css:{display:"flex",alignItems:"center",cursor:"pointer"}},{children:n}))]}))}),"account-option-".concat(n))})),r.jsx(c.Divider,{css:{borderBottom:"1px dashed #E6E6E6"}}),r.jsxs(o.Container,i.__assign({className:"logout-button",display:"flex",padding:"8px",borderRadius:"8px",cursor:"pointer",onClick:u},{children:[r.jsx(l.Signout,{height:24,width:24}),r.jsx(a.Typography,i.__assign({variant:"P1",css:{display:"flex",alignItems:"center",cursor:"pointer"},color:"warning"},{children:M}))]}))]}))]}))},V=function(){var e=f(),n=e.isNovacThemeEnabled,s=e.ravenEventName,c=e.ravenPayload,d=void 0===c?{}:c,u=e.ravenPushCallback,p=e.isUserLoggedIn,g=e.loyaltyType,x=e.ravenPageName,m=k({openDelay:0}),v=m.isDropdownVisible,_=m.handleOnMouseEnter,C=m.handleOnMouseLeave,b=m.handleDropdownMouseEnter,w=m.handleDropdownMouseLeave,j=t.useState(!1),T=j[0],I=j[1];t.useEffect((function(){var e=function(){I(window.scrollY>=50)};return window.addEventListener("scroll",e),function(){return window.removeEventListener("scroll",e)}}),[]);var A=n&&!T?h.NOVAC:h.DEFAULT,M=A.hoverColor,D=A.typographyColor,P=t.useCallback((function(){var e,n=null!==(e=F("utm_source"))&&void 0!==e?e:"organic",i={action_name:"".concat(N.toLowerCase().replace(/[\s-]/g,""),"_header_hover"),action_type:"hover",u_utm_source:n,loyalty_type:E(g)};L(p,s,i,d,u,x)}),[p,s,d,u,x,g]);return r.jsxs(o.Container,{children:[r.jsxs(o.Container,i.__assign({display:"flex",padding:"8px 12px",alignItems:"center",borderRadius:"12px",height:"100%",cursor:"pointer",css:{columnGap:8,height:64},onMouseEnter:function(){_(0),P()},onMouseLeave:C,id:S},{children:[r.jsx(l.MyAccount,{color:v?M:D}),r.jsxs(o.Container,i.__assign({display:"flex",flexDirection:"row",alignItems:"center"},{children:[r.jsx(a.Typography,i.__assign({variant:"B2",css:{cursor:"pointer"},colorCode:v?M:D},{children:N})),r.jsx(l.ChevronDown,{width:20,height:20,fill:v?M:D})]}))]})),r.jsx(y,i.__assign({show:v,marginTop:"64px",handleDropdownMouseEnter:b,handleDropdownMouseLeave:w,onMaskClick:w},{children:r.jsx(O,{isOpen:v})}))]})},U=function(){var e,n=f(),d=n.onLoginButtonClick,p=n.showAllLobs,g=void 0!==p&&p,x=n.isUserLoggedIn,m=n.loyaltyType,_=n.isNovacThemeEnabled,C=void 0!==_&&_,b=n.ravenPayload,w=void 0===b?{}:b,j=n.ravenPushCallback,I=n.ravenPageName,A=n.ravenEventName,M=t.useState(!1),N=M[0],D=M[1];t.useEffect((function(){var e=function(){D(window.scrollY>=50)};return window.addEventListener("scroll",e),function(){return window.removeEventListener("scroll",e)}}),[]);var S=C&&!N?h.NOVAC:h.DEFAULT,P=S.headerBackground,B=S.logoFill,R=S.hoverColor,H=S.fkcompanyColor,G=S.typographyColor,O=k({openDelay:0}),U=O.isDropdownVisible,W=O.hoveredElemIndex,q=O.handleOnMouseEnter,z=O.handleOnMouseLeave,Y=O.handleDropdownMouseEnter,K=O.handleDropdownMouseLeave,J=null!==(e=F("utm_source"))&&void 0!==e?e:"organic",Q=t.useCallback((function(e,n){return{action_name:e,action_type:n,u_utm_source:J,loyalty_type:E(m)}}),[J,m]),X=t.useCallback((function(e){if(e.isClickable&&e.link){var n="".concat(e.text.toLowerCase().replace(/\s/g,""),"_header_click"),i=Q(n,"click");L(x,A,i,w,j,I),window.location.href=e.link}}),[Q,x,A,w,j,I]),Z=t.useCallback((function(){var e=Q("home_header_click","click");L(x,A,e,w,j,I),window.location.href="/"}),[Q,x,A,w,j,I]),$=t.useCallback((function(e){var n="".concat(e.text.toLowerCase().replace(/\s/g,""),"_header_hover"),i=Q(n,"hover");L(x,A,i,w,j,I)}),[Q,x,A,w,j,I]);return r.jsxs(r.Fragment,{children:[r.jsx(o.Container,i.__assign({display:"flex",top:0,position:"sticky",width:"100%",alignItems:"center",justifyContent:"center",zIndex:1e3,height:"64px",background:P,css:{gap:"24px",flexShrink:0,borderBottom:"transparent"===P?"":"1px solid #E6E6E6",transition:"background-color 0.3s ease-in-out, border-bottom 0.3s ease-in-out"}},{children:r.jsxs(o.Container,i.__assign({display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 28px",flex:1,css:{gap:"24px",maxWidth:1440}},{children:[r.jsxs(o.Container,i.__assign({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",cursor:"pointer",onClick:Z},{children:[r.jsx(l.CTLogo,{fillColor:B}),r.jsx(c.Divider,{css:{width:12,marginLeft:2,marginRight:2,transform:"rotate(90deg)",borderBottom:"1px solid #e0e0e0"}}),r.jsx(l.Fkcompany,{color:H})]})),r.jsxs(o.Container,i.__assign({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",columnGap:"24px"},{children:[r.jsx(o.Container,i.__assign({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",columnGap:"4px"},{children:u.map((function(e,n){var t=e.text,s=e.lefticon,c=e.rightIcon,l=e.isHoverable,d=W===n;return r.jsxs(o.Container,{children:[r.jsxs(o.Container,i.__assign({onMouseEnter:function(){q(n),e.isHoverable&&$(e)},onMouseLeave:z,display:"flex",flexDirection:"row",alignItems:"center",padding:"8px 12px 8px 12px",cursor:"pointer",position:"relative",columnGap:8,height:"64px",onClick:function(){return X(e)}},{children:[r.jsx(s,{color:d?R:G}),r.jsxs(o.Container,i.__assign({display:"flex",flexDirection:"row",alignItems:"center"},{children:[r.jsx(a.Typography,i.__assign({variant:"B2",colorCode:d?R:G,isClickable:!0},{children:t})),c&&r.jsx(c,{width:20,height:20,fill:d?R:G})]}))]}),"nav-option-".concat(n)),r.jsx(y,i.__assign({show:W===n&&l&&U,marginTop:"64px",handleDropdownMouseEnter:Y,handleDropdownMouseLeave:K,onMaskClick:K},{children:r.jsx(T,{isOpen:W===n&&l&&U})}))]})}))})),x&&r.jsx(c.Divider,{css:{width:12,margin:"0 -18px",transform:"rotate(90deg)",borderBottom:"1px solid #e0e0e0"}}),r.jsx(o.Container,{children:x?r.jsx(o.Container,i.__assign({display:"flex",flexDirection:"row",alignItems:"center"},{children:r.jsx(V,{})})):r.jsx(s.Button,i.__assign({className:"".concat("transparent"===P?"novac-login-button":"login-button"),onClick:d,css:{width:153,height:40,border:"transparent"===P?"1px solid #FFFFFF !important":"1px solid #1A1A1A !important"},loading:!1},{children:r.jsx(a.Typography,i.__assign({componentNode:"span",variant:"L2",color:"transparent"===P?"neutral":"primary"},{children:"Log in"}))}))})]}))]}))})),g&&r.jsx(v,{})]})};exports.Header=function(e){return r.jsx(m,i.__assign({value:e},{children:r.jsx(U,{})}))};
|
|
1
|
+
"use strict";var e,n,i=require("tslib"),r=require("react/jsx-runtime"),t=require("react"),o=require("@cleartrip/ct-design-container"),a=require("@cleartrip/ct-design-typography"),s=require("@cleartrip/ct-design-button"),c=require("@cleartrip/ct-design-divider"),l=require("@cleartrip/ct-design-icons"),d=require("@cleartrip/ct-design-shimmer"),u=[{lefticon:l.Offers,text:"Offers",ravenActionName:"offers",isHoverable:!1,isClickable:!0,link:"all-offers/?categories=flights"},{lefticon:l.BusinessBag,text:"Business",ravenActionName:"business",rightIcon:l.ChevronDown,isHoverable:!0},{lefticon:l.MyTrips,text:"My Trips",ravenActionName:"mytrips",isHoverable:!1,isClickable:!0,link:"/account/trips"},{lefticon:l.SupportIcon,text:"Support",ravenActionName:"support",isHoverable:!1,isClickable:!0,link:"/support"}],p=[{title:"Flights",image:"https://rukmini-ct.flixcart.com/f_auto,w_32,h_32,dpr_4/offermgmt-prod/offermgmt/images/banner/Navbar_Flights.png?cache=true",link:"/flights"},{title:"Hotels",image:"https://rukmini-ct.flixcart.com/f_auto,w_32,h_32,dpr_4/offermgmt-prod/offermgmt/images/banner/Navbar_Hotels.png?cache=true",link:"/hotels"},{title:"Buses",image:"https://rukmini-ct.flixcart.com/f_auto,w_32,h_32,dpr_4/offermgmt-prod/offermgmt/images/banner/Navbar_Buses.png?cache=true",link:"/bus"},{title:"Trains",image:"https://rukmini-ct.flixcart.com/f_auto,w_32,h_32,dpr_4/offermgmt-prod/offermgmt/images/banner/Navbar_Trains.png?cache=true",link:"/pages/trains/appOnly"},{title:"Packages",image:"https://rukmini-ct.flixcart.com/f_auto,w_32,h_32,dpr_4/offermgmt-prod/offermgmt/images/banner/Navbar_Packages.png?cache=true",link:"/holidays"}],g=[{title:"AgentBox",subtitle:"For travel agents",details:"One-stop travel solution offering the best deals to our travel agency partners",link:"https://agency.cleartrip.com"},{title:"OutOfOffice",subtitle:"For startups, corporates and SMEs",details:"Manage corporate business travel, smartly",link:"https://ooo.cleartrip.com/",ravenActionName:"ooo"},{title:"MICE",subtitle:"For corporate events",details:"An end-to-end management solution for all your corporate events",link:"https://business.cleartrip.com/"},{title:"API",subtitle:"For developers",details:"Unlock seamless integration and scale with our powerful, reliable APIs",link:"https://business.cleartrip.com/api-customers/more-details"}];exports.RAVEN_PAGE_NAMES=void 0,(e=exports.RAVEN_PAGE_NAMES||(exports.RAVEN_PAGE_NAMES={})).UNIFIED_HOME="unified_homepage",e.HOTELS_HOME="hotel_home",e.FLIGHTS_HOME="flights_home",function(e){e.DESKTOP="desktop"}(n||(n={}));var h={NOVAC:{headerBackground:"transparent",hoverColor:"#FDBA12",logoFill:"#FFF",fkcompanyColor:"#FFF",typographyColor:"#FFF",loginButtonColorVariant:s.ButtonColor.NEUTRAL},DEFAULT:{headerBackground:"#FFFFFF",hoverColor:"#FF4F17",logoFill:"#FF4F17",fkcompanyColor:"#1A1A1A",typographyColor:"#1A1A1A",loginButtonColorVariant:s.ButtonColor.PRIMARY}},x=t.createContext(void 0),f=function(){var e=t.useContext(x);if(!e)throw new Error("useHeaderContext must be used within a HeaderProvider");return e},m=function(e){var n=e.value,t=e.children;return r.jsx(x.Provider,i.__assign({value:n},{children:t}))},v=function(){var e=f().selectedLOB;return r.jsx(o.Container,i.__assign({display:"flex",alignItems:"center",justifyContent:"center",padding:"16px",background:"#F7FAFF",top:"64px",zIndex:2,css:{gap:24}},{children:p.map((function(n,t){var s=n.title,c=n.link,l=n.image,d=e===s;return r.jsx("a",i.__assign({href:d?void 0:c,style:{textDecoration:"none",pointerEvents:d?"none":"auto"}},{children:r.jsxs(o.Container,i.__assign({display:"flex",alignItems:"center",width:"116px",height:"48px",justifyContent:"center",cursor:"pointer",css:{gap:8,background:d?"#FFFFFF":"transparent",borderRadius:d?"40px":"0",padding:d?"8px 16px 8px 8px":"0"}},{children:[r.jsx("img",{src:l,alt:s,width:32,height:32}),r.jsx(a.Typography,i.__assign({variant:d?a.TypographyVariant.HM3:a.TypographyVariant.B1,isClickable:!0},{children:s}))]}),t)}))}))}))};function y(e){var n=e.children,a=e.onMaskClick,s=e.show,c=e.marginTop,l=e.handleDropdownMouseEnter,d=e.handleDropdownMouseLeave;t.useEffect((function(){return s&&(document.body.style.overflow="hidden"),function(){document.body.style.overflow="initial"}}),[s]);var u=function(e,n){var i=t.useState(e),r=i[0],o=i[1],a=t.useRef();return t.useEffect((function(){return e?o(e):a.current=setTimeout((function(){o(!1)}),n),function(){(null==a?void 0:a.current)&&clearTimeout(a.current)}}),[e]),r}(s,300),p=function(e,n){var i=t.useState(!1),r=i[0],o=i[1],a=t.useRef();return t.useEffect((function(){return e&&!r?setTimeout((function(){o(!0)}),0):!e&&r&&(a.current=setTimeout((function(){return o(!1)}),n)),function(){a&&a.current&&clearTimeout(a.current)}}),[n,e]),r}(s,100),g=p;return r.jsxs(r.Fragment,{children:[u&&r.jsx(o.Container,{id:"mask-container",css:{position:"fixed",backgroundColor:"#000",opacity:g?.4:0,width:"100%",height:"100vh",left:0,top:c||0,zIndex:9,transition:"opacity 300ms ease-in"},onClick:a}),u&&r.jsx(o.Container,i.__assign({onMouseEnter:l,onMouseLeave:d},{children:n}))]})}var _,C,b,k=function(e){var n=void 0===e?{}:e,i=n.closeDelay,r=void 0===i?0:i,o=n.openDelay,a=void 0===o?500:o,s=Math.max(r,150),c=t.useState(!1),l=c[0],d=c[1],u=t.useState(null),p=u[0],g=u[1],h=t.useRef(null),x=t.useRef(null),f=t.useRef(!1),m=t.useCallback((function(e){h.current&&clearTimeout(h.current),x.current&&clearTimeout(x.current),f.current=!1,x.current=setTimeout((function(){d(!0),f.current||g(e)}),a)}),[a]),v=t.useCallback((function(){f.current=!0,h.current=setTimeout((function(){d(!1),g(null)}),s)}),[s]),y=t.useCallback((function(){h.current&&clearTimeout(h.current)}),[]),_=t.useCallback((function(){f.current=!0,(null==h?void 0:h.current)&&clearTimeout(h.current),h.current=setTimeout((function(){d(!1),g(null)}),s)}),[]);return t.useEffect((function(){var e=function(e){e.clientY<=0&&(d(!1),g(null))};return window.addEventListener("mouseleave",e),function(){window.removeEventListener("mouseleave",e)}}),[]),{isDropdownVisible:l,hoveredElemIndex:p,handleOnMouseEnter:m,handleOnMouseLeave:v,handleDropdownMouseEnter:y,handleDropdownMouseLeave:_}},w=function(e){var n=t.useRef(null);return t.useEffect((function(){e?function(){if(n.current){var e=n.current.scrollHeight;n.current.style.maxHeight="".concat(e/2,"px"),n.current.style.opacity="0",requestAnimationFrame((function(){n.current&&(n.current.style.transition="max-height 0.3s ease-in-out, opacity 0.3s ease-in-out",n.current.style.maxHeight="".concat(e,"px"),n.current.style.opacity="1")}))}}():function(){if(n.current){var e=n.current.scrollHeight;n.current.style.transition="max-height 0.3s ease-in-out, opacity 0.3s ease-in-out",n.current.style.maxHeight="".concat(e/2,"px"),n.current.style.opacity="0",setTimeout((function(){n.current&&(n.current.style.maxHeight="0px")}),300)}}()}),[e]),{containerRef:n}},j=function(e){var n=Object.keys(e),i=[];return n.forEach((function(n){i.includes(n)?e[n]=Number(e[n]):e[n]=""+e[n]})),e},F=function(e){return"undefined"!=typeof window&&window?new URLSearchParams(window.location.search).get(e):""},E=function(e){switch(e){case"FkVip":return"fk_vip";case"FkPremium":return"fk_plus_premium";case"InsiderIcon":return"myntra_insidericon";case"InsiderElite":return"myntra_insiderelite";default:return""}},L=function(e,r,t,o,a,s){var c;if("function"==typeof a){var l={page_name:s,platform:n.DESKTOP,login_status:e?"yes":"no",domain:null===(c=null===window||void 0===window?void 0:window.location)||void 0===c?void 0:c.host},d=j(t),u=j(o),p=i.__assign(i.__assign(i.__assign({},l),d),u);try{1===a.length?a({eventName:r,eventData:p}):a(r,p)}catch(e){return void console.error(e)}}else console.error("ravenPushCallback is not provided or is not a function")},T=function(e){var n=e.isOpen,s=f(),c=s.isUserLoggedIn,l=s.ravenPushCallback,d=s.ravenPageName,u=s.ravenEventName,p=s.loyaltyType,h=s.ravenPayload,x=void 0===h?{}:h,m=t.useState(0),v=m[0],y=m[1],_=w(n).containerRef;t.useEffect((function(){var e=function(){if(_.current){var e=(window.innerWidth-(_.current.offsetWidth||0))/2;e!==v&&y(e)}};return e(),window.addEventListener("resize",e),function(){return window.removeEventListener("resize",e)}}),[_,v]);var C=t.useCallback((function(e,n,i){var r,t=null!==(r=F("utm_source"))&&void 0!==r?r:"organic",o={action_name:i?"".concat(i,"_business_click"):n?"".concat(n.toLowerCase(),"_business_click"):"",action_type:"click",u_utm_source:t,loyalty_type:E(p)};e&&(L(c,u,o,x,l,d),window.location.href=e)}),[c,u,x,l,d,p]);return r.jsxs(o.Container,i.__assign({ref:_,backgroundColor:"#fff",top:"76px",position:"fixed",left:"".concat(v,"px"),borderRadius:24,boxShadow:"0px 8px 24px 0px rgba(26, 26, 26, 0.10)",width:"fit-content",zIndex:1002,css:{overflow:"hidden",opacity:0}},{children:[r.jsx(o.Container,i.__assign({padding:"20px 24px 20px 24px",backgroundColor:"#FFF1EC"},{children:r.jsx(a.Typography,i.__assign({variant:"HM2"},{children:"Other business services"}))})),r.jsx(o.Container,i.__assign({display:"flex",flexDirection:"row",padding:"24px",columnGap:"48px",width:"fit-content"},{children:g.map((function(e){var n=e.title,t=e.subtitle,s=e.details,c=e.link,l=e.ravenActionName;return r.jsxs(o.Container,i.__assign({cursor:"pointer",display:"flex",flexDirection:"column",width:"200px",rowGap:"11px",className:"bd-hover-container",onClick:function(){return C(c,n,l)}},{children:[r.jsxs(o.Container,i.__assign({display:"flex",flexDirection:"column",rowGap:"4px"},{children:[r.jsxs(o.Container,i.__assign({display:"flex",flexDirection:"row",alignItems:"center",columnGap:"8px"},{children:[r.jsx(a.Typography,i.__assign({variant:"HM2",className:"color-orange-on-hover"},{children:n})),r.jsx(I,{})]})),r.jsx(a.Typography,i.__assign({variant:"B3",css:{marginTop:"4px",opacity:.75}},{children:t}))]})),r.jsx(a.Typography,i.__assign({variant:"P3",color:"subheading",css:{marginTop:"12px"}},{children:s}))]}),n)}))}))]}))},I=function(){return r.jsx(o.Container,i.__assign({className:"bd-arrow-container"},{children:i.__spreadArray([],Array(3),!0).map((function(e,n){return r.jsx(o.Container,i.__assign({className:"bd-arrow-wrapper"},{children:r.jsx(l.ArrowRight,{})}),n)}))}))},A=[{text:"My Profile",icon:r.jsx(l.MyAccount,{width:24,height:24}),redirectionLink:"/accounts/profile"},{text:"My Trips",icon:r.jsx(l.MyTrips,{width:24,height:24}),redirectionLink:"/accounts/trips"},{text:"Saved Cards",icon:r.jsx(l.SavedCard,{}),redirectionLink:"/accounts/expressway"},{text:"Saved Travellers",icon:r.jsx(l.Travellers,{width:24,height:24}),redirectionLink:"/account/travellers"},{text:"Hi-Five",icon:r.jsx(l.HiFive,{}),redirectionLink:"/accounts/hi-five?src=fh"},{text:"Wallet",icon:r.jsx(l.Wallet,{width:24,height:24}),redirectionLink:"/accounts/wallet"},{text:"Settings",icon:r.jsx(l.SettingsCog,{width:24,height:24}),redirectionLink:"/account/settings"},{text:"Privacy Rights",icon:r.jsx(l.PrivacyRights,{}),redirectionLink:"accounts/personal-data-dashboard"}],M="Logout",N="My Account",D="You are logged in with",S="header-acc-btn",P="account-options",B=function(e){var n=e.icon,a=e.borderGradient,s=e.backgroundGradient,c=e.handleChipClick,d=e.chevronFillColor,u=f(),p=u.loyaltyType,g=u.isUserLoggedIn,h=u.ravenPushCallback,x=u.ravenPageName,m=u.ravenPayload,v=void 0===m?{}:m,y=u.ravenEventName,_=t.useState(!1),C=_[0],b=_[1],k=t.useCallback((function(){var e;if(c)c();else{var n={action_name:"loyalty_account_click",action_type:"click",u_utm_source:null!==(e=F("utm_source"))&&void 0!==e?e:"organic",loyaltyType:E(p)};L(g,y,n,v,h,x),window.location.href="/all-offers/loyalty-october"}}),[c,p,g,y,v,h,x]);return r.jsxs(o.Container,i.__assign({display:"flex",position:"relative",alignItems:"center",justifyContent:"center",borderRadius:"8px",cursor:"pointer",paddingLeft:"8px",paddingRight:C?"4px":"8px",css:{overflow:"hidden",height:32,paddingLeft:8,transition:"padding-right 0.2s ease-in-out"},onMouseEnter:function(){return b(!0)},onMouseLeave:function(){return b(!1)},onClick:k},{children:[r.jsx(o.Container,{css:{content:'""',position:"absolute",inset:0,borderRadius:"inherit",background:s,zIndex:-2}}),r.jsx(o.Container,{css:{content:'""',position:"absolute",inset:0,borderRadius:"inherit",padding:"1px",background:a,WebkitMask:"linear-gradient(white, white) content-box, linear-gradient(white, white)",WebkitMaskComposite:"destination-out",maskComposite:"exclude",zIndex:-1}}),r.jsx(o.Container,i.__assign({display:"flex",alignItems:"center",position:"relative"},{children:n})),r.jsx(o.Container,i.__assign({display:"flex",alignItems:"center",css:{overflow:"hidden",maxWidth:C?16:0,transition:"max-width 0.2s ease-in-out, opacity 0.2s ease-in-out",opacity:C?.5:0}},{children:r.jsx(l.HeaderChevronRight,{color:d})}))]}))};exports.LOBS_VALUES=void 0,(_=exports.LOBS_VALUES||(exports.LOBS_VALUES={})).FLIGHTS="Flights",_.HOTELS="Hotels",_.BUSES="Buses",_.TRAINS="Trains",_.PACKAGES="Packages",exports.LoyaltyType=void 0,(C=exports.LoyaltyType||(exports.LoyaltyType={})).FkVip="FkVip",C.FkPremium="FkPremium",C.InsiderIcon="InsiderIcon",C.InsiderElite="InsiderElite",C.CtLoyalty="CtLoyalty";var R=((b={})[exports.LoyaltyType.FkVip]={icon:r.jsx(l.FkVip,{}),borderGradient:"linear-gradient(222.13deg, rgba(243, 179, 39, 0) 2.08%, #F3B327 85.17%)",backgroundGradient:"linear-gradient(111deg, #360042 0%, #540061 100%)",chevronFillColor:"#FFF"},b[exports.LoyaltyType.FkPremium]={icon:r.jsx(l.FkPremium,{}),borderGradient:"linear-gradient(230.68deg, rgba(243, 179, 39, 0) 10.1%, #F3B327 45.74%)",backgroundGradient:"linear-gradient(180deg, #04176A 0%, #082395 100%)",chevronFillColor:"#FFF"},b[exports.LoyaltyType.InsiderIcon]={icon:r.jsx(l.InsiderIcon,{}),borderGradient:"linear-gradient(230.68deg, rgba(208, 175, 101, 0) 10.1%, #D0AF65 45.74%)",backgroundGradient:"linear-gradient(111deg, #2E3042 0%, #1A1C23 100%)",chevronFillColor:"#FFF"},b[exports.LoyaltyType.InsiderElite]={icon:r.jsx(l.InsiderElite,{}),borderGradient:"linear-gradient(230.68deg, rgba(208, 175, 101, 0) 10.1%, #D0AF65 45.74%)",backgroundGradient:"linear-gradient(111deg, #2E3042 0%, #1A1C23 100%)",chevronFillColor:"#FFF"},b[exports.LoyaltyType.CtLoyalty]={icon:r.jsx(l.CtLoyalty,{}),borderGradient:"linear-gradient(230.68deg, rgba(243, 179, 39, 0) 10.1%, #F3B327 45.74%)",backgroundGradient:"linear-gradient(110.82deg, #FFF9EC 0%, #FEE3A8 100%)",chevronFillColor:"#1A1A1A"},b),H=function(e){var n=e.icon,s=e.handleChipClick,c=e.value,d=e.type,u=f(),p=u.loyaltyType,g=u.isUserLoggedIn,h=u.ravenPushCallback,x=u.ravenPageName,m=u.ravenEventName,v=u.ravenPayload,y=void 0===v?{}:v,_=t.useState(!1),C=_[0],b=_[1],k=t.useCallback((function(){var e;if(s)s();else{var n=null!==(e=F("utm_source"))&&void 0!==e?e:"organic",i={action_name:"".concat(d,"_account_click"),action_type:"click",u_utm_source:n,loyaltyType:E(p)};L(g,m,i,y,h,x);var r={supercoin:"/all-offers/supercoins/",wallet:"/accounts/wallet"};r[d]&&(window.location.href=r[d])}}),[s,d,p,g,m,y,h,x]);return r.jsxs(o.Container,i.__assign({display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"8px",cursor:"pointer",css:{height:32,paddingLeft:8,paddingRight:C?4:8,transition:"padding-right 0.2s ease-in-out",background:C?"#ffd7ca":"#ffe6df"},onMouseEnter:function(){return b(!0)},onMouseLeave:function(){return b(!1)},onClick:k},{children:[r.jsxs(o.Container,i.__assign({display:"flex",alignItems:"center",css:{gap:"4px"}},{children:[n,r.jsx(a.Typography,i.__assign({variant:"B3",isClickable:!0},{children:c}))]})),r.jsx(o.Container,i.__assign({display:"flex",alignItems:"center",css:{overflow:"hidden",maxWidth:C?16:0,transition:"max-width 0.2s ease-in-out, opacity 0.2s ease-in-out",opacity:C?1:0}},{children:r.jsx(l.HeaderChevronRight,{})}))]}))},G=function(){var e,n=f(),t=n.loyaltyType,a=n.fkSupercoinBurnBalance,s=void 0===a?0:a,c=n.walletBalance,u=void 0===c?0:c,p=n.loyaltyLoading,g=n.superCoinsLoading,h=n.walletLoading,x=n.walletChipClick,m=n.supercoinsChipClick,v=n.loyaltyChipClick,y=n.hideWalletChip,_=n.hideSupercoinsChip,C=n.hideLoyaltyChip;return p||t&&R[t]&&!C||(g||!_)||(h||!y)?r.jsxs(o.Container,i.__assign({display:"flex",padding:"0 16px 16px 16px",justifyContent:"flex-start",css:{alignSelf:"stretch",gap:"4px"}},{children:[p?r.jsx(d.Shimmer,{width:"50px",height:"32px",borderRadius:"8px"}):t&&R[t]&&!C&&r.jsx(B,{icon:R[t].icon,borderGradient:R[t].borderGradient,backgroundGradient:R[t].backgroundGradient,chevronFillColor:(null===(e=R[t])||void 0===e?void 0:e.chevronFillColor)||"#FFF",handleChipClick:v}),g?r.jsx(d.Shimmer,{width:"50px",height:"32px",borderRadius:"8px"}):!_&&r.jsx(H,{icon:r.jsx(l.Supercoin,{width:20,height:20}),value:s,handleChipClick:m,type:"supercoin"}),h?r.jsx(d.Shimmer,{width:"50px",height:"32px",borderRadius:"8px"}):!y&&r.jsx(H,{icon:r.jsx(l.Wallet,{width:20,height:20}),value:u,handleChipClick:x,type:"wallet"})]})):null},O=function(e){var n=e.isOpen,s=f(),u=s.handleLogoutClick,p=s.userName,g=s.userMobileNumber,h=s.countryCode,x=s.userDetailsLoading,m=s.loyaltyType,v=s.isUserLoggedIn,y=s.ravenEventName,_=s.ravenPageName,C=s.ravenPayload,b=void 0===C?{}:C,k=s.ravenPushCallback,j=w(n).containerRef,T=t.useMemo((function(){return{userGreeting:p?"Hello ".concat(p,"!"):"",phoneNumber:h&&g?"".concat(h," ").concat(g):""}}),[p,g,h]),I=T.userGreeting,N=T.phoneNumber,B=function(e){var n;return{action_name:e.toLowerCase().replace(/[\s-]/g,"")+"_account_click",action_type:"click",u_utm_source:null!==(n=F("utm_source"))&&void 0!==n?n:"organic",loyalty_type:E(m)}},R=t.useCallback((function(e,n){L(v,y,B(e),b,k,_),window.location.href=n}),[v,y,b,k,_]);t.useCallback((function(){L(v,y,B(M),b,k,_),u()}),[v,y,b,k,_,u]);var H=t.useCallback((function(){var e=document.getElementById(S),n=document.getElementById(P);if(e&&n){var i=e.getBoundingClientRect().right;n.style.left="".concat(i-328,"px")}}),[]);t.useEffect((function(){H()}),[H]);var O;return r.jsxs(o.Container,i.__assign({id:P,ref:j,display:"flex",flexDirection:"column",borderRadius:"16px",zIndex:1002,top:"76px",position:"fixed",css:{opacity:0,overflow:"hidden"},width:"".concat(328,"px"),background:"#FFF1EC"},{children:[r.jsx(o.Container,i.__assign({padding:"16px",height:"76px"},{children:(O=function(e,n,t,o){return r.jsx(a.Typography,i.__assign({variant:t,color:o},{children:e?r.jsx(d.Shimmer,{height:"HM3"===t?"18px":"12px",width:"HM3"===t?"140px":"200px"}):n}))},r.jsx(o.Container,i.__assign({display:"flex",flexDirection:"column",css:{gap:"4px"}},{children:I?r.jsxs(r.Fragment,{children:[O(x,I,"HM3","primary"),O(x,"".concat(D," ").concat(N),"P3","subheading")]}):r.jsxs(r.Fragment,{children:[O(x,D,"P3","subheading"),O(x,N,"HM3","primary")]})})))})),r.jsx(G,{}),r.jsxs(o.Container,i.__assign({display:"flex",flexDirection:"column",padding:"8px",backgroundColor:"white",rowGap:"8px",css:{borderBottomLeftRadius:12,borderBottomRightRadius:12}},{children:[A.map((function(e){var n=e.text,t=e.icon,s=e.redirectionLink;return r.jsx(o.Container,i.__assign({className:"hoverable-container",padding:"8px",borderRadius:"8px",cursor:"pointer",onClick:function(){return R(n,s)}},{children:r.jsxs(o.Container,i.__assign({display:"flex",cursor:"pointer",css:{columnGap:"8px"}},{children:[t,r.jsx(a.Typography,i.__assign({variant:"P1",css:{display:"flex",alignItems:"center",cursor:"pointer"}},{children:n}))]}))}),"account-option-".concat(n))})),r.jsx(c.Divider,{css:{borderBottom:"1px dashed #E6E6E6"}}),r.jsxs(o.Container,i.__assign({className:"logout-button",display:"flex",padding:"8px",borderRadius:"8px",cursor:"pointer",onClick:u},{children:[r.jsx(l.Signout,{height:24,width:24}),r.jsx(a.Typography,i.__assign({variant:"P1",css:{display:"flex",alignItems:"center",cursor:"pointer"},color:"warning"},{children:M}))]}))]}))]}))},V=function(){var e=f(),n=e.isNovacThemeEnabled,s=e.ravenEventName,c=e.ravenPayload,d=void 0===c?{}:c,u=e.ravenPushCallback,p=e.isUserLoggedIn,g=e.loyaltyType,x=e.ravenPageName,m=k({openDelay:0}),v=m.isDropdownVisible,_=m.handleOnMouseEnter,C=m.handleOnMouseLeave,b=m.handleDropdownMouseEnter,w=m.handleDropdownMouseLeave,j=t.useState(!1),T=j[0],I=j[1];t.useEffect((function(){var e=function(){I(window.scrollY>=50)};return window.addEventListener("scroll",e),function(){return window.removeEventListener("scroll",e)}}),[]);var A=n&&!T?h.NOVAC:h.DEFAULT,M=A.hoverColor,D=A.typographyColor,P=t.useCallback((function(){var e,n=null!==(e=F("utm_source"))&&void 0!==e?e:"organic",i={action_name:"".concat(N.toLowerCase().replace(/[\s-]/g,""),"_header_hover"),action_type:"hover",u_utm_source:n,loyalty_type:E(g)};L(p,s,i,d,u,x)}),[p,s,d,u,x,g]);return r.jsxs(o.Container,{children:[r.jsxs(o.Container,i.__assign({display:"flex",padding:"8px 12px",alignItems:"center",borderRadius:"12px",height:"100%",cursor:"pointer",css:{columnGap:8,height:64},onMouseEnter:function(){_(0),P()},onMouseLeave:C,id:S},{children:[r.jsx(l.MyAccount,{color:v?M:D}),r.jsxs(o.Container,i.__assign({display:"flex",flexDirection:"row",alignItems:"center"},{children:[r.jsx(a.Typography,i.__assign({variant:"B2",css:{cursor:"pointer"},colorCode:v?M:D},{children:N})),r.jsx(l.ChevronDown,{width:20,height:20,fill:v?M:D})]}))]})),r.jsx(y,i.__assign({show:v,marginTop:"64px",handleDropdownMouseEnter:b,handleDropdownMouseLeave:w,onMaskClick:w},{children:r.jsx(O,{isOpen:v})}))]})},U=function(){var e,n=f(),d=n.onLoginButtonClick,p=n.showAllLobs,g=void 0!==p&&p,x=n.isUserLoggedIn,m=n.loyaltyType,_=n.isNovacThemeEnabled,C=void 0!==_&&_,b=n.ravenPayload,w=void 0===b?{}:b,j=n.ravenPushCallback,I=n.ravenPageName,A=n.ravenEventName,M=t.useState(!1),N=M[0],D=M[1];t.useEffect((function(){var e=function(){D(window.scrollY>=50)};return window.addEventListener("scroll",e),function(){return window.removeEventListener("scroll",e)}}),[]);var S=C&&!N?h.NOVAC:h.DEFAULT,P=S.headerBackground,B=S.logoFill,R=S.hoverColor,H=S.fkcompanyColor,G=S.typographyColor,O=k({openDelay:0}),U=O.isDropdownVisible,W=O.hoveredElemIndex,q=O.handleOnMouseEnter,z=O.handleOnMouseLeave,Y=O.handleDropdownMouseEnter,K=O.handleDropdownMouseLeave,J=null!==(e=F("utm_source"))&&void 0!==e?e:"organic",Q=t.useCallback((function(e,n){return{action_name:e,action_type:n,u_utm_source:J,loyalty_type:E(m)}}),[J,m]),X=t.useCallback((function(e){if(e.isClickable&&e.link){var n="".concat(e.text.toLowerCase().replace(/\s/g,""),"_header_click"),i=Q(n,"click");L(x,A,i,w,j,I),window.location.href=e.link}}),[Q,x,A,w,j,I]),Z=t.useCallback((function(){var e=Q("home_header_click","click");L(x,A,e,w,j,I),window.location.href="/"}),[Q,x,A,w,j,I]),$=t.useCallback((function(e){var n="".concat(e.text.toLowerCase().replace(/\s/g,""),"_header_hover"),i=Q(n,"hover");L(x,A,i,w,j,I)}),[Q,x,A,w,j,I]);return r.jsxs(r.Fragment,{children:[r.jsx(o.Container,i.__assign({display:"flex",top:0,position:"sticky",width:"100%",alignItems:"center",justifyContent:"center",zIndex:1e3,height:"64px",background:P,css:{gap:"24px",flexShrink:0,borderBottom:"transparent"===P?"":"1px solid #E6E6E6",transition:"background-color 0.3s ease-in-out, border-bottom 0.3s ease-in-out"}},{children:r.jsxs(o.Container,i.__assign({display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 28px",flex:1,css:{gap:"24px",maxWidth:1440}},{children:[r.jsxs(o.Container,i.__assign({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",cursor:"pointer",onClick:Z},{children:[r.jsx(l.CTLogo,{fillColor:B}),r.jsx(c.Divider,{css:{width:12,marginLeft:2,marginRight:2,transform:"rotate(90deg)",borderBottom:"1px solid #e0e0e0"}}),r.jsx(l.Fkcompany,{color:H})]})),r.jsxs(o.Container,i.__assign({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",columnGap:"24px"},{children:[r.jsx(o.Container,i.__assign({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",columnGap:"4px"},{children:u.map((function(e,n){var t=e.text,s=e.lefticon,c=e.rightIcon,l=e.isHoverable,d=W===n;return r.jsxs(o.Container,{children:[r.jsxs(o.Container,i.__assign({onMouseEnter:function(){q(n),e.isHoverable&&$(e)},onMouseLeave:z,display:"flex",flexDirection:"row",alignItems:"center",padding:"8px 12px 8px 12px",cursor:"pointer",position:"relative",columnGap:8,height:"64px",onClick:function(){return X(e)}},{children:[r.jsx(s,{color:d?R:G}),r.jsxs(o.Container,i.__assign({display:"flex",flexDirection:"row",alignItems:"center"},{children:[r.jsx(a.Typography,i.__assign({variant:"B2",colorCode:d?R:G,isClickable:!0},{children:t})),c&&r.jsx(c,{width:20,height:20,fill:d?R:G})]}))]}),"nav-option-".concat(n)),r.jsx(y,i.__assign({show:W===n&&l&&U,marginTop:"64px",handleDropdownMouseEnter:Y,handleDropdownMouseLeave:K,onMaskClick:K},{children:r.jsx(T,{isOpen:W===n&&l&&U})}))]})}))})),x&&r.jsx(c.Divider,{css:{width:12,margin:"0 -18px",transform:"rotate(90deg)",borderBottom:"1px solid #e0e0e0"}}),r.jsx(o.Container,{children:x?r.jsx(o.Container,i.__assign({display:"flex",flexDirection:"row",alignItems:"center"},{children:r.jsx(V,{})})):r.jsx(s.Button,i.__assign({className:"".concat("transparent"===P?"novac-login-button":"login-button"),onClick:d,css:{width:153,height:40,border:"transparent"===P?"1px solid #FFFFFF !important":"1px solid #1A1A1A !important"},loading:!1},{children:r.jsx(a.Typography,i.__assign({componentNode:"span",variant:"L2",color:"transparent"===P?"neutral":"primary"},{children:"Log in"}))}))})]}))]}))})),g&&r.jsx(v,{})]})};exports.Header=function(e){return r.jsx(m,i.__assign({value:e},{children:r.jsx(U,{})}))};
|
|
2
2
|
//# sourceMappingURL=ct-design-header.browser.cjs.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e,__spreadArray as n}from"tslib";import{jsx as r,jsxs as t,Fragment as i}from"react/jsx-runtime";import{createContext as o,useContext as a,useState as c,useRef as l,useEffect as s,useCallback as d,useMemo as u}from"react";import{Container as p}from"@cleartrip/ct-design-container";import{Typography as h,TypographyVariant as f}from"@cleartrip/ct-design-typography";import{ButtonColor as g,Button as m}from"@cleartrip/ct-design-button";import{Divider as v}from"@cleartrip/ct-design-divider";import{Offers as x,BusinessBag as y,ChevronDown as w,MyTrips as b,SupportIcon as k,ArrowRight as C,MyAccount as F,SavedCard as _,Travellers as L,HiFive as E,Wallet as I,SettingsCog as M,PrivacyRights as T,HeaderChevronRight as A,FkVip as D,FkPremium as N,InsiderIcon as P,InsiderElite as B,CtLoyalty as H,Supercoin as G,Signout as O,CTLogo as R,Fkcompany as S}from"@cleartrip/ct-design-icons";import{Shimmer as U}from"@cleartrip/ct-design-shimmer";var j,V,z=[{lefticon:x,text:"Offers",ravenActionName:"offers",isHoverable:!1,isClickable:!0,link:"all-offers/?categories=flights"},{lefticon:y,text:"Business",ravenActionName:"business",rightIcon:w,isHoverable:!0},{lefticon:b,text:"My Trips",ravenActionName:"mytrips",isHoverable:!1,isClickable:!0,link:"/account/trips"},{lefticon:k,text:"Support",ravenActionName:"support",isHoverable:!1,isClickable:!0,link:"/support"}],W=[{title:"Flights",image:"https://rukmini-ct.flixcart.com/f_auto,w_32,h_32,dpr_4/offermgmt-prod/offermgmt/images/banner/Navbar_Flights.png?cache=true",link:"/flights"},{title:"Hotels",image:"https://rukmini-ct.flixcart.com/f_auto,w_32,h_32,dpr_4/offermgmt-prod/offermgmt/images/banner/Navbar_Hotels.png?cache=true",link:"/hotels"},{title:"Buses",image:"https://rukmini-ct.flixcart.com/f_auto,w_32,h_32,dpr_4/offermgmt-prod/offermgmt/images/banner/Navbar_Buses.png?cache=true",link:"/bus"},{title:"Trains",image:"https://rukmini-ct.flixcart.com/f_auto,w_32,h_32,dpr_4/offermgmt-prod/offermgmt/images/banner/Navbar_Trains.png?cache=true",link:"/pages/trains/appOnly"},{title:"Packages",image:"https://rukmini-ct.flixcart.com/f_auto,w_32,h_32,dpr_4/offermgmt-prod/offermgmt/images/banner/Navbar_Packages.png?cache=true",link:"/holidays"}],Y=[{title:"AgentBox",subtitle:"For travel agents",details:"One-stop travel solution offering the best deals to our travel agency partners",link:"https://agency.cleartrip.com"},{title:"OutOfOffice",subtitle:"For startups, corporates and SMEs",details:"Manage corporate business travel, smartly",link:"https://ooo.cleartrip.com/",ravenActionName:"ooo"},{title:"MICE",subtitle:"For corporate events",details:"An end-to-end management solution for all your corporate events",link:"https://business.cleartrip.com/"},{title:"API",subtitle:"For developers",details:"Unlock seamless integration and scale with our powerful, reliable APIs",link:"https://business.cleartrip.com/api-customers/more-details"}];!function(e){e.UNIFIED_HOME="unified_homepage",e.HOTELS_HOME="hotel_home",e.FLIGHTS_HOME="flights_home"}(j||(j={})),function(e){e.DESKTOP="desktop"}(V||(V={}));var K={NOVAC:{headerBackground:"transparent",hoverColor:"#FDBA12",logoFill:"#FFF",fkcompanyColor:"#FFF",typographyColor:"#FFF",loginButtonColorVariant:g.NEUTRAL},DEFAULT:{headerBackground:"#FFFFFF",hoverColor:"#FF4F17",logoFill:"#FF4F17",fkcompanyColor:"#1A1A1A",typographyColor:"#1A1A1A",loginButtonColorVariant:g.PRIMARY}},q=o(void 0),J=function(){var e=a(q);if(!e)throw new Error("useHeaderContext must be used within a HeaderProvider");return e},Q=function(n){var t=n.value,i=n.children;return r(q.Provider,e({value:t},{children:i}))},X=function(){var n=J().selectedLOB;return r(p,e({display:"flex",alignItems:"center",justifyContent:"center",padding:"16px",background:"#F3F5FA",top:"64px",zIndex:2,css:{gap:24}},{children:W.map((function(i,o){var a=i.title,c=i.link,l=i.image,s=n===a;return r("a",e({href:s?void 0:c,style:{textDecoration:"none",pointerEvents:s?"none":"auto"}},{children:t(p,e({display:"flex",alignItems:"center",width:"116px",height:"48px",justifyContent:"center",cursor:"pointer",css:{gap:8,background:s?"#FFFFFF":"transparent",borderRadius:s?"40px":"0",padding:s?"8px 16px 8px 8px":"0"}},{children:[r("img",{src:l,alt:a,width:32,height:32}),r(h,e({variant:s?f.HM3:f.B1,isClickable:!0},{children:a}))]}),o)}))}))}))};function Z(n){var o=n.children,a=n.onMaskClick,d=n.show,u=n.marginTop,h=n.handleDropdownMouseEnter,f=n.handleDropdownMouseLeave;s((function(){return d&&(document.body.style.overflow="hidden"),function(){document.body.style.overflow="initial"}}),[d]);var g=function(e,n){var r=c(e),t=r[0],i=r[1],o=l();return s((function(){return e?i(e):o.current=setTimeout((function(){i(!1)}),n),function(){(null==o?void 0:o.current)&&clearTimeout(o.current)}}),[e]),t}(d,300),m=function(e,n){var r=c(!1),t=r[0],i=r[1],o=l();return s((function(){return e&&!t?setTimeout((function(){i(!0)}),0):!e&&t&&(o.current=setTimeout((function(){return i(!1)}),n)),function(){o&&o.current&&clearTimeout(o.current)}}),[n,e]),t}(d,100);return t(i,{children:[g&&r(p,{id:"mask-container",css:{position:"fixed",backgroundColor:"#000",opacity:m?.4:0,width:"100%",height:"100vh",left:0,top:u||0,zIndex:9,transition:"opacity 300ms ease-in"},onClick:a}),g&&r(p,e({onMouseEnter:h,onMouseLeave:f},{children:o}))]})}var $,ee,ne,re=function(e){var n=void 0===e?{}:e,r=n.closeDelay,t=void 0===r?0:r,i=n.openDelay,o=void 0===i?500:i,a=Math.max(t,150),u=c(!1),p=u[0],h=u[1],f=c(null),g=f[0],m=f[1],v=l(null),x=l(null),y=l(!1),w=d((function(e){v.current&&clearTimeout(v.current),x.current&&clearTimeout(x.current),y.current=!1,x.current=setTimeout((function(){h(!0),y.current||m(e)}),o)}),[o]),b=d((function(){y.current=!0,v.current=setTimeout((function(){h(!1),m(null)}),a)}),[a]),k=d((function(){v.current&&clearTimeout(v.current)}),[]),C=d((function(){y.current=!0,(null==v?void 0:v.current)&&clearTimeout(v.current),v.current=setTimeout((function(){h(!1),m(null)}),a)}),[]);return s((function(){var e=function(e){e.clientY<=0&&(h(!1),m(null))};return window.addEventListener("mouseleave",e),function(){window.removeEventListener("mouseleave",e)}}),[]),{isDropdownVisible:p,hoveredElemIndex:g,handleOnMouseEnter:w,handleOnMouseLeave:b,handleDropdownMouseEnter:k,handleDropdownMouseLeave:C}},te=function(e){var n=l(null);return s((function(){e?function(){if(n.current){var e=n.current.scrollHeight;n.current.style.maxHeight="".concat(e/2,"px"),n.current.style.opacity="0",requestAnimationFrame((function(){n.current&&(n.current.style.transition="max-height 0.3s ease-in-out, opacity 0.3s ease-in-out",n.current.style.maxHeight="".concat(e,"px"),n.current.style.opacity="1")}))}}():function(){if(n.current){var e=n.current.scrollHeight;n.current.style.transition="max-height 0.3s ease-in-out, opacity 0.3s ease-in-out",n.current.style.maxHeight="".concat(e/2,"px"),n.current.style.opacity="0",setTimeout((function(){n.current&&(n.current.style.maxHeight="0px")}),300)}}()}),[e]),{containerRef:n}},ie=function(e){var n=Object.keys(e),r=[];return n.forEach((function(n){r.includes(n)?e[n]=Number(e[n]):e[n]=""+e[n]})),e},oe=function(e){return"undefined"!=typeof window&&window?new URLSearchParams(window.location.search).get(e):""},ae=function(e){switch(e){case"FkVip":return"fk_vip";case"FkPremium":return"fk_plus_premium";case"InsiderIcon":return"myntra_insidericon";case"InsiderElite":return"myntra_insiderelite";default:return""}},ce=function(n,r,t,i,o,a){var c;if("function"==typeof o){var l={page_name:a,platform:V.DESKTOP,login_status:n?"yes":"no",domain:null===(c=null===window||void 0===window?void 0:window.location)||void 0===c?void 0:c.host},s=ie(t),d=ie(i),u=e(e(e({},l),s),d);try{1===o.length?o({eventName:r,eventData:u}):o(r,u)}catch(e){return void console.error(e)}}else console.error("ravenPushCallback is not provided or is not a function")},le=function(n){var i=n.isOpen,o=J(),a=o.isUserLoggedIn,l=o.ravenPushCallback,u=o.ravenPageName,f=o.ravenEventName,g=o.loyaltyType,m=o.ravenPayload,v=void 0===m?{}:m,x=c(0),y=x[0],w=x[1],b=te(i).containerRef;s((function(){var e=function(){if(b.current){var e=(window.innerWidth-(b.current.offsetWidth||0))/2;e!==y&&w(e)}};return e(),window.addEventListener("resize",e),function(){return window.removeEventListener("resize",e)}}),[b,y]);var k=d((function(e,n,r){var t,i=null!==(t=oe("utm_source"))&&void 0!==t?t:"organic",o={action_name:r?"".concat(r,"_business_click"):n?"".concat(n.toLowerCase(),"_business_click"):"",action_type:"click",u_utm_source:i,loyalty_type:ae(g)};e&&(ce(a,f,o,v,l,u),window.location.href=e)}),[a,f,v,l,u,g]);return t(p,e({ref:b,backgroundColor:"#fff",top:"76px",position:"fixed",left:"".concat(y,"px"),borderRadius:24,boxShadow:"0px 8px 24px 0px rgba(26, 26, 26, 0.10)",width:"fit-content",zIndex:1002,css:{overflow:"hidden",opacity:0}},{children:[r(p,e({padding:"20px 24px 20px 24px",backgroundColor:"#FFF1EC"},{children:r(h,e({variant:"HM2"},{children:"Other business services"}))})),r(p,e({display:"flex",flexDirection:"row",padding:"24px",columnGap:"48px",width:"fit-content"},{children:Y.map((function(n){var i=n.title,o=n.subtitle,a=n.details,c=n.link,l=n.ravenActionName;return t(p,e({cursor:"pointer",display:"flex",flexDirection:"column",width:"200px",rowGap:"11px",className:"bd-hover-container",onClick:function(){return k(c,i,l)}},{children:[t(p,e({display:"flex",flexDirection:"column",rowGap:"4px"},{children:[t(p,e({display:"flex",flexDirection:"row",alignItems:"center",columnGap:"8px"},{children:[r(h,e({variant:"HM2",className:"color-orange-on-hover"},{children:i})),r(se,{})]})),r(h,e({variant:"B3",css:{marginTop:"4px",opacity:.75}},{children:o}))]})),r(h,e({variant:"P3",color:"subheading",css:{marginTop:"12px"}},{children:a}))]}),i)}))}))]}))},se=function(){return r(p,e({className:"bd-arrow-container"},{children:n([],Array(3),!0).map((function(n,t){return r(p,e({className:"bd-arrow-wrapper"},{children:r(C,{})}),t)}))}))},de=[{text:"My Profile",icon:r(F,{width:24,height:24}),redirectionLink:"/accounts/profile"},{text:"My Trips",icon:r(b,{width:24,height:24}),redirectionLink:"/accounts/trips"},{text:"Saved Cards",icon:r(_,{}),redirectionLink:"/accounts/expressway"},{text:"Saved Travellers",icon:r(L,{width:24,height:24}),redirectionLink:"/account/travellers"},{text:"Hi-Five",icon:r(E,{}),redirectionLink:"/accounts/hi-five?src=fh"},{text:"Wallet",icon:r(I,{width:24,height:24}),redirectionLink:"/accounts/wallet"},{text:"Settings",icon:r(M,{width:24,height:24}),redirectionLink:"/account/settings"},{text:"Privacy Rights",icon:r(T,{}),redirectionLink:"accounts/personal-data-dashboard"}],ue="Logout",pe="My Account",he="You are logged in with",fe="header-acc-btn",ge="account-options",me=function(n){var i=n.icon,o=n.borderGradient,a=n.backgroundGradient,l=n.handleChipClick,s=n.chevronFillColor,u=J(),h=u.loyaltyType,f=u.isUserLoggedIn,g=u.ravenPushCallback,m=u.ravenPageName,v=u.ravenPayload,x=void 0===v?{}:v,y=u.ravenEventName,w=c(!1),b=w[0],k=w[1],C=d((function(){var e;if(l)l();else{var n={action_name:"loyalty_account_click",action_type:"click",u_utm_source:null!==(e=oe("utm_source"))&&void 0!==e?e:"organic",loyaltyType:ae(h)};ce(f,y,n,x,g,m),window.location.href="/all-offers/loyalty-october"}}),[l,h,f,y,x,g,m]);return t(p,e({display:"flex",position:"relative",alignItems:"center",justifyContent:"center",borderRadius:"8px",cursor:"pointer",paddingLeft:"8px",paddingRight:b?"4px":"8px",css:{overflow:"hidden",height:32,paddingLeft:8,transition:"padding-right 0.2s ease-in-out"},onMouseEnter:function(){return k(!0)},onMouseLeave:function(){return k(!1)},onClick:C},{children:[r(p,{css:{content:'""',position:"absolute",inset:0,borderRadius:"inherit",background:a,zIndex:-2}}),r(p,{css:{content:'""',position:"absolute",inset:0,borderRadius:"inherit",padding:"1px",background:o,WebkitMask:"linear-gradient(white, white) content-box, linear-gradient(white, white)",WebkitMaskComposite:"destination-out",maskComposite:"exclude",zIndex:-1}}),r(p,e({display:"flex",alignItems:"center",position:"relative"},{children:i})),r(p,e({display:"flex",alignItems:"center",css:{overflow:"hidden",maxWidth:b?16:0,transition:"max-width 0.2s ease-in-out, opacity 0.2s ease-in-out",opacity:b?.5:0}},{children:r(A,{color:s})}))]}))};!function(e){e.FLIGHTS="Flights",e.HOTELS="Hotels",e.BUSES="Buses",e.TRAINS="Trains",e.PACKAGES="Packages"}($||($={})),function(e){e.FkVip="FkVip",e.FkPremium="FkPremium",e.InsiderIcon="InsiderIcon",e.InsiderElite="InsiderElite",e.CtLoyalty="CtLoyalty"}(ee||(ee={}));var ve=((ne={})[ee.FkVip]={icon:r(D,{}),borderGradient:"linear-gradient(222.13deg, rgba(243, 179, 39, 0) 2.08%, #F3B327 85.17%)",backgroundGradient:"linear-gradient(111deg, #360042 0%, #540061 100%)",chevronFillColor:"#FFF"},ne[ee.FkPremium]={icon:r(N,{}),borderGradient:"linear-gradient(230.68deg, rgba(243, 179, 39, 0) 10.1%, #F3B327 45.74%)",backgroundGradient:"linear-gradient(180deg, #04176A 0%, #082395 100%)",chevronFillColor:"#FFF"},ne[ee.InsiderIcon]={icon:r(P,{}),borderGradient:"linear-gradient(230.68deg, rgba(208, 175, 101, 0) 10.1%, #D0AF65 45.74%)",backgroundGradient:"linear-gradient(111deg, #2E3042 0%, #1A1C23 100%)",chevronFillColor:"#FFF"},ne[ee.InsiderElite]={icon:r(B,{}),borderGradient:"linear-gradient(230.68deg, rgba(208, 175, 101, 0) 10.1%, #D0AF65 45.74%)",backgroundGradient:"linear-gradient(111deg, #2E3042 0%, #1A1C23 100%)",chevronFillColor:"#FFF"},ne[ee.CtLoyalty]={icon:r(H,{}),borderGradient:"linear-gradient(230.68deg, rgba(243, 179, 39, 0) 10.1%, #F3B327 45.74%)",backgroundGradient:"linear-gradient(110.82deg, #FFF9EC 0%, #FEE3A8 100%)",chevronFillColor:"#1A1A1A"},ne),xe=function(n){var i=n.icon,o=n.handleChipClick,a=n.value,l=n.type,s=J(),u=s.loyaltyType,f=s.isUserLoggedIn,g=s.ravenPushCallback,m=s.ravenPageName,v=s.ravenEventName,x=s.ravenPayload,y=void 0===x?{}:x,w=c(!1),b=w[0],k=w[1],C=d((function(){var e;if(o)o();else{var n=null!==(e=oe("utm_source"))&&void 0!==e?e:"organic",r={action_name:"".concat(l,"_account_click"),action_type:"click",u_utm_source:n,loyaltyType:ae(u)};ce(f,v,r,y,g,m);var t={supercoin:"/all-offers/supercoins/",wallet:"/accounts/wallet"};t[l]&&(window.location.href=t[l])}}),[o,l,u,f,v,y,g,m]);return t(p,e({display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"8px",cursor:"pointer",css:{height:32,paddingLeft:8,paddingRight:b?4:8,transition:"padding-right 0.2s ease-in-out",background:b?"#ffd7ca":"#ffe6df"},onMouseEnter:function(){return k(!0)},onMouseLeave:function(){return k(!1)},onClick:C},{children:[t(p,e({display:"flex",alignItems:"center",css:{gap:"4px"}},{children:[i,r(h,e({variant:"B3",isClickable:!0},{children:a}))]})),r(p,e({display:"flex",alignItems:"center",css:{overflow:"hidden",maxWidth:b?16:0,transition:"max-width 0.2s ease-in-out, opacity 0.2s ease-in-out",opacity:b?1:0}},{children:r(A,{})}))]}))},ye=function(){var n,i=J(),o=i.loyaltyType,a=i.fkSupercoinBurnBalance,c=void 0===a?0:a,l=i.walletBalance,s=void 0===l?0:l,d=i.loyaltyLoading,u=i.superCoinsLoading,h=i.walletLoading,f=i.walletChipClick,g=i.supercoinsChipClick,m=i.loyaltyChipClick,v=i.hideWalletChip,x=i.hideSupercoinsChip,y=i.hideLoyaltyChip;return d||o&&ve[o]&&!y||(u||!x)||(h||!v)?t(p,e({display:"flex",padding:"0 16px 16px 16px",justifyContent:"flex-start",css:{alignSelf:"stretch",gap:"4px"}},{children:[d?r(U,{width:"50px",height:"32px",borderRadius:"8px"}):o&&ve[o]&&!y&&r(me,{icon:ve[o].icon,borderGradient:ve[o].borderGradient,backgroundGradient:ve[o].backgroundGradient,chevronFillColor:(null===(n=ve[o])||void 0===n?void 0:n.chevronFillColor)||"#FFF",handleChipClick:m}),u?r(U,{width:"50px",height:"32px",borderRadius:"8px"}):!x&&r(xe,{icon:r(G,{width:20,height:20}),value:c,handleChipClick:g,type:"supercoin"}),h?r(U,{width:"50px",height:"32px",borderRadius:"8px"}):!v&&r(xe,{icon:r(I,{width:20,height:20}),value:s,handleChipClick:f,type:"wallet"})]})):null},we=function(n){var o=n.isOpen,a=J(),c=a.handleLogoutClick,l=a.userName,f=a.userMobileNumber,g=a.countryCode,m=a.userDetailsLoading,x=a.loyaltyType,y=a.isUserLoggedIn,w=a.ravenEventName,b=a.ravenPageName,k=a.ravenPayload,C=void 0===k?{}:k,F=a.ravenPushCallback,_=te(o).containerRef,L=u((function(){return{userGreeting:l?"Hello ".concat(l,"!"):"",phoneNumber:g&&f?"".concat(g," ").concat(f):""}}),[l,f,g]),E=L.userGreeting,I=L.phoneNumber,M=function(e){var n;return{action_name:e.toLowerCase().replace(/[\s-]/g,"")+"_account_click",action_type:"click",u_utm_source:null!==(n=oe("utm_source"))&&void 0!==n?n:"organic",loyalty_type:ae(x)}},T=d((function(e,n){ce(y,w,M(e),C,F,b),window.location.href=n}),[y,w,C,F,b]);d((function(){ce(y,w,M(ue),C,F,b),c()}),[y,w,C,F,b,c]);var A=d((function(){var e=document.getElementById(fe),n=document.getElementById(ge);if(e&&n){var r=e.getBoundingClientRect().right;n.style.left="".concat(r-328,"px")}}),[]);s((function(){A()}),[A]);var D;return t(p,e({id:ge,ref:_,display:"flex",flexDirection:"column",borderRadius:"16px",zIndex:1002,top:"76px",position:"fixed",css:{opacity:0,overflow:"hidden"},width:"".concat(328,"px"),background:"#FFF1EC"},{children:[r(p,e({padding:"16px",height:"76px"},{children:(D=function(n,t,i,o){return r(h,e({variant:i,color:o},{children:n?r(U,{height:"HM3"===i?"18px":"12px",width:"HM3"===i?"140px":"200px"}):t}))},r(p,e({display:"flex",flexDirection:"column",css:{gap:"4px"}},{children:t(i,E?{children:[D(m,E,"HM3","primary"),D(m,"".concat(he," ").concat(I),"P3","subheading")]}:{children:[D(m,he,"P3","subheading"),D(m,I,"HM3","primary")]})})))})),r(ye,{}),t(p,e({display:"flex",flexDirection:"column",padding:"8px",backgroundColor:"white",rowGap:"8px",css:{borderBottomLeftRadius:12,borderBottomRightRadius:12}},{children:[de.map((function(n){var i=n.text,o=n.icon,a=n.redirectionLink;return r(p,e({className:"hoverable-container",padding:"8px",borderRadius:"8px",cursor:"pointer",onClick:function(){return T(i,a)}},{children:t(p,e({display:"flex",cursor:"pointer",css:{columnGap:"8px"}},{children:[o,r(h,e({variant:"P1",css:{display:"flex",alignItems:"center",cursor:"pointer"}},{children:i}))]}))}),"account-option-".concat(i))})),r(v,{css:{borderBottom:"1px dashed #E6E6E6"}}),t(p,e({className:"logout-button",display:"flex",padding:"8px",borderRadius:"8px",cursor:"pointer",onClick:c},{children:[r(O,{height:24,width:24}),r(h,e({variant:"P1",css:{display:"flex",alignItems:"center",cursor:"pointer"},color:"warning"},{children:ue}))]}))]}))]}))},be=function(){var n=J(),i=n.isNovacThemeEnabled,o=n.ravenEventName,a=n.ravenPayload,l=void 0===a?{}:a,u=n.ravenPushCallback,f=n.isUserLoggedIn,g=n.loyaltyType,m=n.ravenPageName,v=re({openDelay:0}),x=v.isDropdownVisible,y=v.handleOnMouseEnter,b=v.handleOnMouseLeave,k=v.handleDropdownMouseEnter,C=v.handleDropdownMouseLeave,_=c(!1),L=_[0],E=_[1];s((function(){var e=function(){E(window.scrollY>=50)};return window.addEventListener("scroll",e),function(){return window.removeEventListener("scroll",e)}}),[]);var I=i&&!L?K.NOVAC:K.DEFAULT,M=I.hoverColor,T=I.typographyColor,A=d((function(){var e,n=null!==(e=oe("utm_source"))&&void 0!==e?e:"organic",r={action_name:"".concat(pe.toLowerCase().replace(/[\s-]/g,""),"_header_hover"),action_type:"hover",u_utm_source:n,loyalty_type:ae(g)};ce(f,o,r,l,u,m)}),[f,o,l,u,m,g]);return t(p,{children:[t(p,e({display:"flex",padding:"8px 12px",alignItems:"center",borderRadius:"12px",height:"100%",cursor:"pointer",css:{columnGap:8,height:64},onMouseEnter:function(){y(0),A()},onMouseLeave:b,id:fe},{children:[r(F,{color:x?M:T}),t(p,e({display:"flex",flexDirection:"row",alignItems:"center"},{children:[r(h,e({variant:"B2",css:{cursor:"pointer"},colorCode:x?M:T},{children:pe})),r(w,{width:20,height:20,fill:x?M:T})]}))]})),r(Z,e({show:x,marginTop:"64px",handleDropdownMouseEnter:k,handleDropdownMouseLeave:C,onMaskClick:C},{children:r(we,{isOpen:x})}))]})},ke=function(n){return r(Q,e({value:n},{children:r(Ce,{})}))},Ce=function(){var n,o=J(),a=o.onLoginButtonClick,l=o.showAllLobs,u=void 0!==l&&l,f=o.isUserLoggedIn,g=o.loyaltyType,x=o.isNovacThemeEnabled,y=void 0!==x&&x,w=o.ravenPayload,b=void 0===w?{}:w,k=o.ravenPushCallback,C=o.ravenPageName,F=o.ravenEventName,_=c(!1),L=_[0],E=_[1];s((function(){var e=function(){E(window.scrollY>=50)};return window.addEventListener("scroll",e),function(){return window.removeEventListener("scroll",e)}}),[]);var I=y&&!L?K.NOVAC:K.DEFAULT,M=I.headerBackground,T=I.logoFill,A=I.hoverColor,D=I.fkcompanyColor,N=I.typographyColor,P=re({openDelay:0}),B=P.isDropdownVisible,H=P.hoveredElemIndex,G=P.handleOnMouseEnter,O=P.handleOnMouseLeave,U=P.handleDropdownMouseEnter,j=P.handleDropdownMouseLeave,V=null!==(n=oe("utm_source"))&&void 0!==n?n:"organic",W=d((function(e,n){return{action_name:e,action_type:n,u_utm_source:V,loyalty_type:ae(g)}}),[V,g]),Y=d((function(e){if(e.isClickable&&e.link){var n="".concat(e.text.toLowerCase().replace(/\s/g,""),"_header_click"),r=W(n,"click");ce(f,F,r,b,k,C),window.location.href=e.link}}),[W,f,F,b,k,C]),q=d((function(){var e=W("home_header_click","click");ce(f,F,e,b,k,C),window.location.href="/"}),[W,f,F,b,k,C]),Q=d((function(e){var n="".concat(e.text.toLowerCase().replace(/\s/g,""),"_header_hover"),r=W(n,"hover");ce(f,F,r,b,k,C)}),[W,f,F,b,k,C]);return t(i,{children:[r(p,e({display:"flex",top:0,position:"sticky",width:"100%",alignItems:"center",justifyContent:"center",zIndex:1e3,height:"64px",background:M,css:{gap:"24px",flexShrink:0,borderBottom:"transparent"===M?"":"1px solid #E6E6E6",transition:"background-color 0.3s ease-in-out, border-bottom 0.3s ease-in-out"}},{children:t(p,e({display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 28px",flex:1,css:{gap:"24px",maxWidth:1440}},{children:[t(p,e({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",cursor:"pointer",onClick:q},{children:[r(R,{fillColor:T}),r(v,{css:{width:12,marginLeft:2,marginRight:2,transform:"rotate(90deg)",borderBottom:"1px solid #e0e0e0"}}),r(S,{color:D})]})),t(p,e({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",columnGap:"24px"},{children:[r(p,e({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",columnGap:"4px"},{children:z.map((function(n,i){var o=n.text,a=n.lefticon,c=n.rightIcon,l=n.isHoverable,s=H===i;return t(p,{children:[t(p,e({onMouseEnter:function(){G(i),n.isHoverable&&Q(n)},onMouseLeave:O,display:"flex",flexDirection:"row",alignItems:"center",padding:"8px 12px 8px 12px",cursor:"pointer",position:"relative",columnGap:8,height:"64px",onClick:function(){return Y(n)}},{children:[r(a,{color:s?A:N}),t(p,e({display:"flex",flexDirection:"row",alignItems:"center"},{children:[r(h,e({variant:"B2",colorCode:s?A:N,isClickable:!0},{children:o})),c&&r(c,{width:20,height:20,fill:s?A:N})]}))]}),"nav-option-".concat(i)),r(Z,e({show:H===i&&l&&B,marginTop:"64px",handleDropdownMouseEnter:U,handleDropdownMouseLeave:j,onMaskClick:j},{children:r(le,{isOpen:H===i&&l&&B})}))]})}))})),f&&r(v,{css:{width:12,margin:"0 -18px",transform:"rotate(90deg)",borderBottom:"1px solid #e0e0e0"}}),r(p,{children:f?r(p,e({display:"flex",flexDirection:"row",alignItems:"center"},{children:r(be,{})})):r(m,e({className:"".concat("transparent"===M?"novac-login-button":"login-button"),onClick:a,css:{width:153,height:40,border:"transparent"===M?"1px solid #FFFFFF !important":"1px solid #1A1A1A !important"},loading:!1},{children:r(h,e({componentNode:"span",variant:"L2",color:"transparent"===M?"neutral":"primary"},{children:"Log in"}))}))})]}))]}))})),u&&r(X,{})]})};export{ke as Header,$ as LOBS_VALUES,ee as LoyaltyType,j as RAVEN_PAGE_NAMES};
|
|
1
|
+
import{__assign as e,__spreadArray as n}from"tslib";import{jsx as r,jsxs as t,Fragment as i}from"react/jsx-runtime";import{createContext as o,useContext as a,useState as c,useRef as l,useEffect as s,useCallback as d,useMemo as u}from"react";import{Container as p}from"@cleartrip/ct-design-container";import{Typography as h,TypographyVariant as f}from"@cleartrip/ct-design-typography";import{ButtonColor as g,Button as m}from"@cleartrip/ct-design-button";import{Divider as v}from"@cleartrip/ct-design-divider";import{Offers as x,BusinessBag as y,ChevronDown as w,MyTrips as b,SupportIcon as k,ArrowRight as C,MyAccount as F,SavedCard as _,Travellers as L,HiFive as E,Wallet as I,SettingsCog as M,PrivacyRights as T,HeaderChevronRight as A,FkVip as D,FkPremium as N,InsiderIcon as P,InsiderElite as B,CtLoyalty as H,Supercoin as G,Signout as O,CTLogo as R,Fkcompany as S}from"@cleartrip/ct-design-icons";import{Shimmer as U}from"@cleartrip/ct-design-shimmer";var j,V,z=[{lefticon:x,text:"Offers",ravenActionName:"offers",isHoverable:!1,isClickable:!0,link:"all-offers/?categories=flights"},{lefticon:y,text:"Business",ravenActionName:"business",rightIcon:w,isHoverable:!0},{lefticon:b,text:"My Trips",ravenActionName:"mytrips",isHoverable:!1,isClickable:!0,link:"/account/trips"},{lefticon:k,text:"Support",ravenActionName:"support",isHoverable:!1,isClickable:!0,link:"/support"}],W=[{title:"Flights",image:"https://rukmini-ct.flixcart.com/f_auto,w_32,h_32,dpr_4/offermgmt-prod/offermgmt/images/banner/Navbar_Flights.png?cache=true",link:"/flights"},{title:"Hotels",image:"https://rukmini-ct.flixcart.com/f_auto,w_32,h_32,dpr_4/offermgmt-prod/offermgmt/images/banner/Navbar_Hotels.png?cache=true",link:"/hotels"},{title:"Buses",image:"https://rukmini-ct.flixcart.com/f_auto,w_32,h_32,dpr_4/offermgmt-prod/offermgmt/images/banner/Navbar_Buses.png?cache=true",link:"/bus"},{title:"Trains",image:"https://rukmini-ct.flixcart.com/f_auto,w_32,h_32,dpr_4/offermgmt-prod/offermgmt/images/banner/Navbar_Trains.png?cache=true",link:"/pages/trains/appOnly"},{title:"Packages",image:"https://rukmini-ct.flixcart.com/f_auto,w_32,h_32,dpr_4/offermgmt-prod/offermgmt/images/banner/Navbar_Packages.png?cache=true",link:"/holidays"}],Y=[{title:"AgentBox",subtitle:"For travel agents",details:"One-stop travel solution offering the best deals to our travel agency partners",link:"https://agency.cleartrip.com"},{title:"OutOfOffice",subtitle:"For startups, corporates and SMEs",details:"Manage corporate business travel, smartly",link:"https://ooo.cleartrip.com/",ravenActionName:"ooo"},{title:"MICE",subtitle:"For corporate events",details:"An end-to-end management solution for all your corporate events",link:"https://business.cleartrip.com/"},{title:"API",subtitle:"For developers",details:"Unlock seamless integration and scale with our powerful, reliable APIs",link:"https://business.cleartrip.com/api-customers/more-details"}];!function(e){e.UNIFIED_HOME="unified_homepage",e.HOTELS_HOME="hotel_home",e.FLIGHTS_HOME="flights_home"}(j||(j={})),function(e){e.DESKTOP="desktop"}(V||(V={}));var K={NOVAC:{headerBackground:"transparent",hoverColor:"#FDBA12",logoFill:"#FFF",fkcompanyColor:"#FFF",typographyColor:"#FFF",loginButtonColorVariant:g.NEUTRAL},DEFAULT:{headerBackground:"#FFFFFF",hoverColor:"#FF4F17",logoFill:"#FF4F17",fkcompanyColor:"#1A1A1A",typographyColor:"#1A1A1A",loginButtonColorVariant:g.PRIMARY}},q=o(void 0),J=function(){var e=a(q);if(!e)throw new Error("useHeaderContext must be used within a HeaderProvider");return e},Q=function(n){var t=n.value,i=n.children;return r(q.Provider,e({value:t},{children:i}))},X=function(){var n=J().selectedLOB;return r(p,e({display:"flex",alignItems:"center",justifyContent:"center",padding:"16px",background:"#F7FAFF",top:"64px",zIndex:2,css:{gap:24}},{children:W.map((function(i,o){var a=i.title,c=i.link,l=i.image,s=n===a;return r("a",e({href:s?void 0:c,style:{textDecoration:"none",pointerEvents:s?"none":"auto"}},{children:t(p,e({display:"flex",alignItems:"center",width:"116px",height:"48px",justifyContent:"center",cursor:"pointer",css:{gap:8,background:s?"#FFFFFF":"transparent",borderRadius:s?"40px":"0",padding:s?"8px 16px 8px 8px":"0"}},{children:[r("img",{src:l,alt:a,width:32,height:32}),r(h,e({variant:s?f.HM3:f.B1,isClickable:!0},{children:a}))]}),o)}))}))}))};function Z(n){var o=n.children,a=n.onMaskClick,d=n.show,u=n.marginTop,h=n.handleDropdownMouseEnter,f=n.handleDropdownMouseLeave;s((function(){return d&&(document.body.style.overflow="hidden"),function(){document.body.style.overflow="initial"}}),[d]);var g=function(e,n){var r=c(e),t=r[0],i=r[1],o=l();return s((function(){return e?i(e):o.current=setTimeout((function(){i(!1)}),n),function(){(null==o?void 0:o.current)&&clearTimeout(o.current)}}),[e]),t}(d,300),m=function(e,n){var r=c(!1),t=r[0],i=r[1],o=l();return s((function(){return e&&!t?setTimeout((function(){i(!0)}),0):!e&&t&&(o.current=setTimeout((function(){return i(!1)}),n)),function(){o&&o.current&&clearTimeout(o.current)}}),[n,e]),t}(d,100);return t(i,{children:[g&&r(p,{id:"mask-container",css:{position:"fixed",backgroundColor:"#000",opacity:m?.4:0,width:"100%",height:"100vh",left:0,top:u||0,zIndex:9,transition:"opacity 300ms ease-in"},onClick:a}),g&&r(p,e({onMouseEnter:h,onMouseLeave:f},{children:o}))]})}var $,ee,ne,re=function(e){var n=void 0===e?{}:e,r=n.closeDelay,t=void 0===r?0:r,i=n.openDelay,o=void 0===i?500:i,a=Math.max(t,150),u=c(!1),p=u[0],h=u[1],f=c(null),g=f[0],m=f[1],v=l(null),x=l(null),y=l(!1),w=d((function(e){v.current&&clearTimeout(v.current),x.current&&clearTimeout(x.current),y.current=!1,x.current=setTimeout((function(){h(!0),y.current||m(e)}),o)}),[o]),b=d((function(){y.current=!0,v.current=setTimeout((function(){h(!1),m(null)}),a)}),[a]),k=d((function(){v.current&&clearTimeout(v.current)}),[]),C=d((function(){y.current=!0,(null==v?void 0:v.current)&&clearTimeout(v.current),v.current=setTimeout((function(){h(!1),m(null)}),a)}),[]);return s((function(){var e=function(e){e.clientY<=0&&(h(!1),m(null))};return window.addEventListener("mouseleave",e),function(){window.removeEventListener("mouseleave",e)}}),[]),{isDropdownVisible:p,hoveredElemIndex:g,handleOnMouseEnter:w,handleOnMouseLeave:b,handleDropdownMouseEnter:k,handleDropdownMouseLeave:C}},te=function(e){var n=l(null);return s((function(){e?function(){if(n.current){var e=n.current.scrollHeight;n.current.style.maxHeight="".concat(e/2,"px"),n.current.style.opacity="0",requestAnimationFrame((function(){n.current&&(n.current.style.transition="max-height 0.3s ease-in-out, opacity 0.3s ease-in-out",n.current.style.maxHeight="".concat(e,"px"),n.current.style.opacity="1")}))}}():function(){if(n.current){var e=n.current.scrollHeight;n.current.style.transition="max-height 0.3s ease-in-out, opacity 0.3s ease-in-out",n.current.style.maxHeight="".concat(e/2,"px"),n.current.style.opacity="0",setTimeout((function(){n.current&&(n.current.style.maxHeight="0px")}),300)}}()}),[e]),{containerRef:n}},ie=function(e){var n=Object.keys(e),r=[];return n.forEach((function(n){r.includes(n)?e[n]=Number(e[n]):e[n]=""+e[n]})),e},oe=function(e){return"undefined"!=typeof window&&window?new URLSearchParams(window.location.search).get(e):""},ae=function(e){switch(e){case"FkVip":return"fk_vip";case"FkPremium":return"fk_plus_premium";case"InsiderIcon":return"myntra_insidericon";case"InsiderElite":return"myntra_insiderelite";default:return""}},ce=function(n,r,t,i,o,a){var c;if("function"==typeof o){var l={page_name:a,platform:V.DESKTOP,login_status:n?"yes":"no",domain:null===(c=null===window||void 0===window?void 0:window.location)||void 0===c?void 0:c.host},s=ie(t),d=ie(i),u=e(e(e({},l),s),d);try{1===o.length?o({eventName:r,eventData:u}):o(r,u)}catch(e){return void console.error(e)}}else console.error("ravenPushCallback is not provided or is not a function")},le=function(n){var i=n.isOpen,o=J(),a=o.isUserLoggedIn,l=o.ravenPushCallback,u=o.ravenPageName,f=o.ravenEventName,g=o.loyaltyType,m=o.ravenPayload,v=void 0===m?{}:m,x=c(0),y=x[0],w=x[1],b=te(i).containerRef;s((function(){var e=function(){if(b.current){var e=(window.innerWidth-(b.current.offsetWidth||0))/2;e!==y&&w(e)}};return e(),window.addEventListener("resize",e),function(){return window.removeEventListener("resize",e)}}),[b,y]);var k=d((function(e,n,r){var t,i=null!==(t=oe("utm_source"))&&void 0!==t?t:"organic",o={action_name:r?"".concat(r,"_business_click"):n?"".concat(n.toLowerCase(),"_business_click"):"",action_type:"click",u_utm_source:i,loyalty_type:ae(g)};e&&(ce(a,f,o,v,l,u),window.location.href=e)}),[a,f,v,l,u,g]);return t(p,e({ref:b,backgroundColor:"#fff",top:"76px",position:"fixed",left:"".concat(y,"px"),borderRadius:24,boxShadow:"0px 8px 24px 0px rgba(26, 26, 26, 0.10)",width:"fit-content",zIndex:1002,css:{overflow:"hidden",opacity:0}},{children:[r(p,e({padding:"20px 24px 20px 24px",backgroundColor:"#FFF1EC"},{children:r(h,e({variant:"HM2"},{children:"Other business services"}))})),r(p,e({display:"flex",flexDirection:"row",padding:"24px",columnGap:"48px",width:"fit-content"},{children:Y.map((function(n){var i=n.title,o=n.subtitle,a=n.details,c=n.link,l=n.ravenActionName;return t(p,e({cursor:"pointer",display:"flex",flexDirection:"column",width:"200px",rowGap:"11px",className:"bd-hover-container",onClick:function(){return k(c,i,l)}},{children:[t(p,e({display:"flex",flexDirection:"column",rowGap:"4px"},{children:[t(p,e({display:"flex",flexDirection:"row",alignItems:"center",columnGap:"8px"},{children:[r(h,e({variant:"HM2",className:"color-orange-on-hover"},{children:i})),r(se,{})]})),r(h,e({variant:"B3",css:{marginTop:"4px",opacity:.75}},{children:o}))]})),r(h,e({variant:"P3",color:"subheading",css:{marginTop:"12px"}},{children:a}))]}),i)}))}))]}))},se=function(){return r(p,e({className:"bd-arrow-container"},{children:n([],Array(3),!0).map((function(n,t){return r(p,e({className:"bd-arrow-wrapper"},{children:r(C,{})}),t)}))}))},de=[{text:"My Profile",icon:r(F,{width:24,height:24}),redirectionLink:"/accounts/profile"},{text:"My Trips",icon:r(b,{width:24,height:24}),redirectionLink:"/accounts/trips"},{text:"Saved Cards",icon:r(_,{}),redirectionLink:"/accounts/expressway"},{text:"Saved Travellers",icon:r(L,{width:24,height:24}),redirectionLink:"/account/travellers"},{text:"Hi-Five",icon:r(E,{}),redirectionLink:"/accounts/hi-five?src=fh"},{text:"Wallet",icon:r(I,{width:24,height:24}),redirectionLink:"/accounts/wallet"},{text:"Settings",icon:r(M,{width:24,height:24}),redirectionLink:"/account/settings"},{text:"Privacy Rights",icon:r(T,{}),redirectionLink:"accounts/personal-data-dashboard"}],ue="Logout",pe="My Account",he="You are logged in with",fe="header-acc-btn",ge="account-options",me=function(n){var i=n.icon,o=n.borderGradient,a=n.backgroundGradient,l=n.handleChipClick,s=n.chevronFillColor,u=J(),h=u.loyaltyType,f=u.isUserLoggedIn,g=u.ravenPushCallback,m=u.ravenPageName,v=u.ravenPayload,x=void 0===v?{}:v,y=u.ravenEventName,w=c(!1),b=w[0],k=w[1],C=d((function(){var e;if(l)l();else{var n={action_name:"loyalty_account_click",action_type:"click",u_utm_source:null!==(e=oe("utm_source"))&&void 0!==e?e:"organic",loyaltyType:ae(h)};ce(f,y,n,x,g,m),window.location.href="/all-offers/loyalty-october"}}),[l,h,f,y,x,g,m]);return t(p,e({display:"flex",position:"relative",alignItems:"center",justifyContent:"center",borderRadius:"8px",cursor:"pointer",paddingLeft:"8px",paddingRight:b?"4px":"8px",css:{overflow:"hidden",height:32,paddingLeft:8,transition:"padding-right 0.2s ease-in-out"},onMouseEnter:function(){return k(!0)},onMouseLeave:function(){return k(!1)},onClick:C},{children:[r(p,{css:{content:'""',position:"absolute",inset:0,borderRadius:"inherit",background:a,zIndex:-2}}),r(p,{css:{content:'""',position:"absolute",inset:0,borderRadius:"inherit",padding:"1px",background:o,WebkitMask:"linear-gradient(white, white) content-box, linear-gradient(white, white)",WebkitMaskComposite:"destination-out",maskComposite:"exclude",zIndex:-1}}),r(p,e({display:"flex",alignItems:"center",position:"relative"},{children:i})),r(p,e({display:"flex",alignItems:"center",css:{overflow:"hidden",maxWidth:b?16:0,transition:"max-width 0.2s ease-in-out, opacity 0.2s ease-in-out",opacity:b?.5:0}},{children:r(A,{color:s})}))]}))};!function(e){e.FLIGHTS="Flights",e.HOTELS="Hotels",e.BUSES="Buses",e.TRAINS="Trains",e.PACKAGES="Packages"}($||($={})),function(e){e.FkVip="FkVip",e.FkPremium="FkPremium",e.InsiderIcon="InsiderIcon",e.InsiderElite="InsiderElite",e.CtLoyalty="CtLoyalty"}(ee||(ee={}));var ve=((ne={})[ee.FkVip]={icon:r(D,{}),borderGradient:"linear-gradient(222.13deg, rgba(243, 179, 39, 0) 2.08%, #F3B327 85.17%)",backgroundGradient:"linear-gradient(111deg, #360042 0%, #540061 100%)",chevronFillColor:"#FFF"},ne[ee.FkPremium]={icon:r(N,{}),borderGradient:"linear-gradient(230.68deg, rgba(243, 179, 39, 0) 10.1%, #F3B327 45.74%)",backgroundGradient:"linear-gradient(180deg, #04176A 0%, #082395 100%)",chevronFillColor:"#FFF"},ne[ee.InsiderIcon]={icon:r(P,{}),borderGradient:"linear-gradient(230.68deg, rgba(208, 175, 101, 0) 10.1%, #D0AF65 45.74%)",backgroundGradient:"linear-gradient(111deg, #2E3042 0%, #1A1C23 100%)",chevronFillColor:"#FFF"},ne[ee.InsiderElite]={icon:r(B,{}),borderGradient:"linear-gradient(230.68deg, rgba(208, 175, 101, 0) 10.1%, #D0AF65 45.74%)",backgroundGradient:"linear-gradient(111deg, #2E3042 0%, #1A1C23 100%)",chevronFillColor:"#FFF"},ne[ee.CtLoyalty]={icon:r(H,{}),borderGradient:"linear-gradient(230.68deg, rgba(243, 179, 39, 0) 10.1%, #F3B327 45.74%)",backgroundGradient:"linear-gradient(110.82deg, #FFF9EC 0%, #FEE3A8 100%)",chevronFillColor:"#1A1A1A"},ne),xe=function(n){var i=n.icon,o=n.handleChipClick,a=n.value,l=n.type,s=J(),u=s.loyaltyType,f=s.isUserLoggedIn,g=s.ravenPushCallback,m=s.ravenPageName,v=s.ravenEventName,x=s.ravenPayload,y=void 0===x?{}:x,w=c(!1),b=w[0],k=w[1],C=d((function(){var e;if(o)o();else{var n=null!==(e=oe("utm_source"))&&void 0!==e?e:"organic",r={action_name:"".concat(l,"_account_click"),action_type:"click",u_utm_source:n,loyaltyType:ae(u)};ce(f,v,r,y,g,m);var t={supercoin:"/all-offers/supercoins/",wallet:"/accounts/wallet"};t[l]&&(window.location.href=t[l])}}),[o,l,u,f,v,y,g,m]);return t(p,e({display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"8px",cursor:"pointer",css:{height:32,paddingLeft:8,paddingRight:b?4:8,transition:"padding-right 0.2s ease-in-out",background:b?"#ffd7ca":"#ffe6df"},onMouseEnter:function(){return k(!0)},onMouseLeave:function(){return k(!1)},onClick:C},{children:[t(p,e({display:"flex",alignItems:"center",css:{gap:"4px"}},{children:[i,r(h,e({variant:"B3",isClickable:!0},{children:a}))]})),r(p,e({display:"flex",alignItems:"center",css:{overflow:"hidden",maxWidth:b?16:0,transition:"max-width 0.2s ease-in-out, opacity 0.2s ease-in-out",opacity:b?1:0}},{children:r(A,{})}))]}))},ye=function(){var n,i=J(),o=i.loyaltyType,a=i.fkSupercoinBurnBalance,c=void 0===a?0:a,l=i.walletBalance,s=void 0===l?0:l,d=i.loyaltyLoading,u=i.superCoinsLoading,h=i.walletLoading,f=i.walletChipClick,g=i.supercoinsChipClick,m=i.loyaltyChipClick,v=i.hideWalletChip,x=i.hideSupercoinsChip,y=i.hideLoyaltyChip;return d||o&&ve[o]&&!y||(u||!x)||(h||!v)?t(p,e({display:"flex",padding:"0 16px 16px 16px",justifyContent:"flex-start",css:{alignSelf:"stretch",gap:"4px"}},{children:[d?r(U,{width:"50px",height:"32px",borderRadius:"8px"}):o&&ve[o]&&!y&&r(me,{icon:ve[o].icon,borderGradient:ve[o].borderGradient,backgroundGradient:ve[o].backgroundGradient,chevronFillColor:(null===(n=ve[o])||void 0===n?void 0:n.chevronFillColor)||"#FFF",handleChipClick:m}),u?r(U,{width:"50px",height:"32px",borderRadius:"8px"}):!x&&r(xe,{icon:r(G,{width:20,height:20}),value:c,handleChipClick:g,type:"supercoin"}),h?r(U,{width:"50px",height:"32px",borderRadius:"8px"}):!v&&r(xe,{icon:r(I,{width:20,height:20}),value:s,handleChipClick:f,type:"wallet"})]})):null},we=function(n){var o=n.isOpen,a=J(),c=a.handleLogoutClick,l=a.userName,f=a.userMobileNumber,g=a.countryCode,m=a.userDetailsLoading,x=a.loyaltyType,y=a.isUserLoggedIn,w=a.ravenEventName,b=a.ravenPageName,k=a.ravenPayload,C=void 0===k?{}:k,F=a.ravenPushCallback,_=te(o).containerRef,L=u((function(){return{userGreeting:l?"Hello ".concat(l,"!"):"",phoneNumber:g&&f?"".concat(g," ").concat(f):""}}),[l,f,g]),E=L.userGreeting,I=L.phoneNumber,M=function(e){var n;return{action_name:e.toLowerCase().replace(/[\s-]/g,"")+"_account_click",action_type:"click",u_utm_source:null!==(n=oe("utm_source"))&&void 0!==n?n:"organic",loyalty_type:ae(x)}},T=d((function(e,n){ce(y,w,M(e),C,F,b),window.location.href=n}),[y,w,C,F,b]);d((function(){ce(y,w,M(ue),C,F,b),c()}),[y,w,C,F,b,c]);var A=d((function(){var e=document.getElementById(fe),n=document.getElementById(ge);if(e&&n){var r=e.getBoundingClientRect().right;n.style.left="".concat(r-328,"px")}}),[]);s((function(){A()}),[A]);var D;return t(p,e({id:ge,ref:_,display:"flex",flexDirection:"column",borderRadius:"16px",zIndex:1002,top:"76px",position:"fixed",css:{opacity:0,overflow:"hidden"},width:"".concat(328,"px"),background:"#FFF1EC"},{children:[r(p,e({padding:"16px",height:"76px"},{children:(D=function(n,t,i,o){return r(h,e({variant:i,color:o},{children:n?r(U,{height:"HM3"===i?"18px":"12px",width:"HM3"===i?"140px":"200px"}):t}))},r(p,e({display:"flex",flexDirection:"column",css:{gap:"4px"}},{children:t(i,E?{children:[D(m,E,"HM3","primary"),D(m,"".concat(he," ").concat(I),"P3","subheading")]}:{children:[D(m,he,"P3","subheading"),D(m,I,"HM3","primary")]})})))})),r(ye,{}),t(p,e({display:"flex",flexDirection:"column",padding:"8px",backgroundColor:"white",rowGap:"8px",css:{borderBottomLeftRadius:12,borderBottomRightRadius:12}},{children:[de.map((function(n){var i=n.text,o=n.icon,a=n.redirectionLink;return r(p,e({className:"hoverable-container",padding:"8px",borderRadius:"8px",cursor:"pointer",onClick:function(){return T(i,a)}},{children:t(p,e({display:"flex",cursor:"pointer",css:{columnGap:"8px"}},{children:[o,r(h,e({variant:"P1",css:{display:"flex",alignItems:"center",cursor:"pointer"}},{children:i}))]}))}),"account-option-".concat(i))})),r(v,{css:{borderBottom:"1px dashed #E6E6E6"}}),t(p,e({className:"logout-button",display:"flex",padding:"8px",borderRadius:"8px",cursor:"pointer",onClick:c},{children:[r(O,{height:24,width:24}),r(h,e({variant:"P1",css:{display:"flex",alignItems:"center",cursor:"pointer"},color:"warning"},{children:ue}))]}))]}))]}))},be=function(){var n=J(),i=n.isNovacThemeEnabled,o=n.ravenEventName,a=n.ravenPayload,l=void 0===a?{}:a,u=n.ravenPushCallback,f=n.isUserLoggedIn,g=n.loyaltyType,m=n.ravenPageName,v=re({openDelay:0}),x=v.isDropdownVisible,y=v.handleOnMouseEnter,b=v.handleOnMouseLeave,k=v.handleDropdownMouseEnter,C=v.handleDropdownMouseLeave,_=c(!1),L=_[0],E=_[1];s((function(){var e=function(){E(window.scrollY>=50)};return window.addEventListener("scroll",e),function(){return window.removeEventListener("scroll",e)}}),[]);var I=i&&!L?K.NOVAC:K.DEFAULT,M=I.hoverColor,T=I.typographyColor,A=d((function(){var e,n=null!==(e=oe("utm_source"))&&void 0!==e?e:"organic",r={action_name:"".concat(pe.toLowerCase().replace(/[\s-]/g,""),"_header_hover"),action_type:"hover",u_utm_source:n,loyalty_type:ae(g)};ce(f,o,r,l,u,m)}),[f,o,l,u,m,g]);return t(p,{children:[t(p,e({display:"flex",padding:"8px 12px",alignItems:"center",borderRadius:"12px",height:"100%",cursor:"pointer",css:{columnGap:8,height:64},onMouseEnter:function(){y(0),A()},onMouseLeave:b,id:fe},{children:[r(F,{color:x?M:T}),t(p,e({display:"flex",flexDirection:"row",alignItems:"center"},{children:[r(h,e({variant:"B2",css:{cursor:"pointer"},colorCode:x?M:T},{children:pe})),r(w,{width:20,height:20,fill:x?M:T})]}))]})),r(Z,e({show:x,marginTop:"64px",handleDropdownMouseEnter:k,handleDropdownMouseLeave:C,onMaskClick:C},{children:r(we,{isOpen:x})}))]})},ke=function(n){return r(Q,e({value:n},{children:r(Ce,{})}))},Ce=function(){var n,o=J(),a=o.onLoginButtonClick,l=o.showAllLobs,u=void 0!==l&&l,f=o.isUserLoggedIn,g=o.loyaltyType,x=o.isNovacThemeEnabled,y=void 0!==x&&x,w=o.ravenPayload,b=void 0===w?{}:w,k=o.ravenPushCallback,C=o.ravenPageName,F=o.ravenEventName,_=c(!1),L=_[0],E=_[1];s((function(){var e=function(){E(window.scrollY>=50)};return window.addEventListener("scroll",e),function(){return window.removeEventListener("scroll",e)}}),[]);var I=y&&!L?K.NOVAC:K.DEFAULT,M=I.headerBackground,T=I.logoFill,A=I.hoverColor,D=I.fkcompanyColor,N=I.typographyColor,P=re({openDelay:0}),B=P.isDropdownVisible,H=P.hoveredElemIndex,G=P.handleOnMouseEnter,O=P.handleOnMouseLeave,U=P.handleDropdownMouseEnter,j=P.handleDropdownMouseLeave,V=null!==(n=oe("utm_source"))&&void 0!==n?n:"organic",W=d((function(e,n){return{action_name:e,action_type:n,u_utm_source:V,loyalty_type:ae(g)}}),[V,g]),Y=d((function(e){if(e.isClickable&&e.link){var n="".concat(e.text.toLowerCase().replace(/\s/g,""),"_header_click"),r=W(n,"click");ce(f,F,r,b,k,C),window.location.href=e.link}}),[W,f,F,b,k,C]),q=d((function(){var e=W("home_header_click","click");ce(f,F,e,b,k,C),window.location.href="/"}),[W,f,F,b,k,C]),Q=d((function(e){var n="".concat(e.text.toLowerCase().replace(/\s/g,""),"_header_hover"),r=W(n,"hover");ce(f,F,r,b,k,C)}),[W,f,F,b,k,C]);return t(i,{children:[r(p,e({display:"flex",top:0,position:"sticky",width:"100%",alignItems:"center",justifyContent:"center",zIndex:1e3,height:"64px",background:M,css:{gap:"24px",flexShrink:0,borderBottom:"transparent"===M?"":"1px solid #E6E6E6",transition:"background-color 0.3s ease-in-out, border-bottom 0.3s ease-in-out"}},{children:t(p,e({display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 28px",flex:1,css:{gap:"24px",maxWidth:1440}},{children:[t(p,e({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",cursor:"pointer",onClick:q},{children:[r(R,{fillColor:T}),r(v,{css:{width:12,marginLeft:2,marginRight:2,transform:"rotate(90deg)",borderBottom:"1px solid #e0e0e0"}}),r(S,{color:D})]})),t(p,e({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",columnGap:"24px"},{children:[r(p,e({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",columnGap:"4px"},{children:z.map((function(n,i){var o=n.text,a=n.lefticon,c=n.rightIcon,l=n.isHoverable,s=H===i;return t(p,{children:[t(p,e({onMouseEnter:function(){G(i),n.isHoverable&&Q(n)},onMouseLeave:O,display:"flex",flexDirection:"row",alignItems:"center",padding:"8px 12px 8px 12px",cursor:"pointer",position:"relative",columnGap:8,height:"64px",onClick:function(){return Y(n)}},{children:[r(a,{color:s?A:N}),t(p,e({display:"flex",flexDirection:"row",alignItems:"center"},{children:[r(h,e({variant:"B2",colorCode:s?A:N,isClickable:!0},{children:o})),c&&r(c,{width:20,height:20,fill:s?A:N})]}))]}),"nav-option-".concat(i)),r(Z,e({show:H===i&&l&&B,marginTop:"64px",handleDropdownMouseEnter:U,handleDropdownMouseLeave:j,onMaskClick:j},{children:r(le,{isOpen:H===i&&l&&B})}))]})}))})),f&&r(v,{css:{width:12,margin:"0 -18px",transform:"rotate(90deg)",borderBottom:"1px solid #e0e0e0"}}),r(p,{children:f?r(p,e({display:"flex",flexDirection:"row",alignItems:"center"},{children:r(be,{})})):r(m,e({className:"".concat("transparent"===M?"novac-login-button":"login-button"),onClick:a,css:{width:153,height:40,border:"transparent"===M?"1px solid #FFFFFF !important":"1px solid #1A1A1A !important"},loading:!1},{children:r(h,e({componentNode:"span",variant:"L2",color:"transparent"===M?"neutral":"primary"},{children:"Log in"}))}))})]}))]}))})),u&&r(X,{})]})};export{ke as Header,$ as LOBS_VALUES,ee as LoyaltyType,j as RAVEN_PAGE_NAMES};
|
|
2
2
|
//# sourceMappingURL=ct-design-header.browser.esm.js.map
|
package/dist/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.login-button{background-color:#fff!important}.login-button:hover{background-color
|
|
1
|
+
.login-button{background-color:#fff!important}.login-button:hover{background-color:#e3e3e3!important}.novac-login-button{background-color:transparent!important}.novac-login-button:hover{background-color:hsla(0,0%,100%,.25)!important}.hoverable-container{transition:background-color .2s ease-in-out}.hoverable-container:hover{background-color:#ecf3ff}.logout-button{column-gap:8px;transition:background-color .2s ease-in-out}.logout-button:hover{background-color:#fbefef}.bd-arrow-container{background-color:#000;border-radius:50%;display:flex;flex-direction:row;height:20px;justify-content:center;overflow:hidden;transition:background-color .2s ease;width:20px}.color-orange-on-hover{transition:color .2s ease}.bd-arrow-wrapper{align-items:center;display:flex;flex:1 0 auto;height:20px;justify-content:center;position:relative;width:20px}.bd-hover-container:hover .bd-arrow-container{background-color:#ff4f17;transition:color .2s ease}.bd-hover-container:hover .bd-arrow-wrapper{animation:moveRight .2s linear}.bd-hover-container:hover .color-orange-on-hover{color:#ff4f17;transition:background-color .2s ease}.bd-hover-container:not(:hover) .bd-arrow-wrapper{animation:moveRightAgain .2s linear backwards}@keyframes moveRight{0%{transform:translateX(-20px)}to{transform:translateX(0)}}@keyframes moveRightAgain{0%{transform:translateX(-20px)}to{transform:translateX(0)}}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cleartrip/ct-design-header",
|
|
3
|
-
"version": "1.2.0-SNAPSHOT-header-v0.
|
|
3
|
+
"version": "1.2.0-SNAPSHOT-header-v0.6.0",
|
|
4
4
|
"description": "Common header used in the desktop versions of all the LOBs homepage and UHP.",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"main": "dist/ct-design-header.cjs.js",
|
|
@@ -15,13 +15,13 @@
|
|
|
15
15
|
"dist"
|
|
16
16
|
],
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@cleartrip/ct-design-container": "3.21.0-SNAPSHOT-header-v0.
|
|
19
|
-
"@cleartrip/ct-design-divider": "3.21.0-SNAPSHOT-header-v0.
|
|
20
|
-
"@cleartrip/ct-design-typography": "3.22.0-SNAPSHOT-header-v0.
|
|
21
|
-
"@cleartrip/ct-design-button": "3.21.0-SNAPSHOT-header-v0.
|
|
22
|
-
"@cleartrip/ct-design-transition": "3.21.0-SNAPSHOT-header-v0.
|
|
23
|
-
"@cleartrip/ct-design-icons": "39.0.0-SNAPSHOT-header-v0.
|
|
24
|
-
"@cleartrip/ct-design-shimmer": "1.18.0-SNAPSHOT-header-v0.
|
|
18
|
+
"@cleartrip/ct-design-container": "3.21.0-SNAPSHOT-header-v0.6.0",
|
|
19
|
+
"@cleartrip/ct-design-divider": "3.21.0-SNAPSHOT-header-v0.6.0",
|
|
20
|
+
"@cleartrip/ct-design-typography": "3.22.0-SNAPSHOT-header-v0.6.0",
|
|
21
|
+
"@cleartrip/ct-design-button": "3.21.0-SNAPSHOT-header-v0.6.0",
|
|
22
|
+
"@cleartrip/ct-design-transition": "3.21.0-SNAPSHOT-header-v0.6.0",
|
|
23
|
+
"@cleartrip/ct-design-icons": "39.0.0-SNAPSHOT-header-v0.6.0",
|
|
24
|
+
"@cleartrip/ct-design-shimmer": "1.18.0-SNAPSHOT-header-v0.6.0",
|
|
25
25
|
"@cleartrip/ct-design-theme": "3.20.0"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|