import{j as s}from"./jsx-runtime-u17CrQMm.js";import{r as d}from"./index-CUcfswc1.js";function u(){return s.jsx("div",{className:"auth-brand-mark","aria-hidden":"true"})}function x(){return s.jsxs("div",{className:"auth-brand-row",children:[s.jsx(u,{}),s.jsx("span",{className:"auth-brand-name",children:"MedForge"})]})}function w({children:e}){return s.jsx("div",{className:"auth-frame",children:s.jsxs("div",{className:"auth-inner",children:[s.jsxs("section",{className:"auth-hero",children:[s.jsxs("div",{children:[s.jsx(x,{}),s.jsx("h2",{children:"Tu clínica, un solo panel."})]}),s.jsx("p",{children:"Agendas, cirugías, facturación y WhatsApp en una plataforma pensada para equipos de salud modernos."}),s.jsx("p",{className:"auth-hero-quote",children:"“MedForge redujo nuestro tiempo de agendamiento en 40%.” — Coordinación CIVE"})]}),s.jsx("div",{className:"auth-card-wrap",children:s.jsx("section",{className:"auth-card",children:e})})]})})}function p({off:e}){return e?s.jsx("svg",{viewBox:"0 0 24 24",width:16,height:16,fill:"none",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{d:"M3 3l18 18M10.6 10.6a2 2 0 0 0 2.8 2.8M9.5 5.2A10.9 10.9 0 0 1 12 5c7 0 11 7 11 7a13.4 13.4 0 0 1-3.1 3.8M6.5 6.7C4 8.3 2 12 2 12s4 7 11 7c1.3 0 2.5-.2 3.6-.6"})}):s.jsxs("svg",{viewBox:"0 0 24 24",width:16,height:16,fill:"none",stroke:"currentColor",strokeWidth:2,children:[s.jsx("path",{d:"M1 12s4-7 11-7 11 7 11 7-4 7-11 7-11-7-11-7Z"}),s.jsx("circle",{cx:12,cy:12,r:3})]})}function g(){return s.jsxs("svg",{className:"oauth-icon",viewBox:"0 0 48 48",width:18,height:18,children:[s.jsx("path",{fill:"#FFC107",d:"M43.6 20.5H42V20H24v8h11.3C33.7 32.6 29.3 36 24 36c-6.6 0-12-5.4-12-12s5.4-12 12-12c3.1 0 5.8 1.1 8 3l5.7-5.7C34.7 6 29.6 4 24 4 12.9 4 4 12.9 4 24s8.9 20 20 20 20-8.9 20-20c0-1.2-.1-2.4-.4-3.5Z"}),s.jsx("path",{fill:"#FF3D00",d:"M6.3 14.7l6.6 4.8C14.7 15.9 19 13 24 13c3.1 0 5.8 1.1 8 3l5.7-5.7C34.7 6 29.6 4 24 4 16.1 4 9.3 8.4 6.3 14.7Z"}),s.jsx("path",{fill:"#4CAF50",d:"M24 44c5.5 0 10.5-1.9 14-5.1l-6.5-5.4C29.6 35.4 26.9 36 24 36c-5.3 0-9.7-3.4-11.3-8.1l-6.5 5C9.2 39.6 16 44 24 44Z"}),s.jsx("path",{fill:"#1976D2",d:"M43.6 20.5H42V20H24v8h11.3c-.8 2.3-2.3 4.2-4.2 5.5l6.5 5.4C41.3 36 44 30.5 44 24c0-1.2-.1-2.4-.4-3.5Z"})]})}function v(){return s.jsxs("svg",{className:"oauth-icon",viewBox:"0 0 23 23",width:18,height:18,children:[s.jsx("rect",{x:1,y:1,width:10,height:10,fill:"#f25022"}),s.jsx("rect",{x:12,y:1,width:10,height:10,fill:"#7fba00"}),s.jsx("rect",{x:1,y:12,width:10,height:10,fill:"#00a4ef"}),s.jsx("rect",{x:12,y:12,width:10,height:10,fill:"#ffb900"})]})}function C({id:e,label:t,value:a,onChange:r,hasError:n,autoComplete:l}){const[o,h]=d.useState(!1);return s.jsxs("div",{className:"auth-field",children:[s.jsx("label",{htmlFor:e,children:t}),s.jsx("input",{id:e,name:e,type:o?"text":"password",value:a,placeholder:"••••••••",autoComplete:l??"current-password",className:n?"auth-input-err":"",onChange:i=>r(i.target.value)}),s.jsx("button",{type:"button",className:"auth-field-icon-btn",onClick:()=>h(i=>!i),"aria-label":o?"Ocultar contraseña":"Mostrar contraseña",children:s.jsx(p,{off:o})})]})}class f extends Error{errors;constructor(t,a){super(a??Object.values(t)[0]?.[0]??"Ocurrió un error inesperado."),this.errors=t}}async function c(e,t,a){const r=await fetch(e,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json","X-Requested-With":"XMLHttpRequest","X-CSRF-TOKEN":t},body:JSON.stringify(a)}),n=await r.json().catch(()=>({}));if(!r.ok)throw new f(n.errors??{},n.message);return n}function M(e,t,a,r){return c("/auth/login",e,{username:t,password:a,remember:r})}function N(e,t){return c("/auth/forgot-password",e,{email:t})}function b(e,t,a,r,n){return c("/auth/reset-password",e,{token:t,email:a,password:r,password_confirmation:n})}export{w as A,x as B,g as G,v as M,C as P,f as a,M as l,b as r,N as s};
