PageSourceSearch

https://app.escolaotimaideia.com.br/assets/MarketingTemplates-BN3xJ5Gp.js

js escolaotimaideia.com.br collected 2026-10-07 03:57:14 UTC 38,339 bytes, 97 lines download raw bytes

1import{u as z,j as e}from"./query-vendor-76BjcVwl.js";import{r as o}from"./react-vendor-BhAX4HEa.js";import{D as ne,r as ce,s as de,t as me,v as pe,ae as _,I as $,S as U,j as V,k as H,l as G,m as j,T as ve,x as I,ab as Oe,C as b,c as W,d as X,A as ue,e as D,B as x,aQ as Ne,aR as _e,a3 as he,$ as Q,aS as je,w as g,K as k,Y as Ce,aT as fe,a1 as Ie,y as Re,ag as Se,a5 as Te}from"./index-BFRwOgAy.js";import{B as Le}from"./BasePageLayout-kjjNEMg1.js";import{MarketingService as Z}from"./marketingService-DNILb4w1.js";import{S as Y}from"./switch-Clxwz-qk.js";import{C as Ae,a as ge,b as Ee}from"./collapsible-CsFHNMzk.js";import{TemplateProcessorService as F}from"./templateProcessorService-EfqBBOO8.js";import{C as be}from"./copy-Ca9ckFn-.js";import{A as De,a as we,b as Me,c as ye,d as Pe,e as Ue,f as Ve,g as He}from"./alert-dialog-C53UHB1P.js";import{P as oe}from"./plus-Cro3wTdN.js";import{T as Ge}from"./TemplateVariablesPanel-CB8Tq3XH.js";import{F as xe}from"./file-type-DdIg-GG9.js";import{S as Fe}from"./square-pen-BRvf9020.js";import"./supabase-vendor-Vcb5-iD1.js";import"./chart-vendor-DYVMPw2Q.js";import"./pdf-vendor-CK1Kes8_.js";import"./breadcrumb-CyajETKq.js";import"./upload-Bvo8kvr2.js";import"./clipboard-list-BEJg0i9O.js";import"./index-Dti-t0XO.js";const ke=[{title:"Dados do Aluno",color:"bg-blue-100 text-blue-800 border-blue-200",variables:["NOME","NOME_ALUNO","EMAIL_ALUNO","CPF_ALUNO","RG_ALUNO","TELEFONE_ALUNO","CELULAR_ALUNO","WHATSAPP_ALUNO","ENDERECO_ALUNO","CEP_ALUNO","CIDADE_ALUNO","ESTADO_ALUNO","RESPONSAVEL_NOME","RESPONSAVEL_TELEFONE","RESPONSAVEL_EMAIL"]},{title:"Dados do Curso",color:"bg-green-100 text-green-800 border-green-200",variables:["NOME_CURSO","DESCRICAO_CURSO","CATEGORIA_CURSO","VALOR_CURSO","VALOR_ORIGINAL","VALOR_PROMOCIONAL","DURACAO_CURSO","CARGA_HORARIA","NIVEL_CURSO","MODALIDADE_CURSO"]},{title:"Dados da Turma",color:"bg-purple-100 text-purple-800 border-purple-200",variables:["TURMA_NOME","TURMA_CODIGO","TURMA_PERIODO","VAGAS_TOTAIS","VAGAS_DISPONIVEIS","INSTRUTOR_NOME","INSTRUTOR_EMAIL"]},{title:"Datas e Horários",color:"bg-orange-100 text-orange-800 border-orange-200",variables:["DATA_INICIO","DATA_FIM","DATA_HOJE","DATA_AULA","DATA_PROXIMA_SEGUNDA","DATA_PROXIMO_SABADO","HORARIO_INICIO","HORARIO_FIM","DIAS_SEMANA"]},{title:"Local e Endereço",color:"bg-red-100 text-red-800 border-red-200",variables:["NOME_LOCAL","ENDERECO","ENDERECO_COMPLETO","RUA","NUMERO_ENDERECO","COMPLEMENTO","BAIRRO","CIDADE","ESTADO","CEP_LOCAL","LINK_GOOGLE_MAPS"]},{title:"Dados da Escola",color:"bg-indigo-100 text-indigo-800 border-indigo-200",variables:["NOME_ESCOLA","CNPJ_ESCOLA","TELEFONE_ESCOLA","EMAIL_ESCOLA","WHATSAPP_ESCOLA","ENDERECO_ESCOLA"]}];function qe({open:i,onOpenChange:p,onSuccess:u}){const[O,n]=o.useState(!1),[c,l]=o.useState(new Set(["Dados do Aluno"])),[d,N]=o.useState(""),[E,m]=o.useState(!1),[C,A]=o.useState(""),[R,S]=o.useState(""),[T,y]=o.useState(""),[f,w]=o.useState(!1),[h,a]=o.useState({nome_template:"",template_content:"",tipo:"whatsapp",variaveis_disponiveis:[],ativo:!0,is_default:!1,curso_id:null}),{data:v=[]}=z({queryKey:["courses-for-template"],queryFn:async()=>{const{data:t,error:s}=await k.from("courses").select("id, name, category").eq("status","Ativo");if(s)throw s;return t||[]}}),{data:q=[]}=z({queryKey:["turmas-for-template",C],queryFn:async()=>{if(!C)return[];const{data:t,error:s}=await k.from("turmas").select("id, nome_turma, cidade, data_inicio").eq("course_id",C).eq("status","Ativa");if(s)throw s;return t||[]},enabled:!!C}),ee=F.getAvailableVariables(),K=async()=>{if(!h.template_content){y("Digite o conteúdo do template para ver o preview");return}w(!0);try{const t=await F.getTemplateVariablesWithData(C||void 0,R||void 0),s=F.processTemplate(h.template_content,t);y(s)}catch(t){console.error("Erro ao gerar preview:",t),y("Erro ao gerar preview do template")}finally{w(!1)}};o.useEffect(()=>{E&&K()},[h.template_content,C,R,E]);const B=ke.map(t=>({...t,variables:t.variables.filter(s=>ee.includes(s)&&(d===""||s.toLowerCase().includes(d.toLowerCase())))})).filter(t=>t.variables.length>0),J=t=>{const s=new Set(c);s.has(t)?s.delete(t):s.add(t),l(s)},se=t=>{a(s=>({...s,variaveis_disponiveis:s.variaveis_disponiveis.includes(t)?s.variaveis_disponiveis.filter(r=>r!==t):[...s.variaveis_disponiveis,t]}))},ae=t=>{try{const s=document.getElementById("template_content");
1if(s){const r=s.selectionStart||0,P=s.selectionEnd||0,ie=h.template_content.substring(0,r),re=h.template_content.substring(P),le=ie+`{{${t}}}`+re;a(L=>({...L,template_content:le,variaveis_disponiveis:L.variaveis_disponiveis.includes(t)?L.variaveis_disponiveis:[...L.variaveis_disponiveis,t]})),setTimeout(()=>{s.focus();const L=r+t.length+4;s.setSelectionRange(L,L)},10)}}catch(s){console.error("Erro ao inserir variável:",s),g({title:"Erro",description:"Não foi possível inserir a variável.",variant:"destructive"})}},te=async t=>{t.preventDefault(),n(!0);try{await Z.createTemplate(h),g({title:"Sucesso!",description:"Template criado com sucesso."}),u(),p(!1),a({nome_template:"",template_content:"",tipo:"whatsapp",variaveis_disponiveis:[],ativo:!0,is_default:!1,curso_id:null}),N("")}catch(s){console.error("Erro ao criar template:",s),g({title:"Erro",description:"Não foi possível criar o template.",variant:"destructive"})}finally{n(!1)}};return e.jsx(ne,{open:i,onOpenChange:p,children:e.jsxs(ce,{className:"max-w-5xl max-h-[90vh] overflow-y-auto",children:[e.jsxs(de,{children:[e.jsx(me,{children:"Novo Template"}),e.jsx(pe,{children:"Crie um novo template para suas campanhas de marketing"})]}),e.jsxs("form",{onSubmit:te,className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(_,{htmlFor:"nome_template",children:"Nome do Template *"}),e.jsx($,{id:"nome_template",value:h.nome_template,onChange:t=>a(s=>({...s,nome_template:t.target.value})),placeholder:"Ex: Lembrete de Aula",required:!0})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(_,{htmlFor:"tipo",children:"Tipo *"}),e.jsxs(U,{value:h.tipo,onValueChange:t=>a(s=>({...s,tipo:t})),children:[e.jsx(V,{children:e.jsx(H,{})}),e.jsxs(G,{children:[e.jsx(j,{value:"whatsapp",children:"WhatsApp"}),e.jsx(j,{value:"email",children:"Email"}),e.jsx(j,{value:"social_media",children:"Redes Sociais"}),e.jsx(j,{value:"landing_page",children:"Landing Page"})]})]})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(_,{htmlFor:"template_content",children:"Conteúdo do Template *"}),e.jsx(ve,{id:"template_content",value:h.template_content,onChange:t=>a(s=>({...s,template_content:t.target.value})),placeholder:"Digite o conteúdo do template usando {{VARIAVEL}} para campos dinâmicos",className:"min-h-[200px] font-mono text-sm",required:!0})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(_,{children:"Variáveis Utilizadas"}),e.jsxs("div",{className:"flex flex-wrap gap-1 min-h-[40px] border rounded p-2",children:[h.variaveis_disponiveis.map(t=>e.jsxs(I,{variant:"secondary",className:"text-xs",children:[`{{${t}}}`,e.jsx(Oe,{className:"ml-1 h-3 w-3 cursor-pointer",onClick:()=>se(t)})]},t)),h.variaveis_disponiveis.length===0&&e.jsx("span",{className:"text-sm text-muted-foreground",children:"Nenhuma variável selecionada"})]})]})]}),e.jsxs(b,{children:[e.jsxs(W,{className:"pb-3",children:[e.jsx(X,{className:"text-sm",children:"Variáveis Disponíveis"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Clique para inserir no template"}),e.jsxs("div",{className:"relative",children:[e.jsx(ue,{className:"absolute left-2 top-1/2 transform -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx($,{placeholder:"Pesquisar variáveis...",value:d,onChange:t=>N(t.target.value),className:"pl-8 text-sm"})]})]}),e.jsxs(D,{className:"space-y-2 max-h-[300px] overflow-y-auto",children:[B.length===0&&d&&e.jsxs("div",{className:"text-center text-sm text-muted-foreground py-4",children:['Nenhuma variável encontrada para "',d,'"']}),B.map(t=>e.jsxs(Ae,{open:c.has(t.title)||d!=="",onOpenChange:()=>d===""&&J(t.title),children:[e.jsx(ge,{asChild:!0,children:e.jsxs(x,{variant:"ghost",className:"w-full justify-between p-2 h-auto",disabled:d!=="",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(I,{className:`${t.color} text-xs`,children:t.variables.length}),e.jsx("span",{className:"text-sm font-medium",children:t.title})]}),d===""&&(c.has(t.title)?e.jsx(Ne,{className:"h-4 w-4"}):e.jsx(_e,{className:"h-4 w-4"}))]})}),e.jsx(Ee,{className:"space-y-1 mt-1",children:e.jsx("div",{className:"grid grid-cols-2 gap-1 pl-2",children:t.variables.map(s=>
1e.jsx("div",{className:`cursor-pointer p-2 rounded text-xs transition-colors border ${t.color} hover:opacity-80 ${h.variaveis_disponiveis.includes(s)?"ring-2 ring-primary":""}`,onClick:()=>ae(s),title:`Clique para inserir {{${s}}}`,children:s},s))})})]},t.title))]})]})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Y,{id:"ativo",checked:h.ativo,onCheckedChange:t=>a(s=>({...s,ativo:t}))}),e.jsx(_,{htmlFor:"ativo",children:"Ativo"})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Y,{id:"is_default",checked:h.is_default,onCheckedChange:t=>a(s=>({...s,is_default:t}))}),e.jsx(_,{htmlFor:"is_default",children:"Template Padrão"})]})]}),e.jsxs(b,{className:"mt-4",children:[e.jsxs(W,{children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(X,{className:"text-sm flex items-center gap-2",children:[e.jsx(he,{className:"h-4 w-4"}),"Preview com Dados Reais"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(x,{type:"button",variant:"outline",size:"sm",onClick:()=>m(!E),children:[E?"Ocultar":"Mostrar"," Preview"]}),E&&e.jsx(x,{type:"button",variant:"outline",size:"sm",onClick:K,disabled:f,children:e.jsx(Q,{className:`h-3 w-3 ${f?"animate-spin":""}`})})]})]}),E&&e.jsxs("div",{className:"grid grid-cols-2 gap-4 text-xs mt-4",children:[e.jsxs("div",{children:[e.jsx(_,{children:"Curso (opcional)"}),e.jsxs(U,{value:C,onValueChange:A,children:[e.jsx(V,{className:"h-8",children:e.jsx(H,{placeholder:"Selecione um curso"})}),e.jsxs(G,{children:[e.jsx(j,{value:"none",children:"Nenhum curso"}),v.map(t=>e.jsx(j,{value:t.id,children:t.name},t.id))]})]})]}),e.jsxs("div",{children:[e.jsx(_,{children:"Turma (opcional)"}),e.jsxs(U,{value:R,onValueChange:S,disabled:!C,children:[e.jsx(V,{className:"h-8",children:e.jsx(H,{placeholder:"Selecione uma turma"})}),e.jsxs(G,{children:[e.jsx(j,{value:"none",children:"Nenhuma turma"}),q.map(t=>e.jsxs(j,{value:t.id,children:[t.nome_turma," - ",t.cidade]},t.id))]})]})]})]})]}),E&&e.jsx(D,{children:e.jsx("div",{className:"bg-muted p-3 rounded text-sm font-mono whitespace-pre-wrap max-h-[200px] overflow-y-auto",children:f?e.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[e.jsx(Q,{className:"h-4 w-4 animate-spin"}),"Gerando preview..."]}):T||"Digite o conteúdo do template para ver o preview"})})]}),e.jsxs(je,{children:[e.jsx(x,{type:"button",variant:"outline",onClick:()=>p(!1),children:"Cancelar"}),e.jsx(x,{type:"submit",disabled:O,children:O?"Criando...":"Criar Template"})]})]})]})})}const Be=[{title:"Dados do Aluno",color:"bg-blue-100 text-blue-800 border-blue-200",variables:["NOME","NOME_ALUNO","EMAIL_ALUNO","CPF_ALUNO","RG_ALUNO","TELEFONE_ALUNO","CELULAR_ALUNO","WHATSAPP_ALUNO","ENDERECO_ALUNO","CEP_ALUNO","CIDADE_ALUNO","ESTADO_ALUNO","RESPONSAVEL_NOME","RESPONSAVEL_TELEFONE","RESPONSAVEL_EMAIL"]},{title:"Dados do Curso",color:"bg-green-100 text-green-800 border-green-200",variables:["NOME_CURSO","DESCRICAO_CURSO","CATEGORIA_CURSO","VALOR_CURSO","VALOR_ORIGINAL","VALOR_PROMOCIONAL","DURACAO_CURSO","CARGA_HORARIA","NIVEL_CURSO","MODALIDADE_CURSO"]},{title:"Dados da Turma",color:"bg-purple-100 text-purple-800 border-purple-200",variables:["TURMA_NOME","TURMA_CODIGO","TURMA_PERIODO","VAGAS_TOTAIS","VAGAS_DISPONIVEIS","INSTRUTOR_NOME","INSTRUTOR_EMAIL"]},{title:"Datas e Horários",color:"bg-orange-100 text-orange-800 border-orange-200",variables:["DATA_INICIO","DATA_FIM","DATA_HOJE","DATA_AULA","DATA_PROXIMA_SEGUNDA","DATA_PROXIMO_SABADO","HORARIO_INICIO","HORARIO_FIM","DIAS_SEMANA"]},{title:"Local e Endereço",color:"bg-red-100 text-red-800 border-red-200",variables:["NOME_LOCAL","ENDERECO","ENDERECO_COMPLETO","RUA","NUMERO_ENDERECO","COMPLEMENTO","BAIRRO","CIDADE","ESTADO","CEP_LOCAL","LINK_GOOGLE_MAPS"]},{title:"Dados da Escola",color:"bg-indigo-100 text-indigo-800 border-indigo-200",variables:["NOME_ESCOLA","CNPJ_ESCOLA","TELEFONE_ESCOLA","EMAIL_ESCOLA","WHATSAPP_ESCOLA","ENDERECO_ESCOLA"]}];function ze({template:i,open:p,onOpenChange:u,onSuccess:O}
1){const[n,c]=o.useState(!1),[l,d]=o.useState(new Set(["Dados do Aluno"])),[N,E]=o.useState(""),[m,C]=o.useState(!1),[A,R]=o.useState(""),[S,T]=o.useState(""),[y,f]=o.useState(""),[w,h]=o.useState(!1),[a,v]=o.useState({nome_template:i.nome_template,template_content:i.template_content,tipo:i.tipo,variaveis_disponiveis:i.variaveis_disponiveis||[],ativo:i.ativo,is_default:i.is_default||!1,curso_id:i.curso_id}),{data:q=[]}=z({queryKey:["courses-for-template"],queryFn:async()=>{const{data:s,error:r}=await k.from("courses").select("id, name, category").eq("status","Ativo");if(r)throw r;return s||[]}}),{data:ee=[]}=z({queryKey:["turmas-for-template",A],queryFn:async()=>{if(!A)return[];const{data:s,error:r}=await k.from("turmas").select("id, nome_turma, cidade, data_inicio").eq("course_id",A).eq("status","Ativa");if(r)throw r;return s||[]},enabled:!!A}),K=F.getAvailableVariables(),B=async()=>{if(!a.template_content){f("Digite o conteúdo do template para ver o preview");return}h(!0);try{const s=await F.getTemplateVariablesWithData(A||void 0,S||void 0),r=F.processTemplate(a.template_content,s);f(r)}catch(s){console.error("Erro ao gerar preview:",s),f("Erro ao gerar preview do template")}finally{h(!1)}};o.useEffect(()=>{m&&B()},[a.template_content,A,S,m]);const J=Be.map(s=>({...s,variables:s.variables.filter(r=>K.includes(r)&&(N===""||r.toLowerCase().includes(N.toLowerCase())))})).filter(s=>s.variables.length>0);o.useEffect(()=>{i&&v({nome_template:i.nome_template,template_content:i.template_content,tipo:i.tipo,variaveis_disponiveis:i.variaveis_disponiveis||[],ativo:i.ativo,is_default:i.is_default||!1,curso_id:i.curso_id||null})},[i]);const se=s=>{const r=new Set(l);r.has(s)?r.delete(s):r.add(s),d(r)},ae=s=>{v(r=>({...r,variaveis_disponiveis:r.variaveis_disponiveis.includes(s)?r.variaveis_disponiveis.filter(P=>P!==s):[...r.variaveis_disponiveis,s]}))},te=s=>{try{const r=document.getElementById("template_content");if(r){const P=r.selectionStart||0,ie=r.selectionEnd||0,re=a.template_content.substring(0,P),le=a.template_content.substring(ie),L=re+`{{${s}}}`+le;v(M=>({...M,template_content:L,variaveis_disponiveis:M.variaveis_disponiveis.includes(s)?M.variaveis_disponiveis:[...M.variaveis_disponiveis,s]})),setTimeout(()=>{r.focus();const M=P+s.length+4;r.setSelectionRange(M,M)},10)}}catch(r){console.error("Erro ao inserir variável:",r),g({title:"Erro",description:"Não foi possível inserir a variável.",variant:"destructive"})}},t=async s=>{s.preventDefault(),c(!0);try{await Z.updateTemplate(i.id,a),g({title:"Sucesso!",description:"Template atualizado com sucesso."}),O(),u(!1)}catch(r){console.error("Erro ao atualizar template:",r),g({title:"Erro",description:"Não foi possível atualizar o template.",variant:"destructive"})}finally{c(!1)}};return e.jsx(ne,{open:p,onOpenChange:u,children:e.jsxs(ce,{className:"max-w-5xl max-h-[90vh] overflow-y-auto",children:[e.jsxs(de,{children:[e.jsx(me,{children:"Editar Template"}),e.jsx(pe,{children:"Edite as informações do template"})]}),e.jsxs("form",{onSubmit:t,className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(_,{htmlFor:"nome_template",children:"Nome do Template *"}),e.jsx($,{id:"nome_template",value:a.nome_template,onChange:s=>v(r=>({...r,nome_template:s.target.value})),placeholder:"Ex: Lembrete de Aula",required:!0})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(_,{htmlFor:"tipo",children:"Tipo *"}),e.jsxs(U,{value:a.tipo,onValueChange:s=>v(r=>({...r,tipo:s})),children:[e.jsx(V,{children:e.jsx(H,{})}),e.jsxs(G,{children:[e.jsx(j,{value:"whatsapp",children:"WhatsApp"}),e.jsx(j,{value:"email",children:"Email"}),e.jsx(j,{value:"social_media",children:"Redes Sociais"}),e.jsx(j,{value:"landing_page",children:"Landing Page"})]})]})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(_,{htmlFor:"template_content",children:"Conteúdo do Template *"}),e.jsx(ve,{id:"template_content",value:a.template_content,onChange:s=>v(r=>({...r,template_content:s.target.value})),placeholder:"Digite o conteúdo do template usando {{VARIAVEL}} para campos dinâmicos",className:"min-h-[200px] font-mono text-sm",required:!0})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(_,{children:"Variáveis Utilizadas"}),e.jsxs("div",{className:"flex flex-wrap gap-1 min-h-[40px] border rounded p-2",children:[a.variaveis_disponiveis.map(s=>e.jsxs(I,{variant:"secondary",className:"text-xs",children:[`{{${s}}}`,e.jsx(Oe,{className:"ml-1 h-3 w-3 cursor-pointer",onClick:()=>ae(s)})]},s)),a.variaveis_disponiveis.length===0&&e.jsx("span",{className:"text-sm text-muted-foreground",children:"Nenhuma variável selecionada"})]})]})]}),e.jsxs(b,{children:[e.jsxs(W,{className:"pb-3",children:[e.jsx(X,{className:"text-sm",children:"Variáveis Disponíveis"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Clique para inserir no template"}),e.jsxs("div",{className:"relative",children:[e.jsx(ue,{className:"absolute left-2 top-1/2 transform -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx($,{placeholder:"Pesquisar variáveis...",value:N,onChange:s=>E(s.target.value),className:"pl-8 text-sm"})]})]}),e.jsxs(D,{className:"space-y-2 max-h-[300px] overflow-y-auto",children:[J.length===0&&N&&e.jsxs("div",{className:"text-center text-sm text-muted-foreground py-4",children:['Nenhuma variável encontrada para "',N,'"']}),J.map(s=>e.jsxs(Ae,{open:l.has(s.title)||N!=="",onOpenChange:()=>N===""&&se(s.title),children:[e.jsx(ge,{asChild:!0,children:e.jsxs(x,{variant:"ghost",className:"w-full justify-between p-2 h-auto",disabled:N!=="",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(I,{className:`${s.color} text-xs`,children:s.variables.length}),e.jsx("span",{className:"text-sm font-medium",children:s.title})]}),N===""&&(l.has(s.title)?e.jsx(Ne,{className:"h-4 w-4"}):e.jsx(_e,{className:"h-4 w-4"}))]})}),e.jsx(Ee,{className:"space-y-1 mt-1",children:e.jsx("div",{className:"grid grid-cols-2 gap-1 pl-2",children:s.variables.map(r=>
1e.jsx("div",{className:`cursor-pointer p-2 rounded text-xs transition-colors border ${s.color} hover:opacity-80 ${a.variaveis_disponiveis.includes(r)?"ring-2 ring-primary":""}`,onClick:()=>te(r),title:`Clique para inserir {{${r}}}`,children:r},r))})})]},s.title))]})]})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Y,{id:"ativo",checked:a.ativo,onCheckedChange:s=>v(r=>({...r,ativo:s}))}),e.jsx(_,{htmlFor:"ativo",children:"Ativo"})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Y,{id:"is_default",checked:a.is_default,onCheckedChange:s=>v(r=>({...r,is_default:s}))}),e.jsx(_,{htmlFor:"is_default",children:"Template Padrão"})]})]}),e.jsxs(b,{className:"mt-4",children:[e.jsxs(W,{children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(X,{className:"text-sm flex items-center gap-2",children:[e.jsx(he,{className:"h-4 w-4"}),"Preview com Dados Reais"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(x,{type:"button",variant:"outline",size:"sm",onClick:()=>C(!m),children:[m?"Ocultar":"Mostrar"," Preview"]}),m&&e.jsx(x,{type:"button",variant:"outline",size:"sm",onClick:B,disabled:w,children:e.jsx(Q,{className:`h-3 w-3 ${w?"animate-spin":""}`})})]})]}),m&&e.jsxs("div",{className:"grid grid-cols-2 gap-4 text-xs mt-4",children:[e.jsxs("div",{children:[e.jsx(_,{children:"Curso (opcional)"}),e.jsxs(U,{value:A,onValueChange:R,children:[e.jsx(V,{className:"h-8",children:e.jsx(H,{placeholder:"Selecione um curso"})}),e.jsxs(G,{children:[e.jsx(j,{value:"none",children:"Nenhum curso"}),q.map(s=>e.jsx(j,{value:s.id,children:s.name},s.id))]})]})]}),e.jsxs("div",{children:[e.jsx(_,{children:"Turma (opcional)"}),e.jsxs(U,{value:S,onValueChange:T,disabled:!A,children:[e.jsx(V,{className:"h-8",children:e.jsx(H,{placeholder:"Selecione uma turma"})}),e.jsxs(G,{children:[e.jsx(j,{value:"none",children:"Nenhuma turma"}),ee.map(s=>e.jsxs(j,{value:s.id,children:[s.nome_turma," - ",s.cidade]},s.id))]})]})]})]})]}),m&&e.jsx(D,{children:e.jsx("div",{className:"bg-muted p-3 rounded text-sm font-mono whitespace-pre-wrap max-h-[200px] overflow-y-auto",children:w?e.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[e.jsx(Q,{className:"h-4 w-4 animate-spin"}),"Gerando preview..."]}):y||"Digite o conteúdo do template para ver o preview"})})]}),e.jsxs(je,{children:[e.jsx(x,{type:"button",variant:"outline",onClick:()=>u(!1),children:"Cancelar"}),e.jsx(x,{type:"submit",disabled:n,children:n?"Salvando...":"Salvar Alterações"})]})]})]})})}function $e({template:i,open:p,onOpenChange:u}){const O=async()=>{try{await navigator.clipboard.writeText(i.template_content),g({title:"Copiado!",description:"Conteúdo do template copiado para a área de transferência."})}catch{g({title:"Erro",description:"Não foi possível copiar o template.",variant:"destructive"})}},n=l=>({whatsapp:"WhatsApp",email:"Email",social_media:"Redes Sociais",landing_page:"Landing Page"})[l]||l,c=l=>({whatsapp:"default",email:"secondary",social_media:"outline",landing_page:"destructive"})[l]||"default";return e.jsx(ne,{open:p,onOpenChange:u,children:e.jsxs(ce,{className:"max-w-2xl max-h-[90vh] overflow-y-auto",children:[e.jsxs(de,{children:[e.jsxs(me,{className:"flex items-center gap-2",children:[i.nome_template,e.jsx(I,{variant:c(i.tipo),children:n(i.tipo)}),i.is_default&&e.jsx(I,{variant:"outline",children:"Padrão"}),!i.ativo&&e.jsx(I,{variant:"secondary",children:"Inativo"})]}),e.jsx(pe,{children:"Visualize o conteúdo e as informações do template"})]}),e.jsxs("div",{className:"space-y-4",children:[i.courses&&e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-medium mb-1",children:"Curso Associado"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:i.courses.name})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("h4",{className:"text-sm font-medium",children:"Conteúdo do Template"}),e.jsxs(x,{size:"sm",variant:"outline",onClick:O,className:"gap-2",children:[e.jsx(be,{className:"h-4 w-4"}),"Copiar"]})]}),e.jsx("div",{className:"bg-muted p-4 rounded-lg",children:e.jsx("pre",{className:"whitespace-pre-wrap text-sm",children:i.template_content})})]}),i.variaveis_disponiveis&&i.variaveis_disponiveis.length>0&&e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-medium mb-2",children:"Variáveis Disponíveis"}),e.jsx("div",{className:"flex flex-wrap gap-1",children:i.variaveis_disponiveis.map((l,d)=>e.jsx(I,{variant:"outline",className:"text-xs",children:`{{${l}}}`},d))})]}),e.jsxs("div",{className:"text-xs text-muted-foreground",children:[e.jsxs("p",{children:["Criado em: ",new Date(i.created_at).toLocaleStr
1ing("pt-BR")]}),i.updated_at!==i.created_at&&e.jsxs("p",{children:["Atualizado em: ",new Date(i.updated_at).toLocaleString("pt-BR")]})]})]})]})})}function We({template:i,open:p,onOpenChange:u,onSuccess:O}){const[n,c]=o.useState(!1),l=async()=>{c(!0);try{await Z.deleteTemplate(i.id),g({title:"Sucesso!",description:"Template excluído com sucesso."}),O(),u(!1)}catch(d){console.error("Erro ao excluir template:",d),g({title:"Erro",description:"Não foi possível excluir o template.",variant:"destructive"})}finally{c(!1)}};return e.jsx(De,{open:p,onOpenChange:u,children:e.jsxs(we,{children:[e.jsxs(Me,{children:[e.jsx(ye,{children:"Excluir Template"}),e.jsxs(Pe,{children:['Tem certeza que deseja excluir o template "',i.nome_template,'"? Esta ação não pode ser desfeita.']})]}),e.jsxs(Ue,{children:[e.jsx(Ve,{children:"Cancelar"}),e.jsx(He,{onClick:l,disabled:n,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:n?"Excluindo...":"Excluir"})]})]})})}const Xe=[{nome:"Lembrete - Próxima Segunda",tipo:"whatsapp",template_content:`Olá {{NOME}}! 👋
2
3🗓️ LEMBRETE: Sua aula de {{NOME_CURSO}} será na PRÓXIMA SEGUNDA-FEIRA!
4
5📍 Local: {{ENDERECO_COMPLETO}}
6📅 Data: {{DATA_PROXIMA_SEGUNDA}}
7🕘 Horário: {{HORARIO_INICIO}} às {{HORARIO_FIM}}
8
9📚 Prepare seus materiais e venha com disposição para aprender!
10
11Nos vemos lá! 💪
12
13#AlunoÓtimaIdeia #{{NOME_CURSO_SLUG}}`,variaveis_disponiveis:["NOME","NOME_CURSO","ENDERECO_COMPLETO","DATA_PROXIMA_SEGUNDA","HORARIO_INICIO","HORARIO_FIM","NOME_CURSO_SLUG"],categoria:"Lembrete de Aula"},{nome:"Lembrete - Próxima Semana",tipo:"whatsapp",template_content:`Oi {{NOME}}! 😊
14
15📢 AVISO IMPORTANTE: Suas aulas de {{NOME_CURSO}} começam na PRÓXIMA SEMANA!
16
17📍 Local: {{ENDERECO_COMPLETO}}
18📅 Período: {{DATA_INICIO}} a {{DATA_TERMINO}}
19🕘 Horário: {{HORARIO_INICIO}} às {{HORARIO_FIM}}
20📆 Dias: {{DIAS_SEMANA}}
21
22🎯 O que levar:
23📝 Material para anotações
24💻 Notebook (se aplicável)
25☕ Disposição para aprender!
26
27Estamos ansiosos para te ver em sala! 🚀
28
29#AlunoÓtimaIdeia #{{NOME_CURSO_SLUG}}`,variaveis_disponiveis:["NOME","NOME_CURSO","ENDERECO_COMPLETO","DATA_INICIO","DATA_TERMINO","HORARIO_INICIO","HORARIO_FIM","DIAS_SEMANA","NOME_CURSO_SLUG"],categoria:"Lembrete de Aula"},{nome:"Lembrete - Próximo Sábado",tipo:"whatsapp",template_content:`E aí {{NOME}}! 🌟
30
31⏰ LEMBRETE: Sua aula de {{NOME_CURSO}} será no PRÓXIMO SÁBADO!
32
33📍 Local: {{ENDERECO_COMPLETO}}
34📅 Data: {{DATA_PROXIMO_SABADO}}
35🕘 Horário: {{HORARIO_INICIO}} às {{HORARIO_FIM}}
36
37🎯 Aula especial de sábado! Aproveite para:
38✅ Tirar todas as dúvidas
39✅ Praticar bastante
40✅ Networkar com os colegas
41
42Vamos juntos rumo ao sucesso! 💪
43
44#AulaEspecial #{{NOME_CURSO_SLUG}}`,variaveis_disponiveis:["NOME","NOME_CURSO","ENDERECO_COMPLETO","DATA_PROXIMO_SABADO","HORARIO_INICIO","HORARIO_FIM","NOME_CURSO_SLUG"],categoria:"Lembrete de Aula"},{nome:"Lembrete - 24h Antes",tipo:"whatsapp",template_content:`Oi {{NOME}}! 🔔
45
46⏰ LEMBRETE: Sua aula de {{NOME_CURSO}} é AMANHÃ!
47
48📍 Local: {{ENDERECO_COMPLETO}}
49📅 Data: {{DATA_AULA}}
50🕘 Horário: {{HORARIO_INICIO}} às {{HORARIO_FIM}}
51
52💡 Dicas importantes:
53🚗 Chegue 10 minutos antes
54📱 Traga o material solicitado
55☕ Venha bem disposto(a)!
56
57Te esperamos! 🎯
58
59#LembreteAula #{{NOME_CURSO_SLUG}}`,variaveis_disponiveis:["NOME","NOME_CURSO","ENDERECO_COMPLETO","DATA_AULA","HORARIO_INICIO","HORARIO_FIM","NOME_CURSO_SLUG"],categoria:"Lembrete de Aula"}],Ke=[{nome:"Boas-vindas Novo Aluno",tipo:"whatsapp",template_content:`Olá {{NOME}}! 🎉
60
61Seja muito bem-vindo(a) à {{NOME_CURSO}}! 
62
63Estamos muito felizes em tê-lo(a) conosco nessa jornada de aprendizado.
64
65📍 Local: {{ENDERECO_COMPLETO}}
66📅 Início: {{DATA_INICIO}}
67🕘 Horário: {{HORARIO_INICIO}} às {{HORARIO_FIM}}
68
69Qualquer dúvida, estamos à disposição! 💬
70
71#NovoAluno #{{NOME_CURSO_SLUG}}`,variaveis_disponiveis:["NOME","NOME_CURSO","ENDERECO_COMPLETO","DATA_INICIO","HORARIO_INICIO","HORARIO_FIM","NOME_CURSO_SLUG"],categoria:"Boas-vindas"},...Xe,{nome:"Template Email Marketing",tipo:"email",template_content:`Assunto: {{NOME_CURSO}} - Nova turma em {{CIDADE}}!
72
73Olá!
74
75Temos uma nova turma de {{NOME_CURSO}} começando em breve!
76
77📍 Local: {{ENDERECO_COMPLETO}}
78📅 Início: {{DATA_INICIO}}
79🕘 Horário: {{HORARIO_INICIO}} às {{HORARIO_FIM}}
80
81Entre em contato para mais informações!
82
83Atenciosamente,
84Equipe Ótima Ideia`,variaveis_disponiveis:["NOME_CURSO","CIDADE","ENDERECO_COMPLETO","DATA_INICIO","HORARIO_INICIO","HORARIO_FIM"],categoria:"Marketing"},{nome:"Confirmação de Matrícula",tipo:"email",template_content:`Assunto: Matrícula Confirmada - {{NOME_CURSO}}
85
86Olá {{NOME}}!
87
88Sua matrícula foi confirmada com sucesso!
89
90📚 Curso: {{NOME_CURSO}}
91📍 Local: {{ENDERECO_COMPLETO}}
92📅 Início: {{DATA_INICIO}}
93🕘 Horário: {{HORARIO_INICIO}} às {{HORARIO_FIM}}
94
95Aguardamos você!
96
97Equipe Ótima Ideia`,variaveis_disponiveis:["NOME","NOME_CURSO","ENDERECO_COMPLETO","DATA_INICIO","HORARIO_INICIO","HORARIO_FIM"],categoria:"Confirmação"}],Je=async()=>{try{console.log("🚀 Iniciando inserção de templates padrão...");const{data:i,error:p}=await k.from("marketing_templates").select("nome");if(p)throw console.error("❌ Erro ao buscar templates existentes:",p),p;const u=(i==null?void 0:i.map(l=>l.nome))||[],O=Ke.filter(l=>!u.includes(l.nome));if(O.length===0)return console.log("ℹ️ Todos os templates padrão já existem no banco de dados."),{success:!0,message:"Todos os templates padrão já existem.",inserted:0};console.log(`📝 Inserindo ${O.length} novos templates...`);const{data:n,error:c}=await k.from("marketing_templates").insert(O.map(l=>({nome:l.nome,tipo:l.tipo,template_content:l.template_content,variaveis_disponiveis:l.variaveis_disponiveis,categoria:l.categoria||"Geral",ativo:!0}))).select();if(c)throw console.error("❌ Erro ao inserir templates:",c),c;return console.log(`✅ ${(n==null?void 0:n.length)||0} templates inseridos com sucesso!`),{success:!0,message:`${(n==null?void 0:n.length)||0} templates inseridos com sucesso!`,inserted:(n==null?void 0:n.length)||0,templates:n}}catch(i){return console.error("❌ Erro geral ao inserir templates:",i),{success:!1,message:i instanceof Error?i.message:"Erro desconhecido",inserted:0}}};function Qe({onSuccess:i}){const[p,u]=o.useState(!1),[O,n]=o.useState(!1),c=async()=>{u(!0);try{const l=await Je();l.success?(n(!0),g({title:"Sucesso!",description:l.message}),i==null||i()):g({title:"Erro",description:l.message,variant:"destructive"})}catch(l){console.error("Erro ao inserir templates:",l),g({title:"Erro",description:"Erro ao inserir templates padrão.",variant:"destructive"})}finally{u(!1)}};return O?e.jsxs(x,{variant:"outline",disabled:!0,className:"gap-2",children:[e.jsx(Ce,{className:"h-4 w-4 text-green-600"}),"Templates Inseridos"]}):e.jsxs(x,{onClick:c,disabled:p,variant:"outline",className:"gap-2",children:[p?e.jsx(fe,{className:"h-4 w-4 animate-spin"}):e.jsx(oe,{className:"h-4 w-4"}),p?"Inserindo...":"Inserir Templates Padrão"]})}
97function Ye(){const[i,p]=o.useState(""),[u,O]=o.useState("all"),[n,c]=o.useState(!1),[l,d]=o.useState(null),[N,E]=o.useState(null),{data:m=[],isLoading:C,refetch:A}=z({queryKey:["marketing-templates"],queryFn:async()=>{console.log("TemplatesPage: Iniciando busca de templates...");try{const a=await Z.getTemplates();return console.log("TemplatesPage: Templates recebidos:",a.length),a}catch(a){return console.error("TemplatesPage: Erro ao buscar templates:",a),[]}}}),R=m.filter(a=>{const v=a.nome_template.toLowerCase().includes(i.toLowerCase())||a.template_content.toLowerCase().includes(i.toLowerCase()),q=u==="all"||a.tipo===u;return v&&q}),S=(a,v)=>{console.log("Action triggered:",v,"for template:",a),d(a),E(v)},T=()=>{d(null),E(null),A()},f={whatsapp:m.filter(a=>a.tipo==="whatsapp").length,email:m.filter(a=>a.tipo==="email").length,social_media:m.filter(a=>a.tipo==="social_media").length,landing_page:m.filter(a=>a.tipo==="landing_page").length,active:m.filter(a=>a.ativo).length},w=a=>({whatsapp:"WhatsApp",email:"Email",social_media:"Redes Sociais",landing_page:"Landing Page"})[a]||a,h=a=>({whatsapp:"default",email:"secondary",social_media:"outline",landing_page:"destructive"})[a]||"default";return console.log("TemplatesPage: Renderizando com",m.length,"templates, filtrados:",R.length),e.jsx(Ie,{children:e.jsxs(Le,{title:"Templates de Marketing",subtitle:"Gerencie templates para WhatsApp, email e redes sociais",actions:e.jsxs("div",{className:"flex gap-2",children:[e.jsx(Qe,{onSuccess:A}),e.jsxs(x,{onClick:()=>c(!0),className:"gap-2 btn-responsive",children:[e.jsx(oe,{className:"h-4 w-4"}),e.jsx("span",{className:"hidden sm:inline",children:"Novo Template"}),e.jsx("span",{className:"sm:hidden",children:"Novo"})]})]}),children:[e.jsxs("div",{className:"px-6 space-y-6",children:[!1,e.jsxs("div",{className:"flex justify-between items-center gap-4",children:[e.jsxs("div",{className:"relative flex-1 max-w-md",children:[e.jsx(ue,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx($,{placeholder:"Buscar templates...",value:i,onChange:a=>p(a.target.value),className:"pl-9"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("select",{value:u,onChange:a=>O(a.target.value),className:"px-3 py-2 border border-input bg-background rounded-md text-sm",children:[e.jsx("option",{value:"all",children:"Todos os Tipos"}),e.jsx("option",{value:"whatsapp",children:"WhatsApp"}),e.jsx("option",{value:"email",children:"Email"}),e.jsx("option",{value:"social_media",children:"Redes Sociais"}),e.jsx("option",{value:"landing_page",children:"Landing Page"})]}),e.jsx(x,{variant:"outline",size:"icon","aria-label":"Filtros",children:e.jsx(Re,{className:"h-4 w-4"})})]})]}),e.jsxs("div",{className:"grid-cards",children:[e.jsx(b,{className:"card-stat",children:e.jsxs(D,{className:"p-4",children:[e.jsx("div",{className:"card-stat-value",children:f.whatsapp}),e.jsx("div",{className:"card-stat-label",children:"Templates WhatsApp"})]})}),e.jsx(b,{className:"card-stat",children:e.jsxs(D,{className:"p-4",children:[e.jsx("div",{className:"card-stat-value",children:f.email}),e.jsx("div",{className:"card-stat-label",children:"Templates Email"})]})}),e.jsx(b,{className:"card-stat",children:e.jsxs(D,{className:"p-4",children:[e.jsx("div",{className:"card-stat-value",children:f.social_media}),e.jsx("div",{className:"card-stat-label",children:"Templates Redes Sociais"})]})}),e.jsx(b,{className:"card-stat",children:e.jsxs(D,{className:"p-4",children:[e.jsx("div",{className:"card-stat-value",children:f.active}),e.jsx("div",{className:"card-stat-label",children:"Templates Ativos"})]})})]}),e.jsxs("div",{className:"grid grid-cols-1 xl:grid-cols-3 gap-6",children:[e.jsx("div",{className:"xl:col-span-2",children:e.jsxs(b,{className:"card-dashboard",children:[e.jsxs(W,{className:"pb-3",children:[e.jsxs(X,{className:"header-section flex items-center gap-2",children:[e.jsx(xe,{className:"h-5 w-5"}),"Templates (",R.length,")"]}),e.jsx(Se,{children:"Gerencie seus templates de marketing"})]}),e.jsx(D,{children:C?e.jsxs("div",{className:"text-center py-8",children:[e.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary mx-auto mb-4"}),e.jsx("p",{className:"text-muted-foreground",children:"Carregando templates..."})]}):R.length===0?e.jsxs("div",{className:"text-center py-8",children:[e.jsx(xe,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),e.jsx("h3",{className:"text-lg font-medium mb-2",children:m.length===0?"Nenhum template criado ainda":"Nenhum template encontrado"}),e.jsx("p",{className:"text-muted-foreground mb-4",children:m.length===0?"Crie seu primeiro template para começar a enviar mensagens personalizadas":"Tente ajustar os filtros de busca"}),e.jsxs(x,{onClick:()=>c(!0),children:[e.jsx(oe,{className:"mr-2 h-4 w-4"}),"Criar ",m.length===0?"Primeiro ":"Novo ","Template"]})]}):e.jsx("div",{className:"table-responsive",children:e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-muted/50",children:[e.jsx("th",{className:"text-left p-3 font-medium text-responsive",children:"Nome"}),e.jsx("th",{className:"text-left p-3 font-medium text-responsive",children:"Tipo"}),e.jsx("th",{className:"text-left p-3 font-medium text-responsive hidden lg:table-cell",children:"Curso"}),e.jsx("th",{className:"text-left p-3 font-medium text-responsive hidden md:table-cell",children:"Status"}),e.jsx("th",{className:"text-left p-3 font-medium text-responsive",children:"Ações"})]})}),e.jsx("tbody",{children:R.map(a=>e.jsxs("tr",{className:"border-b border-border/20 hover:bg-muted/20 transition-colors",children:[e.jsxs("td",{className:"p-3",children:[e.jsx("div",{className:"font-medium",children:a.nome_template}),e.jsxs("div",{className:"text-sm text-muted-foreground mt-1 line-clamp-2",children:[a.template_content.substring(0,100),"..."]})]}),e.jsx("td",{className:"p-3",children:e.jsx(I,{variant:h(a.tipo),children:w(a.tipo)})}),e.jsx("td",{className:"p-3 hidden lg:table-cell",children:e.jsx("span",{className:"text-sm",children:a.courses?a.courses.name:"Geral"})}),e.jsx("td",{className:"p-3 hidden md:table-cell",children:e.jsxs("div",{className:"flex items-center gap-1",children:[a.ativo?e.jsx(I,{variant:"outline",className:"text-green-600",children:"Ativo"}):e.jsx(I,{variant:"secondary",children:"Inativo"}),a.is_default&&e.jsx(I,{variant:"outline",children:"Padrão"})]})}),e.jsx("td",{className:"p-3",children:e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(x,{size:"sm",variant:"ghost",onClick:()=>S(a,"view"),"aria-label":"Visualizar",children:e.jsx(he,{className:"h-4 w-4"})}),e.jsx(x,{size:"sm",variant:"ghost",onClick:()=>S(a,"edit"),"aria-label":"Editar",children:e.jsx(Fe,{className:"h-4 w-4"})}),e.jsx(x,{size:"sm",variant:"ghost",onClick:()=>S(a,"delete"),"aria-label":"Excluir",children:e.jsx(Te,{className:"h-4 w-4"})})]})})]},a.id))})]})})})]})}),e.jsx("div",{className:"xl:col-span-1",children:e.jsx(Ge,{})})]})]}),e.jsx(qe,{open:n,onOpenChange:c,onSuccess:()=>{c(!1),A()}}),l&&N==="view"&&e.jsx($e,{template:l,open:!0,onOpenChange:T}),l&&N==="edit"&&e.jsx(ze,{template:l,open:!0,onOpenChange:T,onSuccess:T}),l&&N==="delete"&&e.jsx(We,{template:l,open:!0,onOpenChange:T,onSuccess:T})]})})}function js(){return e.jsx(Ye,{})}export{js as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.