1import{r as V}from"./rolldown-runtime.C1f3BsDW.js";import{i as U,t as D}from"./inertia.BE4YqsTM.js";import"./http.DWpeO7Ui.js";import{Gr as X,I as $,Jt as ee,Kt as se,Or as _,Qr as ae,S as te,W as I,r as re}from"./icons.ChOq_Y4q.js";import{t as ie}from"./react-core.CAMe6Z4j.js";import"./utils.CgzVjNgC.js";import"./state.L8kQliOB.js";import{V as ne,i as E,k as l}from"./entry-client.DX3aUoe5.js";import{n as C}from"./input.GzdAc1Aj.js";import"./dist.DxccqHSW.js";import{t as A}from"./label.D8t8fk_6.js";import{n as oe,t as le}from"./SEO.gPDL2mFy.js";import{t as F}from"./logo.7ZVhR9ER.js";import{t as de}from"./Card.CbhBZ5MF.js";import{n as ce}from"./postAuthDestination.BcKgx72u.js";import{t as me}from"./GoogleSignIn.BispkxKX.js";var a=V(ae(),1),e=V(ie(),1);const ue=({authReset:P=!1})=>{const{login:R,devLogin:O,devLoginFree:T,adminDevLogin:z,isLoading:c,error:m,isAuthenticated:u,resendVerification:B}=E(),[i,W]=(0,a.useState)(""),[d,q]=(0,a.useState)(""),[x,t]=(0,a.useState)(""),[G,g]=(0,a.useState)(!1),[h,f]=(0,a.useState)(!1),[K,p]=(0,a.useState)(!1),[o,v]=(0,a.useState)(!1),[b,j]=(0,a.useState)(!1),[y,w]=(0,a.useState)(!1),[N,L]=(0,a.useState)(!1),M=U().props.app?.env!=="production",Y=async()=>{j(!0),t("");try{await O(),await r()}catch(s){t(s instanceof Error?s.message:"Dev login failed")}finally{j(!1)}},J=async()=>{w(!0),t("");try{await T(),await r()}catch(s){t(s instanceof Error?s.message:"Dev login (free) failed")}finally{w(!1)}},Q=async()=>{L(!0),t("");try{await z(),await r()}catch(s){t(s instanceof Error?s.message:"Admin dev login failed")}finally{L(!1)}},Z=async()=>{f(!0);try{await B(i),p(!0)}catch{t("Could not send the verification email. Try again.")}finally{f(!1)}},r=(0,a.useCallback)(async s=>{s&&(window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"signup_ui_completed",sign_up_method:"google",user_role:"customer",plan_type:"payg",referral_code:"NEW",marketing_optin:!0,timestamp:new Date().toISOString()}));try{await ne.bootstrapSession()}catch{}window.location.href=ce(E.getState().user)},[]),S=(0,a.useRef)(!1);(0,a.useEffect)(()=>{u&&!c&&!S.current&&(S.current=!0,r())},[u,c,r]);const H=async s=>{if(s.preventDefault(),t(""),!i||!d){t("Enter your email and password.");return}v(!0);try{await R(i,d),await r()}catch(n){const k=n;k?.requiresVerification?(g(!0),p(!1),t(k.message||"Verify your email address before you log in.")):(g(!1),t(n instanceof Error?n.message:"Could not log in. Try again."))}finally{v(!1)}};return(0,e.jsxs)("main",{id:"main-content",className:"min-h-screen bg-background flex",children:[(0,e.jsx)(le,{...oe.login}),(0,e.jsxs)("div",{className:"hidden lg:flex lg:w-1/2 relative overflow-hidden",children:[(0,e.jsx)("div",{className:"absolute inset-0 bg-gradient-to-br from-primary/20 via-background to-accent/10"}),(0,e.jsx)("div",{className:"absolute inset-0 opacity-[0.03]",style:{backgroundImage:`linear-gradient(hsl(0 0% 100% / 0.1) 1px, transparent 1px), 2 linear-gradient(90deg, hsl(0 0% 100% / 0.1) 1px, transparent 1px)`,backgroundSize:"64px 64px"}}),(0,e.jsx)("div",{className:"absolute top-1/4 left-1/4 w-96 h-96 bg-primary/20 rounded-lg blur-[128px]"}),(0,e.jsx)("div",{className:"absolute bottom-1/4 right-1/4 w-64 h-64 bg-accent/20 rounded-lg blur-[96px]"}),(0,e.jsxs)("div",{className:"relative z-10 flex flex-col justify-between p-12 w-full",children:[(0,e.jsx)("a",{href:"/",children:(0,e.jsx)(F,{className:"h-5"})}),(0,e.jsxs)("div",{className:"space-y-8",children:[(0,e.jsxs)("div",{children:[(0,e.jsxs)("h1",{className:"text-4xl font-bold text-foreground mb-4 leading-tight",children:["Welcome back to",(0,e.jsx)("span",{className:"text-gradient block",children:"the studio."})]}),(0,e.jsx)("p",{className:"text-lg text-muted-foreground max-w-md",children:"Your films and director styles are right where you left them."})]}),(0,e.jsx)("div",{className:"space-y-4",children:[{icon:$,text:"First cut in one session."},{icon:re,text:"Team sharing and review links"},{icon:I,text:"You own what you make."}].map((s,n)=>(0,e.jsxs)("div",{className:"flex items-center gap-3 text-muted-foreground",children:[(0,e.jsx)("div",{className:"flex h-8 w-8 items-center justify-center rounded-lg bg-secondary",children:(0,e.jsx)(s.icon,{className:"h-4 w-4 text-primary","aria-hidden":"true"})}),(0,e.jsx)("span",{className:"text-sm",children:s.text})]},n))})]}),(0,e.jsx)("dl",{className:"glass-effect grid max-w-md grid-cols-3 gap-4 roun
2ded-xl p-6",children:[{value:"One workspace",label:"Script, storyboard, video, voice and sound"},{value:"12 languages",label:"Scripts, dialogue and voiceover"},{value:"4K export",label:"Finished films, ready to share"}].map(s=>(0,e.jsxs)("div",{children:[(0,e.jsx)("dt",{className:"text-sm font-semibold text-foreground",children:s.value}),(0,e.jsx)("dd",{className:"mt-1 text-xs leading-snug text-muted-foreground",children:s.label})]},s.value))})]})]}),(0,e.jsx)("div",{className:"flex-1 flex items-center justify-center p-6 lg:p-12",children:(0,e.jsxs)("div",{className:"w-full max-w-md animate-fade-in",children:[(0,e.jsx)("div",{className:"flex justify-center mb-8 lg:hidden",children:(0,e.jsx)("a",{href:"/",children:(0,e.jsx)(F,{className:"h-5"})})}),(0,e.jsx)("p",{className:"mb-6 text-center text-xs text-muted-foreground lg:hidden",children:"Trusted by 10K+ creators"}),(0,e.jsxs)(de,{variant:"default",padding:"lg",className:"rounded-xl border-border bg-card/60 shadow-raised-lg",children:[(0,e.jsxs)("div",{className:"text-center mb-8",children:[(0,e.jsx)("h2",{className:"text-3xl font-bold text-foreground mb-2",children:"Welcome back"}),(0,e.jsx)("p",{className:"text-muted-foreground",children:"Pick up where you left off."})]}),P&&(0,e.jsxs)("div",{className:"flex items-center gap-2 p-3 rounded-lg bg-warning/10 border border-warning/20 mb-6",role:"status",children:[(0,e.jsx)(te,{className:"h-4 w-4 text-warning shrink-0","aria-hidden":"true"}),(0,e.jsx)("p",{className:"text-sm text-warning",children:"Your session expired. Log in again."})]}),(0,e.jsx)(me,{onSuccess:r,buttonClassName:"font-semibold"}),(0,e.jsx)("div",{className:"relative my-6",children:(0,e.jsx)("div",{className:"relative flex justify-center",children:(0,e.jsx)("span",{className:" px-4 text-xs text-muted-foreground uppercase tracking-wider",children:"or continue with email"})})}),(0,e.jsxs)("form",{onSubmit:H,className:"space-y-5",children:[(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)(A,{htmlFor:"email",children:"Email"}),(0,e.jsx)(C,{id:"email",type:"email",name:"email",placeholder:"[email protected]â¦",autoComplete:"email",inputMode:"email",spellCheck:!1,value:i,onChange:s=>W(s.target.value),icon:(0,e.jsx)(se,{className:"h-4 w-4","aria-hidden":"true"}),className:"bg-background/85",disabled:o})]}),(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between",children:[(0,e.jsx)(A,{htmlFor:"password",children:"Password"}),(0,e.jsx)(D,{href:"/forgot-password",className:"text-xs text-muted-foreground hover:text-primary transition-colors",children:"Forgot password?"})]}),(0,e.jsx)(C,{id:"password",type:"password",revealable:!0,name:"password",placeholder:"Enter your passwordâ¦",autoComplete:"current-password",value:d,onChange:s=>q(s.target.value),icon:(0,e.jsx)(ee,{className:"h-4 w-4","aria-hidden":"true"}),disabled:o,className:"bg-background/85"})]}),(x||m)&&(0,e.jsxs)("div",{className:"flex flex-col gap-2 p-3 rounded-lg bg-destructive/10 border border-destructive/20",role:"status","aria-live":"polite",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)("div",{className:"h-2 w-2 shrink-0 rounded-lg bg-destructive"}),(0,e.jsx)("p",{className:"text-sm text-destructive",children:x||m})]}),G&&(K?(0,e.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Verification link sent to ",i,". It stays valid for 24 hours â check your spam folder if it has not arrived."]}):(0,e.jsx)("button",{type:"button",onClick:Z,disabled:h,className:"self-start text-xs font-semibold text-primary underline underline-offset-2 transition-colors hover:text-primary/80 disabled:opacity-60",children:h?"Sendingâ¦":"Send me a new verification link"}))]}),(0,e.jsx)(l,{type:"submit",className:"w-full font-semibold",disabled:o,isLoading:o,children:"Log in"})]}),M&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{className:"relative my-4",children:(0,e.jsx)("div",{className:"relative flex justify-center",children:(0,e.jsx)("span",{className:"px-4 text-xs text-muted-foreground/60 uppercase tracking-wider",children:"dev tools"})})}),(0,e.jsxs)(l,{type:"button",variant:"outline",className:"w-full border-dashed border-amber-500/40 text-amber-600 hover:border-amber-500/60",size:"xs",disabled:b,isLoading:b,onClick:Y,children:[(0,e.jsx)(_,{className:"h-3.5 w-3.5","aria-hidden":"true"}),"Dev Login (with subscription)"]}),(0,e.jsxs)(l,{type:"button",variant:"outline",className:"mt-2 w-full border-dashed border-amber-500/40 text-amber-500 hover:border-amber-500/60",size:"xs",disabled:y,isLoading:y,onClick:J,children:[(0,e.jsx)(_,{className:"h-3.5 w-3.5","aria-hidden":"true"}),"Dev Login (no subscription)"]}),(0,e.jsxs)(l,{type:"button",variant:"outline",className:"mt-2 w-full border-dashed border-indigo-500/40 text-indigo-500 hover:border-indigo-500/60",size:"xs",disabled:N,isLoading:N,onClick:Q,children:[(0,e.jsx)(I,{className:"h-3.5 w-3.5","aria-hidden":"true"}),"Admin Dev Login (with subscription)"]})]}),(0,e.jsxs)("p",{className:"mt-6 text-center text-sm text-muted-foreground",children:["Don't have an account?"," ",(0,e.jsx)(D,{href:"/register",className:"text-primary hover:text-primary/80 font-medium transition-colors",children:"Sign up"})]})]}),(0,e.jsxs)("div",{className:"mt-8 space-y-4",children:[(0,e.jsxs)("p",{className:"text-center text-xs text-muted-foreground",children:["By logging in, you agree to our"," ",(0,e.jsx)("a",{href:"/terms",className:"text-foreground
2/70 hover:text-foreground transition-colors",children:"Terms of Service"})," ","and"," ",(0,e.jsx)("a",{href:"/privacy",className:"text-foreground/70 hover:text-foreground transition-colors",children:"Privacy Policy"})]}),(0,e.jsx)("div",{className:"text-center",children:(0,e.jsxs)("a",{href:"/",className:"inline-flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[(0,e.jsx)(X,{className:"h-4 w-4","aria-hidden":"true"}),"Back to home"]})})]})]})})]})};var Ie=ue;export{ue as LoginPage,Ie as default};
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.