import{j as e}from"./v_7_4_3_42_40a29d0b-9b36-4e19-997c-87ed486b67155.js";import{r as i}from"./v_7_4_3_42_40a29d0b-9b36-4e19-997c-87ed486b6715.js";import{ad as j,n as E}from"./v_7_4_3_42_40a29d0b-9b36-4e19-997c-87ed486b671523.js";import{u as v}from"./v_7_4_3_42_40a29d0b-9b36-4e19-997c-87ed486b67154.js";import{al as b,af as p,ax as u,ac as g}from"./v_7_4_3_42_40a29d0b-9b36-4e19-997c-87ed486b67157.js";import{W as w}from"./v_7_4_3_42_40a29d0b-9b36-4e19-997c-87ed486b67152.js";import{c as y}from"./v_7_4_3_42_40a29d0b-9b36-4e19-997c-87ed486b6715106.js";import"./v_7_4_3_42_40a29d0b-9b36-4e19-997c-87ed486b67153.js";import"./v_7_4_3_42_40a29d0b-9b36-4e19-997c-87ed486b67159.js";import"./v_7_4_3_42_40a29d0b-9b36-4e19-997c-87ed486b671510.js";import"./v_7_4_3_42_40a29d0b-9b36-4e19-997c-87ed486b67158.js";import"./v_7_4_3_42_40a29d0b-9b36-4e19-997c-87ed486b671520.js";import"./v_7_4_3_42_40a29d0b-9b36-4e19-997c-87ed486b67156.js";function U({onSelect:r,btnCancel:d=!1,labelsRM:f=[]}){const{variaveisWA:o}=j(),{close:l}=E(),{language:n}=v(),[c,x]=i.useState([]),[m,h]=i.useState([]);return i.useEffect(()=>{(async()=>{try{const t=(await w.Labels("getAllLabels")).filter(s=>f.includes(s.id)===!1);x(t)}catch(a){console.error("Erro ao buscar labels:",a)}})()},[]),e.jsx("div",{style:{position:"initial"},children:e.jsx("ul",{className:"overflow-hidden flex "+o.modalOptions.content2,children:e.jsxs("div",{className:o.modalOptions.content3,children:[e.jsx(b,{filtragem:a=>{let t=[];c.forEach(s=>{s.name?.toUpperCase().includes(a.toUpperCase())&&t.push(s)}),h(t)},placeholder:n.pesquisarEtiquetas,dependenciasADD:[c],btnClear:!0}),e.jsxs("div",{className:"max-w-[300px] overflow-x-hidden overflow-y-auto "+o.listagem.content1,style:{maxHeight:"calc(100vh - 63px)"},children:[d&&e.jsx(p,{content:n.cancelSelection,icon:e.jsx(y,{className:"w-5 h-5 text-red-500"}),setFunction:()=>{r(""),l()},stroke:"1"}),m.slice().sort((a,t)=>a.name.localeCompare(t.name)).map((a,t)=>e.jsx(p,{content:a.name,icon:e.jsx(u,{className:"w-5 h-5",style:{color:a.hexColor}}),setFunction:()=>{r(a.id),l()},stroke:"1"},t)),m.length===0&&e.jsx(g,{icon:e.jsx(u,{className:"w-5 h-5 text-[var(--primaria)]"}),title:"Nenhuma Etiqueta foi Encontrada",description:"Nenhuma Etiqueta foi criada. Crie uma para começar a utilizár essa funcionalidade"})]})]})})})}export{U as default};
