1import{r as o,j as e,Z as se,u as Fe,c as Le,b as ze,m as Ue,bd as $e,a6 as Re,y as l,d as _e,s as b,l as G,B as q,A as we,a7 as Ke,a3 as Qe,aE as Ve,n as He,aJ as We,cO as Be,a_ as Ye,ad as Ze,ae as Je,af as Xe,ag as Ge,a$ as er}from"./index-BwOzJ6eq.js";import{C as ee,a as re}from"./card-CnwoUNGX.js";import{f as rr}from"./supabaseRelations-D6EXEkzO.js";import{C as sr}from"./calendar-DNGRYMoS.js";import{P as ar,a as tr,b as ir}from"./popover-CHgGF7ap.js";import{C as or}from"./calendar-days-Ca0D9bnr.js";import{f as nr,e as ke}from"./es-BVOdUfPk.js";import{c as lr,a as De,b as Ee,m as dr,d as cr,t as ur,e as mr}from"./offerDelivery-C1dL10Uw.js";import{C as pr}from"./calendar-C-0KgoVS.js";import{M as fr}from"./map-pin-DVGbaxPC.js";import{S as xr}from"./send-DjA-m_h_.js";import"./isSameDay-D3eDoc_o.js";import"./subDays-CO7jbD1V.js";import"./isSameMonth-DJr4f949.js";import"./endOfMonth-B4ZlppuE.js";import"./differenceInCalendarMonths-eZs39g5-.js";const z=a=>{const d=new Date(a);return d.setHours(0,0,0,0),d},br=24*60*60*1e3,hr=(a,d=new Date)=>{const t=Math.round((z(a).getTime()-z(d).getTime())/br);return Math.max(1,t)},ae=(a,d=new Date)=>{const t=z(d);return t.setDate(t.getDate()+Math.max(1,Math.round(a))),t},gr=60,Se=(a=new Date)=>({desde:ae(1,a),hasta:ae(gr,a)}),vr=(a,d=new Date)=>{const{desde:t,hasta:m}=Se(d),y=z(a).getTime();return y>=t.getTime()&&y<=m.getTime()},yr=a=>a===1?"mañana":`en ${a} dÃas`,jr=({valor:a,onChange:d,disabled:t,id:m="plazo-de-entrega"})=>{const[y,j]=o.useState(!1),h=new Date,{desde:N,hasta:E}=Se(h),c=a!=null?ae(a,h):void 0;return e.jsxs(ar,{open:y,onOpenChange:j,children:[e.jsx(tr,{asChild:!0,children:e.jsxs("button",{id:m,type:"button",disabled:t,className:se("flex w-full items-center gap-2 rounded-xl border border-border bg-background px-3 py-2.5 text-left text-sm","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40 disabled:opacity-60"),children:[e.jsx(or,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),c&&a!=null?e.jsxs("span",{className:"min-w-0 flex-1 truncate",children:[nr(c,"EEEE d 'de' MMMM",{locale:ke}),e.jsxs("span",{className:"text-muted-foreground",children:[" · ",yr(a)]})]}):e.jsx("span",{className:"flex-1 text-muted-foreground",children:"Elige el dÃa de entrega"})]})}),e.jsx(ir,{className:"w-auto max-w-[95vw] p-0",align:"start",children:e.jsx(sr,{mode:"single",locale:ke,selected:c,defaultMonth:c??N,fromDate:N,toDate:E,disabled:g=>!vr(g,h),onSelect:g=>{g&&(d(hr(g,h)),j(!1))}})})]})};async function Nr(){const{error:a}=await b.rpc("expire_open_hybrid_opportunities");a&&console.warn("Auto-expire hybrid opportunities failed (TeacherOpportunityOffer):",a)}function _r(a){return a.status==="selected"?"selected":a.status!=="open"?"closed":a.expires_at&&new Date(a.expires_at).getTime()<Date.now()?"expired":"open"}function Ur(){var fe,xe,be,he,ge,ve,ye;const a=Fe(),{id:d}=Le(),{user:t}=ze(),{data:m}=Ue(),y=$e(),j=Re(),h=(t==null?void 0:t.stripeChargesEnabled)===!1;o.useEffect(()=>{h&&(l.error("Primero configura tus cobros para poder enviar ofertas."),a("/home?feed=opportunities",{replace:!0}))},[h,a]);const[N,E]=o.useState(""),[c,g]=o.useState(""),te=(m==null?void 0:m.creditsPerEuro)??300,ie=er(Number(c),te),[oe,U]=o.useState(""),[S,ne]=o.useState("online"),[T,$]=o.useState(null),[M,R]=o.useState("60"),[C,K]=o.useState(""),[O,Q]=o.useState(""),[le,V]=o.useState([]),[de,H]=o.useState([]),[_,W]=o.useState(""),[A,B]=o.useState(""),[I,Y]=o.useState(""),[ce,ue]=o.useState(!1),[F,me]=o.useState(null),{data:r,isLoading:Ce,isError:Pe}=_e({queryKey:["teacher-opportunity-detail",t==null?void 0:t.id,d],enabled:!!(t!=null&&t.id&&d),queryFn:async()=>{var f;await Nr();const{data:s,error:i}=await b.from("hybrid_opportunities").select("id, title, description, video_id, budget_min, budget_max, expires_at, status, student_id, video:videos(s3_key)").eq("id",d).neq("student_id",t.id).maybeSingle();if(i)throw i;if(!s)return null;const[{data:p,error:w},{data:k,error:L}]=await Promise.all([b.from("profiles").select("id, username, full_name, avatar_url").eq("id",s.student_id).maybeSingle(),b.from("hybrid_offers").select("id, status, price, created_at").eq("opportunity_id",d).eq("teacher_id",t.id)]);if(w)throw w;if(L)throw L;return{...s,video:rr(s.video),student:p||null,my_active_offers_count:(k||[]).filter(v=>v.status==="submitted"||v.status==="selected").length,my_latest_offer_status:((f=(k||[]).sort((v,D)=>new Date(D.created_at).getTime()-new Date(v.created_at).getTime())[0])==null?void 0:f.status)||null}}}),{data:pe,isLoading:qe,isError:Te}=_e({queryKey:["teacher-opportunity-playback",r==null?void 0:r.id,(fe=r==null?void 0:r.video)==null?void 0:fe.s3_key,F],enabled:!!(F&&((xe=r==null?void 0:r.video)!=null&&xe.s3_key)),retry:1,queryFn:async()=>{const{data:s,error:i}=await b.functions.invoke("get-video-playback-url",{body:{s3Key:r.video.s3_key}});if(i)throw i;if(!(s!=null&&s.playbackUrl))throw new Error("Playback URL not available");return s.playbackUrl}});o.useEffect(()=>{r&&(E(r.title||"Propuesta de análisis"),g(""),U(""),ne("online"),$(null),R("60"),K(""),Q(""),V([]),H([]),W(""),B(""),Y(""))},[r==null?void 0:r.id]);const Z=o.useMemo(()=>r?_r(r):"closed",[r]),J=((r==null?void 0:r.my_active_offers_count)??0)>0,u=!!r&&Z==="open"&&!J,P=dr(S),n=cr(S),Me=s=>{V(i=>i.includes(s)?i.filter(p=>p!==s):[...i,s])},Oe=s=>{H(i=>i.includes(s)?i.filter(p=>p!==s):[...i,s])},Ae=async()=>
1{if(!t||!r)return;if(J){l.info("Ya has enviado una oferta para esta oportunidad"),a(`/hybrid-opportunity/${r.id}`);return}if(Z!=="open"){l.error("Esta oportunidad ya no admite nuevas ofertas");return}if(!t.stripeChargesEnabled){l.error("Configura tus cobros (Stripe) antes de enviar ofertas de pago.");const f=`/my-students/opportunity/${r.id}/offer`;a(`/settings?returnTo=${encodeURIComponent(f)}`);return}if(!N.trim()){l.error("Añade un nombre de servicio");return}if(!c||!Number.isInteger(Number(c))||Number(c)<=0){l.error("Indica en euros enteros lo que quieres recibir por este servicio");return}if(m&&(Number(c)<m.proNetMin||Number(c)>m.proNetMax)){l.error(`Puedes pedir entre ${m.proNetMin} ⬠y ${m.proNetMax} â¬`);return}if(P&&(T==null||T<=0)){l.error("Elige el dÃa en que entregarás el videoanálisis");return}if(n&&!C.trim()){l.error("Añade dónde serÃa la sesión presencial");return}if(n&&(!M||Number(M)<=0)){l.error("Añade la duración de la sesión presencial");return}if(_&&!A||!_&&A){l.error("Si marcas una hora exacta, indica inicio y fin");return}if(n&&_&&!O){l.error("Para reservar una hora exacta, elige también la fecha de la sesión");return}const s=oe.trim(),i=s||null,p=P?T:7,w=n?Number(M):null,k=n?ur(O,_):null,L=mr({deliveryMode:S,deliveryDays:P?p:null,sessionDurationMinutes:w,inPersonLocation:n?C.trim():null,availableFrom:n?O:null,availableWeekdays:n?le:[],preferredSlots:n?de:[],scheduledAt:k,startTime:n?_:null,endTime:n?A:null,modalityNote:I.trim()||null,weekdays:De,timeSlots:Ee}),X=[s,...L].filter(Boolean).join(` 2 3`)||null;ue(!0);try{const{count:f,error:v}=await b.from("hybrid_offers").select("id",{count:"exact",head:!0}).eq("opportunity_id",r.id).eq("teacher_id",t.id).in("status",["submitted","selected"]);if(v)throw v;if((f||0)>0){l.info("Ya has enviado una oferta para esta oportunidad"),await j.invalidateQueries({queryKey:["home-teacher-opportunities"]}),a(`/hybrid-opportunity/${r.id}`);return}const{data:D,error:je}=await b.from("hybrid_offers").insert({opportunity_id:r.id,teacher_id:t.id,student_id:r.student_id,service_name:N.trim(),description:i,message:X,price:Number(c),estimated_delivery_days:P?p:null,delivery_mode:S,in_person_location:n?C.trim():null,session_duration_minutes:w,scheduled_at:k,modality_note:I.trim()||null}).select("id").single();if(je)throw je;try{const{error:x}=await b.from("service_offers").insert({teacher_id:t.id,student_id:r.student_id,service_name:N.trim(),description:X||i||null,price:Number(c),delivery_days:p,delivery_mode:S,in_person_location:n?C.trim():null,session_duration_minutes:w,scheduled_at:k,modality_note:I.trim()||null,status:"pending",hybrid_opportunity_id:r.id,hybrid_offer_id:D.id});if(x)throw x}catch(x){throw console.error("Error creating linked service offer for hybrid offer:",x),x}const{error:Ne}=await b.from("app_notifications").insert({recipient_user_id:r.student_id,actor_user_id:t.id,type:"hybrid_offer_received",title:"Nueva oferta para tu vÃdeo",body:`Has recibido una oferta de ${t.fullName||t.username||"un profesor"}.`,payload:{opportunity_id:r.id,hybrid_offer_id:(D==null?void 0:D.id)??null}});Ne&&console.error("Error creating app notification:",Ne);try{const{error:x}=await b.functions.invoke("send-hybrid-event-email",{body:{event:"offer_received",recipientUserIds:[r.student_id],opportunityTitle:r.title,actorName:t.fullName||t.username||"Un profesor"}});x&&console.error("Error sending offer received email:",x)}catch(x){console.error("Unexpected error sending offer received email:",x)}l.success("Oferta enviada correctamente"),await Promise.all([j.invalidateQueries({queryKey:["home-teacher-opportunities"]}),j.invalidateQueries({queryKey:["teacher-opportunity-detail"]}),j.invalidateQueries({queryKey:["hybrid-opportunity-detail"]})]),a("/home?feed=opportunities")}catch(f){console.error("Error submitting hybrid offer:",f),(f==null?void 0:f.code)==="23505"?l.error("No se pudo enviar porque hay una restricción antigua activa"):l.error("No se pudo enviar la oferta")}finally{ue(!1)}},Ie=()=>{var p;if(!y)return;const s=new Date,i=new Date(s);i.setDate(s.getDate()+2),E((p=r==null?void 0:r.title)!=null&&p.trim()?`Análisis premium · ${r.title}`:"Análisis premium de swing"),g(r!=null&&r.budget_max?String(r.budget_max):"55"),ne("online"),$(3),R("60"),K("Madrid · zona n
3orte / club del alumno"),U("Te propongo una revisión técnica clara y accionable. Incluye prioridades de mejora, correcciones concretas y seguimiento práctico para que avances rápido."),Q(i.toISOString().split("T")[0]),V(["mon","wed","fri"]),H(["afternoon","evening"]),W("17:00"),B("20:00"),Y("Si eliges presencial, puedo desplazarme o vernos en club si te viene mejor."),l.success("Formulario rellenado (modo desarrollo)")};return h?null:Ce?e.jsx("div",{className:"min-h-full p-6 flex items-center justify-center",children:e.jsx(G,{className:"h-8 w-8 animate-spin text-primary"})}):Pe||!r?e.jsxs("div",{className:"min-h-full p-6 space-y-4",children:[e.jsxs(q,{variant:"outline",className:"rounded-[30px]",onClick:()=>a("/home?feed=opportunities"),children:[e.jsx(we,{className:"mr-2 h-4 w-4"}),"Volver"]}),e.jsx(ee,{children:e.jsx(re,{className:"p-5 text-sm text-muted-foreground",children:"No hemos podido cargar esta oportunidad o ya no tienes acceso."})})]}):e.jsxs("div",{className:"min-h-full p-4 sm:p-6 space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs(q,{variant:"outline",className:"rounded-[30px]",onClick:()=>a("/home?feed=opportunities"),children:[e.jsx(we,{className:"mr-2 h-4 w-4"}),"Volver a oportunidades"]}),e.jsx(q,{variant:"outline",className:"rounded-[30px]",onClick:()=>me(r.video_id),children:"Ver vÃdeo"})]}),e.jsx(ee,{children:e.jsxs(re,{className:"p-4 sm:p-5 space-y-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xs uppercase tracking-wide text-muted-foreground",children:"Enviar oferta"}),e.jsx("h1",{className:"text-xl font-semibold mt-1",children:r.title}),r.description&&e.jsx("p",{className:"text-sm text-muted-foreground mt-1.5",children:r.description})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-2.5",children:[e.jsxs("div",{className:"rounded-xl border border-border bg-background px-3 py-2.5",children:[e.jsxs("p",{className:"mb-1 flex items-center gap-1.5 text-xs text-muted-foreground",children:[e.jsx(Ke,{className:"h-3.5 w-3.5"}),"Alumno"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Qe,{avatarUrl:((be=r.student)==null?void 0:be.avatar_url)||null,fullName:((he=r.student)==null?void 0:he.full_name)||((ge=r.student)==null?void 0:ge.username)||"Alumno",className:"h-6 w-6 rounded-full"}),e.jsx("p",{className:"text-sm font-medium",children:((ve=r.student)==null?void 0:ve.full_name)||((ye=r.student)==null?void 0:ye.username)||"Alumno"})]})]}),e.jsxs("div",{className:"rounded-xl border border-border bg-background px-3 py-2.5",children:[e.jsxs("p",{className:"mb-1 flex items-center gap-1.5 text-xs text-muted-foreground",children:[e.jsx(Ve,{className:"h-3.5 w-3.5"}),"Puede pagar"]}),e.jsx("p",{className:"text-sm font-medium",children:He(r.budget_min,r.budget_max,{viewerIsTeacher:!0,creditsPerEuro:te})}),e.jsx("p",{className:"mt-1 text-[11px] text-muted-foreground",children:"Lo que recibirÃas tú"})]}),e.jsxs("div",{className:"rounded-xl border border-border bg-background px-3 py-2.5",children:[e.jsxs("p",{className:"mb-1 flex items-center gap-1.5 text-xs text-muted-foreground",children:[e.jsx(pr,{className:"h-3.5 w-3.5"}),"Fecha lÃmite"]}),e.jsx("p",{className:"text-sm font-medium",children:r.expires_at?new Date(r.expires_at).toLocaleDateString():"Sin lÃmite"})]})]}),r.my_active_offers_count>0&&e.jsx("div",{className:"rounded-xl border border-sky-300 bg-sky-50 p-3 text-sm text-sky-950",children:e.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{className:"flex gap-2.5",children:[e.jsx(We,{className:"mt-0.5 h-4 w-4 flex-none text-sky-600"}),e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold",children:"Oferta ya enviada"}),e.jsx("p",{className:"text-sky-800",children:"Esta oportunidad sigue visible para que puedas revisarla, pero no se pueden enviar propuestas duplicadas."})]})]}),e.jsx(q,{type:"button",variant:"outline",className:"rounded-[30px] border-sky-300 bg-white text-sky-900 hover:bg-sky-100",onClick:()=>a(`/hybrid-opportunity/${r.id}`),children:"Ver oferta"})]})}),r.my_active_offers_count===0&&r.my_latest_offer_status==="not_selected"&&e.jsx("div",{className:"rounded-xl border border-rose-300 bg-rose-50 p-3 text-sm text-rose-950",children:"Tu oferta anterior fue rechazada. Puedes enviar otra propuesta para este vÃdeo."}),Z!=="open"&&e.jsx("div",{className:"rounded-xl border border-amber-300 bg-amber-50 p-3 text-sm text-amber-900",children:"Esta oportunidad ya no admite nuevas ofertas."})]})}),e.jsx(ee,{children:e.jsxs(re,{className:"p-4 sm:p-5 space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("p",{className:"text-sm font-semibold",children:"Tu propuesta"}),y&&e.jsx("button",{type:"button",onClick:Ie,className:"inline-flex h-8 w-8 items-center justify-center rounded-full border border-border bg-background",title:"Rellenar formulario (solo desarrollo)","aria-label":"Rellenar formulario (solo desarrollo)",children:e.jsx(Be,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-sm font-medium",children:"Nombre del servicio"}),e.jsx("input",{value:N,onChange:s=>E(s.target.value),placeholder:"Ej. Análisis completo de swing",className:"w-full rounded-xl border border-border bg-background px-3 py-2.5 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40",disabled:!u})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-sm font-medium",children:"¿Cuánto quieres recibir? (â¬)"}),e.jsx("input",{type:"number",min:"0",step:"1",value:c,onChange:s=>g(s.target.value),placeholder:"Ej. 45",className:"w-full rounded-xl border border-border bg-background px-3 py-2.5 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40",disabled:!u}),e.jsx("p",{className:"text-xs text-muted-foreground",children:ie?`Recibirás ${Number(c)} ⬠por el servicio completado. El alumno lo verá como ${Ye(ie)}.`:"En euros enteros. Es lo que recibirás por cada servicio completado."})]}),P?e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{htmlFor:"plazo-oferta",className:"text-sm font-medium",children:"¿Qué dÃa entregas el videoanálisis?"}),e.jsx(jr,{id:"plazo-oferta",valor:T,onChange:$,disabled:!u}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"El alumno verá esta fecha en tu oferta. Cuenta desde que la acepte."})]}):e.jsxs("div",{className:"rounded-2xl border border-border bg-background px-3 py-3",children:[e.jsx("p",{className:"text-sm font-medium mb-1",children:"Presencial sin entrega online"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Esta oferta no pedirá videoanálisis posterior. La sesión será en la fecha y el lugar que indiques aquÃ."})]})]}),n&&e.jsx(e.Fragment,{children:e.jsxs("div",{className:"rounded-2xl border border-border bg-background/60 p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(fr,{className:"h-4 w-4 text-primary"}),e.jsx("p",{className:"text-sm font-semibold",children:"Sesión presencial"})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-sm font-medium",children:"Ubicación o zona"}),e.jsx("input",{value:C,onChange:s=>K(s.target.value),placeholder:"Ej. Madrid, Pozuelo, club del alumno...",className:"w-full rounded-xl border border-border bg-background px-3 py-2.5 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40",disabled:!u})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-sm font-medium",children:"Duración de la sesión"}),e.jsx("select",{value:M,onChange:s=>R(s.target.value),className:"w-full rounded-xl border border-border bg-background px-3 py-2.5 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40",disabled:!u,children:lr.map(s=>e.jsxs("option",{value:s,children:[s," minutos"]},s))})]})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-sm font-medium",children:"Fecha de la sesión"}),e.jsx("input",{type:"date",value:O,onChange:s=>Q(s.target.value),className:"w-full rounded-xl border border-border bg-background px-3 py-2.5 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40",disabled:!u})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-sm font-medium",children:"Hora exacta (opcional)"}),e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsx("input",{type:"time",value:_,onCh
3ange:s=>W(s.target.value),className:"w-full rounded-xl border border-border bg-background px-3 py-2.5 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40",disabled:!u}),e.jsx("input",{type:"time",value:A,onChange:s=>B(s.target.value),className:"w-full rounded-xl border border-border bg-background px-3 py-2.5 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40",disabled:!u})]})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-sm font-medium",children:"DÃas disponibles"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:De.map(s=>{const i=le.includes(s.id);return e.jsx("button",{type:"button",onClick:()=>Me(s.id),disabled:!u,className:se("rounded-full border px-3 py-1.5 text-xs font-medium transition-colors",i?"border-primary bg-primary text-black":"border-border bg-background text-foreground hover:bg-muted"),children:s.label},s.id)})})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-sm font-medium",children:"Franjas preferidas"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:Ee.map(s=>{const i=de.includes(s.id);return e.jsx("button",{type:"button",onClick:()=>Oe(s.id),disabled:!u,className:se("rounded-full border px-3 py-1.5 text-xs font-medium transition-colors",i?"border-primary bg-primary text-black":"border-border bg-background text-foreground hover:bg-muted"),children:s.label},s.id)})})]})]})}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-sm font-medium",children:n?"Detalles adicionales de la modalidad":"Detalles de la entrega (opcional)"}),e.jsx("input",{value:I,onChange:s=>Y(s.target.value),placeholder:n?"Ej. También puedo desplazarme o ajustar horario con aviso.":"Ej. Incluyo pautas claras y resumen de prioridades.",className:"w-full rounded-xl border border-border bg-background px-3 py-2.5 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40",disabled:!u})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-sm font-medium",children:"Mensaje para el alumno"}),e.jsx("textarea",{value:oe,onChange:s=>U(s.target.value),rows:4,placeholder:n?"Resume qué vais a trabajar, para quién encaja la sesión y qué valor se lleva el alumno.":"Resume qué analizas, cómo entregas el feedback y qué valor se lleva el alumno.",className:"w-full rounded-xl border border-border bg-background px-3 py-2.5 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40",disabled:!u})]}),e.jsx(q,{onClick:Ae,disabled:ce||!u,className:"h-11 w-full rounded-[30px] bg-primary text-primary-foreground hover:bg-primary/90",children:ce?e.jsxs(e.Fragment,{children:[e.jsx(G,{className:"mr-2 h-4 w-4 animate-spin"}),"Enviando..."]}):J?"Oferta ya enviada":u?e.jsxs(e.Fragment,{children:[e.jsx(xr,{className:"mr-2 h-4 w-4"}),"Enviar oferta"]}):"No disponible para enviar"})]})}),e.jsx(Ze,{open:!!F,onOpenChange:()=>me(null),children:e.jsxs(Je,{className:"max-w-2xl",children:[e.jsx(Xe,{children:e.jsx(Ge,{children:"VÃdeo de la oportunidad"})}),F&&e.jsx("div",{className:"py-4",children:qe?e.jsx("div",{className:"flex h-48 items-center justify-center rounded-lg bg-muted",children:e.jsx(G,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):Te||!pe?e.jsx("div",{className:"flex h-48 items-center justify-center rounded-lg bg-muted",children:e.jsx("p",{className:"text-sm text-muted-foreground",children:"No se pudo cargar el video"})}):e.jsx("div",{className:"relative mx-auto max-w-md overflow-hidden rounded-lg bg-black",children:e.jsx("video",{src:pe,className:"h-auto max-h-64 w-full",controls:!0,playsInline:!0})})})]})})]})}export{Ur 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.