import{j as e}from"./v_7_4_3_5_5680d44b-ceb1-449a-bec3-8cbef70a2777.js";import{a as i}from"./v_7_4_3_5_5680d44b-ceb1-449a-bec3-8cbef70a27777.js";import{n as c,w as p}from"./v_7_4_3_5_5680d44b-ceb1-449a-bec3-8cbef70a277723.js";import{g as l}from"./v_7_4_3_5_5680d44b-ceb1-449a-bec3-8cbef70a277720.js";import{V as m,bp as d,I as n}from"./v_7_4_3_5_5680d44b-ceb1-449a-bec3-8cbef70a277711.js";import{b as u,c as g}from"./v_7_4_3_5_5680d44b-ceb1-449a-bec3-8cbef70a2777107.js";import"./v_7_4_3_5_5680d44b-ceb1-449a-bec3-8cbef70a27778.js";import"./v_7_4_3_5_5680d44b-ceb1-449a-bec3-8cbef70a277719.js";import"./v_7_4_3_5_5680d44b-ceb1-449a-bec3-8cbef70a27774.js";import"./v_7_4_3_5_5680d44b-ceb1-449a-bec3-8cbef70a27773.js";import"./v_7_4_3_5_5680d44b-ceb1-449a-bec3-8cbef70a27772.js";import"./v_7_4_3_5_5680d44b-ceb1-449a-bec3-8cbef70a277710.js";import"./v_7_4_3_5_5680d44b-ceb1-449a-bec3-8cbef70a27776.js";import"./v_7_4_3_5_5680d44b-ceb1-449a-bec3-8cbef70a27779.js";const h=async t=>{const{activeChat:a}=p.getState(),{whatsappID:o}=l.getState(),s={status:t.status,phone:a.id.user,whatsappID:o};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 ${t.nome} para esse chat`,position:"top-right"})}catch(r){console.error(r),n({type:"Error",message:`Erro ao realizar a ação de ${t.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:t}=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((o,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(o),t()},children:[e.jsx("span",{className:o.colorIcon,children:o.icon}),e.jsx("span",{children:o.nome})]},s))})]})}export{T as default};
