import{j as e}from"./v_7_4_3_48_026858c9-0735-4edd-ae06-f5f59030b0286.js";import{a as i}from"./v_7_4_3_48_026858c9-0735-4edd-ae06-f5f59030b0282.js";import{h as j,u as E}from"./v_7_4_3_48_026858c9-0735-4edd-ae06-f5f59030b02833.js";import{u as v}from"./v_7_4_3_48_026858c9-0735-4edd-ae06-f5f59030b0285.js";import{ar as b,am as p,ax as u,ad as g}from"./v_7_4_3_48_026858c9-0735-4edd-ae06-f5f59030b0288.js";import{W as w}from"./v_7_4_3_48_026858c9-0735-4edd-ae06-f5f59030b0283.js";import{c as y}from"./v_7_4_3_48_026858c9-0735-4edd-ae06-f5f59030b028112.js";import"./v_7_4_3_48_026858c9-0735-4edd-ae06-f5f59030b02821.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";function H({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 a=(await w.Labels("getAllLabels")).filter(s=>f.includes(s.id)===!1);x(a)}catch(t){console.error("Erro ao buscar labels:",t)}})()},[]),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:t=>{let a=[];c.forEach(s=>{s.name?.toUpperCase().includes(t.toUpperCase())&&a.push(s)}),h(a)},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((t,a)=>t.name.localeCompare(a.name)).map((t,a)=>e.jsx(p,{content:t.name,icon:e.jsx(u,{className:"w-5 h-5",style:{color:t.hexColor}}),setFunction:()=>{r(t.id),l()},stroke:"1"},a)),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{H as default};
