Un vistazo a nuestros proyectos

Exploramos cómo la tecnología, la IA y la automatización pueden mejorar la operativa de tu empresa.

(function(){const s=document.createElement('style');s.textContent='#ci-t{pointer-events:all;position:fixed;bottom:80px;left:24px;width:56px;height:56px;border-radius:50%;background:#1a1a1a;border: none;cursor:pointer;display:flex;align-items:center;justify-content:center;box-shadow:0 4px 12px rgba(0,0,0,.3);z-index:9999;transition:transform .2s}#ci-t:hover{transform:scale(1.05)}#ci-t svg{width:24px;height:24px;fill:#fff}#ci-p{pointer-events:all;position:fixed;bottom:148px;left:24px;width:360px;height:500px;background:#fff;border-radius:16px;box-shadow:0 8px 32px rgba(0,0,0,.15);display:none;flex-direction:column;z-index:9998;overflow:hidden}#ci-p.open{display:flex}#ci-h{background:#1a1a1a;color:#fff;padding:16px 20px;display:flex;align-items:center;gap:10px}.ci-dot{width:8px;height:8px;border-radius:50%;background:#4ade80}#ci-h span{font-size:14px;font-weight:600}#ci-h small{font-size:11px;color:#aaa;margin-left:auto}#ci-m{flex:1;overflow-y:auto;padding:16px;display:flex;flex-direction:column;gap:12px}.ci-msg{max-width:85%;padding:10px 14px;border-radius:12px;font-size:14px;line-height:1.5}.ci-msg.bot{background:#f4f4f4;color:#1a1a1a;align-self:flex-start;border-bottom-left-radius:4px}.ci-msg.user{background:#1a1a1a;color:#fff;a lign-self:flex-end;border-bottom-right-radius:4px}.ci-msg.typing{color:#888;font-style:italic}#ci-ia{padding:12px 16px;border-top:1px solid #eee;display:flex;gap:8px}#ci-i{flex:1;border:1px solid #ddd;border-radius:8px;padding:8px 12px;font-size:14px;outline:none;resize:none;font-family:inherit}#ci-i:focus{border-color:#1a1a1a}#ci-s{background:#1a1a1a;color:#fff;border:none;border-radius:8px;padding:8px 14px;cursor:pointer;font-size:14px;font-weight:600}#ci-s:disabled{opacity:.4;cursor:not-allowed}';document.head.appendChild(s);const h=document.createElement('div');h.innerHTML='
IteraIAAsistente virtual
Hola, soy el asistente de IteraIA. ¿En qué puedo ayudarte?
';document.body.appendChild(h);const W="https://iteraia-chatbot.joelruizd.workers.dev",t=document.getElementById("ci-t"),p=document.getElementById("ci-p"),m=document.getElementById("ci-m"),i=document.getElementById("ci-i"),s2=documen t.getElementById("ci-s");let hs=[];t.addEventListener("click",()=>{p.classList.toggle("open");if(p.classList.contains("open"))i.focus()});function add(txt,role){const d=document.createElement("div");d.className="ci-msg "+role;d.textContent=txt;m.appendChild(d);m.scrollTop=m.scrollHeight;return d}async function send(){const txt=i.value.trim();if(!txt)return;i.value="";s2.disabled=true;add(txt,"user");const ty=add("Escribiendo...","bot typing");try{const r=await fetch(W,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:txt,history:hs})});const data=await r.json();const rep=data.response||"Error.";ty.remove();add(rep,"bot");hs.push({role:"user",content:txt});hs.push({role:"assistant",content:rep});if(hs.length>20)hs=hs.slice(-20)}catch{ty.remove();add("Error de conexión.","bot")}s2.disabled=false;i.focus()}s2.addEventListener("click",send);i.addEventListener("keydown",e=>{if(e.key==="Enter"&&!e.shiftKey){e.preventDefault();send()}})})()