import{j as e,r as t}from"./v_7_4_2_25_48461181-0d14-4d2a-b9c3-5de50369a90b.js";import{u as d}from"./v_7_4_2_25_48461181-0d14-4d2a-b9c3-5de50369a90b62.js";import{u as T,b as C}from"./v_7_4_2_25_48461181-0d14-4d2a-b9c3-5de50369a90b20.js";import{aE as I,b as M,z,p as P,q as F,aF as v,aA as w}from"./v_7_4_2_25_48461181-0d14-4d2a-b9c3-5de50369a90b24.js";import{W as p}from"./v_7_4_2_25_48461181-0d14-4d2a-b9c3-5de50369a90b19.js";import{_ as o,aa as k,T as R,aH as S,ap as O,aI as U,aq as D,z as V,I as L}from"./v_7_4_2_25_48461181-0d14-4d2a-b9c3-5de50369a90b11.js";import{b as q}from"./v_7_4_2_25_48461181-0d14-4d2a-b9c3-5de50369a90b59.js";const B=t.lazy(() => __vitePreload(()=>import(chrome.runtime.getURL("content/assets/js/v_7_4_2_25_48461181-0d14-4d2a-b9c3-5de50369a90b137.js")),[]));function W(){return e.jsx(t.Suspense,{fallback:e.jsx(e.Fragment,{}),children:e.jsx(B,{})})}const N=t.lazy(() => __vitePreload(()=>import(chrome.runtime.getURL("content/assets/js/v_7_4_2_25_48461181-0d14-4d2a-b9c3-5de50369a90b138.js")),[]));function H(){return e.jsx(t.Suspense,{fallback:e.jsx(e.Fragment,{}),children:e.jsx(N,{})})}const G=t.lazy(() => __vitePreload(()=>import(chrome.runtime.getURL("content/assets/js/v_7_4_2_25_48461181-0d14-4d2a-b9c3-5de50369a90b139.js")),[]));function J({setUserLabels:s,userLabels:l}){return e.jsx(t.Suspense,{fallback:e.jsx(e.Fragment,{}),children:e.jsx(G,{setUserLabels:s,userLabels:l})})}const K=t.lazy(() => __vitePreload(()=>import(chrome.runtime.getURL("content/assets/js/v_7_4_2_25_48461181-0d14-4d2a-b9c3-5de50369a90b140.js")),[]));function Q(){return e.jsx(t.Suspense,{fallback:e.jsx(e.Fragment,{}),children:e.jsx(K,{})})}const X=t.lazy(() => __vitePreload(()=>import(chrome.runtime.getURL("content/assets/js/v_7_4_2_25_48461181-0d14-4d2a-b9c3-5de50369a90b141.js")),[]));function Y({userId:s}){return e.jsx(t.Suspense,{fallback:e.jsx(e.Fragment,{}),children:e.jsx(X,{userId:s})})}const Z=t.lazy(() => __vitePreload(()=>import(chrome.runtime.getURL("content/assets/js/v_7_4_2_25_48461181-0d14-4d2a-b9c3-5de50369a90b142.js")),[]));function $({userId:s}){return e.jsx(t.Suspense,{fallback:e.jsx(e.Fragment,{}),children:e.jsx(Z,{userId:s})})}function ce(){const{language:s}=T(d(a=>({language:a.language}))),{pinChat:l,isPin:f}=I(d(a=>({pin:a.pin,pinChat:a.pinChat,isPin:a.isPin}))),{getUserAbasTam:h}=M(d(a=>({userTabs:a.userTabs,getUserAbasTam:a.getUserAbasTam}))),g=C(a=>a.isBusiness),u=z(a=>a.activeChat.id.user),x=z(a=>a.activeChat?.default_id?._serialized),A=P(a=>a.open),r=F(a=>a.open),y=async()=>{await w("clear_message")!==!0&&(await p.Msg("showClearMsg")?L({type:"Success",message:s.asMensagensApagasForamRecuperadas,position:"top-right"}):L({type:"Error",message:s.nenhumaMensagemApagadaFoiRecuperada,position:"top-right"}))},[i,_]=t.useState(null);return t.useEffect(()=>{g&&(async()=>{try{const n=await p.Labels("getAllLabels"),b=await p.Utils("getContato",x);if(b==="undefined")return;const E=b.labels.map(m=>n.find(c=>c.hexColor&&c.id===m)).filter(Boolean).map(({id:m,name:c,hexColor:j})=>({id:m,name:c,color:j,hexColor:j}));_(E)}catch(n){console.error(s.erroAoBuscarLabels,n)}})()},[x]),[{id:"init_fluxo",name:s.iniciarUmFluxoParaEsteContato,icon:e.jsx(k,{size:20}),function:a=>r(e.jsx($,{userId:u}),{placement:"bottom"},a.target,15)},{id:"fixar_chat",name:f()?s.desafixarChat:s.fixarChat,icon:e.jsx(R,{className:f()?"!text-[var(--wds-teal-500)]":"",size:20}),function:()=>l()},{id:"show_clean_messages",name:s.exibirMensagensApagadasRecente,icon:e.jsx(v,{size:20,strokeWidth:"1.8"}),function:()=>y()},{id:"traducao_com_IA",name:s.traducaoComIA,icon:e.jsx(S,{size:20}),function:()=>A(e.jsx(W,{}))},{id:"user_tabs",name:s.userTabs,icon:e.jsx(O,{size:20}),tam:h(u),function:a=>r(e.jsx(H,{}),{placement:"bottom"},a.target,15)},{id:"labels",name:s.tags,icon:i&&i.length>0?e.jsx("div",{className:"flex",children:i.map((a,n)=>e.jsx("span",{style:n!==0?{marginLeft:"-1rem"}:null,children:e.jsx(U,{size:24,style:{color:a.color}})},n))}):e.jsx(D,{size:20}),function:a=>r(e.jsx(J,{setUserLabels:_,userLabels:i}),{placement:"bottom"},a.target.parentNode.parentNode,15),disabled:!g},{id:"transferir_atendimento",name:s.transferirAtendimento,icon:e.jsx(V,{size:20}),function:a=>r(e.jsx(Q,{}),{placement:"bottom"},a.target,15)},{id:"close_atendimento",name:s.fimAtendimento_encerrar,icon:e.jsx(q,{size:20}),function:a=>r(e.jsx(Y,{userId:u}),{placement:"bottom"},a.target,15)}]}export{ce as R};
