1"use strict";(self.__LOADABLE_LOADED_CHUNKS__=self.__LOADABLE_LOADED_CHUNKS__||[]).push([[11021],{51007:function(e,n,t){t.r(n),t.d(n,{default:function(){return N}});var i=t(28346),r=t(67294),s=t(98746),o=t(73957),a=t(29059),c=t(45007),l=t(17861),u=t(29784),d=t(5733),_=t(76637),g=t(77367),p=t(76228),b=t(15238),m=t(96503),h=t(75142),y=t(90014),v=t(86644),x=t(92319),f=t(85893),A=(0,r.memo)(({totalSteps:e,currentIndex:n,currentQuestionKey:t,handleSubmit:i})=>{let o=(0,m.Z)("genericGA4Event",{eventName:"user_onboarding_section_seen",eventCategory:"section_seen",componentTitle:"user_onboarding",additionalAttribute:JSON.stringify({variant:"v2"})});return(0,r.useEffect)(()=>((0,y.b7)(),()=>{(0,y.Td)()}),[]),(0,f.jsxs)("section",{className:"UserOnboarding__header",ref:o,children:[(0,f.jsx)(x.Z,{levels:4,size:200,gap:18,className:"UserOnboarding__rhombus",fill:"url(#customRhombusGradient)",gradient:(0,f.jsxs)("linearGradient",{id:"customRhombusGradient",x1:"0",y1:"0",x2:"100%",y2:"100%",gradientUnits:"userSpaceOnUse",children:[(0,f.jsx)("stop",{offset:"0%",stopColor:"#BA96FF"}),(0,f.jsx)("stop",{offset:"100%",stopColor:"white"})]})}),(0,f.jsxs)("hgroup",{children:[(0,f.jsx)(v.default,{src:`${h.Dy}UserOnboarding/assets/car_keys.lottie`,width:"35px",height:"35px",loop:!0,autoplayWhenInView:!0,style:{marginTop:"-20px"}}),(0,f.jsx)("h3",{children:"Your dream car, in 3 steps"}),(0,f.jsx)("button",{type:"button",onClick:()=>{(0,s.pushIntoGA4)({eventName:"user_onboarding_skip_click",eventCategory:"cta_click",componentTitle:"user_onboarding",eventValue:t,additionalAttribute:JSON.stringify({variant:"v2"})}),i()},children:"Skip"})]}),(0,f.jsx)("div",{className:"UserOnboarding__progressBar",children:Array.from({length:e}).map((e,t)=>(0,f.jsx)("span",{className:t<=n?"UserOnboarding__active":""},t))})]})}),S=t(28700),k=t(98899),C=t(76908),O=(0,r.memo)(({currentQuestion:e,currentAnswer:n,onAnswerChange:t})=>{let{key:i,display_name:s,choices:o,is_multi_choice:a}=e,c=(0,m.Z)("genericGA4Event",{eventName:`user_onboarding_${e.key}_seen`,eventCategory:"section_seen",componentTitle:"user_onboarding",additionalAttribute:JSON.stringify({variant:"v2"})},1),l=(0,r.useCallback)(e=>n===e,[n]);return(0,f.jsxs)("section",{className:"UserOnboarding__question",ref:c,children:[(0,f.jsx)("h2",{children:s}),(0,f.jsx)("ul",{className:(0,S.Y1)("UserOnboarding__choices"),children:o?.map(e=>(0,f.jsxs)("li",{className:(0,S.Y1)("UserOnboarding__choice",o.some(e=>e.description)&&"UserOnboarding__large",!e.description&&"UserOnboarding__centerContent",l(e.value)&&"UserOnboarding__selected"),children:[(0,f.jsx)(C.Z,{onClick:()=>t(i,e.value,a)}),(0,f.jsxs)("hgroup",{children:[(0,f.jsx)("h4",{children:e.display_name}),e.description&&(0,f.jsx)("p",{children:e.description})]}),e.icon&&(0,f.jsx)(k.Z,{src:e.icon,alt:e.display_name})]},e.display_name))})]})}),N=(0,o.P)(({closePopup:e})=>{let{isSuccess:n,totalSteps:t,currentIndex:o,currentQuestion:m,currentAnswer:h,onAnswerChange:y,handleSubmit:v}=(e=>{let n=(0,c.I0)(),t=(0,l.s0)(),i=(0,c.v9)(d.S$),{isUserLoggedIn:o,currentLocation:a}=(0,c.v9)(e=>({isUserLoggedIn:e.base.isUserLoggedIn,currentLocation:e.base.currentLocation})),[m,h]=(0,r.useState)([]),[y,v]=(0,r.useState)(!1),[x,f]=(0,r.useState)({}),[A,S]=(0,r.useState)(0),[k,C]=(0,r.useState)(!1),O=m.length,N=A===O-1,j=(0,r.useMemo)(()=>m[A]??{},[m,A]),U=(0,r.useMemo)(()=>x[j?.key||""],[x,j]),w=(0,r.useCallback)(()=>{let r=(0,b.g3)(x,i),c=Object.keys(x).length>0;if(!o&&(0,u.G)("brandEMCampaignActive")){let l=`${(0,s.appendCityToListingUrl)("/used-cars/s/",i)}?filterObject=${JSON.stringify(r)}`,u=new p.L(n),d={description:"",intent:"neutral_page",sub_source:"neutral_page",filters:r,isMax:!1,city:{name:a?.key||i||"delhi-ncr",display_name:a?.title||"Delhi NCR"}};return u.showLoginModal({title:"Sign up to view cars",postLoginAction:{type:_.Nn.SUBMIT_CAR_PREFERENCE,data:d},isBuyLeadGenCTA:!0,redirect_url:l,category:"user_onboarding"}),u.updateLoginData({postLoginHandler:()=>{(0,b.iH)({completed:!0,source:"new_user_onboarding"}),t(l,{replace:!0})}}),c&&!o&&((0,b.iH)({completed:!0,source:"new_user_onboarding"}),t(l,{replace:!0})),void e("new_user_onboarding")}if(c){(0,s.pushIntoGA4)({eventName:"user_onboarding_show_results_click",eventCategory:"cta_click",componentTitle:"user_onboarding",eventValue:JSON.stringify(x),additionalAttribute:JSON.stringify({variant:"v2"})},"genericGA4Event"),(0,b.iH)({completed:!0,source:"new_user_onboarding"});let e=new g.E(n);e.setRecentFilters(r),e.applyFiltersAndUpdateMeta({isDesktop:!1,category:"user_onboarding"})}e("new_user_onboarding")},[x,i,e,a?.key,a?.title,o,t]),L=(0,r.useCallback)((e,n,t)=>{f(i=>(0,b.km)(i,e,n,t)),N?C(!0):S(e=>e+1),(0,s.pushIntoGA4)({eventName:`user_onboarding_${e}_select`,eventCategory:"cta_click",componentTitle:"user_onboarding",eventValue:JSON.stringify(n),additionalAttribute:JSON.stringify({variant:"v2"})},"genericGA4Event")},[N]);return(0,r.useEffect)(()=>{(0,b.v6)().then(e=>{h(e),v(!0)}).catch(()=>v(!1))},[]),(0,r.useEffect)(()=>{k&&(w(),C(!1))},[k,w]),{isSuccess:y,totalSteps:O,currentIndex:A,currentQuestion:j,currentAnswer:U,onAnswerChange:L,handleSubmit:w}})(e),x=(0,r.useCallback)((e,n)=>{v();let t="outside_box_close_click"===n;(0,s.pushIntoGA4)({eventName:t?"user_onboarding_outside_click":"user_onboarding_close_click",eventCategory:t?"outside_click":"close_click",componentTitle:"user_onboarding",eventValue:m?.key,additionalAttribute:JSON.stringify({variant:"v2"})})},[v,m?.key]);return n&&m?.key?(0,f.jsxs)(a.default,{className:"UserOnboarding__container",hideModal:x,type:"user-onboarding",size:"fitContent",animation:"bottomToTop",hideCloseButton:!0,bottom:"0",left:"0",right:"0",zIndex:20,children:[(0,f.jsx)(A,{totalSteps:t,currentIndex:o,currentQuestionKey:m?.key||"",handleSubmit:v}),(0,f.jsx)(i.AnimatePresence,{mode:"wait",children:(0,f.jsx)(i.motion.div,{initial:{opacity:0,x:"10%"}
1,animate:{opacity:1,x:0},exit:{opacity:0,x:"-10%"},transition:{duration:.3},className:"UserOnboarding__questionContainer",children:(0,f.jsx)(O,{currentQuestion:m,currentAnswer:h,onAnswerChange:y})},o)})]}):null},"OnboardingStepper")}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.