1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[14859],{439:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});let a=(0,r(78340).A)("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]])},4474:(e,t,r)=>{"use strict";r.d(t,{$:()=>l,r:()=>o});var a=r(95155);r(12115);var s=r(42442),n=r(18460),i=r(91337);let o=(0,n.F)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function l({className:e,variant:t,size:r,asChild:n=!1,...l}){let d=n?s.DX:"button";return(0,a.jsx)(d,{"data-slot":"button",className:(0,i.cn)(o({variant:t,size:r,className:e})),...l})}},5772:(e,t,r)=>{"use strict";r.d(t,{default:()=>s.a});var a=r(97651),s=r.n(a)},7915:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});let a=(0,r(78340).A)("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},15411:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});let a=(0,r(78340).A)("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]])},18460:(e,t,r)=>{"use strict";r.d(t,{F:()=>i});var a=r(29722);let s=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,n=a.$,i=(e,t)=>r=>{var a;if((null==t?void 0:t.variants)==null)return n(e,null==r?void 0:r.class,null==r?void 0:r.className);let{variants:i,defaultVariants:o}=t,l=Object.keys(i).map(e=>{let t=null==r?void 0:r[e],a=null==o?void 0:o[e];if(null===t)return null;let n=s(t)||s(a);return i[e][n]}),d=r&&Object.entries(r).reduce((e,t)=>{let[r,a]=t;return void 0===a||(e[r]=a),e},{});return n(e,l,null==t||null==(a=t.compoundVariants)?void 0:a.reduce((e,t)=>{let{class:r,className:a,...s}=t;return Object.entries(s).every(e=>{let[t,r]=e;return Array.isArray(r)?r.includes({...o,...d}[t]):({...o,...d})[t]===r})?[...e,r,a]:e},[]),null==r?void 0:r.class,null==r?void 0:r.className)}},25237:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});let a=(0,r(78340).A)("Smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]])},25777:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});let a=(0,r(78340).A)("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]])},29486:(e,t,r)=>{"use strict";r.d(t,{b:()=>o});var a=r(12115),s=r(55897),n=r(95155),i=a.forwardRef((e,t)=>(0,n.jsx)(s.sG.label,{...e,ref:t,onMouseDown:t=>{t.target.closest("button, input, select, textarea")||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));i.displayName="Label";var o=i},38847:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>N});var a=r(95155);let s="/dashboard",n="https://return-to.invalid";function i(e){let t;if(!e||!e.startsWith("/"))return s;try{t=new URL(e,n)}catch{return s}if(t.origin!==n)return s;let r=`${t.pathname}${t.search}${t.hash}`;return!r.startsWith("/")||r.startsWith("//")?s:r}var o=r(4474),l=r(79984),d=r(39658),c=r(79792),u=r(98500),m=r.n(u),h=r(73321),p=r(12115),f=r(5772),x=r(92289),g=r(25237),v=r(15411),y=r(7915),b=r(25777),w=r(439);function j(){let e=(0,h.useSearchParams)(),t=i(e.get("returnTo")),r=null!==e.get("returnTo"),s=e=>r||"string"!=typeof e?t:i(e),n="success"===e.get("reset"),[u,j]=(0,p.useState)(""),[N,k]=(0,p.useState)(""),[S,P]=(0,p.useState)(""),[A,C]=(0,p.useState)(null),[E,O]=(0,p.useState)(!1),[T,$]=(0,p.useState)(!1),[_,z]=(0,p.useState)(!1),[R,L]=(0,p.useState)("totp"),[q,M]=(0,p.useState)(null),[I,V]=(0,p.useState)(null),[D,F]=(0,p.useState)(0),[W,J]=(0,p.useState)(null),[B,Z]=(0,p.useState)(null);(0,p.useEffect)(()=>{let e=window.location.hash;if(!e||!e.includes("error="))return;let t=new URLSearchParams(e.slice(1)),r=t.get("error_code"),a=t.get("error_description");"otp_expired"===r||a?.toLowerCase().includes("expired")?Z("Your password reset link has expired. Please request a new one."):a?Z(decodeURIComponent(a.replace(/\+/g," "))):Z("Something went wrong with your login link. Please try again."),window.history.replaceState(null,"",window.location.pathname+window.location.search)},[]);let U=async e=>{e.preventDefault(),O(!0),C(null);try{let e=await fetch("/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:u,password:N})}),t=await e.json();if(!e.ok)throw Error(t.error||"Invalid credentials");t.requires2FA?(z(!0),L("email"===t.method?"email":"totp"),M(t.userId),V(t.challengeToken),"email"===t.method&&(F(30),J(null)),k("")):window.location.href=s(t.home)}catch(t){let e=t instanceof Error?t.message:"Invalid credentials";C(e),fetch("/api/auth/record-login-failed",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:u,reason:e})}).catch(()=>{})}finally{O(!1)}};(0,p.useEffect)(()=>
1{if(D<=0)return;let e=setTimeout(()=>F(e=>e-1),1e3);return()=>clearTimeout(e)},[D]);let G=async()=>{if(I&&!(D>0)){J(null),C(null);try{let e=await fetch("/api/auth/resend-2fa-code",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({challengeToken:I})}),t=await e.json();if(!e.ok)throw Error(t.error||"Could not send code");F(30),J("A new code has been sent to your email.")}catch(e){C(e instanceof Error?e.message:"Could not send code")}}},X=async e=>{if(e.preventDefault(),q&&I){O(!0),C(null);try{let e=await fetch("/api/auth/verify-2fa",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:q,token:S,challengeToken:I})}),t=await e.json();if(!e.ok)throw Error(t.error||"Invalid verification code");window.location.href=s(t.home)}catch(e){C(e instanceof Error?e.message:"Verification failed")}finally{O(!1)}}};return(0,a.jsx)("div",{className:"flex min-h-svh w-full items-center justify-center bg-background p-6 md:p-10",children:(0,a.jsx)("div",{className:"w-full max-w-sm",children:(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsxs)("div",{className:"flex flex-col items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"relative h-16 w-16 flex-shrink-0",children:(0,a.jsx)(f.default,{src:"/images/super-processor-logo.jpg",alt:"Super Processor",fill:!0,sizes:"64px",quality:95,className:"object-contain rounded-2xl",priority:!0})}),(0,a.jsxs)("div",{className:"text-center",children:[(0,a.jsx)("h1",{className:"text-xl font-bold",children:"The Vault"}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:"by Super Processor"})]})]}),(0,a.jsxs)(l.Zp,{className:"border-border/50 shadow-xl",children:[(0,a.jsxs)(l.aR,{className:"text-center pb-4",children:[(0,a.jsx)(l.ZB,{className:"text-xl",children:_?"Two-Factor Authentication":"Welcome Back"}),(0,a.jsx)(l.BT,{children:_?"email"===R?"We just emailed you a 6-digit code.":"Enter the code from your authenticator app":"Sign in to access your merchant portal"})]}),(0,a.jsx)(l.Wu,{children:_?(0,a.jsx)("form",{onSubmit:X,children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)("div",{className:"flex justify-center pb-2",children:(0,a.jsx)("div",{className:"flex h-12 w-12 items-center justify-center rounded-full bg-primary/10",children:"email"===R?(0,a.jsx)(x.A,{className:"h-6 w-6 text-primary"}):(0,a.jsx)(g.A,{className:"h-6 w-6 text-primary"})})}),(0,a.jsxs)("div",{className:"grid gap-2",children:[(0,a.jsx)(c.J,{htmlFor:"totp",children:"Verification Code"}),(0,a.jsx)(d.p,{id:"totp",type:"text",maxLength:12,placeholder:"000000 or backup code",required:!0,value:S,onChange:e=>P(e.target.value.toUpperCase().replace(/[^A-Z0-9]/g,"")),className:"bg-secondary/50 text-center text-2xl tracking-widest font-mono",autoFocus:!0,"aria-label":"Enter 6-digit code or 8-character backup code"}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground text-center",children:"email"===R?`Enter the 6-digit code sent to ${u} (or an 8-character backup code)`:"Enter 6-digit TOTP or 8-character backup code"})]}),W&&(0,a.jsx)("p",{className:"text-sm text-primary bg-primary/10 px-3 py-2 rounded-md",children:W}),A&&(0,a.jsx)("p",{className:"text-sm text-destructive bg-destructive/10 px-3 py-2 rounded-md",children:A}),(0,a.jsx)(o.$,{type:"submit",className:"w-full",disabled:E||S.length<6||7===S.length,children:E?"Verifying...":"Verify"}),"email"===R&&(0,a.jsx)(o.$,{type:"button",variant:"ghost",size:"sm",className:"w-full",onClick:G,disabled:D>0,children:D>0?`Resend code in ${D}s`:"Didn't get it? Resend code"}),(0,a.jsx)(o.$,{type:"button",variant:"ghost",className:"w-full",onClick:()=>{z(!1),P(""),M(null),V(null),F(0),J(null)},children:"Back to Login"})]})}):(0,a.jsxs)("form",{onSubmit:U,children:[(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[B&&(0,a.jsxs)("div",{role:"alert",className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:[(0,a.jsx)("p",{children:B}),(0,a.jsx)(m(),{href:"/auth/forgot-password",className:"mt-1 block font-medium underline underline-offset-2 hover:no-underline",children:"Request a new reset link"})]}),n&&(0,a.jsx)("p",{role:"status",className:"rounded-md bg-primary/10 px-3 py-2 text-sm text-primary",children:"Your password was updated. Please sign in with your new password."}),(0,a.jsxs)("div",{className:"grid gap-2",children:[(0,a.jsx)(c.J,{htmlFor:"email",children:"Email"}),(0,a.jsx)(d.p,{id:"email",type:"email",placeholder:"[email protected]",required:!0,value:u,onChange:e=>j(e.target.value),className:"bg-secondary/50",autoComplete:"email","aria-label":"Enter your email address","aria-required":"true"})]}),(0,a.jsxs)("div",{className:"grid gap-2",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)(c.J,{htmlFor:"password",children:"Password"}),(0,a.jsx)(m(),{href:"/auth/forgot-password",className:"text-xs text-muted-foreground underline-offset-4 hover:text-primary hover:underline",children:"Forgot password?"})]}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)(d.p,{id:"password",type:T?"text":"password",required:!0,value:N,onChange:e=>k(e.target.value),className:"bg-secondary/50 pr-10",autoComplete:"current-password","aria-label":"Enter your password","aria-required":"true"}),(0,a.jsx)("button",{type:"button",onClick:()=>$(!T),className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2 rounded-sm p-0.5","aria-label":T?"Hide password":"Show password",children:T?(0,a.jsx)(v.A,{className:"h-4 w-4"}):(0,a.jsx)(y.A,{className:"h-4 w-4"})})]})]}),A&&(0,a.jsx)("p",{className:"text-sm text-destructive bg-destructive/10 px-3 py-2 rounded-md",children:A}),(0,a.jsx)(o.$,{type:"submit",className:"w-full",disabled:E,children:E?"Signing in...":"Sign In"})]}),(0,a.jsxs)("div",{className:"mt-4 text-center text-sm text-muted-foreground",children:["Don't have an account?"," ",(0,a.jsx)(m(),{href:"/auth/sign-up",className:"text-primary hover:underline underline-offset-4",children:"Request access"})]})]})})]}),(0,a.jsxs)("div",{className:"flex items-center justify-center gap-4 text-xs text-muted-foreground",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)(b.A,{className:"h-3 w-3"}),(0,a.jsx)("span",{children:"256-bit encryption"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)(w.A,{className:"h-3 w-3"}),(0,a.jsx)("span",{children:"SOC 2 Compliant"})]})]}),(0,a.jsxs)("p",{className:"text-center text-xs text-muted-foreground",children:["Powered by ",(0,a.jsx)("span",{className:"font-medium",children:"Super Processor, Inc."})]})]})})})}function N(){return(0,a.jsx)(p.Suspense,{fallback:null,children:(0,a.jsx)(j,{})})}},39658:(e,t,r)=>{"use strict";r.d(t,{p:()=>n});var a=r(95155);r(12115);var s=r(91337);function n({className:e,type:t,...r}){return(0,a.jsx)("input",{type:t,"data-slot":"input",className:(0,s.cn)("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...r})}},41904:(e,t,r)=>{Promise.resolve().then(r.bind(r,38847))},55897:(e,t,r)=>{"use strict";r.d(t,{hO:()=>l,sG:()=>o});var a=r(12115),s=r(47650),n=r(42442),i=r(95155),o=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce((e,t)=>
1{let r=a.forwardRef((e,r)=>{let{asChild:a,...s}=e,o=a?n.DX:t;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,i.jsx)(o,{...s,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function l(e,t){e&&s.flushSync(()=>e.dispatchEvent(t))}},73321:(e,t,r)=>{"use strict";var a=r(74645);r.o(a,"useParams")&&r.d(t,{useParams:function(){return a.useParams}}),r.o(a,"usePathname")&&r.d(t,{usePathname:function(){return a.usePathname}}),r.o(a,"useRouter")&&r.d(t,{useRouter:function(){return a.useRouter}}),r.o(a,"useSearchParams")&&r.d(t,{useSearchParams:function(){return a.useSearchParams}})},78340:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var a=r(12115);let s=(...e)=>e.filter((e,t,r)=>!!e&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim();var n={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let i=(0,a.forwardRef)(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:i,className:o="",children:l,iconNode:d,...c},u)=>(0,a.createElement)("svg",{ref:u,...n,width:t,height:t,stroke:e,strokeWidth:i?24*Number(r)/Number(t):r,className:s("lucide",o),...c},[...d.map(([e,t])=>(0,a.createElement)(e,t)),...Array.isArray(l)?l:[l]])),o=(e,t)=>{let r=(0,a.forwardRef)(({className:r,...n},o)=>(0,a.createElement)(i,{ref:o,iconNode:t,className:s(`lucide-${e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,r),...n}));return r.displayName=`${e}`,r}},79792:(e,t,r)=>{"use strict";r.d(t,{J:()=>i});var a=r(95155);r(12115);var s=r(29486),n=r(91337);function i({className:e,...t}){return(0,a.jsx)(s.b,{"data-slot":"label",className:(0,n.cn)("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}},79984:(e,t,r)=>{"use strict";r.d(t,{BT:()=>l,Wu:()=>d,ZB:()=>o,Zp:()=>n,aR:()=>i,wL:()=>c});var a=r(95155);r(12115);var s=r(91337);function n({className:e,...t}){return(0,a.jsx)("div",{"data-slot":"card",className:(0,s.cn)("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm","min-w-0",e),...t})}function i({className:e,...t}){return(0,a.jsx)("div",{"data-slot":"card-header",className:(0,s.cn)("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...t})}function o({className:e,...t}){return(0,a.jsx)("div",{"data-slot":"card-title",className:(0,s.cn)("leading-none font-semibold",e),...t})}function l({className:e,...t}){return(0,a.jsx)("div",{"data-slot":"card-description",className:(0,s.cn)("text-muted-foreground text-sm",e),...t})}function d({className:e,...t}){return(0,a.jsx)("div",{"data-slot":"card-content",className:(0,s.cn)("px-6",e),...t})}function c({className:e,...t}){return(0,a.jsx)("div",{"data-slot":"card-footer",className:(0,s.cn)("flex items-center px-6 [.border-t]:pt-6",e),...t})}},91337:(e,t,r)=>{"use strict";r.d(t,{cn:()=>n});var a=r(29722),s=r(622);function n(...e){return(0,s.QP)((0,a.$)(e))}},92289:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});let a=(0,r(78340).A)("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]])},97651:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={default:function(){return c},getImageProps:function(){return d}};for(var s in a)Object.defineProperty(t,s,{enumerable:!0,get:a[s]});let n=r(73623),i=r(95413),o=r(38437),l=n._(r(36095));function d(e){let{props:t}=(0,i.getImgProps)(e,{defaultLoader:l.default,imgConf:{deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[16,32,48,64,96,128,256,384],qualities:[75,95],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!0}});for(let[e,r]of Object.entries(t))void 0===r&&delete t[e];return{props:t}}let c=o.Image}},e=>{e.O(0,[64514,98500,38437,28441,93794,77358],()=>e(e.s=41904)),_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.