import{bw as n,bu as s,bv as c,bx as l,by as g}from"./index.69621fe4.js";const{WebrtcNativoEventos:t}=n(),{ligacoes:d}=s(),{agente:r}=c(),{modalActiveCall:i}=l();console.log("*********** BOOT webrtcNativoCallManager iniciado *******************");t.on("notificacao",o=>{try{r.value.filas.find(e=>e.fila===o.to)&&g.create({html:!0,group:!1,timeout:0,message:`<div>
          <div class="q-card__section q-card__section--vert row items-center q-pb-none">
            <div class="text-h6">Notifica\xE7\xE3o de: ${o.from}</div>
          </div>
          <div class="q-card__section q-card__section--vert">
            Mensagem: ${o.msg}
          </div>
        </div>`,color:"red",actions:[{icon:"close",color:"white",round:!0,handler:()=>{}}]})}catch(a){console.log("Erro ao tratar NOTIFICACAO no boot webrtcNativoCallManager",a)}});t.on("NovaLigacao",o=>{try{console.log("****** NOVA liga\xE7\xE3o no boot webrtcNativoCallManager *********",o)}catch(a){console.log("Erro ao tratar nova liga\xE7\xE3o no boot webrtcNativoCallManager",a)}});t.on("FimLigacao",o=>{try{if(console.log("****** FIM liga\xE7\xE3o no boot webrtcNativoCallManager *********",o),i.value&&(i.value=!1),o&&o.DataAtendimento){const a=Math.round((new Date().getTime()-o.DataAtendimento.getTime())/1e3),e={agente:r.value.fullname,dataHora:new Date(o.dateIn),idQueueChat:o.callid,inOut:1,queue:o.queue,numero:o.from,dados_adicionais:a,status_atendimento:"Atendida",queueTypeID:1};o.tags&&Array.isArray(o.tags)&&(e.tags=o.tags),console.log("**** Add ligacao hist\xF3rico *****: ",e),d.value.unshift(e)}}catch(a){console.log("Erro ao tratar FIM liga\xE7\xE3o no boot webrtcNativoCallManager",a)}});
