import{r as n,j as e}from"./v_7_4_3_5_5680d44b-ceb1-449a-bec3-8cbef70a2777.js";import{b2 as l,u as b,n as g,ap as v}from"./v_7_4_3_5_5680d44b-ceb1-449a-bec3-8cbef70a277723.js";import{u as T,g as y}from"./v_7_4_3_5_5680d44b-ceb1-449a-bec3-8cbef70a277720.js";import{U as N}from"./v_7_4_3_5_5680d44b-ceb1-449a-bec3-8cbef70a277773.js";import{as as m,$ as S,V as z,a1 as C,X as F,aL as L}from"./v_7_4_3_5_5680d44b-ceb1-449a-bec3-8cbef70a277711.js";import{W as M}from"./v_7_4_3_5_5680d44b-ceb1-449a-bec3-8cbef70a277719.js";import"./v_7_4_3_5_5680d44b-ceb1-449a-bec3-8cbef70a27778.js";import"./v_7_4_3_5_5680d44b-ceb1-449a-bec3-8cbef70a27777.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 c=({id:i,name:r,estado:t,fn:o,icon:a})=>e.jsx("div",{className:"w-full",children:e.jsx("label",{htmlFor:i,children:e.jsxs("div",{className:"flex gap-1 items-center cursor-pointer",children:[e.jsx(C,{id:i,estado:t,checkedUpdade:o}),e.jsx(F,{children:r}),a]})})}),P=()=>{const{getSelecionado:i,onChangeSelecionado:r}=l(),[t,o]=n.useState([]);return n.useEffect(()=>{(async()=>o(await M.Labels("getAllLabels")))()},[]),t.map(a=>e.jsx(c,{id:a.id,name:a.name,estado:i(a.id),fn:()=>r(a.id,"labels"),icon:e.jsx(L,{size:20,style:{color:a.hexColor}})}))};function D(){const{active:i,setActive:r,getSelecionado:t,onChangeSelecionado:o}=l(),{language:a}=T(),{isBusiness:u}=y(),{activeTab:p,userTabs:d}=b(),{close:x}=g(),f=["default","labels","userTabs"],h=N();n.useEffect(()=>{p.type!=="custom"&&l.setState({selecionados:[]})},[]);const j={default:[...v,{id:6,name:"transferidos",visibility:!0}].map(s=>s.id!==1&&e.jsx(c,{id:s.name,name:a[s.name],estado:t(s.name),fn:()=>o(s.name,"default"),icon:e.jsx(m,{size:20,className:"text-[var(--primaria)]"})})),labels:e.jsx(P,{}),userTabs:d.length!==0?d.map(s=>e.jsx(c,{id:s.id,name:s.tag,estado:t(s.id),fn:()=>o(s.id,"userTabs",s.chats),icon:e.jsx(m,{size:20,className:"text-[var(--primaria)]"})})):e.jsx("div",{className:"m-auto",children:e.jsx(S,{name:a.create,funcao:()=>{x(),h()}})})};return e.jsxs("div",{className:"w-[350px] p-3",children:[e.jsx(z,{children:a.customFilter}),e.jsx("div",{className:"tabs tabs-bordered mt-4",children:f.map(s=>{if(!(!u&&s==="labels"))return e.jsxs("label",{className:"tab "+(s===i?"tab-active !border-[var(--primaria)]":""),htmlFor:s,children:[e.jsx("span",{children:a["filter_"+s]}),e.jsx("input",{id:s,type:"checkbox",checked:s===i,onChange:()=>r(s),className:"hidden"})]})})}),e.jsx("div",{className:"flex gap-1 flex-col mt-4 overflow-y-auto",style:{maxHeight:"30vh"},children:j[i]})]})}export{D as default};
