import{j as e}from"./v_7_4_3_20_36aa665d-161a-48bb-8a6b-20d06cac9c195.js";import{r as g}from"./v_7_4_3_20_36aa665d-161a-48bb-8a6b-20d06cac9c19.js";import{u as f}from"./v_7_4_3_20_36aa665d-161a-48bb-8a6b-20d06cac9c194.js";import{u as j}from"./v_7_4_3_20_36aa665d-161a-48bb-8a6b-20d06cac9c1927.js";import{u as v}from"./v_7_4_3_20_36aa665d-161a-48bb-8a6b-20d06cac9c19126.js";import{bO as w,ai as N,p as b,o as y,C,I as A}from"./v_7_4_3_20_36aa665d-161a-48bb-8a6b-20d06cac9c197.js";import{V as L}from"./v_7_4_3_20_36aa665d-161a-48bb-8a6b-20d06cac9c19229.js";import{A as _,L as k}from"./v_7_4_3_20_36aa665d-161a-48bb-8a6b-20d06cac9c1912.js";import{a as T}from"./v_7_4_3_20_36aa665d-161a-48bb-8a6b-20d06cac9c19154.js";import{a as E}from"./v_7_4_3_20_36aa665d-161a-48bb-8a6b-20d06cac9c19110.js";import"./v_7_4_3_20_36aa665d-161a-48bb-8a6b-20d06cac9c193.js";import"./v_7_4_3_20_36aa665d-161a-48bb-8a6b-20d06cac9c192.js";import"./v_7_4_3_20_36aa665d-161a-48bb-8a6b-20d06cac9c1923.js";import"./v_7_4_3_20_36aa665d-161a-48bb-8a6b-20d06cac9c199.js";import"./v_7_4_3_20_36aa665d-161a-48bb-8a6b-20d06cac9c1910.js";import"./v_7_4_3_20_36aa665d-161a-48bb-8a6b-20d06cac9c1920.js";import"./v_7_4_3_20_36aa665d-161a-48bb-8a6b-20d06cac9c198.js";import"./v_7_4_3_20_36aa665d-161a-48bb-8a6b-20d06cac9c196.js";function X(){const{setViewContatos:n}=v(),{agrupamentos:t,setAgrupamentos:c}=j(),{language:a}=f(),[o,d]=g.useState(0),p=s=>{C({content:e.jsxs(e.Fragment,{children:[" ",a.deseja_deletar," "," ",e.jsx("strong",{style:{color:s.color},children:s.name}),"? "]}),confirmText:a.confirm,submit:()=>{A({type:"Success",message:a.agrupamento_deletado,position:"top-right"});const r=t.filter(l=>l.id!==s.id);c([...r])}})},m=s=>{n({isOpen:!1,type:"edit",content:s})},x=e.jsx("div",{className:"flex flex-col w-[235px] overflow-y-auto overflow-x-hidden ",style:{maxHeight:"calc(100vh - 240px)"},children:t.map((s,r)=>e.jsxs("div",{className:"flex gap-1 items-center border-b border-base-300 cursor-pointer hover:bg-base-300 p-1 px-2 rounded "+(o===r?"!bg-base-300":void 0),onClick:()=>d(r),children:[e.jsx("span",{children:e.jsx(w,{className:"w-5h-5",style:{color:s.color}})}),e.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap w-[150px]",children:s.name}),e.jsxs("span",{className:"flex w-[25px] justify-between",children:[e.jsx("span",{className:"pulse cursor-pointer",onClick:()=>m(s),children:e.jsx(N,{className:"w-5 h-5 text-[var(--panel-header-icon)]"})}),e.jsx("span",{className:"pulse cursor-pointer",onClick:l=>{l.stopPropagation(),p(s)},children:e.jsx(E,{className:"w-5 h-5 text-[var(--panel-header-icon)]"})})]})]},r))}),h=({index:s,key:r,style:l})=>{const i=t[o]?.chats[s];if(i)return e.jsx("li",{style:l,children:e.jsxs("div",{className:"flex gap-1 items-center px-2",children:[e.jsx(L,{id:i.id}),e.jsx("span",{className:"font-bold text-base overflow-hidden text-ellipsis whitespace-nowrap max-w-[200px]",children:i.name}),e.jsx("span",{children:i.id.includes("@")?i.id.split("@")[0]:i.id})]})},i.id)},u=e.jsx("div",{className:"w-full pt-2",children:e.jsx("ul",{className:"gap-2 overflow-y-auto overflow-x-hidden justify-center",style:{maxHeight:"calc(100vh - 240px)",height:"calc(100vh - 240px)",width:"350px"},children:e.jsx(_,{children:({width:s,height:r})=>e.jsx(k,{width:s,height:r,rowCount:t[o]?t[o]?.chats.length:0,rowHeight:25,rowRenderer:h})})})});return e.jsxs("div",{style:{height:"calc(100vh - 110px)"},children:[e.jsx(b,{children:a.organiza_cts}),e.jsxs("div",{className:"flex gap-2 items-center p-2",children:[e.jsx(y,{children:a.agrupamentos_salvos}),e.jsx("span",{className:"pulse cursor-pointer lg:tooltip lg:tooltip-right","data-tip":a.voltar,onClick:()=>n({isOpen:!1,type:"create",content:[]}),children:e.jsx(T,{className:"w-6 h-6 text-[var(--primaria)]",strokeWidth:1})})]}),e.jsxs("div",{className:"flex pt-4 gap-12",children:[e.jsxs("div",{className:"flex flex-col gap-4 justify-start",children:[e.jsxs("div",{className:"indicator",children:[t.length!==0&&e.jsxs("span",{className:"indicator-item badge bg-[var(--primaria)] text-[var(--letra)] font-medium",children:["+",t.length]}),e.jsx("span",{className:"p-2 text-xl",children:a.agrupamentos_criados})]}),t.length!==0?x:e.jsx("div",{className:"p-4 border-dotted border rounded-lg text-center mt-2 border-[var(--terciaria)]",children:a.nenhum_agrupamento})]}),e.jsx("div",{className:"flex flex-col gap-4 justify-start",children:t.length!==0?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"indicator",children:[t[o]?.chats.length!==0&&e.jsxs("span",{className:"indicator-item badge bg-[var(--primaria)] text-[var(--letra)] font-medium",children:["+",t[o]?.chats.length]}),e.jsx("span",{className:"p-2 text-xl",children:a.cts_selecionados})]}),u]}):null})]})]})}export{X as default};
