PageSourceSearch

https://flfproleague.com/assets/Asistente-DyvzXiyE.js

js flfproleague.com collected 2026-10-05 23:11:08 UTC 4,803 bytes, 1 lines download raw bytes

1import{r,b as n,j as e,M as f,L as g,aV as b,b5 as o,$ as N,c as p,k as u}from"./index-CtR2Cm7C.js";import{B as v}from"./button-2frSB4pm.js";import{I as w}from"./input-VcMvimTY.js";import{C as y}from"./card-DInig9US.js";import{V as C}from"./volume-2-DnKhypxr.js";import{M as E}from"./index-CxH8DLJ8.js";import{S as k}from"./send-2bR1st9w.js";import"./index-OxmuvU-r.js";function P(){const[a,j]=r.useState(null),[c,d]=r.useState([]),[l,x]=r.useState(""),[i,m]=r.useState(!1);r.useEffect(()=>{(async()=>{try{const t=await n.agents.createConversation({agent_name:"info_assistant",metadata:{name:"Consulta General"}});j(t.id),d(t.messages||[])}catch{u.error("Error al iniciar conversación")}})()},[]),r.useEffect(()=>{if(!a)return;const s=n.agents.subscribeToConversation(a,t=>{d(t.messages)});return()=>s()},[a]);const h=async()=>{if(!(!l.trim()||!a)){m(!0);try{const s=await n.agents.getConversation(a);await n.agents.addMessage(s,{role:"user",content:l}),x("")}catch{u.error("Error al enviar mensaje")}finally{m(!1)}}};return e.jsx("div",{className:"min-h-screen bg-slate-950",children:e.jsxs("div",{className:"container mx-auto px-4 py-8 max-w-4xl",children:[e.jsx("div",{className:"mb-6",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl font-black text-white mb-2",children:"🤖 FLF PRO LEAGUE MANAGER"}),e.jsx("p",{className:"text-slate-400",children:"Pregunta sobre torneos, equipos, reglas y más"})]}),e.jsxs("a",{href:n.agents.getWhatsAppConnectURL("info_assistant"),target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 px-4 py-3 bg-green-600 hover:bg-green-700 text-white rounded-xl font-bold transition-all shadow-lg hover:shadow-green-500/25",children:[e.jsx(f,{className:"w-5 h-5"}),e.jsx("span",{className:"hidden sm:inline",children:"Chatear en WhatsApp"}),e.jsx("span",{className:"sm:hidden",children:"WhatsApp"})]})]})}),e.jsxs(g,{to:"/AICoach",className:"mb-5 flex items-center gap-3 rounded-2xl border border-orange-500/30 bg-
1orange-500/10 p-4 text-left transition hover:bg-orange-500/15",children:[e.jsx("span",{className:"flex h-11 w-11 items-center justify-center rounded-xl bg-orange-500 text-white",children:e.jsx(b,{className:"h-5 w-5"})}),e.jsxs("span",{className:"min-w-0 flex-1",children:[e.jsx("span",{className:"block font-bold text-white",children:"Abrir AI Coach"}),e.jsx("span",{className:"block text-xs text-slate-400",children:"Genera un consejo corto y escúchalo en audio"})]}),e.jsx(C,{className:"h-5 w-5 text-orange-300"})]}),e.jsxs(y,{className:"bg-slate-900/80 border-slate-800 flex flex-col h-[70vh]",children:[e.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-4",children:[c.length===0?e.jsxs("div",{className:"text-center text-slate-500 py-8",children:[e.jsx(o,{className:"w-12 h-12 mx-auto mb-4 text-purple-500"}),e.jsx("p",{children:"¡Hola! Soy el asistente de FLF Pro League."}),e.jsx("p",{className:"text-sm mt-2",children:"Pregúntame sobre torneos, reglas o equipos."})]}):c.map((s,t)=>e.jsxs("div",{className:`flex gap-3 ${s.role==="user"?"justify-end":"justify-start"}`,children:[s.role==="assistant"&&e.jsx("div",{className:"h-8 w-8 rounded-lg bg-purple-600 flex items-center justify-center flex-shrink-0",children:e.jsx(o,{className:"w-5 h-5 text-white"})}),e.jsx("div",{className:`max-w-[80%] rounded-2xl px-4 py-2.5 ${s.role==="user"?"bg-slate-800 text-white":"bg-purple-600/20 border border-purple-500/30 text-white"}`,children:s.role==="user"?e.jsx("p",{className:"text-sm",children:s.content}):e.jsx(E,{className:"text-sm prose prose-sm prose-invert max-w-none",children:s.content})}),s.role==="user"&&e.jsx("div",{className:"h-8 w-8 rounded-lg bg-slate-700 flex items-center justify-center flex-shrink-0",children:e.jsx(N,{className:"w-5 h-5 text-white"})})]},t)),i&&e.jsxs("div",{className:"flex gap-3 justify-start",children:[e.jsx("div",{className:"h-8 w-8 rounded-lg bg-purple-600 flex items-center justify-center",children:e.jsx(o,{className:"w-5 h-5 text-white"})}),e.jsx("div",{className:"bg-purple-600/20 border border-purple-500/30 rounded-2xl px-4 py-2.5",children:e.jsx(p,{className:"w-5 h-5 text-purple-400 animate-spin"})})]})]}),e.jsx("div",{className:"p-4 border-t border-slate-800",children:e.jsxs("div",{className:"flex gap-2",children:[e.jsx(w,{value:l,onChange:s=>x(s.target.value),onKeyDown:s=>{s.key==="Enter"&&(s.preventDefault(),h())},placeholder:"Escribe tu pregunta...",className:"bg-slate-800 border-slate-700 text-white",disabled:i||!a}),e.jsx(v,{type:"button",onClick:h,"aria-label":"Enviar mensaje",disabled:i||!l.trim()||!a,className:"bg-purple-600 hover:bg-purple-700",children:i?e.jsx(p,{className:"w-5 h-5 animate-spin"}):e.jsx(k,{className:"w-5 h-5"})})]})})]})]})})}export{P 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.