import{j as e,av as v,ah as w,H as N,y as b,b as y,I as C}from"./v_7_4_1_31_281d2484-5da9-48a8-8939-2c37d755bb5b10.js";import{a as A}from"./v_7_4_1_31_281d2484-5da9-48a8-8939-2c37d755bb5b4.js";import{u as L}from"./v_7_4_1_31_281d2484-5da9-48a8-8939-2c37d755bb5b19.js";import{u as _}from"./v_7_4_1_31_281d2484-5da9-48a8-8939-2c37d755bb5b28.js";import{a as k}from"./v_7_4_1_31_281d2484-5da9-48a8-8939-2c37d755bb5b21.js";import{V as T}from"./v_7_4_1_31_281d2484-5da9-48a8-8939-2c37d755bb5b140.js";import{A as E,L as H}from"./v_7_4_1_31_281d2484-5da9-48a8-8939-2c37d755bb5b5.js";import{a as M}from"./v_7_4_1_31_281d2484-5da9-48a8-8939-2c37d755bb5b79.js";import{a as S}from"./v_7_4_1_31_281d2484-5da9-48a8-8939-2c37d755bb5b111.js";import"./v_7_4_1_31_281d2484-5da9-48a8-8939-2c37d755bb5b18.js";import"./v_7_4_1_31_281d2484-5da9-48a8-8939-2c37d755bb5b8.js";import"./v_7_4_1_31_281d2484-5da9-48a8-8939-2c37d755bb5b.js";import"./v_7_4_1_31_281d2484-5da9-48a8-8939-2c37d755bb5b7.js";import"./v_7_4_1_31_281d2484-5da9-48a8-8939-2c37d755bb5b9.js";import"./v_7_4_1_31_281d2484-5da9-48a8-8939-2c37d755bb5b23.js";import"./v_7_4_1_31_281d2484-5da9-48a8-8939-2c37d755bb5b6.js";import"./v_7_4_1_31_281d2484-5da9-48a8-8939-2c37d755bb5b2.js";import"./v_7_4_1_31_281d2484-5da9-48a8-8939-2c37d755bb5b3.js";import"./v_7_4_1_31_281d2484-5da9-48a8-8939-2c37d755bb5b47.js";function ee(){var c,d;const{setViewContacts:n}=k(),{agrupamentos:t,setAgrupamentos:m}=_(),{language:a}=L(),[l,x]=A.useState(0),h=s=>{y({content:e.jsxs(e.Fragment,{children:[" ",a.deseja_deletar," "," ",e.jsx("strong",{style:{color:s.color},children:s.name}),"? "]}),confirmText:a.confirm,submit:()=>{C({type:"Success",message:a.agrupamento_deletado,position:"top-right"});const r=t.filter(i=>i.id!==s.id);m([...r])}})},u=s=>{n({isOpen:!1,type:"edit",content:s})},g=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 "+(l===r?"!bg-base-300":void 0),onClick:()=>x(r),children:[e.jsx("span",{children:e.jsx(v,{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:()=>u(s),children:e.jsx(w,{className:"w-5 h-5 text-[var(--panel-header-icon)]"})}),e.jsx("span",{className:"pulse cursor-pointer",onClick:i=>{i.stopPropagation(),h(s)},children:e.jsx(S,{className:"w-5 h-5 text-[var(--panel-header-icon)]"})})]})]},r))}),f=({index:s,key:r,style:i})=>{var p;const o=(p=t[l])==null?void 0:p.chats[s];if(o)return e.jsx("li",{style:i,children:e.jsxs("div",{className:"flex gap-1 items-center px-2",children:[e.jsx(T,{id:o.id}),e.jsx("span",{className:"font-bold text-base overflow-hidden text-ellipsis whitespace-nowrap max-w-[200px]",children:o.name}),e.jsx("span",{children:o.id.includes("@")?o.id.split("@")[0]:o.id})]})},o.id)},j=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(E,{children:({width:s,height:r})=>{var i;return e.jsx(H,{width:s,height:r,rowCount:t[l]?(i=t[l])==null?void 0:i.chats.length:0,rowHeight:25,rowRenderer:f})}})})});return e.jsxs("div",{style:{height:"calc(100vh - 110px)"},children:[e.jsx(N,{children:a.organiza_cts}),e.jsxs("div",{className:"flex gap-2 items-center p-2",children:[e.jsx(b,{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(M,{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?g: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:[((c=t[l])==null?void 0:c.chats.length)!==0&&e.jsxs("span",{className:"indicator-item badge bg-[var(--primaria)] text-[var(--letra)] font-medium",children:["+",(d=t[l])==null?void 0:d.chats.length]}),e.jsx("span",{className:"p-2 text-xl",children:a.cts_selecionados})]}),j]}):null})]})]})}export{ee as default};
