1import{j as e}from"./vendor-motion-yqUB90kg.js";import{r as l}from"./vendor-react-B5b_q3ky.js";import{o as f,s as t,u as h}from"./vendor-forms-Bvrw3oAA.js";import{t as b,F as g,a as y,b as j,c as N,d as v,e as w}from"./form-fT3-uQet.js";import{a as E,B as F}from"./index-Bn3v5rTo.js";import{I}from"./input-GkXpX4zC.js";import{s as S}from"./client-Bglr2tPT.js";import{d as m,v as D,A as T,ae as C,N as k,O as A,p as R}from"./vendor-icons-Ba5av9cC.js";import"./vendor-radix-D4408Q5n.js";import"./label-BW3cy8Jh.js";import"./vendor-query-WMFDW9G1.js";const z=f({nombre:t().trim().min(2,{message:"El nombre debe tener al menos 2 caracteres"}).max(100,{message:"El nombre debe tener menos de 100 caracteres"}),email:t().trim().email({message:"Ingresa un correo electrónico válido"}).max(255,{message:"El email debe tener menos de 255 caracteres"}),telefono:t().trim().min(8,{message:"El teléfono debe tener al menos 8 dÃgitos"}).max(20,{message:"El teléfono debe tener menos de 20 caracteres"}).regex(/^[+]?[\d\s-()]+$/,{message:"Ingresa un número de teléfono válido"}),empresa:t().trim().min(2,{message:"El nombre de la empresa debe tener al menos 2 caracteres"}).max(150,{message:"El nombre de la empresa debe tener menos de 150 caracteres"})}),q=()=>{const[o,n]=l.useState(!1),[c,i]=l.useState(!1),{toast:d}=E(),r=h({resolver:b(z),defaultValues:{nombre:"",email:"",telefono:"",empresa:""}}),p=async a=>{n(!0);try{const{error:s}=await S.functions.invoke("notify-lead",{body:{email:a.email,source:"registration",name:a.nombre,phone:a.telefono}});s&&console.error("Error sending notification:",s)}catch(s){console.error("Error invoking notify-lead:",s)}
1n(!1),i(!0),d({title:"¡Inscripción exitosa!",description:"Nos pondremos en contacto contigo pronto."}),setTimeout(()=>{r.reset(),i(!1)},3e3)},x=[{name:"nombre",label:"Nombre completo",icon:C,placeholder:"Tu nombre completo",type:"text"},{name:"email",label:"Correo electrónico",icon:k,placeholder:"[email protected]",type:"email"},{name:"telefono",label:"Teléfono",icon:A,placeholder:"+503 7000-0000",type:"tel"},{name:"empresa",label:"Empresa u organización",icon:R,placeholder:"Nombre de tu empresa",type:"text"}];return e.jsxs("section",{id:"inscripcion",className:"py-24 relative overflow-hidden",children:[e.jsx("div",{className:"absolute right-0 top-1/2 -translate-y-1/2 w-[800px] h-[800px] rounded-full opacity-30 pointer-events-none",style:{background:"radial-gradient(ellipse, hsl(var(--primary) / 0.2) 0%, transparent 70%)"}}),e.jsx("div",{className:"container mx-auto px-4 relative z-10",children:e.jsx("div",{className:"max-w-6xl mx-auto",children:e.jsxs("div",{className:"grid lg:grid-cols-2 gap-12 items-center",children:[e.jsxs("div",{children:[e.jsx("span",{className:"inline-block text-sm font-semibold text-primary tracking-wider mb-4 animate-fade-in",children:"INSCRÃBETE AHORA"}),e.jsxs("h2",{className:"font-display text-4xl md:text-5xl font-bold mb-6 animate-fade-in",style:{animationDelay:"100ms"},children:["Da el primer paso hacia tu"," ",e.jsx("span",{className:"gradient-text",children:"transformación"})]}),e.jsx("p",{className:"text-xl text-muted-foreground mb-8 animate-fade-in",style:{animationDelay:"200ms"},children:"Completa el formulario para recibir la información de compra y comenzar el diplomado a tu ritmo."}),e.jsx("div",{className:"space-y-4",children:["Acceso disponible inmediatamente","Información completa del programa","Opciones de pago flexibles"].map((a,s)=>e.jsxs("div",{className:"flex items-center gap-3 text-muted-foreground animate-fade-in",style:{animationDelay:`${300+s*80}ms`},children:[e.jsx(m,{className:"w-5 h-5 text-primary"}),e.jsx("span",{children:a})]},a))})]}),e.jsx("div",{className:"glass-card rounded-3xl p-8 lg:p-10 animate-fade-in",style:{animationDelay:"400ms"},children:c?e.jsxs("div",{className:"text-center py-12 animate-scale-in",children:[e.jsx("div",{className:"w-20 h-20 rounded-full bg-primary/20 flex items-center justify-center mx-auto mb-6",children:e.jsx(m,{className:"w-10 h-10 text-primary"})}),e.jsx("h3",{className:"font-display text-2xl font-bold mb-2",children:"¡Gracias por inscribirte!"}),e.jsx("p",{className:"text-muted-foreground",children:"Te contactaremos pronto con más información."})]}):e.jsx(g,{...r,children:e.jsxs("form",{onSubmit:r.handleSubmit(p),className:"space-y-6",children:[x.map((a,s)=>e.jsx("div",{className:"animate-fade-in",style:{animationDelay:`${500+s*80}ms`},children:e.jsx(y,{control:r.control,name:a.name,render:({field:u})=>e.jsxs(j,{children:[e.jsx(N,{className:"text-foreground",children:a.label}),e.jsx(v,{children:e.jsxs("div",{className:"relative group",children:[e.jsx(a.icon,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-muted-foreground group-focus-within:text-primary transition-colors"}),e.jsx(I,{type:a.type,placeholder:a.placeholder,className:"pl-10 h-12 bg-secondary/50 border-border focus:border-primary transition-all",...u})]})}),e.jsx(w,{})]})})},a.name)),e.jsx("div",{className:"animate-fade-in",style:{animationDelay:"800ms"},children:e.jsx(F,{type:"submit",size:"lg",disabled:o,className:"w-full group h-14 text-lg font-semibold bg-primary text-primary-foreground hover:bg-primary/90 shadow-[0_0_30px_hsl(var(--primary)/0.3)] transition-all duration-300 hover:scale-[1.02]",children:o?e.jsxs(e.Fragment,{children:[e.jsx(D,{className:"mr-2 w-5 h-5 animate-spin"}),"Enviando..."]}):e.jsxs(e.Fragment,{children:["Inscribirme ahora",e.jsx(T,{className:"ml-2 w-5 h-5 group-hover:translate-x-1 transition-transform"})]})})}),e.jsx("p",{className:"text-xs text-center text-muted-foreground animate-fade-in",style:{animationDelay:"900ms"},children:"Al inscribirte, aceptas recibir información sobre el diplomado."})]})})})]})})})]})};export{q 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.