PageSourceSearch

https://aiidentifiers.com/assets/quarantine-audit-Dp4UD1pq.js

js aiidentifiers.com collected 2026-10-03 00:46:33 UTC 7,810 bytes, 1 lines download raw bytes

1import{a as n,j as e}from"./react-core-B_NPnx9L.js";import{b as Q,a as U,c as V}from"./react-query-DhhpI0VK.js";import{u as H,S as M,H as z,B as t,C as K,e as G,h as y,i as C,j as S,k as N,l,f as J,F as X,D as k,t as T,v as q,w as D,x as A,y as P}from"./index-DaGE8UZR.js";import{I as R}from"./input-ot47S0Fe.js";import{g as Z,c as E,bN as W,aP as Y,b0 as ee}from"./ui-lib-d6ZI__ZU.js";import"./vendor-DZoFMmQa.js";import"./sentry-CQCgREoE.js";import"./i18n-Z_19K4At.js";const F=25;function de(){const I=Q(),{toast:g}=H(),[j,$]=n.useState("active"),[x,_]=n.useState("all"),[m,B]=n.useState(""),[u,L]=n.useState(""),[h,o]=n.useState(1),[s,p]=n.useState(null),[d,c]=n.useState(null),v=n.useMemo(()=>{const a=new URLSearchParams({state:j,page:String(h),pageSize:String(F)});return x!=="all"&&a.set("fileType",x),m&&a.set("from",m),u&&a.set("to",u),a},[x,m,h,j,u]),r=U({queryKey:["/api/quarantine-audit",v.toString()],queryFn:async()=>{const a=await fetch(`/api/quarantine-audit?${v}`,{credentials:"include"});if(a.status===401)throw new Error("Sign in to review your quarantine records.");if(!a.ok)throw new Error("The quarantine review could not be loaded.");return a.json()}}),f=V({mutationFn:async({id:a,kind:i})=>{const w=await fetch(`/api/quarantine-audit/${a}/${i}`,{method:"POST",credentials:"include"});if(!w.ok)throw new Error("The review state could not be updated.");return w.json()},onSuccess:(a,i)=>{g({title:i.kind==="dismiss"?"Dismissed from active review":"Restored to active review",description:"The action was added to the immutable audit trail."}),p(null),c(null),I.invalidateQueries({queryKey:["/api/quarantine-audit"]})},onError:a=>g({title:"Action failed",description:a.message,variant:"destructive"})}),b=a=>{const i=new URLSearchParams(v);i.delete("page"),i.delete("pageSize"),i.set("format",a),window.location.assign(`/api/quarantine-audit/export?${i}`)},O=Math.max(1,Math.ceil((r.data?.total??0)/F));return e.jsxs("div",{className:"min-h-screen bg-slate-50 dark:bg-slate-950",children:[e.jsx(M,{title:"Deepfake Quarantine Review | AI Identifiers",description:"Filter, inspect, and export owner-scoped synthetic-media review records with an immutable action trail."}),e.jsx(z,{}),e.jsxs("main",{className:"mx-auto max-w-7xl px-4 py-12 sm:px-6",children:[e.jsxs("div",{className:"mb-8 flex flex-col gap-5 lg:flex-row lg:items-end lg:justify-between",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"mb-3 inline-flex items-center gap-2 rounded-full border border-amber-300/70 bg-amber-50 px-3 py-1 text-xs font-semibold uppercase tracking-[0.16em] text-amber-800 dark:border-amber-800 dark:bg-amber-950/40 dark:text-amber-300",children:[e.jsx(Z,{className:"h-4 w-4"})," Compliance review"]}),e.jsx("h1",{className:"text-3xl font-bold text-slate-950 dark:text-white sm:text-4xl",children:"Deepfake quarantine audit"}),e.jsx("p",{className:"mt-3 max-w-3xl text-slate-600 dark:text-slate-400",children:"Review probabilistic image, audio, and video flags. Dismiss and restore actions change review state only; they do not declare authorship or certainty."})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsxs(t,{variant:"outline",onClick:()=>b("csv"),children:[e.jsx(E,{className:"mr-2 h-4 w-4"}),"CSV"]}),e.jsxs(t,{variant:"outline",onClick:()=>b("json"),children:[e.jsx(E,{className:"mr-2 h-4 w-4"}),"JSON"]})]})]}),e.jsx(K,{className:"border-slate-200 dark:border-slate-800",children:e.jsx(G,{className:"p-5",children:e.jsxs("div",{className:"grid gap-3 md:grid-cols-4",children:[e.jsxs(y,{value:j,onValueChange:a=>{$(a),o(1)},children:[e.jsx(C,{"aria-label":"Review state",children:e.jsx(S,{})}),e.jsxs(N,{children:[e.jsx(l,{value:"active",children:"Active review"}),e.jsx(l,{value:"dismissed",children:"Dismissed"}),e.jsx(l,{value:"all",children:"All states"})]})]}),e.jsxs(y,{value:x,onValueChange:a=>{_(a),o(1)},children:[e.jsx(C,{"aria-label":"File type",children:e.jsx(S,{})}),e.jsxs(N,{children:[e.jsx(l,{value:"all",children:"All media"}),e.jsx(l,{value:"image",children:"Images"}),e.jsx(l,{value:"audio",children:"Audio"}),e.jsx(l,{value:"video",children:"Video"})]})]}),e.jsx(R,{type:"date",value:m,onChange:a=>{B(a.target.value),o(1)},"aria-label":"From date"}),e.jsx(R,{type:"date",value:u,onChange:a=>{L(a.target.value),o(1)},"aria-label":"To date"})]})})}),e.jsx("div",{className:"mt-5 overflow-hidden rounded-xl border border-slate-200 bg-white dark:border-slate-800 dark:bg-slate-900",children:r.isLoading?e.jsx("p",{className:"p-10 text-center text-slate-500",children:"Loading review records…"}):r.isError?e.jsx("p",{className:"p-10 text-center text-red-600",children:r.error.message}):r.data?.records.length===0?e.jsx("p",{className:"p-10 text-center text-slate-500",children:"No records match these filters."}):e.jsx("div",{className:"divide-y divide-slate-200 dark:divide-slate-800",children:r.data?.records.map(a=>e.jsxs("button",{type:"button",onClick:()=>p(a),className:"grid w-full gap-3 p-5 text-left transition hover:bg-teal-50/60 dark:hover:bg-teal-950/20 md:grid-cols-[minmax(0,2fr)_0.7fr_0.7fr_1fr_auto] md:items-center",children:[e.jsx("span",{className:"truncate font-semibold text-slate-900 dark:text-white",children:a.filename}
1),e.jsx("span",{className:"capitalize text-slate-600 dark:text-slate-400",children:a.fileType}),e.jsx("span",{className:"font-mono text-slate-800 dark:text-slate-200",children:a.aiConfidence==null?"—":`${a.aiConfidence}%`}),e.jsx("span",{className:"text-sm text-slate-500",children:a.createdAt?new Date(a.createdAt).toLocaleString():"Unknown"}),e.jsx(J,{variant:"outline",className:a.quarantineState==="active"?"border-amber-300 text-amber-700":"border-slate-300 text-slate-600",children:a.quarantineState})]},a.id))})}),e.jsxs("div",{className:"mt-5 flex items-center justify-between",children:[e.jsxs("span",{className:"text-sm text-slate-500",children:[r.data?.total??0," records"]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(t,{variant:"outline",disabled:h<=1,onClick:()=>o(a=>a-1),children:"Previous"}),e.jsx(t,{variant:"outline",disabled:h>=O,onClick:()=>o(a=>a+1),children:"Next"})]})]})]}),e.jsx(X,{}),e.jsx(k,{open:!!s,onOpenChange:a=>!a&&p(null),children:e.jsxs(T,{children:[e.jsxs(q,{children:[e.jsx(D,{children:"Review record"}),e.jsx(A,{children:"Safe metadata only; uploaded content and storage locations are excluded."})]}),s&&e.jsxs("div",{className:"space-y-3 text-sm",children:[e.jsxs("p",{children:[e.jsx("strong",{children:"File:"})," ",s.filename]}),e.jsxs("p",{children:[e.jsx("strong",{children:"Type:"})," ",s.fileType," · ",s.mimeType]}),e.jsxs("p",{children:[e.jsx("strong",{children:"Confidence:"})," ",s.aiConfidence==null?"Unavailable":`${s.aiConfidence}%`]}),e.jsxs("p",{children:[e.jsx("strong",{children:"State:"})," ",s.quarantineState]}),e.jsxs("p",{children:[e.jsx("strong",{children:"Processing time:"})," ",s.processingTime==null?"Unavailable":`${s.processingTime} ms`]})]}),e.jsxs(P,{children:[s?.quarantineState==="active"?e.jsxs(t,{variant:"outline",onClick:()=>c("dismiss"),children:[e.jsx(W,{className:"mr-2 h-4 w-4"}),"Dismiss"]}):e.jsxs(t,{onClick:()=>c("restore"),children:[e.jsx(Y,{className:"mr-2 h-4 w-4"}),"Restore"]}),e.jsxs(t,{variant:"secondary",onClick:()=>p(null),children:[e.jsx(ee,{className:"mr-2 h-4 w-4"}),"Close"]})]})]})}),e.jsx(k,{open:!!d,onOpenChange:a=>!a&&c(null),children:e.jsxs(T,{children:[e.jsxs(q,{children:[e.jsx(D,{children:d==="dismiss"?"Dismiss from active review?":"Restore to active review?"}),e.jsx(A,{children:"This review-state change is recorded in the immutable audit trail."})]}),e.jsxs(P,{children:[e.jsx(t,{variant:"outline",onClick:()=>c(null),children:"Cancel"}),e.jsx(t,{disabled:f.isPending||!s||!d,onClick:()=>s&&d&&f.mutate({id:s.id,kind:d}),children:"Confirm"})]})]})})]})}export{de 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.