import{j as s,Y as T,V as j,I as g,ai as A,aj as y,ak as C,al as M,y as _}from"./v_7_4_2_1_59f2e4f7-dc00-41f3-9942-b1c61b935c9910.js";import{a as o}from"./v_7_4_2_1_59f2e4f7-dc00-41f3-9942-b1c61b935c994.js";import{u as p}from"./v_7_4_2_1_59f2e4f7-dc00-41f3-9942-b1c61b935c9919.js";import{a as b,D as U}from"./v_7_4_2_1_59f2e4f7-dc00-41f3-9942-b1c61b935c9923.js";import{U as D,a as k}from"./v_7_4_2_1_59f2e4f7-dc00-41f3-9942-b1c61b935c99125.js";import{a as O}from"./v_7_4_2_1_59f2e4f7-dc00-41f3-9942-b1c61b935c99111.js";import"./v_7_4_2_1_59f2e4f7-dc00-41f3-9942-b1c61b935c9918.js";import"./v_7_4_2_1_59f2e4f7-dc00-41f3-9942-b1c61b935c996.js";import"./v_7_4_2_1_59f2e4f7-dc00-41f3-9942-b1c61b935c998.js";import"./v_7_4_2_1_59f2e4f7-dc00-41f3-9942-b1c61b935c99.js";import"./v_7_4_2_1_59f2e4f7-dc00-41f3-9942-b1c61b935c995.js";import"./v_7_4_2_1_59f2e4f7-dc00-41f3-9942-b1c61b935c997.js";import"./v_7_4_2_1_59f2e4f7-dc00-41f3-9942-b1c61b935c999.js";import"./v_7_4_2_1_59f2e4f7-dc00-41f3-9942-b1c61b935c992.js";import"./v_7_4_2_1_59f2e4f7-dc00-41f3-9942-b1c61b935c993.js";const E=({setOpen:i})=>{const{setCreateUserTab:a}=b(),{language:t}=p(),[n,r]=o.useState(""),c=()=>{a(n),g({type:"Success",message:t.newTab_success,position:"top-right"}),i(!1)};return s.jsx("div",{className:"form-control my-3 p-3 animate__animated animate__fadeInDown",children:s.jsx(T,{errorMsg:t.newTab_error,action:c,children:s.jsxs("div",{className:"flex input-group input-group-sm justify-center gap-2",children:[s.jsx("input",{type:"text",placeholder:t.menuTabs_inputPlace,className:"input input-bordered input-sm w-80",value:n,onChange:l=>r(l.target.value),required:!0,minLength:3}),s.jsx(j,{name:t.create})]})})})};function I(){const{variaveisWA:i}=U(),{language:a}=p(),{userTabs:t,setVisibilityUserTab:n}=b(),[r,c]=o.useState(""),m=D(),l=k(),[u,f]=o.useState([]),v=e=>{n(e.id),g({type:"Success",message:e.hide?`${e.tag} ${a.menuTab_DesocutarTab}`:`${e.tag} ${a.menuTab_OcutarTab}`,position:"top-right"})},w=s.jsx("div",{className:"pb-3 px-3 grid gap-2",children:u.map(e=>s.jsxs("div",{className:"flex justify-between cursor-pointer items-center hover:bg-[var(--dropdown-background-hover)] h-9 px-1 py-2 rounded pulse",children:[s.jsxs("div",{className:"flex gap-2",children:[s.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap max-w-[200px]",children:e.tag}),s.jsx("span",{className:i.aba+"tam-aba",style:{backgroundColor:"var(--primaria)"},children:e.chats.length})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx("span",{onClick:()=>l(e),children:s.jsx(A,{className:"w-5 h-5"})}),s.jsx("span",{onClick:()=>m(e),children:s.jsx(O,{className:"w-5 h-5"})}),s.jsx("span",{onClick:()=>v(e),children:e.hide===!0?s.jsx(y,{className:"w-5 h-5"}):s.jsx(C,{className:"w-5 h-5"})})]})]},e.id))}),N=s.jsx("div",{className:"p-4 text-center",children:s.jsx("span",{children:a.notFound})});return s.jsxs("div",{className:"pt-2",children:[s.jsx(M,{filtragem:e=>{let d=[];t.forEach(x=>{var h;(h=x.tag)!=null&&h.toUpperCase().includes(e.toUpperCase())&&d.push(x)}),f(d),c(e)},placeholder:a.pesquisarAbas,dependenciasADD:[t],btnClear:!0}),r.length>0&&u.length===0?N:w]})}function K(){const{language:i}=p(),[a,t]=o.useState(!1),n=()=>{t(!a)};return s.jsxs("div",{className:"w-[25rem]",children:[s.jsxs("div",{className:"p-3 flex items-center justify-between",children:[s.jsx("span",{className:"w-full",children:s.jsx(_,{children:i.menuTabs_title})}),s.jsx("span",{className:"w-[125px]",children:s.jsx(j,{name:i.newTab,funcao:n})})]}),a&&s.jsx(E,{setOpen:t}),s.jsx("div",{"data-id":"list-abas",className:"overflow-auto",style:a?{maxHeight:"calc(100vh - 235px)"}:{maxHeight:"calc(100vh - 155px)"},children:s.jsx(I,{})})]})}export{K as default};
