PageSourceSearch

https://spitzpomer.com.br/assets/Reunioes-yavrzIfQ.js

js spitzpomer.com.br collected 2026-10-07 15:53:02 UTC 22,541 bytes, 1 lines download raw bytes

1import{j as e,r as c,b as _}from"./index-D_5GXWiy.js";import{d as G,o as Z,D as ee,h as se,i as ae,j as te,aB as re,V as oe,aC as ie,m as le,P as ne}from"./AppAutenticado-CzKydVy9.js";import{c as I,B as k}from"./button-D5VvoyW8.js";import{S as U,a as V,b as O,c as H,d as z}from"./select-CgAgRNxl.js";import{I as E}from"./input-DWiZAcMh.js";import{d as J,l as B,m as ce,a as de}from"./mesUtil-BXQ6JCJC.js";import{S as D}from"./sparkles-DtUUiOxO.js";import{F as K}from"./file-text-B7Zpugr4.js";import{U as $}from"./users-DOraMMs-.js";import{C as T}from"./circle-check-CtcpgmJO.js";import{C as Q}from"./circle-DCUq486C.js";import{S as me}from"./search-CYw6wuMN.js";import{M as F}from"./messages-square-CPY78naH.js";import{t as w}from"./sonner-vjI3kQlA.js";import{F as W}from"./flag-BcMdkQmC.js";import{L as X}from"./list-checks-Dnwr0Jn1.js";import{U as xe}from"./user-BnJJTC1D.js";import{C as q}from"./x-Bsb3cIeH.js";import{L as M}from"./loader-circle-0V_wP9ca.js";import{R as Y}from"./refresh-cw-V-KSNk_D.js";import{A as ue}from"./archive-DT5I_J3T.js";import{L as S}from"./label-BpoWQIBp.js";import{M as pe}from"./index-Cn1Zep6V.js";import{L as he}from"./list-BMVC2fqP.js";import"./createLucideIcon-ogc1J6M_.js";import"./lock-Dh6eYyey.js";import"./arrow-left-D-86lV6V.js";import"./index-hNFnHP_X.js";import"./car-PLjUkRnC.js";import"./check-nqbqeLRK.js";import"./star-JGD-cnc6.js";import"./shield-check-BT7mc5fv.js";import"./zap-CHGKr2qI.js";import"./circle-alert-C3i67_w1.js";import"./send-BYQv5nqu.js";import"./chevron-left-uDT_QjWY.js";import"./hard-hat-DAPX46rr.js";import"./gift-CGsa9LJ_.js";import"./chevron-down-CTM8Latz.js";import"./index-DI6JeiCF.js";import"./index-DwZogk-F.js";import"./index-CUmbRvXY.js";import"./index-Q9swqPq3.js";import"./chevron-up-Cm0_LPnX.js";import"./subMonths-vhlpUng_.js";function fe({reuniao:a,ativa:h,onClick:n}){const m=a.followups||[],o=m.filter(t=>!t.concluido).length;return e.jsxs("button",{onClick:n,className:I("w-full text-left px-4 py-3 border-b border-border/60 transition-colors",h?"bg-primary/5 border-l-2 border-l-primary":"hover:bg-muted/60 border-l-2 border-l-transparent"),children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-[11px] text-muted-foreground",children:J(a.data)}),a.status_ia==="erro"?e.jsx(G,{className:"w-3.5 h-3.5 text-amber-500",title:"IA não processou"}):a.status_ia==="concluido"?e.jsx(D,{className:"w-3.5 h-3.5 text-primary/60",title:"Analisada pela IA"}):e.jsx(K,{className:"w-3.5 h-3.5 text-muted-foreground/60",title:"Registro salvo"})]}),e.jsx("p",{className:"text-sm font-medium text-foreground mt-0.5 line-clamp-1",children:a.titulo}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1 line-clamp-2",children:a.resumo_ia||(a.transcricao||"").slice(0,160)||"Transcrição registrada."}),e.jsxs("div",{className:"flex items-center gap-3 mt-2 text-[11px] text-muted-foreground",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx($,{className:"w-3 h-3"}),(a.participantes||[]).length]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(T,{className:"w-3 h-3"}),(a.decisoes||[]).length," decisões"]}),m.length>0&&e.jsxs("span",{className:I("flex items-center gap-1",o?"text-amber-600":""),children:[e.jsx(Q,{className:"w-3 h-3"}),o,"/",m.length," abertos"]})]})]})}function ge({reunioes:a,loading:h,selecionadaId:n,onSelecionar:m}){const[o,t]=c.useState(""),[r,f]=c.useState("todos"),b=c.useMemo(()=>{const s=new Set;return a.forEach(i=>(i.participantes||[]).forEach(N=>s.add(N))),[...s].sort()},[a]),j=c.useMemo(()=>{const s=o.trim().toLowerCase();return a.filter(i=>r!=="todos"&&!(i.participantes||[]).includes(r)?!1:s?[i.titulo,i.resumo_ia,...i.temas||[],...(i.decisoes||[]).map(x=>x.texto),...(i.followups||[]).map(x=>x.texto)].join(" ").toLowerCase().includes(s):!0)},[a,o,r]);return e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsxs("div",{className:"p-3 space-y-2 border-b border-border",children:[e.jsxs("div",{className:"relative",children:[e.jsx(me,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-muted-foreground"}),e.jsx(E,{value:o,onChange:s=>t(s.target.value),placeholder:"Buscar em títulos, resumos, decisões...",className:"pl-8 h-8 text-sm"})]}),e.jsxs(U,{value:r,onValueChange:f,children:[e.jsx(V,{className:"h-8 text-xs",children:e.jsx(O,{})}
1),e.jsxs(H,{children:[e.jsx(z,{value:"todos",children:"Todos os participantes"}),b.map(s=>e.jsx(z,{value:s,children:s},s))]})]})]}),e.jsx("div",{className:"flex-1 overflow-y-auto",children:h?e.jsx("div",{className:"p-3 space-y-2",children:[1,2,3,4].map(s=>e.jsx("div",{className:"h-20 bg-muted animate-pulse rounded-lg"},s))}):j.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 py-16 text-muted-foreground",children:[e.jsx(F,{className:"w-10 h-10 opacity-20"}),e.jsx("p",{className:"text-sm",children:"Nenhuma reunião neste mês."})]}):j.map(s=>e.jsx(fe,{reuniao:s,ativa:s.id===n,onClick:()=>m(s.id)},s.id))})]})}function je({reuniao:a,podeEscrever:h,onToggleFollowup:n}){var o;const m=a.followups||[];return e.jsxs("div",{className:"space-y-5",children:[e.jsxs("section",{children:[e.jsxs("h3",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground flex items-center gap-1.5 mb-2",children:[e.jsx(D,{className:"w-3.5 h-3.5"})," Resumo"]}),e.jsx("p",{className:"text-sm text-foreground leading-relaxed whitespace-pre-wrap",children:a.resumo_ia||"A IA ainda não gerou o resumo."}),((o=a.temas)==null?void 0:o.length)>0&&e.jsx("div",{className:"flex flex-wrap gap-1 mt-3",children:a.temas.map(t=>e.jsxs("span",{className:"text-[11px] px-2 py-0.5 rounded-full bg-primary/10 text-primary",children:["#",t]},t))})]}),e.jsxs("section",{children:[e.jsxs("h3",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground flex items-center gap-1.5 mb-2",children:[e.jsx(W,{className:"w-3.5 h-3.5"})," Decisões (",(a.decisoes||[]).length,")"]}),(a.decisoes||[]).length===0?e.jsx("p",{className:"text-xs text-muted-foreground",children:"Nenhuma decisão identificada."}):e.jsx("ul",{className:"space-y-1.5",children:a.decisoes.map((t,r)=>e.jsxs("li",{className:"flex gap-2 text-sm text-foreground",children:[e.jsx(T,{className:"w-4 h-4 text-emerald-600 flex-shrink-0 mt-0.5"}),t.texto]},r))})]}),e.jsxs("section",{children:[e.jsxs("h3",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground flex items-center gap-1.5 mb-2",children:[e.jsx(X,{className:"w-3.5 h-3.5"})," Follow-ups (",m.filter(t=>t.concluido).length,"/",m.length,")"]}),m.length===0?e.jsx("p",{className:"text-xs text-muted-foreground",children:"Nenhum próximo passo identificado."}):e.jsx("ul",{className:"space-y-1.5",children:m.map(t=>e.jsxs("li",{className:I("flex gap-2 items-start rounded-lg border border-border/60 p-2.5",t.concluido&&"opacity-60"),children:[e.jsx("button",{disabled:!h,onClick:()=>n(t.id,!t.concluido),className:"mt-0.5 flex-shrink-0 disabled:cursor-default",children:t.concluido?e.jsx(T,{className:"w-4 h-4 text-emerald-600"}):e.jsx(Q,{className:"w-4 h-4 text-muted-foreground hover:text-primary"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:I("text-sm text-foreground",t.concluido&&"line-through"),children:t.texto}),e.jsxs("div",{className:"flex flex-wrap gap-3 mt-1 text-[11px] text-muted-foreground",children:[t.responsavel&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(xe,{className:"w-3 h-3"}),t.responsavel]}),t.prazo&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(q,{className:"w-3 h-3"}),t.prazo]})]})]})]},t.id))})]})]})}function Ne({reuniaoId:a,statusIa:h,podeEscrever:n,podeExcluir:m,onEditar:o,onAlterada:t}){const[r,f]=c.useState(null),[b,j]=c.useState(!1),[s,i]=c.useState(!1);c.useEffect(()=>{if(!a){f(null);return}j(!0),_.functions.invoke("portalReunioes",{acao:"detalhar",id:a}).then(u=>{var d;return f(((d=u==null?void 0:u.data)==null?void 0:d.reuniao)||null)}).finally(()=>j(!1))},[a,h]);const N=async(u,d)=>{const C=await _.functions.invoke("portalReunioes",{acao:"followup",id:r.id,followup_id:u,concluido:d});f(C.data.reuniao),t==null||t(C.data.reuniao)},x=async()=>{var u,d,C;i(!0);try{const g=await _.functions.invoke("portalReunioes",{acao:"analisar",id:r.id});if((u=g==null?void 0:g.data)!=null&&u.error)throw new Error(g.data.error);f(g.data.reuniao),t==null||t(g.data.reuniao),g.data.reuniao.status_ia==="erro"?w.error("A IA não conseguiu processar: "+g.data.reuniao.erro_ia):w.success("Reunião reprocessada pela IA.")}catch(g){w.error("Erro ao reprocessar: "+(((C=(d=g==null?void 0:g.response)==null?void 0:d.data)==null?void 0:C.error)||(g==null?void 0:g.message)||""))}finally{i(!1)}},p=async()=>{confirm("Arquivar esta reunião? Ela sai da base de conhecimento.")&&(await _.functions.invoke("portalReunioes",{acao:"arquivar",id:r.id}),w.success("Reunião arquivada."),t==null||t(null,r.id))};return a?b||!r?e.jsx("div",{className:"h-full flex items-center justify-center",children:e.jsx(M,{className:"w-5 h-5 animate-spin text-muted-foreground"})}):e.jsxs("div",{className:"h-full flex flex-col",children:[e.jsxs("div",{className:"px-6 py-4 border-b border-border flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("h2",{className:"text-lg font-semibold text-foreground leading-tight",children:r.titulo}),e.jsxs("div",{className:"flex flex-wrap items-center gap-3 mt-1.5 text-xs text-muted-foreground",children:[e.jsx("span",{children:J(r.data)}),r.duracao_minutos&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(q,{className:"w-3 h-3"}),r.duracao_minutos," min"]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx($,{className:"w-3 h-3"}),(r.participantes||[]).join(", ")||"sem participantes"]})]}),r.status_ia==="erro"&&e.jsxs("p",{className:"text-xs text-amber-600 mt-1.5 flex items-center gap-1",children:[e.jsx(G,{className:"w-3 h-3"})," A IA não conseguiu processar: ",r.erro_ia]})]}),n&&e.jsxs("div",{className:"flex gap-1.5 flex-shrink-0",children:[e.jsxs(k,{size:"sm",variant:"outline",className:"gap-1.5",onClick:x,disabled:s,children:[s?e.jsx(M,{className:"w-3.5 h-3.5 animate-spin"}):e.jsx(Y,{className:"w-3.5 h-3.5"})," Analisar com IA"]}),e.jsxs(k,{size:"sm",variant:"outline",className:"gap-1.5",onClick:()=>o(r),children:[e.jsx(Z,{className:"w-3.5 h-3.5"})," Editar"]}),m&&e.jsx(k,{size:"sm",variant:"ghost",className:"text-destructive",onClick:p,children:e.jsx(ue,{className:"w-3.5 h-3.5"})})]})]}),e.jsxs("div",{className:"flex-1 min-h-0 grid grid-cols-1 xl:grid-cols-2",children:[e.jsx("div",{className:"overflow-y-auto p-6 border-b xl:border-b-0 xl:border-r border-border",children:e.jsx(je,{reuniao:r,podeEscrever:n,onToggleFollowup:N})}),e.jsxs("div",{className:"overflow-y-auto p-6 bg-muted/30",children:[e.jsxs("h3",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground flex items-center gap-1.5 mb-2",children:[e.jsx(K,{className:"w-3.5 h-3.5"})," Transcrição"]}
1),e.jsx("p",{className:"text-sm text-foreground/90 leading-relaxed whitespace-pre-wrap font-mono text-[12.5px]",children:r.transcricao})]})]})]}):e.jsxs("div",{className:"h-full flex flex-col items-center justify-center gap-2 text-muted-foreground",children:[e.jsx(F,{className:"w-12 h-12 opacity-20"}),e.jsx("p",{className:"text-sm",children:"Selecione uma reunião para ver a transcrição."})]})}const A=()=>({titulo:"",data:new Date().toISOString().slice(0,10),participantes:"",duracao_minutos:"",transcricao:""});function be({open:a,onClose:h,reuniao:n,onSalva:m}){const[o,t]=c.useState(A()),[r,f]=c.useState(!1),b=!!n;c.useEffect(()=>{a&&t(n?{titulo:n.titulo||"",data:n.data||"",participantes:(n.participantes||[]).join(", "),duracao_minutos:n.duracao_minutos||"",transcricao:n.transcricao||""}:A())},[a,n]);const j=i=>N=>t(x=>({...x,[i]:N.target.value})),s=async()=>{var i,N,x;if(!o.titulo.trim()||!o.data||!o.transcricao.trim()){w.error("Preencha título, data e transcrição.");return}f(!0);try{const p={acao:b?"editar":"criar",id:n==null?void 0:n.id,titulo:o.titulo.trim(),data:o.data,transcricao:o.transcricao,participantes:o.participantes.split(",").map(d=>d.trim()).filter(Boolean),duracao_minutos:o.duracao_minutos?Number(o.duracao_minutos):void 0},u=await _.functions.invoke("portalReunioes",p);if((i=u==null?void 0:u.data)!=null&&i.error)throw new Error(u.data.error);m(u.data.reuniao),h(),w.success(b?"Reunião atualizada.":"Reunião registrada.")}catch(p){w.error("Erro: "+(((x=(N=p==null?void 0:p.response)==null?void 0:N.data)==null?void 0:x.error)||(p==null?void 0:p.message)||""))}finally{f(!1)}};return e.jsx(ee,{open:a,onOpenChange:i=>!i&&!r&&h(),children:e.jsxs(se,{className:"max-w-2xl max-h-[90vh] overflow-y-auto",children:[e.jsxs(ae,{children:[e.jsx(te,{children:b?"Editar reunião":"Registrar reunião"}),e.jsx(re,{children:"Cole a transcrição da reunião para guardá-la como registro do time."})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3",children:[e.jsxs("div",{className:"sm:col-span-2",children:[e.jsx(S,{className:"text-xs",children:"Título"}),e.jsx(E,{value:o.titulo,onChange:j("titulo"),placeholder:"Ex: Reunião semanal dos Reds",className:"mt-1"})]}),e.jsxs("div",{children:[e.jsx(S,{className:"text-xs",children:"Data"}),e.jsx(E,{type:"date",value:o.data,onChange:j("data"),className:"mt-1"})]})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3",children:[e.jsxs("div",{className:"sm:col-span-2",children:[e.jsx(S,{className:"text-xs",children:"Participantes (separados por vírgula)"}),e.jsx(E,{value:o.participantes,onChange:j("participantes"),placeholder:"Ana, Bruno, Carla",className:"mt-1"})]}),e.jsxs("div",{children:[e.jsx(S,{className:"text-xs",children:"Duração (min)"}),e.jsx(E,{type:"number",min:"0",value:o.duracao_minutos,onChange:j("duracao_minutos"),placeholder:"60",className:"mt-1"})]})]}),e.jsxs("div",{children:[e.jsx(S,{className:"text-xs",children:"Transcrição"}),e.jsx("textarea",{value:o.transcricao,onChange:j("transcricao"),rows:12,placeholder:"Cole aqui a transcrição completa da reunião...",className:"mt-1 w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm font-mono resize-y"}),e.jsxs("p",{className:"text-[11px] text-muted-foreground mt-1",children:[o.transcricao.length.toLocaleString("pt-BR")," caracteres"]})]}),e.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[e.jsx(k,{variant:"outline",onClick:h,disabled:r,children:"Cancelar"}),e.jsx(k,{onClick:s,disabled:r,className:"gap-1.5",children:r?e.jsxs(e.Fragment,{children:[e.jsx(M,{className:"w-4 h-4 animate-spin"})," Salvando..."]}):e.jsxs(e.Fragment,{children:[e.jsx(oe,{className:"w-4 h-4"})," Salvar"]})})]})]})]})})}function R({icon:a,label:h,valor:n,sub:m,tom:o="text-primary bg-primary/10"}){return e.jsxs("div",{className:"bg-card border border-border rounded-xl p-4 flex items-start gap-3",children:[e.jsx("div",{className:`w-9 h-9 rounded-lg flex items-center justify-center flex-shrink-0 ${o}`,children:e.jsx(a,{className:"w-4 h-4"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-2xl font-semibold text-foreground leading-none",children:n}
1),e.jsx("p",{className:"text-xs font-medium text-foreground/80 mt-1.5",children:h}),m&&e.jsx("p",{className:"text-[11px] text-muted-foreground mt-0.5",children:m})]})]})}function ve({mesAno:a,podeEscrever:h}){const[n,m]=c.useState(null),[o,t]=c.useState(!0),[r,f]=c.useState(!1),b=c.useCallback(async()=>{t(!0);const x=await _.functions.invoke("portalReunioes",{acao:"insights",mes_ano:a});m(x.data),t(!1)},[a]);c.useEffect(()=>{b()},[b]);const j=async()=>{var x,p,u;f(!0);try{const d=await _.functions.invoke("portalReunioes",{acao:"gerar_relatorio",mes_ano:a});if((x=d==null?void 0:d.data)!=null&&x.error)throw new Error(d.data.error);m(d.data),w.success("Relatório do mês gerado.")}catch(d){w.error("Erro: "+(((u=(p=d==null?void 0:d.response)==null?void 0:p.data)==null?void 0:u.error)||(d==null?void 0:d.message)||""))}finally{f(!1)}};if(o||!n)return e.jsx("div",{className:"flex justify-center py-16",children:e.jsx(M,{className:"w-5 h-5 animate-spin text-muted-foreground"})});const s=n.metricas,i=n.relatorio,N=s.total_minutos?`${Math.round(s.total_minutos/60*10)/10} h em reunião`:"duração não informada";return e.jsxs("div",{className:"max-w-6xl mx-auto p-6 space-y-6",children:[e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-3 xl:grid-cols-5 gap-3",children:[e.jsx(R,{icon:F,label:"Reuniões",valor:s.total_reunioes,sub:B(a)}),e.jsx(R,{icon:q,label:"Tempo",valor:s.total_minutos?`${s.total_minutos} min`:"—",sub:N,tom:"text-sky-600 bg-sky-100 dark:bg-sky-950/40"}),e.jsx(R,{icon:$,label:"Participantes",valor:s.participantes_unicos,sub:`média ${s.media_participantes} por reunião`,tom:"text-violet-600 bg-violet-100 dark:bg-violet-950/40"}),e.jsx(R,{icon:W,label:"Decisões tomadas",valor:s.decisoes,tom:"text-emerald-600 bg-emerald-100 dark:bg-emerald-950/40"}),e.jsx(R,{icon:X,label:"Follow-ups abertos",valor:s.followups_abertos,sub:`${s.followups_concluidos} concluídos de ${s.followups_total}`,tom:"text-amber-600 bg-amber-100 dark:bg-amber-950/40"})]}),e.jsxs("div",{className:"bg-card border border-border rounded-xl p-4",children:[e.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground mb-3",children:"Temas mais frequentes"}),s.temas_top.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:"Nenhum tema ainda — registre reuniões neste mês."}):e.jsx("div",{className:"flex flex-wrap gap-2",children:s.temas_top.map(({tema:x,qtd:p},u)=>e.jsxs("span",{className:"px-3 py-1 rounded-full bg-primary/10 text-primary text-sm",style:{fontSize:`${Math.max(12,16-u)}px`},children:[x," ",e.jsxs("span",{className:"text-primary/60 text-xs",children:["×",p]})]},x))})]}),e.jsxs("div",{className:"bg-card border border-border rounded-xl",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3 px-5 py-4 border-b border-border",children:[e.jsxs("div",{children:[e.jsxs("h3",{className:"text-sm font-semibold text-foreground flex items-center gap-1.5",children:[e.jsx(D,{className:"w-4 h-4 text-primary"})," Relatório de IA do mês"]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:i?`Gerado em ${new Date(i.gerado_em).toLocaleString("pt-BR")} por ${i.gerado_por_nome||i.gerado_por_email}
1`:"Consolida todas as reuniões do mês: temas recorrentes, gargalos e recomendações."})]}),h&&e.jsxs(k,{onClick:j,disabled:r||s.total_reunioes===0,className:"gap-1.5 flex-shrink-0",children:[r?e.jsx(M,{className:"w-4 h-4 animate-spin"}):i?e.jsx(Y,{className:"w-4 h-4"}):e.jsx(D,{className:"w-4 h-4"}),r?"Gerando...":i?"Regenerar":"Gerar relatório de IA"]})]}),e.jsx("div",{className:"px-5 py-4",children:i!=null&&i.relatorio_ia?e.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none text-foreground [&_h2]:text-base [&_h2]:font-semibold [&_h2]:mt-5 [&_h2]:mb-2 [&_ul]:my-2 [&_li]:my-0.5 [&_p]:my-2",children:e.jsx(pe,{children:i.relatorio_ia})}):e.jsxs("div",{className:"flex flex-col items-center gap-2 py-10 text-muted-foreground",children:[e.jsx(T,{className:"w-10 h-10 opacity-20"}),e.jsx("p",{className:"text-sm",children:s.total_reunioes===0?"Registre reuniões neste mês para gerar o relatório.":"Nenhum relatório gerado ainda para este mês."})]})})]})]})}function us(){var P;const{podeEscrever:a,podeExcluir:h}=ie("area_base_conhecimento"),[n,m]=c.useState("reunioes"),[o,t]=c.useState(ce()),[r,f]=c.useState([]),[b,j]=c.useState(!0),[s,i]=c.useState(null),[N,x]=c.useState({open:!1,reuniao:null}),p=c.useCallback(async()=>{var v;j(!0);const l=await _.functions.invoke("portalReunioes",{acao:"listar"});f(((v=l==null?void 0:l.data)==null?void 0:v.reunioes)||[]),j(!1)},[]);c.useEffect(()=>{p()},[p]);const u=c.useMemo(()=>de(r.map(l=>l.mes_ano)),[r]),d=c.useMemo(()=>r.filter(l=>l.mes_ano===o),[r,o]),C=l=>{f(v=>v.some(y=>y.id===l.id)?v.map(y=>y.id===l.id?l:y):[l,...v]),t(l.mes_ano),i(l.id),m("reunioes")},g=(l,v)=>{if(v){f(y=>y.filter(L=>L.id!==v)),i(null);return}l&&f(y=>y.map(L=>L.id===l.id?l:L))};return e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsx("div",{className:"px-6 py-4 border-b border-border bg-card",children:e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-9 h-9 rounded-xl bg-primary/10 flex items-center justify-center",children:e.jsx(F,{className:"w-4 h-4 text-primary"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-lg font-semibold text-foreground",children:"Reuniões & Conhecimento"}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[d.length," reunião(ões) em ",B(o)," · ",r.length," no total"]})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"flex rounded-lg border border-border overflow-hidden",children:[{v:"reunioes",l:"Reuniões",I:he},{v:"insights",l:"Insights do mês",I:le}].map(l=>e.jsxs("button",{onClick:()=>m(l.v),className:I("px-3 py-1.5 text-xs font-medium flex items-center gap-1.5 transition-colors",n===l.v?"bg-primary text-primary-foreground":"text-muted-foreground hover:bg-muted"),children:[e.jsx(l.I,{className:"w-3.5 h-3.5"})," ",l.l]},l.v))}),e.jsxs(U,{value:o,onValueChange:t,children:[e.jsx(V,{className:"h-8 w-44 text-xs",children:e.jsx(O,{})}),e.jsx(H,{children:u.map(l=>e.jsx(z,{value:l,children:B(l)},l))})]}),a&&e.jsxs(k,{size:"sm",className:"gap-1.5",onClick:()=>x({open:!0,reuniao:null}),children:[e.jsx(ne,{className:"w-4 h-4"})," Nova reunião"]})]})]})}),n==="insights"?e.jsx("div",{className:"flex-1 overflow-y-auto",children:e.jsx(ve,{mesAno:o,podeEscrever:a})}):e.jsxs("div",{className:"flex-1 min-h-0 flex flex-col lg:flex-row",children:[e.jsx("aside",{className:"lg:w-80 xl:w-96 flex-shrink-0 border-b lg:border-b-0 lg:border-r border-border bg-card/50 max-h-[40vh] lg:max-h-none",children:e.jsx(ge,{reunioes:d,loading:b,selecionadaId:s,onSelecionar:i})}),e.jsx("section",{className:"flex-1 min-w-0 min-h-0",children:e.jsx(Ne,{reuniaoId:s,statusIa:(P=r.find(l=>l.id===s))==null?void 0:P.status_ia,podeEscrever:a,podeExcluir:h,onEditar:l=>x({open:!0,reuniao:l}),onAlterada:g})})]}),e.jsx(be,{open:N.open,reuniao:N.reuniao,onClose:()=>x({open:!1,reuniao:null}),onSalva:C})]})}export{us 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.