import{j as e}from"./v_7_4_3_48_026858c9-0735-4edd-ae06-f5f59030b0286.js";import{a as n}from"./v_7_4_3_48_026858c9-0735-4edd-ae06-f5f59030b0282.js";import{az as l,u as b,a3 as v}from"./v_7_4_3_48_026858c9-0735-4edd-ae06-f5f59030b02821.js";import{u as g,d as T}from"./v_7_4_3_48_026858c9-0735-4edd-ae06-f5f59030b0285.js";import{u as y}from"./v_7_4_3_48_026858c9-0735-4edd-ae06-f5f59030b02833.js";import{U as N}from"./v_7_4_3_48_026858c9-0735-4edd-ae06-f5f59030b02878.js";import{ai as d,c as z,a as S,e as C,b as F,ax as M}from"./v_7_4_3_48_026858c9-0735-4edd-ae06-f5f59030b0288.js";import{W as P}from"./v_7_4_3_48_026858c9-0735-4edd-ae06-f5f59030b0283.js";import"./v_7_4_3_48_026858c9-0735-4edd-ae06-f5f59030b0284.js";import"./v_7_4_3_48_026858c9-0735-4edd-ae06-f5f59030b02820.js";import"./v_7_4_3_48_026858c9-0735-4edd-ae06-f5f59030b028.js";import"./v_7_4_3_48_026858c9-0735-4edd-ae06-f5f59030b02838.js";import"./v_7_4_3_48_026858c9-0735-4edd-ae06-f5f59030b0289.js";import"./v_7_4_3_48_026858c9-0735-4edd-ae06-f5f59030b02810.js";import"./v_7_4_3_48_026858c9-0735-4edd-ae06-f5f59030b0287.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(C,{id:i,estado:o,checkedUpdade:t}),e.jsx(F,{children:r}),a]})})}),k=()=>{const{getSelecionado:i,onChangeSelecionado:r}=l(),[o,t]=n.useState([]);return n.useEffect(()=>{(async()=>t(await P.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(M,{size:20,style:{color:a.hexColor}})}))};function Q(){const{active:i,setActive:r,getSelecionado:o,onChangeSelecionado:t}=l(),{language:a}=g(),{isBusiness:u}=T(),{activeTab:p,userTabs:m}=b(),{close:x}=y(),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:o(s.name),fn:()=>t(s.name,"default"),icon:e.jsx(d,{size:20,className:"text-[var(--primaria)]"})})),labels:e.jsx(k,{}),userTabs:m.length!==0?m.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(d,{size:20,className:"text-[var(--primaria)]"})})):e.jsx("div",{className:"m-auto",children:e.jsx(z,{name:a.create,funcao:()=>{x(),h()}})})};return e.jsxs("div",{className:"w-[350px] p-3",children:[e.jsx(S,{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{Q as default};
