import{j as e,_ as A,a0 as g,ap as b,b7 as N,V as w,aj as _,b6 as y,a2 as C,h as E,I as L}from"./v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab710.js";import{aV as k,aW as z,aX as O,o as T,q as M}from"./v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab723.js";import{u as R}from"./v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab719.js";import{a as d}from"./v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab74.js";import{a as I}from"./v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab7108.js";import{b as S}from"./v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab741.js";import"./v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab718.js";import"./v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab76.js";import"./v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab78.js";import"./v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab7.js";import"./v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab75.js";import"./v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab77.js";import"./v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab79.js";import"./v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab72.js";import"./v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab73.js";const V=d.lazy(() => __vitePreload(()=>import(chrome.runtime.getURL("content/assets/js/v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab7167.js")),[]));function r(){return e.jsx(d.Suspense,{fallback:e.jsx(e.Fragment,{}),children:e.jsx(V,{})})}function ee(){var n,l;const{autoAtendimento:a,deleteAutoAtendimento:c,switchActive:m,duplicateAutoAtendimento:p}=k(),{setEditAutoAtt:u,setResetDefaultAutoAtt:x}=z(),{setAcao:h}=O(),{open:o}=T(),{language:s}=R(),i=M(t=>t.label),f=async t=>{E({content:e.jsxs(e.Fragment,{children:[s.desejaRemoverAutoAtendimento," ",e.jsx("span",{className:"text-[var(--primaria)]",children:t.nome}),"?"]}),confirmText:s.confirm,submit:()=>{c(t.id),L({type:"Success",message:s.autoAtendimentoDeletado,position:"top-right"})}})},j=t=>{h(t.acao),u(t),o(e.jsx(r,{}))},v=e.jsx("div",{className:"flex flex-col gap-2 overflow-auto max-h-full",children:a.map(t=>e.jsxs("div",{className:"rounded-2xl cursor-pointer border border-[var(--conversation-header-border)] border-solid w-full px-2 py-1 hover:bg-[var(--background-default-active)] flex justify-between gap-1 overflow-hidden",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h2",{className:"text-lg font-bold",children:t.nome}),e.jsxs("div",{className:"flex justify-start gap-2 items-center h-9 px-1 pt-2",children:[e.jsx("span",{children:s.active}),e.jsx(g,{estado:t.active,switchUpdate:()=>m(t.id),id:t.id,zoom:{zoom:"60%"}})]})]}),e.jsxs("div",{className:"flex flex-col justify-between flex-shrink-0",children:[e.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[e.jsx("span",{className:"pulse lg:tooltip lg:tooltip-bottom",onClick:()=>j(t),"data-tip":s.edit,children:e.jsx(b,{className:"w-5 h-5 text-[var(--panel-header-icon)]"})}),e.jsx("span",{className:"pulse lg:tooltip lg:tooltip-bottom",onClick:()=>f(t),"data-tip":s.delete,children:e.jsx(I,{className:"w-5 h-5 text-[var(--panel-header-icon)]"})}),e.jsx("span",{className:"pulse lg:tooltip lg:tooltip-left",onClick:()=>p(t.id),"data-tip":s.duplic,children:e.jsx(N,{className:"w-5 h-5 text-[var(--panel-header-icon)]"})})]}),t.usedLenght!==0&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"font-bold text-sm",children:s.atendimentosRealizados}),e.jsx("div",{className:"badge badge-sm bg-[var(--primaria)] text-[var(--letra)] font-bold pb-[2px]",children:t.usedLenght})]})]})]}))});return e.jsxs("div",{className:"w-[800px] max-h-[99.5vh] flex flex-col gap-4",children:[e.jsx(w,{children:s.autoAtendimento}),a.length===0?e.jsxs("div",{children:[e.jsx(_,{title:s.nenhumAutoAtendimentoCriado_title,description:s.nenhumAutoAtendimentoCriado_desc,icon:e.jsx(S,{className:"w-7 h-7 text-[var(--primaria)]"})}),e.jsx("div",{className:"flex justify-center",children:((l=(n=i.videos_tutoriais)==null?void 0:n.auto_atendimento)==null?void 0:l.length)>0&&e.jsx(y,{funcao:()=>window.open(i.videos_tutoriais.auto_atendimento,"_blank")})})]}):e.jsx("div",{className:"flex-1 overflow-y-auto",children:v}),e.jsx("div",{className:"m-auto",children:e.jsx(C,{name:s.create,funcao:()=>{x(),o(e.jsx(r,{}),!1)}})})]})}export{ee as default};
