1import{r as u,R as G,j as e,s as M}from"./index-bMFZPluE.js";import{a as xe}from"./emailApi-BQfIvn0G.js";import{e as h}from"./emailHtml-CNLY3Q4b.js";import{c as be,P as he}from"./PrivacyPolicy-B2143qp5.js";import{a as ge}from"./educationCatalog-pqwMnMBs.js";import{c as fe}from"./candidateAvailability-DgcALE0v.js";import{a as ve,b as U}from"./phoneFormatting-bIoASOCT.js";import{s as ye}from"./localCandidatePreview-soJiaFs0.js";import{C as we}from"./CompactPrivacyNotice-Dx4_VTkN.js";const Le=()=>{const T=typeof window<"u"&&["localhost","127.0.0.1"].includes(window.location.hostname),[d,F]=u.useState(1),k=4,[A,P]=u.useState(!1),[Q,V]=u.useState(!1),[Y,J]=u.useState(!1),[v,$]=u.useState(null),[K,R]=u.useState(null),[O,Z]=u.useState(!1),[L,X]=u.useState(null),[r,p]=u.useState(null),[H,g]=u.useState(null),z=G.useRef(null),[a,o]=u.useState({firstName:"",lastName:"",primaryStudies:"",secondaryStudies:"",currentSituation:"",preparingOppositions:!1,oppositionDetails:"",location:"",province:"",email:"",phonePrefix:"+34",phone:"",levels:[],subjects:[],englishOwnLevel:"",englishTeachingScopes:[],work_modality:"HÃbrido (Presencial y Online)",online_invoicing_status:"",has_car:!1,has_metro:!1,wants_academy:!1,winter_schedule:"",summer_schedule:"",afternoon_commitment:"",committed_weekdays:[],commitment_notes:"",availability:""}),ee=[...ge],ae=["Refuerzo general Primaria","Matemáticas Primaria / ESO","Matemáticas Bach Ciencias","Matemáticas Bach Sociales","FÃsica","QuÃmica","BiologÃa y GeologÃa","Lengua","Inglés","GeografÃa e Historia","GeografÃa","Historia","EstadÃstica","Informática","EconomÃa","Otros"],te=["HÃbrido (Presencial y Online)","Solo Online (Nacional/Intl.)","Solo Presencial (Local)"],y="Solo Online (Nacional/Intl.)",B=[{value:"self_employed_invoice",label:"Soy autónomo/a y puedo emitir facturas actualmente"},{value:"could_register",label:"PodrÃa darme de alta si se concreta una colaboración"},{value:"cannot_invoice",label:"Ahora mismo no puedo emitir facturas"},{value:"needs_guidance",label:"No lo sé todavÃa; necesito orientación"}],re=["Estudiando","Opositando","Trabajando","Disponible ahora","Otra situación"],se=["B1","B2","C1","C2 / Nativo"],ne=["Primaria","ESO","Bachillerato","Cambridge B1","Cambridge B2","Cambridge C1"],ie=["Lunes","Martes","Miércoles","Jueves","Viernes"];G.useEffect(()=>{var s,n;const t=()=>{var x;if(typeof window>"u")return;const i=window.innerWidth<640,m=((x=window.visualViewport)==null?void 0:x.height)||window.innerHeight;X(i?Math.floor(m):null)};return t(),window.addEventListener("resize",t),(s=window.visualViewport)==null||s.addEventListener("resize",t),(n=window.visualViewport)==null||n.addEventListener("scroll",t),()=>{var i,m;window.removeEventListener("resize",t),(i=window.visualViewport)==null||i.removeEventListener("resize",t),(m=window.visualViewport)==null||m.removeEventListener("scroll",t)}},[]);const S=L!==null&&L<560,I=(t,s)=>{p(null),o(n=>{const i=n[t];return i.includes(s)?{...n,[t]:i.filter(m=>m!==s)}:{...n,[t]:[...i,s]}})},c=(t,s)=>{o(n=>({...n,[t]:s})),p(null),g(null)},C=()=>{var t;(t=z.current)==null||t.scrollTo({top:0,behavior:"smooth"})},l=(t,s)=>{p({message:t,field:s}),window.setTimeout(()=>{var i;if(!s){C();return}const n=(i=z.current)==null?void 0:i.querySelector(`[data-field="${s}"]`);n==null||n.scrollIntoView({behavior:"smooth",block:"center"}),n==null||n.focus({preventScroll:!0})},50)},f=(t,s="")=>["w-full bg-gray-50 border p-4 rounded-2xl text-sm font-bold outline-none transition-colors",(r==null?void 0:r.field)===t?"border-red-400 bg-red-50 focus:border-red-500":"border-gray-200 focus:border-[#1c74e9]",s].join(" "),W=t=>{if(g(null),R(null),!t){$(null);return}if(t.type!=="application/pdf"&&!t.name.toLowerCase().endsWith(".pdf")){$(null),g("El currÃculum debe estar en formato PDF.");return}if(t.size>8*1024*1024){$(null),g("El PDF ocupa más de 8 MB. Reduce su tamaño e inténtalo de nuevo.");return}$(t)},oe=()=>{T&&W(new File(["CV de prueba local. No corresponde a una persona real."],"cv-prueba-candidato-local.pdf",{type:"application/pdf"}))},le=()=>{if(d===1){const s=[{field:"firstName",value:a.firstName,label:"el nombre"},{field:"lastName",value:a.lastName,label:"los apellidos"},{field:"primaryStudies",value:a.primaryStudies,label:"la titulación principal"},{field:"currentSituation",value:a.currentSituation,label:"la situación actual"},{field:"location",value:a.location,label:"la localidad"},{field:"province",value:a.province,label:"la provincia"},{field:"email",value:a.email,label:"el correo electrónico"}
1,{field:"phone",value:a.phone,label:"el número de WhatsApp"}].find(i=>!i.value.trim());if(s){l(`Falta completar ${s.label}.`,s.field);return}if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(a.email.trim())){l("Escribe un correo electrónico válido.","email");return}const n=ve(a.phone,a.phonePrefix,"WhatsApp");if(!n.ok){l(n.error||"Revisa el número de WhatsApp.","phone");return}}if(d===2&&a.work_modality===y&&!a.online_invoicing_status){l("Indica tu situación actual para poder colaborar online.","online_invoicing_status");return}if(d===3){if(a.levels.length===0){l("Selecciona al menos un nivel educativo.","levels");return}if(a.subjects.length===0){l("Selecciona al menos una asignatura.","subjects");return}if(a.subjects.includes("Inglés")&&!a.englishOwnLevel){l("Indica tu nivel propio de inglés.","englishOwnLevel");return}if(a.subjects.includes("Inglés")&&a.englishTeachingScopes.length===0){l("Indica qué niveles o exámenes de inglés puedes impartir.","englishTeachingScopes");return}}p(null),F(t=>Math.min(t+1,k)),window.setTimeout(C,0)},ce=()=>{p(null),g(null),F(t=>Math.max(t-1,1)),window.setTimeout(C,0)},E=t=>{var D,q;const s=(D=new URLSearchParams(window.location.search).get("source"))==null?void 0:D.trim().toLowerCase(),n=s&&/^[a-z0-9][a-z0-9_-]{0,79}$/.test(s)?s:"web",i=U(a.phone,a.phonePrefix),m=a.has_car||a.has_metro,x=`${a.firstName} ${a.lastName}`.trim(),b=[a.primaryStudies.trim(),a.secondaryStudies.trim()?`Secundaria: ${a.secondaryStudies.trim()}`:null].filter(Boolean).join(" · "),w=[`Situación actual: ${a.currentSituation}`,`Opositando: ${a.preparingOppositions?`SÃ${a.oppositionDetails.trim()?` (${a.oppositionDetails.trim()})`:""}`:"No"}`,a.work_modality===y?`Situación para facturar online: ${((q=B.find(j=>j.value===a.online_invoicing_status))==null?void 0:q.label)||"Pendiente de confirmar"}`:null,`Compromiso de tardes: ${a.afternoon_commitment==="two_or_more"?"Dos o más tardes completas":a.afternoon_commitment==="one_exception"?"Una tarde completa como excepción":"Pendiente de confirmar"}`,a.committed_weekdays.length>0?`Tardes completas indicadas (16:00-20:30): ${a.committed_weekdays.join(", ")}`:null,a.commitment_notes.trim()?`Detalle del compromiso: ${a.commitment_notes.trim()}`:null,a.subjects.includes("Inglés")&&a.englishOwnLevel?`Nivel propio de inglés: ${a.englishOwnLevel}`:null,a.subjects.includes("Inglés")&&a.englishTeachingScopes.length>0?`Puede impartir inglés en: ${a.englishTeachingScopes.join(", ")}`:null,a.availability.trim()?`Información adicional: ${a.availability.trim()}`:null].filter(Boolean).join(" | "),N=a.work_modality===y?"online_only":"free",_=Object.fromEntries(fe.filter(j=>a.committed_weekdays.includes(j.day)).map(j=>[j.key,N]));return{studiesSummary:b,payload:{name:x,full_name:x,first_name:a.firstName.trim(),last_name:a.lastName.trim(),studies:b,email:a.email.trim(),phone:i,location:a.location.trim(),province:a.province.trim(),levels:a.levels.join(", "),subjects:a.subjects.join(", "),mobility:m?"SÃ":"No",has_car:a.has_car,has_metro:a.has_metro,wants_academy:a.wants_academy,winter_schedule:a.winter_schedule,summer_schedule:a.summer_schedule,afternoon_commitment:a.afternoon_commitment,committed_weekdays:a.committed_weekdays,weekly_availability:_,commitment_notes:a.commitment_notes.trim()||null,online_invoicing_status:a.work_modality===y?a.online_invoicing_status:null,privacy_accepted_at:new Date().toISOString(),privacy_version:he,privacy_source:"public_teacher_form",source:n,availability:`[MODALIDAD: ${a.work_modality}] - ${w}`,cv_url:t,status:"Pendiente"}}},de=async t=>{if(t.preventDefault(),a.work_modality===y&&!a.online_invoicing_status){l("Indica tu situación actual para poder colaborar online.","online_invoicing_status");return}if(!a.afternoon_commitment){l("Indica si puedes reservar dos tardes completas durante el curso.","afternoon_commitment");return}if(a.afternoon_commitment==="two_or_more"&&a.committed_weekdays.length<2){l("Selecciona al menos dos tardes completas que puedas reservar durante el curso.","committed_weekdays");return}if(a.afternoon_commitment==="one_exception"&&a.committed_weekdays.length!==1){l("Selecciona la tarde completa que puedes reservar.","committed_weekdays");return}if(a.afternoon_commitment==="one_exception"&&!a.commitment_notes.trim()){l("Si solo puedes reservar una tarde completa, cuéntanos brevemente tu situación.","commitment_notes");return}if(!O){l("Confirma la información básica de privacidad antes de enviar la candidatura.","privacy");return}if(P(!0),g(null),p(null),T){const{payload:b}=E(null);if(!ye({...b,id:`local-preview-${Date.now()}`,created_at:new Date().toISOString(),cv_url:null,local_cv_name:(v==null?void 0:v.name)||null,local_preview:!0})){g("No hemos podido guardar la prueba en este navegador. Revisa que el almacenamiento local este disponible e intentalo de nuevo."),P(!1),C();return}J(!0),V(!0),P(!1);return}const{payload:s,studiesSummary:n}=E(null),{data:i,error:m}=await M.rpc("submit_public_candidate",{payload:{...s,privacy_confirmed:O}});let x=null;if(!m&&i&&v){const b=String(i),w=`${b}/${Date.now()}_${Math.random().toString(36).slice(2,12)}.pdf`,{error:N}=await M.storage.from("cvs").upload(w,v,{contentType:"application/pdf",upsert:!1});if(N)console.error("Error subiendo el currÃculum:",N),x="La candidatura está guardada, pero el currÃculum no ha podido adju
1ntarse. No vuelvas a enviar el formulario; contactaremos contigo si necesitamos que nos lo facilites de nuevo.";else{const{error:_}=await M.rpc("attach_public_candidate_cv",{payload:{candidate_id:b,cv_reference:w,email:a.email.trim(),phone:U(a.phone,a.phonePrefix)}});_&&(console.error("Error vinculando el currÃculum:",_),x="La candidatura está guardada, pero no hemos podido vincular el currÃculum automáticamente. No vuelvas a enviar el formulario; revisaremos el archivo desde Coordinación.")}}if(!m&&i){if(i){const b=h(a.firstName),w=h(a.location),N=h(a.province),_=h(a.subjects.join(", ")),D=h(n),q=h(a.currentSituation),j=h(a.oppositionDetails),me=h(a.englishOwnLevel||"Nivel pendiente"),ue=h(a.englishTeachingScopes.join(", ")||"Sin detalle");`${b}${w}${N}${_}${D}${q}`,a.preparingOppositions&&a.oppositionDetails&&`${j}`,a.subjects.includes("Inglés")&&`${me}${ue}`;try{await xe({template:"candidate_intake_confirmation",recordId:String(i)})}catch(pe){console.error("Fallo al enviar autoresponder con Resend:",pe)}}R(x),V(!0)}else console.error("Error guardando la candidatura:",m),g("No hemos podido guardar la candidatura. Tus datos siguen escritos; revisa el aviso e inténtalo de nuevo."),C();P(!1)};return Q?e.jsx("div",{className:"min-h-screen bg-[#F5F7FA] flex items-center justify-center p-6 font-sans text-left",children:e.jsxs("div",{className:"bg-white p-8 rounded-[32px] max-w-md w-full text-center shadow-xl border border-gray-100",children:[e.jsx("div",{className:"w-20 h-20 bg-blue-100 rounded-full flex items-center justify-center text-4xl mx-auto mb-6",children:"ð"}),e.jsx("h2",{className:"text-2xl font-black text-gray-900 mb-2",children:"Candidatura recibida"}),e.jsx("p",{className:"text-gray-500 text-sm mb-6",children:Y?"Candidatura de prueba guardada durante 24 horas solo en este navegador. Ya puedes verla en Administración > Candidatos sin subir archivos ni enviar correos.":K||"Gracias por querer formar parte de Profe en Casa. Revisaremos tu candidatura y te contactaremos si tu perfil encaja con las necesidades del curso."}),e.jsx("button",{onClick:()=>window.location.href="/",className:"w-full py-4 bg-[#1c74e9] text-white font-black rounded-xl uppercase tracking-widest text-xs active:scale-95 transition-transform",children:"Volver al inicio"})]})}):e.jsx("div",{className:"min-h-[100dvh] bg-[#F5F7FA] flex justify-center p-0 sm:p-4 font-sans text-left",children:e.jsxs("div",{className:"w-full max-w-md bg-white sm:rounded-[40px] shadow-2xl flex flex-col border border-gray-100 h-[100dvh] sm:h-[90vh] relative overflow-hidden",style:L?{height:`${L}px`}:void 0,children:[e.jsx("div",{className:`shrink-0 bg-[#1c74e9] text-center text-white relative z-10 shadow-md sm:rounded-t-[40px] ${S?"px-4 py-2":"p-8"}`,children:S?e.jsx("p",{className:"text-xs font-black uppercase tracking-widest",children:"Profe en Casa · Candidatura"}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"w-16 h-16 bg-white/20 backdrop-blur-md rounded-2xl mx-auto flex items-center justify-center text-3xl mb-4 shadow-inner",children:"ð¨âð«"}),e.jsx("h1",{className:"text-2xl font-black leading-tight",children:"Trabaja con nosotros"}),e.jsx("p",{className:"text-blue-100 text-xs font-medium mt-2 uppercase tracking-widest",children:"Portal del Candidato"})]})}),e.jsxs("div",{className:`shrink-0 ${S?"px-4 mt-2":"px-8 mt-6"}`,children:[e.jsxs("div",{className:"flex justify-between items-center mb-2",children:[e.jsxs("span",{className:"text-[10px] font-black text-[#1c74e9] uppercase tracking-widest",children:["Paso ",d," de ",k]}),e.jsxs("span",{className:"text-[10px] font-bold text-gray-400",children:[Math.round(d/k*100),"% Completado"]})]}),e.jsx("div",{className:"w-full bg-gray-100 rounded-full h-2.5 overflow-hidden",children:e.jsx("div",{className:"bg-[#1c74e9] h-2.5 rounded-full transition-all duration-500 ease-out",style:{width:`${d/k*100}%`}})})]}),e.jsxs("div",{ref:z,className:`flex-1 min-h-0 overflow-y-auto scrollbar-hide ${S?"p-4 pb-4":"p-8 pb-8"}`,children:[r&&e.jsxs("div",{role:"alert",className:"mb-5 rounded-2xl border border-red-200 bg-red-50 p-4 text-red-800",children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest",children:"Revisa este dato"}),e.jsx("p",{className:"mt-1 text-sm font-bold",children:r.message})]}),H&&e.jsxs("div",{role:"alert",className:"mb-5 rounded-2xl border border-orange-200 bg-orange-50 p-4 text-orange-900",children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest",children:"No se ha enviado todavÃa"}),e.jsx("p",{className:"mt-1 text-sm font-bold",children:H}),e.jsx("p",{className:"mt-2 text-xs",children:"Tus datos siguen escritos. Revisa el aviso y vuelve a intentarlo."})]}),d===1&&e.jsxs("div",{className:"space-y-5 animate-in fade-in slide-in-from-right-4 duration-500",children:[e.jsx("h2",{className:"text-xl font-black text-gray-900 mb-6 flex items-center gap-2",children:"ð¤ Datos de contacto"}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("input",{required:!0,"data-field":"firstName",autoComplete:"given-name",type:"text",placeholder:"Nombre *",className:f("firstName"),"aria-invalid":(r==null?void 0:r.field)==="firstName",value:a.firstName,onChange:t=>c("firstName",t.target.value)}),e.jsx("input",{required:!0,"data-field":"lastName",autoComplete:"family-name",type:"text",placeholder:"Apellidos *",className:f("lastName"),"aria-invalid":(r==null?void 0:r.field)==="lastName",value:a.lastName,onChange:t=>c("lastName",t.target.value)}),e.jsx("input",{required:!0,"data-field":"primaryStudies",type:"text",placeholder:"Titulación principal *",className:f("primaryStudies","text-blue-900 placeholder:text-blue-400"),"aria-invalid":(r==null?void 0:r.field)==="primaryStudies",value:a.primaryStudies,onChange:t=>c("primaryStudies",t.target.value)}),e.jsx("input",{type:"text",placeholder:"Segunda titulación / mención / especialidad",className:"w-full bg-gray-50 border border-gray-200 p-4 rounded-2xl text-sm font-bold focus:border-[#1c74e9] outline-none transition-colors",value:a.secondaryStudies,onChange:t=>c("secondaryStudies",t.target.value)}),e.jsxs("select",{required:!0,"aria-label":"Situación actual","data-field":"currentSituation",value:a.currentSituation,onChange:t=>c("currentSituation",t.target.value),className:f("currentSituation","text-gray-900 cursor-pointer"),"aria-invalid":(r==null?void 0:r.field)==="currentSituation",children:[e.jsx("option",{value:"",children:"Situación actual *"}),re.map(t=>e.jsx("option",{value:t,children:t},t))]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsx("input",{required:!0,"data-field":"location",autoComplete:"address-level2",type:"text",placeholder:"Localidad *",className:f("location"),"aria-invalid":(r==null?void 0:r.field)==="location",value:a.location,onChange:t=>c("location",t.target.value)}),e.jsx("input",{required:!0,"data-field":"province",autoComplete:"address-level1",type:"text",placeholder:"Provincia *",className:f("province"),"aria-invalid":(r==null?void 0:r.field)==="province",value:a.province,onChange:t=>c("province",t.target.value)})]}),e.jsx("input",{required:!0,"data-field":"email",autoComplete:"email",type:"email",placeholder:"Correo Electrónico *",className:f("email"),"aria-invalid":(r==null?void 0:r.field)==="email",value:a.email,onChange:t=>c("email",t.target.value)}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("select",{"aria-label":"Prefijo telefónico",className:"bg-gray-50 border border-gray-200 p-4 rounded-2xl text-sm font-bold text-gray-900 outline-none focus:border-[#1c74e9] w-28 shrink-0 transition-colors cursor-pointer",value:a.p
1honePrefix,onChange:t=>c("phonePrefix",t.target.value),children:[e.jsx("option",{value:"+34",children:"ðªð¸ +34"}),e.jsx("option",{value:"+52",children:"ð²ð½ +52"}),e.jsx("option",{value:"+54",children:"ð¦ð· +54"}),e.jsx("option",{value:"+57",children:"ð¨ð´ +57"}),e.jsx("option",{value:"+56",children:"ð¨ð± +56"}),e.jsx("option",{value:"+51",children:"ðµðª +51"}),e.jsx("option",{value:"+1",children:"ðºð¸ +1"})]}),e.jsx("input",{required:!0,"data-field":"phone",autoComplete:"tel",inputMode:"tel",type:"tel",placeholder:"WhatsApp *",className:f("phone"),"aria-invalid":(r==null?void 0:r.field)==="phone",value:a.phone,onChange:t=>c("phone",t.target.value)})]}),e.jsxs("div",{className:"bg-orange-50/60 p-4 rounded-2xl border border-orange-100",children:[e.jsx("p",{className:"text-[10px] font-black text-orange-600 uppercase tracking-widest mb-3",children:"¿Te estás preparando oposiciones?"}),e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsx("button",{type:"button",onClick:()=>o({...a,preparingOppositions:!0}),className:`px-4 py-3 rounded-xl text-xs font-black transition-all border ${a.preparingOppositions?"bg-orange-500 text-white border-orange-500 shadow-md":"bg-white text-gray-600 border-gray-200 hover:border-orange-300"}`,children:"SÃ"}),e.jsx("button",{type:"button",onClick:()=>o({...a,preparingOppositions:!1,oppositionDetails:""}),className:`px-4 py-3 rounded-xl text-xs font-black transition-all border ${a.preparingOppositions?"bg-white text-gray-600 border-gray-200 hover:border-orange-300":"bg-orange-500 text-white border-orange-500 shadow-md"}`,children:"No"})]}),a.preparingOppositions&&e.jsx("input",{type:"text",placeholder:"Especialidad o etapa de oposición",className:"w-full mt-3 bg-white border border-orange-200 p-4 rounded-2xl text-sm font-bold focus:border-orange-500 outline-none transition-colors",value:a.oppositionDetails,onChange:t=>o({...a,oppositionDetails:t.target.value})})]})]})]}),d===2&&e.jsxs("div",{className:"space-y-5 animate-in fade-in slide-in-from-right-4 duration-500",children:[e.jsx("h2",{className:"text-xl font-black text-gray-900 mb-6 flex items-center gap-2",children:"ð» Modalidad"}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("select",{"aria-label":"Modalidad de trabajo",value:a.work_modality,onChange:t=>{const s=t.target.value;o({...a,work_modality:s,online_invoicing_status:s===y?a.online_invoicing_status:""}),p(null)},className:"w-full bg-blue-50 border border-blue-200 p-4 rounded-2xl text-sm font-black text-[#1c74e9] outline-none cursor-pointer",children:te.map(t=>e.jsx("option",{value:t,children:t},t))}),a.work_modality===y&&e.jsxs("div",{"data-field":"online_invoicing_status",tabIndex:-1,className:`rounded-[24px] border p-5 ${(r==null?void 0:r.field)==="online_invoicing_status"?"border-red-300 bg-red-50 ring-2 ring-red-200":"border-cyan-200 bg-cyan-50/70"}`,children:[e.jsx("h3",{className:"text-[10px] font-black uppercase tracking-widest text-cyan-800",children:"Situación para colaborar online *"}),e.jsx("p",{className:"mt-2 text-xs font-bold leading-relaxed text-gray-700",children:"Para las clases exclusivamente online necesitamos conocer tu situación actual para emitir facturas."}),e.jsx("div",{className:"mt-3 space-y-2",children:B.map(t=>e.jsxs("label",{className:"flex cursor-pointer items-start gap-3 rounded-xl border border-white bg-white p-3",children:[e.jsx("input",{type:"radio",name:"online_invoicing_status",value:t.value,checked:a.online_invoicing_status===t.value,onChange:s=>c("online_invoicing_status",s.target.value),className:"mt-0.5 h-4 w-4 accent-cyan-700"}),e.jsx("span",{className:"text-xs font-black text-gray-800",children:t.label})]},t.value))}),e.jsx("p",{className:"mt-3 text-[11px] font-semibold leading-relaxed text-cyan-900",children:"Esta respuesta es informativa. Antes de cualquier incorporación, administración revisará contigo la vÃa adecuada."})]}),(a.work_modality==="HÃbrido (Presencial y Online)"||a.work_modality==="Solo Presencial (Local)")&&e.jsxs("div",{className:"space-y-3 bg-gray-50 p-5 rounded-[24px] border border-gray-100 mt-4",children:[e.jsx("h3",{className:"font-black text-gray-900 text-sm mb-3",children:"ð Movilidad por Granada"}),e.jsxs("label",{className:"flex items-center gap-3 p-2 cursor-pointer group",children:[e.jsx("div",{className:`w-6 h-6 rounded-lg flex items-center justify-center border-2 transition-colors ${a.has_car?"bg-[#1c74e9] border-[#1c74e9]":"border-gray-300 bg-white group-hover:border-[#1c74e9]"}`,children:a.has_car&&e.jsx("span",{className:"text-white text-xs",children:"â"})}),e.jsx("input",{type:"checkbox",className:"hidden",checked:a.has_car,onChange:()=>o({...a,has_car:!a.has_car})}),e.jsx("span",{className:"text-sm font-bold text-gray-700",children:"ð VehÃculo propio"})]}),e.jsxs("label",{className:"flex items-center gap-3 p-2 cursor-pointer group",children:[e.jsx("div",{className:`w-6 h-6 rounded-lg flex items-center justify-center border-2 transition-colors ${a.has_metro?"bg-[#1c74e9] border-[#1c74e9]":"border-gray-300 bg-white group-hover:border-[#1c74e9]"}`,children:a.has_metro&&e.jsx("span",{className:"text-white text-xs",children:"â"})}),e.jsx("input",{type:"checkbox",className:"hidden",checked:a.has_metro,onChange:()=>o({...a,has_metro:!a.has_metro})}),e.jsxs("span",{className:"text-sm font-bold text-gray-700 flex flex-col",children:["ð Llego a pueblos del Metro",e.jsx("span",{className:"text-[10px] text-gray-400 font-normal",children:"Albolote, Armilla, Maracena..."})]})]}),e.jsx("div",{className:"h-px w-full bg-gray-200 my-2"}),e.jsxs("label",{className:"flex items-center gap-3 p-2 cursor-pointer group",children:[e.jsx("div",{className:`w-6 h-6 rounded-lg flex items-center justify-center border-2 transition-colors ${a.wants_academy?"bg-indigo-500 border-indigo-500":"border-gray-300 bg-white group-hover:border-indigo-500"}`,children:a.wants_academy&&e.jsx("span",{className:"text-white text-xs",children:"â"})}),e.jsx("input",{type:"checkbox",className:"hidden",checked:a.wants_academy,onChange:()=>o({...a,wants_academy:!a.wants_academy})}),e.jsxs("span",{className:"text-sm font-bold text-gray-700 flex flex-col",children:["ð« Dar clase en la Academia",e.jsx("span",{className:"text-[10px] text-gray-400 font-normal",children:"Presencial en La Zubia"})]})]})]})]})]}),d===3&&e.jsxs("div",{className:"space-y-5 animate-in fade-in slide-in-from-right-4 duration-500",children:[e.jsx("h2",{className:"text-xl font-black text-gray-900 mb-2 flex items-center gap-2",children:"ð Especialidad"}),e.jsx("p",{className:"text-xs text-gray-500 mb-6 font-medium",children:"Selecciona niveles y materias de la forma más precisa posible. Asà luego os asignamos mejor."}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{"data-field":"levels",tabIndex:-1,
1className:(r==null?void 0:r.field)==="levels"?"rounded-2xl border border-red-300 bg-red-50 p-3":"",children:[e.jsx("h3",{className:"text-[10px] font-black text-gray-400 uppercase tracking-widest mb-3",children:"1. Niveles Educativos *"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:ee.map(t=>e.jsx("button",{type:"button",onClick:()=>I("levels",t),className:`px-4 py-2.5 rounded-xl text-xs font-bold transition-all border ${a.levels.includes(t)?"bg-[#1c74e9] text-white border-[#1c74e9] shadow-md":"bg-white text-gray-600 border-gray-200 hover:border-blue-300"}`,children:t},t))})]}),e.jsxs("div",{"data-field":"subjects",tabIndex:-1,className:(r==null?void 0:r.field)==="subjects"?"rounded-2xl border border-red-300 bg-red-50 p-3":"",children:[e.jsx("h3",{className:"text-[10px] font-black text-gray-400 uppercase tracking-widest mb-3",children:"2. Asignaturas Principales *"}),e.jsx("div",{className:"grid grid-cols-2 gap-2",children:ae.map(t=>e.jsxs("button",{type:"button",onClick:()=>I("subjects",t),className:`px-4 py-3 rounded-xl text-[11px] font-bold transition-all border text-left flex items-center justify-between ${a.subjects.includes(t)?"bg-blue-50 text-[#1c74e9] border-[#1c74e9] shadow-sm":"bg-white text-gray-600 border-gray-200 hover:border-blue-300"}`,children:[e.jsx("span",{className:"truncate",children:t}),a.subjects.includes(t)&&e.jsx("span",{className:"text-[#1c74e9] shrink-0 ml-1",children:"â"})]},t))})]}),a.subjects.includes("Inglés")&&e.jsxs("div",{className:"bg-emerald-50/60 p-5 rounded-[24px] border border-emerald-100 space-y-4",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-[10px] font-black text-emerald-700 uppercase tracking-widest mb-3",children:"3. Perfil de inglés *"}),e.jsxs("select",{"aria-label":"Nivel propio de inglés","data-field":"englishOwnLevel",value:a.englishOwnLevel,onChange:t=>c("englishOwnLevel",t.target.value),className:`w-full bg-white border p-4 rounded-2xl text-sm font-bold text-gray-900 outline-none cursor-pointer ${(r==null?void 0:r.field)==="englishOwnLevel"?"border-red-400 focus:border-red-500":"border-emerald-200 focus:border-emerald-500"}`,children:[e.jsx("option",{value:"",children:"Nivel propio de inglés"}),se.map(t=>e.jsx("option",{value:t,children:t},t))]})]}),e.jsxs("div",{"data-field":"englishTeachingScopes",tabIndex:-1,className:(r==null?void 0:r.field)==="englishTeachingScopes"?"rounded-2xl border border-red-300 bg-red-50 p-3":"",children:[e.jsx("h4",{className:"text-[10px] font-black text-gray-500 uppercase tracking-widest mb-3",children:"¿Qué puedes impartir?"}),e.jsx("div",{className:"grid grid-cols-2 gap-2",children:ne.map(t=>e.jsxs("button",{type:"button",onClick:()=>I("englishTeachingScopes",t),className:`px-4 py-3 rounded-xl text-[11px] font-bold transition-all border text-left flex items-center justify-between ${a.englishTeachingScopes.includes(t)?"bg-emerald-500 text-white border-emerald-500 shadow-sm":"bg-white text-gray-600 border-gray-200 hover:border-emerald-300"}`,children:[e.jsx("span",{className:"truncate",children:t}),a.englishTeachingScopes.includes(t)&&e.jsx("span",{className:"shrink-0 ml-1",children:"â"})]},t))})]})]})]})]}),d===4&&e.jsxs("div",{className:"space-y-5 animate-in fade-in slide-in-from-right-4 duration-500",children:[e.jsx("h2",{className:"text-xl font-black text-gray-900 mb-6 flex items-center gap-2",children:"â±ï¸ Disponibilidad y CV"}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"bg-blue-50/70 p-4 rounded-2xl border border-blue-200",children:[e.jsx("p",{className:"text-[10px] font-black text-[#1c74e9] uppercase tracking-widest",children:"Asà organizamos cada tarde completa"}),e.jsx("p",{className:"mt-2 text-sm font-black text-gray-900",children:"De 16:00 a 20:30"}),e.jsx("div",{className:"mt-3 grid grid-cols-1 gap-2 sm:grid-cols-3",children:["16:00-17:30","17:30-19:00","19:00-20:30"].map(t=>e.jsx("span",{className:"rounded-xl border border-blue-100 bg-white px-3 py-2 text-center text-[11px] font-black text-blue-700",children:t},t))}),e.jsx("p",{className:"mt-3 text-[11px] font-semibold leading-relaxed text-gray-600",children:"Cada dÃa que marques significa que podrÃas reservar la tarde completa, formada por tres clases de 90 minutos."})]}),e.jsxs("div",{"data-field":"afternoon_commitment",tabIndex:-1,
1className:`rounded-2xl border p-4 ${(r==null?void 0:r.field)==="afternoon_commitment"?"border-red-300 bg-red-50 ring-2 ring-red-200":"border-emerald-200 bg-emerald-50/70"}`,children:[e.jsx("p",{className:"text-[10px] font-black text-emerald-700 uppercase tracking-widest",children:"Compromiso para el curso"}),e.jsx("p",{className:"mt-2 text-xs font-bold leading-relaxed text-gray-700",children:"Para construir un horario estable, lo recomendable es reservar dos tardes completas. Nosotros procuraremos completarlas progresivamente."}),e.jsx("div",{className:"mt-3 space-y-2",children:[{value:"two_or_more",label:"SÃ, puedo reservar dos o más tardes completas"},{value:"one_exception",label:"Ahora mismo solo puedo reservar una tarde completa"},{value:"to_confirm",label:"TodavÃa necesito confirmar mis tardes completas"}].map(t=>e.jsxs("label",{className:"flex cursor-pointer items-start gap-3 rounded-xl border border-white bg-white p-3",children:[e.jsx("input",{type:"radio",name:"afternoon_commitment",value:t.value,checked:a.afternoon_commitment===t.value,onChange:s=>{const n=s.target.value;o({...a,afternoon_commitment:n,committed_weekdays:n==="to_confirm"?[]:n==="one_exception"?a.committed_weekdays.slice(0,1):a.committed_weekdays}),p(null)},className:"mt-0.5 h-4 w-4 accent-emerald-600"}),e.jsx("span",{className:"text-xs font-black text-gray-800",children:t.label})]},t.value))}),a.afternoon_commitment&&a.afternoon_commitment!=="to_confirm"&&e.jsxs("div",{"data-field":"committed_weekdays",tabIndex:-1,className:`mt-4 rounded-xl border p-3 ${(r==null?void 0:r.field)==="committed_weekdays"?"border-red-300 bg-red-50 ring-2 ring-red-200":"border-emerald-100 bg-white"}`,children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest text-emerald-700",children:"¿Qué tardes completas puedes reservar? *"}),e.jsx("p",{className:"mt-1 text-[11px] font-semibold leading-relaxed text-gray-600",children:a.afternoon_commitment==="two_or_more"?"Marca al menos dos dÃas en los que puedas mantener el bloque completo de 16:00 a 20:30 durante el curso.":"Marca el único dÃa en el que puedes reservar el bloque completo de 16:00 a 20:30."}),e.jsx("div",{className:"mt-3 flex flex-wrap gap-2",children:ie.map(t=>{const s=a.committed_weekdays.includes(t);return e.jsx("button",{type:"button",onClick:()=>{if(a.afternoon_commitment==="one_exception"){c("committed_weekdays",[t]);return}I("committed_weekdays",t)},className:`rounded-xl border px-3 py-2 text-xs font-black transition-colors ${s?"border-emerald-600 bg-emerald-600 text-white":"border-gray-200 bg-white text-gray-600 hover:border-emerald-400"}`,children:t},t)})})]}),a.afternoon_commitment==="one_exception"&&e.jsx("textarea",{"aria-label":"Motivo para reservar una sola tarde","data-field":"commitment_notes",value:a.commitment_notes,onChange:t=>{o({...a,commitment_notes:t.target.value}),p(null)},placeholder:"Cuéntanos por qué solo puedes reservar una tarde completa.",rows:3,className:`mt-3 w-full rounded-xl border bg-white p-3 text-xs font-bold outline-none resize-none ${(r==null?void 0:r.field)==="commitment_notes"?"border-red-300 ring-2 ring-red-200":"border-emerald-200 focus:border-emerald-500"}`})]}),e.jsxs("div",{className:"bg-gray-50 p-4 rounded-2xl border border-gray-100",children:[e.jsx("label",{className:"text-[10px] font-black text-gray-500 uppercase tracking-widest mb-2 block",children:"Aclaración sobre el curso (opcional)"}),e.jsx("input",{"aria-label":"Aclaración sobre la disponibilidad durante el curso",type:"text",placeholder:"Ej.: podrÃa empezar el 15 de septiembre",className:"w-full bg-white border border-gray-200 p-3 rounded-xl text-sm font-bold focus:border-[#1c74e9] outline-none",value:a.winter_schedule,onChange:t=>o({...a,winter_schedule:t.target.value})})]}),e.jsxs("div",{className:"bg-orange-50/50 p-4 rounded-2xl border border-orange-100",children:[e.jsx("label",{className:"text-[10px] font-black text-orange-600 uppercase tracking-widest mb-2 flex items-center gap-1",children:"âï¸ Verano (Mañanas)"}),e.jsx("input",{"aria-label":"Disponibilidad en verano por las mañanas",type:"text",placeholder:"Ej: Total disponibilidad de 9h a 14h...",className:"w-full bg-white border border-orange-200 p-3 rounded-xl text-sm font-bold focus:border-orange-500 outline-none",value:a.summer_schedule,onChange:t=>o({...a,summer_schedule:t.target.value})})]}),e.jsxs("div",{className:"border-2 border-dashed border-gray-300 bg-gray-50 rounded-2xl p-6 text-center relative hover:bg-blue-50 hover:border-blue-300 transition-all group mt-6",children:[e.jsx("input",{"aria-label":"CurrÃculum en formato PDF",type:"file",accept:"application/pdf,.pdf",onChange:t=>{var s;return W(((s=t.target.files)==null?void 0:s[0])||null)},className:"absolute inset-0 w-full h-full opacity-0 cursor-pointer z-10"}),e.jsx("div",{className:"text-3xl mb-2 group-hover:scale-110 transition-transform",children:"ð"}),e.jsx("p",{className:"font-black text-sm text-[#1c74e9] mb-1",children:"Subir CurrÃculum (PDF)"}),e.jsx("p",{className:"font-medium text-[10px] text-gray-500",children:v?`â
${v.name}`:"Opcional · PDF de hasta 8 MB"})]}),T&&e.jsx("button",{type:"button",onClick:oe,className:"w-full rounded-xl border border-blue-200 bg-blue-50 py-3 text-[10px] font-black uppercase tracking-widest text-blue-700",children:"Usar CV de demostración"}),e.jsx("textarea",{"aria-label":"Otra información útil para la candidatura",placeholder:"Cuéntanos cualquier otra información útil: experiencia en academia o domicilio, EVAU, Cambridge, estadÃstica, geografÃa, necesidades educativas, grupos o horarios especiales...",className:"w-full bg-gray-50 border border-gray-200 p-4 rounded-2xl text-sm font-medium min-h-[100px] outline-none focus:border-[#1c74e9] mt-4",value:a.availability,onChange:t=>o({...a,availability:t.target.value})}
1),e.jsx("div",{"data-field":"privacy",tabIndex:-1,className:(r==null?void 0:r.field)==="privacy"?"rounded-2xl ring-2 ring-red-300":"",children:e.jsx(we,{summary:be,accepted:O,onChange:t=>{Z(t),p(null)},consentText:"He leÃdo la información de privacidad y acepto que Profe en Casa trate mis datos para gestionar mi candidatura y ponerse en contacto conmigo.",footnote:"Lo hemos dejado corto y claro para no hacerte perder tiempo. Si quieres, puedes leer el detalle completo en la polÃtica de privacidad.",compactHeightClass:"max-h-28"})})]})]})]}),e.jsxs("div",{className:`shrink-0 w-full bg-white border-t border-gray-100 sm:p-6 sm:pb-6 flex gap-3 z-20 shadow-[0_-10px_20px_rgba(0,0,0,0.02)] sm:rounded-b-[40px] ${S?"p-2 pb-[calc(0.5rem+env(safe-area-inset-bottom))]":"p-4 pb-[calc(1rem+env(safe-area-inset-bottom))]"}`,children:[d>1&&e.jsx("button",{type:"button",onClick:ce,disabled:A,className:"px-6 py-4 bg-gray-100 hover:bg-gray-200 text-gray-600 font-black rounded-2xl transition-colors uppercase tracking-widest text-[11px] active:scale-95",children:"Atrás"}),d<k?e.jsx("button",{type:"button",onClick:le,className:"flex-1 py-4 bg-[#1c74e9] hover:bg-blue-700 text-white font-black rounded-2xl shadow-lg shadow-blue-500/30 uppercase tracking-widest text-[11px] transition-all active:scale-95",children:"Siguiente Paso â"}):e.jsx("button",{type:"button",onClick:de,disabled:A||!O,className:"flex-1 py-4 bg-green-500 hover:bg-green-600 text-white font-black rounded-2xl shadow-lg shadow-green-500/30 uppercase tracking-widest text-[11px] transition-all active:scale-95 flex justify-center items-center gap-2 disabled:opacity-50 disabled:shadow-none disabled:bg-gray-400",children:A?e.jsx("div",{className:"w-4 h-4 border-2 border-white border-t-transparent rounded-full animate-spin"}):"Enviar Solicitud ð"})]})]})})};export{Le as PublicTeacherForm};
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.