PageSourceSearch

https://pragmaz.ai/assets/AdminWupGate-CjNdlwz1.js

js pragmaz.ai collected 2026-09-24 14:08:43 UTC 30,976 bytes, 1 lines download raw bytes

1import{r as y,e as ze,z as Le,j as e,i as Ie,a2 as _,ah as q,aI as E,a1 as _e,cI as K,aT as qe,aU as He,$ as Te,W as be,aw as Ue,M as Ee,dv as Ke,cd as We,aO as fe,an as Ye,dw as Xe,aW as Qe,cG as Ve}from"./app-BEDoDvHI.js";import{R as Ne,C as ye,X as ve,Y as ke,T as we,s as Se,P as Je,B as $e}from"./generateCategoricalChart-wDI50HjE.js";import{A as Ze,a as H}from"./AreaChart-BbMDZRLq.js";import{B as es}from"./BarChart-C8x4GquS.js";const w={redirect:"#6366f1",goias:"#10b981",semGeo:"#64748b"},O=["#6366f1","#8b5cf6","#06b6d4","#ec4899","#14b8a6","#a78bfa","#22d3ee","#f472b6"],De=[{k:"24h",label:"24 horas"},{k:"7d",label:"7 dias"},{k:"30d",label:"30 dias"},{k:"90d",label:"90 dias"}],o=s=>(Number(s)||0).toLocaleString("pt-BR"),Fe=s=>s?new Date(s).toLocaleString("pt-BR",{day:"2-digit",month:"2-digit",hour:"2-digit",minute:"2-digit"}):"—",z=s=>s?new Date(s).toLocaleString("pt-BR"):"—",ss=s=>{if(!s)return null;const a=(Date.now()-new Date(s))/6e4;return Number.isFinite(a)?a<2?"agora há pouco":a<60?`há ${Math.round(a)}min`:a<48*60?`há ${Math.round(a/60)}h`:`há ${Math.round(a/1440)} dias`:null},Ce=s=>s==null?"—":s<60?`${Math.round(s)}s`:s<3600?`${Math.round(s/60)}min`:`${Math.round(s/360)/10}h`,W=(s,a=46)=>{if(!s)return"—";const m=String(s);return m.length>a?`${m.slice(0,a)}…`:m},T=s=>{try{return new URL(s).hostname.replace(/^www\./,"")}catch{return null}},U=(()=>{try{return new Intl.DisplayNames(["pt-BR"],{type:"region"})}catch{return null}})(),Re=s=>{if(!s||s==="??")return"País não identificado";try{return(U==null?void 0:U.of(s))||s}catch{return s}},ts=(s,a)=>{if(a){const h=new Date(String(s).replace(" ","T"));h.setHours(h.getHours()+1);const k=C=>String(C).padStart(2,"0");return`${h.getFullYear()}-${k(h.getMonth()+1)}-${k(h.getDate())} ${k(h.getHours())}:00:00`}const[m,b,v]=String(s).split("-").map(Number),p=new Date(m,b-1,v+1),x=h=>String(h).padStart(2,"0");return`${p.getFullYear()}-${x(p.getMonth()+1)}-${x(p.getDate())}`},as=new Set(["com","net","org","gov","edu","mil","co","ac","or","ne"]),rs=s=>{if(!s)return null;const a=String(s).toLowerCase().replace(/\.$/,"").split(".").filter(Boolean);return a.length<=2?a.join(".")||null:as.has(a[a.length-2])&&a.length>=3?a.slice(-3).join("."):a.slice(-2).join(".")},os=[[/\bEdg(?:e|A|iOS)?\//i,"Edge"],[/\bOPR\/|\bOpera\//i,"Opera"],[/\bSamsungBrowser\//i,"Samsung"],[/\bYaBrowser\//i,"Yandex"],[/\bFirefox\/|\bFxiOS\//i,"Firefox"],[/\bChrome\/|\bCriOS\//i,"Chrome"],[/\bSafari\//i,"Safari"]],is=[[/\biPhone\b/i,"iPhone"],[/\biPad\b/i,"iPad"],[/\bAndroid\b/i,"Android"],[/\bWindows\b/i,"Windows"],[/\bMac OS X\b|\bMacintosh\b/i,"Mac"],[/\bCrOS\b/i,"ChromeOS"],[/\bLinux\b|\bX11\b/i,"Linux"]],Oe=(s,a)=>{var m;return((m=s.find(([b])=>b.test(a)))==null?void 0:m[1])||null},ns=s=>{if(!s)return"—";const a=Oe(os,s),m=Oe(is,s);return!a&&!m?W(s,26):[a,m].filter(Boolean).join(" · ")},Ae={redirect:{label:"Redirecionado",cor:"text-indigo-300 bg-indigo-500/10 border-indigo-500/30"},goias:{label:"Goiás · 404",cor:"text-emerald-300 bg-emerald-500/10 border-emerald-500/30"},sem_geo:{label:"Sem geo · 404",cor:"text-slate-300 bg-slate-500/10 border-slate-500/30"}};function G({icon:s,valor:a,label:m,sub:b,cor:v="text-indigo-400",ajuda:p}){const x=e.jsxs("div",{className:"bg-dark-800 border border-gray-700/50 rounded-xl p-5 h-full",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx("span",{className:`text-2xl ${v}`,children:s}),p&&e.jsx(K,{className:"text-gray-600 text-sm"})]}),e.jsx("p",{className:"text-2xl font-bold text-gray-100 truncate",children:a}),e.jsx("p",{className:"text-sm text-gray-400 mt-1",children:m}),b!=null&&e.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:b})]});return p?e.jsx(E,{content:p,position:"top",children:x}):x}function $({titulo:s,icone:a,children:m,direita:b,vazio:v,temDado:p}){return e.jsxs("div",{className:"bg-dark-800 border border-gray-700/50 rounded-xl p-5",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("h2",{className:"text-sm font-semibold text-gray-300 flex items-center gap-2",children:[a,s]}),b]}),p?m:e.jsx("p",{className:"text-sm text-gray-500 py-6 text-center",children:v||"Nada no período."})]})}function F({itens:s,chave:a,valor:m,extra:b,corBarra:v=w.redirect,formatar:p}){const x=Math.max(...s.map(h=>Number(h[m])||0),1);return e.jsx("div",{className:"space-y-2",children:s.map((h,k)=>{const C=Number(h[m])||0,f=h[a];return e.jsxs("div",{className:"relative",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3 text-sm relative z-10 px-2 py-1.5",children:[e.jsx("span",{className:"text-gray-200 truncate",title:f||"",children:p?p(h):W(f)||"—"}),e.jsxs("span",{className:"text-gray-400 font-mono text-xs shrink-0",children:[o(C),b?b(h):null]})]}),e.jsx("div",{className:"absolute inset-y-0 left-0 rounded-md opacity-20",style:{width:`${C/x*100}%`,background:v}})]},`${f}-${k}`)})})}function Ge({active:s,payload:a,label:m}){var v,p;if(!s||!(a!=null&&a.length))return null;const b=((p=(v=a[0])==null?void 0:v.payload)==null?void 0:p.rotuloCompleto)||m;return e.jsxs("div",{className:"bg-dark-900 border border-gray-700 rounded-lg px-3 py-2 shadow-xl",children:[e.jsx("p",{className:"text-xs text-gray-400 mb-1",children:b}),a.map(x=>e.jsxs("p",{className:"text-xs",style:{color:x.color},children:[x.name,": ",e.jsx("span",{className:"font-semibold",children:o(x.value)})]},x.dataKey))]})}function xs(){var te,ae,re,oe,ie,ne,le,ce,de,me,xe,ue,ge,pe,he;const[s,a]=y.useState(null),[m,b]=y.useState(!0),[v,p]=y.useState(!1),[x,h]=y.useState(null),[k,C]=y.useState("24h"),[f,P]=y.useState(null),B=y.useRef(0),A=y.useCallback(async(t,c,l)=>{var u,g,n,D,je;const d=++B.current;c||b(!0),p(!0),h(null);try{const{data:S}=await ze.get("/admin/wup-gate",{params:{period:t,...l?{dominio:l}:{}}});if(d!==B.current)return;a(S)}catch(S){if(d!==B.current)return;Le.error(((g=(u=S==null?void 0:S.response)==null?void 0:u.data)==null?void 0:g.error)||"Não deu pra carregar o porteiro"),h(((n=S==null?void 0:S.response)==null?void 0:n.status)===429?"limite":((je=(D=S==null?void 0:S.response)==null?void 0:D.data)==null?void 0:je.error)||"Não deu pra carregar o porteiro")}finally{d===B.current&&(b(!1),p(!1))}},[]);y.useEffect(()=>{A(k,!1,f)},[k,f,A]);const r=s==null?void 0:s.resumo,i=s==null?void 0:s.escritor,N=y.useMemo(()=>{var g;if(!((g=s==null?void 0:s.serie)!=null&&g.length))return[];const t=new Map;for(const n of s.serie)t.has(n.bucket)||t.set(n.bucket,{bucket:n.bucket,redirect:0,goias:0,sem_geo:0}),t.get(n.bucket)[n.decision]=Number(n.total)||0;const c=s.janela||{}
1,l=[c.bucketInicio,c.bucketPrimeiro].filter(Boolean).sort().pop(),d=c.bucketFim;if(l&&d&&l<=d){let n=l;for(let D=0;n<=d&&D<2400;D++)t.has(n)||t.set(n,{bucket:n,redirect:0,goias:0,sem_geo:0}),n=ts(n,s.porHora)}const u=new Set([l,d].filter(Boolean));return[...t.values()].sort((n,D)=>n.bucket<D.bucket?-1:1).map(n=>({...n,parcial:u.has(n.bucket),rotulo:s.porHora?`${String(n.bucket).slice(11,13)}h`:`${String(n.bucket).slice(8,10)}/${String(n.bucket).slice(5,7)}`,rotuloCompleto:(s.porHora?`${String(n.bucket).slice(8,10)}/${String(n.bucket).slice(5,7)} às ${String(n.bucket).slice(11,13)}h`:`${String(n.bucket).slice(8,10)}/${String(n.bucket).slice(5,7)}/${String(n.bucket).slice(0,4)}`)+(u.has(n.bucket)?" · período incompleto":"")}))},[s]),M=y.useMemo(()=>({redirect:N.some(t=>t.redirect>0),goias:N.some(t=>t.goias>0),sem_geo:N.some(t=>t.sem_geo>0)}),[N]),Y=y.useMemo(()=>{if(N.length<2)return[];const t=[];N[0].parcial&&t.push({k:"ini",x1:N[0].bucket,x2:N[1].bucket});const c=N.length-1;return N[c].parcial&&t.push({k:"fim",x1:N[c-1].bucket,x2:N[c].bucket}),t},[N]),X=y.useMemo(()=>{const t=Array.from({length:24},(c,l)=>({hora:l,rotulo:`${String(l).padStart(2,"0")}h`,total:0,humanos:0}));for(const c of(s==null?void 0:s.horarios)||[]){const l=Number(c.hora);l>=0&&l<24&&(t[l].total=Number(c.total)||0,t[l].humanos=Number(c.humanos)||0)}return t},[s]),R=y.useMemo(()=>{const t=new Map;for(const u of(s==null?void 0:s.referers)||[]){const g=T(u.referer)||"origem desconhecida";t.set(g,(t.get(g)||0)+(Number(u.total)||0))}const c=[...t.entries()].map(([u,g])=>({host:u,total:g})).sort((u,g)=>g.total-u.total),l=c.slice(0,12),d=c.slice(12).reduce((u,g)=>u+g.total,0);return{topo:l,resto:d,outros:Math.max(0,c.length-12)}},[s]),j=(s==null?void 0:s.origemCobertura)||null;if(m&&!s)return e.jsx(Ie,{});if(x&&!s)return e.jsx("div",{className:"w-full",children:e.jsxs("div",{className:"bg-red-500/10 border border-red-500/30 rounded-xl p-5 flex items-start gap-3",children:[e.jsx(_,{className:"text-red-400 text-xl shrink-0 mt-0.5"}),e.jsxs("div",{className:"text-sm",children:[e.jsx("p",{className:"text-red-300 font-semibold",children:x==="limite"?"Muitas consultas em pouco tempo.":"Não deu pra carregar o porteiro."}),e.jsx("p",{className:"text-gray-400 mt-1",children:x==="limite"?"Espere alguns segundos e tente de novo — o painel do admin aceita 60 consultas por minuto.":x}),e.jsx("button",{onClick:()=>A(k,!1,f),className:"mt-3 px-3 py-1.5 text-xs font-medium rounded-md bg-indigo-600 text-white hover:bg-indigo-500",children:"Tentar de novo"})]})]})});const Q=i!=null&&i.ultimoFlushOk?(Date.now()-new Date(i.ultimoFlushOk))/1e3:null,Pe=!!i&&(i.errosFlush>0||i.descartados>0),V=!!i&&i.naFila>0&&Q!=null&&Q>30,Be=((i==null?void 0:i.flushSeg)||5)*3,J=!!i&&i.recebidos>0&&i.gravados===0&&(i.idadeSeg==null||i.idadeSeg>Be),Z=t=>t?(Date.now()-new Date(t))/36e5:null,L=((s==null?void 0:s.janelaDominios)||[]).map(t=>({...t,idadeH:Z(t.maisRecente)})).filter(t=>t.idadeH!=null&&t.idadeH>6),I=Z((te=s==null?void 0:s.janela)==null?void 0:te.maisRecente),ee=I!=null&&I>6||L.length>0,Me=Pe||V||J||ee,se=(t,c,l)=>{var u,g;if(f==="whatsup.plus")return"whatsup.plus não tem porteiro";if(c>0)return l;const d=(u=s==null?void 0:s.ultimoPorDecisao)==null?void 0:u[t];return d!=null&&d.ultimo?`nenhum no período · último ${Fe(d.ultimo)} (${ss(d.ultimo)})`:(g=s==null?void 0:s.janela)!=null&&g.maisAntigo?`nunca aconteceu — registro começou em ${new Date(s.janela.maisAntigo).toLocaleDateString("pt-BR")}`:"nenhum registrado"};return e.jsxs("div",{className:"w-full space-y-6 pb-10",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"text-2xl font-bold text-gray-100 flex items-center gap-2",children:[e.jsx(q,{className:"text-indigo-400"})," Porteiro dos domínios antigos"]}),e.jsxs("p",{className:"text-sm text-gray-400 mt-1",children:[e.jsx("strong",{className:"text-cyan-300",children:"wup.plus"}),": quem está em"," ",e.jsx("strong",{className:"text-emerald-400",children:"Goiás"})," continua vendo o 404, o resto vai pra ",e.jsx("strong",{className:"text-indigo-400",children:"pragmaz.ai"}),"."," ",e.jsx("strong",{className:"text-violet-300",children:"whatsup.plus"}),": 301 pra todo mundo, sem porteiro."]})]}),e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[((ae=s==null?void 0:s.dominios)==null?void 0:ae.length)>0&&e.jsxs("div",{className:"flex bg-dark-800 border border-gray-700/50 rounded-lg p-1",children:[e.jsx("button",{onClick:()=>P(null),className:`px-3 py-1.5 text-xs font-medium rounded-md transition-colors ${f===null?"bg-indigo-600 text-white":"text-gray-400 hover:text-gray-200"}`,children:"Os dois"}),s.dominios.map(t=>e.jsxs("button",{onClick:()=>P(t.dominio),className:`px-3 py-1.5 text-xs font-medium rounded-md transition-colors ${f===t.dominio?"bg-indigo-600 text-white":"text-gray-400 hover:text-gray-200"}`,children:[t.dominio," ",e.jsx("span",{className:"opacity-60",children:o(t.total)})]},t.dominio))]}),e.jsx("div",{className:"flex bg-dark-800 border border-gray-700/50 rounded-lg p-1",children:De.map(t=>e.jsx("button",{onClick:()=>C(t.k),className:`px-3 py-1.5 text-xs font-medium rounded-md transition-colors ${k===t.k?"bg-indigo-600 text-white":"text-gray-400 hover:text-gray-200"}`,children:t.label},t.k))}),e.jsx(E,{content:"Recarregar agora",position:"top",children:e.jsx("button",{onClick:()=>A(k,!0,f),disabled:v,"aria-label":"Recarregar",className:"p-2 rounded-lg border border-gray-700/50 text-gray-400 hover:text-indigo-300 hover:border-indigo-500/50 disabled:opacity-40 disabled:cursor-not-allowed",children:e.jsx(_e,{className:v?"animate-spin":""})})})]})]}),x&&s&&e.jsxs("div",{className:"bg-red-500/10 border border-red-500/30 rounded-xl p-4 flex items-start gap-3",children:[e.jsx(_,{className:"text-red-400 text-xl shrink-0 mt-0.5"}),e.jsxs("div",{className:"text-sm flex-1",children:[e.jsx("p",{className:"text-red-300 font-semibold",children:x==="limite"?"Muitas consultas em pouco tempo — não deu pra atualizar.":"Não deu pra atualizar o porteiro."}),e.jsxs("p",{className:"text-gray-400 mt-1",children:["O que está na tela é a ",e.jsx("strong",{className:"text-gray-300",children:"consulta anterior"}),":"," ",((re=De.find(t=>t.k===s.periodo))==null?void 0:re.label)||s.periodo," · ",s.dominioFiltro||"os dois domínios",".",x==="limite"?" O painel do admin aceita 60 consultas por minuto.":""]}),e.jsx("button",{onClick:()=>A(k,!0,f),className:"mt-3 px-3 py-1.5 text-xs font-medium rounded-md bg-indigo-600 text-white hover:bg-indigo-500",children:"Tentar de novo"})]})]}),Me&&e.jsxs("div",{className:"bg-red-500/10 border border-red-500/30 rounded-xl p-4 flex items-start gap-3",children:[e.jsx(_,{className:"text-red-400 text-xl shrink-0 mt-0.5"}),e.jsxs("div",{className:"text-sm",children:[e.jsx("p",{className:"text-red-300 font-semibold",children:J?"O registro NUNCA conseguiu gravar — os números abaixo não valem nada.":V?"O registro travou: tem evento na fila e nada é gravado há mais de 30s.":ee?L.length>0?`Sem nenhum registro de ${L.map(t=>`${t.dominio} há ${Math.round(t.idadeH)}h`).join(" e ")} — esse porteiro pode ter parado de chamar o registro (vhost, chave ou nginx).`:`Nenhuma decisão registrada há ${Math.round(I)}h — o porteiro pode ter parado de chamar o registro (vhost, chave ou nginx).`:"O registro está perdendo eventos — os números abaixo estão incompletos."}),e.jsxs("p",{className:"text-gray-400 mt-1",children:[o(i.descartados)," descartados por fila cheia · ",o(i.errosFlush)," erros de gravação"," ","· ",o(i.naFila)," na fila",i.ultimoFlushOk?` · última gravação ${z(i.ultimoFlushOk)}`:" · nunca gravou",i.ultimoErro?` · último erro: ${i.ultimoErro}`:"",i.idadeSeg!=null?` · contadores do processo atual (${Ce(i.idadeSeg)} no ar)`:""]})]})]}),e.jsxs("div",{className:"bg-dark-800/60 border border-gray-700/40 rounded-xl p-4 flex items-start gap-3",children:[e.jsx(K,{className:"text-indigo-400 shrink-0 mt-0.5"}),e.jsxs("p",{className:"text-xs text-gray-400 leading-relaxed",children:[e.jsx("strong",{className:"text-cyan-300",children:"wup.plus"})," conta"," ",e.jsx("strong",{className:"text-gray-300",children:"só o que passa pelo porteiro"}),": a raiz e caminhos que nenhuma outra rota atende, mais ",e.jsx("code",{className:"text-gray-300",children:"/login"}),". Ficam de fora"," ",e.jsx("code",{className:"text-gray-300",children:"/wp-json/"}),", ",e.jsx("code",{className:"text-gray-300",children:"/models/"}),","," ",e.jsx("code",{className:"text-gray-300",children:"/profile"}),", ",e.jsx("code",{className:"text-gray-300",children:"/api/"}),","," ",e.jsx("code",{className:"text-gray-300",children:"/subscribe-*"}),", estáticos, ",e.jsx("code",{className:"text-gray-300",children:".php"}),","," ",e.jsx("code",{className:"text-gray-300",children:"robots.txt"})," e ",e.jsx("code",{className:"text-gray-300",children:"/.well-known/"})," — é o funil da raiz, não do domínio inteiro."," ",e.jsx("strong",{className:"text-violet-300",children:"whatsup.plus"})," registra por espelho no"," ",e.jsx("code",{className:"text-gray-300",children:"location /"})," e ",e.jsx("strong",{className:"text-gray-300",children:"captura tudo"}),", inclusive ",e.jsx("code",{className:"text-gray-300",children:".php"})," e ",e.jsx("code",{className:"text-gray-300",children:"robots.txt"}),". Os dois escopos são diferentes: na aba ",e.jsx("em",{children:"Os dois"})," eles aparecem somados.",i?e.jsxs(e.Fragment,{children:[" Guardamos ",i.retencaoDias," dias."]}):null]})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 xl:grid-cols-5 ga
1p-4",children:[e.jsx(G,{icon:e.jsx(qe,{}),valor:o(r==null?void 0:r.redirects),label:"Redirects para pragmaz.ai",sub:`${(r==null?void 0:r.pctRedirect)??0}% de tudo que bateu`,cor:"text-indigo-400",ajuda:"Quem saiu daqui para o pragmaz.ai, somando três caminhos: 302 na raiz do wup.plus (só para quem NÃO está em Goiás), 301 no /login do wup.plus e 301 no whatsup.plus — nesses dois últimos vai todo mundo, goiano incluído."}),e.jsx(G,{icon:e.jsx(He,{}),valor:o(r==null?void 0:r.goias),label:"Goiás — manteve o 404",sub:se("goias",r==null?void 0:r.goias,`${o((ie=(oe=r==null?void 0:r.porDecisao)==null?void 0:oe.goias)==null?void 0:ie.unicos)} visitantes únicos · só wup.plus`),cor:"text-emerald-400",ajuda:"IP geolocalizado em BR/GO: o site segue desativado para essas pessoas. Só o wup.plus tem porteiro — no whatsup.plus todo mundo é redirecionado, inclusive quem está em Goiás."}),e.jsx(G,{icon:e.jsx(K,{}),valor:o(r==null?void 0:r.semGeo),label:"Sem geo — 404 por segurança",sub:se("sem_geo",r==null?void 0:r.semGeo,"IP privado ou não localizado · só wup.plus"),cor:"text-slate-400",ajuda:"Não deu para ler o IP. Na dúvida o porteiro mantém o 404, nunca redireciona"}),e.jsx(G,{icon:e.jsx(Te,{}),valor:o(r==null?void 0:r.unicosGlobal),label:"Visitantes únicos",sub:`${o(r==null?void 0:r.total)} requisições · ${o(r==null?void 0:r.humanos)} não-robô`,cor:"text-violet-400",ajuda:"IPs distintos (hash) no período. CGNAT de operadora móvel junta várias pessoas num mesmo IP — é piso, não gente."}),e.jsx(G,{icon:e.jsx(be,{}),valor:o(r==null?void 0:r.robos),label:"Requisições de robôs",sub:`${(r==null?void 0:r.pctRobos)??0}% de tudo · inclui sem User-Agent`,cor:"text-cyan-400",ajuda:"Crawler/IA/monitoramento identificados pelo User-Agent (mesma lista do analytics) MAIS as requisições que chegam sem User-Agent nenhum — navegador sempre manda um, então ausência é scanner."})]}),e.jsx($,{titulo:"Por domínio",icone:e.jsx(q,{className:"text-indigo-400"}),temDado:((ne=s==null?void 0:s.dominios)==null?void 0:ne.length)>0,vazio:"Nenhum acesso registrado nos dois domínios neste período.",direita:f?e.jsx("button",{onClick:()=>P(null),className:"text-xs text-indigo-400 hover:text-indigo-300",children:"ver os dois"}):null,children:e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:((s==null?void 0:s.dominios)||[]).map(t=>{const c=t.dominio==="wup.plus",l=s.dominios.reduce((u,g)=>u+g.total,0),d=l?Math.round(t.total/l*100):0;return e.jsxs("button",{onClick:()=>P(f===t.dominio?null:t.dominio),className:`text-left p-4 rounded-xl border transition-colors ${f===t.dominio?"border-indigo-500/60 bg-indigo-500/5":"border-gray-700/50 hover:border-indigo-500/40"}`,children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("span",{className:"text-sm font-semibold text-gray-100",children:t.dominio}),e.jsxs("span",{className:"text-xs text-gray-500",children:[d,"% do total"]})]}),e.jsxs("p",{className:"text-2xl font-bold text-indigo-300",children:[o(t.redirects),e.jsx("span",{className:"text-sm font-normal text-gray-500",children:" redirects"})]}),e.jsxs("div",{className:"mt-2 text-xs text-gray-500 space-y-0.5",children:[e.jsxs("p",{children:[o(t.unicos)," visitantes únicos · ",o(t.humanos)," não-robô"]}),c?e.jsxs("p",{children:[e.jsx("strong",{className:"text-emerald-400",children:o(t.manteve404)})," de Goiás mantiveram o 404",t.semGeo>0?e.jsxs(e.Fragment,{children:[" · ",e.jsx("strong",{className:"text-slate-400",children:o(t.semGeo)})," sem geo"]}):null]}):e.jsx("p",{className:"text-gray-600",children:"301 direto — sem porteiro, todo mundo vai pro pragmaz.ai"})]})]},t.dominio)})})}),e.jsxs($,{titulo:`Linha do tempo — ${s!=null&&s.porHora?"por hora":"por dia"}`,icone:e.jsx(Ue,{className:"text-indigo-400"}),temDado:N.length>0,children:[e.jsx(Ne,{width:"100%",height:260,children:e.jsxs(Ze,{data:N,margin:{top:5,right:8,left:-18,bottom:0},children:[e.jsxs("defs",{children:[e.jsxs("linearGradient",{id:"gRedir",x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"5%",
1stopColor:w.redirect,stopOpacity:.5}),e.jsx("stop",{offset:"95%",stopColor:w.redirect,stopOpacity:.03})]}),e.jsxs("linearGradient",{id:"gGoias",x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"5%",stopColor:w.goias,stopOpacity:.5}),e.jsx("stop",{offset:"95%",stopColor:w.goias,stopOpacity:.03})]})]}),e.jsx(ye,{strokeDasharray:"3 3",stroke:"#374151",vertical:!1}),e.jsx(ve,{dataKey:"bucket",stroke:"#6b7280",fontSize:11,tickLine:!1,axisLine:!1,tickFormatter:t=>s!=null&&s.porHora?`${String(t).slice(11,13)}h`:`${String(t).slice(8,10)}/${String(t).slice(5,7)}`}),e.jsx(ke,{stroke:"#6b7280",fontSize:11,tickLine:!1,axisLine:!1,allowDecimals:!1}),e.jsx(we,{content:e.jsx(Ge,{})}),e.jsx(Se,{wrapperStyle:{fontSize:12}}),Y.map(t=>e.jsx(Je,{x1:t.x1,x2:t.x2,fill:w.semGeo,fillOpacity:.16,stroke:w.semGeo,strokeOpacity:.25},t.k)),e.jsx(H,{type:"monotone",dataKey:"redirect",name:"Redirect",stackId:"1",stroke:w.redirect,fill:"url(#gRedir)",strokeWidth:2}),M.goias&&e.jsx(H,{type:"monotone",dataKey:"goias",name:"Goiás (404)",stackId:"1",stroke:w.goias,fill:"url(#gGoias)",strokeWidth:2}),M.sem_geo&&e.jsx(H,{type:"monotone",dataKey:"sem_geo",name:"Sem geo",stackId:"1",stroke:w.semGeo,fill:w.semGeo,fillOpacity:.12,strokeWidth:2})]})}),Y.length>0&&e.jsxs("p",{className:"text-xs text-gray-500 mt-2",children:["As pontas sombreadas são ",s!=null&&s.porHora?"horas":"dias"," ",e.jsx("strong",{className:"text-gray-400",children:"incompletos"})," — a janela é corrida, então o ",s!=null&&s.porHora?"primeiro e o último balde":"primeiro e o último dia"," cobrem menos tempo que os do meio. A queda na borda direita é o relógio, não o tráfego."]}),!M.goias&&!M.sem_geo&&e.jsxs("p",{className:"text-xs text-gray-500 mt-1",children:["Nenhum acesso ficou no 404 no período: ",e.jsx("strong",{className:"text-gray-400",children:"tudo foi redirecionado"}),"."]})]}),e.jsx($,{titulo:`Que horas batem em ${f||"wup.plus + whatsup.plus"} (horário de Brasília)`,icone:e.jsx(Ee,{className:"text-indigo-400"}),temDado:X.some(t=>t.total>0),children:e.jsx(Ne,{width:"100%",height:200,children:e.jsxs(es,{data:X,margin:{top:5,right:8,left:-18,bottom:0},children:[e.jsx(ye,{strokeDasharray:"3 3",stroke:"#374151",vertical:!1}),e.jsx(ve,{dataKey:"rotulo",stroke:"#6b7280",fontSize:10,tickLine:!1,axisLine:!1,interval:1}),e.jsx(ke,{stroke:"#6b7280",fontSize:11,tickLine:!1,axisLine:!1,allowDecimals:!1}),e.jsx(we,{content:e.jsx(Ge,{}),cursor:{fill:"#ffffff08"}}),e.jsx(Se,{wrapperStyle:{fontSize:12}}),e.jsx($e,{dataKey:"total",name:"Tudo",fill:w.redirect,radius:[3,3,0,0]}),e.jsx($e,{dataKey:"humanos",name:"Sem robôs",fill:"#8b5cf6",radius:[3,3,0,0]})]})})}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4",children:[e.jsx($,{titulo:"Estados do Brasil",icone:e.jsx(Ke,{className:"text-indigo-400"}),temDado:((le=s==null?void 0:s.ufs)==null?void 0:le.length)>0,vazio:"Nenhum acesso do Brasil no período.",children:e.jsx(F,{itens:(s==null?void 0:s.ufs)||[],chave:"region",valor:"total",formatar:t=>{const c=t.region==="sem UF",l=t.region==="GO",d=Number(t.manteve404)||0;return e.jsxs("span",{className:l&&d>0?"text-emerald-300 font-semibold":c?"text-slate-400 italic":"",children:[c?"sem UF — GeoIP não devolveu o estado":l?"GO — Goiás":t.region,l&&e.jsxs("span",{className:"text-gray-500 font-normal",children:[" · ",d>0?`${o(d)} mantiveram o 404`:"nenhum manteve o 404",t.total-d>0?`, ${o(t.total-d)} redirecionados`:""]})]})},extra:t=>e.jsxs("span",{className:"text-gray-600",children:[" · ",o(t.unicos)," únicos"]})})}),e.jsx($,{titulo:"Países",icone:e.jsx(q,{className:"text-indigo-400"}),temDado:((ce=s==null?void 0:s.paises)==null?void 0:ce.length)>0,children:e.jsx(F,{itens:(s==null?void 0:s.paises)||[],chave:"country",valor:"total",corBarra:O[2],formatar:t=>e.jsxs("span",{children:[Re(t.country)," ",e.jsx("span",{className:"text-gray-600 font-mono text-xs",children:t.country})]}),extra:t=>e.jsxs("span",{className:"text-gray-600",children:[" · ",o(t.unicos)," únicos"]})})}),e.jsx($,{titulo:"Cidades",icone:e.jsx(We,{className:"text-indigo-400"}),temDado:((de=s==null?void 0:s.cidades)==null?void 0:de.length)>0,children:e.jsx(F,{itens:(s==null?void 0:s.cidades)||[],chave:"city",valor:"total",corBarra:O[1],formatar:t=>e.jsxs("span",{children:[t.city,e.jsx("span",{className:"text-gray-500",children:t.country==="BR"?t.region?` · ${t.region}`:" · Brasil":` · ${Re(t.country)}`})]})})})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4",children:[e.jsxs($,{titulo:"De onde vieram",icone:e.jsx(fe,{className:"text-indigo-400"}),temDado:((me=s==null?void 0:s.redes)==null?void 0:me.length)>0||R.topo.length>0,vazio:"Sem origem identificável ainda — nem rede, nem link.",direita:j?e.jsxs("span",{className:"text-xs text-gray-500",children:[j.pctComRede,"% com rede"]}):null,children:[((xe=s==null?void 0:s.redes)==null?void 0:xe.length)>0&&e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"text-xs text-gray-500 mb-2",children:["Rede dona do IP, pelo DNS reverso (",(j==null?void 0:j.pctComRede)??0,"%) — é hospedagem/operadora, não link de entrada"]}),e.jsx(F,{itens:s.redes.map(t=>({host:t.rede,total:t.total,unicos:t.unicos})),chave:"host",valor:"total",corBarra:O[3],extra:t=>t.unicos>1?e.jsxs("span",{className:"text-gray-600",children:[" · ",o(t.unicos)," IPs (aprox.)"]}):null})]}),R.topo.length>0&&e.jsxs("div",{className:"mt-4 pt-3 border-t border-gray-700/50",children:[e.jsxs("p",{className:"text-xs text-gray-500 mb-2",children:["Chegaram por link (",(j==null?void 0:j.pctComReferer)??0,"% · ",o(j==null?void 0:j.comReferer)," acessos)"]}),e.jsx(F,{itens:R.topo,chave:"host",valor:"total",corBarra:O[5]}),R.resto>0&&e.jsxs("p",{className:"text-xs text-gray-600 mt-2",children:["+ ",o(R.resto)," de outras ",o(R.outros)," origens"]})]}),j&&e.jsxs("p",{className:"text-xs text-gray-500 mt-3 pt-3 border-t border-gray-700/50 leading-relaxed",children:[j.semPtr>0&&e.jsxs(e.Fragment,{children:[o(j.semPtr)," de ",o(j.total)," acessos vieram de IP ",e.jsx("strong",{className:"text-gray-400",children:"sem DNS reverso"})," — não dá pra saber a rede. "]}),j.naFila>0&&e.jsxs(e.Fragment,{children:[e.jsx("strong",{className:"text-gray-400",children:o(j.naFila)}
1)," ainda na fila de resolução. "]}),"Robô e acesso direto não mandam link de origem, por isso a rede diz mais aqui."]})]}),e.jsx($,{titulo:"Páginas que tentaram abrir",icone:e.jsx(Ye,{className:"text-indigo-400"}),temDado:((ue=s==null?void 0:s.uris)==null?void 0:ue.length)>0,children:e.jsx(F,{itens:(s==null?void 0:s.uris)||[],chave:"uri",valor:"total",corBarra:O[4],extra:t=>t.comParam>0?e.jsxs("span",{className:"text-gray-600",children:[" · ",o(t.comParam)," c/ parâmetro"]}):null})}),e.jsx($,{titulo:"Robôs",icone:e.jsx(be,{className:"text-indigo-400"}),temDado:((ge=s==null?void 0:s.bots)==null?void 0:ge.length)>0,vazio:"Nenhum robô identificado no período.",children:e.jsx(F,{itens:(s==null?void 0:s.bots)||[],chave:"bot_name",valor:"total",corBarra:O[2]})})]}),e.jsx($,{titulo:"Últimos acessos",icone:e.jsx(Qe,{className:"text-indigo-400"}),temDado:((pe=s==null?void 0:s.recentes)==null?void 0:pe.length)>0,direita:e.jsxs("span",{className:"text-xs text-gray-500",children:[o((he=s==null?void 0:s.recentes)==null?void 0:he.length)," mais recentes"]}),children:e.jsx("div",{className:"overflow-x-auto -mx-5 px-5",children:e.jsxs("table",{className:"w-full text-sm min-w-[900px]",children:[e.jsx("thead",{className:"sticky top-0 bg-dark-800",children:e.jsxs("tr",{className:"text-left text-xs text-gray-500 border-b border-gray-700/50",children:[e.jsx("th",{className:"py-2 pr-3 font-medium",children:"Quando"}),e.jsx("th",{className:"py-2 pr-3 font-medium",children:"Domínio"}),e.jsx("th",{className:"py-2 pr-3 font-medium",children:"O que recebeu"}),e.jsx("th",{className:"py-2 pr-3 font-medium",children:"Onde estava"}),e.jsx("th",{className:"py-2 pr-3 font-medium",children:"Pediu"}),e.jsx("th",{className:"py-2 pr-3 font-medium",children:"Veio de"}),e.jsx("th",{className:"py-2 pr-3 font-medium",children:"Quem"})]})}),e.jsx("tbody",{children:((s==null?void 0:s.recentes)||[]).map((t,c)=>{const l=Ae[t.decision]||Ae.sem_geo;return e.jsxs("tr",{className:"border-b border-gray-800/60 last:border-0 hover:bg-gray-800/20",children:[e.jsx("td",{className:"py-2 pr-3 text-gray-400 whitespace-nowrap",children:e.jsx(E,{content:z(t.created_at),position:"right",children:e.jsx("span",{children:Fe(t.created_at)})})}),e.jsx("td",{className:"py-2 pr-3 whitespace-nowrap",children:e.jsx("span",{className:`text-xs ${t.dominio==="whatsup.plus"?"text-violet-300":"text-cyan-300"}`,children:t.dominio||"—"})}),e.jsx("td",{className:"py-2 pr-3",children:e.jsx("span",{className:`inline-block text-xs px-2 py-0.5 rounded-full border ${l.cor}`,children:l.label})}),e.jsx("td",{className:"py-2 pr-3 text-gray-300 whitespace-nowrap",children:[t.city,t.region,t.country].filter(Boolean).join(" · ")||"—"}),e.jsx("td",{className:"py-2 pr-3 text-gray-400 font-mono text-xs",title:t.uri||"",children:W(t.uri,30)}),e.jsx("td",{className:"py-2 pr-3 text-xs",title:t.referer||t.rdns||"",children:T(t.referer)?e.jsxs("span",{className:"text-gray-300 inline-flex items-center gap-1",children:[e.jsx(fe,{className:"shrink-0 text-[10px]"}),T(t.referer)]}):t.rdns?e.jsxs("span",{className:"text-gray-400 inline-flex items-center gap-1",title:`rede do IP (DNS reverso): ${t.rdns}`,children:[e.jsx(Xe,{className:"shrink-0 text-[10px]"}),rs(t.rdns),e.jsx("span",{className:"text-gray-600",children:"rede"})]}):e.jsx("span",{className:"text-gray-600",children:t.rdns_em?"sem DNS reverso":"—"})}),e.jsx("td",{className:"py-2 pr-3 text-gray-500 text-xs",title:t.user_agent||"requisição sem header User-Agent",children:t.bot_name?e.jsx("span",{className:"text-cyan-400",children:t.bot_name}):t.user_agent?ns(t.user_agent):e.jsx("span",{className:"text-cyan-400/70 italic",children:"sem User-Agent"})})]},`${t.created_at}-${c}`)})})]})})}),(s==null?void 0:s.janela)&&e.jsxs("div",{className:"text-xs text-gray-600 flex flex-wrap items-center gap-x-4 gap-y-1 px-1",children:[e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx(Ve,{}),o(s.janela.totalTabela)," eventos guardados"]}),e.jsxs("span",{children:["mais antigo: ",z(s.janela.maisAntigo)]}),e.jsxs("span",{children:["mais recente: ",z(s.janela.maisRecente)]}),i?e.jsxs("span",{children:["fila: ",o(i.naFila)," · gravados neste processo: ",o(i.gravados),i.idadeSeg!=null?` (${Ce(i.idadeSeg)} no ar)`:""]}):null]})]})}export{xs 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.