import{j as s,a4 as C,ax as U,a7 as y}from"./v_7_4_2_16_364f475f-21c1-4d89-bf17-70efc8c405b710.js";import{a as p}from"./v_7_4_2_16_364f475f-21c1-4d89-bf17-70efc8c405b74.js";import{A as q,b as S,q as T,z as E}from"./v_7_4_2_16_364f475f-21c1-4d89-bf17-70efc8c405b723.js";import{u as F}from"./v_7_4_2_16_364f475f-21c1-4d89-bf17-70efc8c405b719.js";import{U as I}from"./v_7_4_2_16_364f475f-21c1-4d89-bf17-70efc8c405b769.js";import"./v_7_4_2_16_364f475f-21c1-4d89-bf17-70efc8c405b718.js";import"./v_7_4_2_16_364f475f-21c1-4d89-bf17-70efc8c405b76.js";import"./v_7_4_2_16_364f475f-21c1-4d89-bf17-70efc8c405b78.js";import"./v_7_4_2_16_364f475f-21c1-4d89-bf17-70efc8c405b7.js";import"./v_7_4_2_16_364f475f-21c1-4d89-bf17-70efc8c405b75.js";import"./v_7_4_2_16_364f475f-21c1-4d89-bf17-70efc8c405b77.js";import"./v_7_4_2_16_364f475f-21c1-4d89-bf17-70efc8c405b79.js";import"./v_7_4_2_16_364f475f-21c1-4d89-bf17-70efc8c405b72.js";import"./v_7_4_2_16_364f475f-21c1-4d89-bf17-70efc8c405b73.js";function K(){const{variaveisWA:t}=q(),{userTabs:o,setNewUser:h,setRemoveUser:u}=S(),{language:r}=F(),{close:x}=T(),c=E(e=>{var a;return(a=e.activeChat)==null?void 0:a.id}),n=c.server==="@lid"?c._serialized:c.user,f=I(),[v,g]=p.useState(""),[l,j]=p.useState([]),b=async e=>{e.chats.find(i=>i.id===n)?u(n,!1,e.id):h(n,e.id)},A=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:()=>{x(),f()}})]}),N=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 m;(m=i.tag)!=null&&m.toUpperCase().includes(e.toUpperCase())&&a.push(i)}),j(a),g(e)},placeholder:r.pesquisarAbas,dependenciasADD:[o],btnClear:!0}),w=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(y,{id:"user_tab&"+a,estado:!!e.chats.find(i=>i.id===n),checkedUpdade:()=>{b(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 v.length>0&&l.length===0?s.jsxs("div",{children:[d,N]}):o.length>0?s.jsxs("div",{children:[d,w]}):A}export{K as default};

