import{j as e}from"./v_7_4_3_73_d3c9bac7-c74e-47f6-ac42-499f067843a53.js";import{a as n}from"./v_7_4_3_73_d3c9bac7-c74e-47f6-ac42-499f067843a52.js";import{aN as l,a as b,r as v,ah as g}from"./v_7_4_3_73_d3c9bac7-c74e-47f6-ac42-499f067843a525.js";import{u as T}from"./v_7_4_3_73_d3c9bac7-c74e-47f6-ac42-499f067843a54.js";import{u as y,z as N}from"./v_7_4_3_73_d3c9bac7-c74e-47f6-ac42-499f067843a55.js";import{U as z}from"./v_7_4_3_73_d3c9bac7-c74e-47f6-ac42-499f067843a587.js";import{aq as m,H as S,D as C,K as F,E as M,aG as k}from"./v_7_4_3_73_d3c9bac7-c74e-47f6-ac42-499f067843a58.js";import"./v_7_4_3_73_d3c9bac7-c74e-47f6-ac42-499f067843a56.js";import"./v_7_4_3_73_d3c9bac7-c74e-47f6-ac42-499f067843a59.js";import"./v_7_4_3_73_d3c9bac7-c74e-47f6-ac42-499f067843a510.js";import"./v_7_4_3_73_d3c9bac7-c74e-47f6-ac42-499f067843a57.js";import"./v_7_4_3_73_d3c9bac7-c74e-47f6-ac42-499f067843a5.js";import"./v_7_4_3_73_d3c9bac7-c74e-47f6-ac42-499f067843a520.js";const c=({id:i,name:r,estado:o,fn:t,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(F,{id:i,estado:o,checkedUpdade:t}),e.jsx(M,{children:r}),a]})})}),A=()=>{const{getSelecionado:i,onChangeSelecionado:r}=l(),[o,t]=n.useState([]);return n.useEffect(()=>{(async()=>t(await N.Labels("getAllLabels")))()},[]),o.map(a=>e.jsx(c,{id:a.id,name:a.name,estado:i(a.id),fn:()=>r(a.id,"labels"),icon:e.jsx(k,{size:20,style:{color:a.hexColor}})}))};function J(){const{active:i,setActive:r,getSelecionado:o,onChangeSelecionado:t}=l(),{language:a}=T(),{isBusiness:u}=y(),{activeTab:x,userTabs:d}=b(),{close:p}=v(),f=["default","labels","userTabs"],h=z();n.useEffect(()=>{x.type!=="custom"&&l.setState({selecionados:[]})},[]);const j={default:[...g,{id:6,name:"transferidos",visibility:!0}].map(s=>s.id!==1&&e.jsx(c,{id:s.name,name:a[s.name],estado:o(s.name),fn:()=>t(s.name,"default"),icon:e.jsx(m,{size:20,className:"text-[var(--primaria)]"})})),labels:e.jsx(A,{}),userTabs:d.length!==0?d.map(s=>e.jsx(c,{id:s.id,name:s.tag,estado:o(s.id),fn:()=>t(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:()=>{p(),h()}})})};return e.jsxs("div",{className:"w-[350px] p-3",children:[e.jsx(C,{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{J as default};
