import{j as e}from"./v_7_4_3_23_c059010f-ff6a-45e1-bfa2-f58a98f4a3915.js";import{r as i}from"./v_7_4_3_23_c059010f-ff6a-45e1-bfa2-f58a98f4a391.js";import{ac as j,n as E}from"./v_7_4_3_23_c059010f-ff6a-45e1-bfa2-f58a98f4a39123.js";import{u as v}from"./v_7_4_3_23_c059010f-ff6a-45e1-bfa2-f58a98f4a3914.js";import{al as b,af as p,ax as u,ac as g}from"./v_7_4_3_23_c059010f-ff6a-45e1-bfa2-f58a98f4a3917.js";import{W as w}from"./v_7_4_3_23_c059010f-ff6a-45e1-bfa2-f58a98f4a3912.js";import{c as y}from"./v_7_4_3_23_c059010f-ff6a-45e1-bfa2-f58a98f4a391107.js";import"./v_7_4_3_23_c059010f-ff6a-45e1-bfa2-f58a98f4a3913.js";import"./v_7_4_3_23_c059010f-ff6a-45e1-bfa2-f58a98f4a3919.js";import"./v_7_4_3_23_c059010f-ff6a-45e1-bfa2-f58a98f4a39110.js";import"./v_7_4_3_23_c059010f-ff6a-45e1-bfa2-f58a98f4a39120.js";import"./v_7_4_3_23_c059010f-ff6a-45e1-bfa2-f58a98f4a3918.js";import"./v_7_4_3_23_c059010f-ff6a-45e1-bfa2-f58a98f4a3916.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};
