1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,23750,e=>{"use strict";var t=e.i(43476),a=e.i(47163);function s({className:e,type:s,...r}){return(0,t.jsx)("input",{type:s,"data-slot":"input",className:(0,a.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})}e.s(["Input",()=>s])},70065,e=>{"use strict";var t=e.i(43476),a=e.i(47163);function s({className:e,...s}){return(0,t.jsx)("div",{"data-slot":"card",className:(0,a.cn)("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...s})}function r({className:e,...s}){return(0,t.jsx)("div",{"data-slot":"card-header",className:(0,a.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),...s})}function i({className:e,...s}){return(0,t.jsx)("div",{"data-slot":"card-title",className:(0,a.cn)("leading-none font-semibold",e),...s})}function n({className:e,...s}){return(0,t.jsx)("div",{"data-slot":"card-description",className:(0,a.cn)("text-muted-foreground text-sm",e),...s})}function l({className:e,...s}){return(0,t.jsx)("div",{"data-slot":"card-content",className:(0,a.cn)("px-6",e),...s})}function o({className:e,...s}){return(0,t.jsx)("div",{"data-slot":"card-footer",className:(0,a.cn)("flex items-center px-6 [.border-t]:pt-6",e),...s})}e.s(["Card",()=>s,"CardContent",()=>l,"CardDescription",()=>n,"CardFooter",()=>o,"CardHeader",()=>r,"CardTitle",()=>i])},31278,e=>{"use strict";let t=(0,e.i(75254).default)("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);e.s(["Loader2",()=>t],31278)},10708,e=>{"use strict";var t=e.i(43476),a=e.i(71645),s=e.i(48425),r=a.forwardRef((e,a)=>(0,t.jsx)(s.Primitive.label,{...e,ref:a,onMouseDown:t=>{t.target.closest("button, input, select, textarea")||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));r.displayName="Label";var i=e.i(47163);function n({className:e,...a}){return(0,t.jsx)(r,{"data-slot":"label",className:(0,i.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),...a})}e.s(["Label",()=>n],10708)},81947,e=>{"use strict";var t=e.i(43476),a=e.i(25913),s=e.i(47163);let r=(0,a.cva)("relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90"}},defaultVariants:{variant:"default"}});function i({className:e,variant:a,...i}){return(0,t.jsx)("div",{"data-slot":"alert",role:"alert",className:(0,s.cn)(r({variant:a}),e),...i})}function n({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"alert-title",className:(0,s.cn)("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",e),...a})}function l({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"alert-description",className:(0,s.cn)("text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",e),...a})}e.s(["Alert",()=>i,"AlertDescription",()=>l,"AlertTitle",()=>n])},95468,e=>{"use strict";let t=(0,e.i(75254).default)("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);e.s(["CheckCircle2",()=>t],95468)},83086,e=>{"use strict";
1let t=(0,e.i(75254).default)("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);e.s(["Sparkles",()=>t],83086)},30374,e=>{"use strict";var t=e.i(43476),a=e.i(26999),s=e.i(95926),r=e.i(47163);function i({...e}){return(0,t.jsx)(a.Root,{"data-slot":"dialog",...e})}function n({...e}){return(0,t.jsx)(a.Trigger,{"data-slot":"dialog-trigger",...e})}function l({...e}){return(0,t.jsx)(a.Portal,{"data-slot":"dialog-portal",...e})}function o({className:e,...s}){return(0,t.jsx)(a.Overlay,{"data-slot":"dialog-overlay",className:(0,r.cn)("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...s})}function d({className:e,children:i,showCloseButton:n=!0,...d}){return(0,t.jsxs)(l,{"data-slot":"dialog-portal",children:[(0,t.jsx)(o,{}),(0,t.jsxs)(a.Content,{"data-slot":"dialog-content",className:(0,r.cn)("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",e),...d,children:[i,n&&(0,t.jsxs)(a.Close,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[(0,t.jsx)(s.XIcon,{}),(0,t.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})}function c({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"dialog-header",className:(0,r.cn)("flex flex-col gap-2 text-center sm:text-left",e),...a})}function u({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"dialog-footer",className:(0,r.cn)("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...a})}function m({className:e,...s}){return(0,t.jsx)(a.Title,{"data-slot":"dialog-title",className:(0,r.cn)("text-lg leading-none font-semibold",e),...s})}function g({className:e,...s}){return(0,t.jsx)(a.Description,{"data-slot":"dialog-description",className:(0,r.cn)("text-muted-foreground text-sm",e),...s})}e.s(["Dialog",()=>i,"DialogContent",()=>d,"DialogDescription",()=>g,"DialogFooter",()=>u,"DialogHeader",()=>c,"DialogTitle",()=>m,"DialogTrigger",()=>n])},49237,e=>{"use strict";var t=e.i(43476),a=e.i(71645),s=e.i(18566),r=e.i(67881),i=e.i(23750),n=e.i(10708),l=e.i(70065),o=e.i(81947),d=e.i(30374),c=e.i(31278),u=e.i(83086),m=e.i(95468),g=e.i(20755),p=e.i(22016);function x(){(0,s.useRouter)();let e=(0,s.useSearchParams)(),[x,f]=(0,a.useState)(""),[h,v]=(0,a.useState)(""),[j,b]=(0,a.useState)(!1),[y,w]=(0,a.useState)(""),[N,C]=(0,a.useState)(""),[k,D]=(0,a.useState)(!1),[S,P]=(0,a.useState)(""),[A,T]=(0,a.useState)(!1),[L,z]=(0,a.useState)(!1),F=e?.get("error"),M=(()=>{switch(F){case"no-access":return"You don't have access to the portal. Please complete a purchase first or contact support if you believe this is an error.";case"auth-failed":return"Authentication failed. Please try again or use email/password login.";case"session-failed":return"Failed to establish session. Please try again.";default:return null}})();async function _(e){e.preventDefault(),b(!0),w("");try{let e=(0,g.createClient)(),{data:t,error:a}=await e.auth.signInWithPassword({email:x,password:h});if(a){w(a.message),b(!1);return}let s=await fetch("/api/portal/verify-access",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:x})});(await s.json()).hasAccess?window.location.href="/portal":(w("No active orders found for this email. Please complete a purchase first."),await e.auth.signOut())}catch(e){w("Something went wrong. Please try again.")}finally{b(!1)}}async function I(e){e.preventDefault(),D(!0),P(""),T(!1);try{let e=(0,g.createClient)(),{error:t}=await e.auth.resetPasswordForEmail(N,{redirectTo:`${window.location.origin}/portal/reset-password`});if(t){console.error("[v0] Password reset error:",t),P(t.message),D(!1);return}console.log("[v0] Password reset email sent successfully"),T(!0),D(!1),setTimeout(()=>{z(!1),T(!1),C("")},3e3)}catch(e){console.error("[v0] Password reset exception:",e),P("Something went wrong. Please try again."),D(!1)}}return(0,t.jsx)("div",{className:"min-h-screen flex items-center justify-center bg-gradient-to-br from-background via-background to-primary/5 p-4",children:(0,t.jsxs)(l.Card,{className:"w-full max-w-md",children:[(0,t.jsxs)(l.CardHeader,{className:"text-center",children:[(0,t.jsx)("div",{className:"flex justify-center mb-4",children:(0,t.jsx)("div",{className:"bg-gradient-to-r from-primary to-secondary p-3 rounded-xl",children:(0,t.jsx)(u.Sparkles,{className:"w-8 h-8 text-white"})})}),(0,t.jsx)(l.CardTitle,{className:"text-2xl text-foreground",children:"Welcome Back"}),(0,t.jsx)(l.CardDescription,{children:"Sign in to access your customer portal"})]}),(0,t.jsxs)(l.CardContent,{children:[M&&(0,t.jsx)(o.Alert,{variant:"destructive",className:"mb-4",children:(0,t.jsx)(o.AlertDescription,{children:M})}),y&&(0,t.jsx)(o.Alert,{variant:"destructive",className:"mb-4",children:(0,t.jsx)(o.AlertDescription,{children:y})}),(0,t.jsxs)("form",{onSubmit:_,className:"space-y-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(n.Label,{htmlFor:"email",children:"Email Address"}),(0,t.jsx)(i.Input,{id:"email",type:"email",placeholder:"[email protected]",value:x,onChange:e=>f(e.target.value),required:!0,disabled:j})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(n.Label,{htmlFor:"password",children:"Password"}),(0,t.jsxs)(d.Dialog,{open:L,onOpenChange:z,children:[(0,t.jsx)(d.DialogTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",className:"text-xs text-primary hover:text-primary/80 underline underline-offset-4",children:"Forgot password?"})}),(0,t.jsxs)(d.DialogContent,{children:[(0,t.jsxs)(d.DialogHeader,{children:[(0,t.jsx)(d.DialogTitle,{children:"Reset Password"}),(0,t.jsx)(d.DialogDescription,{children:"Enter your email address and we'll send you a link to reset your password."})]}),A?(0,t.jsxs)(o.Alert,{className:"border-green-200 bg-green-50",children:[(0,t.jsx)(m.CheckCircle2,{className:"h-4 w-4 text-green-600"}),(0,t.jsxs)(o.AlertDescription,{children:[(0,t.jsx)("p",{className:"font-semibold text-green-900",children:"Check your email!"}),(0,t.jsx)("p",{className:"text-sm text-green-700 mt-1",children:"We've sent you a password reset link. Please check your inbox."})]})]}):(0,t.jsxs)("form",{onSubmit:I,className:"space-y-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(n.Label,{htmlFor:"reset-email",children:"Email Address"}),(0,t.jsx)(i.Input,{id:"reset-email",type:"email",placeholder:"[email protected]",value:N,onChange:e=>C(e.target.value),required:!0,disabled:k})]}),S&&(0,t.jsx)(o.Alert,{variant:"destructive",children:(0,t.jsx)(o.AlertDescription,{children:S})}),(0,t.jsxs)(r.Button,{type:"submit",className:"w-full",disabled:k,children:[k&&(0,t.jsx)(c.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}),"Send Reset Link"]})]})]})]})]}),(0,t.jsx)(i.Input,{id:"password",type:"password",placeholder:"Enter your password",value:h,onChange:e=>v(e.target.value),required:!0,disabled:j})]}),(0,t.jsxs)(r.Button,{type:"submit",className:"w-full",disabled:j,children:[j&&(0,t.jsx)(c.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}),"Sign In"]})]}),(0,t.jsxs)("div",{className:"mt-4 text-center text-sm",children:["Don't have an account?"," ",(0,t.jsx)(p.default,{href:"/portal/signup",className:"underline underline-offset-4 text-primary hover:text-primary/80",children:"Create account"})]})]})]})})}e.s(["PortalLogin",()=>x])}]);
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.