import{j as e}from"./v_7_4_3_15_0399e866-74c7-4569-9f5c-4e0b92137cdb.js";import{a as i}from"./v_7_4_3_15_0399e866-74c7-4569-9f5c-4e0b92137cdb7.js";import{n as c,v as p}from"./v_7_4_3_15_0399e866-74c7-4569-9f5c-4e0b92137cdb23.js";import{h as l}from"./v_7_4_3_15_0399e866-74c7-4569-9f5c-4e0b92137cdb20.js";import{D as m,bt as d,I as n}from"./v_7_4_3_15_0399e866-74c7-4569-9f5c-4e0b92137cdb11.js";import{b as u,c as g}from"./v_7_4_3_15_0399e866-74c7-4569-9f5c-4e0b92137cdb110.js";import"./v_7_4_3_15_0399e866-74c7-4569-9f5c-4e0b92137cdb8.js";import"./v_7_4_3_15_0399e866-74c7-4569-9f5c-4e0b92137cdb19.js";import"./v_7_4_3_15_0399e866-74c7-4569-9f5c-4e0b92137cdb4.js";import"./v_7_4_3_15_0399e866-74c7-4569-9f5c-4e0b92137cdb3.js";import"./v_7_4_3_15_0399e866-74c7-4569-9f5c-4e0b92137cdb2.js";import"./v_7_4_3_15_0399e866-74c7-4569-9f5c-4e0b92137cdb10.js";import"./v_7_4_3_15_0399e866-74c7-4569-9f5c-4e0b92137cdb6.js";import"./v_7_4_3_15_0399e866-74c7-4569-9f5c-4e0b92137cdb9.js";const h=async o=>{const{activeChat:a}=p.getState(),{whatsappID:t}=l.getState(),s={status:o.status,phone:a.id.user,whatsappID:t};try{const r=await i.post("https://autowebhook.papo.global/webhook/wascript-open-close",s,{headers:{"Content-Type":"application/json",accept:"application/json"}});n({type:"Success",message:`Sucesso ao realizar a ação de ${o.nome} para esse chat`,position:"top-right"})}catch(r){console.error(r),n({type:"Error",message:`Erro ao realizar a ação de ${o.nome} para esse chat `,position:"top-right"})}},x=[{nome:"Iniciar Agente",status:"opened",colorIcon:"text-green-500",icon:e.jsx(u,{size:22})},{nome:"Parar Agente",status:"closed",colorIcon:"text-red-500",icon:e.jsx(g,{size:22})}];function T(){const{close:o}=c();return e.jsxs("div",{className:"px-2 w-fit",children:[e.jsxs("div",{className:"flex gap-1 items-center justify-center",children:[e.jsx(m,{style:{fontSize:"18px",textAlign:"center"},children:"Agente IA"}),e.jsx("span",{className:"group cursor-pointer lg:tooltip lg:tooltip-right","data-tip":"Determine uma ação que o agente deverá executar neste chat",children:e.jsx(d,{className:"h-4 w-4 group-hover:pulse"})})]}),e.jsx("div",{className:"flex flex-col gap-1 mt-2",children:x.map((t,s)=>e.jsxs("div",{className:"flex gap-1 pulse cursor-pointer items-center p-1 rounded-lg hover:bg-[var(--dropdown-background-hover)]",onClick:()=>{h(t),o()},children:[e.jsx("span",{className:t.colorIcon,children:t.icon}),e.jsx("span",{children:t.nome})]},s))})]})}export{T as default};
