PageSourceSearch

https://www.upcar.ai/_next/static/chunks/49051-3610a394ffc56094.js

js upcar.ai collected 2026-10-05 15:26:02 UTC 8,165 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[49051],{59465:function(e,t,s){"use strict";var n=s(27573),o=s(7653),a=s(35662);t.Z=e=>{let{length:t=6,value:s,onChange:r,onComplete:l,onResend:i,resendCooldownSec:c=30,contactLabel:d,onChangeContact:u,error:m=null,headerText:f,showHeader:h=!0,resendText:x="Didn't Receive it? Resend OTP",verifyButtonLabel:g="Verify OTP",verifying:p=!1}=e,v=Array.from({length:t},(e,t)=>s[t]||""),[b,_]=(0,o.useState)(c),[y,j]=(0,o.useState)(!1),w=(0,o.useRef)([]);(0,o.useEffect)(()=>{var e;null===(e=w.current[0])||void 0===e||e.focus()},[]),(0,o.useEffect)(()=>{let e;return b>0&&!y?e=setInterval(()=>{_(e=>e-1)},1e3):0===b&&j(!0),()=>clearInterval(e)},[b,y]);let C=e=>{let s=e.join("");r(s),s.length===t&&e.every(e=>""!==e)&&l(s)},F=(e,s)=>{if(!/^\d?$/.test(s))return;let n=[...v];if(n[e]=s,C(n),s&&e<t-1){var o;null===(o=w.current[e+1])||void 0===o||o.focus()}},P=(e,s)=>{var n,o,a;if("Backspace"===s.key){if(v[e]){let t=[...v];t[e]="",C(t)}else e>0&&(null===(n=w.current[e-1])||void 0===n||n.focus())}else"ArrowLeft"===s.key&&e>0?null===(o=w.current[e-1])||void 0===o||o.focus():"ArrowRight"===s.key&&e<t-1&&(null===(a=w.current[e+1])||void 0===a||a.focus())},k=async()=>{if(i&&y)try{var e;await i(),_(c),j(!1),C(Array(t).fill("")),null===(e=w.current[0])||void 0===e||e.focus()}catch(e){}},N=v.join(""),B=p||N.length<t;return(0,n.jsxs)("div",{className:"w-full max-w-[500px]",children:[h&&(0,n.jsx)("h2",{className:"text-xl font-bold text-[#1F1F1F] mb-1",children:f||"Enter the OTP"}),d&&(0,n.jsxs)("p",{className:"text-sm text-[#1F1F1F] mb-1",children:["We have sent a ",t,"-Digit Verification Code to"," ",u?(0,n.jsxs)("button",{type:"button",onClick:u,className:"font-semibold text-[#172B4D] underline underline-offset-2 inline-flex items-center gap-1",children:[d,(0,n.jsxs)("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"#027BFF",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,n.jsx)("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),(0,n.jsx)("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"})]}),(0,n.jsx)("span",{className:"text-[#027BFF] no-underline font-semibold",children:"Change"})]}):(0,n.jsx)("span",{className:"font-semibold text-[#172B4D]",children:d})]}),(0,n.jsx)("div",{className:"flex justify-around my-5",onPaste:e=>{var s;e.preventDefault();let n=e.clipboardData.getData("text").replace(/\D/g,"").slice(0,t);if(!n)return;let o=Array(t).fill("");n.split("").forEach((e,t)=>{o[t]=e}),C(o);let a=Math.min(n.length,t-1);null===(s=w.current[a])||void 0===s||s.focus()},children:v.map((e,t)=>(0,n.jsx)("input",{id:"otp-".concat(t),ref:e=>{w.current[t]=e},type:"text",inputMode:"numeric",pattern:"[0-9]*",autoComplete:0===t?"one-time-code":"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,maxLength:1,"aria-label":"OTP digit ".concat(t+1),value:e,onChange:e=>F(t,e.target.value),onKeyDown:e=>P(t,e),className:(0,a.cn)("w-12 h-12 border border-[#E6E6E6] rounded-xl text-center text-lg font-medium","focus:outline-none input-focus-ring","transition-colors duration-200",m?"border-red-500":"")},t))}),m&&(0,n.jsxs)("div",{className:"flex items-center gap-2 text-red-500 text-sm mb-3",role:"alert",children:[(0,n.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"currentColor",children:(0,n.jsx)("path",{d:"M8 0C3.6 0 0 3.6 0 8s3.6 8 8 8 8-3.6 8-8-3.6-8-8-8zm1 12H7v-2h2v2zm0-4H7V4h2v4z"})}),(0,n.jsx)("span",{children:m.split(".")[0]+"."})]}),i&&(0,n.jsxs)("div",{className:"flex justify-between items-center mb-5",children:[(0,n.jsx)("button",{type:"button",onClick:k,disabled:!y,className:(0,a.cn)("text-sm font-medium transition-colors duration-200",y?"!text-[#1463FF] cursor-pointer":"text-gray-400 cursor-not-allowed"),children:x}),!y&&b>0&&(0,n.jsx)("span",{className:"text-sm font-medium !text-[#1463FF]",children:"".concat(String(Math.floor(b/60)).padStart(2,"0"),":").concat(String(b%60).padStart(2,"0"),"s")})]}),(0,n.jsx)("button",{className:"w-full h-11 rounded-[12px] text-sm font-semibold bg-[#027BFF] text-white hover:bg-[#0266D9] transition-colors disabled:!bg-[#DCDFE4] disabled:!text-[#B3B8C4] disabled:cursor-not-allowed",onClick:()=>l(N),disabled:B,children:p?"Verifying...":g})]})}},49051:function(e,t,s){"use strict";s.d(t,{Z:function(){return h}});var n=s(27573),o=s(7653),a=s(52919),r=s(79509),l=s(15378),i=s.n(l),c=s(73159),d=s(32205),u=s(7384),m=s(59465);function f(e){if(!e)return"";let[t,s]=e.split("@");if(!s)return e;let n=t.length<=1?t:"".concat(t[0],"***");return"".concat(n,"@").concat(s)}function h(e){let{isVisible:t,onClose:s,onLoginSuccess:l,deviceFingerprint:h}=e,[x,g]=(0,o.useState)(""),[p,v]=(0,o.useState)(""),[b,_]=(0,o.useState)(!1),[y,j]=(0,o.useState)(!1),[w,C]=(0,o.useState)(),[F,P]=(0,o.useState)(null),k=(0,u.I0)(),N=async e=>{e.preventDefault(),j(!0);try{let e=await (0,c.Q3)(x);e.success?(C(e.data.userId),a.toast.success(e.data.message),_(!0)):a.toast.error(e.message)}catch(e){console.error("Error sending OTP:",e),a.toast.error("Failed to send OTP. Please try again.")}finally{j(!1)}},B=async()=>{let e=await (0,c.Q3)(x);if(e.success)C(e.data.userId),P(null),v(""),a.toast.success("Code resent");else throw P(e.message||"Failed to resend code."),a.toast.error(e.message||"Failed to resend code."),Error(e.message||"Failed to resend code.")},T=async e=>{j(!0),P(null);try{let t=await (0,c.Mu)(w,e,h,"email");if(t.access_token){if(await (0,c.WX)(t.access_token,k))(0,d.uB)(t.access_token),localStorage.setItem("user",JSON.stringify(t.user)),a.toast.success("OTP Verified! Logging you in..."),l&&l(),setTimeout(()=>{S(),window.location.reload()},2e3);else throw Error("Token verification failed. Please try again.")}else P(t.message||"Invalid OTP."),a.toast.error(t.message||"Invalid OTP.")}catch(e){console.error("Error verifying OTP:",e),P("Failed to verify OTP. Please try again."),a.toast.error("Failed to verify OTP. Please try again.")}finally{j(!1)}},S=()=>{g(""),v(""),_(!1),C(null),j(!1),P(null),s()};return t?(0,n.jsx)(r.Z,{isVisible:t,onClose:S,children:(0,n.jsxs)("div",{className:i().modalContainer,children:[(0,n.jsx)("h1",{className:i().title,children:"Log in with email code"}),b?(0,n.jsxs)("div",{children:[(0,n.jsxs)("p",{className:i().confirmationText,children:["Code sent to ",(0,n.jsx)("strong",{children:f(x)})]}),(0,n.jsx)(m.Z,{length:6,value:p,onChange:e=>{v(e),P(null)},onComplete:T,onResend:B,onChangeContact:()=>{_(!1),P(null),v("")},contactLabel:f(x),error:F,showHeader:!1,verifyButtonLabel:"Verify OTP",verifying:y,resendText:"Didn't get the code? Resend"})]}):(0,n.jsxs)("form",{onSubmit:N,children:[(0,n.jsx)("label",{htmlFor:"email",className:i().label,children:"Enter your email"}),(0,n.jsx)("input",{id:"email",type:"email",className:i().input,placeholder:"Enter your email",value:x,onChange:e=>g(e.target.value)}),(0,n.jsx)("button",{type:"submit",className:i().submitButton,disabled:y,children:y?"Sending...":"Send Code"})]})]})}):null}},79509:function(e,t,s){"use strict";var n=s(27573),o=s(97273),a=s.n(o),r=s(5734);t.Z=e=>{let{isVisible:t,onClose:s,children:o,customClassName:l="",allowPageScroll:i=!1,maintainScrollPosition:c=!0}=e;return((0,r.Ni)(t&&!i,{restoreScroll:c}),t)?(0,n.jsx)("div",{className:a().modalBackdrop,onClick:e=>{e.target===e.currentTarget&&s&&s()},children:(0,n.jsxs)("div",{className:"".concat(a().modalContent," ").concat(l),onClick:e=>e.stopPropagation(),children:[s&&(0,n.jsx)("button",{onClick:s,className:a().closeButton,"aria-label":"Close",children:"\xd7"}),o]})}):null}},97273:function(e){e.exports={modalBackdrop:"Modal_modalBackdrop__F8uAK",modalContent:"Modal_modalContent__uOMcP",closeButton:"Modal_closeButton__Djgg8",customWidthModal:"Modal_customWidthModal__ghmvo"}},15378:function(e){e.exports={modalContainer:"ForgotPassword_modalContainer__Pa2dW",title:"ForgotPassword_title__5eTkS",subtitle:"ForgotPassword_subtitle__sKEBf",label:"ForgotPassword_label__L354I",input:"ForgotPassword_
1input__uqDsv",submitButton:"ForgotPassword_submitButton__HTr74",resendButton:"ForgotPassword_resendButton__r0JV7",confirmationText:"ForgotPassword_confirmationText__YWjR3"}}}]);

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.