import{j as e}from"./v_7_4_3_72_6a457bf5-eeae-4570-8821-bd6fa39c89263.js";import{u as j}from"./v_7_4_3_72_6a457bf5-eeae-4570-8821-bd6fa39c892626.js";import{aJ as v,ae as A,q as g}from"./v_7_4_3_72_6a457bf5-eeae-4570-8821-bd6fa39c892625.js";import{u as b,e as N}from"./v_7_4_3_72_6a457bf5-eeae-4570-8821-bd6fa39c89264.js";import{_ as w,b1 as _,ax as y,bd as C,D as E,al as k,ac as z,bc as L,H as O,C as S,I as T}from"./v_7_4_3_72_6a457bf5-eeae-4570-8821-bd6fa39c89268.js";import{a as l}from"./v_7_4_3_72_6a457bf5-eeae-4570-8821-bd6fa39c89262.js";import{a as M}from"./v_7_4_3_72_6a457bf5-eeae-4570-8821-bd6fa39c8926125.js";import{u as R}from"./v_7_4_3_72_6a457bf5-eeae-4570-8821-bd6fa39c892656.js";import"./v_7_4_3_72_6a457bf5-eeae-4570-8821-bd6fa39c89265.js";import"./v_7_4_3_72_6a457bf5-eeae-4570-8821-bd6fa39c89266.js";import"./v_7_4_3_72_6a457bf5-eeae-4570-8821-bd6fa39c89269.js";import"./v_7_4_3_72_6a457bf5-eeae-4570-8821-bd6fa39c892610.js";import"./v_7_4_3_72_6a457bf5-eeae-4570-8821-bd6fa39c89267.js";import"./v_7_4_3_72_6a457bf5-eeae-4570-8821-bd6fa39c8926.js";import"./v_7_4_3_72_6a457bf5-eeae-4570-8821-bd6fa39c892620.js";import"./v_7_4_3_72_6a457bf5-eeae-4570-8821-bd6fa39c892643.js";const D=l.lazy(() => __vitePreload(()=>import(chrome.runtime.getURL("content/assets/js/v_7_4_3_72_6a457bf5-eeae-4570-8821-bd6fa39c8926184.js")),[]));function n(){return e.jsx(l.Suspense,{fallback:e.jsx(e.Fragment,{}),children:e.jsx(D,{})})}function ee(){const{autoAtendimento:a,deleteAutoAtendimento:r,switchActive:d,duplicateAutoAtendimento:c}=j(),{setEditAutoAtt:m,setResetDefaultAutoAtt:u}=v(),{setAcao:p}=A(),{open:o}=g(),{language:s}=b(),{tutorial_auto_atendimento:i}=N(R(t=>({tutorial_auto_atendimento:t.getUrl("tutoriais","auto_atendimento")}))),x=async t=>{S({content:e.jsxs(e.Fragment,{children:[s.desejaRemoverAutoAtendimento," ",e.jsx("span",{className:"text-[var(--primaria)]",children:t.nome}),"?"]}),confirmText:s.confirm,submit:()=>{r(t.id),T({type:"Success",message:s.autoAtendimentoDeletado,position:"top-right"})}})},h=t=>{p(t.acao),m(t),o(e.jsx(n,{}))},f=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(_,{estado:t.active,switchUpdate:()=>d(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:()=>h(t),"data-tip":s.edit,children:e.jsx(y,{className:"w-5 h-5 text-[var(--panel-header-icon)]"})}),e.jsx("span",{className:"pulse lg:tooltip lg:tooltip-bottom",onClick:()=>x(t),"data-tip":s.delete,children:e.jsx(M,{className:"w-5 h-5 text-[var(--panel-header-icon)]"})}),e.jsx("span",{className:"pulse lg:tooltip lg:tooltip-left",onClick:()=>c(t.id),"data-tip":s.duplic,children:e.jsx(C,{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(E,{children:s.autoAtendimento}),a.length===0?e.jsxs("div",{children:[e.jsx(k,{title:s.nenhumAutoAtendimentoCriado_title,description:s.nenhumAutoAtendimentoCriado_desc,icon:e.jsx(z,{className:"w-7 h-7 text-[var(--primaria)]"})}),e.jsx("div",{className:"flex justify-center",children:i.active&&e.jsx(L,{funcao:()=>window.open(i.link,"_blank")})})]}):e.jsx("div",{className:"flex-1 overflow-y-auto",children:f}),e.jsx("div",{className:"m-auto",children:e.jsx(O,{name:s.create,funcao:()=>{u(),o(e.jsx(n,{}),!1)}})})]})}export{ee as default};
