1import{c as K,h as x,i as h,k as g,w as V,u as b,r as n,o as z,t as u,j as e,L as O,a as X,E as Q,D as w}from"./index-Dw04bfMU.js";import{u as I,I as Y,B as T}from"./input-CAvrjD2z.js";import{P as J}from"./portal-shell-De40gV7l.js";import{u as W}from"./use-auth-ready-7k9jzdM2.js";import{S as Z}from"./search-BHpCVSuv.js";import{L as ee}from"./lock-C69h_TIu.js";import{S as te}from"./shield-alert-DTMiXs7l.js";import"./utils-BApVXjh8.js";import"./index-jXOt-tf9.js";import"./use-idle-timeout-DmyRAEso.js";import"./key-round-DUfWcil5.js";import"./bot-BmxjwvwU.js";import"./trending-up-C3vQsirm.js";import"./activity-CbJ1y1-y.js";import"./file-text-DGbBydz5.js";const ae=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],q=K("eye-off",ae),se=x({method:"POST"}).middleware([h]).handler(g("8cb0901fabccbe780660a0631d72fd08e39253eba5b5cad0a93b18ac3302558d"));x({method:"POST"}).middleware([h]).handler(g("1801b5bd054be27e6103cc034fbcf6ec87620a58214c24e208ba5984aacc4cf3"));const re=x({method:"GET"}).middleware([h]).handler(g("cc6d796bf13cf941c810d619b97bb43f5a59c6a993c1ff795f70806f3ee2db9e")),ne=x({method:"POST"}).middleware([h]).handler(g("385dc5784ad4eaefb7575b609c6ea18f0d03df6920692a6d78c0f5ec6330e7e0")),de=x({method:"POST"}).middleware([h]).handler(g("1928655d851d7601cdfd9e57f053f9afd541b5925bd3e13ad4f8db9a87b912e4")),oe=x({method:"POST"}).middleware([h]).handler(g("df4c34f6cca3fed52e9709578e0087d55112578faf27cc1fb658afba14ce1fd7")),ce=x({method:"POST"}).middleware([h]).handler(g("f1f24a1f9fc660eae15aa6dbf138aa71cc9c5f7e4d2077da09fbbca0d4489e3e")),ie=[{id:"instagram",label:"Instagram"},{id:"facebook",label:"Facebook"},{id:"tiktok",label:"TikTok"},{id:"youtube",label:"YouTube"},{id:"twitter",label:"X / Twitter"}];function Pe(){const r=V(),E=W(),D=b(se),N=b(re),k=b(ne),[i,S]=n.useState("instagram"),[f,P]=n.useState(""),[d,v]=n.useState(!1),{data:F}=z({queryKey:["audit","scans",d],queryFn:()=>N({data:{includeArchived:d}}),enabled:E}),o=I({mutationFn:()=>D({data:{platform:i,username:f.trim().replace(/^@/,"")}}),onSuccess:()=>{u.success("Quick Scan complete"),P(""),r.invalidateQueries({queryKey:["audit","scans"]})},onError:t=>u.error(t.message)}),j=I({mutationFn:t=>k({data:t}),onSuccess:(t,c)=>{u.success(c.archived?"Scan hidden from history":"Scan restored"),r.invalidateQueries({queryKey:["audit","scans"]})},onError:t=>u.error(t.message)}),C=F?.scans??[];return e.jsxs(J,{title:"Audience Audit",children:[e.jsxs("p",{className:"mb-6 max-w-2xl text-sm text-muted-foreground",children:["Detect fake followers and bot inflation on any public social account. The free ",e.jsx("strong",{children:"Quick Scan"})," gives you a ~70% confidence estimate instantly. The ",e.jsx("strong",{children:"iMatter Bot Audit"})," ($199, single forensic run) and ",e.jsx("strong",{children:"Deep Audit"})," deliver 90%+ accuracy and court-grade PDF reports."]}),e.jsxs(O,{to:"/portal/growth-boost",className:"mb-8 flex items-start gap-3 rounded-xl border border-gold/40 p-4 transition-colors hover:border-gold",style:{background:"var(--card)"},children:[e.jsx(X,{className:"mt-0.5 h-5 w-5 flex-none text-gold"}),e.jsxs("div",{className:"text-sm",children:[e.jsx("div",{className:"font-black uppercase tracking-wider text-gold",children:"Got your report? Now replace the bots with real followers â"}),e.jsxs("div",{className:"mt-1 text-muted-foreground",children:["Our ",e.jsx("strong",{children:"Organic Growth"})," engine backfills your audience with real humans â niche-matched discovery and platform-safe manual engagement. No Meta Ads, no paid shoutouts, no bots, no follow/unfollow. For bot removal, we recommend reporting fake accounts directly to the platform â they have the only legitimate path to take them down at scale."]})]})]}),e.jsxs("section",{className:"mb-8 rounded-xl border border-gold/30 p-5",style:{background:"var(--card)"},children:[e.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[e.jsx(Z,{className:"h-4 w-4 text-gold"}),e.jsx("h2",{className:"text-xs font-black uppercase tracking-widest text-gold",children:"Qu
1ick Scan · Free · Instant"})]}),e.jsxs("div",{className:"grid gap-3 sm:grid-cols-[160px_1fr_auto]",children:[e.jsx("select",{value:i,onChange:t=>S(t.target.value),className:"rounded-md border border-input bg-background px-3 py-2 text-sm",children:ie.map(t=>e.jsx("option",{value:t.id,children:t.label},t.id))}),e.jsx(Y,{value:f,onChange:t=>P(t.target.value),placeholder:"@username",maxLength:60}),e.jsx(T,{onClick:()=>o.mutate(),disabled:!f.trim()||o.isPending,className:"bg-gold text-background hover:bg-gold-bright",children:o.isPending?"Scanningâ¦":"Scan now"})]}),e.jsx("p",{className:"mt-2 text-[11px] text-muted-foreground",children:"Estimates only â based on a 100-follower sample and public profile signals. Not legally admissible."}),e.jsx("p",{className:"mt-2 text-[11px] text-gold-bright",children:"â Instagram & Facebook share an audience graph on Meta â for a complete picture, run both handles. Any platform that can be infiltrated by bots is supported; request a new one via Support if you don't see it listed."})]}),e.jsxs(O,{to:"/portal/deep-audit",className:"mb-8 flex items-start gap-3 rounded-xl border border-gold/40 p-5 transition-colors hover:border-gold",style:{background:"var(--card)"},children:[e.jsx(ee,{className:"mt-0.5 h-5 w-5 flex-none text-gold"}),e.jsxs("div",{className:"text-sm",children:[e.jsx("div",{className:"font-black uppercase tracking-wider text-gold",children:"Need 90%+ confidence + court-grade PDF? Open the Deep Audit tab â"}),e.jsxs("div",{className:"mt-1 text-muted-foreground",children:["Contract signing, handle ownership verification, and the full Deep Audit workflow are managed on the dedicated ",e.jsx("strong",{children:"Deep Audit"})," tab."]})]})]}),e.jsxs("section",{children:[e.jsxs("div",{className:"mb-3 flex items-center justify-between gap-3",children:[e.jsxs("h2",{className:"text-xs font-black uppercase tracking-widest text-gold",children:["Scan history ",d?"(including hidden)":""]}),e.jsxs(T,{variant:"outline",size:"sm",onClick:()=>v(t=>!t),className:"h-7 gap-1 text-[11px]",children:[d?e.jsx(Q,{className:"h-3 w-3"}):e.jsx(q,{className:"h-3 w-3"}),d?"Hide archived":"Show archived"]})]}),e.jsxs("p",{className:"mb-3 text-[11px] text-muted-foreground",children:["Scan history is private to your account â viewers and clients never see it. Use ",e.jsx("strong",{children:"Hide"})," on any scan (e.g. an investor or test account) to tuck it away from your default view. Hidden scans stay in your records and can be restored anytime via ",e.jsx("strong",{children:"Show archived"}),"."]}),C.length===0?e.jsx("div",{className:"rounded-xl border border-gold/20 p-8 text-center text-sm text-muted-foreground",style:{background:"var(--card)"},children:d?"No scans yet.":"No visible scans. Run a Quick Scan above or show archived."}):e.jsx("div",{className:"grid gap-3",children:C.map(t=>e.jsx(le,{scan:t,onArchiveToggle:(c,A)=>j.mutate({id:c,archived:A}),busy:j.isPending},t.id))})]})]})}function le({scan:r,onArchiveToggle:E,busy:D}){const N=Number(r.fake_percent??0),k=N>
1=30,i=!!r.archived,S=String(r.tier??"")==="deep",f=b(de),P=b(oe),d=b(ce),[v,F]=n.useState(!1),[o,j]=n.useState(!1),[C,t]=n.useState(!1),[c,A]=n.useState(!1),[L,U]=n.useState(null),[p,$]=n.useState(0),[B,G]=n.useState(0),[y,R]=n.useState(0),l=30,H=async()=>{if(!v){F(!0);try{const a=await f({data:{scanId:String(r.id)}}),s=document.createElement("a");s.href=a.url,s.target="_blank",s.rel="noopener noreferrer",s.download=a.filename,document.body.appendChild(s),s.click(),s.remove()}catch(a){u.error(a.message)}finally{F(!1)}}},_=async a=>{if(!o){j(!0);try{const s=await P({data:{scanId:String(r.id),tier:a}}),m=document.createElement("a");m.href=s.url,m.target="_blank",m.rel="noopener noreferrer",m.download=s.filename,document.body.appendChild(m),m.click(),m.remove()}catch(s){u.error(s.message)}finally{j(!1)}}},M=async a=>{if(!c){A(!0);try{const s=await d({data:{scanId:String(r.id),tier:a}});U(s.parts),$(s.partsTotal),G(s.totalEvidence),t(!0)}catch(s){u.error(s.message)}finally{A(!1)}}};return e.jsxs("div",{className:`rounded-xl border p-4 ${i?"border-muted/40 opacity-60":"border-gold/20"}`,style:{background:"var(--card)"},children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"text-[10px] uppercase tracking-widest text-muted-foreground",children:[String(r.platform)," · ",String(r.tier).toUpperCase()," ·"," ",new Date(String(r.created_at)).toLocaleString(),i&&e.jsx("span",{className:"ml-2 text-gold",children:"· hidden"})]}),e.jsxs("div",{className:"text-lg font-bold",children:["@",String(r.username)]})]}),e.jsxs("div",{className:`text-right ${k?"text-destructive":"text-foreground"}`,children:[e.jsxs("div",{className:"flex items-center gap-1 text-2xl font-black",children:[k&&e.jsx(te,{className:"h-5 w-5"}),N,"%"]}),e.jsx("div",{className:"text-[10px] uppercase tracking-widest text-muted-foreground",children:"fake followers"})]})]}),e.jsxs("div",{className:"mt-3 grid grid-cols-2 gap-2 text-center text-xs",children:[e.jsxs("div",{className:"rounded border border-gold/15 p-2",children:[e.jsx("div",{className:"text-muted-foreground",children:"Real"}),e.jsx("div",{className:"font-semibold",children:Number(r.real_count??0).toLocaleString()})]}),e.jsxs("div",{className:"rounded border border-gold/15 p-2",children:[e.jsx("div",{className:"text-muted-foreground",children:"Fake"}),e.jsx("div",{className:"font-semibold",children:Number(r.fake_count??0).toLocaleString()})]})]}),e.jsx("div",{className:"mt-2 text-[11px] text-muted-foreground",children:String(r.confidence_label??"")}),e.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-3",children:[S?e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",onClick:H,disabled:v,className:"inline-flex items-center gap-1 text-xs font-semibold uppercase tracking-widest text-gold hover:underline disabled:opacity-60",children:[e.jsx(w,{className:"h-3 w-3"})," ",v?"Preparingâ¦":"Download PDF"]}),e.jsxs("button",{type:"button",onClick:()=>_(),disabled:o,className:"inline-flex items-center gap-1 text-xs font-semibold uppercase tracking-widest text-gold hover:underline disabled:opacity-60",children:[e.jsx(w,{className:"h-3 w-3"})," ",o?"Preparingâ¦":"Complete CSV"]}),e.jsxs("button",{type:"button",onClick:()=>M(),disabled:c,className:"inline-flex items-center gap-1 text-xs font-semibold uppercase tracking-widest text-gold hover:underline disabled:opacity-60",children:[e.jsx(w,{className:"h-3 w-3"})," ",c?"Loadingâ¦":"Evidence PDFs"]}),e.jsxs("button",{type:"button",onClick:()=>_("real"),disabled:o,className:"inline-flex items-center gap-1 text-xs font-semibold uppercase tracking-widest text-emerald-600 hover:underline disabled:opacity-60",children:[e.jsx(w,{className:"h-3 w-3"})," Real CSV"]}),e.jsxs("button",{type:"button",onClick:()=>M("real"),disabled:c,className:"inline-flex items-center gap-1 text-xs font-semibold uppercase tracking-widest text-emerald-600 hover:underline disabled:opacity-60",children:[e.jsx(w,{className:"h-3 w-3"})," Real PDFs"]})]}):null,e.jsx(T,{variant:"outline",size:"sm",disabled:D,onClick:()=>E(String(r.id),!i),className:"ml-auto h-7 gap-1 text-[11px]",children:i?e.jsxs(e.Fragment,{children:[e.jsx(Q,{className:"h-3 w-3"})," Restore"]}):e.jsxs(e.Fragment,{children:[e.jsx(q,{className:"h-3 w-3"})," Hide from history"]})})]}),S&&C&&L?e.jsxs("div",{className:"mt-4 rounded-lg border border-gold/20 bg-background/50 p-3",children:[e.jsxs("div",{className:"mb-2 flex flex-wrap items-center justify-between gap-2",children:[e.jsxs("div",{className:"text-[11px] font-semibold uppercase tracking-widest text-gold",children:["Evidence ledger · ",p.toLocaleStr
1ing()," PDF",p===1?"":"s"," · ",B.toLocaleString()," bots"]}),e.jsx("button",{type:"button",onClick:()=>t(!1),className:"text-[10px] uppercase tracking-widest text-muted-foreground hover:text-foreground",children:"Close"})]}),e.jsx("p",{className:"mb-3 text-[11px] text-muted-foreground",children:"Each PDF holds up to 25,000 flagged accounts. Download all parts to forward the full ledger to the platform â or grab the Complete CSV for one-file delivery."}),e.jsx("div",{className:"grid grid-cols-2 gap-1.5 sm:grid-cols-3 md:grid-cols-5",children:L.slice(y*l,y*l+l).map(a=>e.jsxs("a",{href:a.url,download:a.filename,className:"rounded border border-gold/20 px-2 py-1.5 text-center text-[11px] hover:border-gold hover:bg-gold/5",title:`Rows ${a.start.toLocaleString()}-${a.end.toLocaleString()}`,children:[e.jsxs("div",{className:"font-semibold",children:["Part ",a.part]}),e.jsxs("div",{className:"text-[9px] text-muted-foreground",children:[a.start.toLocaleString(),"â",a.end.toLocaleString()]})]},a.part))}),p>l?e.jsxs("div",{className:"mt-3 flex items-center justify-between gap-2 text-[11px]",children:[e.jsx("button",{type:"button",onClick:()=>R(a=>Math.max(0,a-1)),disabled:y===0,className:"rounded border border-gold/20 px-2 py-1 disabled:opacity-40",children:"â Prev"}),e.jsxs("span",{className:"text-muted-foreground",children:["Page ",y+1," of ",Math.
1ceil(p/l)]}),e.jsx("button",{type:"button",onClick:()=>R(a=>Math.min(Math.ceil(p/l)-1,a+1)),disabled:y>=Math.ceil(p/l)-1,className:"rounded border border-gold/20 px-2 py-1 disabled:opacity-40",children:"Next â"})]}):null]}):null]})}export{Pe as component};
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.