(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4520],{3998:(e,t,r)=>{"use strict";r.d(t,{$:()=>o});var a=r(95155),s=r(49574),i=r(83101),n=r(64269);let d=(0,i.F)("group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",outline:"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",xs:"h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",lg:"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",icon:"size-8","icon-xs":"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg","icon-lg":"size-9"}},defaultVariants:{variant:"default",size:"default"}});function o(e){let{className:t,variant:r="default",size:i="default",...o}=e;return(0,a.jsx)(s.Button,{"data-slot":"button",className:(0,n.cn)(d({variant:r,size:i,className:t})),...o})}},23616:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>j});var a=r(95155),s=r(12115),i=r(20063),n=r(22544),d=r(66942),o=r(95154),l=r(18720),c=r(15239),u=r(13185);let p=(0,u.A)("eye-off",[["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"}]]),m=(0,u.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"}]]);var g=r(69746),x=r(77650),f=r(3998),b=r(65142),v=r(76444),h=r(86948);let y=o.Ik({email:o.Yj().email("Ingresa un correo electr\xf3nico v\xe1lido"),password:o.Yj().min(8,"La contrase\xf1a debe tener al menos 8 caracteres")});function j(){let e=(0,i.useRouter)(),t=(0,s.useMemo)(()=>(0,x.U)(),[]),[r,o]=(0,s.useState)(!1),{register:u,handleSubmit:j,formState:{errors:N,isSubmitting:w}}=(0,n.mN)({resolver:(0,d.u)(y)}),k=async r=>{let{error:a}=await t.auth.signInWithPassword({email:r.email.trim().toLowerCase(),password:r.password.trim()});if(a)return void l.o.error("Credenciales inv\xe1lidas. Verifica tu email y contrase\xf1a.");l.o.success("\xa1Bienvenido a Cirux!"),e.push("/dashboard/calendar"),e.refresh()};return(0,a.jsxs)("div",{className:"min-h-screen flex items-center justify-center bg-background p-4",children:[(0,a.jsx)("div",{className:"absolute inset-0 bg-[radial-gradient(ellipse_at_top,_var(--tw-gradient-stops))] from-primary/10 via-background to-background pointer-events-none"}),(0,a.jsxs)("div",{className:"relative w-full max-w-md z-10",children:[(0,a.jsx)("div",{className:"flex items-center justify-center mb-8",children:(0,a.jsx)(c.default,{src:"/logo-cirux-light.webp",alt:"Cirux",width:180,height:48,className:"h-12 w-auto",priority:!0})}),(0,a.jsxs)(h.Zp,{className:"border-border shadow-2xl",children:[(0,a.jsxs)(h.aR,{className:"text-center pb-2",children:[(0,a.jsx)(h.ZB,{className:"font-heading text-2xl font-bold",children:"Iniciar sesi\xf3n"}),(0,a.jsx)(h.BT,{className:"text-muted-foreground text-sm mt-1",children:"Accede al panel de control de tu consultorio"})]}),(0,a.jsx)(h.Wu,{className:"pt-6",children:(0,a.jsxs)("form",{onSubmit:j(k),className:"space-y-5",noValidate:!0,children:[(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(v.J,{htmlFor:"email",className:"text-sm font-medium",children:"Correo electr\xf3nico"}),(0,a.jsx)(b.p,{id:"email",type:"email",placeholder:"doctor@clinica.com",autoComplete:"email",...u("email"),className:N.email?"border-destructive":""}),N.email&&(0,a.jsx)("p",{className:"text-xs text-destructive",children:N.email.message})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(v.J,{htmlFor:"password",className:"text-sm font-medium",children:"Contrase\xf1a"}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)(b.p,{id:"password",type:r?"text":"password",placeholder:"••••••••",autoComplete:"current-password",...u("password"),className:N.password?"border-destructive pr-10":"pr-10"}),(0,a.jsx)("button",{type:"button",onClick:()=>o(e=>!e),className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors","aria-label":r?"Ocultar contrase\xf1a":"Mostrar contrase\xf1a",children:r?(0,a.jsx)(p,{className:"size-4"}):(0,a.jsx)(m,{className:"size-4"})})]}),N.password&&(0,a.jsx)("p",{className:"text-xs text-destructive",children:N.password.message})]}),(0,a.jsx)(f.$,{type:"submit",className:"w-full bg-primary text-[#0D141D] font-semibold hover:bg-primary/90 rounded-[18px] h-11",disabled:w,children:w?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(g.A,{className:"size-4 mr-2 animate-spin"}),"Ingresando…"]}):"Ingresar al sistema"})]})})]}),(0,a.jsx)("p",{className:"text-center text-xs text-muted-foreground mt-6",children:"Plataforma de atenci\xf3n inteligente para cirug\xeda pl\xe1stica"})]})]})}},46876:(e,t,r)=>{Promise.resolve().then(r.bind(r,23616))},64269:(e,t,r)=>{"use strict";r.d(t,{cn:()=>i});var a=r(2821),s=r(75889);function i(){for(var e=arguments.length,t=Array(e),r=0;r{"use strict";r.d(t,{p:()=>n});var a=r(95155);r(12115);var s=r(50092),i=r(64269);function n(e){let{className:t,type:r,...n}=e;return(0,a.jsx)(s.p,{type:r,"data-slot":"input",className:(0,i.cn)("h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",t),...n})}},76444:(e,t,r)=>{"use strict";r.d(t,{J:()=>i});var a=r(95155);r(12115);var s=r(64269);function i(e){let{className:t,...r}=e;return(0,a.jsx)("label",{"data-slot":"label",className:(0,s.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",t),...r})}},77650:(e,t,r)=>{"use strict";r.d(t,{U:()=>s});var a=r(79786);function s(){return(0,a.createBrowserClient)("https://supabase.silvioalzate.shop","eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoiYW5vbiIsImlzcyI6InN1cGFiYXNlIiwiaWF0IjoxNzc5MTYzNDQ1LCJleHAiOjE5MzY4NDM0NDV9.RGVwyQdA7oigXmMylP2Df7DKpNno_8_rSTwd0471zLk")}},83011:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"useMergedRef",{enumerable:!0,get:function(){return s}});let a=r(12115);function s(e,t){let r=(0,a.useRef)(null),s=(0,a.useRef)(null);return(0,a.useCallback)(a=>{if(null===a){let e=r.current;e&&(r.current=null,e());let t=s.current;t&&(s.current=null,t())}else e&&(r.current=i(e,a)),t&&(s.current=i(t,a))},[e,t])}function i(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let r=e(t);return"function"==typeof r?r:()=>e(null)}}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},86948:(e,t,r)=>{"use strict";r.d(t,{BT:()=>o,Wu:()=>l,ZB:()=>d,Zp:()=>i,aR:()=>n});var a=r(95155);r(12115);var s=r(64269);function i(e){let{className:t,size:r="default",...i}=e;return(0,a.jsx)("div",{"data-slot":"card","data-size":r,className:(0,s.cn)("group/card flex flex-col gap-4 overflow-hidden rounded-xl bg-card py-4 text-sm text-card-foreground ring-1 ring-foreground/10 has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",t),...i})}function n(e){let{className:t,...r}=e;return(0,a.jsx)("div",{"data-slot":"card-header",className:(0,s.cn)("group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-4 group-data-[size=sm]/card:px-3 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3",t),...r})}function d(e){let{className:t,...r}=e;return(0,a.jsx)("div",{"data-slot":"card-title",className:(0,s.cn)("font-heading text-base leading-snug font-medium group-data-[size=sm]/card:text-sm",t),...r})}function o(e){let{className:t,...r}=e;return(0,a.jsx)("div",{"data-slot":"card-description",className:(0,s.cn)("text-sm text-muted-foreground",t),...r})}function l(e){let{className:t,...r}=e;return(0,a.jsx)("div",{"data-slot":"card-content",className:(0,s.cn)("px-4 group-data-[size=sm]/card:px-3",t),...r})}}},e=>{e.O(0,[5730,7711,7349,9574,3540,8720,7958,3652,6394,8441,1255,7358],()=>e(e.s=46876)),_N_E=e.O()}]);