PageSourceSearch

https://www.travelxp.com/_next/static/chunks/d2d5a510151c1fee.js?dpl=ee70e9d6bf591bd607a68954f2091ca94d580cc5

js travelxp.com collected 2026-10-01 12:22:07 UTC 15,667 bytes, 4 lines download raw bytes

1;!function(){try { var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&((e._debugIds|| (e._debugIds={}))[n]="6d5304f4-2b0f-2d12-d164-ce079173f671")}catch(e){}}();
2(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,520072,e=>{"use strict";var a=e.i(843476),t=e.i(271645),s=e.i(618566),n=e.i(147288);e.i(972694);var r=e.i(458649),i=e.i(715760),o=e.i(161998),l=e.i(911368),m=e.i(171175),c=e.i(441866),u=e.i(34490),_=e.i(961324),d=e.i(953454),p=e.i(590118),f=e.i(254963),h=e.i(516942),w=e.i(487796);function C(){sessionStorage.removeItem(w.SESSION_REGISTRATION_KEY),sessionStorage.removeItem(w.LOGIN_INTENT_KEY)}function y({lang:e,detectedCountry:y}){let g=(0,s.useRouter)(),S=(0,s.useSearchParams)(),{state:b,setState:L,refreshAuth:k}=(0,n.useApp)(),{pageView:N,trackEvent:T,identifyUser:I}=(0,r.useRudderStack)(),[E,O]=(0,t.useState)("phone"),[x,v]=(0,t.useState)(""),[P,R]=(0,t.useState)(null),[U,$]=(0,t.useState)([]),[A,B]=(0,t.useState)(""),[K,F]=(0,t.useState)(!1),[Y,G]=(0,t.useState)(30),[j,D]=(0,t.useState)(""),[H,M]=(0,t.useState)(!1),[J,z]=(0,t.useState)({channel:"mobile"}),[V,W]=(0,t.useState)({fname:"",lname:"",email:""}),[q,Q]=(0,t.useState)({fname:"",lname:"",email:""}),[X,Z]=(0,t.useState)(!1),[ee,ea]=(0,t.useState)(0),[et,es]=(0,t.useState)(!1),en=(0,t.useCallback)(async(a,t)=>{L(e=>({...e,authenticated:!0,accessToken:t.access_token,business_id:a.business_id??"",business_name:a.business_name??"",user_id:a.userId??a.user_id??"",currency:a.currency??"",country_code:a.country_code??"",watch_plan:a.watch_plan??!1,plan_name:a.plan_name??"",plan_type:a.plan_type??"",watch_plan_sku:a.watch_plan_sku??"",cms_user:a.cms_user??!1,cms_role:a.cms_role??"",user:{...e.user,first_name:a.first_name??"",last_name:a.last_name??""}})),(0,m.removeCookie)("watch"),(0,m.removeCookie)("book");let s=a.userId??a.user_id??"",n=`${P?.dial_code||"+91"}${x}`;s&&(I(s,{firstName:(a.first_name??"").toLowerCase(),lastName:(a.last_name??"").toLowerCase(),plan:a.watch_plan??!1,cmsUser:a.cms_user??!1,planType:(a.plan_type??"").toLowerCase(),planName:(a.plan_name??"").toLowerCase(),currency:(a.currency??"").toLowerCase(),businessName:(a.business_name??"").toLowerCase(),countryCode:(P?.dial_code||"+91").toLowerCase(),phone:n}),T("Login",{first_name:(a.first_name??"").toLowerCase(),last_name:(a.last_name??"").toLowerCase(),phone_number:n}),(0,_.webEngageLogin)(s,{firstName:a.first_name??"",lastName:a.last_name??"",phone:n}));let r=sessionStorage.getItem(w.SESSION_REGISTRATION_KEY);if(r){let{fname:l,lname:c,email:u,salutation:d}=JSON.parse(r);sessionStorage.removeItem(w.SESSION_REGISTRATION_KEY);let p=(0,o.clientHeaders)({accessToken:t.access_token,businessId:a.business_id??"",currency:a.currency??""}),[f,h]=await Promise.all([(0,i.clientFetch)("/api/user/profile/name",{method:"PUT",headers:p,body:{first_name:l,last_name:c,salutation:d.toLowerCase()}}),(0,i.clientFetch)("/api/user/profile/email",{method:"PUT",headers:p,body:{email:u}})]);return(200===f.status&&((0,m.setCookie)("first_name",l,{expires:365}),(0,m.setCookie)("last_name",c,{expires:365}),(0,m.setCookie)("salutation",d.toLowerCase(),{expires:365})),200===h.status&&(0,m.setCookie)("email",u,{expires:365}),await k(),s&&(T("Signup",{phone_number:"",first_name:l.toLowerCase(),last_name:c.toLowerCase(),email_id:u.toLowerCase()}),I(s,{firstName:l.toLowerCase(),lastName:c.toLowerCase(),email:u.toLowerCase(),phone:n,plan:a.watch_plan??!1,cmsUser:a.cms_user??!1,planType:(a.plan_type??"").toLowerCase(),planName:(a.plan_name??"").toLowerCase(),currency:(a.currency??"").toLowerCase(),businessName:(a.business_name??"").toLowerCase(),countryCode:(P?.dial_code||"+91").toLowerCase()}),(0,_.webEngageLogin)(s,{firstName:l,lastName:c,phone:n})),C(),200!==h.status)?void g.push(`/${e}/noindex/settings?tab=edit&emailConflict=true`):void g.push(`/${e}`)}let l=a.first_name??"",c=a.last_name??"";if(!l||""===l||"User"===l||!c||""===c||"User"===c){F(!1),O("name");return}l&&(0,m.setCookie)("first_name",l,{expires:365}),c&&(0,m.setCookie)("last_name",c,{expires:365}),C(),g.push(`/${e}`)},[L,g,e,P,x,I,T,k]),{isOtpless:er,isVendorReady:ei,sendOtpViaOtpless:eo,verifyOtpViaOtpless:el}=(0,h.useOtplessAuth)({phone:x,dialCode:P?.dial_code||"+91",onTokenVerified:en,onError:e=>{B(e),F(!1)},onOtpScreen:()=>{O("otp"),F(!1)}});(0,t.useEffect)(()=>{"true"===S.get("regionRestricted")&&Z(!0)},[S]);let em=(0,t.useRef)(!1);(0,t.useEffect)(()=>{em.current||(em.current=!0,N("login"))},[N]),(0,t.useEffect)(()=>
2{if("phone"===E&&b.authenticated){let{first_name:a,last_name:t}=b.user;if(a&&"User"!==a&&t&&"User"!==t)return void g.push(`/${e}`);a&&"User"!==a&&t&&"User"!==t||O("name")}},[E,b.authenticated,b.user,e,g]),(0,t.useEffect)(()=>{!b.initialized||b.authenticated||sessionStorage.getItem(w.LOGIN_INTENT_KEY)||g.replace(`/${e}`)},[b.initialized,b.authenticated,e,g]),(0,t.useEffect)(()=>{(async()=>{try{let{data:e,status:a}=await (0,i.clientFetch)("/api/masters/country",{headers:(0,o.clientHeaders)()});if(200===a&&Array.isArray(e)){$(e.filter(e=>!e.blocked));let a=e.find(e=>e.country_code===y);a?R(a):e.length>0&&R(e.find(e=>"IN"===e.country_code)||e[0])}}catch{}})()},[y]);let ec=(0,t.useCallback)(async()=>{if(x&&ei){if(F(!0),B(""),er){await eo(),F(!1);return}try{let e,a=(0,o.clientHeaders)();try{e=JSON.parse(sessionStorage.getItem(w.SESSION_REGISTRATION_KEY)||"null")?.email}catch{}let t={mobile:x,country_code:P?.dial_code||"+91",...e&&{email:e}},{data:s,status:n}=await (0,i.clientFetch)("/api/auth/signin",{method:"POST",headers:a,body:t});200===n&&s?.valid?(z({channel:!1===s.is_mobile_otp?"email":"mobile",email:e}),G(s.retry_after||30),D(s.message||""),"otp"===E?(M(!0),setTimeout(()=>M(!1),100)):O("otp"),B("")):B(s?.message||s?.errorMain?.errorMsg||"Failed to send OTP. Please try again.")}catch{B("Something went wrong. Please try again.")}finally{F(!1)}}},[x,P,E,er,eo,ei]),eu=(0,t.useCallback)(async()=>{if(x&&ei){if((0,m.getCookie)(w.BOT_BLOCKED_COOKIE))return void B(`Login is temporarily blocked. Please try again after ${(0,w.getBotBlockRemainingTime)()}.`);if(P?.blocked)return void B("We are not available in your region yet.");F(!0),B("");try{let e={cc:P?.dial_code||"+91",mobile:x},{userExists:a}=await (0,w.signupGuardCheck)(e);a?(sessionStorage.removeItem(w.SESSION_REGISTRATION_KEY),F(!1),await ec()):(ea(0),O("register"),F(!1))}catch{B("Something went wrong. Please try again."),F(!1)}}},[x,P,ei,ec]),e_=(0,t.useCallback)(async e=>{let{fname:a,lname:t,email:s,salutation:n}=e,r={fname:"",lname:"",email:""},i=!0;if(a.trim()?/\s/.test(a)&&(r.fname="First name cannot contain spaces",i=!1):(r.fname="Please enter your first name",i=!1),t.trim()?/\s/.test(t)&&(r.lname="Last name cannot contain spaces",i=!1):(r.lname="Please enter your last name",i=!1),s.trim()?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(s)||(r.email="Please enter a valid email address",i=!1):(r.email="Please enter your email",i=!1),Q(r),i){F(!0),B(""),sessionStorage.setItem(w.SESSION_REGISTRATION_KEY,JSON.stringify({fname:a,lname:t,email:s,salutation:n}));try{let e={cc:P?.dial_code||"+91",mobile:x,first_name:a,last_name:t,email:s},{isBot:n}=await (0,w.signupGuardCheck)(e);if(n){sessionStorage.removeItem(w.SESSION_REGISTRATION_KEY);let e=ee+1;ea(e),e>=3&&(0,m.setCookie)(w.BOT_BLOCKED_COOKIE,String(Date.now()+w.BOT_BLOCK_DURATION_MS),{expires:1}),es(!0),F(!1)}else F(!1),await ec()}catch{B("Something went wrong. Please try again."),F(!1)}}},[x,P,ee,ec]),ed=(0,t.useCallback)(async a=>{if(a.length<6)return void B("Please enter the 6-digit OTP");if(F(!0),B(""),er){await el(a),F(!1);return}try{let t=(0,o.clientHeaders)(),s="email"===J.channel,n=`${P?.dial_code||"+91"}${x}`,r=s?{email:J.email,mobile:n,otp:a}:{mobile:n,otp:a},{data:u,status:d}=await (0,i.clientFetch)(s?"/api/auth/verify/email":"/api/auth/verify/mobile",{method:"POST",headers:t,body:r});if(200===d&&u?.data?.verified){(0,m.setTokens)(u.data);let a="";try{let e=(0,o.clientHeaders)({accessToken:u.data.access_token}),{data:t,status:s}=await (0,i.clientFetch)("/api/user/profile",{headers:e});200===s&&t&&(t.email&&((0,m.setCookie)("email",t.email,{expires:365}),a=t.email),t.mobile&&(0,m.setCookie)("mobile",t.mobile,{expires:365}),t.first_name&&(0,m.setCookie)("first_name",t.first_name,{expires:365}),t.last_name&&(0,m.setCookie)("last_name",t.last_name,{expires:365}),t.salutation&&(0,m.setCookie)("salutation",t.salutation,{expires:365}),(0,m.setCookie)("profile_complete","true",{expires:365}),L(e=>({...e,user:{...e.user,first_name:t.first_name||e.user.first_name,last_name:t.last_name||e.user.last_name,email:t.email||"",salutation:t.salutation||"",phone_number:t.mobile||""}})))}catch(e){(0,l.logError)("Profile enrichment failed",e,{tags:{feature:"auth",context:"profile-enrich"}})}let t=(0,c.getTokenPayload)(u.data.access_token);L(e=>({...e,authenticated:!0,accessToken:u.data.access_token,business_id:t?.business_id??"",business_name:t?.business_name??"",user_id:t?.userId??t?.user_id??"",currency:t?.currency??"",country_code:t?.country_code??"",watch_plan:t?.watch_plan??!1,plan_name:t?.plan_name??"",plan_type:t?.plan_type??"",watch_plan_sku:t?.watch_plan_sku??"",cms_user:t?.cms_user??!1,cms_role:t?.cms_role??"",user:{...e.user,first_name:t?.first_name??"",last_name:t?.last_name??""}})),(0,m.removeCookie)("watch"),(0,m.removeCookie)("book");let s=t?.userId??t?.user_id??"";if(s){let e={firstName:t?.first_name?.toLowerCase(),lastName:t?.last_name?.toLowerCase(),email:a.toLowerCase()||void 0,plan:t?.watch_plan??!1,cmsUser:t?.cms_user??!1,planType:t?.plan_type?.toLowerCase(),planName:t?.plan_name?.toLowerCase(),currency:t?.currency?.toLowerCase(),businessName:t?.business_name?.toLowerCase(),countryCode:(P?.dial_code||"+91").toLowerCase(),phone:n};I(s,e),T("Login",{first_name:(t?.first_name??"").toLowerCase(),last_name:(t?.last_name??"").toLowerCase(),phone_number:n}),(0,_.webEngageLogin)(s,{firstName:t?.first_name,lastName:t?.last_name,phone:n})}let r=sessionStorage.getItem(w.SESSION_REGISTRATION_KEY);if(r){let{fname:a,lname:l,email:c,salutation:d}=JSON.parse(r);sessionStorage.removeItem(w.SESSION_REGISTRATION_KEY);let p=(0,o.clientHeaders)({accessToken:u.data.access_token,businessId:t?.business_id??"",currency:t?.currency??""}),[f,h]=await Promise.all([(0,i.clientFetch)("/api/user/profile/name",{method:"PUT",headers:p,body:{f
2irst_name:a,last_name:l,salutation:d.toLowerCase()}}),(0,i.clientFetch)("/api/user/profile/email",{method:"PUT",headers:p,body:{email:c}})]);if(200===f.status&&((0,m.setCookie)("first_name",a,{expires:365}),(0,m.setCookie)("last_name",l,{expires:365}),(0,m.setCookie)("salutation",d.toLowerCase(),{expires:365})),200===h.status&&(0,m.setCookie)("email",c,{expires:365}),await k(),s){let e={firstName:a.toLowerCase(),lastName:l.toLowerCase(),email:c.toLowerCase(),phone:n,plan:t?.watch_plan??!1,cmsUser:t?.cms_user??!1,planType:t?.plan_type?.toLowerCase(),planName:t?.plan_name?.toLowerCase(),currency:t?.currency?.toLowerCase(),businessName:t?.business_name?.toLowerCase(),countryCode:(P?.dial_code||"+91").toLowerCase()};T("Signup",{phone_number:"",first_name:a.toLowerCase(),last_name:l.toLowerCase(),email_id:c.toLowerCase()}),I(s,e),(0,_.webEngageLogin)(s,{firstName:a,lastName:l,phone:n})}if(C(),200!==h.status)return void g.push(`/${e}/noindex/settings?tab=edit&emailConflict=true`);g.push(`/${e}`);return}if(!t?.first_name||""===t.first_name||"User"===t.first_name||!t?.last_name||""===t.last_name||"User"===t.last_name){F(!1),O("name");return}t.first_name&&(0,m.setCookie)("first_name",t.first_name,{expires:365}),t.last_name&&(0,m.setCookie)("last_name",t.last_name,{expires:365}),C(),g.push(`/${e}`)}else 403===d?B("Invalid or incorrect OTP"):B(u?.data?"Invalid OTP":"Something went wrong")}catch{B("Something went wrong. Please try again.")}finally{F(!1)}},[x,P,J,L,g,e,I,T,k,er,el]),ep=(0,t.useCallback)(async a=>{let{fname:t,lname:s,email:n,salutation:r}=a,l={fname:"",lname:"",email:""},c=!0;if(t.trim()?/\s/.test(t)&&(l.fname="First name cannot contain spaces",c=!1):(l.fname="Please enter your first name",c=!1),s.trim()?/\s/.test(s)&&(l.lname="Last name cannot contain spaces",c=!1):(l.lname="Please enter your last name",c=!1),n.trim()?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(n)||(l.email="Please enter a valid email address",c=!1):(l.email="Please enter your email",c=!1),W(l),!c)return;F(!0);let u=`${P?.dial_code||"+91"}${x}`;try{let a=(0,o.clientHeaders)({accessToken:b.accessToken,businessId:b.business_id,currency:b.currency}),[l,c]=await Promise.all([(0,i.clientFetch)("/api/user/profile/name",{method:"PUT",headers:a,body:{f
2irst_name:t,last_name:s,salutation:r.toLowerCase()}}),(0,i.clientFetch)("/api/user/profile/email",{method:"PUT",headers:a,body:{email:n}})]);if(200===l.status&&200===c.status){if(L(e=>({...e,user:{...e.user,first_name:t,last_name:s,email:n,salutation:r.toLowerCase()}})),(0,m.setCookie)("first_name",t,{expires:365}),(0,m.setCookie)("last_name",s,{expires:365}),(0,m.setCookie)("email",n,{expires:365}),(0,m.setCookie)("salutation",r.toLowerCase(),{expires:365}),(0,m.setCookie)("mobile",x,{expires:365}),await k(),b.user_id){let e={firstName:t.toLowerCase(),lastName:s.toLowerCase(),email:n.toLowerCase(),phone:u,plan:b.watch_plan,cmsUser:b.cms_user,planType:b.plan_type?.toLowerCase(),planName:b.plan_name?.toLowerCase(),currency:b.currency?.toLowerCase(),businessName:b.business_name?.toLowerCase(),countryCode:(b.country_code||P?.dial_code||"+91").toLowerCase()};T("Signup",{phone_number:"",first_name:t.toLowerCase(),last_name:s.toLowerCase(),email_id:n.toLowerCase()}),I(b.user_id,e),(0,_.webEngageLogin)(b.user_id,{firstName:t,lastName:s,phone:u})}C(),g.push(`/${e}`)}else{let e=l.data?.errorMain?.errorMsg||l.data?.error||"Failed to update name",a=c.data?.errorMain?.errorMsg||c.data?.error||"Failed to update email";W({fname:200!==l.status?e:"",lname:"",email:200!==c.status?a:""})}}catch{W({fname:"",lname:"",email:"Something went wrong"})}finally{F(!1)}},[b.accessToken,b.business_id,b.currency,b.user_id,b.watch_plan,b.cms_user,b.plan_type,b.plan_name,b.country_code,b.business_name,L,k,g,e,P,x,I,T]),ef=`${P?.dial_code||"+91"} ${x}`;return(0,a.jsxs)("div",{className:"flex min-h-[calc(100vh-64px)] w-full justify-center overflow-y-auto md:items-center",children:[X&&(0,a.jsx)(u.AlertBox,{message:"Travelxp isn't available in your region yet.",onAlertBoxClick:()=>{Z(!1);let e=new URL(window.location.href);e.searchParams.delete("regionRestricted"),window.history.replaceState({},"",e)}}),et&&(0,a.jsx)(u.AlertBox,{heading:ee>=3?"Account Blocked":"Suspicious Details Detected",message:ee>=3?`Your details appear to be automated activity. You have been blocked for ${(0,w.getBotBlockRemainingTime)()}.`:`Your details look suspicious. Please enter valid information. You have ${3-ee} chance${3-ee==1?"":"s"} remaining.`,onAlertBoxClick:()=>{es(!1),ee>=3&&O("phone")}}),"phone"===E&&(0,a.jsx)(d.PhoneStep,{phone:x,setPhone:v,countryItem:P,countries:U,onSelectCountry:R,screenName:"login",error:A,setError:B,loading:K,onSubmit:eu}),"register"===E&&(0,a.jsx)(f.NameStep,{loading:K,errors:q,generalError:A,onSubmit:e_,screenName:"login",onBack:()=>{O("phone"),B("")}}),"otp"===E&&(0,a.jsx)(p.OtpStep,{mobileDisplay:ef,retryAfter:Y,message:j,error:A,loading:K,resendSuccess:H,onVerify:ed,onResend:ec,onChangeNumber:()=>{O("phone"),B("")},screenName:"login",channel:"phone"}),"name"===E&&(0,a.jsx)(f.NameStep,{loading:K,errors:V,onSubmit:ep,onBack:()=>{O("phone"),B("")}})]})}e.s(["default",()=>y])}]);
3
4//# debugId=6d5304f4-2b0f-2d12-d164-ce079173f671

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.