1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4859],{25631:(e,t,a)=>{Promise.resolve().then(a.bind(a,45064))},41754:(e,t,a)=>{"use strict";a.d(t,{D:()=>u,ThemeProvider:()=>d});var r=a(95155),s=a(12115);let n="surexend_color_mode",l={primary:"#D4A017",light:"#FFD700",dark:"#A07810",glow:"#FFE066",glowRgb:"212, 160, 23",accent:"#C8960C",iconBorder:"rgba(212, 160, 23, 0.4)",gradientBg:"radial-gradient(ellipse at center, #E8B820 0%, #C49015 40%, #A07810 100%)",heroRadial:"radial-gradient(ellipse 80% 60% at 50% -10%, rgba(212,160,23,0.25), transparent)",cardBorder:"rgba(212, 160, 23, 0.2)",shadowGlow:"0 0 40px rgba(212,160,23,0.5), 0 0 80px rgba(212,160,23,0.2)",shadowGlowSm:"0 0 20px rgba(212,160,23,0.6)",particleColor:"#FFD700",shimmerColor:"rgba(255, 215, 0, 0.3)"},i={primary:"#B5E23D",light:"#D4FF4A",dark:"#8AB52A",glow:"#CAFF3A",glowRgb:"181, 226, 61",accent:"#FFFFFF",iconBorder:"rgba(181, 226, 61, 0.4)",gradientBg:"radial-gradient(ellipse at center, #C8F050 0%, #B0D830 40%, #90B820 100%)",heroRadial:"radial-gradient(ellipse 80% 60% at 50% -10%, rgba(181,226,61,0.25), transparent)",cardBorder:"rgba(181, 226, 61, 0.2)",shadowGlow:"0 0 40px rgba(181,226,61,0.5), 0 0 80px rgba(181,226,61,0.2)",shadowGlowSm:"0 0 20px rgba(181,226,61,0.6)",particleColor:"#D4FF4A",shimmerColor:"rgba(212, 255, 74, 0.3)"},o=(0,s.createContext)({variant:"gold",colorMode:"dark",colorPreference:"system",setColorPreference:()=>void 0,toggleColorMode:()=>void 0,colors:l});function c(e){return"light"===e||"dark"===e?e:window.matchMedia("(prefers-color-scheme: light)").matches?"light":"dark"}function d(e){let{children:t}
1=e,[a]=(0,s.useState)(()=>"gold"),[d,u]=(0,s.useState)("system"),[m,h]=(0,s.useState)("dark"),g=(0,s.useCallback)(e=>{u(e),h(c(e));try{localStorage.setItem(n,e)}catch(e){}},[]),p=(0,s.useCallback)(()=>{g("dark"===m?"light":"dark")},[m,g]);(0,s.useEffect)(()=>{let e=function(){try{let e=localStorage.getItem(n);if("light"===e||"dark"===e||"system"===e)return e}catch(e){}return"system"}();u(e),h(c(e))},[]),(0,s.useEffect)(()=>{let e=window.matchMedia("(prefers-color-scheme: light)"),t=()=>{"system"===d&&h(e.matches?"light":"dark")};return e.addEventListener("change",t),()=>e.removeEventListener("change",t)},[d]),(0,s.useEffect)(()=>{document.documentElement.dataset.colorMode=m,document.documentElement.style.colorScheme=m},[m]);let x="lemon"===a?i:l,f=(0,s.useMemo)(()=>({variant:a,colorMode:m,colorPreference:d,setColorPreference:g,toggleColorMode:p,colors:x}),[a,m,d,g,p,x]);return(0,r.jsx)(o.Provider,{value:f,children:(0,r.jsx)("div",{"data-variant":a,children:t})})}let u=()=>s.useContext(o)},45064:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>A});var r=a(95155),s=a(12115),n=a(40809),l=a(22544),i=a(66942),o=a(54879),c=a(20063),d=a(52619),u=a.n(d),m=a(76489),h=a(55867),g=a(23664),p=a(99708),x=a(70532),f=a(57828),y=a(22663),b=a(90960),w=a(41754),v=a(60872);let j=o.Ik({email:o.Yj().email("Invalid email address"),password:o.Yj().min(6,"Password must be at least 6 characters")});function N(){let{variant:e,colors:t}=(0,w.D)(),a=(0,c.useRouter)(),o=(0,c.useSearchParams)(),[d,N]=(0,s.useState)(!1),[A,k]=(0,s.useState)(!1),[C,S]=(0,s.useState)(!1),[B,F]=(0,s.use
1State)(null),[E,D]=(0,s.useState)(""),[R,P]=(0,s.useState)(!1),[M,z]=(0,s.useState)(""),[L,I]=(0,s.useState)(!1),[O,T]=(0,s.useState)(""),[_,q]=(0,s.useState)(!1),[G,Y]=(0,s.useState)(0),H=o.get("next"),W=H&&/^\/(app|admin)(?:\/|$)/.test(H)?H:"/app/dashboard";(0,s.useEffect)(()=>{let e=o.get("error");e&&y.Ay.error(e)},[o]),(0,s.useEffect)(()=>{b.R2.googleConfig().then(e=>S(!!(null==e?void 0:e.enabled))).catch(()=>{})},[]),(0,s.useEffect)(()=>{if(G<=0)return;let e=setTimeout(()=>Y(G-1),1e3);return()=>clearTimeout(e)},[G]);let{register:J,handleSubmit:X,formState:{errors:U}}=(0,l.mN)({resolver:(0,i.u)(j)}),V=async e=>{var t,a,r,s;k(!0);try{let r=await b.R2.login(e);if((null==(t=r.data)?void 0:t.requires2FA)&&(null==(a=r.data)?void 0:a.challengeToken)){F(r.data.challengeToken),D(""),y.Ay.success("Enter your authenticator code to finish signing in");return}y.Ay.success("Login successful!"),window.location.href=W}catch(e){y.Ay.error((null==(s=e.response)||null==(r=s.data)?void 0:r.message)||"Login failed. Please check your credentials.")}finally{k(!1)}},Z=async()=>{if(!M)return y.Ay.error("Enter your email address");q(!0);try{await b.R2.requestLoginOtp(M),I(!0),Y(60),y.Ay.success("One-time code sent to your email")}catch(a){var e,t;y.Ay.error((null==(t=a.response)||null==(e=t.data)?void 0:e.message)||"Could not send code")}finally{q(!1)}},$=async()=>{var e,t,a,r;if(!O||6!==O.length)return y.Ay.error("Enter the 6-digit code");q(!0);try{let a=await b.R2.verifyLoginOtp({email:M,code:O});if((null==(e=a.data)?void 0:e.requires2FA)&&(null==(t=a.data)?void 0:t.challengeToken)){F(a.data.challengeToken),D(""),y.Ay.success("Enter your authenticator code to finish signing in");return}y.Ay.success("Login successful!"),window.location.href=W}catch(e){y.Ay.error((null==(r=e.response)||null==(a=r.data)?void 0:a.message)||"Invalid code")}finally{q(!1)}},K=async()=>{if(!B)return y.Ay.error("Start sign-in again to request a new 2FA challenge");if(6!==E.length)return y.Ay.error("Enter the 6-digit authenticator code");k(!0);try{await b.R2.verify2FALogin({challengeToken:B,code:E}),y.Ay.success("2FA verified. Welcome back!"),window.location.href=W}catch(a){var e,t;y.Ay.error((null==(t=a.response)||null==(e=t.data)?void 0:e.message)||"Could not verify that code")}finally{k(!1)}},Q=async()=>{try{let e=await b.R2.googleUrl();window.location.href=e}catch(a){var e,t;y.Ay.error((null==(t=a.response)||null==(e=t.data)?void 0:e.message)||"Google sign-in is not configured yet")}},[ee,et]=(0,s.useState)(!1),ea=(0,s.useRef)(!1);(0,s.useRef)(a).current=a;let er=async()=>{if(!ea.current)try{if(!await (0,v.ZF)().catch(()=>!1)||ea.current)return;let{options:a,challengeId:r}=await b.lY.loginBegin();if(ea.current)return;let s=await (0,v.HS)({optionsJSON:a,useBrowserAutofill:!0});if(ea.current)return;try{await b.lY.loginComplete(r,s)}catch(a){var e,t;y.Ay.error((null==a||null==(t=a.response)||null==(e=t.data)?void 0:e.message)||"Biometric sign-in expired â please try again."),er();return}ea.current=!0,y.Ay.success("Login successful!"),window.location.href=W}catch(e){}};(0,s.useEffect)(()=>(ea.current=!1,er(),()=>{ea.current=!0}),[]);let es=async()=>{et(!0);try{let{options:e,challengeId:t}=await b.lY.loginBegin(),a=await (0,v.HS)({optionsJSON:e});await b.lY.loginComplete(t,a),ea.current=!0,y.Ay.success("Login successful!"),window.location.href=W}catch(n){var e,t,a;let r=(null==n||null==(e=n.cause)?void 0:e.message)||(null==n?void 0:n.message)||"",s=(null==n?void 0:n.name)==="NotAllowedError"&&/cancel/i.test(r);y.Ay.error((null==n||null==(a=n.response)||null==(t=a.data)?void 0:t.message)||(s?"Biometric sign-in cancelled":r||"Biometric sign-in failed"))}finally{et(!1),er()}};return(0,r.jsxs)("div",{className:"min-h-screen flex items-center justify-center p-4 relative overflow-hidden",style:{background:"var(--app-bg)"},children:[(0,r.jsx)("div",{className:"absolute w-96 h-96 rounded-full pointer-events-none opacity-20",style:{background:"radial-gradient(circle, ".concat(t.glow,", transparent 70%)"),top:"-10%",left:"-10%"}}),(0,r.jsx)("div",{className:"absolute w-80 h-80 rounded-full pointer-events-none opacity-[0.12]",style:{background:"radial-gradient(circle, ".concat(t.glow,", transparent 70%)"),bottom:"-8%",right:"-6%"}}),(0,r.jsxs)(n.P.div,{initial:{opacity:0,y:30}
1,animate:{opacity:1,y:0},transition:{duration:.6,ease:[.22,1,.36,1]},className:"w-full max-w-md p-8 liquid-glass relative z-10 overflow-hidden rounded-3xl border border-white/10",children:[(0,r.jsx)("div",{className:"absolute inset-x-0 top-0 h-[2px] pointer-events-none",style:{background:"linear-gradient(90deg, transparent, ".concat(t.primary,", transparent)")}}),(0,r.jsxs)("div",{className:"text-center mb-8",children:[(0,r.jsx)("div",{className:"w-16 h-16 mx-auto mb-4 flex items-center justify-center",children:(0,r.jsx)("img",{src:"gold"===e?"/logo-mark-gold.png":"/logo-mark-plain.png",alt:"SureXend",className:"w-14 h-14 object-contain ".concat("gold"===e?"gold-logo-glow":"lemon-logo-glow")})}),(0,r.jsx)("h1",{className:"text-3xl font-bold text-white mb-2",children:"Welcome Back"}),(0,r.jsx)("p",{className:"text-[#94A3B8]",children:"Sign in to access your SureXend wallet"})]}),C&&(0,r.jsxs)("button",{type:"button",onClick:Q,className:"w-full mb-6 py-3.5 rounded-xl bg-white text-[#020203] font-bold text-sm flex items-center justify-center gap-3 hover:bg-gray-100 transition-colors shadow-lg shadow-black/20",children:[(0,r.jsxs)("svg",{className:"w-5 h-5 flex-shrink-0",viewBox:"0 0 48 48",children:[(0,r.jsx)("path",{fill:"#EA4335",d:"M24 9.5c3.54 0 6.71 1.22 9.21 3.6l6.85-6.85C35.9 2.38 30.47 0 24 0 14.62 0 6.51 5.38 2.56 13.22l7.98 6.19C12.43 13.72 17.74 9.5 24 9.5z"}),(0,r.jsx)("path",{fill:"#4285F4",d:"M46.98 24.55c0-1.57-.15-3.09-.38-4.55H24v9.02h12.94c-.58 2.96-2.26 5.48-4.78 7.18l7.73 6c4.51-4.18 7.09-10.36 7.09-17.65z"}),(0,r.jsx)("path",{fill:"#FBBC05",d:"M10.53 28.59c-.48-1.45-.76-2.99-.76-4.59s.27-3.14.76-4.59l-7.98-6.19C.92 16.46 0 20.12 0 24c0 3.88.92 7.54 2.56 10.78l7.97-6.19z"}),(0,r.jsx)("path",{fill:"#34A853",d:"M24 48c6.48 0 11.93-2.13 15.89-5.81l-7.73-6c-2.15 1.45-4.92 2.3-8.16 2.3-6.26 0-11.57-4.22-13.47-9.91l-7.98 6.19C6.51 42.62 14.62 48 24 48z"})]}),"Continue with Google"]}),C&&(0,r.jsxs)("div",{className:"mb-6 flex items-center gap-4",children:[(0,r.jsx)("div",{className:"flex-1 h-px bg-[rgba(255,255,255,0.1)]"}),(0,r.jsx)("span",{className:"text-sm text-[#64748B]",children:"or continue with email"}),(0,r.jsx)("div",{className:"flex-1 h-px bg-[rgba(255,255,255,0.1)]"})]}),(0,r.jsxs)("button",{type:"button",onClick:es,disabled:ee,className:"w-full mb-6 py-3.5 rounded-xl border border-white/10 bg-white/[0.03] text-white font-semibold text-sm flex items-center justify-center gap-2.5 hover:bg-white/[0.07] transition-colors disabled:opacity-60",children:[(0,r.jsx)(m.A,{className:"w-5 h-5",style:{color:t.primary}}),ee?"Checking your biometricâ¦":"Sign in with Face ID or fingerprint"]}),B?(0,r.jsxs)("div",{className:"space-y-5",children:[(0,r.jsxs)("div",{className:"rounded-2xl border border-emerald-500/20 bg-emerald-500/10 p-4",children:[(0,r.jsx)("p",{className:"text-sm font-semibold text-white",children:"Second factor required"}),(0,r.jsx)("p",{className:"text-xs text-[#C7F9D4] mt-1 leading-relaxed",children:"Open your authenticator app and enter the current 6-digit code to complete sign-in."})]}),(0,r.jsx)("div",{children:(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)(h.A,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-[#64748B] w-5 h-5 pointer-events-none z-10"}),(0,r.jsx)("input",{value:E,onChange:e=>D(e.target.value.replace(/\D/g,"").slice(0,6)),inputMode:"numeric",autoComplete:"one-time-code",placeholder:"6-digit authenticator code",className:"input-field input-field-".concat(e," input-has-icon-left text-center tracking-[0.4em]")})]})}),(0,r.jsx)("button",{type:"button",onClick:K,disabled:A||6!==E.length,className:"w-full py-4 rounded-xl text-center btn-".concat(e," flex justify-center items-center disabled:opacity-50"),children:A?(0,r.jsx)(n.P.div,{animate:{rotate:360},transition:{repeat:1/0,duration:1,ease:"linear"},className:"w-6 h-6 border-2 border-[#0D0D0D] border-t-transparent rounded-full"}):"Verify and Sign In"}),(0,r.jsx)("button",{type:"button",onClick:()=>{F(null),D("")},className:"w-full text-center text-sm text-[#94A3B8] hover:text-white transition-colors",children:"â Back to sign-in options"})]}):R?(0,r.jsxs)("div",{className:"space-y-5",children:[L?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("p",{className:"text-sm text-[#94A3B8] text-center",children:["We've sent a 6-digit code to ",(0,r.jsx)("span",{className:"text-white font-medium",children:M})]}),(0,r.jsx)("input",{value:O,onChange:e=>T(e.target.value.replace(/\D/g,"").slice(0,6)),inputMode:"numeric",placeholder:"6-digit code",className:"input-field input-field-".concat(e," text-center tracking-[0.5em]")}),(0,r.jsx)("button",{type:"button",onClick:$,disabled:_||6!==O.length,className:"w-full py-4 rounded-xl text-center btn-".concat(e," flex justify-center items-center disabled:opacity-50"),children:_?(0,r.jsx)(n.P.div,{animate:{rotate:360},transition:{repeat:1/0,duration:1,ease:"linear"},className:"w-6 h-6 border-2 border-[#0D0D0D] border-t-transparent roun
1ded-full"}):"Sign In"}),G>0?(0,r.jsxs)("p",{className:"text-center text-sm text-[#64748B]",children:["Resend code in ",G,"s"]}):(0,r.jsx)("button",{onClick:Z,className:"w-full text-center text-sm font-semibold hover:underline",style:{color:t.primary},children:"Resend Code"})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{children:(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)(g.A,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-[#64748B] w-5 h-5 pointer-events-none z-10"}),(0,r.jsx)("input",{value:M,onChange:e=>z(e.target.value),type:"email",autoComplete:"email webauthn",placeholder:"Email address",className:"input-field input-field-".concat(e," input-has-icon-left")})]})}),(0,r.jsx)("button",{type:"button",onClick:Z,disabled:_,className:"w-full py-4 rounded-xl text-center btn-".concat(e," flex justify-center items-center disabled:opacity-50"),children:_?(0,r.jsx)(n.P.div,{animate:{rotate:360},transition:{repeat:1/0,duration:1,ease:"linear"},className:"w-6 h-6 border-2 border-[#0D0D0D] border-t-transparent rounded-full"}):"Send One-Time Code"})]}),(0,r.jsx)("button",{type:"button",onClick:()=>{P(!1),I(!1),T("")},className:"w-full text-center text-sm text-[#94A3B8] hover:text-white transition-colors",children:"â Back to password login"})]}):(0,r.jsxs)("form",{onSubmit:X(V),className:"space-y-5",children:[(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)(g.A,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-[#64748B] w-5 h-5 pointer-events-none z-10"}),(0,r.jsx)("input",{...J("email"),type:"email",autoComplete:"email webauthn",placeholder:"Email address",className:"input-field input-field-".concat(e," input-has-icon-left")})]}),U.email&&(0,r.jsx)("p",{className:"text-[#EF4444] text-sm mt-1",children:U.email.message})]}),(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)(p.A,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-[#64748B] w-5 h-5 pointer-events-none z-10"}),(0,r.jsx)("input",{...J("password"),type:d?"text":"password",placeholder:"Password",className:"input-field input-field-".concat(e," input-has-icon-both")}),(0,r.jsx)("button",{type:"button",onClick:()=>N(!d),className:"absolute right-4 top-1/2 -translate-y-1/2 text-[#64748B] hover:text-white transition-colors z-10 p-1",children:d?(0,r.jsx)(x.A,{className:"w-5 h-5"}):(0,r.jsx)(f.A,{className:"w-5 h-5"})})]}),U.password&&(0,r.jsx)("p",{className:"text-[#EF4444] text-sm mt-1",children:U.password.message})]}),(0,r.jsxs)("div",{className:"flex justify-between items-center",children:[(0,r.jsxs)("button",{type:"button",onClick:()=>P(!0),className:"text-sm text-[#94A3B8] hover:text-white transition-colors flex items-center gap-1",style:{color:t.primary},children:[(0,r.jsx)(h.A,{className:"w-3.5 h-3.5"})," Sign in with a code"]}),(0,r.jsx)(u(),{href:"/auth/forgot-password",className:"text-sm text-[#94A3B8] hover:text-white transition-colors",style:{color:t.primary},children:"Forgot password?"})]}),(0,r.jsx)("button",{type:"submit",disabled:A,className:"w-full py-4 rounded-xl text-center btn-".concat(e," flex justify-center items-center"),children:A?(0,r.jsx)(n.P.div,{animate:{rotate:360},transition:{repeat:1/0,duration:1,ease:"linear"},className:"w-6 h-6 border-2 border-[#0D0D0D] border-t-transparent rounded-full"}):"Sign In"})]}),(0,r.jsxs)("p",{className:"mt-8 text-center text-[#94A3B8] text-sm",children:["Don't have an account?"," ",(0,r.jsx)(u(),{href:"/auth/register",style:{color:t.primary},className:"font-semibold hover:underline",children:"Sign up"})]})]})]})}function A(){return(0,r.jsx)(s.Suspense,{fallback:(0,r.jsx)("div",{className:"min-h-screen flex items-center justify-center bg-[#000000] text-white",children:(0,r.jsx)("div",{className:"w-8 h-8 border-2 border-white/20 border-t-white rounded-full animate-spin"})}),children:(0,r.jsx)(N,{})})}}},e=>{e.O(0,[2663,3949,809,2619,7692,6721,960,8441,1255,7358],()=>e(e.s=25631)),_N_E=e.O()}]);
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.