import{j as e}from"./v_7_4_3_28_345c6a4a-aab6-4ec9-a0c6-3718e7fdb1165.js";import{aR as c,aS as d}from"./v_7_4_3_28_345c6a4a-aab6-4ec9-a0c6-3718e7fdb11623.js";import{$ as i}from"./v_7_4_3_28_345c6a4a-aab6-4ec9-a0c6-3718e7fdb1167.js";import{u as x,P as l,r as p}from"./v_7_4_3_28_345c6a4a-aab6-4ec9-a0c6-3718e7fdb1164.js";import"./v_7_4_3_28_345c6a4a-aab6-4ec9-a0c6-3718e7fdb116.js";import"./v_7_4_3_28_345c6a4a-aab6-4ec9-a0c6-3718e7fdb1163.js";import"./v_7_4_3_28_345c6a4a-aab6-4ec9-a0c6-3718e7fdb1162.js";import"./v_7_4_3_28_345c6a4a-aab6-4ec9-a0c6-3718e7fdb1169.js";import"./v_7_4_3_28_345c6a4a-aab6-4ec9-a0c6-3718e7fdb11610.js";import"./v_7_4_3_28_345c6a4a-aab6-4ec9-a0c6-3718e7fdb11620.js";import"./v_7_4_3_28_345c6a4a-aab6-4ec9-a0c6-3718e7fdb1168.js";import"./v_7_4_3_28_345c6a4a-aab6-4ec9-a0c6-3718e7fdb1166.js";const k=({userId:s})=>{const t=c(r=>r.workflows),a=x(r=>r.language),n=r=>{try{const m={id:{id:p(),fromMe:!1,remote:{server:"c.us",user:s,_serialized:l(s)},default_remote:{server:"c.us",user:s,_serialized:l(s)}},type:"chat",body:"Mensagem de teste",t:Math.floor(Date.now()/1e3),isNewMsg:!0};d({msg:m,manualActivation:{workflow:r}})}catch(o){console.error("Erro ao iniciar o fluxo:",o)}};return e.jsx("div",{className:"flex flex-col gap-2 p-4 max-h-[calc(60vh-4rem)] overflow-y-auto min-w-[200px]",children:t.length===0?e.jsxs("div",{className:"flex flex-col items-center gap-3 py-8",children:[e.jsx(i,{size:25,className:"text-4xl text-gray-400"}),e.jsx("p",{className:"text-md text-center",children:a.nenhumFluxoCadastrado}),e.jsx("button",{onClick:()=>chrome.runtime.sendMessage({message:"FLOW"}),className:"px-4 py-2 bg-[var(--primaria)] text-[var(--letra)] rounded-lg transition-transform duration-200 ease-in hover:scale-[1.02]",children:a.abrirPainelDeFluxos})]}):e.jsxs("div",{className:"grid grid-cols-1 gap-2",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold",children:a.iniciarFluxo}),e.jsx("p",{className:"text-sm",children:a.escolhaUmFluxoParaIniciar})]}),t.map(r=>e.jsxs("div",{className:`p-2 border border-solid border-[var(--conversation-header-border)] 
              rounded-lg hover:scale-[1.02] transition-transform duration-200 ease-in-out flex items-center justify-between`,children:[e.jsxs("div",{className:"flex items-center gap-2 w-full",children:[e.jsx(i,{className:"text-xl text-[var(--primaria)]"}),e.jsx("span",{className:"font-medium truncate",style:{maxWidth:"75%"},children:r.name})]}),e.jsx("button",{onClick:()=>n(r),className:"px-3 py-1 bg-[var(--primaria)] text-[var(--letra)] rounded hover:opacity-90 transition-opacity",children:a.iniciar})]},r.id))]})})};export{k as default};
