import{j as s,a2 as C,as as U,a5 as S}from"./v_7_4_2_12_5cc5c70e-17b9-46d5-a61c-750829962ec510.js";import{a as h}from"./v_7_4_2_12_5cc5c70e-17b9-46d5-a61c-750829962ec54.js";import{A as T,b as _,p as q,y as E}from"./v_7_4_2_12_5cc5c70e-17b9-46d5-a61c-750829962ec523.js";import{u as F}from"./v_7_4_2_12_5cc5c70e-17b9-46d5-a61c-750829962ec519.js";import{U as I}from"./v_7_4_2_12_5cc5c70e-17b9-46d5-a61c-750829962ec571.js";import"./v_7_4_2_12_5cc5c70e-17b9-46d5-a61c-750829962ec518.js";import"./v_7_4_2_12_5cc5c70e-17b9-46d5-a61c-750829962ec56.js";import"./v_7_4_2_12_5cc5c70e-17b9-46d5-a61c-750829962ec58.js";import"./v_7_4_2_12_5cc5c70e-17b9-46d5-a61c-750829962ec5.js";import"./v_7_4_2_12_5cc5c70e-17b9-46d5-a61c-750829962ec55.js";import"./v_7_4_2_12_5cc5c70e-17b9-46d5-a61c-750829962ec57.js";import"./v_7_4_2_12_5cc5c70e-17b9-46d5-a61c-750829962ec59.js";import"./v_7_4_2_12_5cc5c70e-17b9-46d5-a61c-750829962ec52.js";import"./v_7_4_2_12_5cc5c70e-17b9-46d5-a61c-750829962ec53.js";function Q(){var m;const{variaveisWA:t}=T(),{userTabs:o,setNewUser:u,setRemoveUser:x}=_(),{language:r}=F(),{close:f}=q(),c=(m=E().activeChat)==null?void 0:m.id,n=c.server==="@lid"?c._serialized:c.user,v=I(),[g,j]=h.useState(""),[l,b]=h.useState([]),A=async e=>{e.chats.find(i=>i.id===n)?x(n,!1,e.id):u(n,e.id)},N=s.jsxs("div",{className:"p-4 flex flex-col gap-2",children:[s.jsx("span",{children:r.emptyAba}),s.jsx(C,{name:r.create,funcao:()=>{f(),v()}})]}),w=s.jsx("div",{className:"p-4 text-center",children:s.jsx("span",{children:r.notFound})}),d=s.jsx(U,{filtragem:e=>{let a=[];o.forEach(i=>{var p;(p=i.tag)!=null&&p.toUpperCase().includes(e.toUpperCase())&&a.push(i)}),b(a),j(e)},placeholder:r.pesquisarAbas,dependenciasADD:[o],btnClear:!0}),y=s.jsx("div",{className:t.modalOptions.content3+"overflow-auto max-w-[350px]",style:{maxHeight:"calc(100vh - 200px)"},children:l.slice().sort((e,a)=>e.tag.localeCompare(a.tag)).map((e,a)=>s.jsx("div",{className:t.listagem.content1+"hoverShadown",children:s.jsx("li",{tabIndex:1,className:t.listagem.content2,"data-animate-dropdown-item":"true",style:{opacity:1},children:s.jsx("label",{htmlFor:"user_tab&"+a,children:s.jsxs("div",{className:t.listagem.content3,children:[s.jsx("div",{className:t.listagem.content4,children:s.jsx(S,{id:"user_tab&"+a,estado:!!e.chats.find(i=>i.id===n),checkedUpdade:()=>{A(e)}})}),s.jsxs("span",{className:t.listagem.content5+" flex",children:[s.jsx("span",{className:"pr-1 overflow-hidden text-ellipsis whitespace-nowrap",children:e.tag}),s.jsx("span",{className:t.aba+"tam-aba bg-[var(--primaria)] !text-[var(--letra)]",children:e.chats.length})]})]})})})},a))});return g.length>0&&l.length===0?s.jsxs("div",{children:[d,w]}):o.length>0?s.jsxs("div",{children:[d,y]}):N}export{Q as default};
