diff --git a/.gitattributes b/.gitattributes index 3744127c088ee680589b24c67aa5b8040b78365f..e87bf8e396106e775d792f8e4aafc8f90772a98b 100644 --- a/.gitattributes +++ b/.gitattributes @@ -84,3 +84,14 @@ samples/pcb2_good.jpg filter=lfs diff=lfs merge=lfs -text frontend/dist/assets/candle-heatmap-VjHcBjw5.jpg filter=lfs diff=lfs merge=lfs -text frontend/dist/assets/candle-normal-Cqb2kkRH.jpg filter=lfs diff=lfs merge=lfs -text frontend/dist/assets/candle-original-Dqn_yXKt.jpg filter=lfs diff=lfs merge=lfs -text +frontend/dist/showcase/images/1c68ef87cd4b4e10a7efab1b5107d59b.jpg filter=lfs diff=lfs merge=lfs -text +frontend/dist/showcase/images/1c68ef87cd4b4e10a7efab1b5107d59b_heatmap.jpg filter=lfs diff=lfs merge=lfs -text +frontend/dist/showcase/images/24610e481ba14990be2b059b435ec8d1.jpg filter=lfs diff=lfs merge=lfs -text +frontend/dist/showcase/images/6f8af69aa59d40b488d5d864f502224d.jpg filter=lfs diff=lfs merge=lfs -text +frontend/dist/showcase/images/6f8af69aa59d40b488d5d864f502224d_heatmap.jpg filter=lfs diff=lfs merge=lfs -text +frontend/dist/showcase/images/861bd29ac3e34efc89c18aad4befcb0a.jpg filter=lfs diff=lfs merge=lfs -text +frontend/dist/showcase/images/861bd29ac3e34efc89c18aad4befcb0a_heatmap.jpg filter=lfs diff=lfs merge=lfs -text +frontend/dist/showcase/images/ccaaa807f4834da8b402ca8b46073342.jpg filter=lfs diff=lfs merge=lfs -text +frontend/dist/showcase/images/ccaaa807f4834da8b402ca8b46073342_heatmap.jpg filter=lfs diff=lfs merge=lfs -text +frontend/dist/showcase/images/def5b9b862a447ac8c61e168af28c263.jpg filter=lfs diff=lfs merge=lfs -text +frontend/dist/showcase/images/def5b9b862a447ac8c61e168af28c263_heatmap.jpg filter=lfs diff=lfs merge=lfs -text diff --git a/frontend/dist/assets/TeamWorkspace-X22D4OgN.js b/frontend/dist/assets/TeamWorkspace-X22D4OgN.js new file mode 100644 index 0000000000000000000000000000000000000000..11635a7fb5ffe65b03ba336691ae71b580b42982 --- /dev/null +++ b/frontend/dist/assets/TeamWorkspace-X22D4OgN.js @@ -0,0 +1,41 @@ +import{c as he,r as a,l as ct,a as it,b as ot,d as dt,e as mt,s as tt,f as O,R as ut,g as Be,h as e,i as Ue,p as at,n as Oe,j as rt,k as st,m as pt,w as Re,o as Qe,q as ht,t as ft,u as Et,v as yt,x as vt,y as gt,z as bt,A as wt,B as Nt,C as St,L as kt,S as _t,D as Ct,E as Xe,F as Dt,G as Rt,H as Ze,I as xt}from"./index-CjyYKbWk.js";/** + * @license lucide-react v0.577.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Tt=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h2",key:"tvwodi"}],["path",{d:"M20 8v11a2 2 0 0 1-2 2h-2",key:"1gkqxj"}],["path",{d:"m9 15 3-3 3 3",key:"1pd0qc"}],["path",{d:"M12 12v9",key:"192myk"}]],qt=he("archive-restore",Tt);/** + * @license lucide-react v0.577.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const At=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],$e=he("cloud",At);/** + * @license lucide-react v0.577.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Lt=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],Pt=he("external-link",Lt);/** + * @license lucide-react v0.577.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ft=[["path",{d:"m10 17 5-5-5-5",key:"1bsop3"}],["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}]],It=he("log-in",Ft);/** + * @license lucide-react v0.577.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Mt=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],Ot=he("log-out",Mt);/** + * @license lucide-react v0.577.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const zt=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],Ut=he("refresh-cw",zt);/** + * @license lucide-react v0.577.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const jt=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],Ht=he("send",jt);/** + * @license lucide-react v0.577.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Wt=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],$t=he("users",Wt),Ge="17:00",Bt=[{label:"Tomorrow",days:1},{label:"In 3 days",days:3},{label:"In 1 week",days:7},{label:"In 2 weeks",days:14}],Pe=n=>String(n).padStart(2,"0"),je=n=>n.getFullYear()+"-"+Pe(n.getMonth()+1)+"-"+Pe(n.getDate());function Je(n,s=new Date){const m=new Date(s);return m.setDate(m.getDate()+n),je(m)}const Ve=(n,s)=>n?n+"T"+(s||Ge):"",Gt=n=>({date:n?n.slice(0,10):"",time:n?n.slice(11,16):""}),nt=n=>{const[s,m]=n.split(":").map(Number);return(s%12||12)+":"+Pe(m)+" "+(s<12?"AM":"PM")};function Yt(n){const s=[];for(let m=420;m<=1200;m+=30)s.push(Pe(Math.floor(m/60))+":"+Pe(m%60));return n&&/^\d\d:\d\d$/.test(n)&&!s.includes(n)&&s.push(n),s.sort()}function Kt(n,s=new Date){const m=Math.round((new Date(n.slice(0,10)+"T00:00")-new Date(je(s)+"T00:00"))/864e5);return m===0?"today":m===1?"tomorrow":m>1?"in "+m+" days":m===-1?"yesterday":Math.abs(m)+" days ago"}function lt(n,s=new Date){if(!n||!Number.isFinite(Date.parse(n)))return"";const m=new Date(n.slice(0,10)+"T00:00"),i=D=>m.toLocaleDateString("en-GB",D);return i({weekday:"long"})+", "+m.getDate()+" "+i({month:"short"})+" "+m.getFullYear()+" at "+nt(n.slice(11,16))+" · "+Kt(n,s)}const ze=n=>new Date(n).toLocaleString([],{dateStyle:"medium",timeStyle:"short"}),Qt=n=>{const s=new Date(n);return je(s)+"T"+String(s.getHours()).padStart(2,"0")+":"+String(s.getMinutes()).padStart(2,"0")};function et({legend:n,prefix:s,value:m,time:i,setValue:D,setTime:v,disabled:z,required:_,keep:I}){const g=Gt(m),U=g.time||i,G=f=>D(Ve(f,U)),Y=f=>{v(f),g.date&&D(Ve(g.date,f))};return e.createElement("fieldset",{className:"due-field"},e.createElement("legend",null,n),e.createElement("div",{className:"due-shortcuts",role:"group","aria-label":n+" shortcuts"},I&&e.createElement("button",{type:"button",className:"chip"+(m?"":" selected"),"aria-pressed":!m,disabled:z,onClick:()=>D("")},"Keep current"),Bt.map(f=>{const M=Je(f.days);return e.createElement("button",{type:"button",key:f.days,className:"chip"+(g.date===M?" selected":""),"aria-pressed":g.date===M,disabled:z,onClick:()=>G(M)},f.label)})),e.createElement("div",{className:"due-inputs"},e.createElement("label",{className:"field"},s,"date",e.createElement("input",{type:"date",disabled:z,required:_,min:je(new Date),max:Je(365),value:g.date,onInput:f=>G(f.target.value),onChange:f=>G(f.target.value)})),e.createElement("label",{className:"field"},s,"time",e.createElement("select",{disabled:z,value:U,onChange:f=>Y(f.target.value)},Yt(U).map(f=>e.createElement("option",{key:f,value:f},nt(f)))))),e.createElement("p",{className:"caption due-summary","aria-live":"polite"},m?e.createElement(e.Fragment,null,"Due ",e.createElement("strong",null,lt(m))):I||"Pick a day within the next year. Time starts at 5:00 PM."))}function Xt({user:n,inspection:s,notes:m=[],inspections:i=[],inspectionLoading:D=!1,onSelectInspection:v,onEvidence:z}){var Ke;const _=a.useRef(0),I=a.useRef(!1),g=a.useRef(s==null?void 0:s.id),U=a.useRef(null),G=a.useRef(null),Y=a.useRef(null),[f,M]=a.useState("checking"),[T,j]=a.useState([]),[H,E]=a.useState([]),[de,h]=a.useState(""),[se,N]=a.useState([]),[q,L]=a.useState([]),[fe,A]=a.useState(""),[S,J]=a.useState(!1),[me,w]=a.useState(""),[P,Ee]=a.useState(""),[K,l]=a.useState(""),[b,W]=a.useState("Normal"),[ne,u]=a.useState(""),[R,ye]=a.useState(Ge),[V,le]=a.useState(!1),[ee,Se]=a.useState(""),[xe,ke]=a.useState(""),[_e,Te]=a.useState(null),[qe,He]=a.useState(0),[Ce,Ae]=a.useState(""),[Fe,ce]=a.useState(""),[ue,ve]=a.useState(""),[De,Q]=a.useState(Ge),c=T.find(t=>t.id===de),$=ct(m),ie=it(T),C=ot(s,m,T,D),Ie=dt({description:me,owner:P,supervisor:K,priority:b,due:ne},H),r=C.ready?Ie||(V?"":"Tick the box to confirm the defect."):C.reason,[d,o]=a.useState([]),[x,ge]=a.useState("all"),k=t=>["Resolved","Closed","Cancelled"].includes(t.state),X=t=>!k(t)&&Date.parse(t.due_at)!0],["open","Open",t=>!k(t)],["overdue","Overdue",X],["done","Done",k]],be=T.filter(((Ke=te.find(t=>t[0]===x))==null?void 0:Ke[2])||(()=>!0)),B=i.filter(t=>!t.archived_at),ae=B.map(t=>t.id).join(","),F=t=>pt(t.id===(s==null?void 0:s.id)?m:d.filter(p=>p.inspection_id===t.id),T),re=B.map(t=>({row:t,status:F(t)})).sort((t,p)=>(p.status.key==="ready")-(t.status.key==="ready")),pe=re.filter(t=>t.status.key==="ready").length,oe=mt(c,n.id,H.some(t=>t.user_id===n.id&&t.role==="developer")),we=!!c&&_e!==null&&_e!==c.version;async function Me(){const t=++_.current,p=await O(),y=await p.rpc("defectrag_ca_staff");if(t!==_.current)return;if(y.error||y.data!==!0)throw M("denied"),j([]),E([]),h(""),N([]),L([]),new Error("Sign in with an approved Staff account and verify the security code before opening corrective actions.");const Z=await Promise.all([p.from("corrective_actions").select("*").order("created_at",{ascending:!1}).limit(500),p.from("staff_members").select("user_id,display_name,role,revoked_at").is("revoked_at",null)]);if(t===_.current){if(Z.some(Le=>Le.error))throw M("unavailable"),j([]),E([]),h(""),N([]),L([]),Z.find(Le=>Le.error).error;M("authorized"),j(Z[0].data||[]),E(Z[1].data||[]),A(""),He(Le=>Le+1)}}a.useEffect(()=>{const t=tt(Me,{onState:p=>{p.error&&(M("unavailable"),A(p.error),j([]),E([]),h(""),N([]),L([]))}});return()=>{t.stop(),_.current++}},[n.id]),a.useEffect(()=>{const t=()=>{_.current++,M("checking"),j([]),E([]),h(""),N([]),L([]),Me().catch(p=>A(p.message))};return window.addEventListener("defectrag-auth-change",t),()=>window.removeEventListener("defectrag-auth-change",t)},[n.id]),a.useEffect(()=>{g.current&&g.current!==(s==null?void 0:s.id)&&(w(""),Ee(""),l(""),u(""),W("Normal")),g.current=s==null?void 0:s.id,le(!1)},[s==null?void 0:s.id]),a.useEffect(()=>{le(!1)},[$==null?void 0:$.id]),a.useEffect(()=>{let t=!0;const p=ae?ae.split(","):[];if(f!=="authorized"||!p.length){o([]);return}return O().then(y=>y.from("staff_notes").select("id,inspection_id,author_id,body,created_at").in("inspection_id",p).like("body",ut+"%").order("created_at").limit(2e3)).then(({data:y,error:Z})=>{if(t){if(Z)throw Z;o(y||[])}}).catch(()=>{t&&o([])}),()=>{t=!1}},[f,ae,qe]),a.useEffect(()=>{f==="authorized"&&Be(G.current)},[f,s==null?void 0:s.id,$==null?void 0:$.id]);function Ye(){ke(""),Se((c==null?void 0:c.state)||""),Ae((c==null?void 0:c.owner_id)||""),ce((c==null?void 0:c.supervisor_id)||""),ve(""),Te((c==null?void 0:c.version)??null)}a.useEffect(Ye,[c==null?void 0:c.id]),a.useEffect(()=>{c&&Be(U.current)},[c==null?void 0:c.id]),a.useEffect(()=>{let t=!0;const p=_.current;if(!c||f!=="authorized"){Y.current=null,N([]),L([]);return}return Y.current!==c.id&&(Y.current=c.id,N([]),L([])),O().then(y=>Promise.all([y.from("corrective_action_history").select("*").eq("case_id",c.id).order("version"),y.from("corrective_action_events").select("id,case_id,version,kind,status,attempts,last_error,created_at").eq("case_id",c.id).order("created_at",{ascending:!1})])).then(y=>{if(!(!t||p!==_.current)){if(y.some(Z=>Z.error))throw y.find(Z=>Z.error).error;N(y[0].data||[]),L(y[1].data||[])}}).catch(y=>{t&&p===_.current&&A(y.message)}),()=>{t=!1}},[c==null?void 0:c.id,c==null?void 0:c.version,qe,n.id,f]);async function We(t){if(!I.current){I.current=!0,J(!0),A("");try{await t(),await Me(),Re()}catch(p){A(p.message||"Corrective action request failed.")}finally{I.current=!1,J(!1)}}}const Ne=t=>{var p;return((p=H.find(y=>y.user_id===t))==null?void 0:p.display_name)||"Former / unavailable staff"};return e.createElement("section",{className:"card case-workspace",ref:G,tabIndex:-1,"aria-label":"Corrective Actions workspace"},e.createElement("div",{className:"section-title"},e.createElement("div",null,e.createElement("h2",null,"Corrective Actions"),e.createElement("p",null,"Fix confirmed defects. Say who fixes each one, and by when.")),e.createElement("button",{className:"secondary",disabled:S,onClick:()=>We(Me)},"Refresh cases")),fe&&e.createElement("div",{className:"error",role:"alert"},Ue(fe)),f==="checking"&&e.createElement("p",{role:"status"},"Checking your access…"),f!=="checking"&&f!=="authorized"&&e.createElement("p",{className:"note"},"Sign in on the Staff workspace page and enter your security code. Then come back here."),f==="authorized"&&e.createElement(e.Fragment,null,e.createElement("div",{className:"case-stats",role:"group","aria-label":"Case summary"},e.createElement("div",null,e.createElement("b",null,ie.open),e.createElement("span",null,"Open")),e.createElement("div",{className:ie.overdue?"late":""},e.createElement("b",null,ie.overdue),e.createElement("span",null,"Overdue")),e.createElement("div",null,e.createElement("b",null,ie.resolved),e.createElement("span",null,"Done")),e.createElement("div",null,e.createElement("b",null,ie.averageResolutionHours===null?"–":ie.averageResolutionHours.toFixed(1)+" h"),e.createElement("span",null,"Average time to fix"))),e.createElement("h3",null,"Create a new case"),e.createElement("ol",{className:"stepper","aria-label":"Steps to create a case"},["Pick an inspection","Save a defect review","Assign the fix"].map((t,p)=>{const y=s?C.ready||C.existingCaseId?3:2:1;return e.createElement("li",{key:t,className:p+1v(t.target.value)},e.createElement("option",{value:""},"Pick an inspection"),re.map(({row:t,status:p})=>{var y;return e.createElement("option",{key:t.id,value:t.id},at((y=t.payload)==null?void 0:y.category)," · ",new Date(t.created_at).toLocaleString()," · ",t.id.slice(0,8)," — ",p.label)}))),v&&B.length>0&&e.createElement("p",{className:"caption"},pe?`${pe} inspection${pe>1?"s are":" is"} ready, listed first.`:"None are ready yet. A case needs a saved defect review."),v&&!B.length&&e.createElement("p",{className:"note"},"No Team inspections yet. Open a personal inspection and choose “Share with team”."),e.createElement("div",{className:"case-step "+(C.ready?"ready":"blocked")},e.createElement("strong",null,C.ready?"Ready to assign":s?C.existingCaseId?"This inspection already has a case":C.needsReview?"Step 2: save a defect review":"Not available yet":"Step 1: pick an inspection"),e.createElement("p",{id:"case-creation-guidance",role:"status"},C.reason),s&&!s.archived_at&&!D&&e.createElement("button",{type:"button",className:C.needsReview?"primary":"secondary",disabled:S,onClick:()=>z==null?void 0:z(s.id)},C.needsReview?"Open the review":"Open photo and review"),C.existingCaseId&&e.createElement("button",{type:"button",className:"secondary",onClick:()=>h(C.existingCaseId)},"Open existing case")),e.createElement("p",{className:"caption"},"You can fill this in now. Nothing is saved until you press “Create corrective action”."),!H.length&&e.createElement("p",{className:"note"},"No active Staff to assign. Press Refresh cases, or ask the administrator."),e.createElement("form",{className:"login-form","data-tour":"case","aria-label":"Assign corrective action","aria-describedby":"case-creation-guidance case-submit-guidance",onSubmit:t=>{if(t.preventDefault(),!(r||S||I.current))return We(async()=>{const p=await O(),y=await Qe(p,"defectrag_create_corrective_action",{p_inspection:s.id,p_review:C.review.id,p_confirmed:V,p_owner:P,p_supervisor:K,p_priority:b,p_description:me,p_due:new Date(ne).toISOString()});h(y),w(""),le(!1)})}},e.createElement("label",{className:"field"},"What needs fixing?",e.createElement("textarea",{disabled:S,required:!0,minLength:10,maxLength:2e3,value:me,onInput:t=>w(t.target.value),onChange:t=>w(t.target.value)})),e.createElement("label",{className:"field"},"Person responsible",e.createElement("select",{disabled:S,required:!0,value:P,onChange:t=>Ee(t.target.value)},e.createElement("option",{value:""},"Choose a person"),H.map(t=>e.createElement("option",{key:t.user_id,value:t.user_id},t.display_name)))),e.createElement("label",{className:"field"},"Supervisor",e.createElement("select",{disabled:S,required:!0,value:K,onChange:t=>l(t.target.value)},e.createElement("option",{value:""},"Choose a person"),H.map(t=>e.createElement("option",{key:t.user_id,value:t.user_id},t.display_name)))),e.createElement("label",{className:"field"},"Priority",e.createElement("select",{disabled:S,value:b,onChange:t=>W(t.target.value)},["Low","Normal","High","Critical"].map(t=>e.createElement("option",{key:t},t)))),et({legend:"Due date and time",prefix:"Due ",value:ne,time:R,setValue:u,setTime:ye,disabled:S,required:!0}),e.createElement("p",{className:"note"},"When email is switched on, saving a case emails the supervisor and copies the person responsible. See “Email delivery” in the case details."),e.createElement("label",{className:"consent-check"+(C.ready?"":" locked")},e.createElement("input",{type:"checkbox",disabled:S||!C.ready,checked:V,onChange:t=>le(t.target.checked)}),e.createElement("span",null,"I confirm Staff found a real defect that needs fixing.",!C.ready&&e.createElement("small",null,"Finish steps 1 and 2 first."))),e.createElement("p",{className:"note",id:"case-submit-guidance",role:"status"},r?"Not ready: "+r:"All set. Press the button to save."),e.createElement("button",{className:"primary",disabled:S||!!r},"Create corrective action")),e.createElement("div",{className:"section-title section-gap"},e.createElement("h3",null,"Saved cases"),T.length>0&&e.createElement("div",{className:"segmented case-filter",role:"group","aria-label":"Show cases"},te.map(([t,p,y])=>e.createElement("button",{type:"button",key:t,className:x===t?"on":"","aria-pressed":x===t,onClick:()=>ge(t)},p," ",e.createElement("span",{className:"count"},T.filter(y).length))))),e.createElement("div",{className:"table-wrap","data-tour":c?void 0:"case-update"},e.createElement("table",{className:"stackable"},e.createElement("thead",null,e.createElement("tr",null,e.createElement("th",null,"Case"),e.createElement("th",null,"Status"),e.createElement("th",null,"Owner"),e.createElement("th",null,"Priority"),e.createElement("th",null,"Due"),e.createElement("th",null))),e.createElement("tbody",null,be.map(t=>e.createElement("tr",{key:t.id,className:t.id===de?"selected-row":void 0},e.createElement("td",{"data-label":"Case"},t.id.slice(0,8)),e.createElement("td",{"data-label":"Status"},e.createElement("span",{className:"case-state "+t.state.toLowerCase().replace(/\s+/g,"-")},t.state),X(t)&&e.createElement("span",{className:"case-state overdue"},"Overdue")),e.createElement("td",{"data-label":"Owner"},Ne(t.owner_id)),e.createElement("td",{"data-label":"Priority"},e.createElement("span",{className:"priority "+String(t.priority||"").toLowerCase()},t.priority||"Normal")),e.createElement("td",{"data-label":"Due"},ze(t.due_at)),e.createElement("td",{className:"row-action"},e.createElement("button",{className:"text-button","aria-label":"Details for case "+t.id.slice(0,8),onClick:()=>h(t.id)},"Details")))))),T.length?!be.length&&e.createElement("p",{className:"caption"},"No cases in this group. Choose All to see every case."):e.createElement("p",{className:"caption"},"No cases yet.")),c&&e.createElement("div",{className:"cloud-message","data-tour":"case-update",ref:U,tabIndex:-1,"aria-label":"Corrective action case details"},e.createElement("div",{className:"section-title"},e.createElement("h3",null,"Case ",c.id.slice(0,8)," · ",c.state),e.createElement("button",{className:"text-button",onClick:()=>h("")},"Close details")),e.createElement("p",null,c.description),e.createElement("p",null,"Person responsible: ",Ne(c.owner_id)," · Supervisor: ",Ne(c.supervisor_id)," · Due: ",ze(c.due_at)),e.createElement("p",null,"Confirmed by: ",Ne(c.confirmed_by)),e.createElement("button",{className:"secondary",onClick:()=>z(c.inspection_id)},"Open photo and review"),Oe(c.state).length>0&&!oe&&e.createElement("p",{className:"note"},"Only the person responsible, the supervisor or a Developer can update this case."),!Oe(c.state).length&&e.createElement("p",{className:"note"},"This case is ",c.state.toLowerCase(),". You can read it but not change it."),we&&oe&&e.createElement("p",{className:"note",role:"status"},"Someone changed this case while you were typing. Your text is kept but not saved. Copy it, then load the latest case. ",e.createElement("button",{className:"secondary",disabled:S,onClick:()=>{Ye(),A("")}},"Load latest case and replace draft")),Oe(c.state).length>0&&oe&&e.createElement("form",{className:"login-form",onSubmit:t=>{t.preventDefault(),We(async()=>{if(we)throw new Error("The case changed. Load the latest case before saving.");const p=await O(),y=await Qe(p,"defectrag_update_corrective_action",{p_id:c.id,p_version:_e,p_state:ee,p_note:xe,p_owner:Ce,p_supervisor:Fe,p_due:ue?new Date(ue).toISOString():null});Te(y),ke(""),ve("")})}},e.createElement("label",{className:"field"},"Case status",e.createElement("select",{disabled:S||we,value:ee,onChange:t=>Se(t.target.value)},Oe(c.state).map(t=>e.createElement("option",{key:t},t)))),e.createElement("label",{className:"field"},"Person responsible",e.createElement("select",{disabled:S||we,required:!0,value:Ce,onChange:t=>Ae(t.target.value)},e.createElement("option",{value:""},"Choose a person"),H.map(t=>e.createElement("option",{key:t.user_id,value:t.user_id},t.display_name)))),e.createElement("label",{className:"field"},"Supervisor",e.createElement("select",{disabled:S||we,required:!0,value:Fe,onChange:t=>ce(t.target.value)},e.createElement("option",{value:""},"Choose a person"),H.map(t=>e.createElement("option",{key:t.user_id,value:t.user_id},t.display_name)))),et({legend:"New deadline (optional)",prefix:"New due ",value:ue,time:De,setValue:ve,setTime:Q,disabled:S||we,keep:"The deadline stays: "+lt(Qt(c.due_at))+"."}),e.createElement("label",{className:"field"},"What changed or was fixed?",e.createElement("textarea",{disabled:S,required:!0,minLength:3,maxLength:2e3,value:xe,onInput:t=>ke(t.target.value),onChange:t=>ke(t.target.value)})),e.createElement("button",{className:"primary",disabled:S||!ee||we},"Save case update")),e.createElement("h3",null,"Status history"),se.map(t=>e.createElement("p",{key:t.id},e.createElement("strong",null,t.state)," · ",Ne(t.actor_id)," · ",ze(t.created_at),e.createElement("br",null),t.note,t.snapshot&&e.createElement("small",null,e.createElement("br",null),"Owner: ",Ne(t.snapshot.owner_id)," · Supervisor: ",Ne(t.snapshot.supervisor_id)," · Due: ",ze(t.snapshot.due_at)))),e.createElement("h3",null,"Email delivery"),e.createElement("p",{className:"caption"},"Emails go to the supervisor, with a copy to the person responsible. If one fails, tell the administrator. The case stays saved either way."),!q.length&&e.createElement("p",{className:"caption"},"No emails recorded for this case yet."),q.map(t=>e.createElement("p",{key:t.id},rt(t.kind)," · ",st(t.status)," · attempts ",t.attempts,t.last_error?" · "+Ue(t.last_error):"")))))}function Zt({client:n,user:s,onChange:m}){var K;const[i,D]=a.useState(null),[v,z]=a.useState([]),[_,I]=a.useState([]),[g,U]=a.useState(null),[G,Y]=a.useState(""),[f,M]=a.useState(""),[T,j]=a.useState(""),[H,E]=a.useState(""),[de,h]=a.useState(""),[se,N]=a.useState(""),[q,L]=a.useState(!1),[fe,A]=a.useState([]),[S,J]=a.useState([]),me=((K=window.DEFECTRAG_PUBLIC_CONFIG)==null?void 0:K.registrationEnabled)===!0;async function w(){if(!s){D(null),A([]),J([]);return}const l=await ht(n);D(l);const{data:b,error:W}=await n.auth.mfa.listFactors();if(W)throw W;const ne=(b.totp||[]).filter(u=>u.status==="verified");if(z(ne),I((b.all||[]).filter(u=>u.factor_type==="totp"&&u.status==="unverified")),M(u=>{var R;return ne.some(ye=>ye.id===u)?u:((R=ne[0])==null?void 0:R.id)||""}),l.role==="developer"&&l.approved&&l.aal2){const[u,R]=await Promise.all([n.rpc("defectrag_access_directory"),n.rpc("defectrag_notification_status")]);if(u.error)throw u.error;if(R.error)throw R.error;A(u.data||[]),J(R.data||[])}else A([]),J([])}async function P(l){L(!0),N("");try{await l()}catch(b){N(b.message||"Security request failed.")}finally{L(!1)}}a.useEffect(()=>{let l=!0;return U(null),Y(""),A([]),J([]),n&&s?w().catch(b=>{l&&N(b.message)}):D(null),()=>{l=!1}},[n,s==null?void 0:s.id]);async function Ee(){await gt(n,(g==null?void 0:g.id)||f,G),Y(""),U(null),await w(),m(),N("Security code verified. Staff access is available only after the account is approved.")}return e.createElement("div",{className:"section-gap"},s&&e.createElement("h3",null,"Sign-in and account security"),se&&e.createElement("p",{className:"note",role:"status"},Ue(se)),s?e.createElement(e.Fragment,null,e.createElement("p",null,"Access: ",e.createElement("strong",null,i!=null&&i.revoked?"revoked":i!=null&&i.approved?"approved":(i==null?void 0:i.request_status)||"not requested")," · Authenticator: ",e.createElement("strong",null,i!=null&&i.aal2?"security code verified":"enter security code")),e.createElement("button",{className:"secondary",disabled:q,onClick:()=>P(w)},"Refresh account status"),i&&!i.approved&&!i.revoked&&!i.request_status&&e.createElement("form",{className:"login-form",onSubmit:l=>{l.preventDefault(),P(async()=>{await Et(n,T),await w(),N("Request sent. Check back here for Developer approval. Team and private Staff work are not available while the request is waiting."),m()})}},e.createElement("label",{className:"field"},"Display name",e.createElement("input",{value:T,maxLength:80,onChange:l=>j(l.target.value),required:!0})),e.createElement("button",{className:"primary",disabled:q||!i.registration_enabled||!i.email_verified},"Request staff access")),e.createElement("p",{className:"caption"},"Use an authenticator app for the extra six-digit sign-in code. Keep access to that app. If it is lost, contact the workspace administrator; resetting the password does not remove this security check."),!g&&!v.length&&!_.length&&e.createElement("button",{className:"secondary",disabled:q,onClick:()=>P(async()=>U(await yt(n)))},"Set up a security code app"),!g&&_.map(l=>e.createElement("p",{key:l.id,className:"caption"},"Authenticator setup was not finished. ",e.createElement("button",{className:"text-button",disabled:q,onClick:()=>P(async()=>{const{error:b}=await n.auth.mfa.unenroll({factorId:l.id});if(b)throw b;await w()})},"Cancel incomplete setup"))),g&&e.createElement("div",{className:"note"},e.createElement("div",null,e.createElement("p",null,"Open an authenticator app, scan this private QR code, then enter the six-digit code below to finish. Do not share the QR code or security codes."),e.createElement("img",{src:g.totp.qr_code,width:"200",height:"200",alt:"Private authenticator enrollment QR code"}),e.createElement("button",{className:"text-button",disabled:q,onClick:()=>P(async()=>{const{error:l}=await n.auth.mfa.unenroll({factorId:g.id});if(l)throw l;U(null),Y("")})},"Cancel incomplete setup"))),!g&&v.length>0&&(i==null?void 0:i.aal2)&&e.createElement("p",{className:"caption"},"The security code is verified for this sign-in."),(g||v.length>0&&!(i!=null&&i.aal2))&&e.createElement("form",{className:"login-form",onSubmit:l=>{l.preventDefault(),P(Ee)}},!g&&e.createElement("label",{className:"field"},"Security code app",e.createElement("select",{value:f,onChange:l=>M(l.target.value)},v.map(l=>e.createElement("option",{key:l.id,value:l.id},l.friendly_name||"Authenticator")))),e.createElement("label",{className:"field"},"Six-digit security code",e.createElement("input",{inputMode:"numeric",autoComplete:"one-time-code",pattern:"[0-9]{6}",maxLength:6,value:G,onChange:l=>Y(l.target.value),required:!0})),e.createElement("button",{className:"primary",disabled:q},"Verify security code")),(i==null?void 0:i.role)==="developer"&&i.approved&&i.aal2&&e.createElement(e.Fragment,null,e.createElement("h3",{className:"section-gap"},"Staff access management"),e.createElement("p",null,"Approve or reject requests that are still waiting. Removing access stops new Staff actions but keeps inspection history."),e.createElement("div",{className:"table-wrap"},e.createElement("table",null,e.createElement("thead",null,e.createElement("tr",null,e.createElement("th",null,"Account"),e.createElement("th",null,"Status"),e.createElement("th",null,"Role"),e.createElement("th",null,"Action"))),e.createElement("tbody",null,fe.map(l=>e.createElement("tr",{key:l.user_id},e.createElement("td",null,l.display_name,e.createElement("br",null),e.createElement("small",null,l.email)),e.createElement("td",null,l.status),e.createElement("td",null,l.role||"applicant"),e.createElement("td",null,l.user_id!==s.id&&(l.status==="pending"?["approve","reject"]:l.status==="approved"?["revoke"]:[]).map(b=>e.createElement("button",{key:b,className:"text-button",disabled:q,onClick:()=>{window.confirm(`${b[0].toUpperCase()+b.slice(1)} access for ${l.display_name}?`)&&P(async()=>{await vt(n,l,b),await w(),m(),N("Account access updated. Check Email delivery below separately; saving this change does not confirm an email was sent.")})}},{approve:"Approve",reject:"Reject",revoke:"Remove access"}[b])))))))),e.createElement("h3",{className:"section-gap"},"Email delivery"),e.createElement("p",{className:"caption"},"Waiting emails have not been sent. Delivery depends on administrator settings and the email service being available. Sent means the email service accepted the message; it may still reach Spam or fail to arrive."),e.createElement("div",{className:"table-wrap"},e.createElement("table",null,e.createElement("thead",null,e.createElement("tr",null,e.createElement("th",null,"Event"),e.createElement("th",null,"Delivery"),e.createElement("th",null,"Attempts"),e.createElement("th",null))),e.createElement("tbody",null,S.map(l=>e.createElement("tr",{key:l.id},e.createElement("td",null,rt(l.kind)),e.createElement("td",null,st(l.status)),e.createElement("td",null,l.attempts),e.createElement("td",null,l.status==="dead"&&e.createElement("button",{className:"text-button",disabled:q,onClick:()=>P(async()=>{const{error:b}=await n.rpc("defectrag_retry_notification",{p_id:l.id});if(b)throw b;await w()})},"Retry delivery"))))))))):me?e.createElement("details",{className:"register-panel"},e.createElement("summary",null,"New to Staff work? Create an account"),e.createElement("form",{className:"login-form",onSubmit:l=>{l.preventDefault(),P(async()=>{await ft(n,{email:H,password:de,displayName:T,redirectTo:location.origin+location.pathname}),h(""),N("Check the inbox and Spam folder for a confirmation email. Open its link, sign in, then choose Request staff access. A Developer must approve the request before Staff work is available.")})}},e.createElement("p",null,"New to Staff work? Create an account, confirm the email, then request access. The public demo can be used without an account."),e.createElement("label",{className:"field"},"Display name",e.createElement("input",{value:T,onChange:l=>j(l.target.value),maxLength:80,autoComplete:"name",required:!0})),e.createElement("label",{className:"field"},"Email",e.createElement("input",{type:"email",value:H,onChange:l=>E(l.target.value),autoComplete:"email",required:!0})),e.createElement("label",{className:"field"},"New password",e.createElement("input",{type:"password",minLength:12,value:de,onChange:l=>h(l.target.value),autoComplete:"new-password",required:!0})),e.createElement("button",{className:"secondary",disabled:q||!n},"Register account"))):e.createElement("p",{className:"caption"},"New account registration is currently closed. Existing Staff can sign in below. The public demo is still available."))}function Vt({onOpenInspection:n,onOpenCorrectiveActions:s,onChooseInspection:m,casesView:i=!1,initialInspectionId:D=null}){var Ie;const v=a.useRef(0),z=a.useRef(null),_=a.useRef(0),I=a.useRef(null),g=a.useRef(0),U=a.useRef(null),G=a.useRef(null),[Y,f]=a.useState(0),[M,T]=a.useState(!1),[j,H]=a.useState({state:"refreshing"}),[E,de]=a.useState(null),[h,se]=a.useState(null),[N,q]=a.useState([]),[L,fe]=a.useState({}),[A,S]=a.useState(""),[J,me]=a.useState(""),[w,P]=a.useState(!1),[Ee,K]=a.useState(""),[l,b]=a.useState(""),[W,ne]=a.useState(!1),[u,R]=a.useState(null),[ye,V]=a.useState([]),[le,ee]=a.useState([]),[Se,xe]=a.useState(""),[ke,_e]=a.useState(!1),[Te,qe]=a.useState(""),[He,Ce]=a.useState(!1),[Ae,Fe]=a.useState(null),ce=bt(),ue=wt(window.DEFECTRAG_PUBLIC_CONFIG);a.useEffect(()=>()=>{ye.filter(r=>r.startsWith("blob:")).forEach(r=>URL.revokeObjectURL(r))},[ye]),a.useEffect(()=>{I.current=u},[u]),a.useEffect(()=>{u&&Be(U.current)},[Y]),a.useEffect(()=>{if(!E||!h||!D)return;const r=E.id+":"+D;G.current!==r&&(G.current=r,$({id:D},{focus:!i}))},[E==null?void 0:E.id,h==null?void 0:h.user_id,D]);const ve=Nt(),De=ce&&Ae&&(!i||!h)?e.createElement(Zt,{key:(E==null?void 0:E.id)||"anonymous",client:Ae,user:E,onChange:()=>{Re(),E&&Q(c)}}):null;async function Q(r){P(!0),K(""),b("");try{await r()}catch(d){K(d.message||"Team request failed.")}finally{P(!1)}}async function c(){var F;const r=++_.current,d=v.current,o=(F=I.current)==null?void 0:F.id,{client:x,staff:ge}=await xt();let k=x.from("shared_inspections").select("*").order("created_at",{ascending:!1}).limit(200);k=W?k.not("archived_at","is",null):k.is("archived_at",null);const[{data:X,error:te},{data:be,error:B},ae]=await Promise.all([k,x.from("staff_members").select("*"),o?x.from("staff_notes").select("*").eq("inspection_id",o).order("created_at"):{data:[]}]);if(te)throw te;if(B)throw B;if(ae.error)throw ae.error;if(r===_.current&&(se(ge),K(""),q(X||[]),fe(Object.fromEntries((be||[]).map(re=>[re.user_id,re.display_name]))),o&&d===v.current)){const re=(X||[]).find(pe=>pe.id===o);if(!re)v.current++,R(null),V([]),ee([]);else if(R(re),ee(ae.data||[]),!ce&&Date.now()-g.current>480*1e3){const pe=await Promise.all([re.image_path,re.heatmap_path].map(oe=>x.storage.from("team-inspections").createSignedUrl(oe,900)));if(r===_.current&&d===v.current){if(pe.some(oe=>oe.error))throw new Error("Shared image links could not refresh.");V(pe.map(oe=>oe.data.signedUrl)),g.current=Date.now()}}}}a.useEffect(()=>{if(!ve)return;let r=!1,d;return O().then(async o=>{!r&&ce&&Fe(o),d=o.auth.onAuthStateChange((ge,k)=>{var X;if(!r){const te=((X=k==null?void 0:k.user)==null?void 0:X.id)||null;z.current!==te&&(v.current++,_.current++,R(null),q([]),V([]),ee([]),se(null),z.current=te),de((k==null?void 0:k.user)||null),ge==="PASSWORD_RECOVERY"&&_e(!0)}}).data.subscription;const{data:x}=await o.auth.getUser();r||de(x.user)}).catch(o=>{r||K(o.message)}),()=>{r=!0,v.current++,d==null||d.unsubscribe()}},[ve]),a.useEffect(()=>{if(!E)return;const r=tt(c,{onState:d=>{H(d),d.error&&(K(d.error),ce&&(v.current++,q([]),fe({}),R(null),V([]),ee([]),se(null)))}});return()=>{r.stop(),_.current++}},[E==null?void 0:E.id,W]);async function $(r,{focus:d=!0}={}){const o=++v.current;T(!0);try{await Q(async()=>{if(o!==v.current)return;const x=await O(),ge=x.storage.from("team-inspections"),[{data:k,error:X},{data:te,error:be}]=await Promise.all([x.from("shared_inspections").select("*").eq("id",r.id).single(),x.from("staff_notes").select("*").eq("inspection_id",r.id).order("created_at")]);if(o!==v.current)return;if(X)throw X;if(be)throw be;const B=ce?await St(x,k):null,ae=B?B.map(F=>({data:{signedUrl:F}})):await Promise.all([k.image_path,k.heatmap_path].map(F=>ge.createSignedUrl(F,900)));if(ae.some(F=>F.error))throw new Error("Private images could not be loaded. Check staff/storage policies.");if(o!==v.current){B==null||B.forEach(F=>URL.revokeObjectURL(F));return}I.current=k,g.current=Date.now(),R(k),V(ae.map(F=>F.data.signedUrl)),ee(te||[]),d&&f(F=>F+1)})}finally{o===v.current&&T(!1)}}function ie(){v.current++,I.current=null,T(!1),R(null),V([]),ee([])}async function C(){await Q(async()=>{const r=await O(),d=N.filter(o=>o.owner_id===E.id).map(o=>o.id);if(d.length){const{error:o}=await r.rpc("archive_team_inspections",{p_ids:d});if(o)throw o}v.current++,R(null),Ce(!1),await c(),Re()})}return ve?e.createElement(e.Fragment,null,e.createElement("section",{className:"card"},e.createElement("div",{className:"section-title"},e.createElement("div",null,e.createElement("h2",null,e.createElement($t,{size:21})," ",i?"Corrective Actions access":"Staff workspace"),e.createElement("p",null,h?"Inspections your team has shared. New inspections stay private until you share them.":"Sign in to review inspections your team has shared.")),e.createElement("span",{className:"subtle-tag"},e.createElement($e,{size:13})," STAFF ACCESS")),Ee&&e.createElement("div",{className:"error",role:"alert"},Ue(Ee)),l&&e.createElement("div",{className:"success",role:"status"},e.createElement("span",null,l)),M&&e.createElement("p",{role:"status"},"Opening the shared photo and review…"),i&&!ue&&e.createElement("p",{className:"note"},"Corrective Actions has been turned off for this app. Inspections and reviews are still available. Contact the workspace administrator if needed."),E&&!h&&De,E?e.createElement(e.Fragment,null,e.createElement("div",{className:"team-toolbar"},e.createElement("div",null,e.createElement(_t,{size:18}),e.createElement("strong",null,(h==null?void 0:h.display_name)||E.email),e.createElement("span",{className:"subtle-tag"},(h==null?void 0:h.role)||"CHECKING ACCESS")),e.createElement("button",{className:"secondary",disabled:w,onClick:()=>Q(c)},e.createElement(Ut,{size:16})," Refresh"),!i&&h&&ue&&e.createElement("button",{className:"secondary",onClick:()=>s==null?void 0:s()},"Open Corrective Actions"),i&&h&&e.createElement("button",{className:"secondary",onClick:()=>m==null?void 0:m()},"Choose a Team inspection"),e.createElement("button",{className:"secondary",onClick:()=>Q(async()=>{await(await O()).auth.signOut(),q([]),R(null),se(null)})},e.createElement(Ot,{size:16})," Sign out")),ke&&e.createElement("form",{className:"login-form",onSubmit:r=>{r.preventDefault(),Q(async()=>{const d=await O(),{error:o}=await d.auth.updateUser({password:Te});if(o)throw o;qe(""),_e(!1)})}},e.createElement("label",{className:"field"},"Set a new password",e.createElement("input",{type:"password",minLength:12,autoComplete:"new-password",value:Te,onChange:r=>qe(r.target.value),required:!0})),e.createElement("button",{className:"primary",disabled:w},"Save password")),!i&&e.createElement(e.Fragment,null,e.createElement("div",{className:"team-toolbar"},e.createElement("span",{role:"status"},N.length," shared inspections · ",j.state==="synced"?"updated "+new Date(j.at).toLocaleTimeString([],{hour:"numeric",minute:"2-digit"}):j.state==="offline"?"offline; shown results may be out of date":j.state==="stale"?"update failed; shown results may be out of date":"refreshing…"),(h==null?void 0:h.role)==="developer"&&e.createElement("button",{className:"secondary",onClick:()=>{ne(!W),R(null)}},e.createElement(qt,{size:16}),W?"Active history":"Restore archived team work"),!W&&e.createElement("button",{className:"secondary danger",disabled:w||!N.some(r=>r.owner_id===E.id),onClick:()=>Ce(!0)},e.createElement(Ct,{size:16})," Archive my shared inspections")),He&&e.createElement("div",{className:"note"},e.createElement("div",null,e.createElement("strong",null,"Archive your visible records?"),e.createElement("p",null,"They will leave the shared active history. Original files and conversations remain recoverable by a developer. Other staff members’ records will stay active."),e.createElement("div",{className:"button-row"},e.createElement("button",{className:"primary",disabled:w,onClick:C},"Archive my records"),e.createElement("button",{className:"secondary",onClick:()=>Ce(!1)},"Cancel")))),e.createElement("div",{className:"table-wrap"},e.createElement("table",{className:"stackable"},e.createElement("thead",null,e.createElement("tr",null,e.createElement("th",null,"Inspection"),e.createElement("th",null,"Product"),e.createElement("th",null,"Result"),e.createElement("th",null,"Shared by"),e.createElement("th",null,"Saved"),e.createElement("th",null))),e.createElement("tbody",null,N.map(r=>{var d;return e.createElement("tr",{key:r.id},e.createElement("td",{"data-label":"Inspection"},e.createElement("strong",null,r.id.slice(0,8))),e.createElement("td",{"data-label":"Product"},at(r.payload.category)),e.createElement("td",{"data-label":"Result"},e.createElement("span",{className:"badge "+((d=r.payload.verdict)==null?void 0:d.toLowerCase())},Xe(r.payload.verdict))),e.createElement("td",{"data-label":"Shared by"},L[r.owner_id]||"Staff member"),e.createElement("td",{"data-label":"Saved"},new Date(r.created_at).toLocaleString()),e.createElement("td",{className:"row-action"},e.createElement("button",{className:"text-button",disabled:w,onClick:()=>$(r)},"Review"),W&&(h==null?void 0:h.role)==="developer"&&e.createElement("button",{className:"text-button",disabled:w,onClick:()=>Q(async()=>{const o=await O(),{error:x}=await o.rpc("restore_team_inspections",{p_ids:[r.id]});if(x)throw x;await c(),Re()})},"Restore")))}))),!N.length&&e.createElement("div",{className:"empty"},e.createElement($e,{size:30}),e.createElement("p",null,W?"No archived records to recover.":"No shared inspections yet. Open an inspection result and select Share with team."))))):e.createElement(e.Fragment,null,e.createElement("h3",{className:"section-gap"},"Sign in"),e.createElement("form",{className:"login-form",onSubmit:r=>{r.preventDefault(),Q(async()=>{const d=await O(),{error:o}=await d.auth.signInWithPassword({email:A,password:J});if(o)throw o;me("")})}},e.createElement("label",{className:"field"},"Work email",e.createElement("input",{type:"email",autoComplete:"username",value:A,onChange:r=>S(r.target.value),required:!0})),e.createElement("label",{className:"field"},"Password",e.createElement("input",{type:"password",autoComplete:"current-password",value:J,onChange:r=>me(r.target.value),required:!0})),e.createElement("button",{className:"primary",disabled:w},w?e.createElement(kt,{className:"spin",size:17}):e.createElement(It,{size:17})," Sign in"),e.createElement("button",{type:"button",className:"text-button",disabled:!A||w,onClick:()=>Q(async()=>{const r=await O(),{error:d}=await r.auth.resetPasswordForEmail(A,{redirectTo:location.origin+location.pathname});if(d)throw d;b("Password reset email requested. Check the inbox and the Spam folder.")})},"Reset password"),e.createElement("p",{className:"caption"},ce?"A new account needs Developer approval before Staff work is available. Approved Staff must also enter their security code when asked.":"The workspace administrator must approve an account before it can access Staff work.")),De),E&&h&&De&&e.createElement("details",{className:"account-panel section-gap"},e.createElement("summary",null,"Account & security"),De)),i&&E&&h&&ue&&e.createElement(Xt,{key:E.id,user:E,inspection:u,notes:le,inspections:N,inspectionLoading:M,onSelectInspection:r=>r?$({id:r},{focus:!1}):ie(),onEvidence:r=>$({id:r})}),E&&u&&e.createElement("section",{className:"card",ref:U,tabIndex:-1,"aria-labelledby":"shared-inspection-title"},e.createElement("div",{className:"section-title"},e.createElement("div",null,e.createElement("h2",{id:"shared-inspection-title"},"Shared inspection · ",u.id.slice(0,8)),e.createElement("p",null,"Shared by ",L[u.owner_id]||"a colleague",". These are saved results. Nothing is checked again.")),e.createElement("div",{className:"button-row"},n&&!u.archived_at&&e.createElement("button",{className:"secondary",onClick:()=>n(u)},"Open full result and assistant"),!i&&ue&&!u.archived_at&&e.createElement("button",{className:"secondary",onClick:()=>s==null?void 0:s(u)},"Create or view corrective actions"),e.createElement("button",{className:"text-button",onClick:ie},"Close"))),e.createElement("div",{className:"shared-images"},ye.map((r,d)=>e.createElement("img",{key:r,src:r,alt:d?"Saved highlighted areas":"Saved inspected product"}))),e.createElement("div",{className:"observation"},e.createElement("strong",null,"SAVED RESULT"),e.createElement("span",null,Xe(u.payload.verdict)," · score ",Number(u.payload.score).toFixed(5)," · review limit ",Number(u.payload.threshold).toFixed(5))),e.createElement("h3",{className:"section-gap"},"Saved assistant conversation"),(Ie=u.conversation)!=null&&Ie.length?u.conversation.map((r,d)=>e.createElement("p",{className:"cloud-message",key:d},e.createElement("strong",null,r.role==="user"?"Inspector":"Evidence Assistant",": "),r.question||r.answer)):e.createElement("p",{className:"caption"},"No assistant conversation was shared with this inspection."),!u.archived_at&&e.createElement(Dt,{key:u.id+String(le.length),current:le.map(r=>Ze(r,L)).filter(Boolean).at(-1),disabled:w,onSave:async r=>{const d=await O(),{error:o}=await d.from("staff_notes").insert({inspection_id:u.id,author_id:E.id,body:Rt(r.status,r.decision,r.note)});if(o)throw o;await $(u,{focus:!i}),Re()}}),e.createElement("h3",{className:"section-gap"},"Team notes"),le.filter(r=>!Ze(r,L)).map(r=>e.createElement("div",{className:"cloud-message",key:r.id},e.createElement("strong",null,L[r.author_id]||"Staff member"),e.createElement("p",null,r.body),e.createElement("small",null,new Date(r.created_at).toLocaleString()))),!u.archived_at&&e.createElement("form",{className:"question-form",onSubmit:r=>{r.preventDefault(),Q(async()=>{const d=await O(),{error:o}=await d.from("staff_notes").insert({inspection_id:u.id,author_id:E.id,body:Se.trim()});if(o)throw o;xe(""),await $(u),Re()})}},e.createElement("input",{"aria-label":"Staff review note",maxLength:2e3,placeholder:"Add a note for the team…",value:Se,onChange:r=>xe(r.target.value)}),e.createElement("button",{className:"primary",disabled:w||!Se.trim()},e.createElement(Ht,{size:16})," Add note")))):e.createElement("section",{className:"card cloud-setup"},e.createElement("div",{className:"setup-icon"},e.createElement($e,{size:32})),e.createElement("span",{className:"eyebrow"},"TEAM WORKSPACE"),e.createElement("h2",null,"Team workspace is not available yet."),e.createElement("p",null,"The workspace administrator needs to connect shared storage before Staff can sign in here."),e.createElement("div",{className:"setup-grid"},[["01","Connect shared storage","The workspace administrator completes this setup."],["02","Set up staff access","The administrator sets up approval and account security."],["03","Connect this dashboard","The administrator connects the app, then Staff can sign in."]].map(([r,d,o])=>e.createElement("div",{key:r},e.createElement("b",null,r),e.createElement("h3",null,d),e.createElement("p",null,o)))),e.createElement("a",{className:"primary",href:"https://supabase.com/dashboard",target:"_blank",rel:"noreferrer"},"Administrator setup ",e.createElement(Pt,{size:16})),e.createElement("p",{className:"caption"},"Contact the workspace administrator for help. The public demo can be used without Staff access."))}export{Vt as default}; diff --git a/frontend/dist/assets/candle-heatmap-9tTuQfnO.jpg b/frontend/dist/assets/candle-heatmap-9tTuQfnO.jpg new file mode 100644 index 0000000000000000000000000000000000000000..841f898bc6453be036ed3bba372d3d7a20985739 Binary files /dev/null and b/frontend/dist/assets/candle-heatmap-9tTuQfnO.jpg differ diff --git a/frontend/dist/assets/candle-original-qMuCmLLU.jpg b/frontend/dist/assets/candle-original-qMuCmLLU.jpg new file mode 100644 index 0000000000000000000000000000000000000000..95f8871acaf36a85b9af54b936fe888601ff534f Binary files /dev/null and b/frontend/dist/assets/candle-original-qMuCmLLU.jpg differ diff --git a/frontend/dist/assets/index-BJEpbExd.css b/frontend/dist/assets/index-BJEpbExd.css new file mode 100644 index 0000000000000000000000000000000000000000..cbd1c063aabfb47f53c6ca5592a3e9b7ae61d222 --- /dev/null +++ b/frontend/dist/assets/index-BJEpbExd.css @@ -0,0 +1 @@ +:root{color-scheme:light;--background:#ffffff;--foreground:#171717;--card:#ffffff;--primary:#171717;--primary-fg:#ffffff;--secondary:#f5f5f5;--muted:#f5f5f5;--muted-fg:#404040;--accent:#f0f0f0;--link:#171717;--border:#e0e0e0;--input:#8c8c8c;--ring:#171717;--ring-soft:rgba(23,23,23,.18);--sidebar:#fafafa;--heading:#0a0a0a;--sidebar-accent:#f0f0f0;--sidebar-active:#171717;--overlay:rgba(0,0,0,.45);--bad:#b91c1c;--bad-bg:#fef2f2;--bad-border:#fecaca;--warn:#b45309;--warn-bg:#fffbeb;--warn-border:#fde68a;--ok:#15803d;--ok-bg:#f0fdf4;--ok-border:#bbf7d0;--info:#404040;--info-bg:#f5f5f5;--chart-1:#262626;--chart-2:#8c8c8c;--highlight:#171717;--glow:none;--shadow:0 1px 2px rgba(0,0,0,.05);--shadow-lg:0 12px 32px rgba(0,0,0,.12);--radius:10px;--font-sans:"Geist Variable","Segoe UI",system-ui,sans-serif;--font-mono:"Geist Mono Variable",ui-monospace,Consolas,monospace}:root.dark{color-scheme:dark;--background:#0a0a0a;--foreground:#f5f5f5;--card:#121212;--primary:#f5f5f5;--primary-fg:#0a0a0a;--secondary:#171717;--muted:#171717;--muted-fg:#d4d4d4;--accent:#1f1f1f;--link:#e5e5e5;--border:rgba(255,255,255,.14);--input:rgba(255,255,255,.34);--ring:#f5f5f5;--ring-soft:rgba(255,255,255,.28);--sidebar:#000000;--heading:#ffffff;--sidebar-accent:#171717;--sidebar-active:#f5f5f5;--overlay:rgba(0,0,0,.7);--bad:#f87171;--bad-bg:rgba(248,113,113,.14);--bad-border:rgba(248,113,113,.4);--warn:#fcd34d;--warn-bg:rgba(252,211,77,.12);--warn-border:rgba(252,211,77,.4);--ok:#34d399;--ok-bg:rgba(52,211,153,.12);--ok-border:rgba(52,211,153,.4);--info:#d4d4d4;--info-bg:rgba(255,255,255,.06);--chart-1:#e5e5e5;--chart-2:#8c8c8c;--highlight:#f5f5f5;--glow:none;--shadow:none;--shadow-lg:0 12px 32px rgba(0,0,0,.6)}:root{font-family:Inter,Segoe UI,system-ui,sans-serif;color:var(--foreground);background:var(--muted);font-synthesis:none;font-weight:400;font-size:17px}*{box-sizing:border-box}body{margin:0}button,input,select{font:inherit}button,a,input,select{-webkit-tap-highlight-color:transparent}button{cursor:pointer}a{color:inherit;text-decoration:none}button:disabled{opacity:.52;cursor:not-allowed}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible{outline:3px solid var(--ring);outline-offset:3px}button{border:0;background:none;color:inherit}h1,h2,h3,p{margin:0}h1{font-size:36px;line-height:1.2;letter-spacing:-1.1px;font-weight:650}h2{font-size:21px;letter-spacing:-.25px;font-weight:650}h3{font-size:19px}p{line-height:1.65}.app{display:flex;min-height:100vh}.sidebar{background:var(--sidebar);color:var(--muted-fg);width:242px;position:fixed;inset:0 auto 0 0;padding:31px 19px 22px;display:flex;flex-direction:column}.brand{display:flex;align-items:center;color:var(--primary-fg);gap:10px;margin-bottom:47px}.brand>div{font-weight:700;letter-spacing:-.5px;font-size:23px}.brand span:not(.brand-mark){font-size:13px;display:block;letter-spacing:1.8px;font-weight:500;margin-top:6px;color:var(--muted-fg)}.brand-mark{background:var(--primary);width:37px;height:40px;border-radius:10px;display:grid;place-items:center;color:var(--muted-fg)}.brand b{font-size:15px;color:var(--muted-fg);font-weight:500;border:1px solid var(--ring);border-radius:5px;padding:3px;margin-left:auto}.workspace-label{font-size:15px;letter-spacing:1.6px;color:var(--muted-fg);margin:0 13px 14px}nav{display:grid;gap:7px}nav button{display:flex;align-items:center;gap:11px;text-align:left;padding:12px 13px;border-radius:7px;font-size:16px;color:var(--muted-fg);white-space:nowrap}nav button.active{background:var(--primary);color:var(--primary-fg);font-weight:600}nav button.active svg{color:var(--muted-fg)}nav button:hover{background:var(--sidebar)}.nav-count{margin-left:auto;font-size:15px;background:var(--warn);color:var(--primary-fg);border-radius:4px;min-width:20px;text-align:center;padding:2px}.local-card{margin-top:40px;padding:15px 12px;border:1px solid var(--ring);border-radius:7px;font-size:15px}.local-card strong{font-size:15px;vertical-align:middle;color:var(--muted-fg)}.local-card p{color:var(--muted-fg);line-height:1.9;margin:8px 0 0 15px}.status-dot{display:inline-block;width:6px;height:6px;border-radius:50%;background:var(--primary);margin-right:7px;vertical-align:middle}.sidebar-foot{display:flex;align-items:center;justify-content:center;gap:7px;color:var(--muted-fg);font-size:15px;padding-top:23px}main{margin-left:242px;flex:1;min-width:0}.topbar{height:73px;border-bottom:1px solid var(--border);background:var(--card);display:flex;align-items:center;justify-content:space-between;padding:0 37px;font-size:16px;color:var(--muted-fg)}.topbar>span,.topbar>div{display:flex;align-items:center;gap:13px}.environment{font-size:14px;letter-spacing:1px;color:var(--muted-fg)}.avatar{background:var(--muted);color:var(--foreground);border-radius:50%;width:29px;height:29px;display:grid;place-items:center;font-size:15px;font-weight:600;margin-left:8px}.content{max-width:1570px;margin:auto;padding:35px 37px 0}.page-heading{display:flex;align-items:center;justify-content:space-between;gap:24px;margin-bottom:29px}.eyebrow{font-size:14px;font-weight:650;letter-spacing:1.7px;color:var(--muted-fg);margin-bottom:9px}.page-heading>div>p:last-child{color:var(--muted-fg);font-size:16px;margin-top:9px}.primary,.secondary{display:inline-flex;align-items:center;justify-content:center;gap:9px;border-radius:6px;padding:12px 16px;font-size:16px;font-weight:600;white-space:nowrap}.primary{background:var(--primary);color:var(--primary-fg)}.primary:hover:not(:disabled){background:var(--primary)}.secondary{background:var(--card);border:1px solid var(--border);color:var(--foreground)}.text-button{color:var(--foreground);font-size:16px;font-weight:600;display:inline-flex;align-items:center;gap:8px}.stats-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:17px;margin-bottom:24px}.card{background:var(--card);border:1px solid var(--border);border-radius:9px;padding:23px;margin-bottom:24px;box-shadow:var(--shadow)}.stat{padding:20px 22px;margin-bottom:0}.stat>div{display:flex;justify-content:space-between;align-items:center;font-size:16px;color:var(--muted-fg)}.stat strong{font-size:30px;letter-spacing:-1px;font-weight:600;display:block;margin:12px 0 7px}.stat small{font-size:15px;color:var(--muted-fg)}.teal{color:var(--foreground)}.green{color:var(--muted-fg)}.overview-grid{display:grid;grid-template-columns:1.35fr 1fr;gap:24px}.hero-card{position:relative;border-radius:9px;overflow:hidden;background:var(--sidebar);min-height:330px;padding:30px;color:var(--primary-fg);margin-bottom:24px}.hero-card .pill{display:inline-flex;align-items:center;gap:6px;font-size:14px;letter-spacing:1px;background:var(--primary);color:var(--muted-fg);padding:6px 8px;border-radius:4px}.hero-card h2{font-size:23px;line-height:1.4;letter-spacing:-.7px;margin:18px 0 12px;position:relative;z-index:2}.hero-card p{font-size:16px;color:var(--muted-fg);max-width:59%;position:relative;z-index:2}.hero-card .light{margin-top:23px;background:var(--ok-bg);color:var(--foreground)}.scan-visual{position:absolute;inset:52px 18px 40px auto;width:35%;border:1px solid var(--ring);border-radius:7px;background:var(--primary);transform:rotate(-5deg);padding:8px}.scan-visual img{width:100%;height:100%;object-fit:cover;border-radius:4px;opacity:.65;filter:saturate(.65)}.scan-visual>span{position:absolute;bottom:-23px;left:-10px;font-size:13px;letter-spacing:1px;white-space:nowrap;color:var(--muted-fg)}.scan-corner{position:absolute;z-index:1;top:20px;right:20px;bottom:20px;left:20px;border:1px solid var(--ok-border);border-radius:4px}.scan-corner:after{content:"";position:absolute;top:47%;left:-6px;right:-6px;height:1px;background:var(--ok-bg);box-shadow:var(--shadow)}.section-title{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:21px}.section-title p{font-size:16px;color:var(--muted-fg);margin-top:6px}.subtle-tag{font-size:14px;letter-spacing:.7px;color:var(--muted-fg);background:var(--muted);border:1px solid var(--border);border-radius:4px;padding:5px 7px;white-space:nowrap}.pipeline-step{display:flex;gap:13px;margin-bottom:19px;align-items:center}.pipeline-step>span{font-size:15px;border:1px solid var(--border);border-radius:50%;width:28px;height:28px;display:grid;place-items:center;color:var(--muted-fg)}.pipeline-step strong{font-size:16px}.pipeline-step p{font-size:15px;color:var(--muted-fg);line-height:1.6;margin-top:2px}.readiness{padding:23px}.readiness .note{font-size:14px;padding:11px}.note{background:var(--muted);color:var(--muted-fg);border:1px solid var(--border);border-radius:5px;display:flex;align-items:flex-start;gap:9px;padding:13px;font-size:16px;line-height:1.6}.note svg{flex-shrink:0;margin-top:1px}.note p{font-size:16px}.standalone{margin-bottom:24px}.standalone strong{color:var(--foreground)}.table-wrap{overflow:auto}table{width:100%;border-collapse:collapse;white-space:nowrap;font-size:16px}th{text-align:left;color:var(--muted-fg);font-size:14px;letter-spacing:.2px;background:var(--muted);padding:12px;font-weight:500}td{padding:15px 12px;border-bottom:1px solid var(--border);color:var(--foreground)}td strong{font-weight:600;color:var(--foreground)}td small{display:block;color:var(--muted-fg);font-size:14px;margin-top:5px}tr:last-child td{border-bottom:0}.badge{display:inline-flex;align-items:center;gap:6px;border:1px solid var(--border);background:var(--ok-bg);color:var(--foreground);font-size:15px;border-radius:5px;padding:5px 8px}.badge i{width:4px;height:4px;border-radius:50%;background:currentColor}.badge.anomalous{background:var(--bad-bg);border-color:var(--bad-border);color:var(--bad)}.badge.uncertain{background:var(--warn-bg);border-color:var(--warn-border);color:var(--warn)}.icon-button{width:29px;height:29px;border:1px solid var(--border);border-radius:5px;display:inline-grid;place-items:center;color:var(--muted-fg)}.gallery{display:grid;grid-template-columns:repeat(6,1fr);gap:14px;margin-bottom:24px}.sample{background:var(--card);border:1px solid var(--border);border-radius:8px;padding:0;text-align:left;overflow:hidden}.sample img{width:100%;height:110px;object-fit:cover;background:var(--muted)}.sample>div{padding:13px 11px}.sample strong{font-size:16px}.sample span{font-size:14px;color:var(--muted-fg);display:flex;justify-content:space-between;margin-top:5px}.inspection-grid{display:grid;grid-template-columns:330px minmax(0,1fr);gap:24px}.field{font-size:16px;font-weight:600;display:block;margin-bottom:20px;color:var(--foreground)}.field>span{font-weight:400;color:var(--muted-fg);font-size:15px;margin-left:5px}select,input{border:1px solid var(--border);border-radius:5px;background:var(--card);color:var(--foreground);min-height:39px;padding:9px 11px;width:100%;font-size:16px}.field select,.field input{margin-top:9px}.drop-zone{border:1px dashed var(--border);background:var(--muted);border-radius:7px;min-height:195px;display:flex;align-items:center;justify-content:center;flex-direction:column;padding:20px;gap:12px;cursor:pointer;position:relative;color:var(--muted-fg);text-align:center}.drop-zone span{font-size:14px;color:var(--muted-fg)}.drop-zone img{width:100%;height:140px;object-fit:contain}.drop-zone input{opacity:0;position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;cursor:pointer}.drop-zone:focus-within{outline:3px solid var(--ring);outline-offset:3px}.caption{font-size:14px;color:var(--muted-fg);line-height:1.7;margin-top:12px}.upload-card .caption:last-child{text-align:center}.wide{width:100%;margin-top:19px}.empty{min-height:220px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;color:var(--muted-fg);gap:12px;padding:20px}.empty p{font-size:16px;max-width:350px}.empty h3{font-size:18px;color:var(--foreground)}.result-banner{display:flex;align-items:center;justify-content:space-between;gap:15px;margin-bottom:24px}.result-banner h2{margin-top:13px;font-size:23px}.result-banner p{font-size:15px;color:var(--muted-fg);margin-top:6px}.image-toolbar{display:flex;justify-content:space-between;align-items:center;margin-bottom:9px;font-size:15px;color:var(--muted-fg)}.result-image{width:100%;max-height:390px;object-fit:contain;background:var(--muted);border:1px solid var(--border);border-radius:7px}.score-grid{display:grid;grid-template-columns:repeat(3,1fr);margin:20px 0;gap:18px}.score-grid>div{border-right:1px solid var(--border)}.score-grid>div:last-child{border:0}.score-grid small{font-size:15px;color:var(--muted-fg);display:block}.score-grid strong{font-size:25px;font-weight:550;display:block;margin-top:8px;color:var(--foreground)}.filters{display:flex;align-items:center;gap:12px;background:var(--muted);padding:12px;margin-bottom:16px;border-radius:5px;color:var(--muted-fg)}.filters select{max-width:170px;font-size:15px}.filters>span{margin-left:auto;font-size:15px;white-space:nowrap}.table-caption{padding:8px 12px}.assistant h2{display:flex;align-items:center;gap:8px}.observation{display:flex;gap:14px;background:var(--muted);padding:13px;border-radius:6px;font-size:16px;color:var(--muted-fg);align-items:center}.observation strong{font-size:14px;letter-spacing:1px;white-space:nowrap}.suggestions{display:flex;gap:10px;margin:25px 0;flex-wrap:wrap}.suggestions button{border:1px solid var(--border);border-radius:6px;padding:12px;font-size:15px;display:flex;gap:15px;align-items:center;color:var(--muted-fg)}.question-form{display:flex;gap:10px;margin-top:21px}.question-form input{flex:1}.conversation{margin-top:20px}.user-message{margin-left:15%;padding:16px;border-radius:6px;background:var(--muted);margin-bottom:16px;font-size:16px}.user-message strong{font-size:15px;color:var(--muted-fg)}.user-message p{margin-top:6px}.assistant-message{border:1px solid var(--border);border-radius:6px;padding:18px;margin-bottom:18px}.assistant-message>div:first-child{display:flex;align-items:center;justify-content:space-between}.assistant-message strong{font-size:16px}.answer-text{font-size:16px;white-space:pre-wrap;margin:14px 0}.trace{color:var(--muted-fg);font-size:14px;display:block;margin-top:13px}details{font-size:16px;color:var(--muted-fg)}summary{cursor:pointer;padding:10px 0}.source{background:var(--muted);padding:12px;border-radius:5px;margin:8px 0}.source p{font-size:16px;color:var(--muted-fg);white-space:pre-wrap;margin:8px 0}.source small{display:block;color:var(--muted-fg);font-size:14px}.source a{display:flex;align-items:center;gap:5px;color:var(--ok);font-size:15px;margin-top:8px}.generating{display:flex;gap:9px;align-items:center;font-size:16px;color:var(--muted-fg);padding:15px 0}.alert-row{display:flex;gap:17px;align-items:center;border-top:1px solid var(--border);padding:19px 0}.alert-row>svg{color:var(--warn)}.alert-row>div{flex:1}.alert-row strong{font-size:16px}.alert-row p{font-size:15px;color:var(--muted-fg);margin-top:5px}.performance-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:20px}.performance-grid .card{min-width:0}.performance-grid .section-title{gap:7px}.performance-grid p{font-size:15px}.matrix{display:grid;grid-template-columns:1fr 1fr 1fr;gap:4px;margin:17px 0 25px;align-items:center;text-align:center}.matrix b{font-size:21px;font-weight:500;background:var(--warn-bg);color:var(--muted-fg);padding:15px 0;border-radius:4px}dl>div{display:flex;justify-content:space-between;gap:8px;border-top:1px solid var(--border);padding:10px 0;font-size:14px}dt{color:var(--muted-fg)}dd{margin:0;color:var(--muted-fg);text-align:right}.about p{font-size:16px;color:var(--muted-fg);margin:14px 0}.about h3{font-size:17px;margin-top:27px;color:var(--foreground)}.source-link{display:flex;align-items:center;justify-content:space-between;padding:23px 0;border-bottom:1px solid var(--border);color:var(--muted-fg)}.source-link strong{font-size:16px}.source-link small{display:block;font-size:15px;color:var(--muted-fg);margin-top:6px}.about .note{margin-top:22px}.error{background:var(--bad-bg);border:1px solid var(--bad-border);color:var(--bad);display:flex;gap:10px;align-items:center;padding:14px;border-radius:6px;font-size:16px;margin-bottom:23px}.error span{flex:1}.error button{color:inherit;display:grid;place-items:center}.batch-summary{margin:22px 0}.batch-summary p{font-size:16px;color:var(--muted-fg);margin-top:8px}footer{border-top:1px solid var(--border);margin-top:12px;padding:22px 0;color:var(--muted-fg);display:flex;gap:17px;font-size:14px}footer>span:first-child{flex:1}.spin{animation:spin 1.2s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}@media(min-width:1500px){.hero-card h2{font-size:32px}.hero-card{min-height:340px}.gallery .sample img{height:140px}}@media(max-width:1200px){.sidebar{width:214px;padding-left:14px;padding-right:14px}main{margin-left:214px}.content{padding:28px 25px 0}.topbar{padding:0 25px}.hero-card{padding:24px}.hero-card h2{font-size:23px}.overview-grid{grid-template-columns:1.15fr 1fr;gap:18px}.hero-card p{max-width:65%}.scan-visual{width:29%;right:14px}.gallery{grid-template-columns:repeat(3,1fr)}.sample img{height:140px}.inspection-grid{grid-template-columns:285px minmax(0,1fr);gap:18px}.card{padding:19px}.performance-grid{grid-template-columns:1fr}.performance-grid .matrix{max-width:350px}.performance-grid dl{display:grid;grid-template-columns:repeat(2,1fr);gap:0 30px}.filters{flex-wrap:wrap}.filters select{flex:1;min-width:110px}}@media(max-width:900px){.overview-grid{grid-template-columns:1fr}.hero-card{min-height:285px}.scan-visual{width:28%;right:32px;top:25px}.hero-card p{max-width:60%}.inspection-grid{grid-template-columns:1fr}.stats-grid{grid-template-columns:repeat(2,1fr)}.page-heading{align-items:flex-start}h1{font-size:30px}.brand>div{font-size:21px}.brand span:not(.brand-mark){font-size:13px}.sidebar{width:200px}main{margin-left:200px}.alert-row{flex-wrap:wrap}.alert-row>div{min-width:180px}}@media(max-width:680px){.app{display:block}.sidebar{width:100%;position:relative;padding:16px 18px 0;display:block}.brand{margin-bottom:20px;width:185px}.brand>div{font-size:21px}.workspace-label,.sidebar-bottom{display:none}nav{display:flex;overflow:auto;gap:4px;margin:0 -5px;padding:0 0 12px}nav button{font-size:15px;padding:10px;gap:7px}nav button svg{width:15px;min-width:15px}.sidebar nav .nav-count{font-size:14px}main{margin:0}.topbar{height:50px;padding:0 19px;font-size:14px}.environment{font-size:13px}.avatar{width:25px;height:25px;font-size:14px}.content{padding:26px 18px 0}.page-heading{display:block;margin-bottom:25px}.page-heading>.primary{margin-top:18px}h1{font-size:28px}.stats-grid{gap:10px}.stat{padding:17px}.stat strong{font-size:30px}.stat small{font-size:14px}.hero-card{padding:23px;min-height:310px}.hero-card h2{font-size:24px}.hero-card p{max-width:62%}.scan-visual{width:27%;right:18px;top:65px;bottom:55px}.scan-visual>span{font-size:5px;left:-8px}.gallery{grid-template-columns:repeat(2,1fr);gap:10px}.sample img{height:120px}.sample span{font-size:14px}.card{padding:18px;margin-bottom:18px}.section-title{gap:10px}.section-title h2{font-size:18px}.section-title p{font-size:15px}.subtle-tag{font-size:13px}.section-title>.subtle-tag{max-width:130px;white-space:normal}.observation{display:block}.observation span{display:block;margin-top:7px;font-size:15px}.assistant-message>div:first-child{gap:12px}.assistant-message{padding:12px}.score-grid{gap:12px}.score-grid strong{font-size:23px}.score-grid small{font-size:14px}.result-banner h2{font-size:21px}.result-banner{align-items:flex-start}.result-banner .secondary{padding:9px;font-size:14px}.performance-grid dl{display:block}.filters{gap:8px}.filters>svg{display:none}.filters select{min-width:90px}.filters>span{width:100%;font-size:14px}.question-form{gap:6px}.question-form .primary{padding:10px}.question-form input{min-width:0}.alert-row{gap:10px}.alert-row>div{min-width:140px}.alert-row .secondary{font-size:15px;padding:10px}footer{flex-wrap:wrap;font-size:14px;gap:9px}footer>span:last-child{width:100%}.source-link{padding:18px 0}}@media(prefers-reduced-motion:reduce){*{animation:none!important;scroll-behavior:auto!important}}.showcase-banner{display:flex;gap:14px;padding:18px 22px;background:var(--muted);border:1px solid var(--ring);border-radius:14px;margin:0 0 24px;color:var(--foreground)}.showcase-banner svg{flex-shrink:0;margin-top:2px}.showcase-banner p{margin:6px 0 0;line-height:1.55;font-size:17px}.upload-card .gallery{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.upload-card .sample img{height:110px}.upload-card .sample{min-width:0}:root{font-family:Segoe UI,Inter,system-ui,sans-serif;color:var(--foreground);background:var(--muted);font-size:17px;font-weight:450}body{background:var(--muted)}button,a,input,select,summary{transition:background .18s,border-color .18s,box-shadow .18s,transform .18s,color .18s}button:active:not(:disabled){transform:translateY(1px)}.sidebar{background:var(--sidebar);color:var(--muted-fg);border-right:1px solid var(--ring);padding-top:25px}.brand{margin-bottom:28px;gap:11px}.brand>div{font-size:25px;letter-spacing:-1px}.brand span:not(.brand-mark){font-size:12px;letter-spacing:1.5px;color:var(--muted-fg)}.brand-mark{background:none;width:42px;height:42px}.brand-mark img{width:42px;height:42px}.workspace-label{color:var(--muted-fg);font-size:13px;margin-bottom:12px}nav{gap:5px;overflow:auto;scrollbar-width:thin;scrollbar-color:var(--primary) transparent}nav button{font-size:16px;padding:11px 12px;color:var(--muted-fg)}nav button.active{background:var(--primary);color:var(--primary-fg);box-shadow:var(--shadow)}nav button.active svg{color:var(--primary-fg)}nav button:hover{background:var(--primary);color:var(--primary-fg)}.nav-count{background:var(--warn);color:var(--foreground);font-weight:700}.local-card{background:var(--accent);border-color:var(--ring);margin-top:22px}.local-card strong{font-size:14px;color:var(--primary-fg)}.local-card p,.sidebar-foot{font-size:14px;color:var(--muted-fg)}.status-dot{background:var(--primary);box-shadow:0 0 0 3px var(--ring-soft)}.topbar{background:var(--card);-webkit-backdrop-filter:blur(16px);backdrop-filter:blur(16px);color:var(--muted-fg);border-color:var(--border);height:68px;font-size:15px}.environment{font-size:13px;color:var(--muted-fg)}.avatar{background:var(--muted);color:var(--muted-fg)}.content{padding-top:32px}.page-heading{margin-bottom:28px}.page-heading h1{font-size:36px;letter-spacing:-1.4px;color:var(--foreground);font-weight:720}.page-heading>div>p:last-child{font-size:17px;color:var(--muted-fg);max-width:700px}.eyebrow{color:var(--muted-fg);font-size:14px;letter-spacing:1.8px;font-weight:700;margin-bottom:11px}.card{border-color:var(--border);border-radius:16px;background:var(--card);box-shadow:var(--shadow);padding:25px;margin-bottom:24px}.section-title{margin-bottom:21px}.section-title h2{color:var(--foreground);font-size:21px;font-weight:680}.section-title h2 svg{vertical-align:middle;margin-right:4px}.section-title p{font-size:16px;color:var(--muted-fg);line-height:1.55}.section-title>div{min-width:0}.subtle-tag{border-color:var(--border);background:var(--muted);color:var(--muted-fg);display:inline-flex;align-items:center;gap:5px;border-radius:6px;font-size:13px}.stats-grid{gap:17px}.stat{position:relative;overflow:hidden}.stat:after{content:"";position:absolute;width:80px;height:80px;right:-35px;bottom:-35px;border-radius:50%;background:var(--muted)}.stat>div{font-size:16px;color:var(--muted-fg)}.stat strong{font-size:36px;line-height:1.25;font-weight:720;color:var(--foreground);letter-spacing:-1px}.stat small{font-size:14px;color:var(--muted-fg)}.stat:nth-child(2):after{background:var(--ok-bg)}.stat:nth-child(3):after{background:var(--bad-bg)}.stat:nth-child(4):after{background:var(--warn-bg)}.teal{color:var(--muted-fg)}.green{color:var(--foreground)}.orange{color:var(--bad)}.amber{color:var(--warn)}.primary{background:var(--primary);border-radius:9px;color:var(--primary-fg);box-shadow:var(--shadow);font-size:16px;min-height:42px;padding:11px 17px;font-weight:600}.primary:hover{box-shadow:var(--shadow);filter:brightness(1.05);transform:translateY(-1px)}.secondary{border:1px solid var(--border);border-radius:9px;color:var(--muted-fg);background:var(--card);font-size:15px;padding:10px 13px;display:inline-flex;align-items:center;gap:7px;justify-content:center}.secondary:hover{background:var(--muted);border-color:var(--border)}.secondary.selected{background:var(--muted);border-color:var(--ring)}.text-button{color:var(--muted-fg);font-size:15px}.icon-button{border-color:var(--border);border-radius:8px;color:var(--muted-fg);background:var(--card);width:33px;height:33px}.icon-button:hover{background:var(--muted);border-color:var(--border)}.button-row{display:flex;align-items:center;gap:9px;flex-wrap:wrap}.button-row>.primary,.button-row>.secondary{white-space:nowrap}.hero-card{background:var(--primary);border-radius:17px;box-shadow:var(--shadow);min-height:330px}.hero-card h2{font-size:28px;font-weight:680;color:var(--primary-fg);max-width:65%;line-height:1.28}.hero-card p{font-size:16px;color:var(--primary-fg);max-width:61%;line-height:1.65}.pill{background:var(--accent);color:var(--primary-fg);border-color:var(--border);font-size:13px}.primary.light{background:var(--card);color:var(--muted-fg);box-shadow:none}.scan-visual{transform:rotate(-4deg);box-shadow:var(--shadow);border-color:var(--border);border-radius:10px;overflow:hidden;animation:float-image 7s ease-in-out infinite}.scan-corner{border-color:var(--border)}.scan-corner:after{background:var(--accent);box-shadow:var(--shadow);animation:scan-sweep 4s ease-in-out infinite}.scan-visual>span{background:var(--sidebar);color:var(--primary-fg);font-size:12px}.pipeline-step strong{font-size:16px;color:var(--foreground)}.pipeline-step p{font-size:15px;color:var(--muted-fg)}.pipeline-step>span{border-color:var(--border);color:var(--muted-fg);background:var(--card);font-size:14px}.readiness .note{font-size:14px}.note{border-color:var(--border);background:var(--muted);color:var(--muted-fg);border-radius:9px;font-size:15px;line-height:1.6}.note p{font-size:15px}.showcase-banner{background:var(--muted);border-color:var(--border);border-radius:14px;color:var(--foreground);padding:19px 21px}.showcase-banner p,table{font-size:16px}th{background:var(--muted);color:var(--muted-fg);font-size:14px;padding:13px 12px;font-weight:650}td{padding:17px 12px;border-color:var(--border);color:var(--muted-fg)}td strong{color:var(--foreground)}td small{font-size:14px;color:var(--muted-fg);margin-top:6px}tbody tr{transition:background .16s}tbody tr:hover{background:var(--muted)}.badge{font-size:14px;padding:6px 10px;border-radius:7px}.badge.good{color:var(--foreground);background:var(--ok-bg);border-color:var(--ok-border)}.badge.anomalous{color:var(--bad);background:var(--bad-bg);border-color:var(--bad-border)}.badge.uncertain{color:var(--warn);background:var(--warn-bg);border-color:var(--warn-border)}.filters{background:var(--muted);border-radius:10px;padding:14px;color:var(--muted-fg)}.filters select{font-size:15px;max-width:190px}.filters>span{font-size:14px}.gallery{grid-template-columns:repeat(4,minmax(0,1fr));gap:15px}.sample{border-color:var(--border);border-radius:12px;transition:transform .18s,box-shadow .18s,border-color .18s}.sample:hover{transform:translateY(-4px);box-shadow:var(--shadow);border-color:var(--border)}.sample img{height:140px}.sample>div{padding:13px}.sample strong{font-size:16px;color:var(--foreground)}.sample span{font-size:14px;color:var(--muted-fg)}.sample img{transition:transform .35s}.sample:hover img{transform:scale(1.035)}.field{font-size:16px;color:var(--foreground)}.field>span{font-size:14px;color:var(--muted-fg)}select,input{min-height:43px;border-color:var(--border);border-radius:8px;color:var(--foreground);font-size:16px;padding:10px 12px}input:focus,select:focus{border-color:var(--ring);box-shadow:0 0 0 3px var(--ring-soft)}.drop-zone{border-color:var(--border);background:var(--muted);color:var(--muted-fg);border-radius:13px;min-height:200px}.drop-zone strong{font-size:16px}.drop-zone span{font-size:14px}.caption{color:var(--muted-fg);font-size:14px;line-height:1.7}.empty{color:var(--muted-fg)}.empty p{font-size:16px}.empty h3{color:var(--muted-fg)}.result-banner h2{font-size:23px;color:var(--foreground)}.result-banner p{font-size:14px;color:var(--muted-fg)}.image-toolbar{font-size:15px;color:var(--muted-fg)}.score-grid small{color:var(--muted-fg);font-size:15px}.score-grid strong{color:var(--foreground);font-size:26px;font-weight:650}.viewer-controls{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin:12px 0}.viewer-controls>div{display:flex;align-items:center;gap:8px;font-size:14px;color:var(--muted-fg)}.viewer-stage{height:350px;position:relative;border:1px solid var(--border);border-radius:12px;background:var(--muted);overflow:hidden}.viewer-image-wrap{position:absolute;top:0;right:0;bottom:0;left:0;transition:transform .25s}.viewer-original,.viewer-overlay{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;object-fit:contain}.viewer-overlay{clip-path:inset(0 0 0 var(--split))}.viewer-overlay.full{clip-path:none}.comparison-line{position:absolute;top:0;bottom:0;left:var(--split);width:2px;background:var(--card);box-shadow:0 0 0 1px var(--ring-soft);pointer-events:none}.comparison-line:after{content:"↔";position:absolute;top:48%;left:-17px;width:34px;height:34px;border-radius:50%;background:var(--card);color:var(--muted-fg);display:grid;place-items:center;box-shadow:var(--shadow)}.comparison-range{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;opacity:0;cursor:ew-resize;padding:0;margin:0}.viewer-stage:focus-within{outline:3px solid var(--border);outline-offset:2px}.viewer-label{position:absolute;top:12px;padding:6px 9px;background:var(--sidebar);color:var(--primary-fg);border-radius:5px;font-size:12px;letter-spacing:1px;pointer-events:none}.viewer-label.left{left:12px}.viewer-label.right{right:12px}.image-dialog,.confirmation-dialog{border:1px solid var(--border);border-radius:18px;padding:26px;box-shadow:var(--shadow);color:var(--foreground);max-width:min(94vw,1100px)}dialog::backdrop{background:var(--sidebar);-webkit-backdrop-filter:blur(5px);backdrop-filter:blur(5px)}.image-dialog{width:1000px}.image-dialog .viewer-stage{height:70vh}.confirmation-dialog{width:520px}.confirmation-dialog h2{font-size:25px;line-height:1.25}.confirmation-dialog>p{margin:17px 0;color:var(--muted-fg);font-size:16px}.confirmation-dialog .note{margin-bottom:23px}.confirmation-dialog .button-row{justify-content:flex-end}.observation{background:var(--muted);color:var(--muted-fg);border:1px solid var(--border);border-radius:10px;font-size:16px;flex-wrap:wrap}.observation strong{font-size:13px;color:var(--muted-fg)}.suggestions{gap:9px;margin:20px 0}.suggestions button{font-size:15px;color:var(--muted-fg);border-color:var(--border);border-radius:9px;padding:10px 12px;background:var(--card)}.suggestions button:hover{background:var(--muted);border-color:var(--border)}.user-message{background:var(--muted);color:var(--foreground);border-radius:13px 13px 3px;font-size:16px}.user-message strong{font-size:14px;color:var(--muted-fg)}.assistant-message{border-color:var(--border);background:var(--card);border-radius:13px;padding:22px}.assistant-message strong{font-size:16px;color:var(--foreground)}.answer-text{font-size:17px;line-height:1.85;color:var(--foreground);margin:17px 0}.source{background:var(--muted);border-radius:8px;padding:15px}.source p{font-size:16px;color:var(--muted-fg);line-height:1.75}.source strong{font-size:14px}.source small,.source a{font-size:14px;color:var(--muted-fg)}.workflow-details{margin-top:13px;border-top:1px solid var(--border);padding-top:3px}.workflow-details summary{font-size:14px;color:var(--muted-fg)}.workflow-details p,.trace{font-size:14px;color:var(--muted-fg)}.generating{font-size:16px;color:var(--muted-fg)}.generating .spin{color:var(--muted-fg)}.question-form input{font-size:16px}.question-form .primary{min-width:90px}.assistant .section-title{flex-wrap:wrap}.error{font-size:16px;background:var(--bad-bg);border-color:var(--bad-border);color:var(--bad);border-radius:10px}.success{display:flex;align-items:center;gap:10px;margin-bottom:22px;border:1px solid var(--border);background:var(--ok-bg);color:var(--foreground);padding:14px;border-radius:10px;font-size:16px}.success span{flex:1}.alert-row{border-color:var(--border)}.alert-row strong{font-size:16px;color:var(--foreground)}.alert-row p{font-size:14px;color:var(--muted-fg)}.performance-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.performance-grid p{font-size:15px;color:var(--muted-fg)}.performance-grid .section-title h2{font-size:19px}.performance-grid .section-title{flex-wrap:wrap}.matrix small{font-size:14px;color:var(--muted-fg)}.matrix b{font-size:23px;background:var(--bad-bg);color:var(--muted-fg)}.matrix b.correct{background:var(--muted);color:var(--muted-fg)}dl>div{font-size:14px;border-color:var(--border)}dt,dd{color:var(--muted-fg)}.about p{font-size:16px;color:var(--muted-fg);line-height:1.85}.about h3{font-size:18px;color:var(--muted-fg)}.source-link strong{font-size:16px;color:var(--muted-fg)}.source-link small{font-size:14px;color:var(--muted-fg)}.source-link{border-color:var(--border)}.about .note{font-size:15px}.muted{color:var(--muted-fg)}footer{color:var(--muted-fg);font-size:14px;border-color:var(--border);padding:23px 0}.setup-icon{width:57px;height:57px;background:var(--muted);color:var(--muted-fg);border-radius:16px;display:grid;place-items:center}.cloud-setup{padding:36px}.cloud-setup>.eyebrow{display:block;margin-top:25px}.cloud-setup>h2{font-size:28px;margin-bottom:17px}.cloud-setup>p{max-width:760px;color:var(--muted-fg);font-size:17px;line-height:1.8}.setup-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:20px;margin:32px 0}.setup-grid>div{padding:23px;background:var(--muted);border:1px solid var(--border);border-radius:12px}.setup-grid b{color:var(--muted-fg);font-size:15px}.setup-grid h3{font-size:18px;margin:15px 0 9px}.setup-grid p{font-size:16px;color:var(--muted-fg);line-height:1.7}.login-form{max-width:440px;margin:28px 0}.login-form .text-button{margin-left:16px}.team-toolbar{display:flex;align-items:center;gap:13px;flex-wrap:wrap;margin:20px 0;color:var(--muted-fg);font-size:15px}.team-toolbar>div:first-child{display:flex;align-items:center;gap:10px;flex:1}.team-toolbar>span:first-child{flex:1}.shared-images{display:grid;grid-template-columns:1fr 1fr;gap:15px;margin:20px 0}.shared-images img{width:100%;height:320px;object-fit:contain;background:var(--muted);border-radius:12px}.cloud-message{padding:15px 17px;border:1px solid var(--border);border-radius:10px;margin:12px 0;color:var(--muted-fg);font-size:16px;white-space:pre-wrap}.cloud-message small{font-size:14px;color:var(--muted-fg)}.section-gap{margin:27px 0 16px}.benchmark-intro{display:flex;align-items:center;gap:25px;background:var(--muted);border-color:var(--border)}.benchmark-intro h2{font-size:26px;color:var(--foreground)}.benchmark-intro p{font-size:16px;color:var(--muted-fg);line-height:1.8;max-width:850px;margin-top:14px}.benchmark-intro>svg{color:var(--muted-fg);flex-shrink:0}.training-steps{display:grid;gap:10px;margin-bottom:24px}.training-steps details{border:1px solid var(--border);border-radius:10px;background:var(--muted);padding:7px 17px}.training-steps summary{display:flex;align-items:center;gap:14px;color:var(--muted-fg);font-size:16px;list-style:none}.training-steps summary>span{font-size:14px;border:1px solid var(--border);color:var(--muted-fg);border-radius:50%;width:28px;height:28px;display:grid;place-items:center}.training-steps details p{margin:5px 0 15px 43px;font-size:16px;color:var(--muted-fg);line-height:1.75}.content{animation:page-in .28s ease-out}.card{animation:card-in .32s ease-out both}.stats-grid .card:nth-child(2){animation-delay:35ms}.stats-grid .card:nth-child(3){animation-delay:.07s}.stats-grid .card:nth-child(4){animation-delay:.105s}@keyframes page-in{0%{opacity:.4;transform:translateY(5px)}to{opacity:1;transform:translateY(0)}}@keyframes card-in{0%{opacity:.5;transform:translateY(7px)}to{opacity:1;transform:translateY(0)}}@keyframes float-image{0%,to{transform:rotate(-4deg) translateY(0)}50%{transform:rotate(-3deg) translateY(-6px)}}@keyframes scan-sweep{0%,to{top:25%;opacity:.5}50%{top:75%;opacity:1}}@media(min-width:901px){.sidebar{width:250px}main{margin-left:250px}.content,.topbar{padding-left:32px;padding-right:32px}.inspection-grid{grid-template-columns:310px minmax(0,1fr)}}@media(max-width:1250px){.performance-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.overview-grid{grid-template-columns:1fr}.hero-card{min-height:290px}.hero-card h2{font-size:29px}.scan-visual{width:26%;top:23px;bottom:23px;right:35px}.readiness{display:none}.gallery{grid-template-columns:repeat(3,minmax(0,1fr))}.setup-grid{grid-template-columns:1fr}.page-heading h1{font-size:32px}.section-title{flex-wrap:wrap}}@media(max-width:900px){.sidebar{width:205px}main{margin-left:205px}.sidebar nav button{font-size:14px;padding:11px 8px}.content{padding:26px 22px 0}.inspection-grid{grid-template-columns:1fr}.upload-card .gallery{grid-template-columns:repeat(4,minmax(0,1fr))}.performance-grid{grid-template-columns:1fr}.viewer-stage{height:380px}.stats-grid{grid-template-columns:repeat(2,1fr)}.card{padding:22px}.hero-card h2{font-size:26px}}@media(max-width:680px){.sidebar{width:100%;position:relative;padding:18px 18px 0}.sidebar nav{overflow:auto}.sidebar nav button{font-size:14px;padding:10px;min-height:40px}.brand{margin-bottom:18px}.brand>div{font-size:22px}main{margin:0}.content{padding:24px 16px 0}.page-heading h1{font-size:29px}.page-heading>div>p:last-child{font-size:16px}.card{padding:19px;border-radius:13px}.topbar{padding:0 17px;height:53px}.environment{font-size:12px}.stats-grid{gap:11px}.stat strong{font-size:29px}.stat small{font-size:14px}.hero-card{min-height:330px;padding:24px}.hero-card h2{font-size:26px;max-width:70%}.hero-card p{font-size:15px;max-width:68%}.scan-visual{width:23%;right:18px;top:80px;bottom:85px}.gallery,.upload-card .gallery{grid-template-columns:repeat(2,minmax(0,1fr))}.sample img{height:135px}.viewer-controls{justify-content:center}.viewer-stage{height:300px}.viewer-label{font-size:12px}.section-title h2{font-size:20px}.section-title p{font-size:15px}.result-banner{flex-wrap:wrap}.result-banner h2{font-size:21px}.result-banner p{font-size:14px}.score-grid strong{font-size:22px}.score-grid small{font-size:14px}.observation{font-size:15px}.assistant-message{padding:16px}.answer-text{font-size:16px}.assistant-message>div:first-child{flex-wrap:wrap;gap:10px}.suggestions button{font-size:14px}.shared-images{grid-template-columns:1fr}.benchmark-intro>svg{display:none}.benchmark-intro h2{font-size:23px}.cloud-setup{padding:23px}.cloud-setup>h2{font-size:25px}.team-toolbar>.secondary{font-size:14px}.confirmation-dialog{padding:23px}.confirmation-dialog h2{font-size:23px}footer{font-size:13px}.source-link strong{font-size:16px}}@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}.tutorial-dialog{width:min(650px,calc(100vw - 32px));max-height:88dvh;box-sizing:border-box;border:1px solid var(--border);border-radius:20px;padding:28px;margin:auto;background:var(--card);color:var(--foreground);box-shadow:var(--shadow);overflow:auto}.tutorial-top,.tutorial-footer{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}.tutorial-progress{display:block;width:100%;height:6px;margin:18px 0 23px;accent-color:var(--primary)}.tutorial-icon{width:58px;height:58px;border-radius:16px;background:var(--muted);color:var(--muted-fg);display:grid;place-items:center;margin-bottom:18px}.tutorial-dialog h2{font-size:26px;line-height:1.25;margin:0 0 12px}.tutorial-dialog h2:focus{outline:none}.tutorial-dialog>p{font-size:17px;line-height:1.65;color:var(--muted-fg)}.tutorial-points{padding-left:22px;margin:18px 0 26px;color:var(--foreground);font-size:16px;line-height:1.75}.tutorial-points li+li{margin-top:12px}.tutorial-footer{border-top:1px solid var(--border);padding-top:18px}.tutorial-footer .button-row{margin:0}.tutorial-footer button{min-height:42px}@media(max-width:680px){.tutorial-dialog{padding:20px;max-height:90dvh}.tutorial-dialog h2{font-size:22px}.tutorial-points{font-size:16px}.tutorial-footer{gap:10px}.tutorial-footer .button-row{gap:8px}}.case-workspace textarea{display:block;width:100%;min-height:96px;resize:vertical;margin-top:9px;padding:10px 12px;border:1px solid var(--border);border-radius:8px;font:inherit;font-weight:400;color:var(--foreground);background:var(--card)}.case-workspace textarea:focus-visible{outline:3px solid var(--ring);outline-offset:3px}.case-workspace input[type=checkbox]{width:auto;min-height:0;padding:0;margin-right:8px;vertical-align:middle}.mobile-nav-hint{display:none}@media(max-width:680px){.mobile-nav-hint{display:block;color:var(--muted-fg);font-size:14px;line-height:1.5;padding:5px 0 10px;margin:0}}[tabindex="-1"]:focus{outline:none}.case-step{border:1px solid var(--border);background:var(--muted);border-radius:9px;padding:14px 16px;margin:14px 0 18px;color:var(--muted-fg);font-size:15px;line-height:1.6}.case-step strong{display:block;color:var(--foreground);font-size:16px;margin-bottom:4px}.case-step p{margin:0 0 10px}.case-step .primary,.case-step .secondary{margin-right:10px}.case-step.ready{border-color:var(--ok-border);background:var(--ok-bg)}.case-step.blocked{border-left:4px solid var(--ring)}.case-workspace .consent-check{display:flex;align-items:flex-start;gap:8px;margin:16px 0 4px;font-size:16px;line-height:1.6;color:var(--foreground);cursor:pointer}.case-workspace .consent-check input{flex:0 0 auto;margin:5px 0 0;accent-color:var(--primary)}.case-workspace .consent-check small{display:block;color:var(--muted-fg);font-size:14px}.case-workspace .consent-check.locked{cursor:not-allowed;color:var(--muted-fg)}.register-panel,.account-panel{border:1px solid var(--border);border-radius:9px;padding:12px 16px;margin-top:22px;background:var(--card)}.register-panel>summary,.account-panel>summary{cursor:pointer;color:var(--muted-fg);font-weight:600;font-size:16px}.register-panel[open]>summary,.account-panel[open]>summary{margin-bottom:6px}.demo-banner{display:flex;align-items:center;justify-content:space-between;gap:16px;width:100%;flex-wrap:wrap}.demo-banner>div{flex:1 1 320px}.demo-banner p{margin:4px 0 0}.alert-thumb{width:46px;height:46px;object-fit:cover;border-radius:8px;flex:0 0 auto;background:var(--muted)}.tutorial-coach{position:fixed;right:24px;bottom:24px;z-index:60;width:min(380px,calc(100vw - 32px));max-height:min(70vh,520px);overflow:auto;background:var(--card);border:1px solid var(--border);border-radius:14px;box-shadow:var(--shadow);padding:16px 18px;color:var(--foreground)}.tutorial-coach h2{font-size:18px;margin:10px 0 6px;color:var(--foreground)}.tutorial-coach p{font-size:13.5px;line-height:1.6;margin:0 0 8px}.tutorial-coach progress{width:100%;height:6px;accent-color:var(--primary)}.tutorial-coach small{display:block;color:var(--muted-fg);font-size:11.5px;line-height:1.5;margin-top:10px}.tutorial-coach .coach-hint{background:var(--warn-bg);border:1px solid var(--warn-border);color:var(--warn);border-radius:8px;padding:8px 10px}.tutorial-coach .coach-actions{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-top:6px}.tour-target{outline:3px solid var(--ring)!important;outline-offset:4px;border-radius:10px;box-shadow:0 0 0 8px var(--ring-soft)!important;animation:tour-pulse 1.6s ease-in-out infinite}@keyframes tour-pulse{50%{box-shadow:0 0 0 14px var(--ring-soft)}}@media(prefers-reduced-motion:reduce){.tour-target{animation:none}}@media(max-width:680px){.tutorial-coach{right:8px;left:8px;bottom:calc(8px + env(safe-area-inset-bottom,0px));width:auto;max-height:46vh}}.due-field{border:0;padding:0;margin:0 0 20px;min-width:0}.due-field legend{font-size:16px;font-weight:600;color:var(--foreground);padding:0;margin-bottom:9px}.due-shortcuts{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:12px}.chip{border:1px solid var(--border);background:var(--card);color:var(--foreground);border-radius:999px;padding:7px 13px;font-size:15px;min-height:34px}.chip:hover:not(:disabled){border-color:var(--border);background:var(--muted)}.chip.selected{background:var(--muted);border-color:var(--ring);color:var(--muted-fg);font-weight:600}.due-inputs{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,160px);gap:12px}.due-inputs .field{margin-bottom:0;font-weight:500;font-size:15px}.due-summary{margin-top:10px}.due-summary strong{color:var(--foreground);font-weight:600}@media(max-width:480px){.due-inputs{grid-template-columns:1fr}}.tutorial-coach.at-bottom-left{right:auto;left:24px}.tutorial-coach.at-top-right{bottom:auto;top:24px}.tutorial-coach.at-top-left{right:auto;left:24px;bottom:auto;top:24px}@media(max-width:680px){.tutorial-coach.at-top{bottom:auto;top:calc(8px + env(safe-area-inset-top,0px))}}.coach-more{display:none}@media(max-width:680px),(max-height:820px){.tutorial-coach{max-height:none;padding:12px 14px}.tutorial-coach>small{display:none}.tutorial-coach h2{font-size:18px;margin:6px 0 4px}.tutorial-coach progress{margin:6px 0}.coach-text:not(.open){display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.coach-more{display:inline-flex;padding:0;margin:0 0 6px}body.coach-open main{padding-bottom:240px}}.batch-samples{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:14px 0 4px;padding:12px 14px;border:1px solid var(--border);border-radius:11px;background:var(--card)}.batch-samples>div:first-child{flex:1 1 180px;display:grid;gap:2px}.batch-samples strong{font-size:16px;color:var(--foreground)}.batch-samples span{font-size:14px;color:var(--muted-fg)}.batch-sample-row{display:flex;gap:6px}.batch-sample-row img{width:48px;height:48px;object-fit:cover;border-radius:7px;border:1px solid var(--border)}@font-face{font-family:Geist Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(./geist-cyrillic-ext-wght-normal-DjL33-gN.woff2) format("woff2-variations");unicode-range:U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:Geist Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(./geist-cyrillic-wght-normal-BEAKL7Jp.woff2) format("woff2-variations");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:Geist Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(./geist-vietnamese-wght-normal-6IgcOCM7.woff2) format("woff2-variations");unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB}@font-face{font-family:Geist Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(./geist-latin-ext-wght-normal-DC-KSUi6.woff2) format("woff2-variations");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Geist Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(./geist-latin-wght-normal-BgDaEnEv.woff2) format("woff2-variations");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Geist Mono Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(./geist-mono-cyrillic-ext-wght-normal-X_5orZeX.woff2) format("woff2-variations");unicode-range:U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:Geist Mono Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(./geist-mono-cyrillic-wght-normal-DiZS0aHC.woff2) format("woff2-variations");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:Geist Mono Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(./geist-mono-symbols2-wght-normal-CO5SzqOn.woff2) format("woff2-variations");unicode-range:U+2000-2001,U+2004-2008,U+200A,U+23B8-23BD,U+2500-259F}@font-face{font-family:Geist Mono Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(./geist-mono-vietnamese-wght-normal-DadHysG0.woff2) format("woff2-variations");unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB}@font-face{font-family:Geist Mono Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(./geist-mono-latin-ext-wght-normal-Bwz-egvJ.woff2) format("woff2-variations");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Geist Mono Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(./geist-mono-latin-wght-normal-XN7g48iV.woff2) format("woff2-variations");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}html,body{background:var(--sidebar);color:var(--foreground)}:root{font-family:var(--font-sans);font-size:17px;font-weight:400;color:var(--foreground);background:var(--sidebar)}body{font-size:16px;-webkit-font-smoothing:antialiased}button,input,select,textarea{font-family:inherit}.num,.stat strong,td .mono,.score-grid strong{font-variant-numeric:tabular-nums}.mono{font-family:var(--font-mono)}::selection{background:var(--accent)}.app{background:var(--sidebar)}.sidebar{background:var(--sidebar);color:var(--foreground);border-right:0;width:256px;padding:8px 8px 12px;gap:6px}.brand{margin:0;padding:8px;gap:8px;color:var(--foreground)}.brand-mark,.brand-mark img{width:24px;height:24px;background:none}.brand>div{font-size:17px;font-weight:600;letter-spacing:-.2px;color:var(--foreground)}.brand span:not(.brand-mark),.workspace-label,.mobile-nav-hint{display:none}.sidebar-new{display:flex;align-items:center;gap:8px;width:100%;height:34px;margin:4px 0 6px;padding:0 10px;border-radius:6px;background:var(--primary);color:var(--primary-fg);font-size:16px;font-weight:500;border:0}.sidebar-new:hover:not(:disabled){opacity:.9}nav{gap:2px}.nav-group{display:grid;gap:1px;padding:4px 0}.nav-group h6{margin:8px 0 2px;padding:0 8px;height:24px;display:flex;align-items:center;font-size:14px;font-weight:500;color:var(--muted-fg);letter-spacing:0}nav button{height:32px;min-height:32px;padding:0 8px;border-radius:6px;font-size:16px;font-weight:400;color:var(--foreground);gap:8px;background:transparent}nav button svg{width:16px;height:16px;min-width:16px;color:var(--foreground)}nav button:hover{background:var(--sidebar-accent);color:var(--foreground)}nav button.active{background:var(--sidebar-accent);color:var(--foreground);font-weight:500;box-shadow:none}nav button.active svg{color:var(--foreground)}.nav-count{margin-left:auto;min-width:0;padding:0 4px;background:transparent;color:var(--muted-fg);font-size:14px;font-weight:500}.sidebar-bottom{margin-top:auto}.local-card{margin-top:8px;padding:10px 12px;border:1px solid var(--border);border-radius:8px;background:var(--card);color:var(--muted-fg);font-size:14px}.local-card strong{color:var(--foreground);font-size:15px;font-weight:500}.local-card p{margin:4px 0 0 13px;color:var(--muted-fg);line-height:1.5;font-size:14px}.sidebar-foot{color:var(--muted-fg);font-size:14px;padding-top:12px}.status-dot{background:var(--ok)}.status-dot.offline{background:var(--warn)}@media(min-width:681px){main{margin:8px 8px 8px 264px;background:var(--background);border:1px solid var(--border);border-radius:12px;box-shadow:var(--shadow);min-height:calc(100vh - 16px);overflow:clip}}.topbar{height:48px;padding:0 24px;border-bottom:1px solid var(--border);background:transparent;color:var(--foreground);font-size:16px}.topbar-title{display:flex;align-items:center;gap:12px;font-size:16px;font-weight:500}.topbar-title .sep{width:1px;height:16px;background:var(--border)}.topbar-title svg{color:var(--muted-fg)}.environment{font-size:14px;letter-spacing:0;color:var(--muted-fg);border:1px solid var(--border);border-radius:999px;padding:3px 10px;display:inline-flex;align-items:center;gap:6px}.avatar{display:none}.theme-toggle{width:32px;height:32px;display:grid;place-items:center;border-radius:6px;color:var(--foreground);background:transparent}.theme-toggle:hover{background:var(--accent)}.content{padding:24px 24px 0;max-width:1600px}.page-heading{margin-bottom:24px;align-items:flex-end}.page-heading .eyebrow{display:none}.page-heading h1{font-size:23px;line-height:1.25;font-weight:600;letter-spacing:-.4px;color:var(--foreground)}.page-heading>div>p:last-child{font-size:16px;color:var(--muted-fg);margin-top:4px}.primary,.secondary,.text-button,.icon-button{transition:background .15s,opacity .15s,border-color .15s}.primary{background:var(--primary);color:var(--primary-fg);border:1px solid var(--primary);border-radius:6px;min-height:36px;padding:0 14px;font-size:16px;font-weight:500;box-shadow:var(--shadow);filter:none}.primary:hover:not(:disabled){background:var(--primary);opacity:.9;box-shadow:var(--shadow);transform:none;filter:none}.primary.light{background:var(--card);color:var(--foreground);border-color:var(--border)}.secondary{background:var(--card);color:var(--foreground);border:1px solid var(--border);border-radius:6px;min-height:36px;padding:0 12px;font-size:16px;font-weight:500;box-shadow:var(--shadow)}.secondary:hover:not(:disabled){background:var(--accent);border-color:var(--border)}.secondary.selected{background:var(--accent);border-color:var(--ring)}:root.dark .secondary{background:#ffffff0a;border-color:var(--input)}:root.dark .secondary:hover:not(:disabled){background:#ffffff14}.text-button{color:var(--foreground);font-size:16px;font-weight:500;text-underline-offset:4px}.text-button:hover:not(:disabled){text-decoration:underline}.danger{color:var(--bad)}.icon-button{background:var(--card);color:var(--foreground);border:1px solid var(--border);border-radius:6px}.icon-button:hover{background:var(--accent);border-color:var(--border)}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,summary:focus-visible{outline:2px solid var(--ring);outline-offset:2px}.card{background:var(--card);color:var(--foreground);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow);padding:24px}.section-title h2{font-size:17px;font-weight:600;letter-spacing:-.1px;color:var(--foreground)}.section-title p{font-size:16px;color:var(--muted-fg)}.subtle-tag{background:transparent;border:1px solid var(--border);color:var(--muted-fg);border-radius:6px;font-size:14px;font-weight:500;letter-spacing:0;padding:2px 8px}.caption,.muted{color:var(--muted-fg)}.note{background:var(--muted);border:1px solid var(--border);color:var(--muted-fg);border-radius:8px}.note strong,.note b{color:var(--foreground)}.error{background:var(--bad-bg);border:1px solid var(--bad-border);color:var(--bad);border-radius:8px}.cloud-message{border-color:var(--border);background:var(--card);color:var(--foreground)}select,input,textarea{background:var(--background);color:var(--foreground);border:1px solid var(--input);border-radius:6px;min-height:36px;font-size:16px;box-shadow:var(--shadow)}:root.dark select,:root.dark input,:root.dark textarea{background:#ffffff0a}input::placeholder,textarea::placeholder{color:var(--muted-fg)}input:focus,select:focus,textarea:focus{border-color:var(--ring);box-shadow:0 0 0 3px var(--ring-soft);outline:none}.field{color:var(--foreground);font-size:16px;font-weight:500}.field>span{color:var(--muted-fg);font-weight:400}.drop-zone{border:1px dashed var(--input);background:transparent;color:var(--muted-fg);border-radius:var(--radius)}.drop-zone:hover{border-color:var(--ring);background:var(--muted)}.drop-zone strong{color:var(--foreground);font-weight:500}.table-wrap{border:1px solid var(--border);border-radius:var(--radius)}table{font-size:16px}th{background:var(--muted);color:var(--foreground);font-size:15px;font-weight:500;letter-spacing:0}td{color:var(--foreground);border-bottom:1px solid var(--border)}td strong{color:var(--foreground);font-weight:500;font-family:var(--font-mono);font-size:15px}td small{color:var(--muted-fg)}tbody tr:hover td{background:var(--muted)}.badge{display:inline-flex;align-items:center;gap:6px;background:transparent;border:1px solid var(--border);color:var(--foreground);border-radius:6px;font-size:14px;font-weight:500;padding:2px 8px}.badge i{width:7px;height:7px;border-radius:50%;background:var(--ok)}.badge.anomalous,.badge.uncertain{background:transparent;border-color:var(--border);color:var(--foreground)}.badge.anomalous i{background:var(--bad)}.badge.uncertain i{background:var(--warn)}.stats-grid{gap:16px}.stat{padding:20px 24px;display:flex;flex-direction:column;gap:16px}.stat:after,.stat:before{display:none}.stat-head{display:flex;justify-content:space-between;align-items:center;gap:8px;color:var(--muted-fg);font-size:16px}.stat strong{font-size:28px;line-height:1.1;font-weight:600;letter-spacing:-.6px;margin:0;color:var(--foreground)}.stat-trend{display:inline-flex;align-items:center;gap:4px;border:1px solid var(--border);border-radius:8px;padding:1px 8px;font-size:14px;font-weight:500;color:var(--foreground)}.stat-trend.bad{color:var(--bad)}.stat-trend.warn{color:var(--warn)}.stat-trend.ok{color:var(--ok)}.stat-foot{display:grid;gap:3px;font-size:16px}.stat-foot b{font-weight:500;color:var(--foreground)}.stat-foot small{color:var(--muted-fg);font-size:16px}.segmented{display:inline-flex;border:1px solid var(--border);border-radius:8px;overflow:hidden}.segmented button{padding:6px 12px;font-size:15px;color:var(--muted-fg);background:transparent;border-radius:0}.segmented button.on{background:var(--muted);color:var(--foreground);font-weight:500}.chart-card svg{display:block;width:100%;height:200px}.chart-legend{display:flex;gap:16px;font-size:14px;color:var(--muted-fg);margin-top:8px}.chart-legend i{display:inline-block;width:8px;height:8px;border-radius:2px;margin-right:6px;vertical-align:middle}.chart-axis{display:flex;justify-content:space-between;font-size:14px;color:var(--muted-fg);margin-top:6px}.chart-empty{height:200px;display:grid;place-items:center;color:var(--muted-fg);border:1px dashed var(--border);border-radius:8px}.tabs-row{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:12px}.tab-list{display:inline-flex;background:var(--muted);border-radius:8px;padding:3px;gap:2px}.tab-list button{display:inline-flex;align-items:center;gap:6px;padding:4px 12px;border-radius:6px;font-size:15px;color:var(--muted-fg);background:transparent}.tab-list button.on{background:var(--background);color:var(--foreground);font-weight:500;box-shadow:var(--shadow)}:root.dark .tab-list button.on{background:var(--input)}.tab-list .count{background:var(--border);border-radius:999px;padding:0 6px;font-size:14px;color:var(--foreground)}.sample{background:var(--card);border:1px solid var(--border);border-radius:var(--radius)}.sample:hover{border-color:var(--ring)}.sample strong{color:var(--foreground);font-weight:500}.sample span{color:var(--muted-fg)}.result-banner h2{color:var(--foreground)}.result-banner p{color:var(--muted-fg)}.score-grid>div{border-color:var(--border)}.score-grid small{color:var(--muted-fg)}.score-grid strong{color:var(--foreground);font-weight:600}.observation{background:var(--muted);border:1px solid var(--border);color:var(--foreground)}.observation strong{color:var(--muted-fg)}.suggestions button{background:var(--card);border:1px solid var(--border);color:var(--foreground);border-radius:999px}.suggestions button:hover{background:var(--accent)}.user-message{background:var(--muted);color:var(--foreground)}.user-message strong{color:var(--muted-fg)}.assistant-message{background:var(--card);border:1px solid var(--border)}.assistant-message strong,.answer-text{color:var(--foreground)}.source{background:var(--muted)}.source p{color:var(--muted-fg)}.source a{color:var(--foreground);text-decoration:underline;text-underline-offset:3px}.tutorial-coach{background:var(--card);border:1px solid var(--border);box-shadow:var(--shadow-lg);color:var(--foreground)}.tutorial-coach p,.tutorial-coach small{color:var(--muted-fg)}.tutorial-coach progress{accent-color:var(--foreground)}.coach-hint{background:var(--warn-bg);border:1px solid var(--warn-border);color:var(--warn)}.tour-target{outline:2px solid var(--highlight)!important;box-shadow:0 0 0 6px color-mix(in srgb,var(--highlight) 18%,transparent)!important}@media(max-width:900px)and (min-width:681px){.sidebar{width:220px}main{margin-left:228px}}@media(max-width:680px){.sidebar{width:100%;position:relative;padding:12px 12px 0;border-bottom:1px solid var(--border)}.sidebar-new{display:none}nav{display:flex;overflow:auto;gap:4px;padding-bottom:10px}.nav-group{display:contents}.nav-group h6{display:none}nav button{flex:0 0 auto;font-size:15px}main{margin:0;background:var(--background)}.content{padding:20px 16px 0}.page-heading h1{font-size:21px}.card{padding:18px}}.stat>.stat-foot{display:grid;gap:3px;justify-content:start}.stat>.stat-head{display:flex}.note:has(>.demo-banner){margin-bottom:16px}.inspection-grid .section-title .subtle-tag{display:none}.page-heading .button-row{gap:8px}select{background-color:var(--card)}:root.dark select{background-color:var(--card)}option,optgroup{background-color:var(--card);color:var(--foreground)}.text-button,.source a{color:var(--link)}nav button.active{color:var(--sidebar-active);box-shadow:inset 2px 0 0 var(--sidebar-active)}nav button.active svg{color:var(--sidebar-active)}.primary,.sidebar-new{box-shadow:var(--glow),var(--shadow)}:root.dark .primary,:root.dark .sidebar-new{font-weight:600}.segmented button.on,.tab-list button.on{color:var(--foreground)}:root.dark .tab-list button.on{background:var(--accent)}:root.dark .stat strong{color:var(--heading)}:root.dark .page-heading h1,:root.dark .section-title h2{color:var(--heading)}:root{--text-strong:var(--heading);--text-body:var(--foreground);--text-hint:var(--muted-fg);--tile-1:var(--primary);--tile-2:var(--ok);--tile-3:var(--bad);--tile-4:var(--warn)}:root:not(.dark){--muted-fg:#404040;--input:#8c8c8c}:root.dark{--muted-fg:#d4d4d4}html{-webkit-text-size-adjust:100%}body{font-size:16px;line-height:1.6;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}p{line-height:1.6}strong,b{font-weight:700}.page-heading h1{font-size:38px;font-weight:750;color:var(--text-strong)}.page-heading>div>p:last-child{font-size:18px;color:var(--text-body);max-width:640px}.section-title h2,.card h2{font-size:23px;font-weight:720;color:var(--text-strong);line-height:1.25}h3{font-size:19px;font-weight:680;color:var(--text-strong);margin:22px 0 10px}.section-title p{font-size:16px;color:var(--text-hint)}.caption{font-size:15px;color:var(--text-hint);line-height:1.6}.note{font-size:16px;color:var(--text-body);padding:14px 16px;border-left:4px solid var(--primary);background:var(--accent)}.eyebrow,.subtle-tag,.badge,.nav-group h6,.workspace-label,footer,.sidebar-foot,.brand span:not(.brand-mark){font-size:14px}.nav-group h6{font-weight:700;letter-spacing:1.2px;color:var(--text-hint)}@media(min-width:901px){.sidebar{width:268px}main{margin-left:268px}}.sidebar nav button{font-size:16px;min-height:44px;padding:9px 12px;border-radius:10px;transition:background .15s,color .15s,transform .15s}.sidebar nav button svg{width:20px;height:20px;flex:0 0 auto}.sidebar nav{overflow-x:hidden;scrollbar-gutter:stable}.sidebar nav button.active{font-weight:700}.sidebar-new{font-size:16px;min-height:46px;font-weight:700}.nav-count{font-size:14px!important;font-weight:700;min-width:26px;padding:2px 8px!important;border-radius:999px!important;background:var(--warn)!important;color:#111827!important;text-align:center}.local-card strong{font-size:15px}.local-card p{font-size:14px;color:var(--text-hint);line-height:1.5}.topbar{display:flex;align-items:center;justify-content:space-between;gap:16px;height:66px}.topbar>div{display:flex;align-items:center;gap:12px}.topbar-title{font-size:18px;font-weight:700;color:var(--text-strong)}.who{display:inline-flex;align-items:center;gap:10px;padding:7px 14px;border:1px solid var(--border);border-radius:999px;background:var(--accent);color:var(--text-body);font-size:15px;line-height:1.2;max-width:min(60vw,440px)}.who>span{display:flex;align-items:center;gap:8px;min-width:0;white-space:nowrap}.who strong{overflow:hidden;text-overflow:ellipsis;color:var(--text-strong)}.who em{font-style:normal;font-size:13px;font-weight:700;letter-spacing:.4px;text-transform:uppercase;padding:3px 9px;border-radius:999px;background:var(--primary);color:var(--primary-fg)}.who svg{color:var(--primary);flex:0 0 auto}.who-out{cursor:pointer;border-style:dashed}.who-out u{color:var(--link);font-weight:700;text-underline-offset:3px}.who-out:hover{border-color:var(--primary)}.theme-toggle{width:44px;height:44px;display:grid;place-items:center;border:1px solid var(--border);border-radius:12px}.theme-toggle svg{width:20px;height:20px}button.primary,button.secondary,a.primary,a.secondary,.text-button{font-size:15.5px}button.primary,button.secondary,a.primary,a.secondary{min-height:44px;padding:0 18px;border-radius:12px;font-weight:650;transition:transform .12s,box-shadow .15s,background .15s,border-color .15s}button.primary:not(:disabled):hover,a.primary:hover{transform:translateY(-1px);box-shadow:0 6px 16px var(--ring-soft)}button.secondary:not(:disabled):hover{border-color:var(--primary)}button.primary:not(:disabled):active,button.secondary:not(:disabled):active{transform:translateY(0)}.text-button{font-weight:650;color:var(--link);padding:6px 4px;text-underline-offset:3px}.text-button:hover{text-decoration:underline}label.field,.field{font-size:15px;font-weight:600;color:var(--text-strong)}input,select,textarea{font-size:16px;min-height:44px;color:var(--text-body)}textarea{min-height:110px;line-height:1.5}select option{font-size:15px}table{font-size:15.5px}th{font-size:14px;font-weight:700;letter-spacing:.6px;text-transform:uppercase;color:var(--text-hint);padding:12px 14px}td{padding:14px;color:var(--text-body)}tbody tr{transition:background .12s}tbody tr:hover{background:var(--accent)}.quick-steps{list-style:none;margin:0 0 24px;padding:0;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}.quick-steps button{width:100%;display:flex;align-items:center;gap:16px;text-align:left;padding:18px 20px;border:1px solid var(--border);border-radius:16px;background:var(--card);color:var(--text-body);box-shadow:var(--shadow);transition:transform .15s,border-color .15s,box-shadow .15s}.quick-steps button:hover{transform:translateY(-3px);border-color:var(--primary);box-shadow:var(--shadow-lg)}.quick-steps b{flex:0 0 auto;display:grid;place-items:center;width:46px;height:46px;border-radius:50%;background:var(--primary);color:var(--primary-fg);font-size:20px}.quick-steps span{display:flex;flex-direction:column;gap:2px;min-width:0;flex:1}.quick-steps strong{font-size:18px;color:var(--text-strong);line-height:1.25}.quick-steps small{font-size:15px;color:var(--text-hint)}.quick-steps svg{flex:0 0 auto;color:var(--primary);transition:transform .15s}.quick-steps button:hover svg{transform:translate(4px)}.stats-grid .card{border-top:5px solid var(--tile-1);transition:transform .15s,box-shadow .15s}.stats-grid .card:nth-child(2){border-top-color:var(--tile-2)}.stats-grid .card:nth-child(3){border-top-color:var(--tile-3)}.stats-grid .card:nth-child(4){border-top-color:var(--tile-4)}.stats-grid .card:hover{transform:translateY(-3px);box-shadow:var(--shadow-lg)}.stat-head{font-size:16px;color:var(--text-body)}.stat>strong{font-size:41px;line-height:1.1;color:var(--text-strong)}.stat-foot b{font-size:17px;color:var(--text-strong)}.stat-foot small{font-size:15px;color:var(--text-hint)}.stat-trend{font-size:14px;font-weight:700;padding:3px 10px}.alert-head{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;flex-wrap:wrap}.count-pill{display:inline-flex;align-items:center;min-height:46px;padding:0 16px;border-radius:999px;font-size:15px;font-weight:700;border:1px solid var(--border)}.count-pill.warn{background:var(--warn-bg);color:var(--warn);border-color:var(--warn-border)}.count-pill.ok{background:var(--ok-bg);color:var(--ok);border-color:var(--ok-border)}.alert-row{padding:18px 14px;margin:0 -14px;border-radius:12px;border-left:5px solid var(--warn);transition:background .15s}.alert-row:hover{background:var(--accent)}.alert-row.seen{border-left-color:transparent;opacity:.78}.alert-row strong{font-size:17px}.alert-row p{font-size:15px}.alert-thumb{width:72px;height:72px;border-radius:12px;object-fit:cover}.case-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin:6px 0 10px}.case-stats>div{display:flex;flex-direction:column;gap:2px;padding:14px 16px;border:1px solid var(--border);border-radius:14px;background:var(--muted)}.case-stats b{font-size:32px;line-height:1.1;color:var(--text-strong)}.case-stats span{font-size:15px;color:var(--text-hint)}.case-stats .late{background:var(--bad-bg);border-color:var(--bad-border)}.case-stats .late b{color:var(--bad)}.stepper{list-style:none;margin:6px 0 14px;padding:0;display:flex;flex-wrap:wrap;gap:10px}.stepper li{display:flex;align-items:center;gap:10px;padding:8px 16px 8px 8px;border:1px solid var(--border);border-radius:999px;font-size:15.5px;font-weight:600;color:var(--text-hint);background:var(--card)}.stepper li b{display:grid;place-items:center;width:30px;height:30px;border-radius:50%;background:var(--muted);color:var(--text-strong);font-size:14px}.stepper li.now{border-color:var(--primary);color:var(--text-strong);background:var(--accent);box-shadow:0 0 0 3px var(--ring-soft)}.stepper li.now b{background:var(--primary);color:var(--primary-fg)}.stepper li.done{color:var(--ok)}.stepper li.done b{background:var(--ok);color:#fff}.case-step{font-size:16px;border-left:5px solid var(--primary)}.case-step.ready{border-left-color:var(--ok)}.case-step strong{font-size:18px}.case-workspace .consent-check{font-size:16px;padding:14px 16px;border:1px solid var(--border);border-radius:12px;background:var(--muted)}.case-workspace .consent-check input{width:22px;height:22px;min-height:0}.case-workspace .consent-check small{font-size:14px;margin-top:2px}.case-state{display:inline-block;padding:4px 12px;border-radius:999px;font-size:14.5px;font-weight:700;border:1px solid var(--border);background:var(--muted);color:var(--text-strong);margin-right:6px}.case-state.open,.case-state.assigned{background:var(--info-bg);color:var(--info)}.case-state.in-progress{background:var(--warn-bg);color:var(--warn);border-color:var(--warn-border)}.case-state.resolved,.case-state.closed{background:var(--ok-bg);color:var(--ok);border-color:var(--ok-border)}.case-state.cancelled{opacity:.8}.case-state.overdue{background:var(--bad-bg);color:var(--bad);border-color:var(--bad-border)}.due-field legend{font-size:16px;font-weight:700;color:var(--text-strong)}.chip{font-size:15px;min-height:42px;padding:0 16px}.due-summary{font-size:15px}.shared-images img{display:block;max-width:100%;height:auto;background:var(--muted);border-radius:12px}@media(max-width:900px){.quick-steps{grid-template-columns:1fr}.case-stats{grid-template-columns:repeat(2,minmax(0,1fr))}.topbar{height:auto;min-height:64px;padding-top:8px;padding-bottom:8px;flex-wrap:wrap}.page-heading h1{font-size:30px}.who{max-width:100%}}@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}}.case-workspace .login-form{max-width:680px}.case-workspace .cloud-message{line-height:1.7}.case-workspace .cloud-message p{margin:0 0 6px}.who strong{min-width:0}.who em{flex:0 0 auto}@media(max-width:900px){.topbar>div{width:100%;justify-content:space-between}.who{flex:1 1 auto;min-width:0;max-width:none}.who>span{flex:1 1 auto;min-width:0}.theme-toggle{flex:0 0 auto}}@media(max-width:520px){.who em{display:none}.who{padding:8px 12px;font-size:14px}}.text-size{display:inline-flex;border:1px solid var(--border);border-radius:12px;overflow:hidden}.text-size button{min-width:46px;height:44px;font-size:18px;font-weight:700;color:var(--text-strong);display:inline-flex;align-items:baseline;justify-content:center;padding:10px 8px 0;transition:background .15s}.text-size button+button{border-left:1px solid var(--border)}.text-size button:not(:disabled):hover{background:var(--accent)}.text-size small{font-size:13px;margin-left:1px}.menu-toggle{display:none}@media(max-width:680px){.sidebar{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;column-gap:12px;position:sticky;top:0;z-index:40;padding:10px 16px;height:auto;border-bottom:1px solid var(--border)}.sidebar .brand{margin:0;padding:4px 0;width:auto}.menu-toggle{display:inline-flex;align-items:center;gap:8px;min-height:44px;padding:0 14px;border:1px solid var(--border);border-radius:12px;background:var(--card);color:var(--text-strong);font-weight:700;font-size:16px}.menu-toggle .nav-count{margin-left:2px}.sidebar nav{grid-column:1/-1;display:none;padding:0}.sidebar nav.open{display:block;max-height:calc(100dvh - 76px);overflow:auto;padding:6px 0 14px;animation:menu-in .18s ease-out}.sidebar nav.open .nav-group{display:block}.sidebar nav.open .nav-group h6{display:block;margin:14px 6px 6px}.sidebar nav.open button{width:100%;justify-content:flex-start;font-size:17px;min-height:48px}}@keyframes menu-in{0%{opacity:0;transform:translateY(-6px)}to{opacity:1;transform:none}}@media(max-width:900px),(pointer:coarse){.icon-button{width:40px;height:40px}.segmented button,.tab-list button{min-height:40px}.text-button{min-height:40px;display:inline-flex;align-items:center;gap:6px}.success .icon-button,.error>button{width:40px;height:40px}.who-out{flex:0 1 auto}}@media(max-width:680px){.table-wrap:has(>table.stackable){border:0;overflow:visible}table.stackable,table.stackable tbody{display:block;width:100%}table.stackable thead{display:none}table.stackable tr{display:block;padding:12px 14px;margin-bottom:12px;border:1px solid var(--border);border-radius:14px;background:var(--card);box-shadow:var(--shadow)}table.stackable td{display:flex;flex-wrap:wrap;align-items:center;column-gap:10px;row-gap:2px;padding:5px 0;border:0;font-size:15.5px;min-width:0}table.stackable td:before{content:attr(data-label);flex:0 0 112px;color:var(--text-hint);font-size:14px;font-weight:600}table.stackable td small{flex-basis:100%;padding-left:122px;color:var(--text-hint)}table.stackable td.row-action{justify-content:flex-end;padding-top:8px}table.stackable td.row-action:before{content:none}table.stackable td.row-action .text-button,table.stackable td.row-action .secondary{min-height:44px}}@media(max-width:680px){.filters{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;align-items:center}.filters select{max-width:none;width:100%;min-width:0}.filters>svg{display:none}.filters .text-button{justify-self:start}.filters>span{grid-column:1/-1;margin:0}}@media(max-width:680px){.alert-row{display:grid;grid-template-columns:64px minmax(0,1fr) minmax(0,1fr);gap:12px;align-items:start}.alert-row>img,.alert-row>svg{grid-column:1;grid-row:1}.alert-row>div{grid-column:2/-1;grid-row:1;min-width:0}.alert-row>.badge{display:none}.alert-row>button:nth-of-type(1){grid-column:1/3}.alert-row>button:nth-of-type(2){grid-column:3}.alert-thumb{width:64px;height:64px}}.viewer-label{background:#0f172ad1;color:#fff;font-weight:700}.viewer-stage.movable{cursor:grab}.viewer-stage.movable:active{cursor:grabbing}.viewer-stage.movable .viewer-image-wrap{transition:none}.viewer-stage img{-webkit-user-select:none;user-select:none;-webkit-user-drag:none}.zoom-level{min-width:58px;min-height:36px;padding:4px 6px;border-radius:8px;font-size:14px;font-weight:700;color:var(--text-body)}.zoom-level:not(:disabled):hover{background:var(--accent)}.zoom-level:disabled{cursor:default;opacity:1}.review-fields{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:12px 16px;padding:14px;margin-bottom:12px;border-radius:12px;background:var(--muted)}.review-fields .field{display:flex;flex-direction:column;gap:6px;margin:0}.review-fields .field select{margin:0;width:100%}.decision-key{list-style:none;display:flex;flex-wrap:wrap;gap:8px 18px;padding:0;margin:6px 0 14px;font-size:15px;color:var(--text-hint)}.decision-key b{display:inline-block;margin-right:6px;padding:2px 10px;border-radius:999px;font-size:14px}.decision-key .ok{background:var(--ok-bg);color:var(--ok)}.decision-key .warn{background:var(--warn-bg);color:var(--warn)}.decision-key .bad{background:var(--bad-bg);color:var(--bad)}.case-workspace .section-title h3{margin:0}.case-filter .count{margin-left:4px;font-size:13px;opacity:.85}.priority{font-weight:700}.priority.high{color:var(--warn)}.priority.critical{color:var(--bad)}tr.selected-row{background:var(--accent)}.support-box{margin-top:10px;padding:16px 18px;border:1px solid var(--border);border-radius:14px;background:var(--muted)}.support-box h3{margin-top:0}.fix-list{margin:6px 0 12px;padding-left:20px;line-height:1.7}.fix-list li+li{margin-top:4px}.fix-list em{font-style:normal;font-weight:700}.crash-card{border-left:5px solid var(--bad)}.crash-icon{width:52px;height:52px;border-radius:14px;display:grid;place-items:center;background:var(--bad-bg);color:var(--bad);margin-bottom:12px}.build-tag{font-family:Geist Mono Variable,ui-monospace,monospace;opacity:.75}.subtle-tag{white-space:nowrap}@media(max-width:900px),(pointer:coarse){.who,.sidebar .brand{min-height:44px}}.row-open-label{display:none}@media(max-width:680px){.topbar .topbar-title,.section-title .subtle-tag{display:none}table.stackable td.row-action .icon-button{width:auto;padding:0 16px;gap:6px;display:inline-flex;align-items:center;min-height:44px;font-weight:650}table.stackable td.row-action .row-open-label{display:inline}}.who-out u{white-space:nowrap}@media(max-width:520px){.who-out>span{display:none}}.text-size,.theme-toggle{flex:0 0 auto}.content,.card,.stats-grid .card{animation:none!important}.scan-visual,.scan-corner:after{animation:none!important}.scan-visual{transform:none}.primary:hover,.sample:hover,.sample:hover img{transform:none!important}.stat:after{background:var(--muted)!important}:root:not(.dark) .nav-count{color:#fff!important}:root.dark .hero-card{background:var(--card);border:1px solid var(--border);box-shadow:none}:root.dark .hero-card h2{color:var(--heading)}:root.dark .hero-card p{color:var(--muted-fg)}:root.dark .hero-card .pill{background:var(--muted);color:var(--foreground);border-color:var(--border)}:root.dark .scan-visual>span,:root.dark .viewer-label{color:var(--foreground)}.stats-grid.plain .card,.stats-grid.plain .card:nth-child(n){border-top:5px solid var(--border)}.references{margin-top:22px}.references h3{margin:0 0 6px}.reference-row{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:12px 0}.reference-row figure{margin:0}.reference-row img{display:block;width:100%;aspect-ratio:4/3;object-fit:cover;background:var(--muted);border:1px solid var(--border);border-radius:8px}.reference-row figcaption{margin-top:6px;font-size:14px;color:var(--text-hint)}.showcase-banner{flex-wrap:wrap;align-items:center}.showcase-banner>div{flex:1 1 320px}.showcase-live{display:inline-flex;align-items:center;gap:8px;padding:11px 16px;border-radius:10px;background:var(--primary);color:var(--primary-fg);font-weight:600;font-size:15px;text-decoration:none;white-space:nowrap}.showcase-live:hover,.showcase-live:focus-visible{opacity:.88}.showcase-live svg{margin:0} diff --git a/frontend/dist/assets/index-CjyYKbWk.js b/frontend/dist/assets/index-CjyYKbWk.js new file mode 100644 index 0000000000000000000000000000000000000000..19aabeb20e124be603c1c46c0a5c9a9cccdc9c93 --- /dev/null +++ b/frontend/dist/assets/index-CjyYKbWk.js @@ -0,0 +1,277 @@ +var zb=Object.defineProperty;var Wp=i=>{throw TypeError(i)};var kb=(i,s,u)=>s in i?zb(i,s,{enumerable:!0,configurable:!0,writable:!0,value:u}):i[s]=u;var pe=(i,s,u)=>kb(i,typeof s!="symbol"?s+"":s,u),eg=(i,s,u)=>s.has(i)||Wp("Cannot "+u);var rc=(i,s,u)=>(eg(i,s,"read from private field"),u?u.call(i):s.get(i)),tg=(i,s,u)=>s.has(i)?Wp("Cannot add the same private member more than once"):s instanceof WeakSet?s.add(i):s.set(i,u),ag=(i,s,u,o)=>(eg(i,s,"write to private field"),o?o.call(i,u):s.set(i,u),u);(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))o(d);new MutationObserver(d=>{for(const m of d)if(m.type==="childList")for(const p of m.addedNodes)p.tagName==="LINK"&&p.rel==="modulepreload"&&o(p)}).observe(document,{childList:!0,subtree:!0});function u(d){const m={};return d.integrity&&(m.integrity=d.integrity),d.referrerPolicy&&(m.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?m.credentials="include":d.crossOrigin==="anonymous"?m.credentials="omit":m.credentials="same-origin",m}function o(d){if(d.ep)return;d.ep=!0;const m=u(d);fetch(d.href,m)}})();const Db="modulepreload",Mb=function(i,s){return new URL(i,s).href},ng={},br=function(s,u,o){let d=Promise.resolve();if(u&&u.length>0){let p=function(g){return Promise.all(g.map(y=>Promise.resolve(y).then(R=>({status:"fulfilled",value:R}),R=>({status:"rejected",reason:R}))))};const v=document.getElementsByTagName("link"),_=document.querySelector("meta[property=csp-nonce]"),O=(_==null?void 0:_.nonce)||(_==null?void 0:_.getAttribute("nonce"));d=p(u.map(g=>{if(g=Mb(g,o),g in ng)return;ng[g]=!0;const y=g.endsWith(".css"),R=y?'[rel="stylesheet"]':"";if(!!o)for(let j=v.length-1;j>=0;j--){const L=v[j];if(L.href===g&&(!y||L.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${g}"]${R}`))return;const x=document.createElement("link");if(x.rel=y?"stylesheet":Db,y||(x.as="script"),x.crossOrigin="",x.href=g,O&&x.setAttribute("nonce",O),document.head.appendChild(x),y)return new Promise((j,L)=>{x.addEventListener("load",j),x.addEventListener("error",()=>L(new Error(`Unable to preload CSS for ${g}`)))})}))}function m(p){const v=new Event("vite:preloadError",{cancelable:!0});if(v.payload=p,window.dispatchEvent(v),!v.defaultPrevented)throw p}return d.then(p=>{for(const v of p||[])v.status==="rejected"&&m(v.reason);return s().catch(m)})};var Ub="host",sy="queue/data",xb="queue/join",lg="upload",Hb="login",ig="config",qb="info",Bb="runtime",Lb="sleeptime",jb="heartbeat",Gb="component_server",Yb="reset",Vb="cancel",Xb="app_id",oy="This application is currently busy. Please try again. ",Ol="Connection errored out. ",gn="Could not resolve app config. ",Qb="Could not get space status. ",cg="Could not get API info. ",pr="Space metadata could not be loaded. ",Zb="Invalid URL. A full URL path is required.",Kb="Not authorized to access this space. ",uy="Invalid credentials. Could not login. ",Jb="Could not access this app (received a 401 response). If it is a private Hugging Face Space, pass a valid Hugging Face token to the `token` option of `Client.connect`. You can generate a token at https://huggingface.co/settings/tokens.",$b=(i,s)=>`Space "${i}" could not be accessed (received a ${s} response from the Hugging Face API). Check that the Space name is spelled correctly and that the Space exists. If the Space is private, pass a valid Hugging Face token to the \`token\` option of \`Client.connect\`. You can generate a token at https://huggingface.co/settings/tokens.`,Ib="No API information is available for this app. This can happen when the app's `/info` endpoint cannot be reached, or when the app is running a legacy version of Gradio that is not supported by this client. ",Fb="This app appears to be running a legacy version of Gradio (3.x or earlier) that communicates over WebSockets, which is not supported by this version of @gradio/client. Please upgrade the app to a newer version of Gradio, or connect to it with @gradio/client version 0.x.",Pb="File system access is only available in Node.js environments",fy="Root URL not found in client config",Wb="Error uploading file";async function eE(i,s,u){try{return(await(await fetch(`https://huggingface.co/api/spaces/${i}/jwt`,{headers:{Authorization:`Bearer ${s}`,...u?{Cookie:u}:{}}})).json()).token||!1}catch{return!1}}function dy(i){i.hf_token&&!i.token&&(i.token=i.hf_token,console.warn("The `hf_token` option has been renamed to `token`. Support for `hf_token` will be removed in a future version of @gradio/client."))}function rg(i){let s={};return i.forEach(({api_name:u,id:o})=>{u&&(s[u]=o)}),s}function tE(i,s,u=!1){const o=new URL(s),d=new URL(i,o),m=d.hostname.endsWith(".colab-user-runtimes.internal")||d.hostname.endsWith(".codatalab-user-runtimes.internal");return u||m?new URL(new URL(i,o).pathname,o).toString().replace(/\/$/,""):d.hostname!==o.hostname?i:(d.protocol=o.protocol,d.host=o.host,d.toString().replace(/\/$/,""))}async function aE(i,s=!0){const u=this.options.token?{Authorization:`Bearer ${this.options.token}`}:{};if(typeof window<"u"&&window.gradio_config&&location.origin!=="http://localhost:9876"){if(s&&window.gradio_config.current_page&&(i=i.substring(0,i.lastIndexOf("/"))),window.gradio_config.dev_mode||typeof window<"u"&&(window==null?void 0:window.BUILD_MODE)==="dev"){let d=new URL(Hf(i,ig));this.deep_link&&d.searchParams.set("deep_link",this.deep_link),this.page!==null&&d.searchParams.set("page",this.page);const m=await sg(await this.fetch(d,{headers:u,credentials:this.options.credentials??"same-origin"}),!!this.options.auth);m.root=i||m.root,window.gradio_config={...m,current_page:window.gradio_config.current_page}}const o={...window.gradio_config};return o.root=tE(o.root,location.href,o.is_colab),o}else if(i){let o=new URL(Hf(i,ig));this.deep_link&&o.searchParams.set("deep_link",this.deep_link),this.page!==null&&o.searchParams.set("page",this.page);const d=await sg(await this.fetch(o,{headers:u,credentials:this.options.credentials??"same-origin"}),!!this.options.auth);return d.root||(d.root=i),d}throw new Error(gn)}async function sg(i,s){var u,o;if((i==null?void 0:i.status)===401&&!s){let d=null;try{d=await i.json()}catch{throw new Error(Jb)}const m=(u=d==null?void 0:d.detail)==null?void 0:u.auth_message;throw new Error(m||"Login credentials are required to access this space.")}else if((i==null?void 0:i.status)===401&&s)throw new Error(uy);if((i==null?void 0:i.status)===200){let d=await i.json();return(o=d.dependencies)==null||o.forEach((m,p)=>{m.id===void 0&&(m.id=p)}),d}else if((i==null?void 0:i.status)===401)throw new Error(Kb);throw new Error(`${gn}(received status ${i==null?void 0:i.status} when fetching the app config)`)}async function nE(){const{http_protocol:i,host:s}=await Kf(this.app_reference,this.options.token);try{if(this.options.auth){const u=await my(i,s,this.options.auth,this.fetch,this.options.token,this.options.credentials);u&&this.set_cookies(u)}}catch(u){throw Error(u.message)}}async function my(i,s,u,o,d,m){const p=new FormData;p.append("username",u==null?void 0:u[0]),p.append("password",u==null?void 0:u[1]);let v={};d&&(v.Authorization=`Bearer ${d}`);const _=await o(`${i}//${s}/${Hb}`,{headers:v,method:"POST",body:p,credentials:m??"same-origin"});if(_.status===200)return _.headers.get("set-cookie");throw _.status===401?new Error(uy):new Error(pr)}function _f(i){if(i.startsWith("http")){const{protocol:s,host:u,pathname:o}=new URL(i);return{ws_protocol:s==="https:"?"wss":"ws",http_protocol:s,host:u+(o!=="/"?o:"")}}return{ws_protocol:"wss",http_protocol:"https:",host:new URL(i).host}}var hy=i=>{let s=[];return i.split(/,(?=\s*[^\s=;]+=[^\s=;]+)/).forEach(u=>{const[o,d]=u.split(";")[0].split("=");o&&d&&s.push(`${o.trim()}=${d.trim()}`)}),s},Zf=/^[a-zA-Z0-9_\-\.]+\/[a-zA-Z0-9_\-\.]+$/,lE=/.*hf\.space\/{0,1}.*$/;async function Kf(i,s){const u={};s&&(u.Authorization=`Bearer ${s}`);const o=i.trim().replace(/\/$/,"");if(Zf.test(o)){let d;try{d=await fetch(`https://huggingface.co/api/spaces/${o}/${Ub}`,{headers:u})}catch{throw new Error(pr)}if(d.status===401||d.status===404)throw new Error($b(o,d.status));let m;try{m=(await d.json()).host}catch{throw new Error(pr)}if(!m)throw new Error(pr);return{space_id:o,..._f(m)}}if(lE.test(o)){const{ws_protocol:d,http_protocol:m,host:p}=_f(o);return{space_id:p.split("/")[0].replace(".hf.space",""),ws_protocol:d,http_protocol:m,host:p}}return{space_id:!1,..._f(o)}}var Hf=(...i)=>{try{return i.reduce((s,u)=>(s=s.replace(/\/+$/,""),u=u.replace(/^\/+/,""),new URL(u,s+"/").toString()))}catch{throw new Error(Zb)}};function iE(i,s,u){const o={named_endpoints:{},unnamed_endpoints:{}};return Object.keys(i).forEach(d=>{(d==="named_endpoints"||d==="unnamed_endpoints")&&(o[d]={},Object.entries(i[d]).forEach(([m,p])=>{var Y;const v=(p==null?void 0:p.parameters)??[],_=(p==null?void 0:p.returns)??[],O=((Y=s.dependencies.find(x=>x.api_name===m||x.api_name===m.replace("/","")))==null?void 0:Y.id)||u[m.replace("/","")]||-1,g=O!==-1?s.dependencies.find(x=>x.id==O):void 0,y=O!==-1?g==null?void 0:g.types:{generator:!1,cancel:!1};if(g&&Array.isArray(g.inputs)&&g.inputs.length!==v.length){const x=g.inputs.map(j=>{var L;return(L=s.components.find(le=>le.id===j))==null?void 0:L.type});try{x.forEach((j,L)=>{j==="state"&&v.splice(L,0,{component:"state",example:null,parameter_default:null,parameter_has_default:!0,parameter_name:null,hidden:!0})})}catch(j){console.error(j)}}const R=(x,j,L,le)=>({...x,description:rE(x==null?void 0:x.type,L),type:cE(x==null?void 0:x.type,j,L,le)||""});o[d][m]={parameters:v.map(x=>R(x,x==null?void 0:x.component,x==null?void 0:x.serializer,"parameter")),returns:_.map(x=>R(x,x==null?void 0:x.component,x==null?void 0:x.serializer,"return")),type:y,...p!=null&&p.oauth_token?{oauth_token:p.oauth_token}:{}}}))}),o}function cE(i,s,u,o){if(s==="Api")return i.type;switch(i==null?void 0:i.type){case"string":return"string";case"boolean":return"boolean";case"number":return"number"}if(u==="JSONSerializable"||u==="StringSerializable")return"any";if(u==="ListStringSerializable")return"string[]";if(s==="Image")return o==="parameter"?"Blob | File | Buffer":"string";if(u==="FileSerializable")return(i==null?void 0:i.type)==="array"?o==="parameter"?"(Blob | File | Buffer)[]":"{ name: string; data: string; size?: number; is_file?: boolean; orig_name?: string}[]":o==="parameter"?"Blob | File | Buffer":"{ name: string; data: string; size?: number; is_file?: boolean; orig_name?: string}";if(u==="GallerySerializable")return o==="parameter"?"[(Blob | File | Buffer), (string | null)][]":"[{ name: string; data: string; size?: number; is_file?: boolean; orig_name?: string}, (string | null))][]"}function rE(i,s){return s==="GallerySerializable"?"array of [file, label] tuples":s==="ListStringSerializable"?"array of strings":s==="FileSerializable"?"array of files or single file":i==null?void 0:i.description}function og(i,s){switch(i.msg){case"send_data":return{type:"data"};case"send_hash":return{type:"hash"};case"queue_full":return{type:"update",status:{queue:!0,message:oy,stage:"error",code:i.code,success:i.success}};case"heartbeat":return{type:"heartbeat"};case"unexpected_error":return{type:"unexpected_error",status:{queue:!0,message:i.message,session_not_found:i.session_not_found,stage:"error",success:!1}};case"broken_connection":return{type:"broken_connection",status:{queue:!0,message:i.message,stage:"error",success:!1}};case"estimation":return{type:"update",status:{queue:!0,stage:s||"pending",code:i.code,size:i.queue_size,position:i.rank,eta:i.rank_eta,success:i.success}};case"progress":return{type:"update",status:{queue:!0,stage:"pending",code:i.code,progress_data:i.progress_data,success:i.success}};case"log":return{type:"log",data:i};case"process_generating":return{type:"generating",status:{queue:!0,message:i.success?null:i.output.error,stage:i.success?"generating":"error",code:i.code,progress_data:i.progress_data,eta:i.average_duration,changed_state_ids:i.success?i.output.changed_state_ids:void 0},data:i.success?i.output:null};case"process_streaming":return{type:"streaming",status:{queue:!0,message:i.output.error,stage:"streaming",time_limit:i.time_limit,code:i.code,progress_data:i.progress_data,changed_state_ids:i.output.changed_state_ids,eta:i.eta},data:i.output};case"process_completed":return"error"in i.output?{type:"update",status:{queue:!0,title:i.output.title??"Error",message:i.output.error??"An error occurred",visible:i.output.visible,duration:i.output.duration,stage:"error",code:i.code,success:i.success}}:{type:"complete",status:{queue:!0,message:i.success?void 0:i.output.error,stage:i.success?"complete":"error",code:i.code,progress_data:i.progress_data,changed_state_ids:i.success?i.output.changed_state_ids:void 0,used_cache:i.used_cache,cache_duration:i.cache_duration,avg_time:i.avg_time},data:i.success?i.output:null};case"process_starts":return{type:"update",status:{queue:!0,stage:"pending",code:i.code,size:i.rank,position:0,success:i.success,eta:i.eta},original_msg:"process_starts"}}return{type:"none",status:{stage:"error",queue:!0}}}var sE=(i=[],s)=>{const u=s?s.parameters:[];if(Array.isArray(i))return s&&u.length>0&&i.length>u.length&&console.warn("Too many arguments provided for the endpoint."),i;const o=[],d=Object.keys(i);return u.forEach((m,p)=>{if(i.hasOwnProperty(m.parameter_name))o[p]=i[m.parameter_name];else if(m.parameter_has_default)o[p]=m.parameter_default;else throw new Error(`No value provided for required parameter: ${m.parameter_name}`)}),d.forEach(m=>{if(!u.some(p=>p.parameter_name===m))throw new Error(`Parameter \`${m}\` is not a valid keyword argument. Please refer to the API for usage.`)}),o.forEach((m,p)=>{if(m===void 0&&!u[p].parameter_has_default)throw new Error(`No value provided for required parameter: ${u[p].parameter_name}`)}),o};async function oE(){if(this.api_info)return this.api_info;const{token:i}=this.options,{config:s}=this,u={};if(i&&(u.Authorization=`Bearer ${i}`),!!s)try{let o,d;if(typeof window<"u"&&window.gradio_api_info)d=window.gradio_api_info;else{const m=new URL(Hf(s.root,this.api_prefix,qb));if(this.page!==null&&m.searchParams.set("page",this.page),o=await this.fetch(m,{headers:u,credentials:this.options.credentials??"same-origin"}),!o.ok)throw new Error(Ol);d=await o.json()}return"api"in d&&(d=d.api),d.named_endpoints["/predict"]&&!d.unnamed_endpoints[0]&&(d.unnamed_endpoints[0]=d.named_endpoints["/predict"]),iE(d,s,this.api_map)}catch(o){throw new Error("Could not get API info. "+o.message)}}async function uE(i,s,u){var v;const o={};(v=this==null?void 0:this.options)!=null&&v.token&&(o.Authorization=`Bearer ${this.options.token}`);const d=1e3,m=[];let p;for(let _=0;_{g.append("files",R)});try{const R=u?`${i}${this.api_prefix}/${lg}?upload_id=${u}`:`${i}${this.api_prefix}/${lg}`;p=await this.fetch(R,{method:"POST",body:g,headers:o,credentials:this.options.credentials??"same-origin"})}catch(R){throw new Error(Ol+R.message)}if(!p.ok){const R=await p.text();return{error:`HTTP ${p.status}: ${R}`}}const y=await p.json();y&&m.push(...y)}return{files:m}}var ug={si:{radix:1e3,unit:["b","kb","Mb","Gb","Tb","Pb","Eb","Zb","Yb"]},iec:{radix:1024,unit:["b","Kib","Mib","Gib","Tib","Pib","Eib","Zib","Yib"]},jedec:{radix:1024,unit:["b","Kb","Mb","Gb","Tb","Pb","Eb","Zb","Yb"]}};function fE(i,s=1,u="jedec"){i=Math.abs(i);const{radix:o,unit:d}=ug[u]||ug.jedec;let m=0;for(;i>=o;)i/=o,++m;return`${i.toFixed(s)} ${d[m]}`}async function dE(i,s,u,o){let d=(Array.isArray(i)?i:[i]).map(p=>p.blob);const m=d.filter(p=>p.size>(o??1/0));if(m.length)throw new Error(`File(s) exceed the maximum allowed size of ${fE(o||1/0)}: ${m.map(p=>`"${p.name}"`).join(", ")}`);return await Promise.all(await this.upload_files(s,d,u).then(async p=>{if(p.error)throw new Error(p.error);return p.files?p.files.map((v,_)=>{const O=v.split("/").map(g=>encodeURIComponent(g)).join("/");return new Jf({...i[_],path:v,url:`${s}${this.api_prefix}/file=${O}`})}):[]}))}var Jf=class{constructor({path:i,url:s,orig_name:u,size:o,blob:d,is_stream:m,mime_type:p,alt_text:v,b64:_}){pe(this,"path");pe(this,"url");pe(this,"orig_name");pe(this,"size");pe(this,"blob");pe(this,"is_stream");pe(this,"mime_type");pe(this,"alt_text");pe(this,"b64");pe(this,"meta",{_type:"gradio.FileData"});this.path=i,this.url=s,this.orig_name=u,this.size=o,this.blob=s?void 0:d,this.is_stream=m,this.mime_type=p,this.alt_text=v,this.b64=_}},mE=class{constructor(i,s){pe(this,"type");pe(this,"command");pe(this,"meta");pe(this,"fileData");this.type="command",this.command=i,this.meta=s}};typeof process<"u"&&process.versions&&process.versions.node;function fg(i,s,u){for(;u.length>1;){const d=u.shift();if(typeof d=="string"||typeof d=="number")i=i[d];else throw new Error("Invalid key type")}const o=u.shift();if(typeof o=="string"||typeof o=="number")i[o]=s;else throw new Error("Invalid key type")}async function qf(i,s=void 0,u=[],o=!1,d=void 0){if(Array.isArray(i)){let m=[];return await Promise.all(i.map(async(p,v)=>{var g;let _=u.slice();_.push(String(v));const O=await qf(i[v],o?((g=d==null?void 0:d.parameters[v])==null?void 0:g.component)||void 0:s,_,!1,d);m=m.concat(O)})),m}else{if(globalThis.Buffer&&i instanceof globalThis.Buffer||i instanceof Blob)return[{path:u,blob:i instanceof Blob?i:new Blob([i]),type:s}];if(typeof i=="object"&&i!==null){let m=[];for(const p of Object.keys(i)){const v=[...u,p],_=i[p];m=m.concat(await qf(_,void 0,v,!1,d))}return m}}return[]}function dg(i,s){var o,d;let u=(d=(o=s==null?void 0:s.dependencies)==null?void 0:o.find(m=>m.id==i))==null?void 0:d.queue;return u!=null?!u:!s.enable_queue}function hE(i,s){return new Promise((u,o)=>{const d=new MessageChannel;d.port1.onmessage=(({data:m})=>{d.port1.close(),u(m)}),window.parent.postMessage(i,s,[d.port2])})}function ur(i,s,u,o,d=!1){var _;if(o==="input"&&!d)throw new Error("Invalid code path. Cannot skip state inputs for input.");if(o==="output"&&d)return i;let m=[],p=0;const v=o==="input"?s.inputs:s.outputs;for(let O=0;Oy.id===g))==null?void 0:_.type)==="state"){if(d)if(i.length===v.length){const y=i[p];m.push(y),p++}else m.push(null);else{p++;continue}continue}else{const y=i[p];m.push(y),p++}}return m}var pE=["/file=","/file/","/stream/","/proxy="];function $f(i,s,u,o){if(!o||i===null||typeof i!="object")return;const d=o,m=new URL(s),p=m.pathname.replace(/\/+$/,""),v=u?`/${u.replace(/^\/+|\/+$/g,"")}`:"",_=new Set([`${p}${v}`,v]);v||(_.add(`${p}/gradio_api`),_.add("/gradio_api"));function O(g){var R;if(g===null||typeof g!="object")return;const y=g;if(((R=y.meta)==null?void 0:R._type)==="gradio.FileData"&&typeof y.url=="string"){const Y=new URL(y.url,`${m.toString().replace(/\/$/,"")}/`),x=[..._].some(j=>pE.some(L=>Y.pathname.startsWith(`${j}${L}`)));(Y.protocol==="http:"||Y.protocol==="https:")&&Y.origin===m.origin&&x&&(Y.searchParams.set("__sign",d),y.url=Y.toString())}for(const Y of Object.values(y))O(Y)}O(i)}function mg(i,s){var u;for(const o of i.components||[])$f((u=o.props)==null?void 0:u.value,i.root,i.api_prefix||"",s)}async function gE(i,s,u){const o=this;await yE(o,s);const d=await qf(s,void 0,[],!0,u);return(await Promise.all(d.map(async({path:m,blob:p,type:v})=>{if(!p)return{path:m,type:v};const _=await o.upload_files(i,[p]);return{path:m,file_url:_.files&&_.files[0],type:v,name:typeof File<"u"&&p instanceof File?p==null?void 0:p.name:void 0}}))).forEach(({path:m,file_url:p,type:v,name:_})=>{v==="Gallery"?fg(s,p,m):p&&fg(s,new Jf({path:p,orig_name:_}),m)}),s}async function yE(i,s){var u,o;if(!((u=i.config)!=null&&u.root||(o=i.config)!=null&&o.root_url))throw new Error(fy);await py(i,s)}async function py(i,s,u=[]){for(const o in s)s[o]instanceof mE?await vE(i,s,o):typeof s[o]=="object"&&s[o]!==null&&await py(i,s[o],[...u,o])}async function vE(i,s,u){var m,p;let o=s[u];const d=((m=i.config)==null?void 0:m.root)||((p=i.config)==null?void 0:p.root_url);if(!d)throw new Error(fy);try{let v,_;if(typeof process<"u"&&process.versions&&process.versions.node){const R=await br(()=>import("./__vite-browser-external-BIHI7g3E.js"),[],import.meta.url);_=(await br(async()=>{const{resolve:Y}=await import("./__vite-browser-external-BIHI7g3E.js");return{resolve:Y}},[],import.meta.url)).resolve(process.cwd(),o.meta.path),v=await R.readFile(_)}else throw new Error(Pb);const O=new Blob([v],{type:"application/octet-stream"}),g=await i.upload_files(d,[O]),y=g.files&&g.files[0];y&&(s[u]=new Jf({path:y,orig_name:o.meta.name||""}))}catch(v){console.error(Wb,v)}}async function bE(i,s,u){const o={"Content-Type":"application/json"};this.options.token&&(o.Authorization=`Bearer ${this.options.token}`);try{var d=await this.fetch(i,{method:"POST",body:JSON.stringify(s),headers:{...o,...u},credentials:this.options.credentials??"same-origin"})}catch{return[{error:Ol},500]}let m,p;try{m=await d.json(),p=d.status}catch(v){m={error:`Could not parse server response: ${v}`},p=500}return[m,p]}async function EE(i,s={}){let u=!1,o=!1;if(!this.config)throw new Error("Could not resolve app config");if(typeof i=="number")this.config.dependencies.find(p=>p.id==i);else{const p=i.replace(/^\//,"");this.config.dependencies.find(v=>v.id==this.api_map[p])}const d=this.submit(i,s,null,null,!0);let m;for await(const p of d){if(p.type==="data"&&(u=!0,m=p,o))return m;if(p.type==="status"){if(p.stage==="error"){const{message:v,..._}=p,O=new Error((typeof v=="string"?v:v&&JSON.stringify(v))||"An unknown error occurred while making a prediction.");throw Object.assign(O,_),O}if(p.stage==="complete"&&(o=!0,u))return m}}return m}async function gr(i,s,u){let o=s==="subdomain"?`https://huggingface.co/api/spaces/by-subdomain/${i}`:`https://huggingface.co/api/spaces/${i}`,d,m;try{if(d=await fetch(o),m=d.status,m!==200)throw new Error;d=await d.json()}catch{u({status:"error",load_status:"error",message:Qb,detail:"NOT_FOUND"});return}if(!d||m!==200)return;const{runtime:{stage:p},id:v}=d;switch(p){case"STOPPED":case"SLEEPING":u({status:"sleeping",load_status:"pending",message:"Space is asleep. Waking it up...",detail:p}),setTimeout(()=>{gr(i,s,u)},1e3);break;case"PAUSED":u({status:"paused",load_status:"error",message:"This space has been paused by the author. If you would like to try this demo, consider duplicating the space.",detail:p,discussions_enabled:await hg(v)});break;case"RUNNING":case"RUNNING_BUILDING":u({status:"running",load_status:"complete",message:"Space is running.",detail:p});break;case"BUILDING":u({status:"building",load_status:"pending",message:"Space is building...",detail:p}),setTimeout(()=>{gr(i,s,u)},1e3);break;case"APP_STARTING":u({status:"starting",load_status:"pending",message:"Space is starting...",detail:p}),setTimeout(()=>{gr(i,s,u)},1e3);break;default:u({status:"space_error",load_status:"error",message:"This space is experiencing an issue.",detail:p,discussions_enabled:await hg(v)});break}}var gy=async(i,s)=>{let u=0;const o=12,d=5e3;return new Promise(m=>{gr(i,Zf.test(i)?"space_name":"subdomain",p=>{s(p),p.status==="running"||p.status==="error"||p.status==="paused"||p.status==="space_error"?m():(p.status==="sleeping"||p.status==="building")&&(u{gy(i,s).then(m)},d)):m())})})},_E=/^(?=[^]*\b[dD]iscussions{0,1}\b)(?=[^]*\b[dD]isabled\b)[^]*$/;async function hg(i){try{const s=await fetch(`https://huggingface.co/api/spaces/${i}/discussions`,{method:"HEAD"}),u=s.headers.get("x-error-message");return!(!s.ok||u&&_E.test(u))}catch{return!1}}async function wE(i,s){const u={};s&&(u.Authorization=`Bearer ${s}`);try{const o=await fetch(`https://huggingface.co/api/spaces/${i}/${Bb}`,{headers:u});if(o.status!==200)throw new Error("Space hardware could not be obtained.");const{hardware:d}=await o.json();return d.current}catch(o){throw new Error(o.message)}}async function SE(i,s,u){const o={};u&&(o.Authorization=`Bearer ${u}`);const d={seconds:s};try{const m=await fetch(`https://huggingface.co/api/spaces/${i}/${Lb}`,{method:"POST",headers:{"Content-Type":"application/json",...o},body:JSON.stringify(d)});if(m.status!==200)throw new Error("Could not set sleep timeout on duplicated Space. Please visit *ADD HF LINK TO SETTINGS* to set a timeout manually to reduce billing charges.");return await m.json()}catch(m){throw new Error(m.message)}}var pg=["cpu-basic","cpu-upgrade","cpu-xl","t4-small","t4-medium","a10g-small","a10g-large","a10g-largex2","a10g-largex4","a100-large","zero-a10g","h100","h100x8"];async function NE(i,s){dy(s);const{token:u,private:o,hardware:d,timeout:m,auth:p}=s;if(d&&!pg.includes(d))throw new Error(`Invalid hardware type provided. Valid types are: ${pg.map(j=>`"${j}"`).join(",")}.`);const{http_protocol:v,host:_}=await Kf(i,u);let O=null;if(p){const j=await my(v,_,p,fetch,void 0,s.credentials);j&&(O=hy(j))}const g={Authorization:`Bearer ${u}`,"Content-Type":"application/json",...O?{Cookie:O.join("; ")}:{}},y=(await(await fetch("https://huggingface.co/api/whoami-v2",{headers:g})).json()).name,R=i.split("/")[1],Y={repository:`${y}/${R}`};o&&(Y.private=!0);let x;try{d||(x=await wE(i,u))}catch(j){throw Error(pr+j.message)}Y.hardware=d||x||"cpu-basic";try{const j=await fetch(`https://huggingface.co/api/spaces/${i}/duplicate`,{method:"POST",headers:g,body:JSON.stringify(Y)});if(j.status===409)try{return await Bf.connect(`${y}/${R}`,s)}catch(le){throw console.error("Failed to connect Client instance:",le),le}else if(j.status!==200)throw new Error(j.statusText);const L=await j.json();return await SE(`${y}/${R}`,m||300,u),await Bf.connect(TE(L.url),s)}catch(j){throw new Error(j)}}function TE(i){const s=i.match(/https:\/\/huggingface.co\/spaces\/([^/]+\/[^/]+)/);if(s)return s[1]}var gg="supports-zerogpu-headers",yg=!1;function CE(){return typeof window<"u"&&typeof document<"u"&&typeof window.addEventListener=="function"}function yy(i){return i.includes(".dev.")?`https://moon-${i.split(".")[1]}.dev.spaces.huggingface.tech`:i.endsWith(".hf.space")?"https://huggingface.co":null}function AE(){if(!CE()||yg)return;window.addEventListener("message",s=>{s.data===gg&&(window.supports_zerogpu_headers=!0)}),yg=!0;const i=yy(window.location.hostname);i&&window.parent!==window&&window.parent.postMessage(gg,i)}var Vn,ry,OE=(ry=class extends TransformStream{constructor(s={allowCR:!1}){super({transform:(u,o)=>{for(u=rc(this,Vn)+u;;){const d=u.indexOf(` +`),m=s.allowCR?u.indexOf("\r"):-1;if(m!==-1&&m!==u.length-1&&(d===-1||d-1>m)){o.enqueue(u.slice(0,m)),u=u.slice(m+1);continue}if(d===-1)break;const p=u[d-1]==="\r"?d-1:d;o.enqueue(u.slice(0,p)),u=u.slice(d+1)}ag(this,Vn,u)},flush:u=>{if(rc(this,Vn)==="")return;const o=s.allowCR&&rc(this,Vn).endsWith("\r")?rc(this,Vn).slice(0,-1):rc(this,Vn);u.enqueue(o)}});tg(this,Vn,"")}},Vn=new WeakMap,ry);function RE(i){let s=new TextDecoderStream,u=new OE({allowCR:!0});return i.pipeThrough(s).pipeThrough(u)}function zE(i){let s=/[:]\s*/.exec(i),u=s&&s.index;if(u)return[i.substring(0,u),i.substring(u+s[0].length)]}function vg(i,s,u){i.get(s)||i.set(s,u)}async function*kE(i,s){if(!i.body)return;let u=RE(i.body),o,d=u.getReader(),m;for(;;){if(s&&s.aborted)return d.cancel();if(o=await d.read(),o.done)return;if(!o.value){m&&(yield m),m=void 0;continue}let[p,v]=zE(o.value)||[];p==="data"?(m||(m={}),m[p]=m[p]?m[p]+` +`+v:v):p==="event"?(m||(m={}),m[p]=v):p==="id"?(m||(m={}),m[p]=String(+v)===v?+v:v):p==="retry"&&(m||(m={}),m[p]=+v||void 0)}}async function DE(i,s){let u=new Request(i,s);vg(u.headers,"Accept","text/event-stream"),vg(u.headers,"Content-Type","application/json");let o=await fetch(u);if(!o.ok)throw o;return kE(o,u.signal)}async function ME(){let{event_callbacks:i,unclosed_events:s,pending_stream_messages:u,stream_status:o,config:d,jwt:m}=this;const p=this;if(!d)throw new Error("Could not resolve app config");o.open=!0;let v=null,_=new URLSearchParams({session_hash:this.session_hash}).toString(),O=new URL(`${d.root}${this.api_prefix}/${sy}?${_}`);if(m&&O.searchParams.set("__sign",m),v=this.stream(O),!v){console.warn("Cannot connect to SSE endpoint: "+O.toString());return}v.onmessage=async function(g){let y=JSON.parse(g.data);if(y.msg==="close_stream"){If(o,p.abort_controller);return}const R=y.event_id;if(!R)await Promise.all(Object.keys(i).map(Y=>i[Y](y)));else if(i[R]&&d){y.msg==="process_completed"&&["sse","sse_v1","sse_v2","sse_v2.1","sse_v3"].includes(d.protocol)&&s.delete(R);let Y=i[R];typeof window<"u"&&typeof document<"u"&&document.visibilityState!=="hidden"?setTimeout(Y,0,y):Y(y)}else u[R]||(u[R]=[]),u[R].push(y)},v.onerror=async function(g){console.error(g),await Promise.all(Object.keys(i).map(y=>i[y]({msg:"broken_connection",message:Ol})))}}function If(i,s){i&&(i.open=!1,s==null||s.abort())}function UE(i,s,u){i[s]?u.data.forEach((o,d)=>{let m=xE(d{i[s][d]=o}))}function xE(i,s){return s.forEach(([u,o,d])=>{i=HE(i,o,u,d)}),i}function HE(i,s,u,o){if(s.length===0){if(u==="replace")return o;if(u==="append")return i+o;throw new Error(`Unsupported action: ${u}`)}let d=i;for(let p=0;p{console.warn("Method not implemented.")},onerror:null,onmessage:null,onopen:null,readyState:0,url:i.toString(),withCredentials:!1,CONNECTING:0,OPEN:1,CLOSED:2,addEventListener:()=>{throw new Error("Method not implemented.")},dispatchEvent:()=>{throw new Error("Method not implemented.")},removeEventListener:()=>{throw new Error("Method not implemented.")}};return DE(i,s).then(async o=>{u.readyState=u.OPEN;try{for await(const d of o)u.onmessage&&u.onmessage(d);u.readyState=u.CLOSED}catch(d){u.onerror&&u.onerror(d),u.readyState=u.CLOSED}}).catch(o=>{console.error(o),u.onerror&&u.onerror(o),u.readyState=u.CLOSED}),u}var Ws="gradio:run-history:",yr=`${Ws}v2:`,bg=`${Ws}replay:v2:`,vy=`${Ws}destination:v1:`,BE=100,LE=8;function _r(i,s){try{return i()}catch(u){return console.warn("Could not update the run history.",u),s}}function wr(i){if(typeof window>"u")return null;const s=i==null?void 0:i.app_id;if(s==null||s==="")return null;try{return window.localStorage?`${yr}${s}${i!=null&&i.username?`:user:${encodeURIComponent(i.username)}`:""}`:null}catch{return null}}function jE(i){const s=wr(i);return s?s.replace(yr,vy):null}function by(i){const s=jE(i);if(!s)return{type:"browser"};try{const u=JSON.parse(window.localStorage.getItem(s)||"null");return typeof(u==null?void 0:u.bucket_id)=="string"?u.type==="bucket"?{type:"bucket",bucket_id:u.bucket_id}:{type:"browser",bucket_id:u.bucket_id}:{type:"browser"}}catch{return{type:"browser"}}}function Eg(i){var s;try{const u=JSON.parse(window.localStorage.getItem(i)||"[]");return Array.isArray(u)&&u.length&&Date.parse((s=u[0])==null?void 0:s.started_at)||0}catch{return 0}}function Ey(i){const s=Object.keys(window.localStorage).filter(o=>o.startsWith(Ws)),u=[...s.filter(o=>!o.startsWith(yr)&&!o.startsWith(bg)&&!o.startsWith(vy)),...s.filter(o=>o.startsWith(yr)&&o!==i).sort((o,d)=>Eg(d)-Eg(o)).slice(LE-1)];for(const o of u)try{window.localStorage.removeItem(o),window.sessionStorage.removeItem(o.replace(yr,bg))}catch{}}function GE(){return typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():`${Date.now()}-${Math.random().toString(36).slice(2)}`}function vr(i){const s=new WeakSet;try{return JSON.parse(JSON.stringify(i,(u,o)=>{if(typeof o=="bigint")return o.toString();if(typeof o=="object"&&o!==null){if(s.has(o))return"[Circular]";s.add(o)}return o}))}catch{return"[Unserializable value]"}}function Ff(i){const s=wr(i);if(!s)return[];try{const u=JSON.parse(window.localStorage.getItem(s)||"[]");return Array.isArray(u)?u:[]}catch{return[]}}function Pf(i,s){const u=wr(i);if(!u)return;let o=s.slice(0,BE),d=!1;for(;o.length>0;)try{window.localStorage.setItem(u,JSON.stringify(o));return}catch{if(!d){d=!0,Ey(u);continue}o=o.slice(0,-1)}try{window.localStorage.removeItem(u)}catch{}}function YE(i){const s=wr(i);if(s){try{window.localStorage.removeItem(s)}catch{}_y()}}var VE="gradio:run-history-change";function _y(){if(!(typeof window>"u"))try{window.dispatchEvent(new Event(VE))}catch{}}function XE(i){if(by(i).type==="bucket")return null;const s=wr(i);if(!s)return null;Ey(s);const u={id:GE(),endpoint:i.endpoint,api_name:i.api_name,fn_index:i.fn_index,page:`${window.location.pathname}${window.location.search}`,inputs:vr(i.inputs),outputs:null,...i.input_components?{input_components:vr(i.input_components)}:{},...i.output_components?{output_components:vr(i.output_components)}:{},status:"running",started_at:new Date().toISOString()};return Pf(i,[u,...Ff(i)]),_y(),u.id}function QE(i,s,u){if(!s)return;const o=Ff(i),d=o.find(m=>m.id===s);d&&(d.inputs=vr(u),Pf(i,o))}function ZE(i,s,u){if(!s)return;const o=Ff(i),d=o.find(p=>p.id===s);if(!d)return;let m=!1;if(u.type==="data")d.outputs=vr(u.data),fr.set(s,d.outputs);else if(u.type==="status"&&u.original_msg==="process_starts")JE(d,u.time);else if(u.type==="status"&&(u.stage==="generating"||u.stage==="streaming"))d.streamed=!0;else if(u.type==="status"&&u.stage==="complete")d.status="completed",_g(d,u),m=!0;else if(u.type==="status"&&u.stage==="error")d.status="failed",d.error=typeof u.message=="string"?u.message:JSON.stringify(u.message||"Unknown error"),_g(d,u),m=!0;else return;if(m)fr.has(s)&&(d.outputs=fr.get(s)),fr.delete(s),wf.delete(s);else if(d.streamed){if(Date.now()-(wf.get(s)??0)=0?s.cache_duration*1e3:null)??Math.max(0,u.getTime()-Date.parse(i.process_started_at||i.started_at))}function $E(i){return _r(()=>by(i),{type:"browser"})}function IE(i){_r(()=>YE(i),void 0)}function FE(i){return _r(()=>XE(i),null)}function PE(i,s,u){_r(()=>QE(i,s,u),void 0)}function WE(i,s,u){_r(()=>ZE(i,s,u),void 0)}function e1(i,s={},u,o,d,m){var p;try{let F=function(de){WE(_e,aa,de),(de.type==="data"||de.type==="render")&&$f(de.data,W,I,Z.jwt),(d||X[de.type])&&$e(de)},tt=function(){for(mt=!0;ke.length>0;)ke.shift()({value:void 0,done:!0})},zt=function(de){ke.length>0?ke.shift()(de):Ue.push(de)},pa=function(de){zt(t1(de)),tt()},$e=function(de){zt({value:de,done:!1})},Ut=function(){return Ue.length>0?Promise.resolve(Ue.shift()):mt?Promise.resolve({value:void 0,done:!0}):new Promise(de=>ke.push(de))};const{token:v}=this.options,{fetch:_,app_reference:O,config:g,session_hash:y,api_info:R,api_map:Y,stream_status:x,pending_stream_messages:j,pending_diff_streams:L,event_callbacks:le,unclosed_events:Ne,post_data:je,options:te,api_prefix:I}=this,se=m||{"x-gradio-user":"api"},Z=this;if(!R)throw new Error(Ib);if(!g)throw new Error("Could not resolve app config");const W=g.root;let{fn_index:$,endpoint_info:ve,dependency:Ge}=a1(R,i,Y,g),dt=sE(s,ve),_t=g.protocol??"ws";if(_t==="ws")throw new Error(Fb);const Ra=typeof Ge.api_name=="string"?`/${Ge.api_name}`:i,rt=typeof Ge.api_name=="string"?`/${Ge.api_name}`:`Function ${$}`,Q=de=>{const st=g.components.find(kt=>kt.id===de);return st?{type:st.type,component_class_id:st.component_class_id,props:st.props}:null},D=Ge.api_visibility==="public",fe=g.run_history!==!1&&this.options.record_history!==!1,_e={app_id:g.app_id,username:g.username},he=$E(_e),Ye={...se,...fe&&he.type==="bucket"?{"x-gradio-history-bucket":he.bucket_id}:{}},aa=!fe||!D?null:FE({..._e,endpoint:Ra,api_name:rt,fn_index:$,inputs:ur(dt,Ge,g.components,"input",!0),input_components:Ge.inputs.map(Q),output_components:Ge.outputs.map(Q)});let Ve,w="";const U=typeof i=="number"?"/predict":i;let ie,G=null,ye=!1,Ce={},ce=typeof window<"u"&&typeof document<"u"?new URLSearchParams(window.location.search).toString():"";const X=((p=te==null?void 0:te.events)==null?void 0:p.reduce((de,st)=>(de[st]=!0,de),{}))||{};async function Ae(){let de={},st={};de={event_id:G},st={event_id:G,session_hash:y,fn_index:$};try{if(!g)throw new Error("Could not resolve app config");"event_id"in st&&await _(`${g.root}${I}/${Vb}`,{headers:{"Content-Type":"application/json"},method:"POST",body:JSON.stringify(st)}),await _(`${g.root}${I}/${Yb}`,{headers:{"Content-Type":"application/json"},method:"POST",body:JSON.stringify(de)})}catch{console.warn("The `/reset` endpoint could not be called. Subsequent endpoint results may be unreliable.")}}const tn=async de=>{await this._resolve_heartbeat(de)};async function oe(de){if(!g)return;let st=de.render_id;g.components=[...g.components.filter(He=>He.props.rendered_in!==st),...de.components],g.dependencies=[...g.dependencies.filter(He=>He.rendered_in!==st),...de.dependencies];const kt=g.components.some(He=>He.type==="state"),ga=g.dependencies.some(He=>He.targets.some(za=>za[1]==="unload"));g.connect_heartbeat=kt||ga,await tn(g),F({type:"render",data:de,endpoint:U,fn_index:$})}const Rt=this.handle_blob(g.root,dt,ve).then(async de=>{var ga;let st=ur(de,Ge,g.components,"input",!0);if(PE(_e,aa,st||[]),ie={data:st||[],event_data:u,fn_index:$,trigger_id:o,...te.oauth_token&&(ve!=null&&ve.oauth_token)?{oauth_token:te.oauth_token}:{}},dg($,g))F({type:"status",endpoint:U,stage:"pending",queue:!1,fn_index:$,time:new Date}),je(`${g.root}${I}/run${U.startsWith("/")?U:`/${U}`}${ce?"?"+ce:""}`,{...ie,session_hash:y},Ye).then(async([He,za])=>{const xe=He.data;if(za==200)F({type:"data",endpoint:U,fn_index:$,data:ur(xe,Ge,g.components,"output",te.with_null_state),time:new Date,event_data:u,trigger_id:o}),He.render_config&&await oe(He.render_config),F({type:"status",endpoint:U,fn_index:$,stage:"complete",eta:He.average_duration,queue:!1,time:new Date});else{const Ze=(He==null?void 0:He.error)===Ol;F({type:"status",stage:"error",endpoint:U,fn_index:$,message:He.error,broken:Ze,queue:!1,time:new Date})}}).catch(He=>{F({type:"status",stage:"error",message:He.message,endpoint:U,fn_index:$,queue:!1,time:new Date})});else if(_t=="sse"){F({type:"status",stage:"pending",queue:!0,endpoint:U,fn_index:$,time:new Date});var kt=new URLSearchParams({fn_index:$.toString(),session_hash:y}).toString();let He=new URL(`${g.root}${I}/${sy}?${ce?ce+"&":""}${kt}`);if(this.jwt&&He.searchParams.set("__sign",this.jwt),Ve=this.stream(He),!Ve)return Promise.reject(new Error("Cannot connect to SSE endpoint: "+He.toString()));Ve.onmessage=async function(za){const{type:xe,status:Ze,data:ot}=og(JSON.parse(za.data),Ce[$]);if(xe==="update"&&Ze&&!ye)F({type:"status",endpoint:U,fn_index:$,time:new Date,...Ze}),Ze.stage==="error"&&(Ve==null||Ve.close(),tt());else if(xe==="data"){let[Dt,wt]=await je(`${g.root}${I}/queue/data`,{...ie,session_hash:y,event_id:G},Ye);wt!==200&&(F({type:"status",stage:"error",message:Ol,queue:!0,endpoint:U,fn_index:$,time:new Date}),Ve==null||Ve.close(),tt())}else xe==="complete"?ye=Ze:xe==="log"?F({type:"log",title:ot.title,log:ot.log,level:ot.level,endpoint:U,duration:ot.duration,visible:ot.visible,fn_index:$}):(xe==="generating"||xe==="streaming")&&F({type:"status",time:new Date,...Ze,stage:Ze==null?void 0:Ze.stage,queue:!0,endpoint:U,fn_index:$});ot&&(F({type:"data",time:new Date,data:ur(ot.data,Ge,g.components,"output",te.with_null_state),endpoint:U,fn_index:$,event_data:u,trigger_id:o}),ye&&(F({type:"status",time:new Date,...ye,stage:Ze==null?void 0:Ze.stage,queue:!0,endpoint:U,fn_index:$}),Ve==null||Ve.close(),tt()))}}else if(_t=="sse_v1"||_t=="sse_v2"||_t=="sse_v2.1"||_t=="sse_v3"){F({type:"status",stage:"pending",queue:!0,endpoint:U,fn_index:$,time:new Date});let He="";typeof window<"u"&&typeof document<"u"&&(He=(ga=window==null?void 0:window.location)==null?void 0:ga.hostname);const za=yy(He);return(typeof window<"u"&&typeof document<"u"&&window.parent!=window&&za&&window.supports_zerogpu_headers?hE("zerogpu-headers",za):Promise.resolve(null)).then(xe=>{const Ze={...Ye,...xe||{}};return je(`${g.root}${I}/${xb}?${ce}`,{...ie,session_hash:y},Ze)}).then(async([xe,Ze])=>{if(xe.event_id&&(w=xe.event_id),Ze===503)F({type:"status",stage:"error",message:oy,queue:!0,endpoint:U,fn_index:$,time:new Date,visible:!0}),tt();else if(Ze===422)F({type:"status",stage:"error",message:xe.detail,queue:!0,endpoint:U,fn_index:$,code:"validation_error",time:new Date,visible:!0}),tt();else if(Ze!==200){const ot=(xe==null?void 0:xe.error)===Ol;F({type:"status",stage:"error",broken:ot,message:ot?Ol:xe.detail||xe.error,queue:!0,endpoint:U,fn_index:$,time:new Date,visible:!0}),tt()}else{G=xe.event_id,w=G;let ot=async function(Dt){try{const{type:wt,status:Xe,data:We,original_msg:nn}=og(Dt,Ce[$]);if(wt=="heartbeat")return;if(wt==="update"&&Xe&&!ye)F({type:"status",endpoint:U,fn_index:$,time:new Date,original_msg:nn,...Xe});else if(wt==="complete")ye=Xe;else if(wt=="unexpected_error"||wt=="broken_connection"){console.error("Unexpected error",Xe==null?void 0:Xe.message);const ln=wt==="broken_connection";F({type:"status",stage:"error",message:(Xe==null?void 0:Xe.message)||"An Unexpected Error Occurred!",queue:!0,endpoint:U,broken:ln,session_not_found:Xe==null?void 0:Xe.session_not_found,fn_index:$,time:new Date})}else if(wt==="log"){F({type:"log",title:We.title,log:We.log,level:We.level,endpoint:U,duration:We.duration,visible:We.visible,fn_index:$});return}else(wt==="generating"||wt==="streaming")&&(F({type:"status",time:new Date,...Xe,stage:Xe==null?void 0:Xe.stage,queue:!0,endpoint:U,fn_index:$}),We&&Ge.connection!=="stream"&&["sse_v2","sse_v2.1","sse_v3"].includes(_t)&&UE(L,G,We));We&&(F({type:"data",time:new Date,data:ur(We.data,Ge,g.components,"output",te.with_null_state),endpoint:U,fn_index:$}),We.render_config&&await oe(We.render_config),ye&&(F({type:"status",time:new Date,...ye,stage:Xe==null?void 0:Xe.stage,queue:!0,endpoint:U,fn_index:$}),tt())),((Xe==null?void 0:Xe.stage)==="complete"||(Xe==null?void 0:Xe.stage)==="error")&&(le[G]&&delete le[G],G in L&&delete L[G],tt())}catch(wt){console.error("Unexpected client exception",wt),F({type:"status",stage:"error",message:"An Unexpected Error Occurred!",queue:!0,endpoint:U,fn_index:$,time:new Date}),["sse_v2","sse_v2.1","sse_v3"].includes(_t)&&(If(x,Z.abort_controller),x.open=!1,tt())}};G in j&&(j[G].forEach(Dt=>ot(Dt)),delete j[G]),le[G]=ot,Ne.add(G),x.open||await this.open_stream()}})}});Rt.catch(de=>{F({type:"status",stage:"error",message:de instanceof Error?de.message:String(de),queue:!dg($,g),endpoint:U,fn_index:$,time:new Date}),tt()});let mt=!1;const Ue=[],ke=[],bn=(de,st)=>{Rt.then(()=>{w&&this.post_data(`${g.root}${I}/stream/${w}${de}`,st)},()=>{})},an={[Symbol.asyncIterator]:()=>an,next:Ut,throw:async de=>(pa(de),Ut()),return:async()=>(tt(),{value:void 0,done:!0}),cancel:Ae,send_chunk:de=>{bn("",{...de,session_hash:this.session_hash})},close_stream:()=>{tt(),bn("/close",{})},event_id:()=>w,wait_for_id:async()=>(await Rt,G)};return an}catch(v){throw console.error("Submit function encountered an error:",v),v}}function t1(i){return{then:(s,u)=>u(i)}}function a1(i,s,u,o){let d,m,p;if(typeof s=="number")d=s,m=i.unnamed_endpoints[d],p=o.dependencies.find(v=>v.id==s);else{const v=s.replace(/^\//,"");d=u[v],m=i.named_endpoints[s.trim()]??i.named_endpoints[`/${v}`],p=o.dependencies.find(_=>_.id==u[v])}if(typeof d!="number"||!p){const v=o.dependencies.filter(_=>_.api_name).map(_=>`"/${_.api_name}"`).join(", ");throw new Error(`No endpoint matching ${JSON.stringify(s)} was found. `+(v?`Valid named endpoints are: ${v}. `:"This app exposes no named endpoints. ")+"An fn_index (number) of an existing dependency can also be used.")}return{fn_index:d,endpoint_info:m,dependency:p}}var Bf=class{constructor(i,s={events:["data"]}){pe(this,"app_reference");pe(this,"options");pe(this,"deep_link",null);pe(this,"page",null);pe(this,"config");pe(this,"api_prefix","");pe(this,"api_info");pe(this,"api_map",{});pe(this,"session_hash",Math.random().toString(36).substring(2));pe(this,"jwt",!1);pe(this,"last_status",{});pe(this,"cookies",null);pe(this,"stream_status",{open:!1});pe(this,"closed",!1);pe(this,"pending_stream_messages",{});pe(this,"pending_diff_streams",{});pe(this,"event_callbacks",{});pe(this,"unclosed_events",new Set);pe(this,"heartbeat_event",null);pe(this,"abort_controller",null);pe(this,"stream_instance",null);pe(this,"current_payload");pe(this,"view_api");pe(this,"upload_files");pe(this,"upload");pe(this,"handle_blob");pe(this,"post_data");pe(this,"submit");pe(this,"predict");pe(this,"open_stream");pe(this,"resolve_config");pe(this,"resolve_cookies");var u,o;this.app_reference=i,this.deep_link=((u=s.query_params)==null?void 0:u.deep_link)||null,this.page=((o=s.query_params)==null?void 0:o.page)??null,s.events||(s.events=["data"]),dy(s),this.options=s,this.current_payload={},s.cookies&&(this.cookies=s.cookies),this.view_api=oE.bind(this),this.upload_files=uE.bind(this),this.handle_blob=gE.bind(this),this.post_data=bE.bind(this),this.submit=e1.bind(this),this.predict=EE.bind(this),this.open_stream=ME.bind(this),this.resolve_config=aE.bind(this),this.resolve_cookies=nE.bind(this),this.upload=dE.bind(this),this.fetch=this.fetch.bind(this),this.handle_space_success=this.handle_space_success.bind(this),this.stream=this.stream.bind(this)}get_url_config(i=null){if(!this.config)throw new Error(gn);i===null&&(i=window.location.href);const s=m=>m.replace(/^\/+|\/+$/g,"");let u=s(new URL(this.config.root).pathname),o=s(new URL(i).pathname),d;return o.startsWith(u)?d=s(o.substring(u.length)):d="",this.get_page_config(d)}get_page_config(i){if(!this.config)throw new Error(gn);let s=this.config;return i in s.page||(i=""),{...s,current_page:i,layout:s.page[i].layout,components:s.components.filter(u=>s.page[i].components.includes(u.id)),dependencies:this.config.dependencies.filter(u=>s.page[i].dependencies.includes(u.id))}}fetch(i,s){const u=new Headers((s==null?void 0:s.headers)||{});return this&&this.cookies&&u.append("Cookie",this.cookies),this&&this.options.headers&&new Headers(this.options.headers).forEach((o,d)=>{u.append(d,o)}),fetch(i,{...s,headers:u})}stream(i){const s=new Headers;return this&&this.cookies&&s.append("Cookie",this.cookies),this&&this.options.headers&&new Headers(this.options.headers).forEach((u,o)=>{s.append(o,u)}),this&&this.options.token&&s.append("Authorization",`Bearer ${this.options.token}`),this.abort_controller=new AbortController,this.stream_instance=qE(i.toString(),{credentials:this.options.credentials??"same-origin",headers:s,signal:this.abort_controller.signal}),this.stream_instance}async init(){var i;AE(),this.options.auth&&await this.resolve_cookies(),await this._resolve_config().then(s=>(s==null?void 0:s.config)&&this._resolve_heartbeat(s.config));try{this.api_info=await this.view_api()}catch(s){console.error(s.message)}this.api_map=rg(((i=this.config)==null?void 0:i.dependencies)||[])}async _resolve_heartbeat(i){if(this.config=i,this.api_prefix=i.api_prefix||"",i.space_id&&this.options.token&&(this.jwt=await eE(i.space_id,this.options.token,this.cookies)),mg(this.config,this.jwt),this.config&&this.config.connect_heartbeat){const s=new URL(`${this.config.root}${this.api_prefix}/${jb}/${this.session_hash}`);this.jwt&&s.searchParams.set("__sign",this.jwt),this.heartbeat_event||(this.heartbeat_event=this.stream(s))}}static async connect(i,s={events:["data"]}){const u=new this(i,s);return s.session_hash&&(u.session_hash=s.session_hash),await u.init(),u}async reconnect(){const i=new URL(`${this.config.root}${this.api_prefix}/${Xb}`);let s;try{const u=await this.fetch(i);if(!u.ok)throw new Error;s=(await u.json()).app_id}catch{return"broken"}return s!==this.config.app_id?"changed":"connected"}close(){this.closed=!0,If(this.stream_status,this.abort_controller)}async refresh(){if(!this.config)throw new Error(gn);const i=await this.resolve_config(this.config.root,!1);if(!i)throw new Error(gn);this.config=i,this.api_prefix=i.api_prefix||"",this.api_map=rg(i.dependencies||[]),mg(this.config,this.jwt);try{this.api_info=await this.view_api()}catch(s){console.error(cg+s.message)}return this.get_url_config()}set_current_payload(i){this.current_payload=i}static async duplicate(i,s={events:["data"]}){return NE(i,s)}async _resolve_config(){const{http_protocol:i,host:s,space_id:u}=await Kf(this.app_reference,this.options.token),{status_callback:o}=this.options;u&&o&&await gy(u,o);let d;try{let m=`${i}//${s}`;if(d=await this.resolve_config(m),!d)throw new Error(gn);return this.config_success(d)}catch(m){if(u&&o)gr(u,Zf.test(u)?"space_name":"subdomain",this.handle_space_success);else throw o&&o({status:"error",message:"Could not load this space.",load_status:"error",detail:"NOT_FOUND"}),m instanceof Error?m:new Error(String(m))}}async config_success(i){if(this.config=i,this.api_prefix=i.api_prefix||"",i.run_history===!1&&IE({app_id:i.app_id,username:i.username}),this.config.auth_required)return this.prepare_return_obj();try{this.api_info=await this.view_api()}catch(s){console.error(cg+s.message)}return this.prepare_return_obj()}async handle_space_success(i){var u;if(!this)throw new Error(gn);const{status_callback:s}=this.options;if(s&&s(i),i.status==="running")try{if(this.config=await this._resolve_config(),this.api_prefix=((u=this==null?void 0:this.config)==null?void 0:u.api_prefix)||"",!this.config)throw new Error(gn);return await this.config_success(this.config)}catch(o){throw s&&s({status:"error",message:"Could not load this space.",load_status:"error",detail:"NOT_FOUND"}),o}}async component_server(i,s,u){var O;if(!this.config)throw new Error(gn);const o={},{token:d}=this.options,{session_hash:m}=this;d&&(o.Authorization=`Bearer ${this.options.token}`);let p,v=this.config.components.find(g=>g.id===i);(O=v==null?void 0:v.props)!=null&&O.root_url?p=v.props.root_url:p=this.config.root;let _;if(typeof u=="object"&&u!==null&&"binary"in u){const g=u;_=new FormData;for(const y in g.data)y!=="binary"&&_.append(y,g.data[y]);_.set("component_id",i.toString()),_.set("fn_name",s),_.set("session_hash",m)}else _=JSON.stringify({data:u,component_id:i,fn_name:s,session_hash:m}),o["Content-Type"]="application/json";d&&(o.Authorization=`Bearer ${d}`);try{const g=await this.fetch(`${p}${this.api_prefix}/${Gb}/`,{method:"POST",body:_,headers:o,credentials:this.options.credentials??"same-origin"});if(!g.ok)throw new Error("Could not connect to component server: "+g.statusText);const y=await g.json();return $f(y,this.config.root,this.config.api_prefix||"",this.jwt),y}catch(g){console.warn(g)}}set_cookies(i){this.cookies=hy(i).join("; ")}prepare_return_obj(){return{config:this.config,predict:this.predict,submit:this.submit,view_api:this.view_api,component_server:this.component_server}}};function n1(i){const s=i.stream_instance;if(s){const u=s.onerror;s.onerror=o=>{(o==null?void 0:o.name)!=="AbortError"&&(u==null||u(o))}}i.close()}function wg(){let i=0;return{invalidate(){i++},capture(){const s=i;return()=>s===i}}}const Lf="DEFECTRAG_REVIEW_V1:",wy=["Needs review","In review","Reviewed"],Sy=["Pending","Hold","Accept","Reject"],l1={Pending:"Pending",Hold:"Hold: needs more checks",Accept:"Accept: no defect",Reject:"Reject: defect confirmed"},jf=i=>l1[i]||i;function Wf(i,s,u=""){if(!wy.includes(i)||!Sy.includes(s)||i==="Reviewed"==(s==="Pending")||u.length>1e3)throw new Error("Choose a review status and a compatible decision.");return Lf+JSON.stringify({status:i,decision:s,note:u.trim()})}function hc(i,s={}){var u;if(!((u=i.body)!=null&&u.startsWith(Lf)))return null;try{const o=JSON.parse(i.body.slice(Lf.length));return Wf(o.status,o.decision,o.note||""),{...o,reviewer:s[i.author_id]||"Staff member",reviewer_id:i.author_id,created_at:i.created_at}}catch{return null}}const i1=i=>/exceeded.*(?:ZeroGPU|GPU).*(?:limit|quota)|(?:ZeroGPU|GPU).*(?:quota|limit).*exceed/i.test(i);function c1(i){return Object.fromEntries(["id","created_at","category","batch","verdict","score","threshold","inference_ms","model_id","storage"].filter(s=>i[s]!==void 0).map(s=>[s,i[s]]))}function Sg(i,s,u){return{version:1,id:crypto.randomUUID(),category:s,batch:u,updated_at:new Date().toISOString(),items:i.map(o=>({id:crypto.randomUUID().replaceAll("-",""),filename:o.name,file:o,status:"pending"}))}}function Ng(i){return{batch:i.batch,records:i.items.filter(s=>s.status==="completed").map(s=>s.record),errors:i.items.filter(s=>["failed","pending","running"].includes(s.status)).map(s=>({filename:s.filename,status:s.status,message:s.message||(s.status==="running"?"Inspection in progress; no result has been saved yet.":"Pending inspection; no prediction has been made.")}))}}async function r1(i,s,u,o=()=>!0){let d={...i,items:i.items.map(m=>({...m}))};for(let m=0;m0&&(i.owner_id===s||i.supervisor_id===s||u===!0)}function s1(i){return{Open:["Open","Assigned","Cancelled"],Assigned:["Assigned","In Progress","Cancelled"],"In Progress":["In Progress","Resolved","Cancelled"],Resolved:["Resolved","Closed","In Progress","Cancelled"],Closed:[],Cancelled:[]}[i]||[]}function ed(i){return i.filter(u=>hc(u)).sort((u,o)=>String(u.created_at).localeCompare(String(o.created_at))||u.id.localeCompare(o.id)).at(-1)}function o1(i){const s=ed(i),u=s&&hc(s);return(u==null?void 0:u.status)==="Reviewed"&&u.decision==="Reject"?s:null}function SS(i,s=[],u=[],o=!1){if(o)return{ready:!1,reason:"Opening the selected inspection…"};if(!i)return{ready:!1,reason:"Pick a shared Team inspection first."};if(i.archived_at)return{ready:!1,reason:"This inspection is archived. Pick an active one."};const d=o1(s);if(!d){const p=ed(s),v=p&&hc(p);return{ready:!1,needsReview:!0,reason:v?`Saved review: ${v.status} / ${jf(v.decision)}. A case needs “Reviewed” and “Reject: defect confirmed”.`:"No defect review saved yet. Open the review and choose “Reviewed” and “Reject: defect confirmed”."}}const m=u.find(p=>p.review_id===d.id);return m?{ready:!1,existingCaseId:m.id,reason:"This review already has a case. Open it to see progress."}:{ready:!0,review:d,reason:"Choose who fixes it, a supervisor and a deadline."}}function NS(i=[],s=[]){const u=ed(i),o=u&&hc(u);return(o==null?void 0:o.status)==="Reviewed"&&o.decision==="Reject"?s.some(d=>d.review_id===u.id)?{key:"has_case",label:"Has a case"}:{key:"ready",label:"Ready: defect confirmed"}:(o==null?void 0:o.status)==="Reviewed"?{key:o.decision.toLowerCase(),label:o.decision==="Accept"?"Accepted: no case needed":"On hold: needs more checks"}:o?{key:"in_review",label:"Review in progress"}:{key:"needs_review",label:"Needs review"}}function TS({description:i,owner:s,supervisor:u,priority:o,due:d},m,p=Date.now()){if(typeof i!="string"||i.trim().length<10||i.trim().length>2e3)return"Describe the work in 10 to 2,000 characters.";const v=O=>m.some(g=>g.user_id===O&&!g.revoked_at);if(!v(s))return"Choose an active Staff member as the person responsible.";if(!v(u))return"Choose an active Staff member as the supervisor.";if(!["Low","Normal","High","Critical"].includes(o))return"Choose a priority.";const _=Date.parse(d);return Number.isFinite(_)?_<=p?"Choose a future due date and time.":_>p+365*24*60*60*1e3?"Choose a due date within the next year.":"":"Choose a due date and time."}function CS(i,s=Date.now()){const u=i.filter(d=>!["Closed","Cancelled"].includes(d.state)),o=i.filter(d=>["Resolved","Closed"].includes(d.state)).map(d=>Date.parse(d.resolved_at)-Date.parse(d.created_at)).filter(d=>Number.isFinite(d)&&d>=0);return{open:u.filter(d=>d.state!=="Resolved").length,resolved:i.filter(d=>["Resolved","Closed"].includes(d.state)).length,overdue:u.filter(d=>d.state!=="Resolved"&&Date.parse(d.due_at)d+m,0)/o.length/36e5:null}}async function AS(i,s,u){const{data:o,error:d}=await i.rpc(s,u);if(d)throw d;return o}const yn="00000000-0000-4000-8000-00000000a001",u1="00000000-0000-4000-8000-00000000a002",f1="00000000-0000-4000-8000-00000000a003",Ny=Object.freeze([{user_id:yn,display_name:"You (practice)",role:"staff",revoked_at:null},{user_id:u1,display_name:"Alex (practice)",role:"staff",revoked_at:null},{user_id:f1,display_name:"Sam (practice)",role:"staff",revoked_at:null}]),d1=Object.freeze({category:"candle",verdict:"Anomalous",score:.19342294335365295,threshold:.10769653692841528,uncertainty_margin:.005384826846420765,inference_ms:31.12,model_id:"dinov2-tuned-candle-v1"}),m1=d1;let ee=null;const pc=()=>ee!==null,Gn=(i,s={})=>{var u;try{(u=ee==null?void 0:ee.onEvent)==null||u.call(ee,{type:"complete",event:i,...s})}catch{}},Xn=()=>crypto.randomUUID(),zl=()=>new Date().toISOString(),Sr=()=>{throw new Error("The practice lesson has ended. Normal work is available again.")};function h1({assets:i={},metadata:s={},onEvent:u}={}){ee={onEvent:u,assets:i,metadata:s,records:[],messages:{},reviews:{},alerts:[],shared:[],notes:[],cases:[],history:[],events:[],batches:{},publications:{},listeners:new Set}}function p1(){ee=null}function g1(i,s=""){return{...m1,id:i,batch:s,created_at:zl(),storage:"browser_session",workspace:"personal",image_url:ee.assets.original||"",heatmap_url:ee.assets.heatmap||"",report_url:"#practice-report-not-saved"}}const y1=i=>Object.fromEntries(["id","created_at","category","batch","verdict","score","threshold","inference_ms","model_id","image_url","heatmap_url"].map(s=>[s,i[s]])),Xs=i=>{try{return JSON.parse((i==null?void 0:i.body)||"{}")}catch{return{}}};function v1(){const i={};for(const u of ee.records)i[u.verdict]=(i[u.verdict]||0)+1;const s=[...new Set(ee.records.map(u=>u.batch).filter(Boolean))].map(u=>({batch:u}));return{total:ee.records.length,counts:i,batches:s}}async function Ty(i,s={}){var _,O;ee||Sr();const u=new URL(i,"https://practice.invalid"),o=u.pathname,d=(s.method||"GET").toUpperCase(),m=o.match(/^\/api\/inspections\/([^/]+)(?:\/([a-z-]+))?$/);if(o==="/api/health")return{status:"ok",mode:"cloud_session_workspace",encoder_configured:!0,auth_workflow_enabled:!0,personal_workspace_enabled:!0,local_sync_enabled:!1,practice:!0};if(o==="/api/samples")return ee.metadata.samples||[];if(o==="/api/evaluation")return ee.metadata.evaluation||{categories:{}};if(o==="/api/benchmark/official")return ee.metadata.official||null;if(o==="/api/stats")return v1();if(o==="/api/inspections")return ee.records.map(y1);if(o==="/api/alerts")return ee.alerts.map(g=>({...g}));if(o==="/api/archives")return[];if(o==="/api/workspace")return{workspace:"personal",role:"staff",practice:!0};if(o==="/api/gallery")return{items:[],total:0,offset:0,enabled:!0};if(o==="/api/batch-name")return{available:!ee.records.some(g=>g.batch.trim().toLowerCase()===String(u.searchParams.get("name")||"").trim().toLowerCase())};if(o==="/api/inspect"&&d==="POST"){const g=s.body,y=(_=g==null?void 0:g.get)==null?void 0:_.call(g,"category"),R=String(((O=g==null?void 0:g.get)==null?void 0:O.call(g,"batch"))||"").trim();if(y!=="candle")throw new Error("In this lesson, choose Candle and a Candle sample photo. Practice shows a saved Candle example.");const Y=g1(Xn().replaceAll("-",""),R);return ee.records.unshift(Y),ee.messages[Y.id]=[],ee.alerts.unshift({id:Xn(),inspection_id:Y.id,kind:Y.verdict,created_at:Y.created_at,acknowledged:null}),R?(ee.batches[R]=(ee.batches[R]||0)+1,ee.batches[R]>=2&&Gn("batch")):Gn("inspect"),{...Y}}if(o==="/api/assistant"&&d==="POST"){const{inspection_id:g,question:y}=Xs(s),R={mode:"retrieval_only",answer:"Practice answer, prepared text and not a live AI answer. The difference score is above the review limit, so the photo looks unusual compared with normal Candle examples. Highlighted areas show where it differs; a Staff member must check the product before any decision. The score is not an accuracy or defect probability.",evidence:[],trace:["practice lesson","no AI call"]};return ee.messages[g]=[...ee.messages[g]||[],{role:"user",question:y},{role:"assistant",...R}],Gn("ask"),R}const p=o.match(/^\/api\/alerts\/([^/]+)\/acknowledge$/);if(p&&d==="POST"){const g=ee.alerts.find(y=>y.id===p[1]);return g&&(g.acknowledged=zl()),Gn("alert"),{acknowledged:!0}}const v=o.match(/^\/api\/gallery\/([^/]+)\/withdraw$/);if(v){for(const g of Object.keys(ee.publications))ee.publications[g].id===v[1]&&(ee.publications[g]={...ee.publications[g],visible:!1});return{withdrawn:!0}}if(m){const g=ee.records.find(R=>R.id===m[1]);if(!g)throw Object.assign(new Error("Practice inspection not found."),{status:404});const y=m[2];if(!y)return{...g};if(y==="messages")return[...ee.messages[g.id]||[]];if(y==="reviews")return[...ee.reviews[g.id]||[]];if(y==="review"&&d==="POST"){const R=Xs(s);Wf(R.status,R.decision,R.note||"");const Y={...R,id:Xn(),created_at:zl(),reviewer:"You (practice)"};return ee.reviews[g.id]=[...ee.reviews[g.id]||[],Y],Y}if(y==="save-personal"&&d==="POST")return{saved:!0};if(y==="share"&&d==="POST"){if(ee.shared.some(L=>L.id===g.id))return{alreadyShared:!0};const{image_url:R,heatmap_url:Y,report_url:x,...j}=g;return ee.shared.unshift({id:g.id,owner_id:yn,payload:j,conversation:Xs(s).include_conversation?ee.messages[g.id]:[],image_path:"practice/original",heatmap_path:"practice/heatmap",created_at:zl(),archived_at:null}),Gn("share"),{alreadyShared:!1}}if(y==="publication"){if(d==="POST"){if(Xs(s).consent!==!0)throw new Error("Confirm that the copy may be public.");return ee.publications[g.id]={id:Xn(),visible:!0,practice:!0},Gn("gallery"),ee.publications[g.id]}return{enabled:!0,publication:ee.publications[g.id]||null}}}if(o==="/api/history/archive"||o==="/api/history/restore")return{archived:0,restored:0};throw new Error("This action is not part of the practice lesson. Finish or skip the tutorial to use it normally.")}async function b1(i,s){return ee||Sr(),new URL(i,"https://practice.invalid").pathname==="/api/export.csv"?new Response(`practice_note +Practice data is not exported. Finish the tutorial to download real history. +`,{status:200,headers:{"Content-Type":"text/csv"}}):new Response(JSON.stringify({data:await Ty(i,s)}),{status:200,headers:{"Content-Type":"application/json"}})}function E1(i){return{shared_inspections:ee.shared,staff_notes:ee.notes,staff_members:Ny,corrective_actions:ee.cases,corrective_action_history:ee.history,corrective_action_events:ee.events}[i]||[]}function _1(i){const s=[];let u=!1,o,d=1/0,m=null;const p={select(){return p},order(v,{ascending:_=!0}={}){return m=[v,_],p},limit(v){return d=v,p},is(v,_){return s.push(O=>(O[v]??null)===_),p},not(v,_,O){return s.push(g=>(g[v]??null)!==O),p},eq(v,_){return s.push(O=>O[v]===_),p},in(v,_){return s.push(O=>_.includes(O[v])),p},like(v,_){const O=String(_).replace(/%$/,"");return s.push(g=>String(g[v]).startsWith(O)),p},single(){return u=!0,p},maybeSingle(){return u="maybe",p},insert(v){return o=v,p},then(v,_){return Promise.resolve().then(()=>{if(ee||Sr(),o){if(i!=="staff_notes")throw new Error("Practice does not save this change.");const g={...o,author_id:yn,id:Xn(),created_at:zl()};ee.notes.push(g);const y=hc(g);return y&&Gn("review",{status:y.status,decision:y.decision}),{data:g,error:null}}let O=E1(i).filter(g=>s.every(y=>y(g)));return m&&(O=[...O].sort((g,y)=>String(g[m[0]]).localeCompare(String(y[m[0]]))*(m[1]?1:-1))),O=structuredClone(O.slice(0,d)),u?{data:O[0]||null,error:u===!0&&!O.length?new Error("Not available in this practice workspace"):null}:{data:O,error:null}}).then(v,_)}};return p}async function w1(i,s={}){if(ee||Sr(),i==="defectrag_auth_status")return{data:{approved:!0,authorized:!0,aal2:!0,mfa_required:!0,role:"staff",revoked:!1,registration_enabled:!1,email_verified:!0,request_status:"approved"},error:null};if(i==="defectrag_ca_staff")return{data:!0,error:null};const u=o=>({data:null,error:new Error(o)});if(i==="defectrag_create_corrective_action"){const o=ee.notes.find(_=>_.id===s.p_review),d=o&&hc(o);if(!d||d.status!=="Reviewed"||d.decision!=="Reject"||o.inspection_id!==s.p_inspection)return u("A case needs a saved review of Reviewed with “Reject: defect confirmed”.");if(s.p_confirmed!==!0)return u("Confirm the defect before creating the case.");if(ee.cases.some(_=>_.review_id===s.p_review))return u("This saved review already has a case.");const m=Xn(),p=zl(),v={id:m,inspection_id:s.p_inspection,review_id:s.p_review,owner_id:s.p_owner,supervisor_id:s.p_supervisor,confirmed_by:yn,priority:s.p_priority,description:s.p_description,due_at:s.p_due,state:"Open",version:1,created_at:p,resolved_at:null};return ee.cases.unshift(v),ee.history.push({id:Xn(),case_id:m,version:1,actor_id:yn,state:"Open",note:"Human-confirmed defect; case created",created_at:p,snapshot:{owner_id:v.owner_id,supervisor_id:v.supervisor_id,due_at:v.due_at}}),ee.events.push({id:Xn(),case_id:m,version:1,kind:"created",status:"suppressed",attempts:0,last_error:null,created_at:p}),Gn("case"),{data:m,error:null}}if(i==="defectrag_update_corrective_action"){const o=ee.cases.find(d=>d.id===s.p_id);return o?o.owner_id!==yn&&o.supervisor_id!==yn?u("Only the person responsible, the supervisor or a Developer can change this case. In this lesson, choose You (practice) as person responsible or supervisor."):o.version!==s.p_version?u("The case changed. Load the latest case before saving."):!s1(o.state).includes(s.p_state)||String(s.p_note||"").trim().length<3?u("Choose an allowed next status and describe what changed."):(Object.assign(o,{state:s.p_state,version:o.version+1,owner_id:s.p_owner||o.owner_id,supervisor_id:s.p_supervisor||o.supervisor_id,due_at:s.p_due||o.due_at,resolved_at:["Resolved","Closed"].includes(s.p_state)?o.resolved_at||zl():null}),ee.history.push({id:Xn(),case_id:o.id,version:o.version,actor_id:yn,state:o.state,note:String(s.p_note).trim(),created_at:zl(),snapshot:{owner_id:o.owner_id,supervisor_id:o.supervisor_id,due_at:o.due_at}}),Gn("lifecycle",{state:o.state}),{data:o.version,error:null}):u("Practice case not found.")}return u("This action is not part of the practice lesson.")}function Cy(){ee||Sr();const i={id:yn,email:"you@practice.invalid"};return{auth:{getUser:async()=>({data:{user:i},error:null}),getSession:async()=>({data:{session:{user:i,access_token:"PRACTICE_NOT_A_TOKEN"}},error:null}),onAuthStateChange(){return{data:{subscription:{unsubscribe(){}}}}},signOut:async()=>({error:null}),mfa:{listFactors:async()=>({data:{totp:[{id:"practice-factor",friendly_name:"Practice authenticator",status:"verified"}],all:[]},error:null})}},from:_1,rpc:w1,storage:{from:()=>({download:async s=>{const u=s.endsWith("heatmap")?ee==null?void 0:ee.assets.heatmap:ee==null?void 0:ee.assets.original;try{return{data:await(await fetch(u)).blob(),error:null}}catch(o){return{data:null,error:o}}},createSignedUrl:async s=>({data:{signedUrl:s.endsWith("heatmap")?ee==null?void 0:ee.assets.heatmap:ee==null?void 0:ee.assets.original},error:null})})}}}async function S1(){return{client:Cy(),user:{id:yn,email:"you@practice.invalid"},staff:Ny[0]}}let Tg;function Ay(){const i=window.DEFECTRAG_PUBLIC_CONFIG||{};return{url:i.supabaseUrl||"",key:i.supabasePublishableKey||""}}function eo(){if(pc())return!0;const{url:i,key:s}=Ay();let u=s.startsWith("sb_publishable_");if(!u)try{u=JSON.parse(atob(s.split(".")[1].replaceAll("-","+").replaceAll("_","/"))).role==="anon"}catch{u=!1}return/^https:\/\//.test(i)&&u}async function mc(){if(pc())return Cy();if(!eo())throw new Error("Team workspace is not connected. Complete the Supabase setup first.");return Tg||(Tg=br(async()=>{const{createClient:i}=await import("./index-DGhDXxpu.js");return{createClient:i}},[],import.meta.url).then(({createClient:i})=>{const{url:s,key:u}=Ay(),o=i(s,u);return o.auth.onAuthStateChange((d,m)=>{["SIGNED_IN","SIGNED_OUT","TOKEN_REFRESHED","MFA_CHALLENGE_VERIFIED","USER_UPDATED"].includes(d)&&setTimeout(()=>{var p;return window.dispatchEvent(new CustomEvent("defectrag-auth-change",{detail:{event:d,userId:((p=m==null?void 0:m.user)==null?void 0:p.id)||null}}))},0)}),o})),Tg}async function N1(){var m;if(pc())return S1();const i=await mc(),{data:{user:s},error:u}=await i.auth.getUser();if(u||!s)throw new Error("Sign in to the team workspace before sharing.");if(((m=window.DEFECTRAG_PUBLIC_CONFIG)==null?void 0:m.authWorkflowEnabled)===!0){const{requireStaff:p}=await br(async()=>{const{requireStaff:v}=await Promise.resolve().then(()=>Kw);return{requireStaff:v}},void 0,import.meta.url);await p(i)}const{data:o,error:d}=await i.from("staff_members").select("*").eq("user_id",s.id).single();if(d||!o)throw new Error("Your account is not on the staff allowlist. Ask the workspace developer to add it.");return{client:i,user:s,staff:o}}async function T1(i,s,u){const{client:o,user:d}=await N1(),{data:m,error:p}=await o.from("shared_inspections").select("id").eq("id",i.id).maybeSingle();if(p)throw p;if(m)return{alreadyShared:!0};const v=[];for(const[x,j]of[["image",i.image_url],["heatmap",i.heatmap_url]]){const L=await fetch(u(j));if(!L.ok)throw new Error("Could not read the saved inspection image.");const le=await L.blob(),Ne=Array.from(new Uint8Array(await crypto.subtle.digest("SHA-256",await le.arrayBuffer()))).map(I=>I.toString(16).padStart(2,"0")).join(""),je=`${d.id}/${i.id}/${x}-${Ne}.jpg`,{error:te}=await o.storage.from("team-inspections").upload(je,le,{contentType:le.type||"image/jpeg",upsert:!1});if(te&&!(String(te.statusCode)==="409"||["Duplicate","ResourceAlreadyExists","KeyAlreadyExists"].includes(te.code)||/already exists/i.test(te.message||"")&&String(te.statusCode)==="400"))throw te;v.push(je)}const{image_url:_,heatmap_url:O,report_url:g,owner_id:y,...R}=i,{error:Y}=await o.from("shared_inspections").insert({id:i.id,owner_id:d.id,payload:R,conversation:s,image_path:v[0],heatmap_path:v[1]});if(Y)throw Y;return fi(),{alreadyShared:!1}}function fi(){window.dispatchEvent(new Event("defectrag-workspace-change"));try{localStorage.setItem("defectrag-workspace-event",String(Date.now())+Math.random())}catch{}}typeof window<"u"&&typeof window.addEventListener=="function"&&window.addEventListener("storage",i=>{i.key==="defectrag-workspace-event"&&window.dispatchEvent(new Event("defectrag-workspace-change"))});const C1=i=>/exceeded.*(?:ZeroGPU|GPU).*(?:limit|quota)|(?:ZeroGPU|GPU).*(?:quota|limit).*exceed/i.test(i);async function A1(i,s){const u=[],o=[];for(let d=0;ds===i},invalidate(){i++}}}function zy(i,{interval:s=15e3,onState:u=()=>{},target:o=window,documentTarget:d=document}={}){let m=!1,p=!1,v=!1;async function _(){var R,Y,x;if(!m){if(p){v=!0;return}if(((R=o.navigator)==null?void 0:R.onLine)===!1){u({state:"offline"});return}p=!0,u({state:"refreshing"});try{const j=await i();m||(((Y=o.navigator)==null?void 0:Y.onLine)===!1?u({state:"offline"}):(j==null?void 0:j.state)==="blocked"?u(j):j!==!1&&u({state:"synced",at:Date.now()}))}catch(j){m||u(((x=o.navigator)==null?void 0:x.onLine)===!1?{state:"offline"}:{state:"stale",error:j.message})}finally{p=!1,v&&!m&&(v=!1,_())}}}const O=()=>{d.hidden||_()},g=()=>u({state:"offline"}),y=setInterval(O,s);for(const R of["focus","online","defectrag-workspace-change"])o.addEventListener(R,O);return o.addEventListener("offline",g),d.addEventListener("visibilitychange",O),_(),{refresh:_,stop(){m=!0,clearInterval(y);for(const R of["focus","online","defectrag-workspace-change"])o.removeEventListener(R,O);o.removeEventListener("offline",g),d.removeEventListener("visibilitychange",O)}}}let si;function ky(){if(si)return si;try{si=localStorage.getItem("defectrag-private-workspace")}catch{}if(!/^[a-f0-9]{64}$/.test(si||"")){si=Array.from(crypto.getRandomValues(new Uint8Array(32)),i=>i.toString(16).padStart(2,"0")).join("");try{localStorage.setItem("defectrag-private-workspace",si)}catch{}}return si}const z1=i=>i;async function k1(){var o,d;if(!eo())return"";const i=await mc(),{data:s,error:u}=await i.auth.getSession();if(u)throw new Error("Account session could not refresh. Reconnect or sign in again.");if((o=s.session)!=null&&o.expires_at&&s.session.expires_at*1e3new Promise((s,u)=>{const o=new FileReader;o.onload=()=>s(String(o.result).split(",")[1]),o.onerror=()=>u(new Error("Image could not be read")),o.readAsDataURL(i)});async function M1(i,s={}){const u=fc(),o=new URL(i,location.origin).pathname;try{const m=(!s.method||s.method==="GET")&&(/^\/api\/(health|models|evaluation|samples|gallery)(\/|$)/.test(o)||o==="/api/benchmark/official")?"":await k1();let p;if(s.method==="POST"&&["/api/inspect","/api/batch"].includes(o)){const v=s.body,_=v.get("category"),O=v.get("batch")||"",g=o==="/api/batch"?v.getAll("files"):[v.get("file")];if(!g.length||g.length>20||o==="/api/batch"&&!O.trim())throw new Error("Choose 1–20 images and a batch label.");const{records:y,errors:R}=await A1(g,async Y=>{if(Y.size>10*1024*1024)throw new Error("Image limit is 10 MB");return await Cg("/inspect",{image_b64:await D1(Y),filename:Y.name,category:_,batch:O,request_id:v.get("request_id")||""},m,u)});if(o==="/api/inspect"){if(R.length)throw new Error(R[0].message);p=y[0]}else p={records:y,errors:R,batch:O}}else if(s.method==="POST"&&o==="/api/assistant")p=await Cg("/assistant",JSON.parse(s.body),m,u);else{const v=new Headers(s.headers||{});return v.set("X-DefectRAG-Session",ky()),v.set("X-DefectRAG-Workspace",u),m&&v.set("Authorization","Bearer "+m),await fetch(i,{...s,headers:v})}return Response.json({data:p})}catch(d){const m=d.message||"Model request failed",p=/image limit|invalid image|choose 1|supported category|batch label|32px|25 MP|aspect ratio/i.test(m);return Response.json({error:{message:m}},{status:p?422:503})}}function U1(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var Nf={exports:{}},ge={};/** + * @license React + * react.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Ag;function x1(){if(Ag)return ge;Ag=1;var i=Symbol.for("react.transitional.element"),s=Symbol.for("react.portal"),u=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),m=Symbol.for("react.consumer"),p=Symbol.for("react.context"),v=Symbol.for("react.forward_ref"),_=Symbol.for("react.suspense"),O=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),R=Symbol.for("react.view_transition"),Y=Symbol.iterator;function x(w){return w===null||typeof w!="object"?null:(w=Y&&w[Y]||w["@@iterator"],typeof w=="function"?w:null)}var j={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},L=Object.assign,le={};function Ne(w,U,ie){this.props=w,this.context=U,this.refs=le,this.updater=ie||j}Ne.prototype.isReactComponent={},Ne.prototype.setState=function(w,U){if(typeof w!="object"&&typeof w!="function"&&w!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,w,U,"setState")},Ne.prototype.forceUpdate=function(w){this.updater.enqueueForceUpdate(this,w,"forceUpdate")};function je(){}je.prototype=Ne.prototype;function te(w,U,ie){this.props=w,this.context=U,this.refs=le,this.updater=ie||j}var I=te.prototype=new je;I.constructor=te,L(I,Ne.prototype),I.isPureReactComponent=!0;var se=Array.isArray;function Z(){}var W={H:null,A:null,T:null,S:null},$=Object.prototype.hasOwnProperty;function ve(w,U,ie){var G=ie.ref;return{$$typeof:i,type:w,key:U,ref:G!==void 0?G:null,props:ie}}function Ge(w,U){return ve(w.type,U,w.props)}function dt(w){return typeof w=="object"&&w!==null&&w.$$typeof===i}function _t(w){var U={"=":"=0",":":"=2"};return"$"+w.replace(/[=:]/g,function(ie){return U[ie]})}var Ra=/\/+/g;function rt(w,U){return typeof w=="object"&&w!==null&&w.key!=null?_t(""+w.key):U.toString(36)}function Q(w){switch(w.status){case"fulfilled":return w.value;case"rejected":throw w.reason;default:switch(typeof w.status=="string"?w.then(Z,Z):(w.status="pending",w.then(function(U){w.status==="pending"&&(w.status="fulfilled",w.value=U)},function(U){w.status==="pending"&&(w.status="rejected",w.reason=U)})),w.status){case"fulfilled":return w.value;case"rejected":throw w.reason}}throw w}function D(w,U,ie,G,ye){var Ce=typeof w;(Ce==="undefined"||Ce==="boolean")&&(w=null);var ce=!1;if(w===null)ce=!0;else switch(Ce){case"bigint":case"string":case"number":ce=!0;break;case"object":switch(w.$$typeof){case i:case s:ce=!0;break;case g:return ce=w._init,D(ce(w._payload),U,ie,G,ye)}}if(ce)return ye=ye(w),ce=G===""?"."+rt(w,0):G,se(ye)?(ie="",ce!=null&&(ie=ce.replace(Ra,"$&/")+"/"),D(ye,U,ie,"",function(Ae){return Ae})):ye!=null&&(dt(ye)&&(ye=Ge(ye,ie+(ye.key==null||w&&w.key===ye.key?"":(""+ye.key).replace(Ra,"$&/")+"/")+ce)),U.push(ye)),1;ce=0;var X=G===""?".":G+":";if(se(w))for(var F=0;F>>1,he=Q[_e];if(0>>1;_ed(Ve,fe))wd(U,Ve)?(Q[_e]=U,Q[w]=fe,_e=w):(Q[_e]=Ve,Q[aa]=fe,_e=aa);else if(wd(U,fe))Q[_e]=U,Q[w]=fe,_e=w;else break e}}return D}function d(Q,D){var fe=Q.sortIndex-D.sortIndex;return fe!==0?fe:Q.id-D.id}if(i.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var m=performance;i.unstable_now=function(){return m.now()}}else{var p=Date,v=p.now();i.unstable_now=function(){return p.now()-v}}var _=[],O=[],g=1,y=null,R=3,Y=!1,x=!1,j=!1,L=!1,le=typeof setTimeout=="function"?setTimeout:null,Ne=typeof clearTimeout=="function"?clearTimeout:null,je=typeof setImmediate<"u"?setImmediate:null;function te(Q){for(var D=u(O);D!==null;){if(D.callback===null)o(O);else if(D.startTime<=Q)o(O),D.sortIndex=D.expirationTime,s(_,D);else break;D=u(O)}}function I(Q){if(j=!1,te(Q),!x)if(u(_)!==null)x=!0,se||(se=!0,dt());else{var D=u(O);D!==null&&rt(I,D.startTime-Q)}}var se=!1,Z=-1,W=5,$=-1;function ve(){return L?!0:!(i.unstable_now()-$Q&&ve());){var _e=y.callback;if(typeof _e=="function"){y.callback=null,R=y.priorityLevel;var he=_e(y.expirationTime<=Q);if(Q=i.unstable_now(),typeof he=="function"){y.callback=he,te(Q),D=!0;break t}y===u(_)&&o(_),te(Q)}else o(_);y=u(_)}if(y!==null)D=!0;else{var Ye=u(O);Ye!==null&&rt(I,Ye.startTime-Q),D=!1}}break e}finally{y=null,R=fe,Y=!1}D=void 0}}finally{D?dt():se=!1}}}var dt;if(typeof je=="function")dt=function(){je(Ge)};else if(typeof MessageChannel<"u"){var _t=new MessageChannel,Ra=_t.port2;_t.port1.onmessage=Ge,dt=function(){Ra.postMessage(null)}}else dt=function(){le(Ge,0)};function rt(Q,D){Z=le(function(){Q(i.unstable_now())},D)}i.unstable_IdlePriority=5,i.unstable_ImmediatePriority=1,i.unstable_LowPriority=4,i.unstable_NormalPriority=3,i.unstable_Profiling=null,i.unstable_UserBlockingPriority=2,i.unstable_cancelCallback=function(Q){Q.callback=null},i.unstable_forceFrameRate=function(Q){0>Q||125_e?(Q.sortIndex=fe,s(O,Q),u(_)===null&&Q===u(O)&&(j?(Ne(Z),Z=-1):j=!0,rt(I,fe-_e))):(Q.sortIndex=he,s(_,Q),x||Y||(x=!0,se||(se=!0,dt()))),Q},i.unstable_shouldYield=ve,i.unstable_wrapCallback=function(Q){var D=R;return function(){var fe=R;R=D;try{return Q.apply(this,arguments)}finally{R=fe}}}})(Af)),Af}var zg;function q1(){return zg||(zg=1,Cf.exports=H1()),Cf.exports}var Of={exports:{}},Qt={};/** + * @license React + * react-dom.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var kg;function B1(){if(kg)return Qt;kg=1;var i=ad();function s(g){var y="https://react.dev/errors/"+g;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(s){console.error(s)}}return i(),Of.exports=B1(),Of.exports}/** + * @license React + * react-dom-client.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Mg;function j1(){if(Mg)return dr;Mg=1;var i=q1(),s=ad(),u=L1();function o(e){var t="https://react.dev/errors/"+e;if(1oe||(e.current=tn[oe],tn[oe]=null,oe--)}function Ue(e,t){oe++,tn[oe]=e.current,e.current=t}var ke=Rt(null),tt=Rt(null),zt=Rt(null),pa=Rt(null);function $e(e,t){switch(Ue(zt,t),Ue(tt,e),Ue(ke,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?sp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=sp(t),e=op(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}mt(ke),Ue(ke,e)}function Ut(){mt(ke),mt(tt),mt(zt)}function bn(e){var t=e.memoizedState;t!==null&&(lc._currentValue=t.memoizedState,Ue(pa,e)),t=ke.current;var a=op(t,e.type);t!==a&&(Ue(tt,e),Ue(ke,a))}function an(e){tt.current===e&&(mt(ke),mt(tt)),pa.current===e&&(mt(pa),lc._currentValue=Ae)}var de,st;function kt(e){if(de===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);de=t&&t[1]||"",st=-1)":-1l||b[n]!==T[l]){var k=` +`+b[n].replace(" at new "," at ");return e.displayName&&k.includes("")&&(k=k.replace("",e.displayName)),k}while(1<=n&&0<=l);break}}}finally{ga=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?kt(a):""}function za(e,t){switch(e.tag){case 26:case 27:case 5:return kt(e.type);case 16:return kt("Lazy");case 13:return e.child!==t&&t!==null?kt("Suspense Fallback"):kt("Suspense");case 19:return kt("SuspenseList");case 0:case 15:return He(e.type,!1);case 11:return He(e.type.render,!1);case 1:return He(e.type,!0);case 31:return kt("Activity");case 30:return kt("ViewTransition");default:return""}}function xe(e){try{var t="",a=null;do t+=za(e,a),a=e,e=e.return;while(e);return t}catch(n){return` +Error generating stack: `+n.message+` +`+n.stack}}var Ze=Object.prototype.hasOwnProperty,ot=i.unstable_scheduleCallback,Dt=i.unstable_cancelCallback,wt=i.unstable_shouldYield,Xe=i.unstable_requestPaint,We=i.unstable_now,nn=i.unstable_getCurrentPriorityLevel,ln=i.unstable_ImmediatePriority,Qn=i.unstable_UserBlockingPriority,Ya=i.unstable_NormalPriority,Va=i.unstable_LowPriority,gc=i.unstable_IdlePriority,to=i.log,kl=i.unstable_setDisableYieldValue,ht=null,xt=null;function ya(e){if(typeof to=="function"&&kl(e),xt&&typeof xt.setStrictMode=="function")try{xt.setStrictMode(ht,e)}catch{}}var Zt=Math.clz32?Math.clz32:Zn,It=Math.log,ao=Math.LN2;function Zn(e){return e>>>=0,e===0?32:31-(It(e)/ao|0)|0}var En=256,Kn=262144,hi=4194304;function _n(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function pi(e,t,a){var n=e.pendingLanes;if(n===0)return 0;var l=0,c=e.suspendedLanes,f=e.pingedLanes;e=e.warmLanes;var h=n&134217727;return h!==0?(n=h&~c,n!==0?l=_n(n):(f&=h,f!==0?l=_n(f):a||(a=h&~e,a!==0&&(l=_n(a))))):(h=n&~c,h!==0?l=_n(h):f!==0?l=_n(f):a||(a=n&~e,a!==0&&(l=_n(a)))),l===0?0:t!==0&&t!==l&&(t&c)===0&&(c=l&-l,a=t&-t,c>=a||c===32&&(a&4194048)!==0)?t:l}function Dl(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function na(e,t){(t&8)!==0&&(t|=t&32);var a=e.entangledLanes;if(a!==0)for(e=e.entanglements,a&=t;0a;a++)t.push(e);return t}function $n(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function yi(e,t,a,n,l,c){var f=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var h=e.entanglements,b=e.expirationTimes,T=e.hiddenUpdates;for(a=f&~a;0"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ni=!1;if(Ma)try{var nl={};Object.defineProperty(nl,"passive",{get:function(){Ni=!0}}),window.addEventListener("test",nl,nl),window.removeEventListener("test",nl,nl)}catch{Ni=!1}var Za=null,Ti=null,Ll=null;function Sc(){if(Ll)return Ll;var e,t=Ti,a=t.length,n,l="value"in Za?Za.value:Za.textContent,c=l.length;for(e=0;e=Cc),ud=" ",fd=!1;function dd(e,t){switch(e){case"keyup":return Av.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function md(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ci=!1;function Rv(e,t){switch(e){case"compositionend":return md(t);case"keypress":return t.which!==32?null:(fd=!0,ud);case"textInput":return e=t.data,e===ud&&fd?null:e;default:return null}}function zv(e,t){if(Ci)return e==="compositionend"||!so&&dd(e,t)?(e=Sc(),Ll=Ti=Za=null,Ci=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function _d(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function wd(e,t){var a=_d(e);e=0;for(var n;a;){if(a.nodeType===3){if(n=e+a.textContent.length,e<=t&&n>=t)return{node:a,offset:t-e};e=n}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=_d(a)}}function Sd(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Sd(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Nd(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=fo(e.document);t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)e=t.contentWindow;else break;t=fo(e.document)}return t}function mo(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var Bv=Ma&&"documentMode"in document&&11>=document.documentMode,Ai=null,ho=null,zc=null,po=!1;function Td(e,t,a){var n=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;po||Ai==null||Ai!==fo(n)||(n=Ai,"selectionStart"in n&&mo(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),zc&&Rc(zc,n)||(zc=n,n=Ds(ho,"onSelect"),0>=f,l-=f,cn=1<<32-Zt(t)+l|a<me?(Ot=ue,ue=null):Ot=ue.sibling;var Le=S(N,ue,C[me],q);if(Le===null){ue===null&&(ue=Ot);break}e&&ue&&Le.alternate===null&&t(N,ue),E=c(Le,E,me),Me===null?ae=Le:Me.sibling=Le,Me=Le,ue=Ot}if(me===C.length)return a(N,ue),Te&&kn(N,me),ae;if(ue===null){for(;meme?(Ot=ue,ue=null):Ot=ue.sibling;var Al=S(N,ue,Le.value,q);if(Al===null){ue===null&&(ue=Ot);break}e&&ue&&Al.alternate===null&&t(N,ue),E=c(Al,E,me),Me===null?ae=Al:Me.sibling=Al,Me=Al,ue=Ot}if(Le.done)return a(N,ue),Te&&kn(N,me),ae;if(ue===null){for(;!Le.done;me++,Le=C.next())Le=B(N,Le.value,q),Le!==null&&(E=c(Le,E,me),Me===null?ae=Le:Me.sibling=Le,Me=Le);return Te&&kn(N,me),ae}for(ue=n(ue);!Le.done;me++,Le=C.next())Le=A(ue,N,me,Le.value,q),Le!==null&&(e&&(Ot=Le.alternate,Ot!==null&&ue.delete(Ot.key===null?me:Ot.key)),E=c(Le,E,me),Me===null?ae=Le:Me.sibling=Le,Me=Le);return e&&ue.forEach(function(Rb){return t(N,Rb)}),Te&&kn(N,me),ae}function Ee(N,E,C,q){if(typeof C=="object"&&C!==null&&C.type===Ge&&C.key===null&&C.props.ref===void 0&&(C=C.props.children),typeof C=="object"&&C!==null){switch(C.$$typeof){case $:e:{for(var ae=C.key;E!==null;){if(E.key===ae){if(ae=C.type,ae===Ge){if(E.tag===7){a(N,E.sibling),q=l(E,C.props.children),sl(q,C),q.return=N,N=q;break e}}else if(E.elementType===ae||typeof ae=="object"&&ae!==null&&ae.$$typeof===he&&Pl(ae)===E.type){a(N,E.sibling),q=l(E,C.props),sl(q,C),q.return=N,N=q;break e}a(N,E);break}else t(N,E);E=E.sibling}C.type===Ge?(q=Ql(C.props.children,N.mode,q,C.key),sl(q,C),q.return=N,N=q):(q=qr(C.type,C.key,C.props,null,N.mode,q),sl(q,C),q.return=N,N=q)}return f(N);case ve:e:{for(ae=C.key;E!==null;){if(E.key===ae)if(E.tag===4&&E.stateNode.containerInfo===C.containerInfo&&E.stateNode.implementation===C.implementation){a(N,E.sibling),q=l(E,C.children||[]),q.return=N,N=q;break e}else{a(N,E);break}else t(N,E);E=E.sibling}q=wo(C,N.mode,q),q.return=N,N=q}return f(N);case he:return C=Pl(C),Ee(N,E,C,q)}if(ce(C))return J(N,E,C,q);if(G(C)){if(ae=G(C),typeof ae!="function")throw Error(o(150));return C=ae.call(C),re(N,E,C,q)}if(typeof C.then=="function")return Ee(N,E,Kr(C),q);if(C.$$typeof===rt)return Ee(N,E,Vr(N,C),q);Jr(N,C)}return typeof C=="string"&&C!==""||typeof C=="number"||typeof C=="bigint"?(C=""+C,E!==null&&E.tag===6?(a(N,E.sibling),q=l(E,C),q.return=N,N=q):(a(N,E),q=_o(C,N.mode,q),q.return=N,N=q),f(N)):a(N,E)}return function(N,E,C,q){try{Hc=0;var ae=Ee(N,E,C,q);return Hi=null,ae}catch(ue){if(ue===xi||ue===Qr)throw ue;var Me=oa(29,ue,null,N.mode);return Me.lanes=q,Me.return=N,Me}finally{}}}var ei=$d(!0),Id=$d(!1),ol=!1;function Do(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Mo(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function ul(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function fl(e,t,a){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,(Qe&2)!==0){var l=n.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),n.pending=t,t=Hr(e),Md(e,null,a),t}return xr(e,n,t,a),Hr(e)}function qc(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var n=t.lanes;n&=e.pendingLanes,a|=n,t.lanes=a,Ul(e,a)}}function Uo(e,t){var a=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,a===n)){var l=null,c=null;if(a=a.firstBaseUpdate,a!==null){do{var f={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};c===null?l=c=f:c=c.next=f,a=a.next}while(a!==null);c===null?l=c=t:c=c.next=t}else l=c=t;a={baseState:n.baseState,firstBaseUpdate:l,lastBaseUpdate:c,shared:n.shared,callbacks:n.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}var xo=!1;function Bc(){if(xo){var e=Ui;if(e!==null)throw e}}function Lc(e,t,a,n){xo=!1;var l=e.updateQueue;ol=!1;var c=l.firstBaseUpdate,f=l.lastBaseUpdate,h=l.shared.pending;if(h!==null){l.shared.pending=null;var b=h,T=b.next;b.next=null,f===null?c=T:f.next=T,f=b;var k=e.alternate;k!==null&&(k=k.updateQueue,h=k.lastBaseUpdate,h!==f&&(h===null?k.firstBaseUpdate=T:h.next=T,k.lastBaseUpdate=b))}if(c!==null){var B=l.baseState;f=0,k=T=b=null,h=c;do{var S=h.lane&-536870913,A=S!==h.lane;if(A?(De&S)===S:(n&S)===S){S!==0&&S===Il&&(xo=!0),k!==null&&(k=k.next={lane:0,tag:h.tag,payload:h.payload,callback:null,next:null});e:{var J=e,re=h;S=t;var Ee=a;switch(re.tag){case 1:if(J=re.payload,typeof J=="function"){B=J.call(Ee,B,S);break e}B=J;break e;case 3:J.flags=J.flags&-65537|128;case 0:if(J=re.payload,S=typeof J=="function"?J.call(Ee,B,S):J,S==null)break e;B=Z({},B,S);break e;case 2:ol=!0}}S=h.callback,S!==null&&(e.flags|=64,A&&(e.flags|=8192),A=l.callbacks,A===null?l.callbacks=[S]:A.push(S))}else A={lane:S,tag:h.tag,payload:h.payload,callback:h.callback,next:null},k===null?(T=k=A,b=B):k=k.next=A,f|=S;if(h=h.next,h===null){if(h=l.shared.pending,h===null)break;A=h,h=A.next,A.next=null,l.lastBaseUpdate=A,l.shared.pending=null}}while(!0);k===null&&(b=B),l.baseState=b,l.firstBaseUpdate=T,l.lastBaseUpdate=k,c===null&&(l.shared.lanes=0),vl|=f,e.lanes=f,e.memoizedState=B}}function Fd(e,t){if(typeof e!="function")throw Error(o(191,e));e.call(t)}function Pd(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;ec?c:8;var f=X.T,h={};h.types=f!==null?f.types:null,X.T=h,tu(e,!1,t,a);try{var b=l(),T=X.S;if(T!==null&&T(h,b),b!==null&&typeof b=="object"&&typeof b.then=="function"){var k=$v(b,n);Vc(e,t,k,Ca(e))}else Vc(e,t,n,Ca(e))}catch(B){Vc(e,t,{then:function(){},status:"rejected",reason:B},Ca())}finally{F.p=c,f!==null&&h.types!==null&&(f.types=h.types),X.T=f}}function t0(){}function Wo(e,t,a,n){if(e.tag!==5)throw Error(o(476));var l=zm(e).queue;Rm(e,l,t,Ae,a===null?t0:function(){return km(e),a(n)})}function zm(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Ae,baseState:Ae,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:xn,lastRenderedState:Ae},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:xn,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function km(e){var t=zm(e);t.next===null&&(t=e.alternate.memoizedState),Vc(e,t.next.queue,{},Ca())}function eu(){return jt(lc)}function Dm(){return St().memoizedState}function Mm(){return St().memoizedState}function a0(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=Ca();e=ul(a);var n=fl(t,e,a);n!==null&&(ma(n,t,a),qc(n,t,a)),t={cache:Oo()},e.payload=t;return}t=t.return}}function n0(e,t,a){var n=Ca();a={lane:n,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},ls(e)?xm(t,a):(a=bo(e,t,a,n),a!==null&&(ma(a,e,n),Hm(a,t,n)))}function Um(e,t,a){var n=Ca();Vc(e,t,a,n)}function Vc(e,t,a,n){var l={lane:n,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(ls(e))xm(t,l);else{var c=e.alternate;if(e.lanes===0&&(c===null||c.lanes===0)&&(c=t.lastRenderedReducer,c!==null))try{var f=t.lastRenderedState,h=c(f,a);if(l.hasEagerState=!0,l.eagerState=h,_a(h,f))return xr(e,t,l,0),nt===null&&Ur(),!1}catch{}finally{}if(a=bo(e,t,l,n),a!==null)return ma(a,e,n),Hm(a,t,n),!0}return!1}function tu(e,t,a,n){if(n={lane:2,revertLane:Qu(),gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},ls(e)){if(t)throw Error(o(479))}else t=bo(e,a,n,2),t!==null&&ma(t,e,2)}function ls(e){var t=e.alternate;return e===be||t!==null&&t===be}function xm(e,t){qi=Fr=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function Hm(e,t,a){if((a&4194048)!==0){var n=t.lanes;n&=e.pendingLanes,a|=n,t.lanes=a,Ul(e,a)}}var is={readContext:jt,use:es,useCallback:vt,useContext:vt,useEffect:vt,useImperativeHandle:vt,useLayoutEffect:vt,useInsertionEffect:vt,useMemo:vt,useReducer:vt,useRef:vt,useState:vt,useDebugValue:vt,useDeferredValue:vt,useTransition:vt,useSyncExternalStore:vt,useId:vt,useHostTransitionStatus:vt,useFormState:vt,useActionState:vt,useOptimistic:vt,useMemoCache:vt,useCacheRefresh:vt,useEffectEvent:vt},qm={readContext:jt,use:es,useCallback:function(e,t){return Pt().memoizedState=[e,t===void 0?null:t],e},useContext:jt,useEffect:Em,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,as(4194308,4,Nm.bind(null,t,e),a)},useLayoutEffect:function(e,t){return as(4194308,4,e,t)},useInsertionEffect:function(e,t){as(4,2,e,t)},useMemo:function(e,t){var a=Pt();t=t===void 0?null:t;var n=e();if(ti){ya(!0);try{e()}finally{ya(!1)}}return a.memoizedState=[n,t],n},useReducer:function(e,t,a){var n=Pt();if(a!==void 0){var l=a(t);if(ti){ya(!0);try{a(t)}finally{ya(!1)}}}else l=t;return n.memoizedState=n.baseState=l,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:l},n.queue=e,e=e.dispatch=n0.bind(null,be,e),[n.memoizedState,e]},useRef:function(e){var t=Pt();return e={current:e},t.memoizedState=e},useState:function(e){e=Jo(e);var t=e.queue,a=Um.bind(null,be,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:Fo,useDeferredValue:function(e,t){var a=Pt();return Po(a,e,t)},useTransition:function(){var e=Jo(!1);return e=Rm.bind(null,be,e.queue,!0,!1),Pt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var n=be,l=Pt();if(Te){if(a===void 0)throw Error(o(407));a=a()}else{if(a=t(),nt===null)throw Error(o(349));(De&127)!==0||lm(n,t,a)}l.memoizedState=a;var c={value:a,getSnapshot:t};return l.queue=c,Em(cm.bind(null,n,c,e),[e]),n.flags|=2048,Li(9,{destroy:void 0},im.bind(null,n,c,a,t),null),a},useId:function(){var e=Pt(),t=nt.identifierPrefix;if(Te){var a=rn,n=cn;a=(n&~(1<<32-Zt(n)-1)).toString(32)+a,t="_"+t+"R_"+a,a=Pr++,0<\/script>",c=c.removeChild(c.firstChild);break;case"select":c=typeof n.is=="string"?f.createElement("select",{is:n.is}):f.createElement("select"),n.multiple?c.multiple=!0:n.size&&(c.size=n.size);break;default:c=typeof n.is=="string"?f.createElement(l,{is:n.is}):f.createElement(l)}}c[gt]=t,c[Kt]=n;e:for(f=t.child;f!==null;){if(f.tag===5||f.tag===6)c.appendChild(f.stateNode);else if(f.tag!==4&&f.tag!==27&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===t)break e;for(;f.sibling===null;){if(f.return===null||f.return===t)break e;f=f.return}f.sibling.return=f.return,f=f.sibling}t.stateNode=c;e:switch(Xt(c,l,n),l){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}n&&qn(t)}}return ct(t),t.subtreeFlags&=-33554433,hu(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==n&&qn(t);else{if(typeof n!="string"&&t.stateNode===null)throw Error(o(166));if(e=zt.current,Mi(t)){if(e=t.stateNode,a=t.memoizedProps,n=null,l=qt,l!==null)switch(l.tag){case 27:case 5:n=l.memoizedProps}e[gt]=t,e=!!(e.nodeValue===a||n!==null&&n.suppressHydrationWarning===!0||cp(e.nodeValue,a)),e||cl(t,!0)}else e=ar(e).createTextNode(n),e[gt]=t,t.stateNode=e}return ct(t),null;case 31:if(a=t.memoizedState,e===null||e.memoizedState!==null){if(n=Mi(t),a!==null){if(e===null){if(!n)throw Error(o(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(557));e[gt]=t}else Zl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ct(t),e=!1}else a=To(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return t.flags&256?(wa(t),t):(wa(t),null);if((t.flags&128)!==0)throw Error(o(558))}return ct(t),null;case 13:if(n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(l=Mi(t),n!==null&&n.dehydrated!==null){if(e===null){if(!l)throw Error(o(318));if(l=t.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(o(317));l[gt]=t}else Zl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ct(t),l=!1}else l=To(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),l=!0;if(!l)return t.flags&256?(wa(t),t):(wa(t),null)}return wa(t),(t.flags&128)!==0?(t.lanes=a,t):(a=n!==null,e=e!==null&&e.memoizedState!==null,a&&(n=t.child,l=null,n.alternate!==null&&n.alternate.memoizedState!==null&&n.alternate.memoizedState.cachePool!==null&&(l=n.alternate.memoizedState.cachePool.pool),c=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(c=n.memoizedState.cachePool.pool),c!==l&&(n.flags|=2048)),a!==e&&a&&(t.child.flags|=8192),fs(t,t.updateQueue),ct(t),null);case 4:return Ut(),e===null&&$u(t.stateNode.containerInfo),t.flags|=67108864,ct(t),null;case 10:return Mn(t.type),ct(t),null;case 19:if(Lo(t),n=t.memoizedState,n===null)return ct(t),null;if(l=(t.flags&128)!==0,c=n.rendering,c===null)if(l)Qc(n,!1);else{if(bt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(c=Ir(e),c!==null){for(t.flags|=128,Qc(n,!1),e=c.updateQueue,t.updateQueue=e,fs(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)Ud(a,e),a=a.sibling;return jc(t,Yt.current&1|2),Te&&kn(t,n.treeForkCount),t.child}e=e.sibling}n.tail!==null&&We()>Ss&&(t.flags|=128,l=!0,Qc(n,!1),t.lanes=4194304)}else{if(!l)if(e=Ir(c),e!==null){if(t.flags|=128,l=!0,e=e.updateQueue,t.updateQueue=e,fs(t,e),Qc(n,!0),n.tail===null&&n.tailMode!=="collapsed"&&n.tailMode!=="visible"&&!c.alternate&&!Te)return ct(t),null}else 2*We()-n.renderingStartTime>Ss&&a!==536870912&&(t.flags|=128,l=!0,Qc(n,!1),t.lanes=4194304);n.isBackwards?(c.sibling=t.child,t.child=c):(e=n.last,e!==null?e.sibling=c:t.child=c,n.last=c)}if(n.tail!==null){e=n.tail;e:{for(a=e;a!==null;){if(a.alternate!==null){a=!1;break e}a=a.sibling}a=!0}return n.rendering=e,n.tail=e.sibling,n.renderingStartTime=We(),e.sibling=null,c=Yt.current,c=l?c&1|2:c&1,n.tailMode==="visible"||n.tailMode==="collapsed"||!a||Te?jc(t,c):(a=c,Ue(Gt,t),Ue(Yt,a),Jt===null&&(Jt=t)),Te&&kn(t,n.treeForkCount),e}return ct(t),null;case 22:case 23:return wa(t),qo(),n=t.memoizedState!==null,e!==null?e.memoizedState!==null!==n&&(t.flags|=8192):n&&(t.flags|=8192),n?(a&536870912)!==0&&(t.flags&128)===0&&(ct(t),t.subtreeFlags&6&&(t.flags|=8192)):ct(t),a=t.updateQueue,a!==null&&fs(t,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),n=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),n!==a&&(t.flags|=2048),e!==null&&mt(Fl),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),Mn(Tt),ct(t),null;case 25:return null;case 30:return t.flags|=33554432,ct(t),null}throw Error(o(156,t.tag))}function u0(e,t){switch(So(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Mn(Tt),Ut(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return an(t),null;case 31:if(t.memoizedState!==null){if(wa(t),t.alternate===null)throw Error(o(340));Zl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(wa(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));Zl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Lo(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return Ut(),null;case 10:return Mn(t.type),null;case 22:case 23:return wa(t),qo(),e!==null&&mt(Fl),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Mn(Tt),null;case 25:return null;default:return null}}function sh(e,t){switch(So(t),t.tag){case 3:Mn(Tt),Ut();break;case 26:case 27:case 5:an(t);break;case 4:Ut();break;case 31:t.memoizedState!==null&&wa(t);break;case 13:wa(t);break;case 19:Lo(t);break;case 10:Mn(t.type);break;case 22:case 23:wa(t),qo(),e!==null&&mt(Fl);break;case 24:Mn(Tt)}}function Zc(e,t){try{var a=t.updateQueue,n=a!==null?a.lastEffect:null;if(n!==null){var l=n.next;a=l;do{if((a.tag&e)===e){n=void 0;var c=a.create,f=a.inst;n=c(),f.destroy=n}a=a.next}while(a!==l)}}catch(h){Fe(t,t.return,h)}}function pl(e,t,a){try{var n=t.updateQueue,l=n!==null?n.lastEffect:null;if(l!==null){var c=l.next;n=c;do{if((n.tag&e)===e){var f=n.inst,h=f.destroy;if(h!==void 0){f.destroy=void 0,l=t;var b=a,T=h;try{T()}catch(k){Fe(l,b,k)}}}n=n.next}while(n!==c)}}catch(k){Fe(t,t.return,k)}}function oh(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{Pd(t,a)}catch(n){Fe(e,e.return,n)}}}function uh(e,t,a){a.props=ai(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(n){Fe(e,t,n)}}function sn(e,t){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var n=e.stateNode;break;case 30:var l=e.stateNode,c=On(e.memoizedProps,l);(l.ref===null||l.ref.name!==c)&&(l.ref=yp(c)),n=l.ref;break;case 7:if(e.stateNode===null){var f=new Aa(e);y(e.child,!1,eb,f,void 0,void 0),e.stateNode=f}n=e.stateNode;break;default:n=e.stateNode}typeof a=="function"?e.refCleanup=a(n):a.current=n}}catch(h){Fe(e,t,h)}}function Vt(e,t){var a=e.ref,n=e.refCleanup;if(a!==null)if(typeof n=="function")try{n()}catch(l){Fe(e,t,l)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(l){Fe(e,t,l)}else a.current=null}function ds(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var a=0;a title"))),Xt(n,t,a),n[gt]=e,Nt(n),t=n;break e;case"link":if(c=Up("link","href",l).get(t+(a.href||""))){for(f=0;fEe&&(f=Ee,Ee=re,re=f);var N=wd(h,re),E=wd(h,Ee);if(N&&E&&(A.rangeCount!==1||A.anchorNode!==N.node||A.anchorOffset!==N.offset||A.focusNode!==E.node||A.focusOffset!==E.offset)){var C=B.createRange();C.setStart(N.node,N.offset),A.removeAllRanges(),re>Ee?(A.addRange(C),A.extend(E.node,E.offset)):(C.setEnd(E.node,E.offset),A.addRange(C))}}}}for(B=[],A=h;A=A.parentNode;)A.nodeType===1&&B.push({element:A,left:A.scrollLeft,top:A.scrollTop});for(typeof h.focus=="function"&&h.focus(),h=0;ha?32:a,X.T=null,a=xu,xu=null;var c=Wa,f=hn;if(pt=0,ci=Wa=null,hn=0,(Qe&6)!==0)throw Error(o(331));var h=Qe;if(Qe|=4,Mh(c.current),zh(c,c.current,f,a),Qe=h,Wc(0,!1),xt&&typeof xt.onPostCommitFiberRoot=="function")try{xt.onPostCommitFiberRoot(ht,c)}catch{}return!0}finally{F.p=l,X.T=n,Jh(e,t)}}function $h(e,t,a){t=xa(a,t),t=lu(e.stateNode,t,2),e=fl(e,t,2),e!==null&&($n(e,2),pn(e))}function Fe(e,t,a){if(e.tag===3)$h(e,e,a);else for(;t!==null;){if(t.tag===3){$h(t,e,a);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(bl===null||!bl.has(n))){e=xa(a,e),a=Qm(2),n=fl(t,a,2),n!==null&&(Zm(a,n,t,e),$n(n,2),pn(n));break}}t=t.return}}function Yu(e,t,a){var n=e.pingCache;if(n===null){n=e.pingCache=new h0;var l=new Set;n.set(t,l)}else l=n.get(t),l===void 0&&(l=new Set,n.set(t,l));l.has(a)||(Du=!0,l.add(a),e=w0.bind(null,e,t,a),t.then(e,e))}function w0(e,t,a){var n=e.pingCache;n!==null&&n.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,nt===e&&(De&a)===a&&((bt===4||bt===3&&(De&62914560)===De&&300>We()-ws)&&(Qe&2)===0?Ii(e,0):_s|=a,Qi===De&&(Qi=0)),pn(e)}function Ih(e,t){t===0&&(t=yc()),e=Xl(e,t),e!==null&&($n(e,t),pn(e))}function S0(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),Ih(e,a)}function N0(e,t){var a=0;switch(e.tag){case 31:case 13:var n=e.stateNode,l=e.memoizedState;l!==null&&(a=l.retryLane);break;case 19:n=e.stateNode;break;case 22:n=e.stateNode._retryCache;break;default:throw Error(o(314))}n!==null&&n.delete(t),Ih(e,a)}function T0(e,t){return ot(e,t)}var Pi=null,Wi=null,Vu=!1,zs=!1,Xu=!1,_l=0;function pn(e){e!==Wi&&e.next===null&&(Wi===null?Pi=Wi=e:Wi=Wi.next=e),zs=!0,Vu||(Vu=!0,A0())}function Wc(e,t){if(!Xu&&zs){Xu=!0;do for(var a=!1,n=Pi;n!==null;){if(e!==0){var l=n.pendingLanes;if(l===0)var c=0;else{var f=n.suspendedLanes,h=n.pingedLanes;c=(1<<31-Zt(42|e)+1)-1,c&=l&~(f&~h),c=c&201326741?c&201326741|1:c?c|2:0}c!==0&&(a=!0,ep(n,c))}else c=De,c=pi(n,n===nt?c:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),(c&3)===0||Dl(n,c)||(a=!0,ep(n,c));n=n.next}while(a);Xu=!1}}function C0(){Fh()}function Fh(){zs=Vu=!1;var e=0;_l!==0&&B0()&&(e=_l);for(var t=We(),a=null,n=Pi;n!==null;){var l=n.next,c=Ph(n,t);c===0?(n.next=null,a===null?Pi=l:a.next=l,l===null&&(Wi=a)):(a=n,(e!==0||(c&3)!==0)&&(zs=!0)),n=l}pt!==0&&pt!==5||Wc(e),_l!==0&&(_l=0)}function Ph(e,t){for(var a=e.suspendedLanes,n=e.pingedLanes,l=e.expirationTimes,c=e.pendingLanes&-62914561;0h)break;var k=b.transferSize,B=b.initiatorType;k&&rp(B)&&(b=b.responseEnd,f+=k*(bxs){re.length=J;break}C=new Promise(X0.bind(C)),re.push(C)}}}if(0"u"?null:document;function zp(e,t,a){var n=tc;if(n&&typeof t=="string"&&t){var l=Ft(t);l='link[rel="'+e+'"][href="'+l+'"]',typeof a=="string"&&(l+='[crossorigin="'+a+'"]'),Rp.has(l)||(Rp.add(l),e={rel:e,crossOrigin:a,href:t},n.querySelector(l)===null&&(t=n.createElement("link"),Xt(t,"link",e),Nt(t),n.head.appendChild(t)))}}function ob(e){Ln.D(e),zp("dns-prefetch",e,null)}function ub(e,t){Ln.C(e,t),zp("preconnect",e,t)}function fb(e,t,a){Ln.L(e,t,a);var n=tc;if(n&&e&&t){var l='link[rel="preload"][as="'+Ft(t)+'"]';t==="image"&&a&&a.imageSrcSet?(l+='[imagesrcset="'+Ft(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(l+='[imagesizes="'+Ft(a.imageSizes)+'"]')):l+='[href="'+Ft(e)+'"]';var c=l;switch(t){case"style":c=ac(e);break;case"script":c=nc(e)}if(!(Ga.has(c)||(e=Z({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),Ga.set(c,e),n.querySelector(l)!==null||t==="style"&&n.querySelector(lr(c))||t==="script"&&n.querySelector(ir(c))))){var f=n.createElement("link");Xt(f,"link",e),t==="style"&&(f[Da]=!0,f.onload=f.onerror=function(){Cr(f)}),Nt(f),n.head.appendChild(f)}}}function db(e,t){Ln.m(e,t);var a=tc;if(a&&e){var n=t&&typeof t.as=="string"?t.as:"script",l='link[rel="modulepreload"][as="'+Ft(n)+'"][href="'+Ft(e)+'"]',c=l;switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":c=nc(e)}if(!Ga.has(c)&&(e=Z({rel:"modulepreload",href:e},t),Ga.set(c,e),a.querySelector(l)===null)){switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(ir(c)))return}n=a.createElement("link"),Xt(n,"link",e),Nt(n),a.head.appendChild(n)}}}function mb(e,t,a){Ln.S(e,t,a);var n=tc;if(n&&e){var l=Tn(n).hoistableStyles,c=ac(e);t=t||"default";var f=l.get(c);if(!f){var h={loading:0,preload:null};if(f=n.querySelector(lr(c)))h.loading=5;else{e=Z({rel:"stylesheet",href:e,"data-precedence":t},a),(a=Ga.get(c))&&df(e,a);var b=f=n.createElement("link");Nt(b),Xt(b,"link",e),b._p=new Promise(function(T,k){b.onload=T,b.onerror=k}),b.addEventListener("load",function(){h.loading|=1}),b.addEventListener("error",function(){h.loading|=2}),h.loading|=4,Ms(f,t,n)}f={type:"stylesheet",instance:f,count:1,state:h},l.set(c,f)}}}function hb(e,t){Ln.X(e,t);var a=tc;if(a&&e){var n=Tn(a).hoistableScripts,l=nc(e),c=n.get(l);c||(c=a.querySelector(ir(l)),c||(e=Z({src:e,async:!0},t),(t=Ga.get(l))&&mf(e,t),c=a.createElement("script"),Nt(c),Xt(c,"link",e),a.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},n.set(l,c))}}function pb(e,t){Ln.M(e,t);var a=tc;if(a&&e){var n=Tn(a).hoistableScripts,l=nc(e),c=n.get(l);c||(c=a.querySelector(ir(l)),c||(e=Z({src:e,async:!0,type:"module"},t),(t=Ga.get(l))&&mf(e,t),c=a.createElement("script"),Nt(c),Xt(c,"link",e),a.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},n.set(l,c))}}function kp(e,t,a,n){var l=(l=zt.current)?nr(l):null;if(!l)throw Error(o(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(a=ac(a.href),t=Tn(l).hoistableStyles,n=t.get(a),n||(n={type:"style",instance:null,count:0,state:null},t.set(a,n)),n):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=ac(a.href);var c=Tn(l).hoistableStyles,f=c.get(e);if(f||(l=l.ownerDocument||l,f={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},c.set(e,f),(c=l.querySelector(lr(e)))?c._p||(f.instance=c,f.state.loading=5):(c=Ga.get(e),c||(c={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},Ga.set(e,c)),gb(l,e,c,f.state))),t&&n===null)throw Error(o(528,""));return f}if(t&&n!==null)throw Error(o(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(a=nc(a),t=Tn(l).hoistableScripts,n=t.get(a),n||(n={type:"script",instance:null,count:0,state:null},t.set(a,n)),n):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,e))}}function ac(e){return'href="'+Ft(e)+'"'}function lr(e){return'link[rel="stylesheet"]['+e+"]"}function Dp(e){return Z({},e,{"data-precedence":e.precedence,precedence:null})}function gb(e,t,a,n){if(t=e.querySelector('link[rel="preload"][as="style"]['+t+"]")){if(t[Da]!==!0){n.loading=1;return}}else t=e.createElement("link"),t[Da]=!0,t.onload=t.onerror=Cr.bind(null,t),Xt(t,"link",a),Nt(t),e.head.appendChild(t);n.preload=t,t.addEventListener("load",function(){return n.loading|=1}),t.addEventListener("error",function(){return n.loading|=2})}function nc(e){return'[src="'+Ft(e)+'"]'}function ir(e){return"script[async]"+e}function Mp(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var n=e.querySelector('style[data-href~="'+Ft(a.href)+'"]');if(n)return t.instance=n,Nt(n),n;var l=Z({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return n=(e.ownerDocument||e).createElement("style"),Nt(n),Xt(n,"style",l),Ms(n,a.precedence,e),t.instance=n;case"stylesheet":l=ac(a.href);var c=e.querySelector(lr(l));if(c)return t.state.loading|=4,t.instance=c,Nt(c),c;n=Dp(a),(l=Ga.get(l))&&df(n,l),c=(e.ownerDocument||e).createElement("link"),Nt(c);var f=c;return f._p=new Promise(function(h,b){f.onload=h,f.onerror=b}),Xt(c,"link",n),t.state.loading|=4,Ms(c,a.precedence,e),t.instance=c;case"script":return c=nc(a.src),(l=e.querySelector(ir(c)))?(t.instance=l,Nt(l),l):(n=a,(l=Ga.get(c))&&(n=Z({},a),mf(n,l)),e=e.ownerDocument||e,l=e.createElement("script"),Nt(l),Xt(l,"link",n),e.head.appendChild(l),t.instance=l);case"void":return null;default:throw Error(o(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(n=t.instance,t.state.loading|=4,Ms(n,a.precedence,e));return t.instance}function Ms(e,t,a){for(var n=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),l=n.length?n[n.length-1]:null,c=l,f=0;f title"):null)}function yb(e,t,a){if(a===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function xp(e,t){return e==="img"&&t.src!=null&&t.src!==""&&t.onLoad==null&&t.loading!=="lazy"}function Hp(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function qp(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function Bp(e,t){typeof t.decode=="function"&&(e.imgCount++,t.complete||(e.imgBytes+=qp(t),e.suspenseyImages.push(t)),e=Eb.bind(e),t.decode().then(e,e))}function vb(e,t,a,n){if(a.type==="stylesheet"&&(typeof n.media!="string"||matchMedia(n.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var l=ac(n.href),c=t.querySelector(lr(l));if(c){t=c._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=cr.bind(e),t.then(e,e)),a.state.loading|=4,a.instance=c,Nt(c);return}c=t.ownerDocument||t,n=Dp(n),(l=Ga.get(l))&&df(n,l),c=c.createElement("link"),Nt(c);var f=c;f._p=new Promise(function(h,b){f.onload=h,f.onerror=b}),Xt(c,"link",n),a.instance=c}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=cr.bind(e),t.addEventListener("load",a),t.addEventListener("error",a))}}var xs=0;function bb(e,t){return e.stylesheets&&e.count===0&&qs(e,e.stylesheets),0xs?50:800)+t);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(n),clearTimeout(l)}}:null}function Lp(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)qs(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function cr(){this.count--,Lp(this)}function Eb(){this.imgCount--,Lp(this)}var Hs=null;function qs(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Hs=new Map,t.forEach(_b,e),Hs=null,cr.call(e))}function _b(e,t){if(!(t.state.loading&4)){var a=Hs.get(e);if(a)var n=a.get(null);else{a=new Map,Hs.set(e,a);for(var l=e.querySelectorAll("link[data-precedence],style[data-precedence]"),c=0;c"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(s){console.error(s)}}return i(),Tf.exports=j1(),Tf.exports}var Y1=G1();/** + * @license lucide-react v0.577.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Dy=(...i)=>i.filter((s,u,o)=>!!s&&s.trim()!==""&&o.indexOf(s)===u).join(" ").trim();/** + * @license lucide-react v0.577.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const V1=i=>i.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/** + * @license lucide-react v0.577.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const X1=i=>i.replace(/^([A-Z])|[\s-_]+(\w)/g,(s,u,o)=>o?o.toUpperCase():u.toLowerCase());/** + * @license lucide-react v0.577.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const xg=i=>{const s=X1(i);return s.charAt(0).toUpperCase()+s.slice(1)};/** + * @license lucide-react v0.577.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */var Q1={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** + * @license lucide-react v0.577.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Z1=i=>{for(const s in i)if(s.startsWith("aria-")||s==="role"||s==="title")return!0;return!1};/** + * @license lucide-react v0.577.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const K1=M.forwardRef(({color:i="currentColor",size:s=24,strokeWidth:u=2,absoluteStrokeWidth:o,className:d="",children:m,iconNode:p,...v},_)=>M.createElement("svg",{ref:_,...Q1,width:s,height:s,stroke:i,strokeWidth:o?Number(u)*24/Number(s):u,className:Dy("lucide",d),...!m&&!Z1(v)&&{"aria-hidden":"true"},...v},[...p.map(([O,g])=>M.createElement(O,g)),...Array.isArray(m)?m:[m]]));/** + * @license lucide-react v0.577.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Oe=(i,s)=>{const u=M.forwardRef(({className:o,...d},m)=>M.createElement(K1,{ref:m,iconNode:s,className:Dy(`lucide-${V1(xg(i))}`,`lucide-${i}`,o),...d}));return u.displayName=xg(i),u};/** + * @license lucide-react v0.577.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const J1=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]],$1=Oe("archive",J1);/** + * @license lucide-react v0.577.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const I1=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],F1=Oe("arrow-left",I1);/** + * @license lucide-react v0.577.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const P1=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],oc=Oe("arrow-right",P1);/** + * @license lucide-react v0.577.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const W1=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],di=Oe("arrow-up-right",W1);/** + * @license lucide-react v0.577.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const e_=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],My=Oe("bell",e_);/** + * @license lucide-react v0.577.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const t_=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],Nr=Oe("book-open",t_);/** + * @license lucide-react v0.577.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const a_=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],n_=Oe("chart-column",a_);/** + * @license lucide-react v0.577.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const l_=[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]],Hg=Oe("check-check",l_);/** + * @license lucide-react v0.577.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const i_=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Gf=Oe("check",i_);/** + * @license lucide-react v0.577.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const c_=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Qs=Oe("circle-question-mark",c_);/** + * @license lucide-react v0.577.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const r_=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}],["path",{d:"M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662",key:"154egf"}]],qg=Oe("circle-user",r_);/** + * @license lucide-react v0.577.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const s_=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"m9 14 2 2 4-4",key:"df797q"}]],o_=Oe("clipboard-check",s_);/** + * @license lucide-react v0.577.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const u_=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Uy=Oe("copy",u_);/** + * @license lucide-react v0.577.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const f_=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],d_=Oe("cpu",f_);/** + * @license lucide-react v0.577.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const m_=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"22",x2:"18",y1:"12",y2:"12",key:"l9bcsi"}],["line",{x1:"6",x2:"2",y1:"12",y2:"12",key:"13hhkx"}],["line",{x1:"12",x2:"12",y1:"6",y2:"2",key:"10w3f3"}],["line",{x1:"12",x2:"12",y1:"22",y2:"18",key:"15g9kq"}]],h_=Oe("crosshair",m_);/** + * @license lucide-react v0.577.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const p_=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],g_=Oe("download",p_);/** + * @license lucide-react v0.577.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const y_=[["path",{d:"m15 15 6 6",key:"1s409w"}],["path",{d:"m15 9 6-6",key:"ko1vev"}],["path",{d:"M21 16v5h-5",key:"1ck2sf"}],["path",{d:"M21 8V3h-5",key:"1qoq8a"}],["path",{d:"M3 16v5h5",key:"1t08am"}],["path",{d:"m3 21 6-6",key:"wwnumi"}],["path",{d:"M3 8V3h5",key:"1ln10m"}],["path",{d:"M9 9 3 3",key:"v551iv"}]],v_=Oe("expand",y_);/** + * @license lucide-react v0.577.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const b_=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],E_=Oe("file-text",b_);/** + * @license lucide-react v0.577.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const __=[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]],Bg=Oe("flask-conical",__);/** + * @license lucide-react v0.577.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const w_=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],Lg=Oe("history",w_);/** + * @license lucide-react v0.577.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const S_=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],jg=Oe("layers",S_);/** + * @license lucide-react v0.577.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const N_=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],xy=Oe("layout-dashboard",N_);/** + * @license lucide-react v0.577.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const T_=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],uc=Oe("loader-circle",T_);/** + * @license lucide-react v0.577.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const C_=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],A_=Oe("menu",C_);/** + * @license lucide-react v0.577.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const O_=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],R_=Oe("message-square",O_);/** + * @license lucide-react v0.577.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const z_=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],k_=Oe("moon",z_);/** + * @license lucide-react v0.577.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const D_=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],M_=Oe("plus",D_);/** + * @license lucide-react v0.577.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const U_=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],x_=Oe("rotate-ccw",U_);/** + * @license lucide-react v0.577.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const H_=[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["path",{d:"M7 12h10",key:"b7w52i"}]],Fs=Oe("scan-line",H_);/** + * @license lucide-react v0.577.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const q_=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],B_=Oe("search",q_);/** + * @license lucide-react v0.577.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const L_=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Ps=Oe("shield-check",L_);/** + * @license lucide-react v0.577.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const j_=[["path",{d:"M8 19H5c-1 0-2-1-2-2V7c0-1 1-2 2-2h3",key:"lubmu8"}],["path",{d:"M16 5h3c1 0 2 1 2 2v10c0 1-1 2-2 2h-3",key:"1ag34g"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]],G_=Oe("square-split-horizontal",j_);/** + * @license lucide-react v0.577.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Y_=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],V_=Oe("sun",Y_);/** + * @license lucide-react v0.577.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const X_=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Q_=Oe("triangle-alert",X_);/** + * @license lucide-react v0.577.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Z_=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],K_=Oe("upload",Z_);/** + * @license lucide-react v0.577.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const J_=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],mi=Oe("x",J_);/** + * @license lucide-react v0.577.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const $_=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]],I_=Oe("zoom-in",$_);/** + * @license lucide-react v0.577.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const F_=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]],P_=Oe("zoom-out",F_),mr=1e3,oi=200;function W_(i){if(i.length<2)return i.length?`M${i[0][0]} ${i[0][1]}`:"";let s=`M${i[0][0]} ${i[0][1]}`;for(let u=0;unew Date(i+"T00:00").toLocaleDateString(void 0,{day:"numeric",month:"short"});function ew({series:i}){const s=Math.max(1,...i.map(_=>_.total));if(!i.some(_=>_.total))return r.createElement("div",{className:"chart-empty"},"No inspections in this period yet.");const u=_=>i.length===1?mr/2:_*mr/(i.length-1),o=_=>oi-6-_/s*(oi-24),d=_=>W_(i.map((O,g)=>[u(g),o(O[_])])),m=_=>d(_)+` L${mr} ${oi} L0 ${oi}Z`,p=i.reduce((_,O)=>_+O.total,0),v=i.reduce((_,O)=>_+O.unusual,0);return r.createElement("figure",{style:{margin:0},"aria-label":`${p} inspections in this period, ${v} unusual or close to the limit`},r.createElement("svg",{viewBox:`0 0 ${mr} ${oi}`,preserveAspectRatio:"none",role:"img","aria-hidden":"true"},r.createElement("defs",null,r.createElement("linearGradient",{id:"chart-all",x1:"0",y1:"0",x2:"0",y2:"1"},r.createElement("stop",{offset:"0",stopColor:"var(--chart-2)",stopOpacity:".35"}),r.createElement("stop",{offset:"1",stopColor:"var(--chart-2)",stopOpacity:".03"})),r.createElement("linearGradient",{id:"chart-unusual",x1:"0",y1:"0",x2:"0",y2:"1"},r.createElement("stop",{offset:"0",stopColor:"var(--bad)",stopOpacity:".3"}),r.createElement("stop",{offset:"1",stopColor:"var(--bad)",stopOpacity:".03"}))),[.25,.5,.75].map(_=>r.createElement("line",{key:_,x1:"0",x2:mr,y1:oi*_,y2:oi*_,stroke:"var(--border)",strokeWidth:"1",vectorEffect:"non-scaling-stroke"})),r.createElement("path",{d:m("total"),fill:"url(#chart-all)",stroke:"var(--chart-2)",strokeWidth:"2",vectorEffect:"non-scaling-stroke"}),r.createElement("path",{d:m("unusual"),fill:"url(#chart-unusual)",stroke:"var(--bad)",strokeWidth:"2",vectorEffect:"non-scaling-stroke"})),r.createElement("div",{className:"chart-axis"},r.createElement("span",null,Rf(i[0].date)),r.createElement("span",null,Rf(i[Math.floor(i.length/2)].date)),r.createElement("span",null,Rf(i.at(-1).date))),r.createElement("figcaption",{className:"chart-legend"},r.createElement("span",null,r.createElement("i",{style:{background:"var(--chart-2)"}}),"All results · ",p),r.createElement("span",null,r.createElement("i",{style:{background:"var(--bad)"}}),"Unusual or closer look · ",v)))}var zf={version:"2.1.0",commit:"7469737",built:"2026-11-20"};const Gg=15,Rl=[],Oa=typeof zf=="object"&&zf?zf:{version:"dev",commit:"local",built:""},Hy=i=>String(i||"").replace(/[\w.+-]+@[\w-]+\.[\w.-]+/g,"[email]").replace(/eyJ[\w-]+\.[\w-]+\.[\w-]+/g,"[token]").replace(/(bearer|apikey|key|token)=?\s*[\w-]{16,}/gi,"$1 [hidden]").slice(0,300);function nd(i,s,u={}){const o=String(u.path||"").split("?")[0].replace(/[0-9a-f]{8,}/gi,":id");Rl.push({at:new Date().toISOString(),kind:i,message:Hy(s),status:u.status??null,path:o}),Rl.length>Gg&&Rl.splice(0,Rl.length-Gg)}function tw(){return Rl.slice()}function qy(i={},s=globalThis){const u=s.navigator||{},o=s.innerWidth?s.innerWidth+"×"+s.innerHeight:"unknown",d=["DefectRAG diagnostic details","Version: "+Oa.version+" · build "+Oa.commit+(Oa.built?" · "+Oa.built:""),"Page: "+(i.page||"unknown")+" · mode: "+(i.mode||"unknown")+" · sync: "+(i.sync||"unknown"),"Signed in: "+(i.signedIn?"yes":"no")+" · workspace: "+(i.workspace||"unknown"),"Screen: "+o+" · theme: "+(i.theme||"unknown")+" · text size: "+(i.textSize?Math.round(i.textSize*100)+"%":"unknown"),"Browser: "+Hy(u.userAgent||"unknown"),"Online: "+(u.onLine===!1?"no":"yes"),"Time: "+new Date().toISOString(),"","Recent problems ("+Rl.length+"):"];Rl.length||d.push("none recorded in this tab");for(const m of Rl.slice().reverse())d.push("- "+m.at+" · "+m.kind+(m.status?" "+m.status:"")+(m.path?" · "+m.path:"")+" · "+m.message);return d.join(` +`)}class aw extends r.Component{constructor(s){super(s),this.state={error:null,copied:!1}}static getDerivedStateFromError(s){return{error:s}}componentDidCatch(s,u){nd("screen",((s==null?void 0:s.message)||String(s))+" "+String((u==null?void 0:u.componentStack)||"").trim().split(` +`)[0],{path:this.props.resetKey})}componentDidUpdate(s){s.resetKey!==this.props.resetKey&&this.state.error&&this.setState({error:null,copied:!1})}async copy(){var s,u;try{await navigator.clipboard.writeText(qy(((u=(s=this.props).context)==null?void 0:u.call(s))||{})),this.setState({copied:!0})}catch{this.setState({copied:!1})}}render(){return this.state.error?r.createElement("section",{className:"card crash-card",role:"alert"},r.createElement("div",{className:"crash-icon"},r.createElement(Q_,{size:28})),r.createElement("h2",null,"This page could not be shown"),r.createElement("p",null,"Your saved work is safe. Try the page again, or go back to the overview."),r.createElement("div",{className:"button-row"},r.createElement("button",{type:"button",className:"primary",onClick:()=>this.setState({error:null,copied:!1})},r.createElement(x_,{size:17})," Try again"),r.createElement("button",{type:"button",className:"secondary",onClick:()=>{var s,u;return(u=(s=this.props).onHome)==null?void 0:u.call(s)}},r.createElement(xy,{size:17})," Go to Overview"),r.createElement("button",{type:"button",className:"secondary",onClick:()=>this.copy()},r.createElement(Uy,{size:17})," ",this.state.copied?"Details copied":"Copy details for support"))):this.props.children}}const Yg={408:"The server took too long to answer. Try again.",413:"The upload is too large. Use images up to 10 MB each.",429:"The service is busy right now. Wait a moment and try again.",502:"The online app is starting or restarting. Wait about a minute, then try again.",503:"The online app is starting or restarting. Wait about a minute, then try again.",504:"The server took too long to answer. Wait a moment and try again."};function nw(i){return Yg[i]?Yg[i]:i>=500?"The server hit an unexpected problem. Try again. If it keeps happening, copy the details from Help & references and send them to the administrator.":i===401||i===403?"This account cannot open that. Check the sign-in in Staff workspace.":i===404?"That item was not found. It may have been archived or removed. Refresh and try again.":"The server reply could not be read. Refresh the page and try again."}async function lw(i,s=""){var p;let u="";try{u=await i.text()}catch{}let o;if(u)try{o=JSON.parse(u)}catch{o=void 0}if(i.ok&&o!==void 0)return o==null?void 0:o.data;const m=((p=o==null?void 0:o.error)==null?void 0:p.message)||(typeof(o==null?void 0:o.detail)=="string"?o.detail:"")||nw(i.ok?0:i.status);throw nd("api",m,{status:i.status,path:s}),Object.assign(new Error(m),{status:i.status})}const By="defectrag-theme";function iw(i=globalThis.localStorage,s=globalThis.matchMedia){try{const u=i==null?void 0:i.getItem(By);if(u==="light"||u==="dark")return u}catch{}try{return s!=null&&s("(prefers-color-scheme: dark)").matches?"dark":"light"}catch{return"light"}}function cw(i,s=(o=>(o=globalThis.document)==null?void 0:o.documentElement)(),u=globalThis.localStorage){s==null||s.classList.toggle("dark",i==="dark");try{u==null||u.setItem(By,i)}catch{}}const Ly="defectrag-text-size",dc=[.8,.9,1,1.15],jy=i=>dc.includes(i);function rw(i=globalThis.localStorage,s=globalThis.innerWidth){try{const u=Number(i==null?void 0:i.getItem(Ly));if(jy(u))return u}catch{}return s>=900?.8:1}function sw(i,s=(o=>(o=globalThis.document)==null?void 0:o.documentElement)(),u=globalThis.localStorage){const d=jy(i)?i:1;s&&(s.style.zoom=d===1?"":String(d));try{u==null||u.setItem(Ly,String(d))}catch{}return d}function Vg(i,s){const u=Math.max(0,dc.indexOf(i));return dc[Math.min(dc.length-1,Math.max(0,u+(s<0?-1:1)))]}const Xg=i=>String(i).padStart(2,"0"),Qg=i=>i.getFullYear()+"-"+Xg(i.getMonth()+1)+"-"+Xg(i.getDate());function ow(i={},{showcase:s=!1}={}){const u=i.total||0,o=i.counts||{},d=p=>u?Math.round(p/u*100)+"%":null,m=(i.batches||[]).filter(p=>p.batch).length;return[{title:"Inspections",value:u,share:null,tone:"",line:s?"Previously measured examples":"Saved in this workspace",detail:m?m+" named batch"+(m===1?"":"es"):"Single photos and batches"},{title:"Looks normal",value:o.Good||0,share:d(o.Good||0),tone:"ok",line:"Within the review limit",detail:"No action needed"},{title:"Unusual appearance",value:o.Anomalous||0,share:d(o.Anomalous||0),tone:"bad",line:"Staff review recommended",detail:"Check the highlighted areas"},{title:"Needs a closer look",value:o.Uncertain||0,share:d(o.Uncertain||0),tone:"warn",line:"Close to the review limit",detail:"Check the photo again"}]}function uw(i=[],s=30,u=new Date){const o=[],d={};for(let m=s-1;m>=0;m--){const p=new Date(u.getFullYear(),u.getMonth(),u.getDate()-m),v=Qg(p);d[v]=o.length,o.push({date:v,total:0,unusual:0})}for(const m of i){const p=new Date(m.created_at);if(!Number.isFinite(p.getTime()))continue;const v=d[Qg(p)];v!==void 0&&(o[v].total++,(m.verdict==="Anomalous"||m.verdict==="Uncertain")&&o[v].unusual++)}return o}const Yf=[["recent","Recent",()=>!0],["unusual","Unusual",i=>i.verdict==="Anomalous"],["closer","Closer look",i=>i.verdict==="Uncertain"]];function fw(i=[],s="recent",u=5){const o=(Yf.find(([d])=>d===s)||Yf[0])[2];return i.filter(o).slice(0,u)}const Gy=1,Yy=2.5,dw=.25;function Zg(i,s){const u=Math.max(0,(s-1)*50),o=d=>Math.min(u,Math.max(-u,Number.isFinite(d)?d:0));return{x:o(i.x),y:o(i.y)}}function mw(i,s,u=0){return 50+(i-50-u)/s}function hw(i,s){const u=Math.round((i+s*dw)*100)/100;return Math.min(Yy,Math.max(Gy,u))}function pw({record:i,url:s,heatmap:u,onComparisonUsed:o}){const[d,m]=M.useState(!1),[p,v]=M.useState(50),[_,O]=M.useState(1),[g,y]=M.useState({x:0,y:0}),[R,Y]=M.useState(!1),x=M.useRef(null),j=M.useRef(null);M.useEffect(()=>{O(1),y({x:0,y:0}),v(50)},[i.id]),M.useEffect(()=>{var W,$;R?(W=x.current)==null||W.showModal():($=x.current)==null||$.close()},[R]);const L=_>1&&!d;function le(W){const $=hw(_,W);O($),y(ve=>Zg(ve,$))}function Ne(){O(1),y({x:0,y:0})}function je(W){var $,ve;L&&((ve=($=W.currentTarget).setPointerCapture)==null||ve.call($,W.pointerId),j.current={x:W.clientX,y:W.clientY,pan:g,w:W.currentTarget.clientWidth||1,h:W.currentTarget.clientHeight||1})}function te(W){const $=j.current;$&&y(Zg({x:$.pan.x+(W.clientX-$.x)/$.w*100,y:$.pan.y+(W.clientY-$.y)/$.h*100},_))}function I(){j.current=null}function se(){const W=mw(p,_,g.x);return r.createElement("div",{className:"viewer-stage"+(d?" comparison":"")+(L?" movable":""),style:{"--split":p+"%",touchAction:L?"none":void 0},onPointerDown:je,onPointerMove:te,onPointerUp:I,onPointerCancel:I,onDoubleClick:()=>{_>1&&Ne()}},r.createElement("div",{className:"viewer-image-wrap",style:{transform:`translate(${g.x}%, ${g.y}%) scale(${_})`}},r.createElement("img",{className:"viewer-original",src:s(i.image_url),alt:"Inspected product original",draggable:!1}),d?r.createElement("img",{className:"viewer-overlay",style:{clipPath:`inset(0 0 0 ${W}%)`},src:s(i.heatmap_url),alt:"Measured anomaly heatmap comparison",draggable:!1}):u&&r.createElement("img",{className:"viewer-overlay full",src:s(i.heatmap_url),alt:"Measured anomaly localization heatmap",draggable:!1})),d&&r.createElement(r.Fragment,null,r.createElement("div",{className:"comparison-line"}),r.createElement("span",{className:"viewer-label left"},"ORIGINAL"),r.createElement("span",{className:"viewer-label right"},"HIGHLIGHTED AREAS"),r.createElement("input",{"aria-label":"Compare original and heatmap",className:"comparison-range",type:"range",min:"0",max:"100",value:p,onChange:$=>{v(Number($.target.value)),o==null||o()}})))}const Z=d?"Drag the divider to compare the photo and the highlighted areas.":L?"Drag the photo to move around. Double-click to reset.":"Use Compare images to see both side by side.";return r.createElement(r.Fragment,null,r.createElement("div",{className:"viewer-controls"},r.createElement("button",{className:"secondary "+(d?"selected":""),"aria-pressed":d,onClick:()=>m(!d)},r.createElement(G_,{size:16}),d?"Single image":"Compare images"),r.createElement("div",null,r.createElement("button",{className:"icon-button","aria-label":"Zoom out",disabled:_<=Gy,onClick:()=>le(-1)},r.createElement(P_,{size:17})),r.createElement("button",{type:"button",className:"zoom-level","aria-label":"Reset zoom",title:"Reset zoom",disabled:_===1,onClick:Ne},Math.round(_*100),"%"),r.createElement("button",{className:"icon-button","aria-label":"Zoom in",disabled:_>=Yy,onClick:()=>le(1)},r.createElement(I_,{size:17})),r.createElement("button",{className:"icon-button","aria-label":"Expand inspection image",onClick:()=>Y(!0)},r.createElement(v_,{size:17})))),se(),r.createElement("p",{className:"caption"},Z," Highlighted areas look different from normal examples. Stronger colors do not mean a more serious defect."),r.createElement("dialog",{"aria-label":"Expanded inspection image",className:"image-dialog",ref:x,onClose:()=>Y(!1),onCancel:()=>Y(!1)},r.createElement("div",{className:"section-title"},r.createElement("h2",null,"Inspection image · ",i.id.slice(0,8)),r.createElement("button",{className:"icon-button","aria-label":"Close expanded image",onClick:()=>Y(!1)},r.createElement(mi,{size:20}))),R&&se()))}const gw=i=>`./assets/references/${i}.json`,yw=i=>["Closest match","2nd closest","3rd closest"][i]||`${i+1}th closest`;function vw(i,s){const u=new Map(((s==null?void 0:s.items)||[]).map(o=>[o.id,o]));return((i==null?void 0:i.references)||[]).map(o=>{var d;return{id:o.id,similarity:o.similarity,thumb:(d=u.get(o.id))==null?void 0:d.thumb}}).filter(o=>o.thumb)}const kf=new Map,bw=i=>(kf.has(i)||kf.set(i,fetch(gw(i)).then(s=>s.ok?s.json():null).catch(()=>null)),kf.get(i));function Ew({record:i}){var m;const[s,u]=M.useState(null),o=!!((m=i==null?void 0:i.references)!=null&&m.length);M.useEffect(()=>{let p=!0;return u(null),o&&bw(i.category).then(v=>{p&&u(v)}),()=>{p=!1}},[i==null?void 0:i.id,i==null?void 0:i.category,o]);const d=vw(i,s);return d.length?r.createElement("section",{className:"references","aria-label":"Closest normal reference photos"},r.createElement("h3",null,"Closest normal reference photos"),r.createElement("p",{className:"caption"},"Normal training photos of this product that look most like the photo above. They are for comparison only and do not change the result."),r.createElement("div",{className:"reference-row"},d.map((p,v)=>r.createElement("figure",{key:p.id},r.createElement("img",{src:p.thumb,alt:`Normal reference photo ${p.id}`,loading:"lazy"}),r.createElement("figcaption",null,yw(v))))),(s==null?void 0:s.attribution)&&r.createElement("p",{className:"caption"},s.attribution)):null}function _w({context:i}){const[s,u]=M.useState("idle");async function o(){try{await navigator.clipboard.writeText(qy(i||{})),u("copied")}catch{u("failed")}}const d=tw().length;return r.createElement("div",{className:"support-box"},r.createElement("h3",null,"If something is not working"),r.createElement("ul",{className:"fix-list"},r.createElement("li",null,r.createElement("strong",null,"“Starting” or “busy” message?")," Wait a minute, then press ",r.createElement("em",null,"Retry refresh"),"."),r.createElement("li",null,r.createElement("strong",null,"Page looks old?")," Reload it (Ctrl + F5 on a computer, pull down on a phone)."),r.createElement("li",null,r.createElement("strong",null,"Still stuck?")," Copy the details below and send them to the administrator.")),r.createElement("p",null,"Read the message beside the button first. It says what to do next. “Mark as seen” only records that an alert was noticed; it does not approve the product."),r.createElement("div",{className:"button-row"},r.createElement("button",{type:"button",className:"secondary",onClick:o},s==="copied"?r.createElement(Gf,{size:16}):r.createElement(Uy,{size:16})," ",s==="copied"?"Details copied":"Copy details for support")),s==="failed"&&r.createElement("p",{className:"caption",role:"alert"},"Copying is blocked in this browser. Take a screenshot of this page instead."),r.createElement("p",{className:"caption"},"Version ",Oa.version," · build ",Oa.commit,Oa.built?" · "+Oa.built:""," · ",d," recent problem",d===1?"":"s"," recorded in this tab. No passwords, emails or photos are included."))}function ww({health:i,showcase:s=!1,context:u}){const o=(i==null?void 0:i.mode)==="cloud_session_workspace";return r.createElement("div",{className:"overview-grid"},r.createElement("section",{className:"card about"},r.createElement("h2",null,"Using DefectRAG"),r.createElement("p",null,"The app helps you screen photos. Your workplace rules still decide what is accepted."),r.createElement("h3",null,"1. Start an inspection"),r.createElement("p",null,"Pick ",r.createElement("strong",null,"Image inspection")," for one photo, or ",r.createElement("strong",null,"Batch inspection")," for up to 20. Choose the product, add clear photos, then press Run."),r.createElement("h3",null,"2. Check the result"),r.createElement("p",null,r.createElement("strong",null,"Looks normal")," means nothing was flagged. ",r.createElement("strong",null,"Unusual appearance")," or ",r.createElement("strong",null,"Needs a closer look")," means a person should check. Compare the photo with the highlighted areas. The score is not a chance of defect."),r.createElement("h3",null,"3. Keep work private or share it"),r.createElement("p",null,"Personal workspace is private to you. Press ",r.createElement("strong",null,"Share with team")," to give your team a copy."),r.createElement("h3",null,"4. Review shared work"),r.createElement("p",null,"Go to Inspection history, pick Team workspace, then press Review. Save your decision. If a real defect needs fixing, choose ",r.createElement("strong",null,"Reviewed")," and ",r.createElement("strong",null,"Reject"),"."),r.createElement("h3",null,"5. Track a corrective action"),r.createElement("p",null,"Open ",r.createElement("strong",null,"Corrective Actions"),". Pick an inspection marked Ready. Choose who fixes it, a supervisor and a deadline. Tick the box and press Create. Press Details on a case to see its progress."),r.createElement("h3",null,"Sign-in help"),r.createElement("p",null,"New Staff: create an account, confirm your email, sign in and request access. A Developer approves it. Then enter the six-digit security code from your authenticator app. Password reset does not remove this check. Lost your authenticator? Ask the administrator.")),r.createElement("section",{className:"card about"},r.createElement("h2",null,"Saving and privacy"),r.createElement("p",null,s?"This version shows saved examples only. It does not check new photos or provide a live assistant.":o?"The online app saves approved account work privately online. Without sign-in, demo results belong to this browser session and may disappear when the app restarts.":"Without sign-in, work stays on this computer. With approved sign-in and a security code, Personal work can also be saved online. Check saved changes to see whether anything is still waiting."),r.createElement("p",null,"To use private work on another device, sign in with the same account and complete its security check there. Sharing with the team is always separate. Personal notes and later conversations are not added to a Team copy automatically."),r.createElement("h3",null,"If changes were made in two places"),r.createElement("p",null,"The app keeps both copies for review. Compare saved changes before choosing which copy to use. Do not assume that a change waiting on this computer has already reached the online account."),r.createElement("h3",null,"Understanding the assistant"),r.createElement("p",null,"Ask about the saved result, highlighted areas or supporting information. The assistant reads saved measurements and references; it does not examine the photo itself. Open supporting references and check important answers. The app does not provide factory repair instructions or replace workplace procedures."),r.createElement(_w,{context:u}),r.createElement("details",{className:"workflow-details"},r.createElement("summary",null,"Technical background and references"),r.createElement("p",null,"Visual screening compares DINOv2 image features with normal reference features. The encoder used online was lightly fine-tuned on synthetic defects made from normal images. Category calibration sets the operating threshold. The system does not classify named defects."),r.createElement("p",null,"The Evidence Assistant uses retrieval-augmented generation (RAG). BGE text embeddings retrieve reference passages; LangChain and LangGraph support retrieval, routing and evidence checks. Qwen generates supported explanations. This is vision-assisted text RAG, not image retrieval or a vision-language assistant."),r.createElement("p",null,"Application: React + Vite, FastAPI, SQLite for local storage, and Supabase for account security and private/shared online records. ",o?"Online generation uses Qwen 2.5 3B fine-tuned for this project (improved using Qwen) on ZeroGPU.":"Local generation uses the configured Ollama model, commonly Qwen 2.5 3B."," Corrective Action delivery can use n8n; a saved case is separate from an email being sent."),r.createElement("p",null,"References describe the components, not proof that every component or cited research method is implemented in full."),[["DINOv2 visual features","https://github.com/facebookresearch/dinov2"],["Qwen 2.5 3B text generation (base model, fine-tuned here)","https://huggingface.co/Qwen/Qwen2.5-3B-Instruct"],["VisA example image dataset","https://github.com/amazon-science/spot-diff"],["BGE text embeddings","https://huggingface.co/BAAI/bge-small-en-v1.5"],["Dinomaly reference documentation","https://anomalib.readthedocs.io/en/lib-v2.6.2/markdown/guides/reference/models/image/dinomaly.html"]].map(([d,m])=>r.createElement("a",{className:"source-link",key:d,href:m,target:"_blank",rel:"noreferrer"},d)),r.createElement("p",null,"VisA sample images: Zou et al., ECCV 2022, CC BY 4.0. Model and library licenses remain listed in the project documentation."))))}function Sw({open:i,onDismiss:s,onStart:u}){const o=M.useRef(null),d=M.useRef(null);return M.useEffect(()=>{var m;i?(o.current.open||o.current.showModal(),(m=d.current)==null||m.focus({preventScroll:!0})):o.current.open&&o.current.close()},[i]),r.createElement("dialog",{ref:o,className:"tutorial-dialog","aria-labelledby":"tutorial-title","aria-describedby":"tutorial-description",onCancel:m=>{m.preventDefault(),s()},onClose:()=>{i&&s()}},r.createElement("div",{className:"tutorial-top"},r.createElement("span",{className:"subtle-tag"},"GUIDED PRACTICE"),r.createElement("button",{type:"button",className:"icon-button","aria-label":"Close tutorial",onClick:s},r.createElement(mi,{size:20}))),r.createElement("div",{className:"tutorial-icon"},r.createElement(Nr,{size:30,"aria-hidden":"true"})),r.createElement("h2",{ref:d,tabIndex:-1,id:"tutorial-title"},"Learn by doing"),r.createElement("p",{id:"tutorial-description"},"Practise the real steps in about 3 minutes. A guide points to the next button."),r.createElement("ul",{className:"tutorial-points"},r.createElement("li",null,"Check a photo, share it, review it, and track the fix."),r.createElement("li",null,"It is only practice. Nothing is saved, shared or emailed."),r.createElement("li",null,"Skip any time. Replay it from Overview.")),r.createElement("div",{className:"tutorial-footer"},r.createElement("button",{type:"button",className:"text-button",onClick:s},"Skip tutorial"),r.createElement("button",{type:"button",className:"primary",onClick:u},"Start guided practice ",r.createElement(oc,{size:16}))))}const Vy="defectrag-guided-practice-v3";let Xy=!1;function Kg(i){if(Xy)return!0;try{return(i==null?void 0:i.getItem(Vy))==="done"}catch{return!1}}function Jg(i){Xy=!0;try{i==null||i.setItem(Vy,"done")}catch{}}function ld(){return[{id:"product",page:"inspect",event:"product",target:"product",title:"Choose the product",instruction:"In Product category, choose Candle. Always choose the product that is in the photo."},{id:"photo",page:"inspect",event:"photo",target:"samples",focus:{selector:"[data-tour=samples] button",text:"candle"},title:"Add a photo",instruction:"Below, under “Or try a sample photo”, choose the first Candle sample. For real work, use Choose an image to pick a photo from this device."},{id:"inspect",page:"inspect",event:"inspect",target:"run",title:"Run the inspection",instruction:"Select Run inspection. In practice this opens a saved Candle example, so there is no AI run and no wait."},{id:"compare",page:"inspect",event:"compare",target:"viewer",focus:{selector:"[data-tour=viewer] button,[data-tour=viewer] input[type=range]"},title:"Compare the photo and highlights",instruction:"Select Compare images, then drag the divider to compare the original photo with the highlighted areas."},{id:"ask",page:"inspect",event:"ask",target:"assistant",title:"Ask the Evidence Assistant",instruction:"Choose a suggested question or type your own, then select Ask. Practice shows a prepared answer; normal work uses the real assistant."},{id:"open",page:"history",event:"open",target:"history",focus:{selector:'[data-tour=history] button[aria-label^="Open inspection"]'},title:"Find saved work",instruction:"Open Inspection history in the sidebar, then select the open button on the practice row. Approved Staff results save to Personal Workspace automatically."},{id:"share",page:"inspect",event:"share",target:"share",title:"Share with the team",instruction:"Select Share with team. Sharing is always your choice and creates a separate Team copy; in practice nothing leaves this browser."},{id:"gallery",page:"inspect",event:"gallery",target:"publish",title:"Understand public sharing",instruction:"Scroll to “Publish to community gallery”, tick the box and select Publish. In practice nothing is published; in real work anyone could see the copy."},{id:"review",page:"team",event:"review",target:"review",focus:[{selector:"[data-tour=review] select,[data-tour=review] input,[data-tour=review] textarea,[data-tour=review] button"},{selector:"table button",text:"review"}],title:"Record a Staff review",instruction:"Open Staff workspace, select Review on the practice row, choose Reviewed and “Reject: defect confirmed”, add a short note and Save review."},{id:"case",page:"cases",event:"case",target:"case",title:"Create a corrective action",instruction:"In Corrective Actions choose the practice inspection marked Ready. Describe the fix, choose Alex as person responsible and You as supervisor, set a future deadline, tick the confirmation and Create corrective action."},{id:"lifecycle",page:"cases",event:"lifecycle",target:"case-update",focus:[{selector:"[data-tour=case-update] select,[data-tour=case-update] input,[data-tour=case-update] textarea,[data-tour=case-update] button"},{selector:".case-workspace table button",text:"details"}],title:"Track the case to closure",instruction:"Open Details on the new case. Save each update in turn: Assigned, In Progress, Resolved and Closed, with a short note each time."},{id:"batch",page:"batch",event:"batch",target:"batch",title:"Check a group of photos",focus:{selector:".batch-samples button",text:"sample"},instruction:"Choose Candle, enter a batch name, select Add sample photos, then Inspect batch. No earlier single inspection is needed."},{id:"alert",page:"alerts",event:"alert",target:"alerts",title:"Notice a review alert",instruction:"Select Mark as seen on a practice alert. This records that someone noticed it; it does not approve the product or close a case."},{id:"finish",page:"overview",event:"finish",target:"finish",title:"Ready for real work",instruction:"Select Finish tutorial. All practice data disappears and your real workspace returns unchanged. Replay any time from Overview."}]}function $s(){return{started:!1,step:0,caseState:null,hint:""}}const $g=["Open","Assigned","In Progress","Resolved","Closed"];function Ig(i,s){if(s.type==="start")return{...$s(),started:!0};if(!i.started)return i;const u=ld(),o=u[i.step];if(s.type==="back")return i.step?{...i,step:i.step-1,hint:""}:i;if(s.type!=="complete"||(s.event==="lifecycle"&&s.state&&(i={...i,caseState:s.state}),s.event!==o.event))return i;if(o.event==="product"&&s.value!=="candle")return{...i,hint:"Choose Candle for this lesson."};if(o.event==="review"&&(s.status!=="Reviewed"||s.decision!=="Reject"))return{...i,hint:"Saved, but this lesson needs Reviewed with “Reject: defect confirmed”. Save the review again with those choices."};if(o.event==="lifecycle"&&i.caseState!=="Closed"){const d=$g[$g.indexOf(i.caseState)+1];return{...i,hint:d?`Saved as ${i.caseState}. Next, choose ${d} and save again.`:""}}return{...i,hint:"",step:Math.min(i.step+1,u.length-1)}}const Nw=24,Tw=8,Qy=680,Vf=(i,s)=>Math.max(0,Math.min(i.right,s.right)-Math.max(i.left,s.left))*Math.max(0,Math.min(i.bottom,s.bottom)-Math.max(i.top,s.top));function Zy({width:i,height:s,coachWidth:u,coachHeight:o}){if(i<=Qy){const p=Tw,v=_=>({left:p,right:i-p,top:_,bottom:_+o});return[{name:"bottom",...v(s-p-o)},{name:"top",...v(p)}]}const d=Nw,m=(p,v)=>({left:p,top:v,right:p+u,bottom:v+o});return[{name:"bottom-right",...m(i-d-u,s-d-o)},{name:"bottom-left",...m(d,s-d-o)},{name:"top-right",...m(i-d-u,d)},{name:"top-left",...m(d,d)}]}function Ky(i,s=[],u=[]){const o=m=>Math.hypot((m.left+m.right)/2-i.width/2,(m.top+m.bottom)/2-i.height/2),d=m=>{const v=m.filter(_=>_.bottom>0&&_.top0&&_.left!_||o(O)1?d(u):u:d(s)}const Cw=(i,s)=>s.some(u=>Vf(i,u)>0);function Aw(i,s=[],u=null,o=[],d=[]){const m=Zy(i),p=(O,g)=>g.reduce((y,R)=>y+Vf(O,R),0),v=Ky(i,s,d),_=O=>p(O,v)*1e3+p(O,s)*100+p(O,o)*10+(u?Vf(O,u):0);return m.reduce((O,g)=>_(g)<_(O)?g:O,m[0]).name}const Df='button,a[href],input,select,textarea,[role=button],[tabindex="0"]',Fg={inspect:"Image inspection",history:"Inspection history",team:"Staff workspace",cases:"Corrective Actions",batch:"Batch inspection",alerts:"Review alerts",overview:"Overview"};function Ow({state:i,page:s,onGo:u,onSkip:o,onFinish:d,onBack:m}){const p=ld(),v=p[i.step],_=M.useRef(null),O=M.useRef(null),g=M.useRef(null),y=M.useRef("bottom-right"),[R,Y]=M.useState("bottom-right"),[x,j]=M.useState(!1),[L,le]=M.useState(!1),Ne=s===v.page||v.target==="finish";M.useEffect(()=>{var te;(te=_.current)==null||te.focus({preventScroll:!0}),j(!1)},[i.step]),M.useEffect(()=>{const te=()=>{const I=g.current;le(!!I&&I.scrollHeight>I.clientHeight+1)};return te(),window.addEventListener("resize",te),()=>window.removeEventListener("resize",te)},[i.step,x]),M.useEffect(()=>(document.body.classList.add("coach-open"),()=>document.body.classList.remove("coach-open")),[]),M.useEffect(()=>{let te=null;const I=()=>{const ve=Ne?document.querySelector('[data-tour="'+v.target+'"]'):null;ve!==te&&(te==null||te.classList.remove("tour-target"),ve==null||ve.classList.add("tour-target"),te=ve),se(ve)},se=ve=>{var _e;const Ge=(_e=O.current)==null?void 0:_e.getBoundingClientRect();if(!Ge)return;const dt=he=>[...he].filter(Ye=>Ye.offsetParent!==null&&!O.current.contains(Ye)).map(Ye=>Ye.getBoundingClientRect()),_t=ve?dt([...ve.querySelectorAll(Df),...ve.matches(Df)?[ve]:[]]):[],Ra=dt(document.querySelectorAll(["main","nav"].flatMap(he=>Df.split(",").map(Ye=>he+" "+Ye)).join(","))),rt=he=>dt([...document.querySelectorAll(he.selector)].filter(Ye=>!he.text||Ye.textContent.toLowerCase().includes(he.text))),Q=[].concat(v.focus||[]).map(rt).find(he=>he.length)||[],D={width:window.innerWidth,height:window.innerHeight,coachWidth:Ge.width,coachHeight:Ge.height},fe=Zy(D).find(he=>he.name===y.current);fe&&!Cw(fe,Ky(D,_t,Q))||(y.current=Aw(D,_t,(ve==null?void 0:ve.getBoundingClientRect())||null,Ra,Q),Y(y.current))};let Z;const W=()=>{clearTimeout(Z),Z=setTimeout(()=>se(te),300)};I();const $=setInterval(I,1e3);return window.addEventListener("scroll",W,{passive:!0}),window.addEventListener("resize",W),()=>{clearInterval($),clearTimeout(Z),window.removeEventListener("scroll",W),window.removeEventListener("resize",W),te==null||te.classList.remove("tour-target")}},[v.target,Ne]);function je(){var te;(te=document.querySelector('[data-tour="'+v.target+'"]'))==null||te.scrollIntoView({block:window.innerWidth<=680?"start":"center",behavior:"smooth"})}return r.createElement("aside",{ref:O,className:"tutorial-coach at-"+R,role:"dialog","aria-modal":"false","aria-labelledby":"coach-title"},r.createElement("div",{className:"section-title"},r.createElement("span",{className:"subtle-tag"},r.createElement(Nr,{size:13})," PRACTICE · STEP ",i.step+1," OF ",p.length),r.createElement("button",{type:"button",className:"icon-button","aria-label":"Skip tutorial",onClick:o},r.createElement(mi,{size:17}))),r.createElement("progress",{"aria-label":"Practice progress",value:i.step+1,max:p.length}),r.createElement("h2",{ref:_,tabIndex:-1,id:"coach-title"},v.title),r.createElement("p",{ref:g,"aria-live":"polite",className:"coach-text"+(x?" open":"")},v.instruction),(L||x)&&r.createElement("button",{type:"button",className:"text-button coach-more","aria-expanded":x,onClick:()=>j(te=>!te)},x?"Less":"More"),i.hint&&r.createElement("p",{className:"coach-hint",role:"status"},i.hint),!Ne&&r.createElement("p",{className:"caption"},"This step is on ",Fg[v.page],"."),r.createElement("div",{className:"coach-actions"},r.createElement("button",{type:"button",className:"text-button",disabled:!i.step,onClick:m},r.createElement(F1,{size:14})," Previous"),v.target==="finish"?r.createElement("button",{type:"button",className:"primary","data-tour":"finish",onClick:d},"Finish tutorial"):Ne?r.createElement("button",{type:"button",className:"secondary",onClick:je},r.createElement(h_,{size:15})," Show me"):r.createElement("button",{type:"button",className:"primary",onClick:()=>u(v.page)},"Go to ",Fg[v.page])),r.createElement("small",null,"Practice data only · nothing is saved, shared, published or emailed. Your real work returns when the lesson ends."))}const Mf=""+new URL("candle-original-qMuCmLLU.jpg",import.meta.url).href,Rw=""+new URL("candle-heatmap-9tTuQfnO.jpg",import.meta.url).href,Er=i=>({Good:"Looks normal",Anomalous:"Unusual appearance",Uncertain:"Needs a closer look"})[i]||i,Jy={pcb1:"PCB 1",capsules:"Capsules",cashew:"Cashew",candle:"Candle",chewinggum:"Chewing gum",fryum:"Fryum",macaroni1:"Macaroni 1",macaroni2:"Macaroni 2",pcb2:"PCB 2",pcb3:"PCB 3",pcb4:"PCB 4",pipe_fryum:"Pipe fryum"},OS=i=>Jy[i]||i||"Product",zw=(i,s=!1)=>i==="llm"?s?"SAVED ANSWER":"ANSWER WITH REFERENCES":i==="measurement_only"?"INSPECTION RESULT":i==="retrieval_only"?"REFERENCE INFORMATION":"NO SUPPORTED ANSWER",RS=i=>({queued:"Waiting to send",sending:"Sending",delivered:"Accepted by email service",sent:"Accepted by email service",retry:"Waiting to retry",dead:"Needs administrator help",ambiguous:"Delivery unconfirmed",superseded:"Replaced by a newer update",suppressed:"Not sent"})[i]||i,zS=i=>({requested:"Staff access request",approved:"Access approved",rejected:"Access not approved",revoked:"Access removed",created:"New case",updated:"Case update",reminder:"Due-date reminder",overdue:"Overdue case"})[i]||i;function vn(i,s="This action could not be completed. Try again. If the problem continues, contact the workspace administrator."){const u=String((i==null?void 0:i.message)||i||"");return u?/invalid login credentials/i.test(u)?"The email or password was not accepted. Check both and try again.":/email not confirmed/i.test(u)?"Confirm the email using the link in the signup email, then sign in again.":/(?:invalid|expired|incorrect).*(?:totp|otp|authenticator|verification code)|(?:totp|otp).*(?:invalid|expired)/i.test(u)?"That security code was not accepted. Enter the latest six-digit code from the authenticator app.":/rate.?limit|too many requests|too many.*attempts/i.test(u)?"Too many attempts were made. Wait a few minutes before trying again.":/reassign revoked owner|active owner and supervisor|active verified supervisor required/i.test(u)?"Choose currently approved Staff for the person responsible and supervisor, then try again.":/latest reviewed reject|recorded human review required/i.test(u)?"Open the shared inspection and save its latest Staff review as Reviewed and Reject before creating a case.":/explicit human defect confirmation required/i.test(u)?"Confirm that the Staff review found a defect needing follow-up before creating the case.":/active team inspection required/i.test(u)?"Choose a shared Team inspection that has not been archived.":/invalid case transition/i.test(u)?"That case status change is not allowed. Refresh the case and choose an available status.":/audit note.*required/i.test(u)?"Add a short note explaining what changed or was fixed before saving.":/invalid due date|due date must be within/i.test(u)?"Choose a future due date within the next year.":/duplicate key|unique constraint/i.test(u)?"A matching item may already exist. Refresh the list and check before trying again.":/exceeded.*(?:ZeroGPU|GPU).*(?:limit|quota)|(?:ZeroGPU|GPU).*(?:quota|limit).*exceed/i.test(u)?"The free inspection service has reached its usage limit. Try again later. Signing in to Hugging Face may provide a separate allowance; Staff sign-in does not change this limit.":/pending.*approval|staff access.*pending/i.test(u)?"Staff access has not been approved yet. Check its status in Staff workspace.":/revoked/i.test(u)?"Access to this workspace has been removed. Contact the workspace administrator.":/expired.*(?:session|jwt)|(?:session|jwt).*expired|refresh token/i.test(u)?"The sign-in has expired. Open Staff workspace and sign in again.":/(?:approved staff|approved account).*(?:TOTP|MFA)|complete MFA|verified TOTP|authenticator verification|AAL2/i.test(u)?"Use an approved Staff account and enter the security code in Staff workspace before continuing.":/assigned editor|assigned owner|owner.*supervisor.*developer/i.test(u)?"Only the person assigned to this case, its supervisor or a Developer can change it.":/case changed|version conflict|optimistic|stale.*version|concurrent/i.test(u)?"This record changed elsewhere. Refresh it and check the latest details before saving again. The attempted update has not been confirmed.":/row.level security|permission denied|not authorized|unauthorized|insufficient.*privilege|RLS|42501|PGRST301/i.test(u)?"This account cannot complete that action. Check approval and the security code in Staff workspace. If access is still denied, contact the workspace administrator.":/failed to fetch|networkerror|network request|fetch failed|connection.*(?:failed|refused)|timed? ?out|ECONN/i.test(u)?"The connection was interrupted. Check the internet connection and try again. Any new changes may still be waiting to save.":/supabase|postgres|sqlite|RPC|PGRST|traceback|stack trace|HTTP \d{3}|service.role|JWT|backend|schema cache|constraint|relation .*does not exist/i.test(u)?s:u:s}function kw({open:i,onClose:s,onConfirm:u,busy:o,scope:d="local"}){const m=M.useRef(null);M.useEffect(()=>{var _,O;i?(_=m.current)==null||_.showModal():(O=m.current)==null||O.close()},[i]);const p=d==="guest"?"Demo inspections matching these filters will be moved out of the active history and review list.":d==="local"?"All inspections on this computer matching these filters will move to the archive. This includes matches beyond the 500 shown here. They will leave the active history and review list.":`Up to 500 active inspections matching the current filters will be archived in ${d==="personal"?"Personal":"Team"} Workspace. They will leave that workspace’s active history and review queue.`,v=d==="guest"?"Only this demo session is affected. Account and Team records stay unchanged. Demo archives may be lost when the online app restarts.":d==="personal"?"Only this account’s Personal inspections move. Shared Team copies stay active. This account can restore its own Personal work.":d==="team"?"Only Team inspections this account is allowed to archive will move. Personal originals stay active. Ask a Developer to restore Team work.":"This action does not change cloud records.";return r.createElement("dialog",{"aria-label":"Archive matching inspections",ref:m,className:"confirmation-dialog",onCancel:s,onClose:s},r.createElement("div",{className:"section-title"},r.createElement("div",{className:"setup-icon"},r.createElement($1,{size:25})),r.createElement("button",{className:"icon-button","aria-label":"Cancel clear history",disabled:o,onClick:s},r.createElement(mi,{size:18}))),r.createElement("h2",null,"Move these inspections to the archive?"),r.createElement("p",null,p),r.createElement("div",{className:"note"},"Photos, results and conversations are kept. Open History recovery to restore them, while their saved storage is still available. ",v),r.createElement("div",{className:"button-row"},r.createElement("button",{className:"secondary",onClick:s,disabled:o},"Keep history"),r.createElement("button",{className:"primary",onClick:u,disabled:o},o?"Archiving…":"Archive matching history")))}const Pg=i=>i?i[0]>0?"better":i[1]<0?"worse":"":"",Dw=i=>{const s=String(i).replace(/_/g," ");return s.charAt(0).toUpperCase()+s.slice(1)};function Mw(i){return((i==null?void 0:i.arms)||[]).map(s=>{var u,o,d,m;return{key:s.key,label:s.label,auroc:(o=(u=i.macro_mean)==null?void 0:u[s.key])==null?void 0:o.auroc,pixel:(m=(d=i.macro_mean)==null?void 0:d[s.key])==null?void 0:m.pixel_auroc}})}function Uw(i){const s=((i==null?void 0:i.arms)||[]).map(u=>u.key);return Object.entries((i==null?void 0:i.categories)||{}).map(([u,o])=>{var d,m,p,v;return{key:u,label:Dw(u),tests:o.n_test,values:s.map(_=>{var O,g;return(g=(O=o.arms)==null?void 0:O[_])==null?void 0:g.auroc}),pixel:(m=(d=o.arms)==null?void 0:d[s[s.length-1]])==null?void 0:m.pixel_auroc,coreset:Pg((p=o.differences)==null?void 0:p["B-A"]),tuned:Pg((v=o.differences)==null?void 0:v["C-B"])}})}const Wg=i=>i==="better"?"▲":i==="worse"?"▼":"",ui=i=>typeof i=="number"&&Number.isFinite(i)?i:null;function xw(i,s){const u=i==null?void 0:i.macro_mean;if((i==null?void 0:i.profile)!=="dinov2_tuned_v1"||ui(u==null?void 0:u.image_auroc)===null)return null;const o=(s==null?void 0:s.macro_mean)||{};return{profile:i.profile,cards:[{key:"image_auroc",label:"Mean image AUROC",after:ui(u.image_auroc),before:ui(o.auroc)},{key:"recall",label:"Defects caught",after:ui(u.recall),before:null},{key:"false_positive_rate",label:"Normal photos flagged",after:ui(u.false_positive_rate),before:null},{key:"pixel_auroc",label:"Mean pixel AUROC",after:ui(u.pixel_auroc_224),before:ui(o.pixel_auroc)}]}}const Zs=i=>typeof i=="number"?i.toFixed(3):"—",jn=i=>typeof i=="number"?(i*100).toFixed(2)+"%":"—";function Hw({report:i,labels:s,evaluation:u}){var Y,x,j,L,le,Ne,je,te,I,se;const d=(i==null?void 0:i.candidate)||i,m=Object.entries((d==null?void 0:d.categories)||{}),p=m.length===12,v=i==null?void 0:i.mvtec,_=Mw(v),O=Uw(v),g=d==null?void 0:d.macro_mean,y=xw(u,d),R=["auroc","au_pr","pixel_auroc","pixel_au_pr"];return r.createElement(r.Fragment,null,r.createElement("section",{className:"card"},r.createElement("h2",null,"Official benchmark: DINOv2 on VisA"),r.createElement("p",null,"Results on the official VisA test split: 12 products, 2,162 test photos. The deployed detector (fine-tuned DINOv2 encoder with a coreset memory) comes first, then the frozen baseline it started from, averaged over three fixed seeds.",v&&" A one-run check on a second dataset, MVTec AD, follows the VisA results."),r.createElement("p",null,"These tests compare inspection results on example product photos. They help explain strengths and limits, but do not approve a product or guarantee a correct result."),r.createElement("p",null,"Image results measure whether unusual photos were found. Highlighted-area results measure where differences were located. The measured results and test settings are shown below.")),y&&r.createElement(r.Fragment,null,r.createElement("section",{className:"card benchmark-intro"},r.createElement("div",null,r.createElement("span",{className:"eyebrow"},"DEPLOYED DETECTOR · AFTER FINE-TUNING"),r.createElement("h2",null,"Fine-tuned DINOv2 with a coreset memory."),r.createElement("p",null,"The model the app runs now, on the same official test split. Defects caught and normal photos flagged use the app’s rule: the limit is the 95th percentile of held-out normal scores, the same for every product. One run; retrospective, because earlier test data was already seen.")),r.createElement(Bg,{size:48})),r.createElement("div",{className:"stats-grid"},y.cards.map(Z=>r.createElement("section",{className:"card stat",key:Z.key},r.createElement("span",null,Z.label),r.createElement("strong",null,jn(Z.after)),r.createElement("small",null,Z.before!==null?"Before fine-tuning: "+jn(Z.before):"App threshold · 12 products"))))),r.createElement("section",{className:"card benchmark-intro"},r.createElement("div",null,r.createElement("span",{className:"eyebrow"},y?"BASELINE · BEFORE FINE-TUNING":"REPRODUCIBLE MODEL COMPARISON"),r.createElement("h2",null,y?"Frozen DINOv2 with a random-sample memory.":"Measure improvement across every product."),r.createElement("p",null,"Official VisA training normals and test assignments. Three fixed seeds; every category reported. These are retrospective development results: earlier test data was already seen.")),r.createElement(Bg,{size:48})),r.createElement("div",{className:"stats-grid"},[[jn(g==null?void 0:g.auroc),y?"Mean image AUROC · baseline":"Mean image AUROC · headline"],[jn(g==null?void 0:g.au_pr),"Mean image AU-PR"],[jn(g==null?void 0:g.pixel_auroc),"Mean pixel AUROC"],[jn(g==null?void 0:g.pixel_au_pr),"Mean pixel AU-PR"]].map(([Z,W])=>r.createElement("section",{className:"card stat",key:W},r.createElement("span",null,W),r.createElement("strong",null,Z),r.createElement("small",null,p?"Equal category weights · 3 seeds":"Available after all 12 finish")))),r.createElement("section",{className:"card"},r.createElement("div",{className:"section-title"},r.createElement("div",null,r.createElement("h2",null,"Benchmark results by product"),r.createElement("p",null,"Mean ± sample standard deviation over seeds 42, 43 and 44. ",m.length,"/12 categories completed.")),r.createElement("span",{className:"subtle-tag"},p?"COMPLETE":"IN PROGRESS")),r.createElement("div",{className:"table-wrap"},r.createElement("table",null,r.createElement("thead",null,r.createElement("tr",null,r.createElement("th",null,"Product"),r.createElement("th",null,"Train normals"),r.createElement("th",null,"Test images"),r.createElement("th",null,"Image AUROC"),r.createElement("th",null,"Image AU-PR"),r.createElement("th",null,"Pixel AUROC"),r.createElement("th",null,"Pixel AU-PR"))),r.createElement("tbody",null,m.map(([Z,W])=>r.createElement("tr",{key:Z},r.createElement("td",null,r.createElement("strong",null,s[Z]||Z)),r.createElement("td",null,W.official_train_normals),r.createElement("td",null,W.official_test_images),R.map($=>r.createElement("td",{key:$},Zs(W.benchmark_mean[$]),r.createElement("small",null,"± ",Zs(W.benchmark_std[$]))))))))),r.createElement("p",{className:"caption"},"Supplementary: mean image AP ",jn(g==null?void 0:g.average_precision)," · mean pixel AP ",jn(g==null?void 0:g.pixel_average_precision),". These are not bounding-box mAP@IoU."),r.createElement("div",{className:"note"},r.createElement(Ps,{size:19}),r.createElement("p",null,"Custom AnomalyDINO-inspired adaptation: frozen DINOv2 ViT-S/14, 448px short edge, rectangular patches, PCA foreground heuristic and a larger normal memory. It does not reproduce Dinomaly. Pixel evaluation uses 224×224 maps. The Model performance page describes the active deployment profile and its separate calibrated threshold."))),v&&r.createElement("section",{className:"card"},r.createElement("div",{className:"section-title"},r.createElement("div",null,r.createElement("h2",null,"MVTec AD: one-run generalisation check"),r.createElement("p",null,v.scope)),r.createElement("span",{className:"subtle-tag"},"OFFLINE · ONE RUN")),r.createElement("div",{className:"stats-grid plain"},_.map(Z=>r.createElement("section",{className:"card stat",key:Z.key},r.createElement("span",null,Z.label),r.createElement("strong",null,jn(Z.auroc)),r.createElement("small",null,"Mean image AUROC · ",v.products," products"))),r.createElement("section",{className:"card stat"},r.createElement("span",null,"Test photos"),r.createElement("strong",null,(x=(Y=v.test_images)==null?void 0:Y.toLocaleString)==null?void 0:x.call(Y)),r.createElement("small",null,"Scored once, nothing adjusted afterwards"))),r.createElement("div",{className:"table-wrap"},r.createElement("table",null,r.createElement("thead",null,r.createElement("tr",null,r.createElement("th",null,"Product"),r.createElement("th",null,"Test images"),_.map(Z=>r.createElement("th",{key:Z.key},Z.label)),r.createElement("th",null,"Pixel AUROC"))),r.createElement("tbody",null,O.map(Z=>r.createElement("tr",{key:Z.key},r.createElement("td",null,r.createElement("strong",null,Z.label)),r.createElement("td",null,Z.tests),Z.values.map((W,$)=>r.createElement("td",{key:$},Zs(W),$===1&&Z.coreset&&r.createElement("span",{style:{marginLeft:6},title:Z.coreset==="better"?"Clearly better than the random-sample memory":"Clearly worse than the random-sample memory"},Wg(Z.coreset)),$===2&&Z.tuned&&r.createElement("span",{style:{marginLeft:6},title:Z.tuned==="better"?"Clearly better than the coreset alone":"Clearly worse than the coreset alone"},Wg(Z.tuned)))),r.createElement("td",null,Zs(Z.pixel))))))),r.createElement("p",{className:"caption"},"▲ ▼ mark a difference whose 95% bootstrap interval excludes zero: the coreset column against the random-sample memory, the last variant against the coreset alone. Pixel AUROC is for the last variant (224×224 maps) and is weak on texture products because of the foreground heuristic."),r.createElement("div",{className:"note"},r.createElement(Ps,{size:19}),r.createElement("p",null,"The coreset memory transfers: it is clearly better on ",(L=(j=v.comparisons)==null?void 0:j["B-A"])==null?void 0:L.better," products and clearly worse on ",(Ne=(le=v.comparisons)==null?void 0:le["B-A"])==null?void 0:Ne.worse,". The encoder fine-tuned on VisA adds nothing measurable here (",(te=(je=v.comparisons)==null?void 0:je["C-B"])==null?void 0:te.better," clearly better, ",(se=(I=v.comparisons)==null?void 0:I["C-B"])==null?void 0:se.worse," clearly worse), so its small VisA gain is not confirmed elsewhere. MVTec AD is licensed CC BY-NC-SA 4.0, used here only for this evaluation and not redistributed; the copy came from a third-party mirror and was checked against the published counts. ",r.createElement("a",{href:v.protocol_url,target:"_blank",rel:"noreferrer"},"Protocol and results")))),r.createElement("section",{className:"card"},r.createElement("div",{className:"section-title"},r.createElement("div",null,r.createElement("h2",null,"Overall evaluation metrics"),r.createElement("p",null,"The official VisA protocol reports AUROC and AU-PR, averaged across products. Image metrics evaluate detection; pixel metrics evaluate localization.")),r.createElement(Nr,{size:22})),r.createElement("div",{className:"training-steps"},[["01","Mean image AUROC","For each product, measure how well scores rank anomalous images above normal images; average the 12 category AUROCs. 0.5 is chance-level ranking."],["02","Supplementary mean image AP","Calculate average precision for anomaly detection in each product category, then average across all 12. This is not YOLO mAP@0.5 or mAP@0.5:0.95: we do not predict boxes or named defect classes."],["03","Supplementary mean pixel AP","Calculate pixel average precision within each category, including normal images, then average over products. It measures localization; high image AP does not guarantee accurate heatmaps."],["04","Mean image AU-PR","Trapezoidal area under each precision–recall curve, averaged over products. It follows the official VisA metric implementation and is distinct from non-interpolated average precision."],["05","Normal-only fitting and calibration","The published benchmark below uses the frozen pretrained encoder; the online detector uses a lightly fine-tuned DINOv2 (see the model card). Normal images populate memory. A separate operational bank holds out normal training images to calibrate its threshold; no test anomalies select that threshold."],["06","Evaluation limits","Configuration is fixed before each candidate run, but earlier test results informed this development effort. Report it as retrospective benchmarking, not an untouched external evaluation."]].map(([Z,W,$])=>r.createElement("details",{key:Z},r.createElement("summary",null,r.createElement("span",null,Z),r.createElement("strong",null,W)),r.createElement("p",null,$)))),r.createElement("div",{className:"button-row"},r.createElement("a",{className:"secondary",href:"https://github.com/amazon-science/spot-diff",target:"_blank",rel:"noreferrer"},"Official VisA protocol ",r.createElement(di,{size:15})),r.createElement("a",{className:"secondary",href:"https://github.com/dammsi/AnomalyDINO",target:"_blank",rel:"noreferrer"},"AnomalyDINO reference ",r.createElement(di,{size:15}))),r.createElement("p",{className:"caption"},"Exact settings, differences from the paper and resume commands are in docs/TRAINING_AND_EVALUATION.md.")))}const qw=i=>i==="developer"?"Developer":i==="staff"?"Staff":"";function Bw(i){var o,d;if(!(i!=null&&i.user))return{signedIn:!1,name:"",role:"",text:"Not signed in"};const s=(((o=i.staff)==null?void 0:o.display_name)||"").trim()||i.user.email||"your account",u=qw((d=i.staff)==null?void 0:d.role);return{signedIn:!0,name:s,role:u,email:i.user.email||"",text:"Signed in as "+s+(u?" · "+u:"")}}async function Lw(i){var m;const{data:s,error:u}=await i.auth.getSession(),o=(m=s==null?void 0:s.session)==null?void 0:m.user;if(u||!o)return null;let d=null;try{const p=await i.from("staff_members").select("display_name,role").eq("user_id",o.id).maybeSingle();p.error||(d=p.data||null)}catch{d=null}return{user:{id:o.id,email:o.email||""},staff:d}}function jw(){var i,s;return((s=(i=globalThis.window)==null?void 0:i.DEFECTRAG_PUBLIC_CONFIG)==null?void 0:s.authWorkflowEnabled)===!0}async function id(i){const{data:s,error:u}=await i.rpc("defectrag_auth_status");if(u)throw u;if(!s||typeof s.approved!="boolean"||typeof s.authorized!="boolean"||typeof s.aal2!="boolean")throw new Error("Account security status is unavailable.");return s}async function Gw(i){const s=await id(i);if(!s.approved||s.revoked)throw new Error("Staff access is pending, rejected or revoked. Demo Mode remains available after signing out.");if(!s.authorized||s.mfa_required&&!s.aal2)throw new Error("Complete authenticator verification in Staff workspace.");return s}async function Yw(i,{email:s,password:u,displayName:o,redirectTo:d}){if(u.length<12||!o.trim()||o.trim().length>80)throw new Error("Use a display name and a password of at least 12 characters.");const{data:m,error:p}=await i.auth.signUp({email:s,password:u,options:{emailRedirectTo:d}});if(p)throw p;return m.session&&await $y(i,o),{confirmationRequired:!m.session}}async function $y(i,s){const{data:u,error:o}=await i.rpc("defectrag_request_access",{p_display_name:s.trim()});if(o)throw o;return u}async function Vw(i){const{data:s,error:u}=await i.auth.mfa.enroll({factorType:"totp",friendlyName:"DefectRAG authenticator"});if(u)throw u;return s}async function Xw(i,s,u){if(!/^\d{6}$/.test(u))throw new Error("Enter the six-digit authenticator code.");const{data:o,error:d}=await i.auth.mfa.challenge({factorId:s});if(d)throw d;const m=await i.auth.mfa.verify({factorId:s,challengeId:o.id,code:u});if(m.error)throw m.error;return m.data}async function Qw(i,s,u){if(!["approve","reject","revoke"].includes(u))throw new Error("Invalid account action.");const{data:o,error:d}=await i.rpc("defectrag_decide_access",{p_user_id:s.user_id,p_action:u,p_version:s.version});if(d)throw d;return o}async function Zw(i,s){const u=[];try{for(const o of[s.image_path,s.heatmap_path]){const{data:d,error:m}=await i.storage.from("team-inspections").download(o);if(m)throw m;u.push(URL.createObjectURL(d))}return u}catch(o){throw u.forEach(d=>URL.revokeObjectURL(d)),o}}const Kw=Object.freeze(Object.defineProperty({__proto__:null,authStatus:id,authWorkflowEnabled:jw,decideAccess:Qw,enrollTotp:Vw,privateTeamImages:Zw,registerAccount:Yw,requireStaff:Gw,submitAccessRequest:$y,verifyTotp:Xw},Symbol.toStringTag,{value:"Module"})),ey=i=>String(i||"").normalize("NFKC").trim().replace(/\s+/gu," ").toLowerCase();function Jw(i,s=[]){const u=ey(i);return!!(u&&s.some(o=>ey(o.batch)===u))}function $w(i,s,u="history"){return i.filter(o=>{var d;return(u!=="batch"||!!((d=o.batch)!=null&&d.trim()))&&(!s.category||o.category===s.category)&&(!s.verdict||o.verdict===s.verdict)&&(!s.batch||o.batch===s.batch)})}function Iw(i,s=!1){return s&&i==="browser_session"?"Saved only on this computer. To keep it in a private account across devices, sign in with approved Staff access and a security code, then use Copy older work into this account.":{supabase_personal:"Saved online in Personal Workspace. Only this account can see it. Sign in with the same account on another device to open it.",supabase:"A shared copy is saved in Team Workspace. Approved Staff can see it.",local_account:"Saved on this computer for this account. Check saved changes to confirm it has also reached the online account.",browser_session:"Temporary demo result for this browser session. It may disappear when the online app restarts."}[i]||"Saved only on this computer. It is not automatically copied into an online account."}function Fw(i){return i==="authorized"?{allowed:!0,reason:""}:{allowed:!1,reason:i==="mfa"?"Enter the security code in Staff workspace before saving to the account or sharing with the team.":i==="guest"?"This result stays in the demo workspace. To save privately across devices, use an approved Staff account and its security code. Creating an account alone does not give Staff access.":"Check account approval and enter the security code in Staff workspace before saving online or sharing with the team."}}const Iy="New inspections are created in Personal Workspace. Switch to Personal to run an inspection, then share the result with your team.";async function Pw(i){const{data:s,error:u}=await i.auth.getSession();if(u)throw u;if(!s.session)return{state:"guest"};const o=await id(i);return o.revoked?{state:"revoked"}:o.approved?typeof o.mfa_required!="boolean"?{state:"unavailable"}:o.mfa_required&&!o.aal2?{state:"mfa"}:{state:o.authorized&&["staff","developer"].includes(o.role)?"authorized":"denied"}:{state:o.request_status==="rejected"?"rejected":"pending"}}function Ww({health:i,workspace:s,access:u={state:"checking"},files:o=[],categoryValid:d=!0,batch:m="",knownBatches:p=[],multiple:v=!1,retry:_=!1,busy:O=!1,ragBusy:g=!1,recordLoading:y=!1,offline:R=!1,connectionFailed:Y=!1}){const x=!!(i!=null&&i.personal_workspace_enabled&&s==="team"),j=(L,le)=>({disabled:!0,code:L,reason:le,teamRestricted:x});if(O)return j("processing","A photo is being checked. Wait for its result before starting another inspection.");if(g)return j("evidence_processing","The assistant is preparing an answer. Wait for it to finish before starting an inspection.");if(y)return j("record_loading","A saved inspection is loading. Wait for it to finish before starting another.");if(x)return j("team",Iy);if(!i)return j("connecting","Connecting to the inspection service. Wait for the connection or use Retry refresh.");if(Y||i.status!=="ok"||i.encoder_configured===!1)return j("service","The inspection service is temporarily unavailable. Reconnect or use Retry refresh.");if(R&&i.mode==="cloud_session_workspace")return j("offline","The cloud inspection service is offline. Reconnect before running an inspection.");if((i.mode==="cloud_session_workspace"||i.local_sync_enabled)&&i.auth_workflow_enabled){const L={checking:"Checking whether the account can run an inspection.",pending:"Staff access is waiting for approval. Open Staff workspace to check the request. Sign out to try the public demo.",rejected:"The Staff request was not approved. Contact the workspace administrator, or sign out to try the public demo.",revoked:"Staff access has been removed. Contact the workspace administrator.",mfa:"Enter the six-digit security code in Staff workspace before inspecting.",denied:"This account cannot run Staff inspections. Check access in Staff workspace.",unavailable:"Account access could not be checked. Check the connection or sign in again in Staff workspace."};if(!["guest","authorized"].includes(u.state))return j(u.state,L[u.state]||L.denied)}if(!d)return j("category","Choose the product shown in the photo. A sample photo sets it automatically.");if(!_){if(!o.length)return j("images","Choose an image before running an inspection.");if(!v&&o.length!==1)return j("single","Choose one photo, or use Batch inspection to check several photos together.");if(o.length>20)return j("count","Choose up to 20 images per batch.");if(o.some(L=>L.size<=0||L.size>10*1024*1024))return j("size","Each image must be under 10 MB. Choose a smaller photo.");if(o.some(L=>L.type?!["image/jpeg","image/png","image/webp"].includes(L.type):!/\.(jpe?g|png|webp)$/i.test(L.name)))return j("format","Choose JPEG, PNG or WebP images.");if(o.reduce((L,le)=>L+le.size,0)>20*1024*1024)return j("total","Keep the total batch upload within 20 MB.");if(v&&!m.trim())return j("batch","Add a batch label before inspecting this batch.");if(v&&Jw(m,p))return j("duplicate_batch","This batch name is already used. Choose a new name. To finish an earlier batch, use Continue unfinished photos.");if(m.length>80)return j("batch_length","Keep the batch label within 80 characters.")}return{disabled:!1,code:"ready",reason:"",teamRestricted:x}}function eS({readiness:i,busy:s,multiple:u,onRun:o,onSwitch:d,switchDisabled:m=!1}){return r.createElement(r.Fragment,null,r.createElement("button",{type:"button",className:"primary wide",disabled:i.disabled,"aria-describedby":i.disabled?"inspection-run-reason":void 0,title:i.reason||void 0,onClick:o},s?r.createElement(uc,{className:"spin",size:18}):r.createElement(Fs,{size:18})," ",s?"Inspecting image…":u?"Inspect batch":"Run inspection"),i.disabled&&r.createElement("p",{id:"inspection-run-reason",className:"caption",role:"status"},i.reason),i.teamRestricted&&r.createElement(r.Fragment,null,i.code!=="team"&&r.createElement("p",{className:"caption"},Iy),r.createElement("button",{type:"button",className:"secondary wide",disabled:m,onClick:d},"Switch to Personal Workspace")))}function tS({multiple:i,files:s=[]}){return r.createElement("div",{className:"caption",role:"status"},r.createElement("p",null,i?"Check up to 20 photos at once. Give the batch a new name so its results stay together.":"Check one product photo. Unusual areas are highlighted, and you can ask about the result."),(i?s.length>0:s.length===1)&&r.createElement("p",null,r.createElement("strong",null,s.length," photo",s.length===1?"":"s"," ready.")," Press ",i?"Inspect batch":"Run inspection"," to get the result."))}function aS(i,s,u){if((i==null?void 0:i.mode)!=="cloud_session_workspace"&&!(i!=null&&i.local_sync_enabled))return null;if(i.auth_workflow_enabled){const o={checking:"Checking access before opening saved work.",mfa:"Open Staff workspace and enter the six-digit security code to open private work.",pending:"The Staff request is waiting for approval. Private and Team work will be available after approval.",rejected:"The Staff request was not approved. Contact the workspace administrator if help is needed.",revoked:"Staff access has been removed. Contact the workspace administrator.",denied:"This account cannot open Staff work. Check access in Staff workspace.",unavailable:"Account access could not be checked. Check the connection and retry, or sign in again in Staff workspace."};if(!["guest","authorized"].includes(s.state))return{reason:o[s.state]||o.denied,action:s.state==="checking"?null:"account",retry:s.state==="unavailable",failed:s.state==="unavailable"}}return s.state==="guest"&&u==="team"&&i.personal_workspace_enabled?{reason:"Sign in with an approved Staff account and enter the security code to open Team work. To try the app without signing in, switch to Personal Workspace for the demo.",action:"personal"}:null}async function ty(i,s,u){const o=await Promise.allSettled(i.map(([,d])=>s(d)));return u()?{apply(){i.forEach(([,,d],m)=>{o[m].status==="fulfilled"&&d(o[m].value)})},failures:i.flatMap(([d],m)=>{var p;return o[m].status==="rejected"?[{name:d,status:(p=o[m].reason)==null?void 0:p.status}]:[]})}:null}function nS({errors:i=[],block:s,refreshing:u,onRetry:o,onAccount:d,onPersonal:m,showAccess:p=!0}){return i.length?r.createElement("div",{className:"error",role:"alert"},"Some information could not be updated: ",i.join(", "),". Check the connection and try again. Shown results may be out of date."," ",r.createElement("button",{className:"text-button",disabled:u,"aria-busy":u,onClick:o},u?"Refreshing…":"Retry refresh")):!s||!p?null:r.createElement("div",{className:s.failed?"error":"note",role:s.failed?"alert":"status"},r.createElement("div",null,s.reason," ",s.action==="account"&&r.createElement("button",{className:"text-button",onClick:d},"Open Staff workspace"),s.action==="personal"&&r.createElement("button",{className:"text-button",onClick:m},"Switch to Personal Workspace"),s.retry&&r.createElement("button",{className:"text-button",disabled:u,"aria-busy":u,onClick:o},u?"Refreshing…":"Retry refresh")))}let Fy=!1;function lS(i){Fy=i===!0}function iS(){return Fy}async function cS(i,s={},u,o,d=fetch,m=localStorage){var y;const p=new URL(i,location.origin).pathname;if((!s.method||s.method==="GET")&&(/^\/api\/(health|models|evaluation|samples|gallery)(\/|$)/.test(p)||p==="/api/benchmark/official"))return d(i,{...s,cache:"no-store"});let v=m.getItem("defectrag-local-browser");/^[a-f0-9]{64}$/.test(v||"")||(v=Array.from(crypto.getRandomValues(new Uint8Array(32)),R=>R.toString(16).padStart(2,"0")).join(""),m.setItem("defectrag-local-browser",v));const{data:_,error:O}=await u.auth.getSession();if(O)throw new Error("Local account session could not refresh. Sign in again; saved local records are retained.");const g=new Headers(s.headers||{});return g.set("X-DefectRAG-Session",v),g.set("X-DefectRAG-Workspace",o),(y=_.session)!=null&&y.access_token&&g.set("Authorization","Bearer "+_.session.access_token),d(i,{...s,headers:g,cache:"no-store"})}function rS(i){return i?i.state==="conflict"?"This inspection was changed in two places. Both copies are kept. Choose Compare saved changes to decide what to keep.":i.message?vn(i.message,"Some changes could not be saved online yet. Work saved on this computer is kept. Check the connection and try again."):i.pending?`${i.pending} change${i.pending===1?" is":"s are"} saved on this computer and waiting to be confirmed online. Keep the app open and connected until this finishes.`:i.scan_in_progress?"Loading more private inspections from the online account. The next check will continue where this one stopped.":i.last_synchronized?"Private work is up to date across this computer and the online account. New changes are checked about every 15 seconds. Team sharing is still a separate choice.":"Preparing this account’s private saved work. Nothing is shared with the team automatically.":"Work saved on this computer is kept here. Sign in and verify the security code to keep this account’s private work up to date across devices."}function sS({status:i,onRetry:s,onResolve:u,onBackup:o,onListImports:d,onImport:m,canImport:p,refreshing:v}){var I;const[_,O]=M.useState(null),[g,y]=M.useState(!1),[R,Y]=M.useState(""),[x,j]=M.useState(null),[L,le]=M.useState([]);async function Ne(){y(!0),Y("");try{j(await d())}catch{Y("Saved work on this computer could not be listed. Check the sign-in in Staff workspace.")}finally{y(!1)}}async function je(){y(!0),Y("");try{await m(L),j(null),le([])}catch{Y("The copy could not be confirmed. The original work is still saved on this computer.")}finally{y(!1)}}async function te(se){y(!0),Y("");try{await u(_,se),O(null)}catch{Y("The chosen copy could not be saved. Both copies have been kept.")}finally{y(!1)}}return r.createElement("section",{className:"note",role:"status"},r.createElement("div",null,r.createElement("strong",null,"Keep private work up to date across devices"),r.createElement("p",null,rS(i)),r.createElement("button",{className:"text-button",disabled:v||g,onClick:s},v?"Checking saved changes…":"Check saved changes"),p&&r.createElement("button",{className:"text-button",disabled:g,onClick:Ne},"Copy older work into this account"),(i==null?void 0:i.last_backup)&&r.createElement("button",{className:"text-button",disabled:g,onClick:()=>o(i.last_backup)},"Download backup copy"),x&&r.createElement("div",null,r.createElement("p",null,"Choose up to 10 inspections to copy into this private account. This list shows the latest 500 saved only on this computer. Originals stay here. Only select work that belongs in this account; the original inspector cannot be checked. Nothing is shared with the team."),x.map(se=>r.createElement("label",{className:"caption",key:se.id},r.createElement("input",{type:"checkbox",style:{width:16,height:16,minHeight:16,padding:0,marginRight:6,verticalAlign:"middle"},checked:L.includes(se.id),disabled:g||!L.includes(se.id)&&L.length>=10,onChange:Z=>le(Z.target.checked?[...L,se.id]:L.filter(W=>W!==se.id))}),se.category," · ",se.id.slice(0,8)," · ",new Date(se.created_at).toLocaleString())),r.createElement("button",{className:"secondary",disabled:g||!L.length,onClick:je},"Copy selected inspections")," ",r.createElement("button",{className:"text-button",disabled:g,onClick:()=>j(null)},"Cancel")),(I=i==null?void 0:i.conflicts)==null?void 0:I.map(se=>r.createElement("button",{className:"text-button",key:se.inspection_id,disabled:g,onClick:()=>O(se.inspection_id)},"Compare saved changes · ",se.inspection_id.slice(0,8))),_&&r.createElement("div",null,r.createElement("p",null,"This inspection was changed in two places. Use the online copy to replace the copy shown on this computer; the previous changes are kept in a backup. Or try saving the computer’s changes again. If they still overlap, both copies will be kept for another review."),r.createElement("button",{className:"secondary",disabled:g,onClick:()=>te("cloud")},"Use online copy")," ",r.createElement("button",{className:"secondary",disabled:g,onClick:()=>te("retry_local")},"Try saving this computer’s changes")," ",r.createElement("button",{className:"text-button",disabled:g,onClick:()=>O(null)},"Cancel")),R&&r.createElement("p",{role:"alert"},vn(R))))}function oS({cloud:i,onStart:s,status:u}){return r.createElement("section",{className:"note",role:"status"},r.createElement("div",{className:"demo-banner"},r.createElement("div",null,r.createElement("strong",null,"Demo workspace · try the app without signing in"),r.createElement("p",{className:"caption"},i?"Demo results belong to this browser session and may disappear when the online app restarts. Private Staff records are not shown. Free service limits may cause a wait.":"Without signing in, results stay on this computer. They are separate from account and Team records."," Sign in with an approved account to keep private work across devices.",u&&r.createElement(r.Fragment,null," ",u))),s&&r.createElement("button",{className:"secondary",onClick:s},"Try an inspection")))}function sc(i,s){return((i==null?void 0:i.mode)==="cloud_session_workspace"||(i==null?void 0:i.local_sync_enabled)===!0)&&(s==null?void 0:s.state)==="guest"}function uS({current:i,onSave:s,disabled:u=!1,demo:o=!1}){const[d,m]=M.useState((i==null?void 0:i.status)||"Needs review"),[p,v]=M.useState((i==null?void 0:i.decision)||"Pending"),[_,O]=M.useState(""),[g,y]=M.useState(!1),[R,Y]=M.useState("");return r.createElement("section",{className:"review-form","data-tour":"review"},r.createElement("h3",null,o?"Demo review · this browser only":"Staff review"),o&&r.createElement("p",{className:"note"},"Try recording a review here. It stays with this demo result and is not an official Staff review, Team decision or corrective action."),i&&r.createElement("p",{className:"caption"},r.createElement("strong",null,i.status," · ",jf(i.decision))," · ",i.reviewer," · ",new Date(i.created_at).toLocaleString(),i.note&&r.createElement(r.Fragment,null,r.createElement("br",null),i.note)),r.createElement("ul",{className:"decision-key","aria-label":"What each decision means"},r.createElement("li",null,r.createElement("b",{className:"ok"},"Accept")," no defect"),r.createElement("li",null,r.createElement("b",{className:"warn"},"Hold")," needs more checks"),r.createElement("li",null,r.createElement("b",{className:"bad"},"Reject")," defect confirmed · can start a corrective action")),r.createElement("form",{onSubmit:async x=>{x.preventDefault(),y(!0),Y("");try{Wf(d,p,_),await s({status:d,decision:p,note:_}),O("")}catch(j){Y(j.message)}finally{y(!1)}}},r.createElement("div",{className:"review-fields"},r.createElement("label",{className:"field"},"Review status",r.createElement("select",{value:d,disabled:u||g,onChange:x=>{m(x.target.value),v(x.target.value==="Reviewed"?"Hold":"Pending")}},wy.map(x=>r.createElement("option",{key:x},x)))),r.createElement("label",{className:"field"},"Review decision",r.createElement("select",{value:p,disabled:u||g||d!=="Reviewed",onChange:x=>v(x.target.value)},(d==="Reviewed"?Sy.slice(1):["Pending"]).map(x=>r.createElement("option",{key:x,value:x},jf(x)))))),r.createElement("div",{className:"question-form"},r.createElement("input",{"aria-label":"Review decision note",value:_,maxLength:1e3,disabled:u||g,placeholder:"Add a reason or what was checked…",onChange:x=>O(x.target.value)}),r.createElement("button",{className:"primary",disabled:u||g},g?"Saving review…":"Save review")),R&&r.createElement("p",{role:"alert",className:"error"},vn(R))))}function fS({record:i,messages:s,url:u,api:o,enabled:d,local:m=!1,access:p={state:"checking"},onChanged:v,onNotice:_}){const[O,g]=M.useState(!1),[y,R]=M.useState(!1),[Y,x]=M.useState(""),j=M.useRef(null);j.current||(j.current=R1()),M.useEffect(()=>()=>j.current.invalidate(),[i.id,i.workspace]);const L=i.workspace==="team",le=Fw(p.state);async function Ne(je=!1){if(d&&!le.allowed){x(le.reason);return}const te=j.current.begin();R(!0),x("");try{const I=d?await o(`/api/inspections/${i.id}/${je?"save-personal":"share"}`,{method:"POST",headers:{"Content-Type":"application/json"},body:je?void 0:JSON.stringify({include_conversation:O})}):await T1(i,s,u);if(fi(),!te())return;_(je?"Saved in Personal Workspace. Only this account can see it.":I.alreadyShared?"This inspection is already in Team workspace.":"A separate copy has been shared with the team. Personal notes and later conversations stay private."),await v()}catch(I){te()&&x(I.message+" Sign in with an approved account if required.")}finally{te()&&R(!1)}}return r.createElement("div",null,r.createElement("p",{className:"caption"},Iw(i.storage,m)),d&&!le.allowed&&r.createElement("p",{className:"caption",id:"personal-save-reason"},le.reason," ",r.createElement("a",{href:"#team"},"Open Staff workspace")),r.createElement("div",{className:"button-row"},d&&i.storage==="browser_session"&&r.createElement("button",{className:"secondary","aria-describedby":le.allowed?void 0:"personal-save-reason",disabled:y||!le.allowed,onClick:()=>Ne(!0)},"Save to Personal"),r.createElement("button",{className:"secondary",disabled:y||d&&(L||!le.allowed),onClick:()=>Ne()},y?"Saving…":d&&L?"Already shared with team":"Share with team")),d&&!L&&le.allowed&&r.createElement("label",{className:"caption"},r.createElement("input",{type:"checkbox",style:{width:16,height:16,minHeight:16,padding:0,marginRight:6,verticalAlign:"middle"},checked:O,disabled:y,onChange:je=>g(je.target.checked)})," Also share the saved assistant conversation"),Y&&r.createElement("p",{className:"error",role:"alert"},vn(Y)))}const kS=(i={})=>(i==null?void 0:i.correctiveActionsEnabled)!==!1,Uf=(i,s=!1)=>!s&&!!((i==null?void 0:i.mode)==="cloud_session_workspace"||i!=null&&i.local_sync_enabled);function DS(i){var u,o;if(!i)return;i.focus({preventScroll:!0});const s=(o=(u=globalThis.window)==null?void 0:u.matchMedia)==null?void 0:o.call(u,"(prefers-reduced-motion: reduce)").matches;i.scrollIntoView({block:"start",behavior:s?"auto":"smooth"})}const ay=i=>"data:image/jpeg;base64,"+i,xf=i=>typeof i=="number"?i.toFixed(5):"—";function dS({local:i=!1}){return r.createElement("p",{className:"note"},r.createElement("span",null,i?r.createElement(r.Fragment,null,"Public sharing is not available from this computer yet. Demo results stay here. Account work stays private unless shared separately."," ",r.createElement("a",{href:"https://wizzas-defectrag.hf.space/#gallery",target:"_blank",rel:"noreferrer"},"Open the online community gallery")," to browse existing public copies. Opening it does not publish a local inspection."):"The public gallery is not available yet. Other inspection features can still be used."))}function mS({record:i,api:s}){const[u,o]=M.useState(null),[d,m]=M.useState(!1),[p,v]=M.useState(!1),[_,O]=M.useState(""),g=M.useRef(!1),y=M.useRef(0);M.useEffect(()=>{let x=!0;const j=zy(async()=>{if(g.current)return;const L=y.current;try{const le=await s(`/api/inspections/${i.id}/publication`);x&&L===y.current&&(o(le),O(""))}catch(le){throw x&&L===y.current&&O(le.message),le}});return()=>{x=!1,j.stop()}},[i.id,s]);const R=u==null?void 0:u.publication;async function Y(){if(!g.current){g.current=!0,y.current++,v(!0),O("");try{if(R!=null&&R.visible)await s(`/api/gallery/${R.id}/withdraw`,{method:"POST"}),o({...u,publication:{...R,visible:!1}});else{const x=await s(`/api/inspections/${i.id}/publication`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({consent:d})});o({...u,publication:x}),m(!1)}}catch(x){O(x.message)}finally{g.current=!1,v(!1)}}}return r.createElement("section",{className:"card"},r.createElement("div",{className:"section-title"},r.createElement("h2",null,"Publish to community gallery"),r.createElement("span",{className:"subtle-tag"},"OPTIONAL · PUBLIC")),r.createElement("p",null,"Publishing lets anyone see a separate copy of the photo, highlighted areas, product type and result. Private history stays in this workspace."),r.createElement("p",{className:"caption"},"Names, filenames, batch names, conversations and Staff reviews are not included. Anything visible inside the photo can still be seen. Only publish photos that may be shared publicly."),!u&&!_&&r.createElement("p",{role:"status"},"Checking gallery availability…"),(u==null?void 0:u.enabled)===!1&&r.createElement("p",{className:"note"},u.runtime==="local"?"Public sharing is not set up on this computer. This is not caused by using the demo. Results remain saved here. The online app has its own public sharing settings.":"Public sharing is not available in this app yet. Once enabled, demo visitors can publish by choice. Private work stays separate."),(u==null?void 0:u.enabled)&&!R&&r.createElement("label",{className:"field"},r.createElement("span",{style:{fontSize:14}},r.createElement("input",{type:"checkbox",style:{width:18,height:18,minHeight:18,padding:0,marginTop:0,marginRight:8,verticalAlign:"middle"},checked:d,disabled:p,onChange:x=>m(x.target.checked)})," This photo may be shared publicly. Publish the photo, highlighted areas and result for anyone to see.")),R&&!R.visible&&r.createElement("p",{role:"status",className:"note"},"This publication was withdrawn or moderated. It remains unavailable in the public gallery."),(u==null?void 0:u.enabled)&&(!R||R.visible)&&r.createElement("button",{className:"secondary",disabled:p||!R&&!d,onClick:Y},p?"Saving…":R?"Withdraw public copy":"Publish to community gallery"),(R==null?void 0:R.visible)&&r.createElement("p",{className:"caption"},"Published. Other visitors can browse this copy in Community gallery. Withdrawal keeps the private inspection. Downloaded or cached copies cannot be recalled."),_&&r.createElement("p",{className:"error",role:"alert"},vn(_)))}function hS({api:i,staff:s=!1,local:u=!1}){const[o,d]=M.useState(0),[m,p]=M.useState(0),[v,_]=M.useState(null),[O,g]=M.useState(""),[y,R]=M.useState(null),[Y,x]=M.useState(""),[j,L]=M.useState(!1),le=M.useRef(null),Ne=M.useRef(null);M.useEffect(()=>{var I,se;O&&((I=le.current)==null||I.focus({preventScroll:!0}),(se=le.current)==null||se.scrollIntoView({block:"start",behavior:"instant"}))},[O]);function je(){var I;g(""),(I=Ne.current)==null||I.focus()}M.useEffect(()=>{let I=!0;return _(null),x(""),i(`/api/gallery?offset=${o}`).then(se=>{I&&_(se)}).catch(se=>{I&&x(se.message)}),()=>{I=!1}},[i,o,m]),M.useEffect(()=>{let I=!0;return R(null),O?(i(`/api/gallery/${O}`).then(se=>{I&&R(se)}).catch(se=>{I&&x(se.message)}),()=>{I=!1}):()=>{I=!1}},[i,O,m]);async function te(I){L(!0),x("");try{await i(`/api/gallery/${O}/${I?"moderate":"withdraw"}`,{method:"POST"}),g(""),p(se=>se+1)}catch(se){x(se.message)}finally{L(!1)}}return r.createElement(r.Fragment,null,r.createElement("section",{className:"card"},r.createElement("div",{className:"section-title"},r.createElement("h2",null,"Shared by demo visitors"),r.createElement("button",{className:"secondary",disabled:j,onClick:()=>p(I=>I+1)},"Refresh gallery")),r.createElement("p",null,"Only explicitly published inspections appear here. Browsing requires no account. Private guest and staff histories are separate."),r.createElement("p",{className:"caption"},"These are saved results shared by visitors. They are not new inspections or expert product approvals. Visitors choose the product type, which may be incorrect. VisA sample images: Zou et al., ECCV 2022 · CC BY 4.0."),Y&&r.createElement("p",{className:"error",role:"alert"},vn(Y)),!v&&!Y&&r.createElement("p",{role:"status"},"Loading public gallery…"),(v==null?void 0:v.enabled)===!1&&r.createElement(dS,{local:u}),(v==null?void 0:v.enabled)&&r.createElement(r.Fragment,null,r.createElement("div",{className:"table-wrap"},r.createElement("table",null,r.createElement("thead",null,r.createElement("tr",null,r.createElement("th",null,"Product"),r.createElement("th",null,"Inspection result"),r.createElement("th",null,"Score"),r.createElement("th",null,"Published"),r.createElement("th",null,"Preview"))),r.createElement("tbody",null,v.items.map(I=>r.createElement("tr",{key:I.id},r.createElement("td",null,I.measurement.category),r.createElement("td",null,Er(I.measurement.verdict)),r.createElement("td",null,xf(I.measurement.score)),r.createElement("td",null,new Date(I.created_at).toLocaleString()),r.createElement("td",null,r.createElement("button",{className:"text-button",disabled:j,"aria-expanded":O===I.id,"aria-controls":"public-inspection-preview",onClick:se=>{Ne.current=se.currentTarget,x(""),g(I.id)}},"View image & heatmap"))))))),!v.items.length&&r.createElement("p",{className:"empty"},"No published inspections on this page. Inspect an image, then choose Publish to community gallery."),r.createElement("div",{className:"button-row"},r.createElement("button",{className:"secondary",disabled:!o||j,onClick:()=>{g(""),d(I=>Math.max(0,I-12))}},"Previous"),r.createElement("span",null,"Page ",Math.floor(o/12)+1),r.createElement("button",{className:"secondary",disabled:v.items.length<12||o>=96||j,onClick:()=>{g(""),d(I=>I+12)}},"Next")))),O&&r.createElement("section",{className:"card",id:"public-inspection-preview","aria-labelledby":"public-inspection-preview-heading"},r.createElement("div",{className:"section-title"},r.createElement("h2",{ref:le,tabIndex:-1,id:"public-inspection-preview-heading"},"Public inspection snapshot"),r.createElement("button",{className:"text-button",disabled:j,onClick:je},"Close preview")),Y&&r.createElement("p",{className:"error",role:"alert"},vn(Y)," ",r.createElement("button",{className:"text-button",onClick:()=>{x(""),p(I=>I+1)}},"Retry preview")),!y&&!Y&&r.createElement("p",{role:"status"},"Loading image and heatmap…"),y&&r.createElement(r.Fragment,null,r.createElement("div",{className:"inspection-grid",style:{gridTemplateColumns:"repeat(auto-fit,minmax(min(100%,260px),1fr))"}},r.createElement("figure",{style:{margin:0}},r.createElement("img",{style:{width:"100%"},src:ay(y.image),alt:"Publicly shared inspection image"}),r.createElement("figcaption",null,"Published image preview")),r.createElement("figure",{style:{margin:0}},r.createElement("img",{style:{width:"100%"},src:ay(y.heatmap),alt:"Anomaly heatmap for the published inspection"}),r.createElement("figcaption",null,"Highlighted unusual areas"))),r.createElement("p",null,r.createElement("strong",null,y.measurement.category," · ",Er(y.measurement.verdict))," · Score ",xf(y.measurement.score)," · Threshold ",xf(y.measurement.threshold)),r.createElement("p",{className:"caption"},y.measurement.model_id," · ",y.measurement.localization,r.createElement("br",null),"A higher score means a larger difference from normal examples. It is not an accuracy percentage or the chance of a defect."),r.createElement("div",{className:"button-row"},r.createElement("button",{className:"secondary",disabled:j,onClick:()=>te(!1)},"Withdraw own publication"),s&&r.createElement("button",{className:"secondary",disabled:j,onClick:()=>te(!0)},"Staff: hide publication")),r.createElement("p",{className:"caption"},"To remove a demo publication, use the browser that published it. Staff can remove their own publications using the same approved account. If access is lost, contact the workspace administrator with this public item number: ",y.id,". Staff can hide unsuitable publications. Hidden copies are kept privately for review and are no longer shown publicly."))))}async function ny(){var i;if(pc())return"practice";if(eo()){const{data:s}=await(await mc()).auth.getSession();if((i=s.session)!=null&&i.user)return"staff:"+s.session.user.id+(Ry()?":personal":"")}return"browser"}function Py(){return new Promise((i,s)=>{const u=indexedDB.open("defectrag-batch-checkpoints",1);u.onupgradeneeded=()=>u.result.createObjectStore("jobs"),u.onsuccess=()=>i(u.result),u.onerror=()=>s(new Error("Browser batch recovery is unavailable."))})}async function pS(i,s){if(i==="practice")return;const u=await Py();try{await new Promise((o,d)=>{const m=u.transaction("jobs","readwrite");m.objectStore("jobs").put(s,i),m.oncomplete=o,m.onerror=()=>d(new Error("Browser storage could not save batch progress.")),m.onabort=()=>d(new Error("Browser storage could not save batch progress."))})}finally{u.close()}}async function gS(i){if(i==="practice")return null;const s=await Py();try{return await new Promise((u,o)=>{const d=s.transaction("jobs").objectStore("jobs").get(i);d.onsuccess=()=>u(d.result||null),d.onerror=()=>o(d.error)})}finally{s.close()}}const ha=!1,yS=M.lazy(()=>br(()=>import("./TeamWorkspace-X22D4OgN.js"),[],import.meta.url)),Yn=z1,$t=Jy,vS=[["",["overview","inspect","batch","history"]],["Review",["alerts","cases","team"]],["Insight",["performance","benchmark","gallery"]],["More",["recovery","about"]]],Xf=[["overview","Overview",xy],["inspect","Image inspection",Fs],["batch","Batch inspection",jg],["history","Inspection history",Lg],["alerts","Review alerts",My],["cases","Corrective Actions",o_],["performance","Model performance",n_],["benchmark","Official benchmark",d_],["gallery","Community gallery",Fs],["team","Staff workspace",jg],["recovery","History recovery",Lg],["about","Help & references",Nr]];function ly(i="overview"){const s=location.hash.slice(1);return/(?:^|&)(access_token|error_description|type)=/.test(s)||new URLSearchParams(location.search).has("code")?"team":Xf.some(u=>u[0]===s)?s:i}const ta=(i,s=3)=>typeof i=="number"?i.toFixed(s):"—",Ks=i=>typeof i=="number"?(i*100).toFixed(1)+"%":"—",Qf=i=>i?new Date(i).toLocaleString():"";async function Wy(i,s={}){return pc()?b1(i,s):iS()?cS(Yn(i),s,await mc(),fc()):M1(Yn(i),s)}async function Et(i,s={}){if(pc())return Ty(i,s);let u;try{u=await Wy(i,s)}catch(o){throw nd("network",(o==null?void 0:o.message)||"Request failed",{path:i}),o}return lw(u,i)}function bS({render:i}){return i()}function Is({value:i}){return r.createElement("span",{className:"badge "+(i==null?void 0:i.toLowerCase())},r.createElement("i",null),Er(i))}function hr({children:i}){return r.createElement("div",{className:"empty"},r.createElement(Fs,{size:30}),r.createElement("p",null,i))}const ev=i=>"./assets/sample-thumbs/"+i.name+".jpg";function iy({samples:i,busy:s,onChoose:u}){return r.createElement("div",{className:"gallery"},i.map(o=>r.createElement("button",{className:"sample",key:o.name,disabled:s,onClick:()=>u(o)},r.createElement("img",{src:ev(o),loading:"lazy",decoding:"async",onError:d=>{d.currentTarget.dataset.fallback||(d.currentTarget.dataset.fallback="1",d.currentTarget.src=Yn(o.url))},alt:$t[o.category]+" sample photo"}),r.createElement("div",null,r.createElement("strong",null,$t[o.category]),r.createElement("span",null,o.name.endsWith("_good")?"Normal sample":"Unusual sample"," ",r.createElement(di,{size:14}))))))}function cy({filter:i,setFilter:s,stats:u,filteredCount:o}){return r.createElement("div",{className:"filters"},r.createElement(B_,{size:17}),r.createElement("select",{"aria-label":"Filter category",value:i.category,onChange:d=>s({...i,category:d.target.value})},r.createElement("option",{value:""},"All products"),Object.entries($t).map(([d,m])=>r.createElement("option",{key:d,value:d},m))),r.createElement("select",{"aria-label":"Filter result",value:i.verdict,onChange:d=>s({...i,verdict:d.target.value})},r.createElement("option",{value:""},"All results"),["Good","Anomalous","Uncertain"].map(d=>r.createElement("option",{key:d,value:d},Er(d)))),r.createElement("select",{"aria-label":"Filter batch",value:i.batch,onChange:d=>s({...i,batch:d.target.value})},r.createElement("option",{value:""},"All batches"),u.batches.filter(d=>d.batch).map(d=>r.createElement("option",{key:d.batch},d.batch))),r.createElement("button",{className:"text-button",onClick:()=>s({category:"",verdict:"",batch:""})},"Clear filters"),r.createElement("span",null,o," records shown"))}function Js({rows:i=[],emptyMessage:s,hasRecords:u,onOpen:o,reviewMode:d=!1}){return i.length?r.createElement("div",{className:"table-wrap"},r.createElement("table",{className:"stackable"},r.createElement("thead",null,r.createElement("tr",null,r.createElement("th",null,"Inspection / time"),r.createElement("th",null,"Product"),r.createElement("th",null,"Batch"),r.createElement("th",null,"Result"),r.createElement("th",null,"Score / review limit"),r.createElement("th",null,"Time to check"),r.createElement("th",null))),r.createElement("tbody",null,i.map(m=>r.createElement("tr",{key:m.id},r.createElement("td",{"data-label":"Inspection"},r.createElement("strong",null,m.id.slice(0,8)),r.createElement("small",null,Qf(m.created_at))),r.createElement("td",{"data-label":"Product"},$t[m.category]),r.createElement("td",{"data-label":"Batch"},m.batch||"Individual"),r.createElement("td",{"data-label":"Result"},r.createElement(Is,{value:m.verdict})),r.createElement("td",{"data-label":"Score / limit"},ta(m.score)," ",r.createElement("span",{className:"muted"},"/ ",ta(m.threshold))),r.createElement("td",{"data-label":"Time to check"},ta(m.inference_ms,0)," ms"),r.createElement("td",{className:"row-action"},r.createElement("button",{className:d?"text-button":"icon-button","aria-label":(d?"Review shared inspection ":"Open inspection ")+m.id.slice(0,8),onClick:()=>o(m)},d?"Review":r.createElement(r.Fragment,null,r.createElement(di,{size:18}),r.createElement("span",{className:"row-open-label"},"Open"))))))))):r.createElement(hr,null,s||(u?"No inspections match these filters. Clear the filters to see saved records.":"No inspections yet. Add an image to start your inspection log."))}function ES(){var wi,Cn;const[i,s]=M.useState(()=>ly()),[u,o]=M.useState(iw);M.useEffect(()=>cw(u),[u]);const[d,m]=M.useState(rw);M.useEffect(()=>{sw(d)},[d]);const[p,v]=M.useState(30),[_,O]=M.useState("recent"),[g,y]=M.useState(!1),R=M.useRef(!1),Y=M.useRef("overview"),[x,j]=M.useState($s),L=g&&x.started;function le(){try{Jg(window.localStorage)}catch{Jg(null)}const H=x.started;y(!1),j($s()),H&&(p1(),Ne(),at(Y.current))}function Ne(){Dt.current.invalidate(),Zn(),ra(),Ut([]),tt(""),pa(""),Jn(null),Ze(null),Ya.current=null,kl(null),Q(""),Qn.current=!1,Hl({state:"checking"}),gt(null)}function je(){X||Ae||ut||(Y.current=i,h1({assets:{original:Mf,heatmap:Rw},metadata:{samples:Ye,evaluation:G,official:I},onEvent:te}),Ne(),Sf("personal"),xt("personal"),j(Ig($s(),{type:"start"})),at("inspect"))}function te(H){j(K=>Ig(K,H))}const[I,se]=M.useState(null),[Z,W]=M.useState([]),[$,ve]=M.useState(!1),[Ge,dt]=M.useState(!1),[_t,Ra]=M.useState(!1),[rt,Q]=M.useState(""),[D,fe]=M.useState(null),[_e,he]=M.useState({total:0,counts:{},batches:[]}),[Ye,aa]=M.useState([]),[Ve,w]=M.useState([]),[U,ie]=M.useState([]),[G,ye]=M.useState(null),[Ce,ce]=M.useState(""),[X,F]=M.useState(!1),[Ae,tn]=M.useState(!1),[oe,Rt]=M.useState(null),[mt,Ue]=M.useState([]),[ke,tt]=M.useState(""),[zt,pa]=M.useState(""),[$e,Ut]=M.useState([]),[bn,an]=M.useState(""),[de,st]=M.useState({category:"",verdict:"",batch:""}),[kt,ga]=M.useState(""),[He,za]=M.useState(!0),[xe,Ze]=M.useState(null),ot=M.useRef(wg()),Dt=M.useRef(wg()),wt=M.useRef(null),Xe=M.useRef(null),We=M.useRef(0),nn=M.useRef(null),ln=M.useRef(0),Qn=M.useRef(!1),Ya=M.useRef(null),[Va,gc]=M.useState(!1),[to,kl]=M.useState(null),[ht,xt]=M.useState("personal"),[ya,Zt]=M.useState(null),[It,ao]=M.useState({state:"refreshing"});function Zn(){Dt.current.invalidate(),w([]),ie([]),W([]),he({total:0,counts:{},batches:[]}),Zt(null),yi(H=>H.filter(K=>["Connection","Samples","Performance","Benchmark"].includes(K)))}function En(H){const K=ht==="team"&&H==="personal"&&!X&&!Ae&&!ut;Sf(H),xt(H),Zn(),ra(),K||Ut([]),st({category:"",verdict:"",batch:""})}function Kn(){X||Ae||ut||En("personal")}function hi(H){kl(H.id),at("team")}function _n(H){kl((H==null?void 0:H.id)||null),at("cases")}function pi(){kl(null),at("team")}function Dl(H){D!=null&&D.personal_workspace_enabled&&En("team"),yt({...H.payload,id:H.id,storage:"supabase",workspace:"team"})}const[na,Jn]=M.useState(null),[yc,gi]=M.useState(""),[$n,yi]=M.useState([]),[Ml,Ul]=M.useState(null),[ut,In]=M.useState(!1),xl=M.useRef(null);M.useEffect(()=>{var K,V;(i==="inspect"&&oe||i==="batch"&&xe)&&!X&&!ut&&((K=xl.current)==null||K.focus({preventScroll:!0}),(V=xl.current)==null||V.scrollIntoView({block:"start",behavior:"instant"}))},[i,oe==null?void 0:oe.id,(wi=xe==null?void 0:xe.records)==null?void 0:wi.length,X,ut,L]);const[ka,Hl]=M.useState({state:"checking"}),[Xa,gt]=M.useState(null),[Kt,la]=M.useState(null),[Tr,vc]=M.useState(null);M.useEffect(()=>{if(L||!eo()){vc(null);return}let H=!0;const K=()=>mc().then(Lw).then(V=>{H&&vc(V)}).catch(()=>{H&&vc(null)});return K(),window.addEventListener("defectrag-auth-change",K),()=>{H=!1,window.removeEventListener("defectrag-auth-change",K)}},[L]);const ql=Bw(Tr),[va,ia]=M.useState({phase:"idle",done:0,total:0}),[Da,wn]=M.useState(!1);M.useEffect(()=>{if(!Da)return;const H=K=>{K.key==="Escape"&&wn(!1)};return window.addEventListener("keydown",H),()=>window.removeEventListener("keydown",H)},[Da]);const[ca,Sn]=M.useState({}),Nn=M.useRef(new Set);async function Tn(H,K){if(!Nn.current.has(H)){Nn.current.add(H),Sn(V=>({...V,[H]:!0})),ce("");try{await K()}catch(V){ce(V.message)}finally{Nn.current.delete(H),Sn(V=>{const ne={...V};return delete ne[H],ne})}}}function Nt(H){return Tn("ack:"+H,async()=>{await Et("/api/alerts/"+H+"/acknowledge",{method:"POST"}),ie(K=>K.map(V=>V.id===H?{...V,acknowledged:V.acknowledged||1}:V)),fi()})}function Cr(H){return Tn("restore:"+H,async()=>{await Et("/api/history/restore",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ids:[H]})}),W(K=>K.filter(V=>V.id!==H)),Q("Inspection restored to active history."),fi()})}const Fn=U.filter(H=>!H.acknowledged).length;M.useEffect(()=>{va.phase==="confirm"&&Fn<2&&ia({phase:"idle",done:0,total:0})},[Fn,va.phase]),M.useEffect(()=>{if(i!=="overview"||!D||X||Ae||ut||R.current)return;R.current=!0;let H=!1;try{H=Kg(window.localStorage)}catch{H=Kg(null)}H||y(!0)},[i,D==null?void 0:D.mode,X,Ae,ut]);function bc(H=!1,K=!1){const V=H&&na&&Ya.current===$e&&na.category===ke&&na.batch===zt.trim();return Ww({health:D,workspace:ht,access:ka,files:$e,categoryValid:!!$t[ke],batch:H?zt:"",knownBatches:[..._e.batches,...Z],multiple:H,retry:K||!!V,busy:X,ragBusy:Ae,recordLoading:ut,offline:It.state==="offline",connectionFailed:$n.includes("Connection")})}const at=H=>{s(H),location.hash=H,ce(""),Q(""),wn(!1),ia(K=>K.phase==="working"?K:{phase:"idle",done:0,total:0})};function Pn(){sc(D,ka)&&(Kn(),at("inspect"))}function ra(){return ot.current.invalidate(),F(!1),tn(!1),In(!1),Rt(null),Ue([]),Ul(null),ga(""),ot.current.capture()}async function Wn(H=!1){Dt.current.invalidate();const K=Dt.current.capture();let V=D;if(H||!V){const P=[["Connection","/api/health",ba=>{V=ba,fe(ba)}],["Samples","/api/samples",aa],["Performance","/api/evaluation",ye],["Benchmark","/api/benchmark/official",se]],Be=await ty(P,Et,K);if(!Be)return!1;Be.apply();const Ke=Be.failures.map(ba=>ba.name);if(yi(ba=>[...ba.filter(tl=>!P.some(Qa=>Qa[0]===tl)),...Ke]),Qn.current=!Ke.length,Ke.includes("Connection"))throw new Error("The inspection service could not be reached.");const lt=!!V.personal_workspace_enabled!==Ry();if(lS(V.local_sync_enabled),O1(V.personal_workspace_enabled),xt(fc()),lt)return Zn(),yi(Ke),!1}let ne={state:"not_required"};if(((V==null?void 0:V.mode)==="cloud_session_workspace"||V!=null&&V.local_sync_enabled)&&V.auth_workflow_enabled){try{ne=await Pw(await mc())}catch{ne={state:"unavailable"}}if(!K())return!1}Hl(ne);const we=aS(V,ne,fc());if(gt(we),we)return Zn(),ra(),la(null),{state:"blocked",reason:we.reason};if(V!=null&&V.local_sync_enabled&&ne.state==="authorized"&&fc()==="personal")try{const P=await Et("/api/local-sync/run",{method:"POST"});if(!K())return!1;la(P)}catch{if(!K())return!1;la({state:"unavailable",message:"Cloud synchronization could not be confirmed. Local records remain saved."})}const Se=[["Overview","/api/stats",he],["History","/api/inspections?limit=500",w],["Alerts","/api/alerts",ie],["Recovery","/api/archives",W]];((V==null?void 0:V.mode)==="cloud_session_workspace"||V!=null&&V.local_sync_enabled)&&Se.push(["Workspace","/api/workspace",Zt]),i==="inspect"&&oe&&!ha&&!X&&!Ae&&(Se.push(["Selected conversation","/api/inspections/"+oe.id+"/messages",Ue],["Selected review","/api/inspections/"+oe.id+"/reviews",P=>Ul(P.at(-1)||null)]),Date.now()-We.current>480*1e3&&Se.push(["Selected images","/api/inspections/"+oe.id,P=>{We.current=Date.now(),Rt(P)}]));const z=await ty(Se,Et,K);if(!z)return!1;if(z.failures.some(P=>[401,403].includes(P.status))){Zn(),ra(),Hl({state:"denied"}),la(null);const P={reason:"Workspace access was denied or the session expired. Open Staff workspace to check sign-in and authenticator verification.",action:"account"};return gt(P),{state:"blocked",reason:P.reason}}if(z.apply(),yi(P=>[...P.filter(Be=>!Se.some(Ke=>Ke[0]===Be)),...z.failures.map(Be=>Be.name)]),z.failures.length||!Qn.current)throw new Error("Some workspace data could not synchronize.")}function Bl(){var H;Qn.current=!1,(H=wt.current)==null||H.refresh()}async function no(H,K){const V=Dt.current.capture(),ne=await Et("/api/local-sync/resolve",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({inspection_id:H,choice:K})});V()&&(la(ne),Bl())}async function qe(){if(va.phase==="working")return;const H=U.filter(ne=>!ne.acknowledged).map(ne=>ne.id);if(!H.length){ia({phase:"idle",done:0,total:0});return}ia({phase:"working",done:0,total:H.length}),ce("");let K=0,V=0;try{for(let ne=0;neEt("/api/alerts/"+z+"/acknowledge",{method:"POST"})));K+=Se.filter(z=>z.status==="rejected").length,V+=we.length,ia({phase:"working",done:V,total:H.length})}}finally{ia({phase:"idle",done:0,total:0}),fi(),await Wn().catch(()=>{})}K?ce(K+" of "+H.length+" alerts could not be marked. Press the button again to retry."):Q(H.length+(H.length===1?" alert":" alerts")+" marked as seen.")}async function Ar(H){const K=Dt.current.capture(),V=await Et("/api/local-sync/import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ids:H,confirmation:"IMPORT_PRIVATE"})});K()&&(la(V.status),Bl())}async function vi(H){const K=Dt.current.capture();try{const V=await Et("/api/local-sync/backups/"+H);if(!K())return;const ne=URL.createObjectURL(new Blob([JSON.stringify(V,null,2)],{type:"application/json"})),we=document.createElement("a");we.href=ne,we.download="defectrag-private-recovery-"+H+".json",we.click(),setTimeout(()=>URL.revokeObjectURL(ne),1e3)}catch{K()&&ce("Recovery backup could not be downloaded. Verify account access and retry.")}}async function el(){const H=++ln.current,K=ot.current.capture();try{const V=await ny(),ne=await gS(V);if(H!==ln.current)return;nn.current=V,gc(V.startsWith("staff:")),Jn(ne),Ze(ne?Ng(ne):null),ne&&K()&&location.hash==="#batch"&&(tt(ne.category),pa(ne.batch))}catch{H===ln.current&&gi("Browser batch recovery is unavailable. Keep this page open to retain pending files.")}}M.useEffect(()=>{const H=zy(()=>Wn(!Qn.current),{onState:ao});return wt.current=H,()=>{H.stop(),Dt.current.invalidate(),wt.current===H&&(wt.current=null)}},[i,ht,D==null?void 0:D.mode,D==null?void 0:D.personal_workspace_enabled,D==null?void 0:D.auth_workflow_enabled,D==null?void 0:D.local_sync_enabled,oe==null?void 0:oe.id,X,Ae,L]),M.useEffect(()=>{D!=null&&D.personal_workspace_enabled&&el()},[D==null?void 0:D.personal_workspace_enabled]),M.useEffect(()=>{el();const H=()=>{s(V=>ly(V)),ce(""),Q(""),wn(!1)},K=async V=>{var ne;if(V.type==="defectrag-auth-change"&&V.detail.event!=="TOKEN_REFRESHED"){Dt.current.invalidate(),Hl({state:"checking"}),gt(null),la(null);const we=nn.current,Se=V.detail.userId?"staff:"+V.detail.userId:"browser";(we==null?void 0:we.replace(/:personal$/,""))!==Se&&(Zn(),kl(null),Sf("personal"),xt("personal"),ot.current.invalidate(),F(!1),tn(!1),In(!1),(Se==="browser"||we!=null&&we.startsWith("staff:"))&&ra(),gc(Se.startsWith("staff:")),Ut([]),Jn(null),Ze(null),nn.current=Se,el())}(ne=wt.current)==null||ne.refresh()};return window.addEventListener("hashchange",H),window.addEventListener("defectrag-auth-change",K),()=>{ot.current.invalidate(),Dt.current.invalidate(),ln.current++,window.removeEventListener("hashchange",H),window.removeEventListener("defectrag-auth-change",K)}},[]),M.useEffect(()=>{if(!$e[0]){an("");return}const H=URL.createObjectURL($e[0]);return an(H),()=>URL.revokeObjectURL(H)},[$e]),M.useEffect(()=>{var K;if(!L)return;const H=(K=ld()[x.step])==null?void 0:K.event;H==="product"&&ke&&te({type:"complete",event:"product",value:ke}),H==="photo"&&$e.length===1&&ke==="candle"&&te({type:"complete",event:"photo"})},[L,x.step,ke,$e]);const sa=$w(Ve,de,i);async function yt(H){L&&i==="history"&&te({type:"complete",event:"open"});const K=ra();tt(H.category),pa(H.batch||""),Ut([]),In(!0),at("inspect");try{const[V,ne,we]=await Promise.all([Et("/api/inspections/"+H.id),Et("/api/inspections/"+H.id+"/messages"),ha?[]:Et("/api/inspections/"+H.id+"/reviews")]);if(!K())return;Rt(V),Ue(ne),Ul(we.at(-1)||null),tt(V.category),pa(V.batch||"")}catch(V){K()&&ce(V.message)}finally{K()&&In(!1)}}async function Or(){const H=Ye.filter(V=>V.category===ke);if(!H.length)return;const K=ra();Ze(null),Jn(null),Ya.current=null;try{const V=await Promise.all(H.map(async ne=>{const we=await fetch(L?Mf:Yn(ne.url));if(!we.ok)throw new Error("Sample unavailable");return new File([await we.blob()],ne.name+".jpg",{type:"image/jpeg"})}));K()&&Ut(V)}catch{K()&&ce("Sample photos could not load. Try again, or choose your own photos.")}}async function Rr(H){if(X||Ae||ut)return;const K=ra();try{const V=await fetch(L?Mf:Yn(H.url));if(!V.ok)throw new Error("Sample unavailable");const ne=await V.blob();if(!K())return;Ut([new File([ne],H.name+".jpg",{type:"image/jpeg"})]),tt(H.category),at("inspect")}catch(V){K()&&ce(V.message)}}async function bi(H=!1,K=!1){if(X)return;const V=bc(H,K);if(V.disabled){ce(V.reason);return}if(H&&na&&Ya.current===$e&&na.category===ke&&na.batch===zt.trim()){if(na.items.every(Se=>Se.status==="completed")){Q("This batch is already complete. Choose a new batch name and select images to start another batch.");return}K=!0}if(!K){if(!$e.length){ce("Choose an image first.");return}if(H&&!zt.trim()){ce("Add a batch label so these inspections can be filtered together.");return}if($e.some(Se=>Se.size>10*1024*1024)){ce("Each image must be no larger than 10 MB.");return}if($e.reduce((Se,z)=>Se+z.size,0)>20*1024*1024){ce("Keep each batch upload under 20 MB.");return}if($e.length>20){ce("Inspect up to 20 files per batch.");return}}const ne=ra();F(!0),ce("");const we=async(Se,z,P,Be="")=>{const Ke=new FormData;return Ke.append("category",z),Ke.append("batch",P),Ke.append("file",Se),Be&&Ke.append("request_id",Be),Et("/api/inspect",{method:"POST",body:Ke})};try{if(H){ln.current++;const Se=await ny();if(nn.current=Se,!K){const Be=await Et("/api/batch-name?name="+encodeURIComponent(zt.trim()));if(!ne())return;if(!Be.available)throw new Error("This batch name is already used in this workspace. Choose a different name. No images were submitted.")}const z=K?na:Sg($e,ke,zt.trim());if(K||(Ya.current=$e),!z)throw new Error("No unfinished batch is available.");if(!ne())return;tt(z.category),pa(z.batch);const P=async Be=>{try{await pS(Se,Be)}catch{ne()&&gi("Progress is retained in this tab, but browser recovery could not be saved.")}ne()&&(Jn(Be),Ze(Ng(Be)))};await P(z),await r1(z,we,P,()=>ne()&&nn.current===Se)}else{const Se=Xe.current;(!Se||Se.file!==$e[0]||Se.category!==ke)&&(Xe.current={file:$e[0],category:ke,batch:"",id:Sg([$e[0]],ke,"").items[0].id});const z=await we($e[0],ke,"",Xe.current.id);ne()&&Rt(z)}await Wn().catch(()=>{})}catch(Se){ne()&&ce(Se.message)}finally{ne()&&F(!1)}}async function Ec(H=kt){if(!oe||Ae||H.trim().length<3)return;const K=ot.current.capture(),V=oe.id;tn(!0),ce(""),ga("");try{const ne=await Et("/api/assistant",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({inspection_id:V,question:H})});K()&&Ue(we=>[...we,{role:"user",question:H},{role:"assistant",...ne}])}catch(ne){K()&&(ce(ne.message),ga(H))}finally{K()&&tn(!1)}}async function zr(H=!1){try{const K=new URLSearchParams(H?{}:Object.fromEntries(Object.entries(de).filter(([,Se])=>Se))),V=await Wy("/api/export.csv"+(K.size?"?"+K:""));if(!V.ok)throw new Error("Export could not be downloaded. Refresh the workspace and try again.");const ne=await V.blob(),we=document.createElement("a");we.href=URL.createObjectURL(ne),we.download=H?"defectrag-all.csv":"defectrag-filtered.csv",we.click(),setTimeout(()=>URL.revokeObjectURL(we.href),1e3)}catch(K){ce(K.message)}}const Ft=sc(D,ka)&&["overview","inspect","batch","team"].includes(i),Ei=It.state==="synced"?"Updated "+new Date(It.at).toLocaleTimeString([],{hour:"numeric",minute:"2-digit"}):It.state==="offline"?"Offline · shown results may be out of date":It.state==="stale"?"Update failed · shown results may be out of date":It.state==="blocked"?"Open Staff workspace to finish the account check":"Updating saved work…",_i={cases:["TEAM OPERATIONS","Corrective actions","Fix confirmed defects. See who is fixing each one, and by when."],gallery:["PUBLIC DEMO","Community gallery","Inspections that visitors chose to make public."],benchmark:["OFFICIAL BENCHMARK","Official benchmark","Saved test results that compare two models. These are not new inspections."],team:["CONNECTED QUALITY","Staff workspace",Va?"Review shared inspections with your team.":"Sign in to review shared inspections."],recovery:sc(D,ka)?["DEMO RECOVERY","Recover demo inspections","Restore this browser’s archived demo results. They are separate from account and Team history."]:D!=null&&D.personal_workspace_enabled&&ht==="personal"?["PERSONAL RECOVERY","Recover private inspections","Bring archived inspections, conversations and review alerts back into this account’s history."]:["DEVELOPER WORKSPACE","Archived inspections","Bring archived inspections and their saved details back into the current history."],overview:["INSPECTION WORKSPACE","Overview","Check a photo. Review unusual results. Fix real defects."],inspect:["VISUAL INSPECTION","Image inspection","Pick the product, add a photo, check the result."],batch:["OPERATIONS","Batch inspection","Check many photos at once."],history:["INSPECTION LOG","Inspection history","Find past photos and results."],alerts:["REVIEW QUEUE","Review alerts","Unusual results that need a person to look."],performance:["MODEL RESULTS","Model performance","How accurate the checks are, product by product."],about:["HELP & GUIDANCE","Help & references","How to inspect, save, share and review."]}[i]||["","",""];return r.createElement("div",{className:"app"},r.createElement("aside",{className:"sidebar"},r.createElement("a",{className:"brand",href:"#overview",onClick:()=>at("overview")},r.createElement("span",{className:"brand-mark"},r.createElement("img",{src:"./logo.svg",alt:""})),r.createElement("div",null,"DefectRAG",r.createElement("span",null,"INSPECTION INTELLIGENCE"))),r.createElement("button",{type:"button",className:"menu-toggle","aria-expanded":Da,"aria-controls":"app-nav",onClick:()=>wn(H=>!H)},Da?r.createElement(mi,{size:20}):r.createElement(A_,{size:20}),r.createElement("span",null,Da?"Close":"Menu"),!Da&&Fn>0&&r.createElement("span",{className:"nav-count","aria-label":Fn+" alerts not seen"},Fn)),!L&&r.createElement("button",{className:"sidebar-new",disabled:X||Ae||ut,title:X||Ae||ut?"Finish the current inspection or answer before starting another.":void 0,onClick:()=>{X||Ae||ut||(D!=null&&D.personal_workspace_enabled&&En("personal"),ra(),Ut([]),at("inspect"))}},r.createElement(M_,{size:16})," ","New inspection"),r.createElement("nav",{id:"app-nav","aria-label":"Workspace pages",className:Da?"open":void 0},vS.map(([H,K])=>{const V=Xf.filter(ne=>K.includes(ne[0]));return V.length?r.createElement("div",{className:"nav-group",key:H||"main"},H&&r.createElement("h6",null,H),V.map(([ne,we,Se])=>r.createElement("button",{key:ne,className:i===ne?"active":"","aria-current":i===ne?"page":void 0,onClick:()=>at(ne)},r.createElement(Se,{size:16}),we,ne==="alerts"&&U.some(z=>!z.acknowledged)&&r.createElement("span",{className:"nav-count"},U.filter(z=>!z.acknowledged).length)))):null})),r.createElement("div",{className:"sidebar-bottom"},r.createElement("div",{className:"local-card"},r.createElement("span",{className:"status-dot "+(!D||["offline","stale"].includes(It.state)?"offline":"")}),r.createElement("strong",null,L?"Practice workspace":D?It.state==="offline"?"Workspace offline":It.state==="stale"?"Updates need attention":"Workspace online":"Connecting to workspace"),r.createElement("p",null,L?"Temporary lesson only":Va?D!=null&&D.personal_workspace_enabled?["team","cases"].includes(i)||ht==="team"?"Team · shared with approved Staff":"Personal · private to this account":"Team · shared with approved Staff":(D==null?void 0:D.mode)==="cloud_session_workspace"?"Temporary demo session":"Saved on this computer",r.createElement("br",null),"Product photo checks")),r.createElement("div",{className:"sidebar-foot"},r.createElement(Ps,{size:15})," Check the result before deciding."))),r.createElement("main",null,r.createElement("div",{className:"topbar"},r.createElement("span",{className:"topbar-title"},(Cn=Xf.find(H=>H[0]===i))==null?void 0:Cn[1]),r.createElement("div",null,!L&&(ql.signedIn?r.createElement("span",{className:"who",role:"status",title:ql.email},r.createElement(qg,{size:18}),r.createElement("span",null,"Signed in as ",r.createElement("strong",null,ql.name),ql.role&&r.createElement("em",null,ql.role))):r.createElement("button",{type:"button",className:"who who-out",onClick:()=>at("team")},r.createElement(qg,{size:18}),r.createElement("span",null,"Not signed in"),r.createElement("u",null,"Sign in"))),r.createElement("div",{className:"text-size",role:"group","aria-label":"Text size"},r.createElement("button",{type:"button","aria-label":"Smaller text",title:"Smaller text",disabled:d===dc[0],onClick:()=>m(Vg(d,-1))},"A",r.createElement("small",null,"−")),r.createElement("button",{type:"button","aria-label":"Larger text",title:"Larger text · now "+Math.round(d*100)+"%",disabled:d===dc.at(-1),onClick:()=>m(Vg(d,1))},"A",r.createElement("small",null,"+"))),r.createElement("button",{type:"button",className:"theme-toggle","aria-label":u==="dark"?"Switch to light mode":"Switch to dark mode",title:u==="dark"?"Light mode":"Dark mode",onClick:()=>o(H=>H==="dark"?"light":"dark")},u==="dark"?r.createElement(V_,{size:16}):r.createElement(k_,{size:16})))),r.createElement("div",{className:"content",key:i+(L?":practice":"")},!L&&r.createElement(nS,{errors:$n,block:Xa,refreshing:It.state==="refreshing",onRetry:Bl,onAccount:()=>at("team"),onPersonal:Kn,showAccess:["overview","inspect","batch","history","alerts","recovery"].includes(i)}),r.createElement("header",{className:"page-heading"},r.createElement("div",null,r.createElement("p",{className:"eyebrow"},_i[0]),r.createElement("h1",null,_i[1]),r.createElement("p",null,_i[2])),r.createElement("div",{className:"button-row"},i==="overview"&&!L&&r.createElement("button",{className:"secondary",disabled:X||Ae||ut,title:X||Ae||ut?"Finish the current task before starting practice.":void 0,onClick:()=>y(!0)},r.createElement(Nr,{size:17})," Tutorial"))),r.createElement(aw,{resetKey:i,onHome:()=>at("overview"),context:()=>({page:i,mode:L?"practice":D==null?void 0:D.mode,sync:It.state,signedIn:Va,workspace:ht,theme:u,textSize:d})},r.createElement(bS,{render:()=>{var H,K,V,ne,we,Se;return r.createElement(r.Fragment,null,!Ft&&((D==null?void 0:D.mode)==="cloud_session_workspace"||(D==null?void 0:D.local_sync_enabled))&&r.createElement("section",{className:"note",role:"status"},r.createElement("div",null,r.createElement("strong",null,L?"Practice workspace · lesson data only. Nothing is saved, shared or emailed.":["team","cases"].includes(i)?"Team workspace · shared with approved Staff":Va&&!ya?"Account access needs checking · online saving is not confirmed":Va?D.personal_workspace_enabled?ht==="personal"?"Personal workspace · only you can see it":"Team workspace · shared with approved Staff":"Team workspace · shared Staff work":D.local_sync_enabled?"Demo workspace · work stays on this computer":"Demo workspace · temporary results for this browser"),r.createElement("p",null,Ei),Va&&D.personal_workspace_enabled&&!["team","cases"].includes(i)&&r.createElement("label",null,"Show inspections from ",r.createElement("select",{"aria-label":"Inspection data source",value:ht,disabled:X||Ae||ut,onChange:z=>En(z.target.value)},r.createElement("option",{value:"personal"},"Personal Workspace"),r.createElement("option",{value:"team"},"Team Workspace"))),D.personal_workspace_enabled&&ht==="team"&&r.createElement("p",null,"Start new inspections in Personal workspace. Then share them with the team."))),(D==null?void 0:D.local_sync_enabled)&&ht==="personal"&&r.createElement(sS,{key:nn.current||"browser",status:Kt,onRetry:Bl,onResolve:no,onBackup:vi,onListImports:()=>Et("/api/local-sync/importable"),onImport:Ar,canImport:ka.state==="authorized",refreshing:It.state==="refreshing"}),Ft&&r.createElement(oS,{cloud:(D==null?void 0:D.mode)==="cloud_session_workspace",status:Ei+".",onStart:i==="inspect"?void 0:Pn}),ha,rt&&r.createElement("div",{className:"success",role:"status"},r.createElement(Gf,{size:18}),r.createElement("span",null,rt),r.createElement("button",{className:"icon-button","aria-label":"Dismiss notice",onClick:()=>Q("")},r.createElement(mi,{size:16}))),Ce&&r.createElement("div",{role:"alert",className:"error"},r.createElement(Qs,{size:18}),r.createElement("span",null,vn(Ce)),r.createElement("button",{"aria-label":"Dismiss error",onClick:()=>ce("")},r.createElement(mi,{size:17}))),i==="gallery"&&!ha&&r.createElement(hS,{api:Et,staff:!!(ya!=null&&ya.role),local:(D==null?void 0:D.mode)==="local_single_user"}),i==="overview"&&r.createElement(r.Fragment,null,r.createElement("ol",{className:"quick-steps","aria-label":"What to do"},r.createElement("li",null,r.createElement("button",{type:"button",onClick:()=>at("inspect")},r.createElement("b",null,"1"),r.createElement("span",null,r.createElement("strong",null,"Check a photo"),r.createElement("small",null,"Start a new inspection")),r.createElement(oc,{size:18}))),r.createElement("li",null,r.createElement("button",{type:"button",onClick:()=>at("alerts")},r.createElement("b",null,"2"),r.createElement("span",null,r.createElement("strong",null,"Look at unusual results"),r.createElement("small",null,U.filter(z=>!z.acknowledged).length?U.filter(z=>!z.acknowledged).length+" waiting for you":"Nothing waiting")),r.createElement(oc,{size:18}))),r.createElement("li",null,r.createElement("button",{type:"button",onClick:()=>at("cases")},r.createElement("b",null,"3"),r.createElement("span",null,r.createElement("strong",null,"Fix real defects"),r.createElement("small",null,"Assign a person and a deadline")),r.createElement(oc,{size:18})))),r.createElement("div",{className:"stats-grid"},ow(_e,{showcase:ha}).map(z=>r.createElement("section",{className:"stat card",key:z.title},r.createElement("div",{className:"stat-head"},r.createElement("span",null,z.title),z.share&&r.createElement("span",{className:"stat-trend "+z.tone},z.share)),r.createElement("strong",null,z.value.toLocaleString()),r.createElement("div",{className:"stat-foot"},r.createElement("b",null,z.line),r.createElement("small",null,z.detail))))),r.createElement("section",{className:"card chart-card"},r.createElement("div",{className:"section-title"},r.createElement("div",null,r.createElement("h2",null,"Inspections over time"),r.createElement("p",null,"Results saved per day in this workspace")),r.createElement("div",{className:"segmented",role:"group","aria-label":"Chart period"},[[7,"7 days"],[30,"30 days"],[90,"3 months"]].map(([z,P])=>r.createElement("button",{type:"button",key:z,className:p===z?"on":"","aria-pressed":p===z,onClick:()=>v(z)},P)))),r.createElement(ew,{series:uw(Ve,p)})),r.createElement("section",{className:"card"},r.createElement("div",{className:"tabs-row"},r.createElement("div",{className:"tab-list",role:"tablist","aria-label":"Recent inspections"},Yf.map(([z,P,Be])=>r.createElement("button",{type:"button",role:"tab",key:z,"aria-selected":_===z,className:_===z?"on":"",onClick:()=>O(z)},P,z!=="recent"&&r.createElement("span",{className:"count"},Ve.filter(Be).length)))),r.createElement("button",{className:"text-button",onClick:()=>at("history")},"View history ",r.createElement(oc,{size:15}))),r.createElement(Js,{onOpen:yt,hasRecords:Ve.length>0,rows:fw(Ve,_)})),r.createElement("section",null,r.createElement("div",{className:"section-title"},r.createElement("div",null,r.createElement("h2",null,"Explore with a sample"),r.createElement("p",null,"VisA images · Zou et al., ECCV 2022 · CC BY 4.0 · resized previews"))),r.createElement(iy,{samples:Ye,busy:X||Ae||ut,onChoose:Rr}))),(i==="inspect"||i==="batch")&&r.createElement(r.Fragment,null,r.createElement("div",{className:"inspection-grid"},r.createElement("section",{className:"card upload-card","data-tour":i==="batch"?"batch":void 0},r.createElement(r.Fragment,null,r.createElement("div",{className:"section-title"},r.createElement("h2",null,i==="batch"?"Create a batch":"Add a product photo"),r.createElement("span",{className:"subtle-tag"},"01 / INPUT")),r.createElement("label",{className:"field","data-tour":"product"},"Product category",r.createElement("select",{value:ke,onChange:z=>{ra(),ce(""),tt(z.target.value)},disabled:X||Ae||ut},r.createElement("option",{value:""},"Choose the product in the photo"),Object.entries($t).map(([z,P])=>r.createElement("option",{key:z,value:z},P)))),i==="batch"&&r.createElement("label",{className:"field"},"Batch label ",r.createElement("span",null,"required"),r.createElement("input",{placeholder:"e.g. PCB-LINE-01",value:zt,maxLength:80,disabled:X||Ae||ut,onChange:z=>pa(z.target.value)})),r.createElement("label",{className:"drop-zone"},bn?r.createElement("img",{src:bn,alt:"Selected upload preview"}):r.createElement(K_,{size:29}),r.createElement("strong",null,$e.length?`${$e.length} image${$e.length>1?"s":""} selected`:"Choose an image"+(i==="batch"?" group":"")),r.createElement("span",null,"JPEG, PNG or WebP · up to 10 MB each"),r.createElement("input",{"aria-label":"Upload inspection images",type:"file",accept:"image/jpeg,image/png,image/webp",multiple:i==="batch",disabled:X||Ae||ut,onChange:z=>{ra(),ce(""),Ze(null),Jn(null),Ya.current=null,Ut(Array.from(z.target.files||[])),z.target.value=""}})),i==="batch"&&r.createElement("div",{className:"batch-samples"},r.createElement("div",null,r.createElement("strong",null,"No photos to hand?"),r.createElement("span",null,ke?"Add the "+$t[ke]+" sample photos to try a batch.":"Choose a product first to see its sample photos.")),ke&&r.createElement("div",{className:"batch-sample-row"},Ye.filter(z=>z.category===ke).map(z=>r.createElement("img",{key:z.name,src:ev(z),alt:$t[z.category]+" sample photo",loading:"lazy"}))),r.createElement("button",{type:"button",className:"secondary",disabled:X||!Ye.some(z=>z.category===ke),onClick:Or},"Add sample photos")),r.createElement(tS,{multiple:i==="batch",files:!oe&&!X&&!(i==="batch"&&xe)?$e:[]}),r.createElement("p",{className:"caption"},"Use a clear photo of the selected product. Other products or unrelated photos may give unreliable results."),r.createElement("div",{"data-tour":"run"},r.createElement(eS,{readiness:bc(i==="batch"),busy:X,multiple:i==="batch",onRun:()=>bi(i==="batch"),onSwitch:Kn,switchDisabled:X||Ae||ut})),r.createElement("p",{className:"caption"},D!=null&&D.personal_workspace_enabled?Va?"New results save privately in Personal Workspace. Check the save status. Sharing with the team or public gallery is always a separate choice.":D!=null&&D.local_sync_enabled?"Without signing in, results stay on this computer. Copy them into an approved account later if needed.":"Demo results belong to this browser session and may disappear when the online app restarts.":"Photos and results stay on this computer"))),r.createElement("section",{className:"card result-card"},r.createElement("div",{className:"section-title"},r.createElement("h2",{ref:xl,tabIndex:-1},i==="batch"?"Batch run":"Inspection result"),r.createElement("span",{className:"subtle-tag"},"02 / EVIDENCE")),ut?r.createElement("div",{className:"empty",role:"status"},r.createElement(uc,{className:"spin",size:32}),r.createElement("p",null,"Opening the saved photo and result…")):X&&i!=="batch"?r.createElement("div",{className:"empty"},r.createElement(uc,{className:"spin",size:32}),r.createElement("h3",null,"Checking the product photo"),r.createElement("p",null,"The first inspection may take longer while the app gets ready.")):i==="batch"?xe?r.createElement(r.Fragment,null,r.createElement("div",{className:"batch-summary"},r.createElement("h3",null,xe.batch),r.createElement("p",null,xe.records.length," completed · ",xe.errors.length," unfinished")),xe.errors.map((z,P)=>r.createElement("div",{key:P,className:z.status&&z.status!=="failed"?"note":"error"},z.filename,": ",vn(z.message))),r.createElement(Js,{onOpen:yt,hasRecords:Ve.length>0,rows:xe.records,emptyMessage:"No batch images have completed yet."}),na&&r.createElement(r.Fragment,null,r.createElement("p",{className:"caption",role:"status"},X?"Processing one image at a time. Completed images are kept.":"Continue an unfinished batch in the same browser and account. Photos still waiting are kept on this computer; completed photos are not inspected again."," ",na.items.filter(z=>z.status==="running").map(z=>"Inspecting "+z.filename).join("")),na.items.some(z=>z.status!=="completed")&&r.createElement("button",{className:"primary",disabled:X,onClick:()=>bi(!0,!0)},"Continue unfinished photos")),yc&&r.createElement("p",{className:"error",role:"alert"},yc)):r.createElement(hr,null,"Choose a product, label the batch and select up to 20 images."):oe?r.createElement(r.Fragment,null,((V=(K=(H=G==null?void 0:G.categories)==null?void 0:H[oe.category])==null?void 0:K.metrics)==null?void 0:V.image_auroc)<.6&&r.createElement("div",{className:"error"},"Tests showed less reliable results for this product. A Staff member should check the photo before a decision is made."),r.createElement("div",{className:"result-banner"},r.createElement("div",null,r.createElement(Is,{value:oe.verdict}),r.createElement("h2",null,oe.verdict==="Good"?"Looks similar to normal examples":oe.verdict==="Anomalous"?"Unusual appearance found":"A closer review is needed"),r.createElement("p",null,$t[oe.category]," · ",oe.id.slice(0,8)," · ",ta(oe.inference_ms,0)," ms · Model: ",oe.model_id||"Not recorded")),r.createElement("div",{className:"button-row"},r.createElement("div",{"data-tour":"share"},r.createElement(fS,{key:oe.id+ht,record:oe,messages:mt,url:Yn,api:Et,enabled:D==null?void 0:D.personal_workspace_enabled,local:(D==null?void 0:D.mode)==="local_single_user",access:ka,onNotice:Q,onChanged:()=>yt(oe)})),r.createElement("a",{className:"secondary",href:Yn(oe.report_url||`/api/inspections/${oe.id}/report`),target:"_blank",rel:"noreferrer"},r.createElement(E_,{size:16})," Report"))),r.createElement("div",{className:"image-toolbar"},r.createElement("span",null,He?"Highlighted unusual areas":"Uploaded image"),r.createElement("button",{className:"text-button",onClick:()=>za(!He)},He?"Show original":"Show highlights")),r.createElement("div",{"data-tour":"viewer"},r.createElement(pw,{record:oe,url:Yn,heatmap:He,onComparisonUsed:L?()=>te({type:"complete",event:"compare"}):void 0})),r.createElement("div",{className:"score-grid"},r.createElement("div",null,r.createElement("small",null,"Difference score"),r.createElement("strong",null,ta(oe.score,4))),r.createElement("div",null,r.createElement("small",null,"Review limit"),r.createElement("strong",null,ta(oe.threshold,4))),r.createElement("div",null,r.createElement("small",null,"Close-call range"),r.createElement("strong",null,"±",ta(oe.uncertainty_margin,4)))),r.createElement("div",{className:"note"},r.createElement(Qs,{size:16})," A higher score means the photo looks more different from normal examples. It is not a percentage chance of a defect. Highlighted areas need checking; they do not identify the defect or its cause."),r.createElement(Ew,{record:oe})):r.createElement(hr,null,"The result and highlighted photo will appear here after the inspection."))),i==="inspect"&&oe&&!ha&&r.createElement("section",{className:"card"},r.createElement(uS,{key:oe.id+String(Ml==null?void 0:Ml.created_at),demo:sc(D,ka),current:Ml,onSave:async z=>{const P=ot.current.capture(),Be=await Et("/api/inspections/"+oe.id+"/review",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(z)});P()&&(Ul(Be),Q(sc(D,ka)?"Demo review saved in this browser session. No Team review or product approval was created.":"Staff review saved. The original inspection result has not changed.")),fi(),Wn().catch(()=>{})}})),i==="inspect"&&oe&&r.createElement("section",{className:"card assistant","data-tour":"assistant"},r.createElement("div",{className:"section-title"},r.createElement("div",null,r.createElement("h2",null,r.createElement(R_,{size:19})," Evidence Assistant"),r.createElement("p",null,"Linked to inspection ",oe.id.slice(0,8)," · explains the saved result using reference information")),r.createElement("span",{className:"subtle-tag"},"RESULT HELP")),r.createElement("div",{className:"observation"},r.createElement("strong",null,"SAVED RESULT"),r.createElement("span",null,Er(oe.verdict)," · score ",ta(oe.score,4)," · review limit ",ta(oe.threshold,4)," · ",$t[oe.category])),r.createElement("div",{className:"suggestions"},[oe.verdict==="Good"?"Is this image normal?":"Is this image anomalous?","Does the score mean accuracy?","What does the heatmap show?","Explain this result and its limits."].map(z=>r.createElement("button",{key:z,onClick:()=>Ec(z),disabled:Ae},z,r.createElement(di,{size:14})))),r.createElement("div",{className:"conversation"},mt.map((z,P)=>{var Be,Ke;return z.role==="user"?r.createElement("div",{key:P,className:"user-message"},r.createElement("strong",null,"Inspection question"),r.createElement("p",null,z.question)):r.createElement("div",{key:P,className:"assistant-message"},r.createElement("div",null,r.createElement("strong",null,"Evidence Assistant"),r.createElement("span",{className:"subtle-tag"},zw(z.mode,ha))),r.createElement("p",{className:"answer-text"},z.answer),z.error&&r.createElement("p",{className:"caption"},vn(z.error)),((Be=z.evidence)==null?void 0:Be.length)>0&&r.createElement("details",null,r.createElement("summary",null,z.evidence.length," supporting references"),z.evidence.map(lt=>r.createElement("article",{className:"source",key:lt.chunk_id},r.createElement("strong",null,lt.chunk_id," · ",lt.title),r.createElement("p",null,lt.text),r.createElement("small",null,lt.scope),lt.url.startsWith("https://")&&r.createElement("a",{href:lt.url,target:"_blank",rel:"noreferrer"},"Open source ",r.createElement(di,{size:12}))))),r.createElement("details",{className:"workflow-details"},r.createElement("summary",null,"What this answer is based on"),r.createElement("p",null,"The answer uses the saved inspection result and, when relevant, the references shown above. Some questions can be answered from the saved result alone."),r.createElement("details",null,r.createElement("summary",null,"Technical processing details"),r.createElement("small",{className:"trace"},(Ke=z.trace)==null?void 0:Ke.join(" → ")))))})),Ae&&r.createElement("p",{role:"status",className:"generating"},r.createElement(uc,{size:17,className:"spin"})," Finding supporting information and preparing an answer…"),r.createElement("form",{className:"question-form",onSubmit:z=>{z.preventDefault(),Ec()}},r.createElement("input",{"aria-label":"Ask a follow-up question",placeholder:"Ask about this inspection or the supporting evidence…",value:kt,maxLength:1200,onChange:z=>ga(z.target.value),disabled:Ae||ha}),r.createElement("button",{className:"primary",disabled:Ae||kt.trim().length<3},"Ask ",r.createElement(oc,{size:16}))),r.createElement("p",{className:"caption"},ha,"The assistant explains saved results and reference information; it does not look at the photo itself. Check important answers against the original photo and workplace guidance. A reference does not guarantee that every explanation is correct.")),i==="inspect"&&oe&&!ha&&r.createElement("div",{"data-tour":"publish"},r.createElement(mS,{key:oe.id+ht,record:oe,api:Et})),i==="inspect"&&!oe&&r.createElement("section",{"data-tour":"samples"},r.createElement("div",{className:"section-title"},r.createElement("div",null,r.createElement("h2",null,"Or try a sample photo"),r.createElement("p",null,"CC BY 4.0 · resized previews; predictions may differ slightly from original-resolution evaluation"))),r.createElement(iy,{samples:Ye,busy:X||Ae||ut,onChoose:Rr})),i==="batch"&&r.createElement("section",{className:"card"},r.createElement("div",{className:"section-title"},r.createElement("h2",null,"Batch history"),r.createElement("span",{className:"subtle-tag"},_e.batches.filter(z=>z.batch).length," named batches")),r.createElement(cy,{filter:de,setFilter:st,stats:_e,filteredCount:sa.length}),r.createElement(Js,{rows:sa,onOpen:yt,hasRecords:Ve.some(z=>{var P;return(P=z.batch)==null?void 0:P.trim()}),emptyMessage:Ve.some(z=>{var P;return(P=z.batch)==null?void 0:P.trim()})?void 0:"No batch inspections yet. Choose a new batch name and add photos above."}))),i==="history"&&r.createElement("section",{className:"card","data-tour":"history"},r.createElement("div",{className:"section-title"},r.createElement("h2",null,"Saved inspections"),r.createElement("div",{className:"button-row"},r.createElement("button",{className:"secondary danger",onClick:()=>ve(!0)},"Archive history"),r.createElement(r.Fragment,null,r.createElement("button",{className:"secondary",onClick:()=>zr()},r.createElement(g_,{size:15})," Download filtered spreadsheet"),r.createElement("button",{className:"text-button",onClick:()=>zr(!0)},"Download all as spreadsheet")))),r.createElement(cy,{filter:de,setFilter:st,stats:_e,filteredCount:sa.length}),r.createElement(Js,{rows:sa,reviewMode:ht==="team"&&Uf(D,ha),onOpen:ht==="team"&&Uf(D,ha)?hi:yt,hasRecords:Ve.length>0}),r.createElement("p",{className:"caption table-caption"},"Showing the latest 500 inspections. Spreadsheet downloads include up to 10,000 matching inspections.")),i==="alerts"&&r.createElement("section",{className:"card","data-tour":"alerts"},r.createElement("div",{className:"section-title alert-head"},r.createElement("div",null,r.createElement("h2",null,"Inspections needing review"),r.createElement("p",null,"Open each one and check the photo. Then mark it as seen.")),r.createElement("div",{className:"button-row"},r.createElement("span",{className:"count-pill"+(U.some(z=>!z.acknowledged)?" warn":" ok")},U.filter(z=>!z.acknowledged).length," not seen"),U.filter(z=>!z.acknowledged).length>1&&(va.phase==="confirm"?r.createElement(r.Fragment,null,r.createElement("button",{type:"button",className:"primary",onClick:qe},r.createElement(Hg,{size:17})," Yes, mark all ",U.filter(z=>!z.acknowledged).length),r.createElement("button",{type:"button",className:"secondary",onClick:()=>ia({phase:"idle",done:0,total:0})},"Cancel")):r.createElement("button",{type:"button",className:"primary",disabled:va.phase==="working","aria-busy":va.phase==="working",onClick:()=>ia({phase:"confirm",done:0,total:0})},va.phase==="working"?r.createElement(r.Fragment,null,r.createElement(uc,{className:"spin",size:17})," Marking ",va.done," of ",va.total,"…"):r.createElement(r.Fragment,null,r.createElement(Hg,{size:17})," Mark all as seen"))))),U.length?U.map(z=>{var Be;const P=Ve.find(Ke=>Ke.id===z.inspection_id);return r.createElement("div",{className:"alert-row"+(z.acknowledged?" seen":""),key:z.id},P!=null&&P.image_url?r.createElement("img",{className:"alert-thumb",src:Yn(P.image_url),loading:"lazy",decoding:"async",alt:$t[P.category]+" inspection photo"}):r.createElement(My,{size:19}),r.createElement("div",null,r.createElement("strong",null,P?$t[P.category]+" · ":"",z.kind==="Anomalous"?"Unusual appearance found":"Result needs a closer look"),r.createElement("p",null,(Be=P==null?void 0:P.batch)!=null&&Be.trim()?"Batch "+P.batch+" · ":"",z.inspection_id.slice(0,8)," · ",Qf(z.created_at))),r.createElement(Is,{value:z.kind}),r.createElement("button",{className:"secondary",disabled:!!z.acknowledged||ca["ack:"+z.id]||va.phase==="working","aria-busy":!!ca["ack:"+z.id],onClick:()=>Nt(z.id)},z.acknowledged?r.createElement(r.Fragment,null,r.createElement(Gf,{size:15})," Seen"):ca["ack:"+z.id]?"Saving…":"Mark as seen"),r.createElement("button",{className:"secondary","aria-label":"Open alerted inspection "+z.inspection_id.slice(0,8),onClick:()=>{P?yt(P):Et("/api/inspections/"+z.inspection_id).then(yt).catch(Ke=>ce(Ke.message))}},"Open ",r.createElement(di,{size:15})))}):r.createElement(hr,null,"No alerts. Unusual results will appear here."),r.createElement("div",{className:"note"},r.createElement(Qs,{size:16})," “Seen” only means someone looked. It does not approve the product.")),i==="benchmark"&&r.createElement(Hw,{report:I,labels:$t,evaluation:G}),["team","cases"].includes(i)&&r.createElement(M.Suspense,{fallback:r.createElement("div",{className:"empty"},r.createElement(uc,{className:"spin",size:28}),"Loading staff workspace…")},r.createElement(yS,{casesView:i==="cases",initialInspectionId:to,onOpenCorrectiveActions:_n,onChooseInspection:pi,onOpenInspection:Uf(D,ha)?Dl:void 0})),i==="recovery"&&r.createElement("section",{className:"card"},r.createElement("div",{className:"section-title"},r.createElement("div",null,r.createElement("h2",null,"Archived inspections"),r.createElement("p",null,"Restore an inspection with its photos, result, conversation and review alerts.")),r.createElement("span",{className:"subtle-tag"},Z.length," archived")),Z.length?r.createElement("div",{className:"table-wrap"},r.createElement("table",{className:"stackable"},r.createElement("thead",null,r.createElement("tr",null,r.createElement("th",null,"Inspection"),r.createElement("th",null,"Product"),r.createElement("th",null,"Result"),r.createElement("th",null,"Saved"),r.createElement("th",null))),r.createElement("tbody",null,Z.map(z=>r.createElement("tr",{key:z.id},r.createElement("td",{"data-label":"Inspection"},z.id.slice(0,8)),r.createElement("td",{"data-label":"Product"},$t[z.category]),r.createElement("td",{"data-label":"Result"},r.createElement(Is,{value:z.verdict})),r.createElement("td",{"data-label":"Saved"},Qf(z.created_at)),r.createElement("td",{className:"row-action"},r.createElement("button",{className:"secondary",disabled:ca["restore:"+z.id],"aria-busy":!!ca["restore:"+z.id],onClick:()=>Cr(z.id)},ca["restore:"+z.id]?"Restoring…":"Restore inspection"))))))):r.createElement(hr,null,"No archived inspections here. Archive history moves inspections out of the active list without deleting their saved files."),r.createElement("p",{className:"caption"},sc(D,ka)?"Only this browser’s demo archive is shown. It may disappear when the online app restarts.":D!=null&&D.personal_workspace_enabled?ht==="personal"?"This account can restore its own Personal inspections.":"Ask a Developer to restore archived Team inspections.":"This page restores work in the selected workspace. Team work can only be restored by a Developer.")),i==="performance"&&r.createElement(r.Fragment,null,r.createElement("section",{className:"card"},r.createElement("h2",null,"Results for the app’s inspection settings"),r.createElement("p",null,"This page shows the app’s operating results: precision, recall, F1 and other measurements at its saved review limits. Official benchmark uses a separate benchmark test, so its figures may differ."),r.createElement("p",null,"Results vary by product. Some unusual photos are missed, and some normal photos are flagged. Use the inspection as a screening aid and follow workplace quality rules before deciding."),r.createElement("p",null,"Precision means how often a flag was correct. Recall means how many unusual photos were found. Higher recall can also mean more false alarms. These are results from test photos, not a guarantee for the next inspection.")),r.createElement("div",{className:"note standalone"},r.createElement(Ps,{size:20}),r.createElement("div",null,r.createElement("strong",null,"Active model · evaluation protocol"),r.createElement("p",null,(G==null?void 0:G.protocol)||"Evaluation results are not available."))),r.createElement("section",{className:"card"},r.createElement("div",{className:"section-title"},r.createElement("div",null,r.createElement("h2",null,"Retrospective image performance"),r.createElement("p",null,"Binary metrics use the versioned decision threshold. The dashboard also applies a ±5% review band. Precision measures correct anomaly flags; recall measures anomaly coverage. High precision with low recall means many annotated anomalies are missed. AUROC measures ranking across thresholds, not recall at this operating point."),(G==null?void 0:G.decision_policy)&&r.createElement("p",{className:"caption"},"Sensitivity policy: ",G.decision_policy==="macaroni-recall-v1"?"Macaroni 1/2 normal 80th percentile; other products normal 95th percentile.":"Held-out normal 95th percentile."," Mean recall ",Ks((ne=G.macro_mean)==null?void 0:ne.recall)," · precision ",Ks((we=G.macro_mean)==null?void 0:we.precision)," · normal false-alarm rate ",Ks((Se=G.macro_mean)==null?void 0:Se.false_positive_rate),". More anomalies are caught with more review alerts. Historical inspections retain their original thresholds; future rates may differ. ",G.decision_policy==="macaroni-recall-v1"&&"Macaroni 1/2 falsely flag 24%/28% of normal benchmark images; review workload is substantially higher.")),r.createElement("span",{className:"subtle-tag"},"REAL PREDICTIONS")),r.createElement("div",{className:"table-wrap"},r.createElement("table",null,r.createElement("thead",null,r.createElement("tr",null,r.createElement("th",null,"Product"),r.createElement("th",null,"Images"),r.createElement("th",null,"AUROC"),r.createElement("th",null,"Avg. precision"),r.createElement("th",null,"Precision"),r.createElement("th",null,"Recall"),r.createElement("th",null,"F1"))),r.createElement("tbody",null,Object.entries((G==null?void 0:G.categories)||{}).map(([z,P])=>{var Be;return r.createElement("tr",{key:z},r.createElement("td",null,r.createElement("strong",null,$t[z])),r.createElement("td",null,((Be=P.metrics)==null?void 0:Be.n_images)??"—"),["image_auroc","average_precision","precision","recall","f1"].map(Ke=>{var lt;return r.createElement("td",{key:Ke},ta((lt=P.metrics)==null?void 0:lt[Ke]))}))}))))),r.createElement("div",{className:"performance-grid"},Object.entries((G==null?void 0:G.categories)||{}).map(([z,P])=>{var Be,Ke,lt,ba,tl,Qa,An,_c,Si,wc,al,Ma,Ni,nl,Za,Ti,Ll,Sc,jl,Gl,Nc,Ht,Ka;return r.createElement("section",{className:"card",key:z},r.createElement("div",{className:"section-title"},r.createElement("h2",null,$t[z]),r.createElement("span",{className:"subtle-tag"},P.train_normal_count," NORMAL FIT")),r.createElement("p",{className:"muted"},"Confusion matrix · true rows / predicted columns"),r.createElement("div",{className:"matrix"},r.createElement("span",null),r.createElement("small",null,"Good"),r.createElement("small",null,"Anomalous"),r.createElement("small",null,"Good"),(((Ke=(Be=P.metrics)==null?void 0:Be.confusion_matrix)==null?void 0:Ke[0])||["—","—"]).map((Ja,Ea)=>r.createElement("b",{key:Ea,className:Ea===0?"correct":""},Ja)),r.createElement("small",null,"Anomalous"),(((ba=(lt=P.metrics)==null?void 0:lt.confusion_matrix)==null?void 0:ba[1])||["—","—"]).map((Ja,Ea)=>r.createElement("b",{key:Ea,className:Ea===1?"correct":""},Ja))),r.createElement("dl",null,[["Decision threshold",ta(P.threshold,4)],[P.profile?"Pixel AUROC · 224 × 224":"Pixel AUROC · 64 × 64",ta(((tl=P.metrics)==null?void 0:tl.pixel_auroc_224)??((Qa=P.metrics)==null?void 0:Qa.pixel_auroc_64))],["Pixel average precision",ta(((An=P.metrics)==null?void 0:An.pixel_average_precision_224)??((_c=P.metrics)==null?void 0:_c.pixel_average_precision_64))],["Close-call range coverage",Ks((Si=P.metrics)==null?void 0:Si.uncertain_fraction)],["Median model inference",((wc=P.metrics)==null?void 0:wc.latency_median_ms)==null&&!((Ma=(al=G==null?void 0:G.serving_profile)==null?void 0:al.categories)!=null&&Ma[z])?"Not profiled":ta(((Za=(nl=(Ni=G==null?void 0:G.serving_profile)==null?void 0:Ni.categories)==null?void 0:nl[z])==null?void 0:Za.core_median_ms)??((Ti=P.metrics)==null?void 0:Ti.latency_median_ms),0)+" ms"],["Peak PyTorch GPU allocation",((Ll=P.metrics)==null?void 0:Ll.peak_gpu_mb)==null&&!((jl=(Sc=G==null?void 0:G.serving_profile)==null?void 0:Sc.categories)!=null&&jl[z])?"Not profiled":ta(((Ht=(Nc=(Gl=G==null?void 0:G.serving_profile)==null?void 0:Gl.categories)==null?void 0:Nc[z])==null?void 0:Ht.peak_torch_allocated_gpu_mb)??((Ka=P.metrics)==null?void 0:Ka.peak_gpu_mb),1)+" MB"],["Normal bank size",typeof P.bank_size_bytes=="number"?(P.bank_size_bytes/1024**2).toFixed(1)+" MB":"—"]].map(([Ja,Ea])=>r.createElement("div",{key:Ja},r.createElement("dt",null,Ja),r.createElement("dd",null,Ea)))))})),r.createElement("div",{className:"note"},r.createElement(Qs,{size:17}),r.createElement("p",null,"Frozen nearest-normal memory, not Dinomaly. Performance varies by category; inspect image and pixel metrics separately. No supervised defect-type classifier or factory acceptance claim. Core latency excludes image decoding and heatmap rendering. Historical clean serving measurements apply only to their original model profile. GPU allocation excludes other processes and driver memory."))),i==="about"&&r.createElement(ww,{health:D,showcase:ha,context:{page:i,mode:D==null?void 0:D.mode,sync:It.state,signedIn:Va,workspace:ht,theme:u,textSize:d}}),r.createElement(kw,{scope:(D==null?void 0:D.mode)==="cloud_session_workspace"?Va?D.personal_workspace_enabled?ht:"team":"guest":"local",open:$,onClose:()=>ve(!1),busy:Ge,onConfirm:async()=>{dt(!0);try{const z=await Et("/api/history/archive",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...de,confirmation:"ARCHIVE"})});ve(!1),Q(`${z.archived} ${z.archived===1?"inspection":"inspections"} archived. Restore them in History recovery.`),fi(),Wn().catch(()=>{})}catch(z){ce(z.message)}finally{dt(!1)}}}))}})),r.createElement("footer",null,"DefectRAG ",r.createElement("span",null,"Inspection & evidence workspace"),r.createElement("span",null,"Screening aid · Staff review before product decisions"),r.createElement("span",{className:"build-tag",title:"Build "+Oa.commit+(Oa.built?" · "+Oa.built:"")},"v",Oa.version," · ",Oa.commit)))),r.createElement(Sw,{open:g&&!x.started,onDismiss:le,onStart:je}),L&&r.createElement(Ow,{state:x,page:i,onGo:at,onSkip:le,onFinish:le,onBack:()=>te({type:"back"})}))}Y1.createRoot(document.getElementById("root")).render(r.createElement(ES,null));export{kS as A,eo as B,Zw as C,$1 as D,Er as E,uS as F,Wf as G,hc as H,N1 as I,uc as L,Lf as R,Ps as S,CS as a,SS as b,Oe as c,TS as d,wS as e,mc as f,DS as g,r as h,vn as i,zS as j,RS as k,o1 as l,NS as m,s1 as n,AS as o,OS as p,id as q,M as r,zy as s,Yw as t,$y as u,Vw as v,fi as w,Qw as x,Xw as y,jw as z}; diff --git a/frontend/dist/index.html b/frontend/dist/index.html index f24b51aa7959c0a4c4627701b9028814549d0891..a2ab7ac4c0c1045b1252789262730c5d931b0c06 100644 --- a/frontend/dist/index.html +++ b/frontend/dist/index.html @@ -1,3 +1,3 @@ -DefectRAG · Inspection intelligence - +DefectRAG · Inspection intelligence +
diff --git a/frontend/dist/showcase/data.json b/frontend/dist/showcase/data.json index ca65e6a5e27ddf927d045b90868bba2e55c97c20..6fcbcfbd233a370e16596ee431f8cbab2f4191d9 100644 --- a/frontend/dist/showcase/data.json +++ b/frontend/dist/showcase/data.json @@ -1,3001 +1,3566 @@ -{ - "schema": 1, - "mode": "saved_examples", - "records": [ - { - "id": "18c7586f94de4b6d8ef773779f7cea2f", - "created_at": "2026-10-16T01:54:06.141819+00:00", - "category": "pcb1", - "verdict": "Good", - "score": 0.029462307691574097, - "threshold": 0.047802507877349854, - "uncertainty_margin": 0.0023901253938674928, - "inference_ms": 626.97, - "model_id": "dinov3-normal-bank-pcb1-v1", - "batch": "Verified VisA examples", - "filename": "VisA example", - "image_url": "showcase/images/18c7586f94de4b6d8ef773779f7cea2f.jpg", - "heatmap_url": "showcase/images/18c7586f94de4b6d8ef773779f7cea2f_heatmap.jpg" - }, - { - "id": "52ee2c6d54934fcfaffb0f273c70dc87", - "created_at": "2026-10-16T01:54:06.454213+00:00", - "category": "pcb1", - "verdict": "Anomalous", - "score": 0.09511521458625793, - "threshold": 0.047802507877349854, - "uncertainty_margin": 0.0023901253938674928, - "inference_ms": 79.49, - "model_id": "dinov3-normal-bank-pcb1-v1", - "batch": "Verified VisA examples", - "filename": "VisA example", - "image_url": "showcase/images/52ee2c6d54934fcfaffb0f273c70dc87.jpg", - "heatmap_url": "showcase/images/52ee2c6d54934fcfaffb0f273c70dc87_heatmap.jpg" - }, - { - "id": "e701c08ef3264b20bcb11149f734b219", - "created_at": "2026-10-16T01:54:06.826573+00:00", - "category": "capsules", - "verdict": "Uncertain", - "score": 0.04526650905609131, - "threshold": 0.04728597402572632, - "uncertainty_margin": 0.0023642987012863163, - "inference_ms": 47.72, - "model_id": "dinov3-normal-bank-capsules-v1", - "batch": "Verified VisA examples", - "filename": "VisA example", - "image_url": "showcase/images/e701c08ef3264b20bcb11149f734b219.jpg", - "heatmap_url": "showcase/images/e701c08ef3264b20bcb11149f734b219_heatmap.jpg" - }, - { - "id": "e3964b50d4cf4860a1f7a926d1ae444a", - "created_at": "2026-10-16T01:54:07.099544+00:00", - "category": "capsules", - "verdict": "Anomalous", - "score": 0.06019875407218933, - "threshold": 0.04728597402572632, - "uncertainty_margin": 0.0023642987012863163, - "inference_ms": 53.84, - "model_id": "dinov3-normal-bank-capsules-v1", - "batch": "Verified VisA examples", - "filename": "VisA example", - "image_url": "showcase/images/e3964b50d4cf4860a1f7a926d1ae444a.jpg", - "heatmap_url": "showcase/images/e3964b50d4cf4860a1f7a926d1ae444a_heatmap.jpg" - }, - { - "id": "b5d1bd5c7ed1493ab8f4a849eeeb7712", - "created_at": "2026-10-16T01:54:07.485318+00:00", - "category": "cashew", - "verdict": "Good", - "score": 0.030725598335266113, - "threshold": 0.051523059606552124, - "uncertainty_margin": 0.0025761529803276064, - "inference_ms": 53.57, - "model_id": "dinov3-normal-bank-cashew-v1", - "batch": "Verified VisA examples", - "filename": "VisA example", - "image_url": "showcase/images/b5d1bd5c7ed1493ab8f4a849eeeb7712.jpg", - "heatmap_url": "showcase/images/b5d1bd5c7ed1493ab8f4a849eeeb7712_heatmap.jpg" - }, - { - "id": "3243fbe65d59477b9811da0f306535aa", - "created_at": "2026-10-16T01:54:07.777072+00:00", - "category": "cashew", - "verdict": "Anomalous", - "score": 0.07818332314491272, - "threshold": 0.051523059606552124, - "uncertainty_margin": 0.0025761529803276064, - "inference_ms": 51.4, - "model_id": "dinov3-normal-bank-cashew-v1", - "batch": "Verified VisA examples", - "filename": "VisA example", - "image_url": "showcase/images/3243fbe65d59477b9811da0f306535aa.jpg", - "heatmap_url": "showcase/images/3243fbe65d59477b9811da0f306535aa_heatmap.jpg" - }, - { - "id": "a6226ef392eb417e8991369e890d816b", - "created_at": "2026-10-16T03:37:21.911121+00:00", - "category": "pcb1", - "verdict": "Anomalous", - "score": 0.09611436724662781, - "threshold": 0.047802507877349854, - "uncertainty_margin": 0.0023901253938674928, - "inference_ms": 38.44, - "model_id": "dinov3-normal-bank-pcb1-v1", - "batch": "Verified VisA examples", - "filename": "VisA example", - "image_url": "showcase/images/a6226ef392eb417e8991369e890d816b.jpg", - "heatmap_url": "showcase/images/a6226ef392eb417e8991369e890d816b_heatmap.jpg" - }, - { - "id": "14418c36d94648adbdbc2779a6a33b3c", - "created_at": "2026-10-16T05:04:08.792238+00:00", - "category": "candle", - "verdict": "Good", - "score": 0.022238105535507202, - "threshold": 0.04235455393791199, - "uncertainty_margin": 0.0021177276968955996, - "inference_ms": 373.68, - "model_id": "dinov3-normal-bank-candle-v1", - "batch": "Verified VisA examples", - "filename": "VisA example", - "image_url": "showcase/images/14418c36d94648adbdbc2779a6a33b3c.jpg", - "heatmap_url": "showcase/images/14418c36d94648adbdbc2779a6a33b3c_heatmap.jpg" - }, - { - "id": "7dbb6f27253b450698a1a503cfa9a8c8", - "created_at": "2026-10-16T05:04:09.045272+00:00", - "category": "candle", - "verdict": "Anomalous", - "score": 0.046729326248168945, - "threshold": 0.04235455393791199, - "uncertainty_margin": 0.0021177276968955996, - "inference_ms": 34.73, - "model_id": "dinov3-normal-bank-candle-v1", - "batch": "Verified VisA examples", - "filename": "VisA example", - "image_url": "showcase/images/7dbb6f27253b450698a1a503cfa9a8c8.jpg", - "heatmap_url": "showcase/images/7dbb6f27253b450698a1a503cfa9a8c8_heatmap.jpg" - }, - { - "id": "6082416ed1c34be6a4fccd7e406f4a34", - "created_at": "2026-10-16T05:04:09.292761+00:00", - "category": "chewinggum", - "verdict": "Good", - "score": 0.03845283389091492, - "threshold": 0.06446045637130737, - "uncertainty_margin": 0.003223022818565369, - "inference_ms": 37.45, - "model_id": "dinov3-normal-bank-chewinggum-v1", - "batch": "Verified VisA examples", - "filename": "VisA example", - "image_url": "showcase/images/6082416ed1c34be6a4fccd7e406f4a34.jpg", - "heatmap_url": "showcase/images/6082416ed1c34be6a4fccd7e406f4a34_heatmap.jpg" - }, - { - "id": "dcc3e255b90f466c9087d7e09af1a661", - "created_at": "2026-10-16T05:04:09.469926+00:00", - "category": "chewinggum", - "verdict": "Anomalous", - "score": 0.09018924832344055, - "threshold": 0.06446045637130737, - "uncertainty_margin": 0.003223022818565369, - "inference_ms": 29.3, - "model_id": "dinov3-normal-bank-chewinggum-v1", - "batch": "Verified VisA examples", - "filename": "VisA example", - "image_url": "showcase/images/dcc3e255b90f466c9087d7e09af1a661.jpg", - "heatmap_url": "showcase/images/dcc3e255b90f466c9087d7e09af1a661_heatmap.jpg" - }, - { - "id": "d9023f03ff7945d8928216e8df02a620", - "created_at": "2026-10-16T05:04:09.704431+00:00", - "category": "fryum", - "verdict": "Good", - "score": 0.02073901891708374, - "threshold": 0.031331419944763184, - "uncertainty_margin": 0.0015665709972381592, - "inference_ms": 31.32, - "model_id": "dinov3-normal-bank-fryum-v1", - "batch": "Verified VisA examples", - "filename": "VisA example", - "image_url": "showcase/images/d9023f03ff7945d8928216e8df02a620.jpg", - "heatmap_url": "showcase/images/d9023f03ff7945d8928216e8df02a620_heatmap.jpg" - }, - { - "id": "118f64eaadfe43ce8b27b955a82c37ba", - "created_at": "2026-10-16T05:04:09.853046+00:00", - "category": "fryum", - "verdict": "Uncertain", - "score": 0.03211769461631775, - "threshold": 0.031331419944763184, - "uncertainty_margin": 0.0015665709972381592, - "inference_ms": 29.33, - "model_id": "dinov3-normal-bank-fryum-v1", - "batch": "Verified VisA examples", - "filename": "VisA example", - "image_url": "showcase/images/118f64eaadfe43ce8b27b955a82c37ba.jpg", - "heatmap_url": "showcase/images/118f64eaadfe43ce8b27b955a82c37ba_heatmap.jpg" - }, - { - "id": "e335298e27e843c38d81accf54fdb399", - "created_at": "2026-10-16T05:04:10.096196+00:00", - "category": "macaroni1", - "verdict": "Anomalous", - "score": 0.0720357894897461, - "threshold": 0.04998299479484558, - "uncertainty_margin": 0.002499149739742279, - "inference_ms": 29.82, - "model_id": "dinov3-normal-bank-macaroni1-v1", - "batch": "Verified VisA examples", - "filename": "VisA example", - "image_url": "showcase/images/e335298e27e843c38d81accf54fdb399.jpg", - "heatmap_url": "showcase/images/e335298e27e843c38d81accf54fdb399_heatmap.jpg" - }, - { - "id": "1a5f9735b7dd44f18995b62e871ee3b7", - "created_at": "2026-10-16T05:04:10.240752+00:00", - "category": "macaroni1", - "verdict": "Good", - "score": 0.04587012529373169, - "threshold": 0.04998299479484558, - "uncertainty_margin": 0.002499149739742279, - "inference_ms": 29.49, - "model_id": "dinov3-normal-bank-macaroni1-v1", - "batch": "Verified VisA examples", - "filename": "VisA example", - "image_url": "showcase/images/1a5f9735b7dd44f18995b62e871ee3b7.jpg", - "heatmap_url": "showcase/images/1a5f9735b7dd44f18995b62e871ee3b7_heatmap.jpg" - }, - { - "id": "d03553a7af274bba808fe090d4a7912b", - "created_at": "2026-10-16T05:04:10.476998+00:00", - "category": "macaroni2", - "verdict": "Anomalous", - "score": 0.07178214192390442, - "threshold": 0.056429386138916016, - "uncertainty_margin": 0.002821469306945801, - "inference_ms": 28.18, - "model_id": "dinov3-normal-bank-macaroni2-v1", - "batch": "Verified VisA examples", - "filename": "VisA example", - "image_url": "showcase/images/d03553a7af274bba808fe090d4a7912b.jpg", - "heatmap_url": "showcase/images/d03553a7af274bba808fe090d4a7912b_heatmap.jpg" - }, - { - "id": "232cbf03a23f4eb2a3793fa1628e5f9c", - "created_at": "2026-10-16T05:04:10.617141+00:00", - "category": "macaroni2", - "verdict": "Uncertain", - "score": 0.055811017751693726, - "threshold": 0.056429386138916016, - "uncertainty_margin": 0.002821469306945801, - "inference_ms": 28.8, - "model_id": "dinov3-normal-bank-macaroni2-v1", - "batch": "Verified VisA examples", - "filename": "VisA example", - "image_url": "showcase/images/232cbf03a23f4eb2a3793fa1628e5f9c.jpg", - "heatmap_url": "showcase/images/232cbf03a23f4eb2a3793fa1628e5f9c_heatmap.jpg" - }, - { - "id": "99d47a61108f4581b59c6fac6bfc224f", - "created_at": "2026-10-16T05:04:10.847182+00:00", - "category": "pcb2", - "verdict": "Anomalous", - "score": 0.0873120129108429, - "threshold": 0.03412127494812012, - "uncertainty_margin": 0.0017060637474060059, - "inference_ms": 28.92, - "model_id": "dinov3-normal-bank-pcb2-v1", - "batch": "Verified VisA examples", - "filename": "VisA example", - "image_url": "showcase/images/99d47a61108f4581b59c6fac6bfc224f.jpg", - "heatmap_url": "showcase/images/99d47a61108f4581b59c6fac6bfc224f_heatmap.jpg" - }, - { - "id": "c6222fddf36d4c788ae4e96994b3e02b", - "created_at": "2026-10-16T05:04:11.008753+00:00", - "category": "pcb2", - "verdict": "Anomalous", - "score": 0.04729834198951721, - "threshold": 0.03412127494812012, - "uncertainty_margin": 0.0017060637474060059, - "inference_ms": 33.07, - "model_id": "dinov3-normal-bank-pcb2-v1", - "batch": "Verified VisA examples", - "filename": "VisA example", - "image_url": "showcase/images/c6222fddf36d4c788ae4e96994b3e02b.jpg", - "heatmap_url": "showcase/images/c6222fddf36d4c788ae4e96994b3e02b_heatmap.jpg" - }, - { - "id": "2cb0f86c14d344019b28f77f4628257f", - "created_at": "2026-10-16T05:04:11.261839+00:00", - "category": "pcb3", - "verdict": "Anomalous", - "score": 0.052754610776901245, - "threshold": 0.04104718565940857, - "uncertainty_margin": 0.0020523592829704285, - "inference_ms": 27.26, - "model_id": "dinov3-normal-bank-pcb3-v1", - "batch": "Verified VisA examples", - "filename": "VisA example", - "image_url": "showcase/images/2cb0f86c14d344019b28f77f4628257f.jpg", - "heatmap_url": "showcase/images/2cb0f86c14d344019b28f77f4628257f_heatmap.jpg" - }, - { - "id": "b43a98329ac646ef90f19861345d0884", - "created_at": "2026-10-16T05:04:11.412727+00:00", - "category": "pcb3", - "verdict": "Uncertain", - "score": 0.04286506772041321, - "threshold": 0.04104718565940857, - "uncertainty_margin": 0.0020523592829704285, - "inference_ms": 31.02, - "model_id": "dinov3-normal-bank-pcb3-v1", - "batch": "Verified VisA examples", - "filename": "VisA example", - "image_url": "showcase/images/b43a98329ac646ef90f19861345d0884.jpg", - "heatmap_url": "showcase/images/b43a98329ac646ef90f19861345d0884_heatmap.jpg" - }, - { - "id": "d182ffb0791744d08f112d7321e69f1d", - "created_at": "2026-10-16T05:04:11.654455+00:00", - "category": "pcb4", - "verdict": "Good", - "score": 0.040615081787109375, - "threshold": 0.043793290853500366, - "uncertainty_margin": 0.0021896645426750182, - "inference_ms": 27.27, - "model_id": "dinov3-normal-bank-pcb4-v1", - "batch": "Verified VisA examples", - "filename": "VisA example", - "image_url": "showcase/images/d182ffb0791744d08f112d7321e69f1d.jpg", - "heatmap_url": "showcase/images/d182ffb0791744d08f112d7321e69f1d_heatmap.jpg" - }, - { - "id": "09c2eda2da134adf829057bc0a4faccb", - "created_at": "2026-10-16T05:04:11.824898+00:00", - "category": "pcb4", - "verdict": "Anomalous", - "score": 0.05046689510345459, - "threshold": 0.043793290853500366, - "uncertainty_margin": 0.0021896645426750182, - "inference_ms": 35.16, - "model_id": "dinov3-normal-bank-pcb4-v1", - "batch": "Verified VisA examples", - "filename": "VisA example", - "image_url": "showcase/images/09c2eda2da134adf829057bc0a4faccb.jpg", - "heatmap_url": "showcase/images/09c2eda2da134adf829057bc0a4faccb_heatmap.jpg" - }, - { - "id": "3c255e6f989c4bee88941ef44c2f81dc", - "created_at": "2026-10-16T05:04:12.082369+00:00", - "category": "pipe_fryum", - "verdict": "Good", - "score": 0.04459744691848755, - "threshold": 0.05846443772315979, - "uncertainty_margin": 0.0029232218861579896, - "inference_ms": 28.43, - "model_id": "dinov3-normal-bank-pipe_fryum-v1", - "batch": "Verified VisA examples", - "filename": "VisA example", - "image_url": "showcase/images/3c255e6f989c4bee88941ef44c2f81dc.jpg", - "heatmap_url": "showcase/images/3c255e6f989c4bee88941ef44c2f81dc_heatmap.jpg" - }, - { - "id": "eba4738a39db4a3192230964d15853bc", - "created_at": "2026-10-16T05:04:12.265434+00:00", - "category": "pipe_fryum", - "verdict": "Anomalous", - "score": 0.08141562342643738, - "threshold": 0.05846443772315979, - "uncertainty_margin": 0.0029232218861579896, - "inference_ms": 27.96, - "model_id": "dinov3-normal-bank-pipe_fryum-v1", - "batch": "Verified VisA examples", - "filename": "VisA example", - "image_url": "showcase/images/eba4738a39db4a3192230964d15853bc.jpg", - "heatmap_url": "showcase/images/eba4738a39db4a3192230964d15853bc_heatmap.jpg" - } - ], - "samples": [ - { - "name": "pcb1_good", - "category": "pcb1", - "record_id": "18c7586f94de4b6d8ef773779f7cea2f", - "url": "showcase/images/18c7586f94de4b6d8ef773779f7cea2f.jpg", - "attribution": "VisA \u00b7 Zou et al., ECCV 2022 \u00b7 CC BY 4.0" - }, - { - "name": "pcb1_anomalous", - "category": "pcb1", - "record_id": "52ee2c6d54934fcfaffb0f273c70dc87", - "url": "showcase/images/52ee2c6d54934fcfaffb0f273c70dc87.jpg", - "attribution": "VisA \u00b7 Zou et al., ECCV 2022 \u00b7 CC BY 4.0" - }, - { - "name": "capsules_good", - "category": "capsules", - "record_id": "e701c08ef3264b20bcb11149f734b219", - "url": "showcase/images/e701c08ef3264b20bcb11149f734b219.jpg", - "attribution": "VisA \u00b7 Zou et al., ECCV 2022 \u00b7 CC BY 4.0" - }, - { - "name": "capsules_anomalous", - "category": "capsules", - "record_id": "e3964b50d4cf4860a1f7a926d1ae444a", - "url": "showcase/images/e3964b50d4cf4860a1f7a926d1ae444a.jpg", - "attribution": "VisA \u00b7 Zou et al., ECCV 2022 \u00b7 CC BY 4.0" - }, - { - "name": "cashew_good", - "category": "cashew", - "record_id": "b5d1bd5c7ed1493ab8f4a849eeeb7712", - "url": "showcase/images/b5d1bd5c7ed1493ab8f4a849eeeb7712.jpg", - "attribution": "VisA \u00b7 Zou et al., ECCV 2022 \u00b7 CC BY 4.0" - }, - { - "name": "cashew_anomalous", - "category": "cashew", - "record_id": "3243fbe65d59477b9811da0f306535aa", - "url": "showcase/images/3243fbe65d59477b9811da0f306535aa.jpg", - "attribution": "VisA \u00b7 Zou et al., ECCV 2022 \u00b7 CC BY 4.0" - }, - { - "name": "pcb1_anomalous_followup", - "category": "pcb1", - "record_id": "a6226ef392eb417e8991369e890d816b", - "url": "showcase/images/a6226ef392eb417e8991369e890d816b.jpg", - "attribution": "VisA \u00b7 Zou et al., ECCV 2022 \u00b7 CC BY 4.0" - }, - { - "name": "candle_good", - "category": "candle", - "record_id": "14418c36d94648adbdbc2779a6a33b3c", - "url": "showcase/images/14418c36d94648adbdbc2779a6a33b3c.jpg", - "attribution": "VisA \u00b7 Zou et al., ECCV 2022 \u00b7 CC BY 4.0" - }, - { - "name": "candle_anomalous", - "category": "candle", - "record_id": "7dbb6f27253b450698a1a503cfa9a8c8", - "url": "showcase/images/7dbb6f27253b450698a1a503cfa9a8c8.jpg", - "attribution": "VisA \u00b7 Zou et al., ECCV 2022 \u00b7 CC BY 4.0" - }, - { - "name": "chewinggum_good", - "category": "chewinggum", - "record_id": "6082416ed1c34be6a4fccd7e406f4a34", - "url": "showcase/images/6082416ed1c34be6a4fccd7e406f4a34.jpg", - "attribution": "VisA \u00b7 Zou et al., ECCV 2022 \u00b7 CC BY 4.0" - }, - { - "name": "chewinggum_anomalous", - "category": "chewinggum", - "record_id": "dcc3e255b90f466c9087d7e09af1a661", - "url": "showcase/images/dcc3e255b90f466c9087d7e09af1a661.jpg", - "attribution": "VisA \u00b7 Zou et al., ECCV 2022 \u00b7 CC BY 4.0" - }, - { - "name": "fryum_good", - "category": "fryum", - "record_id": "d9023f03ff7945d8928216e8df02a620", - "url": "showcase/images/d9023f03ff7945d8928216e8df02a620.jpg", - "attribution": "VisA \u00b7 Zou et al., ECCV 2022 \u00b7 CC BY 4.0" - }, - { - "name": "fryum_anomalous", - "category": "fryum", - "record_id": "118f64eaadfe43ce8b27b955a82c37ba", - "url": "showcase/images/118f64eaadfe43ce8b27b955a82c37ba.jpg", - "attribution": "VisA \u00b7 Zou et al., ECCV 2022 \u00b7 CC BY 4.0" - }, - { - "name": "macaroni1_good", - "category": "macaroni1", - "record_id": "e335298e27e843c38d81accf54fdb399", - "url": "showcase/images/e335298e27e843c38d81accf54fdb399.jpg", - "attribution": "VisA \u00b7 Zou et al., ECCV 2022 \u00b7 CC BY 4.0" - }, - { - "name": "macaroni1_anomalous", - "category": "macaroni1", - "record_id": "1a5f9735b7dd44f18995b62e871ee3b7", - "url": "showcase/images/1a5f9735b7dd44f18995b62e871ee3b7.jpg", - "attribution": "VisA \u00b7 Zou et al., ECCV 2022 \u00b7 CC BY 4.0" - }, - { - "name": "macaroni2_good", - "category": "macaroni2", - "record_id": "d03553a7af274bba808fe090d4a7912b", - "url": "showcase/images/d03553a7af274bba808fe090d4a7912b.jpg", - "attribution": "VisA \u00b7 Zou et al., ECCV 2022 \u00b7 CC BY 4.0" - }, - { - "name": "macaroni2_anomalous", - "category": "macaroni2", - "record_id": "232cbf03a23f4eb2a3793fa1628e5f9c", - "url": "showcase/images/232cbf03a23f4eb2a3793fa1628e5f9c.jpg", - "attribution": "VisA \u00b7 Zou et al., ECCV 2022 \u00b7 CC BY 4.0" - }, - { - "name": "pcb2_good", - "category": "pcb2", - "record_id": "99d47a61108f4581b59c6fac6bfc224f", - "url": "showcase/images/99d47a61108f4581b59c6fac6bfc224f.jpg", - "attribution": "VisA \u00b7 Zou et al., ECCV 2022 \u00b7 CC BY 4.0" - }, - { - "name": "pcb2_anomalous", - "category": "pcb2", - "record_id": "c6222fddf36d4c788ae4e96994b3e02b", - "url": "showcase/images/c6222fddf36d4c788ae4e96994b3e02b.jpg", - "attribution": "VisA \u00b7 Zou et al., ECCV 2022 \u00b7 CC BY 4.0" - }, - { - "name": "pcb3_good", - "category": "pcb3", - "record_id": "2cb0f86c14d344019b28f77f4628257f", - "url": "showcase/images/2cb0f86c14d344019b28f77f4628257f.jpg", - "attribution": "VisA \u00b7 Zou et al., ECCV 2022 \u00b7 CC BY 4.0" - }, - { - "name": "pcb3_anomalous", - "category": "pcb3", - "record_id": "b43a98329ac646ef90f19861345d0884", - "url": "showcase/images/b43a98329ac646ef90f19861345d0884.jpg", - "attribution": "VisA \u00b7 Zou et al., ECCV 2022 \u00b7 CC BY 4.0" - }, - { - "name": "pcb4_good", - "category": "pcb4", - "record_id": "d182ffb0791744d08f112d7321e69f1d", - "url": "showcase/images/d182ffb0791744d08f112d7321e69f1d.jpg", - "attribution": "VisA \u00b7 Zou et al., ECCV 2022 \u00b7 CC BY 4.0" - }, - { - "name": "pcb4_anomalous", - "category": "pcb4", - "record_id": "09c2eda2da134adf829057bc0a4faccb", - "url": "showcase/images/09c2eda2da134adf829057bc0a4faccb.jpg", - "attribution": "VisA \u00b7 Zou et al., ECCV 2022 \u00b7 CC BY 4.0" - }, - { - "name": "pipe_fryum_good", - "category": "pipe_fryum", - "record_id": "3c255e6f989c4bee88941ef44c2f81dc", - "url": "showcase/images/3c255e6f989c4bee88941ef44c2f81dc.jpg", - "attribution": "VisA \u00b7 Zou et al., ECCV 2022 \u00b7 CC BY 4.0" - }, - { - "name": "pipe_fryum_anomalous", - "category": "pipe_fryum", - "record_id": "eba4738a39db4a3192230964d15853bc", - "url": "showcase/images/eba4738a39db4a3192230964d15853bc.jpg", - "attribution": "VisA \u00b7 Zou et al., ECCV 2022 \u00b7 CC BY 4.0" - } - ], - "messages": { - "18c7586f94de4b6d8ef773779f7cea2f": [ - { - "role": "user", - "question": "What caused this defect?" - }, - { - "role": "assistant", - "answer": "The available measurements and documentation do not establish that claim. Specific defect names, counts, root causes, tolerances and repair instructions require additional validated evidence.", - "mode": "abstained", - "evidence": [], - "trace": [ - "route", - "abstain" - ] - }, - { - "role": "user", - "question": "What caused this defect?" - }, - { - "role": "assistant", - "answer": "The available measurements and documentation do not establish that claim. Specific defect names, counts, root causes, tolerances and repair instructions require additional validated evidence.", - "mode": "abstained", - "evidence": [], - "trace": [ - "route", - "abstain" - ] - } - ], - "52ee2c6d54934fcfaffb0f273c70dc87": [], - "e701c08ef3264b20bcb11149f734b219": [], - "e3964b50d4cf4860a1f7a926d1ae444a": [], - "b5d1bd5c7ed1493ab8f4a849eeeb7712": [], - "3243fbe65d59477b9811da0f306535aa": [], - "a6226ef392eb417e8991369e890d816b": [ - { - "role": "user", - "question": "So this product is anomaly right?" - }, - { - "role": "assistant", - "answer": "Yes\u2014the model flagged this pcb1 image as Anomalous. Its anomaly score is 0.09611, above the upper review boundary of 0.05019; the decision threshold is 0.04780. This flags unusual appearance; it does not identify a specific defect or its cause.", - "mode": "measurement_only", - "evidence": [], - "trace": [ - "read_saved_inspection", - "check_score_and_review_band", - "answer_measurement_question" - ] - }, - { - "role": "user", - "question": "Does 0.09 mean 9% accurate?" - }, - { - "role": "assistant", - "answer": "The model flagged this pcb1 image as Anomalous. Its anomaly score is 0.09611, above the upper review boundary of 0.05019; the decision threshold is 0.04780. This score measures feature difference from normal references. It is not an accuracy percentage, confidence level or defect probability.", - "mode": "measurement_only", - "evidence": [], - "trace": [ - "read_saved_inspection", - "check_score_and_review_band", - "answer_measurement_question" - ] - }, - { - "role": "user", - "question": "What does this inspection heatmap show?" - }, - { - "role": "assistant", - "answer": "The model flagged this pcb1 image as Anomalous. Its anomaly score is 0.09611, above the upper review boundary of 0.05019; the decision threshold is 0.04780. This flags unusual appearance; it does not identify a specific defect or its cause.\n\nThe heatmap illustrates the cosine distance between each image patch feature and its closest stored normal patch feature. [screening-4]\n\nThe map represents a 14 by 14 patch grid for coarse localization, not for verified defect segmentation or named defect diagnosis. [screening-4]", - "mode": "llm", - "evidence": [ - { - "text": "# Current detector heatmap\nThe current DefectRAG detector uses a frozen DINOv3 encoder and a nearest-normal memory bank. Its heatmap displays the cosine distance between each image patch feature and its closest stored normal patch feature. Larger distances mean a larger departure from the reference appearance. The map interpolates a 14 by 14 patch grid; it is coarse localization, not a verified defect segmentation or a named defect diagnosis. This detector does not reconstruct image features with a trained decoder. General Dinomaly reconstruction documentation describes a different method.", - "id": "screening", - "file": "screening.md", - "title": "DefectRAG v2 screening and evidence policy", - "url": "project://docs/inspection-policy", - "license": "Project-authored, MIT", - "scope": "application policy; not a factory SOP", - "start_index": 1282, - "chunk_id": "screening-4", - "similarity": 0.7689 - }, - { - "text": "# Evidence limits and response\nThe system does not predict specific defect types, component counts, root causes, process parameters, acceptance tolerances or repair instructions. Those require additional validated supervision or approved process records. Model failures create an error event, never a successful inspection. Anomaly and uncertain events create local review alerts. Review source images and heatmaps before acting. Product category is selected by the operator; arbitrary or wrong-product uploads are outside validated scope. Documentation is general context and must remain separate from image measurements.", - "id": "screening", - "file": "screening.md", - "title": "DefectRAG v2 screening and evidence policy", - "url": "project://docs/inspection-policy", - "license": "Project-authored, MIT", - "scope": "application policy; not a factory SOP", - "start_index": 1880, - "chunk_id": "screening-5", - "similarity": 0.7055 - } - ], - "trace": [ - "route", - "retrieve", - "validate_evidence", - "generate", - "validate_answer" - ] - }, - { - "role": "user", - "question": "How does that map relate to the anomaly score?" - }, - { - "role": "assistant", - "answer": "The model flagged this pcb1 image as Anomalous. Its anomaly score is 0.09611, above the upper review boundary of 0.05019; the decision threshold is 0.04780. This flags unusual appearance; it does not identify a specific defect or its cause.\n\nA larger anomaly score indicates a larger feature distance; the score is not a defect probability. [screening-2]\n\nThe map represents a 14 by 14 patch grid; it is coarse localization, not a verified defect segmentation or a named defect diagnosis. [screening-4]", - "mode": "llm", - "evidence": [ - { - "text": "# Current detector heatmap\nThe current DefectRAG detector uses a frozen DINOv3 encoder and a nearest-normal memory bank. Its heatmap displays the cosine distance between each image patch feature and its closest stored normal patch feature. Larger distances mean a larger departure from the reference appearance. The map interpolates a 14 by 14 patch grid; it is coarse localization, not a verified defect segmentation or a named defect diagnosis. This detector does not reconstruct image features with a trained decoder. General Dinomaly reconstruction documentation describes a different method.", - "id": "screening", - "file": "screening.md", - "title": "DefectRAG v2 screening and evidence policy", - "url": "project://docs/inspection-policy", - "license": "Project-authored, MIT", - "scope": "application policy; not a factory SOP", - "start_index": 1282, - "chunk_id": "screening-4", - "similarity": 0.7411 - }, - { - "text": "# Reading an inspection\nDefectRAG compares an uploaded image with normal VisA reference features for the selected product. A larger anomaly score indicates a larger feature distance; the score is not a defect probability. Good means the score lies below the validated decision threshold and outside the review band. Anomalous means it lies above the threshold and outside the review band. Uncertain means it lies within a fixed five-percent band around the threshold. This review band is an operational heuristic, not calibrated statistical confidence. A Good result is screening evidence, not proof that a product is safe or meets a factory specification.", - "id": "screening", - "file": "screening.md", - "title": "DefectRAG v2 screening and evidence policy", - "url": "project://docs/inspection-policy", - "license": "Project-authored, MIT", - "scope": "application policy; not a factory SOP", - "start_index": 0, - "chunk_id": "screening-2", - "similarity": 0.7304 - } - ], - "trace": [ - "route", - "retrieve", - "validate_evidence", - "generate", - "validate_answer" - ] - }, - { - "role": "user", - "question": "What caused this defect?" - }, - { - "role": "assistant", - "answer": "The model flagged this pcb1 image as Anomalous. Its anomaly score is 0.09611, above the upper review boundary of 0.05019; the decision threshold is 0.04780. This flags unusual appearance; it does not identify a specific defect or its cause.\n\nThe available measurements and documentation do not establish that claim. Specific defect names, counts, root causes, tolerances and repair instructions require additional validated evidence.", - "mode": "abstained", - "evidence": [], - "trace": [ - "route", - "abstain" - ] - } - ], - "14418c36d94648adbdbc2779a6a33b3c": [], - "7dbb6f27253b450698a1a503cfa9a8c8": [], - "6082416ed1c34be6a4fccd7e406f4a34": [], - "dcc3e255b90f466c9087d7e09af1a661": [], - "d9023f03ff7945d8928216e8df02a620": [], - "118f64eaadfe43ce8b27b955a82c37ba": [], - "e335298e27e843c38d81accf54fdb399": [], - "1a5f9735b7dd44f18995b62e871ee3b7": [], - "d03553a7af274bba808fe090d4a7912b": [], - "232cbf03a23f4eb2a3793fa1628e5f9c": [], - "99d47a61108f4581b59c6fac6bfc224f": [], - "c6222fddf36d4c788ae4e96994b3e02b": [], - "2cb0f86c14d344019b28f77f4628257f": [], - "b43a98329ac646ef90f19861345d0884": [], - "d182ffb0791744d08f112d7321e69f1d": [], - "09c2eda2da134adf829057bc0a4faccb": [], - "3c255e6f989c4bee88941ef44c2f81dc": [], - "eba4738a39db4a3192230964d15853bc": [] - }, - "evaluation": { - "method": "Frozen DINOv3 ViT-S/16 + cosine nearest-normal patch bank", - "protocol": "64 normal fit images; 32 distinct training normals + 20 official test anomalies for calibration; remaining official test images for final evaluation. Seed 42. Not the full official VisA test protocol.", - "platform": "Windows-11-10.0.26300-SP0", - "python": "3.12.4", - "torch": "2.8.0+cu126", - "device": "cuda", - "encoder_sha256": "4610ad75edef83e75afdebf162d148dc628045ea6cbb83d67d4708c709c4f91d", - "categories": { - "pcb1": { - "category": "pcb1", - "available": true, - "model_id": "dinov3-normal-bank-pcb1-v1", - "method": "Frozen DINOv3 ViT-S/16 + cosine nearest-normal patch bank", - "encoder_sha256": "4610ad75edef83e75afdebf162d148dc628045ea6cbb83d67d4708c709c4f91d", - "bank_sha256": "32786eb59ad977de43f1eac542defa92a62c856c3e6013762373c5d8428ff41f", - "threshold": 0.047802507877349854, - "uncertainty_margin": 0.0023901253938674928, - "uncertainty_policy": "Fixed \u00b15% of validated threshold. Operational review band, not calibrated confidence.", - "heatmap_scale": 0.05350043252110481, - "bank_size_bytes": 5826022, - "encoder_size_bytes": 86406384, - "calibration": { - "method": "Max F1 on separate validation identities", - "normal": 32, - "anomalous": 20, - "seed": 42 - }, - "train_normal_count": 64, - "metrics": { - "image_auroc": 0.8966250000000001, - "average_precision": 0.8663194463972607, - "precision": 0.7790697674418605, - "recall": 0.8375, - "f1": 0.8072289156626506, - "confusion_matrix": [ - [ - 81, - 19 - ], - [ - 13, - 67 - ] - ], - "n_images": 180, - "pixel_auroc_64": 0.9898054522947226, - "pixel_average_precision_64": 0.7869819025878954, - "pixel_f1_64": 0.7252747252747253, - "pixel_threshold": 0.09545719623565674, - "latency_median_ms": 107.9613499896368, - "latency_p95_ms": 200.43043499463238, - "peak_gpu_mb": 75.25634765625, - "uncertain_fraction": 0.10555555555555556 - }, - "fit_and_evaluation_seconds": 46.72307930000534 - }, - "capsules": { - "category": "capsules", - "available": true, - "model_id": "dinov3-normal-bank-capsules-v1", - "method": "Frozen DINOv3 ViT-S/16 + cosine nearest-normal patch bank", - "encoder_sha256": "4610ad75edef83e75afdebf162d148dc628045ea6cbb83d67d4708c709c4f91d", - "bank_sha256": "04c06d14d8a95cdcc25f2db57d5156c5f3ad3ccc5997b1a94762f4e6953f3230", - "threshold": 0.04728597402572632, - "uncertainty_margin": 0.0023642987012863163, - "uncertainty_policy": "Fixed \u00b15% of validated threshold. Operational review band, not calibrated confidence.", - "heatmap_scale": 0.051162537187337875, - "bank_size_bytes": 5829829, - "encoder_size_bytes": 86406384, - "calibration": { - "method": "Max F1 on separate validation identities", - "normal": 32, - "anomalous": 20, - "seed": 42 - }, - "train_normal_count": 64, - "metrics": { - "image_auroc": 0.825, - "average_precision": 0.888730323581443, - "precision": 0.8382352941176471, - "recall": 0.7125, - "f1": 0.7702702702702703, - "confusion_matrix": [ - [ - 49, - 11 - ], - [ - 23, - 57 - ] - ], - "n_images": 140, - "pixel_auroc_64": 0.9262537759349578, - "pixel_average_precision_64": 0.045138180218283995, - "pixel_f1_64": 0.11524251238110211, - "pixel_threshold": 0.05173458158969879, - "latency_median_ms": 63.487500010523945, - "latency_p95_ms": 154.34065499284767, - "peak_gpu_mb": 75.25634765625, - "uncertain_fraction": 0.2642857142857143 - }, - "fit_and_evaluation_seconds": 22.833901800011517 - }, - "cashew": { - "category": "cashew", - "available": true, - "model_id": "dinov3-normal-bank-cashew-v1", - "method": "Frozen DINOv3 ViT-S/16 + cosine nearest-normal patch bank", - "encoder_sha256": "4610ad75edef83e75afdebf162d148dc628045ea6cbb83d67d4708c709c4f91d", - "bank_sha256": "2da63dd9fec7bba903090659fad56c7d3dbb39cf7cc8525a68ebbb5cf13031c5", - "threshold": 0.051523059606552124, - "uncertainty_margin": 0.0025761529803276064, - "uncertainty_policy": "Fixed \u00b15% of validated threshold. Operational review band, not calibrated confidence.", - "heatmap_scale": 0.05220940336585045, - "bank_size_bytes": 5818641, - "encoder_size_bytes": 86406384, - "calibration": { - "method": "Max F1 on separate validation identities", - "normal": 32, - "anomalous": 20, - "seed": 42 - }, - "train_normal_count": 64, - "metrics": { - "image_auroc": 0.9705, - "average_precision": 0.9830165610895263, - "precision": 1.0, - "recall": 0.7, - "f1": 0.8235294117647058, - "confusion_matrix": [ - [ - 50, - 0 - ], - [ - 24, - 56 - ] - ], - "n_images": 130, - "pixel_auroc_64": 0.996374825929817, - "pixel_average_precision_64": 0.9143062834240087, - "pixel_f1_64": 0.7389403146118462, - "pixel_threshold": 0.060025766491889954, - "latency_median_ms": 46.69994999130722, - "latency_p95_ms": 87.63518499908969, - "peak_gpu_mb": 75.25634765625, - "uncertain_fraction": 0.06153846153846154 - }, - "fit_and_evaluation_seconds": 15.456038499978604 - }, - "candle": { - "category": "candle", - "available": true, - "model_id": "dinov3-normal-bank-candle-v1", - "method": "Frozen DINOv3 ViT-S/16 + cosine nearest-normal patch bank", - "encoder_sha256": "4610ad75edef83e75afdebf162d148dc628045ea6cbb83d67d4708c709c4f91d", - "bank_sha256": "f7465d73990b2e0ada0b4ffd493341af104debf37ba5add778767ba955406eaa", - "threshold": 0.04235455393791199, - "uncertainty_margin": 0.0021177276968955996, - "uncertainty_policy": "Fixed \u00b15% of validated threshold. Operational review band, not calibrated confidence.", - "heatmap_scale": 0.049472544342279434, - "bank_size_bytes": 5833565, - "encoder_size_bytes": 86406384, - "calibration": { - "method": "Max F1 on separate validation identities", - "normal": 32, - "anomalous": 20, - "seed": 42 - }, - "train_normal_count": 64, - "metrics": { - "image_auroc": 0.9247500000000001, - "average_precision": 0.9157839305972371, - "precision": 0.8095238095238095, - "recall": 0.85, - "f1": 0.8292682926829268, - "confusion_matrix": [ - [ - 84, - 16 - ], - [ - 12, - 68 - ] - ], - "n_images": 180, - "pixel_auroc_64": 0.9843575395340302, - "pixel_average_precision_64": 0.21910140819834925, - "pixel_f1_64": 0.21270521056388295, - "pixel_threshold": 0.0849744901061058, - "latency_median_ms": 35.39944998919964, - "latency_p95_ms": 42.45204498292878, - "peak_gpu_mb": 75.25634765625, - "uncertain_fraction": 0.07777777777777778 - }, - "fit_and_evaluation_seconds": 16.015594900003634 - }, - "chewinggum": { - "category": "chewinggum", - "available": true, - "model_id": "dinov3-normal-bank-chewinggum-v1", - "method": "Frozen DINOv3 ViT-S/16 + cosine nearest-normal patch bank", - "encoder_sha256": "4610ad75edef83e75afdebf162d148dc628045ea6cbb83d67d4708c709c4f91d", - "bank_sha256": "457aa7d24353f019c0cd279b927e686d85fb9642d61f35fa7837eac9180971d1", - "threshold": 0.06446045637130737, - "uncertainty_margin": 0.003223022818565369, - "uncertainty_policy": "Fixed \u00b15% of validated threshold. Operational review band, not calibrated confidence.", - "heatmap_scale": 0.12498166412115097, - "bank_size_bytes": 5818815, - "encoder_size_bytes": 86406384, - "calibration": { - "method": "Max F1 on separate validation identities", - "normal": 32, - "anomalous": 20, - "seed": 42 - }, - "train_normal_count": 64, - "metrics": { - "image_auroc": 0.9615, - "average_precision": 0.9817544815300773, - "precision": 1.0, - "recall": 0.8375, - "f1": 0.9115646258503401, - "confusion_matrix": [ - [ - 50, - 0 - ], - [ - 13, - 67 - ] - ], - "n_images": 130, - "pixel_auroc_64": 0.9764362172320896, - "pixel_average_precision_64": 0.6115074532633727, - "pixel_f1_64": 0.535268768428215, - "pixel_threshold": 0.15793992578983307, - "latency_median_ms": 35.14035000989679, - "latency_p95_ms": 38.95726999035105, - "peak_gpu_mb": 75.25634765625, - "uncertain_fraction": 0.05384615384615385 - }, - "fit_and_evaluation_seconds": 12.904443200008245 - }, - "fryum": { - "category": "fryum", - "available": true, - "model_id": "dinov3-normal-bank-fryum-v1", - "method": "Frozen DINOv3 ViT-S/16 + cosine nearest-normal patch bank", - "encoder_sha256": "4610ad75edef83e75afdebf162d148dc628045ea6cbb83d67d4708c709c4f91d", - "bank_sha256": "8ace2cfe248a0fcc2cf4de52a724e5eb0bb40b8982cc1940a0ebc1d328b14bf5", - "threshold": 0.031331419944763184, - "uncertainty_margin": 0.0015665709972381592, - "uncertainty_policy": "Fixed \u00b15% of validated threshold. Operational review band, not calibrated confidence.", - "heatmap_scale": 0.03678131476044655, - "bank_size_bytes": 5837639, - "encoder_size_bytes": 86406384, - "calibration": { - "method": "Max F1 on separate validation identities", - "normal": 32, - "anomalous": 20, - "seed": 42 - }, - "train_normal_count": 64, - "metrics": { - "image_auroc": 0.9045000000000001, - "average_precision": 0.9462912998505075, - "precision": 0.8518518518518519, - "recall": 0.8625, - "f1": 0.8571428571428571, - "confusion_matrix": [ - [ - 38, - 12 - ], - [ - 11, - 69 - ] - ], - "n_images": 130, - "pixel_auroc_64": 0.9719083051766001, - "pixel_average_precision_64": 0.3980462068371827, - "pixel_f1_64": 0.4379701239538087, - "pixel_threshold": 0.032756902277469635, - "latency_median_ms": 42.533050014753826, - "latency_p95_ms": 46.57477499276865, - "peak_gpu_mb": 75.25634765625, - "uncertain_fraction": 0.1076923076923077 - }, - "fit_and_evaluation_seconds": 14.423628800024744 - }, - "macaroni1": { - "category": "macaroni1", - "available": true, - "model_id": "dinov3-normal-bank-macaroni1-v1", - "method": "Frozen DINOv3 ViT-S/16 + cosine nearest-normal patch bank", - "encoder_sha256": "4610ad75edef83e75afdebf162d148dc628045ea6cbb83d67d4708c709c4f91d", - "bank_sha256": "80671fc63c363971235dfcfed56f4b7bc26a6cc729f8742b9cc245e3c32a6740", - "threshold": 0.04998299479484558, - "uncertainty_margin": 0.002499149739742279, - "uncertainty_policy": "Fixed \u00b15% of validated threshold. Operational review band, not calibrated confidence.", - "heatmap_scale": 0.04887811839580536, - "bank_size_bytes": 5838076, - "encoder_size_bytes": 86406384, - "calibration": { - "method": "Max F1 on separate validation identities", - "normal": 32, - "anomalous": 20, - "seed": 42 - }, - "train_normal_count": 64, - "metrics": { - "image_auroc": 0.8305, - "average_precision": 0.7713832272795041, - "precision": 0.8103448275862069, - "recall": 0.5875, - "f1": 0.6811594202898551, - "confusion_matrix": [ - [ - 89, - 11 - ], - [ - 33, - 47 - ] - ], - "n_images": 180, - "pixel_auroc_64": 0.694555712193444, - "pixel_average_precision_64": 0.001018167117284116, - "pixel_f1_64": 0.004832509610104338, - "pixel_threshold": 0.04819351062178612, - "latency_median_ms": 38.921750005101785, - "latency_p95_ms": 43.64804000215372, - "peak_gpu_mb": 75.25634765625, - "uncertain_fraction": 0.13333333333333333 - }, - "fit_and_evaluation_seconds": 16.23608139998396 - }, - "macaroni2": { - "category": "macaroni2", - "available": true, - "model_id": "dinov3-normal-bank-macaroni2-v1", - "method": "Frozen DINOv3 ViT-S/16 + cosine nearest-normal patch bank", - "encoder_sha256": "4610ad75edef83e75afdebf162d148dc628045ea6cbb83d67d4708c709c4f91d", - "bank_sha256": "0645e4c3bfe1b829bc2b10c59f1ecf7e4b64bf85490182c9aeb188d2a31b1a68", - "threshold": 0.056429386138916016, - "uncertainty_margin": 0.002821469306945801, - "uncertainty_policy": "Fixed \u00b15% of validated threshold. Operational review band, not calibrated confidence.", - "heatmap_scale": 0.057037897408008575, - "bank_size_bytes": 5828662, - "encoder_size_bytes": 86406384, - "calibration": { - "method": "Max F1 on separate validation identities", - "normal": 32, - "anomalous": 20, - "seed": 42 - }, - "train_normal_count": 64, - "metrics": { - "image_auroc": 0.46825, - "average_precision": 0.4027863501702508, - "precision": 0.41414141414141414, - "recall": 0.5125, - "f1": 0.4581005586592179, - "confusion_matrix": [ - [ - 42, - 58 - ], - [ - 39, - 41 - ] - ], - "n_images": 180, - "pixel_auroc_64": 0.806682222416908, - "pixel_average_precision_64": 0.0014684442001449403, - "pixel_f1_64": 0.006172839506172839, - "pixel_threshold": 0.06772572547197342, - "latency_median_ms": 36.53770001255907, - "latency_p95_ms": 41.75992001546546, - "peak_gpu_mb": 75.25634765625, - "uncertain_fraction": 0.35 - }, - "fit_and_evaluation_seconds": 15.40095150002162 - }, - "pcb2": { - "category": "pcb2", - "available": true, - "model_id": "dinov3-normal-bank-pcb2-v1", - "method": "Frozen DINOv3 ViT-S/16 + cosine nearest-normal patch bank", - "encoder_sha256": "4610ad75edef83e75afdebf162d148dc628045ea6cbb83d67d4708c709c4f91d", - "bank_sha256": "896d2526dbbe432a77d1085ec7c229848dfc99076d5544a76ad323d3e30ede30", - "threshold": 0.03412127494812012, - "uncertainty_margin": 0.0017060637474060059, - "uncertainty_policy": "Fixed \u00b15% of validated threshold. Operational review band, not calibrated confidence.", - "heatmap_scale": 0.05106712877750397, - "bank_size_bytes": 5830678, - "encoder_size_bytes": 86406384, - "calibration": { - "method": "Max F1 on separate validation identities", - "normal": 32, - "anomalous": 20, - "seed": 42 - }, - "train_normal_count": 64, - "metrics": { - "image_auroc": 0.7842500000000001, - "average_precision": 0.7352563715081358, - "precision": 0.5929203539823009, - "recall": 0.8375, - "f1": 0.694300518134715, - "confusion_matrix": [ - [ - 54, - 46 - ], - [ - 13, - 67 - ] - ], - "n_images": 180, - "pixel_auroc_64": 0.914610843350704, - "pixel_average_precision_64": 0.036729612921036846, - "pixel_f1_64": 0.08551020408163265, - "pixel_threshold": 0.04263307899236679, - "latency_median_ms": 38.40279999712948, - "latency_p95_ms": 42.41142502578441, - "peak_gpu_mb": 75.25634765625, - "uncertain_fraction": 0.15555555555555556 - }, - "fit_and_evaluation_seconds": 15.296049700002186 - }, - "pcb3": { - "category": "pcb3", - "available": true, - "model_id": "dinov3-normal-bank-pcb3-v1", - "method": "Frozen DINOv3 ViT-S/16 + cosine nearest-normal patch bank", - "encoder_sha256": "4610ad75edef83e75afdebf162d148dc628045ea6cbb83d67d4708c709c4f91d", - "bank_sha256": "f291efa19669dbc601086ec5f5b7a8f5e8ae107d0476c65563e911958ed089e6", - "threshold": 0.04104718565940857, - "uncertainty_margin": 0.0020523592829704285, - "uncertainty_policy": "Fixed \u00b15% of validated threshold. Operational review band, not calibrated confidence.", - "heatmap_scale": 0.05669708549976349, - "bank_size_bytes": 5822961, - "encoder_size_bytes": 86406384, - "calibration": { - "method": "Max F1 on separate validation identities", - "normal": 32, - "anomalous": 20, - "seed": 42 - }, - "train_normal_count": 64, - "metrics": { - "image_auroc": 0.8034653465346534, - "average_precision": 0.7836195407829445, - "precision": 0.6931818181818182, - "recall": 0.7625, - "f1": 0.7261904761904762, - "confusion_matrix": [ - [ - 74, - 27 - ], - [ - 19, - 61 - ] - ], - "n_images": 181, - "pixel_auroc_64": 0.9392880496970388, - "pixel_average_precision_64": 0.14389241178306048, - "pixel_f1_64": 0.1905079470934756, - "pixel_threshold": 0.054352011531591415, - "latency_median_ms": 41.84810002334416, - "latency_p95_ms": 45.29579999507405, - "peak_gpu_mb": 75.25634765625, - "uncertain_fraction": 0.11602209944751381 - }, - "fit_and_evaluation_seconds": 16.930150200001663 - }, - "pcb4": { - "category": "pcb4", - "available": true, - "model_id": "dinov3-normal-bank-pcb4-v1", - "method": "Frozen DINOv3 ViT-S/16 + cosine nearest-normal patch bank", - "encoder_sha256": "4610ad75edef83e75afdebf162d148dc628045ea6cbb83d67d4708c709c4f91d", - "bank_sha256": "b92668a5dd7740e5f966feaf6ee360655ecbeb0103943a2a9ba9c898a7ec439a", - "threshold": 0.043793290853500366, - "uncertainty_margin": 0.0021896645426750182, - "uncertainty_policy": "Fixed \u00b15% of validated threshold. Operational review band, not calibrated confidence.", - "heatmap_scale": 0.045600999146699905, - "bank_size_bytes": 5825074, - "encoder_size_bytes": 86406384, - "calibration": { - "method": "Max F1 on separate validation identities", - "normal": 32, - "anomalous": 20, - "seed": 42 - }, - "train_normal_count": 64, - "metrics": { - "image_auroc": 0.9326732673267326, - "average_precision": 0.907221287906644, - "precision": 0.8461538461538461, - "recall": 0.825, - "f1": 0.8354430379746836, - "confusion_matrix": [ - [ - 89, - 12 - ], - [ - 14, - 66 - ] - ], - "n_images": 181, - "pixel_auroc_64": 0.9642022029108047, - "pixel_average_precision_64": 0.2560012959647235, - "pixel_f1_64": 0.3499251497005988, - "pixel_threshold": 0.042218707501888275, - "latency_median_ms": 42.51339999609627, - "latency_p95_ms": 46.933599980548024, - "peak_gpu_mb": 75.25634765625, - "uncertain_fraction": 0.09392265193370165 - }, - "fit_and_evaluation_seconds": 17.002736900001764 - }, - "pipe_fryum": { - "category": "pipe_fryum", - "available": true, - "model_id": "dinov3-normal-bank-pipe_fryum-v1", - "method": "Frozen DINOv3 ViT-S/16 + cosine nearest-normal patch bank", - "encoder_sha256": "4610ad75edef83e75afdebf162d148dc628045ea6cbb83d67d4708c709c4f91d", - "bank_sha256": "eed6f4f89764e14ca8811cc7d4aef3cf9266c9ae2d432595afc94bdfeca8156a", - "threshold": 0.05846443772315979, - "uncertainty_margin": 0.0029232218861579896, - "uncertainty_policy": "Fixed \u00b15% of validated threshold. Operational review band, not calibrated confidence.", - "heatmap_scale": 0.12200922518968582, - "bank_size_bytes": 5829726, - "encoder_size_bytes": 86406384, - "calibration": { - "method": "Max F1 on separate validation identities", - "normal": 32, - "anomalous": 20, - "seed": 42 - }, - "train_normal_count": 64, - "metrics": { - "image_auroc": 0.95425, - "average_precision": 0.9740168127563904, - "precision": 0.9577464788732394, - "recall": 0.85, - "f1": 0.9006622516556292, - "confusion_matrix": [ - [ - 47, - 3 - ], - [ - 12, - 68 - ] - ], - "n_images": 130, - "pixel_auroc_64": 0.9918675784453588, - "pixel_average_precision_64": 0.575045773003843, - "pixel_f1_64": 0.5497345487328459, - "pixel_threshold": 0.10162080824375153, - "latency_median_ms": 39.761749998433515, - "latency_p95_ms": 43.10778999642935, - "peak_gpu_mb": 75.25634765625, - "uncertain_fraction": 0.06153846153846154 - }, - "fit_and_evaluation_seconds": 12.410172900010366 - } - }, - "serving_profile": { - "method": "Existing calibrated models; 6 original held-out images, 5 warm repetitions each; no training", - "categories": { - "pcb1": { - "samples": 10, - "core_median_ms": 54.59, - "core_p95_ms": 60.916999999999994, - "decoded_image_to_result_median_ms": 172.78114998771343, - "decoded_image_to_result_p95_ms": 182.06591499620117, - "category_load_ms": 1318.0554999853484, - "peak_torch_allocated_gpu_mb": 65.61, - "device": "cuda" - }, - "capsules": { - "samples": 10, - "core_median_ms": 53.875, - "core_p95_ms": 57.915, - "decoded_image_to_result_median_ms": 158.5184499999741, - "decoded_image_to_result_p95_ms": 162.40958499111002, - "category_load_ms": 78.86780000990257, - "peak_torch_allocated_gpu_mb": 77.61, - "device": "cuda" - }, - "cashew": { - "samples": 10, - "core_median_ms": 65.61500000000001, - "core_p95_ms": 89.65849999999999, - "decoded_image_to_result_median_ms": 229.5610500004841, - "decoded_image_to_result_p95_ms": 258.9202900038799, - "category_load_ms": 77.84360001096502, - "peak_torch_allocated_gpu_mb": 89.61, - "device": "cuda" - } - }, - "python": "3.12.4", - "torch": "2.8.0+cu126", - "gpu": { - "name": "NVIDIA GeForce RTX 4060 Laptop GPU", - "free_mb_before": 7097.0, - "total_mb": 8187.5 - }, - "cpu_smoke": { - "verdict": "Good", - "score": 0.03067457675933838, - "reference_cuda_score": 0.030725598335266113, - "absolute_difference": 5.1021575927734375e-05, - "total_ms": 1110.6508999946527 - } - } - }, - "official_evaluation": { - "protocol": { - "schema": 1, - "dataset": "VisA official split_csv/1cls.csv", - "split_csv_sha256": "a48557e6033318cb90556f706196bc9d247a776a23ea51aecee5a80dd0332995", - "method": "Frozen DINOv3 ViT-S/16 + cosine nearest-normal patch memory; custom baseline, not Dinomaly", - "encoder_sha256": "4610ad75edef83e75afdebf162d148dc628045ea6cbb83d67d4708c709c4f91d", - "benchmark_seeds": [ - 42, - 43, - 44 - ], - "bank_patch_limit": 8192, - "image_score": "mean of highest 1% patch distances", - "pixel_evaluation_resolution": 224, - "pixel_metrics": "VisA reference 200-threshold AUROC/AU-PR; normal images included; AP separately", - "preprocessing": "bundled DINOv3 image processor, default 224 input; no augmentation or GT masks in features", - "benchmark": "all official training normals; all official test images; threshold-free ranking metrics", - "deployment": "seed42; 10% official training normals held out; threshold=max held-out normal score; no test anomalies used", - "prior_test_exposure": "retrospective benchmark: test images/results were seen in earlier modified-split experiments; no new test-driven tuning", - "selection_policy": "fixed before execution; all three seeds reported; no best-seed selection", - "sources": [ - "https://github.com/amazon-science/spot-diff", - "https://arxiv.org/html/2207.14315", - "https://raw.githubusercontent.com/amazon-science/spot-diff/main/utils/metrics.py" - ] - }, - "python": "3.12.4", - "torch": "2.8.0+cu126", - "device": "cuda", - "categories": { - "pcb1": { - "official_train_normals": 904, - "official_test_images": 200, - "benchmark_runs": [ - { - "seed": 42, - "auroc": 0.8823, - "au_pr": 0.8652156099418584, - "average_precision": 0.8662377386046971, - "pixel_auroc": 0.9843661984454277, - "pixel_au_pr": 0.7588138431092281, - "pixel_average_precision": 0.7588445707254726 - }, - { - "seed": 43, - "auroc": 0.8833, - "au_pr": 0.8478267819433369, - "average_precision": 0.8493502402186066, - "pixel_auroc": 0.9842690568703282, - "pixel_au_pr": 0.7560718748028801, - "pixel_average_precision": 0.7560583979602433 - }, - { - "seed": 44, - "auroc": 0.8729, - "au_pr": 0.8477510900503791, - "average_precision": 0.849157510741792, - "pixel_auroc": 0.9828381548165445, - "pixel_au_pr": 0.7602114521729626, - "pixel_average_precision": 0.7602556604913916 - } - ], - "benchmark_mean": { - "auroc": 0.8795000000000001, - "au_pr": 0.8535978273118582, - "average_precision": 0.8549151631883652, - "pixel_auroc": 0.9838244700441002, - "pixel_au_pr": 0.7583657233616902, - "pixel_average_precision": 0.7583862097257025 - }, - "benchmark_std": { - "auroc": 0.0057375953151123996, - "au_pr": 0.01006136607246337, - "average_precision": 0.009806111446781554, - "pixel_auroc": 0.0008555538659163021, - "pixel_au_pr": 0.002105856994628281, - "pixel_average_precision": 0.002135842759527955 - }, - "deployment_holdout_profile": { - "seed": 42, - "threshold": 0.08778351545333862, - "fit_normals": 813, - "validation_normals": 91, - "auroc": 0.8823, - "au_pr": 0.8689523679102507, - "average_precision": 0.8701001531382211, - "pixel_auroc": 0.9829881707996662, - "pixel_au_pr": 0.761096603150961, - "pixel_average_precision": 0.7610949764155934 - }, - "seconds": 112.7122111999779 - }, - "capsules": { - "official_train_normals": 542, - "official_test_images": 160, - "benchmark_runs": [ - { - "seed": 42, - "auroc": 0.8064999999999999, - "au_pr": 0.8883355238246444, - "average_precision": 0.8889946957168198, - "pixel_auroc": 0.9314791692599804, - "pixel_au_pr": 0.06111133849830806, - "pixel_average_precision": 0.06111931303510193 - }, - { - "seed": 43, - "auroc": 0.8116666666666668, - "au_pr": 0.892768815037886, - "average_precision": 0.8933734183457129, - "pixel_auroc": 0.9271496681356036, - "pixel_au_pr": 0.06392553683680963, - "pixel_average_precision": 0.06394387473959999 - }, - { - "seed": 44, - "auroc": 0.831, - "au_pr": 0.9045055504943371, - "average_precision": 0.905031503578954, - "pixel_auroc": 0.920030704594082, - "pixel_au_pr": 0.06036921760334449, - "pixel_average_precision": 0.060374057512393456 - } - ], - "benchmark_mean": { - "auroc": 0.8163888888888889, - "au_pr": 0.8952032964522892, - "average_precision": 0.8957998725471622, - "pixel_auroc": 0.9262198473298886, - "pixel_au_pr": 0.061802030979487395, - "pixel_average_precision": 0.06181241509569846 - }, - "benchmark_std": { - "auroc": 0.012914605570323747, - "au_pr": 0.008355385415553805, - "average_precision": 0.008289183409453001, - "pixel_auroc": 0.0057805934686359466, - "pixel_au_pr": 0.0018760713473231134, - "pixel_average_precision": 0.001883133454834655 - }, - "deployment_holdout_profile": { - "seed": 42, - "threshold": 0.06207504868507385, - "fit_normals": 487, - "validation_normals": 55, - "auroc": 0.8285000000000001, - "au_pr": 0.9036303626323163, - "average_precision": 0.9041775948115949, - "pixel_auroc": 0.925380309579376, - "pixel_au_pr": 0.06219526908416476, - "pixel_average_precision": 0.06220455484733658 - }, - "seconds": 73.66336999999476 - }, - "cashew": { - "official_train_normals": 450, - "official_test_images": 150, - "benchmark_runs": [ - { - "seed": 42, - "auroc": 0.9686, - "au_pr": 0.9855796182651859, - "average_precision": 0.9856470397867623, - "pixel_auroc": 0.9959214053889084, - "pixel_au_pr": 0.9063467359578445, - "pixel_average_precision": 0.906363611998445 - }, - { - "seed": 43, - "auroc": 0.9714, - "au_pr": 0.9864154003433409, - "average_precision": 0.9864809726384766, - "pixel_auroc": 0.9956851230701886, - "pixel_au_pr": 0.905553212306003, - "pixel_average_precision": 0.9055719630533584 - }, - { - "seed": 44, - "auroc": 0.9674, - "au_pr": 0.9847871536501108, - "average_precision": 0.9848592880970601, - "pixel_auroc": 0.9954262934889538, - "pixel_au_pr": 0.9028857900152283, - "pixel_average_precision": 0.9029448883372253 - } - ], - "benchmark_mean": { - "auroc": 0.9691333333333333, - "au_pr": 0.9855940574195459, - "average_precision": 0.985662433507433, - "pixel_auroc": 0.9956776073160168, - "pixel_au_pr": 0.9049285794263587, - "pixel_average_precision": 0.9049601544630095 - }, - "benchmark_std": { - "auroc": 0.0020526405757787585, - "au_pr": 0.0008142193748539785, - "average_precision": 0.0008109518561199027, - "pixel_auroc": 0.0002476415015495735, - "pixel_au_pr": 0.0018130530549814719, - "pixel_average_precision": 0.0017895949769051811 - }, - "deployment_holdout_profile": { - "seed": 42, - "threshold": 0.07112658023834229, - "fit_normals": 405, - "validation_normals": 45, - "auroc": 0.9718, - "au_pr": 0.9869784872730237, - "average_precision": 0.9870395707487909, - "pixel_auroc": 0.995439448532811, - "pixel_au_pr": 0.9041546127455985, - "pixel_average_precision": 0.9041673447497144 - }, - "seconds": 67.18520740000531 - }, - "candle": { - "official_train_normals": 900, - "official_test_images": 200, - "benchmark_runs": [ - { - "seed": 42, - "auroc": 0.9124, - "au_pr": 0.9067093867265235, - "average_precision": 0.907317577547275, - "pixel_auroc": 0.9791673272800795, - "pixel_au_pr": 0.19343705864597519, - "pixel_average_precision": 0.19350496168249026 - }, - { - "seed": 43, - "auroc": 0.9188, - "au_pr": 0.9183048196974375, - "average_precision": 0.9187591434503573, - "pixel_auroc": 0.979483321196079, - "pixel_au_pr": 0.18619068410380335, - "pixel_average_precision": 0.18625584865892192 - }, - { - "seed": 44, - "auroc": 0.9185, - "au_pr": 0.9149165895092746, - "average_precision": 0.9154818487384909, - "pixel_auroc": 0.9796341027948368, - "pixel_au_pr": 0.19655647956405858, - "pixel_average_precision": 0.1966224772020632 - } - ], - "benchmark_mean": { - "auroc": 0.9165666666666666, - "au_pr": 0.9133102653110785, - "average_precision": 0.9138528565787077, - "pixel_auroc": 0.979428250423665, - "pixel_au_pr": 0.19206140743794572, - "pixel_average_precision": 0.1921277625144918 - }, - "benchmark_std": { - "auroc": 0.0036115555282084802, - "au_pr": 0.005962275112574286, - "average_precision": 0.005892161672181073, - "pixel_auroc": 0.00023821091027684724, - "pixel_au_pr": 0.005318058016379355, - "pixel_average_precision": 0.005318764424104492 - }, - "deployment_holdout_profile": { - "seed": 42, - "threshold": 0.06003263592720032, - "fit_normals": 810, - "validation_normals": 90, - "auroc": 0.9321, - "au_pr": 0.9351585676489977, - "average_precision": 0.9355012345374768, - "pixel_auroc": 0.9798686015733775, - "pixel_au_pr": 0.19301852070736908, - "pixel_average_precision": 0.1931484756578974 - }, - "seconds": 113.62054019997595 - }, - "chewinggum": { - "official_train_normals": 453, - "official_test_images": 150, - "benchmark_runs": [ - { - "seed": 42, - "auroc": 0.9573999999999999, - "au_pr": 0.9830502868470744, - "average_precision": 0.9831192510451747, - "pixel_auroc": 0.9766855303849944, - "pixel_au_pr": 0.6299510587206012, - "pixel_average_precision": 0.629929382711634 - }, - { - "seed": 43, - "auroc": 0.9588, - "au_pr": 0.9845659784908927, - "average_precision": 0.9846248486924407, - "pixel_auroc": 0.9762049874185391, - "pixel_au_pr": 0.6251718689797755, - "pixel_average_precision": 0.6251574763557178 - }, - { - "seed": 44, - "auroc": 0.9668, - "au_pr": 0.9872811603159687, - "average_precision": 0.9873310764098553, - "pixel_auroc": 0.9754393718474601, - "pixel_au_pr": 0.628449413046543, - "pixel_average_precision": 0.6284537166295275 - } - ], - "benchmark_mean": { - "auroc": 0.961, - "au_pr": 0.984965808551312, - "average_precision": 0.9850250587158236, - "pixel_auroc": 0.9761099632169978, - "pixel_au_pr": 0.6278574469156398, - "pixel_average_precision": 0.6278468585656265 - }, - "benchmark_std": { - "auroc": 0.005071488933242415, - "au_pr": 0.0021435882616210435, - "average_precision": 0.0021342432552906732, - "pixel_auroc": 0.0006284902340739392, - "pixel_au_pr": 0.002443968406057183, - "pixel_average_precision": 0.0024431496269568974 - }, - "deployment_holdout_profile": { - "seed": 42, - "threshold": 0.05347451567649841, - "fit_normals": 407, - "validation_normals": 46, - "auroc": 0.9625999999999999, - "au_pr": 0.9854792314128331, - "average_precision": 0.9855370573897992, - "pixel_auroc": 0.9759074141352108, - "pixel_au_pr": 0.6277173455397616, - "pixel_average_precision": 0.6277079537238726 - }, - "seconds": 66.73736349999672 - }, - "fryum": { - "official_train_normals": 450, - "official_test_images": 150, - "benchmark_runs": [ - { - "seed": 42, - "auroc": 0.9116000000000001, - "au_pr": 0.9574765963875643, - "average_precision": 0.9576928507137918, - "pixel_auroc": 0.9604315182344441, - "pixel_au_pr": 0.3775780213581445, - "pixel_average_precision": 0.3776046761599081 - }, - { - "seed": 43, - "auroc": 0.8862000000000001, - "au_pr": 0.9432783477724793, - "average_precision": 0.9435869919550414, - "pixel_auroc": 0.9583562963953284, - "pixel_au_pr": 0.3747542024223356, - "pixel_average_precision": 0.3747849030743497 - }, - { - "seed": 44, - "auroc": 0.9004, - "au_pr": 0.9514351723489248, - "average_precision": 0.9516899329031522, - "pixel_auroc": 0.9586872744593278, - "pixel_au_pr": 0.37651978163909156, - "pixel_average_precision": 0.3765570093516509 - } - ], - "benchmark_mean": { - "auroc": 0.8994, - "au_pr": 0.9507300388363228, - "average_precision": 0.9509899251906617, - "pixel_auroc": 0.9591583630297, - "pixel_au_pr": 0.3762840018065239, - "pixel_average_precision": 0.37631552952863623 - }, - "benchmark_std": { - "auroc": 0.012729493312775637, - "au_pr": 0.007125340404983236, - "average_precision": 0.007078935013730096, - "pixel_auroc": 0.0011149348641231144, - "pixel_au_pr": 0.0014265982064486373, - "pixel_average_precision": 0.0014253120508163468 - }, - "deployment_holdout_profile": { - "seed": 42, - "threshold": 0.053059279918670654, - "fit_normals": 405, - "validation_normals": 45, - "auroc": 0.8989999999999999, - "au_pr": 0.9499623450465442, - "average_precision": 0.9502271580371828, - "pixel_auroc": 0.95870290751976, - "pixel_au_pr": 0.3758081431639321, - "pixel_average_precision": 0.3758205269856516 - }, - "seconds": 45.03114439998171 - }, - "macaroni1": { - "official_train_normals": 900, - "official_test_images": 200, - "benchmark_runs": [ - { - "seed": 42, - "auroc": 0.8164, - "au_pr": 0.7900379634618211, - "average_precision": 0.7926331212277926, - "pixel_auroc": 0.7283181171780677, - "pixel_au_pr": 0.0015780890385677598, - "pixel_average_precision": 0.0015822262566728654 - }, - { - "seed": 43, - "auroc": 0.8359, - "au_pr": 0.7956190395568308, - "average_precision": 0.7979488439753669, - "pixel_auroc": 0.7306853981697815, - "pixel_au_pr": 0.0014010765391638876, - "pixel_average_precision": 0.0014043048463368265 - }, - { - "seed": 44, - "auroc": 0.8099000000000001, - "au_pr": 0.8008593903199746, - "average_precision": 0.8025537360231381, - "pixel_auroc": 0.7277374329290651, - "pixel_au_pr": 0.0016472824117211124, - "pixel_average_precision": 0.0016523645125773884 - } - ], - "benchmark_mean": { - "auroc": 0.8207333333333334, - "au_pr": 0.7955054644462088, - "average_precision": 0.7977119004087658, - "pixel_auroc": 0.7289136494256381, - "pixel_au_pr": 0.0015421493298175867, - "pixel_average_precision": 0.0015462985385290267 - }, - "benchmark_std": { - "auroc": 0.013530828996529822, - "au_pr": 0.005411607366661578, - "average_precision": 0.004964549946341761, - "pixel_auroc": 0.0015616077479764874, - "pixel_au_pr": 0.00012697669045616823, - "pixel_average_precision": 0.00012787298464535848 - }, - "deployment_holdout_profile": { - "seed": 42, - "threshold": 0.07591500878334045, - "fit_normals": 810, - "validation_normals": 90, - "auroc": 0.8335, - "au_pr": 0.8032695520542, - "average_precision": 0.8058774002646991, - "pixel_auroc": 0.7319699198048704, - "pixel_au_pr": 0.001820719918554894, - "pixel_average_precision": 0.0018246547691389576 - }, - "seconds": 113.06721189999371 - }, - "macaroni2": { - "official_train_normals": 900, - "official_test_images": 200, - "benchmark_runs": [ - { - "seed": 42, - "auroc": 0.4955, - "au_pr": 0.4859157566747824, - "average_precision": 0.4902353735956684, - "pixel_auroc": 0.7944229143717352, - "pixel_au_pr": 0.0022004507218000534, - "pixel_average_precision": 0.002215863502953361 - }, - { - "seed": 43, - "auroc": 0.4796000000000001, - "au_pr": 0.4677863570673503, - "average_precision": 0.4739730801749749, - "pixel_auroc": 0.8020432743793243, - "pixel_au_pr": 0.0021332172565870665, - "pixel_average_precision": 0.0021419399589341134 - }, - { - "seed": 44, - "auroc": 0.47309999999999997, - "au_pr": 0.481108422817926, - "average_precision": 0.4866820080963612, - "pixel_auroc": 0.7959122719175098, - "pixel_au_pr": 0.002358628955417945, - "pixel_average_precision": 0.0023693502334905183 - } - ], - "benchmark_mean": { - "auroc": 0.4827333333333333, - "au_pr": 0.47827017885335293, - "average_precision": 0.48363015395566816, - "pixel_auroc": 0.7974594868895232, - "pixel_au_pr": 0.0022307656446016884, - "pixel_average_precision": 0.0022423845651259977 - }, - "benchmark_std": { - "auroc": 0.011524032858914164, - "au_pr": 0.009392044725900559, - "average_precision": 0.008549906847283857, - "pixel_auroc": 0.0040389203122285795, - "pixel_au_pr": 0.00011572318004966633, - "pixel_average_precision": 0.00011600165213275413 - }, - "deployment_holdout_profile": { - "seed": 42, - "threshold": 0.0805380642414093, - "fit_normals": 810, - "validation_normals": 90, - "auroc": 0.5002, - "au_pr": 0.47564475009156426, - "average_precision": 0.48172379567632917, - "pixel_auroc": 0.7947031866442082, - "pixel_au_pr": 0.002174639270063553, - "pixel_average_precision": 0.0021925647141094167 - }, - "seconds": 67.62013350002235 - }, - "pcb2": { - "official_train_normals": 901, - "official_test_images": 200, - "benchmark_runs": [ - { - "seed": 42, - "auroc": 0.7893, - "au_pr": 0.7838787634081932, - "average_precision": 0.7855971798280925, - "pixel_auroc": 0.91671033819846, - "pixel_au_pr": 0.041767499746959265, - "pixel_average_precision": 0.041784021345270844 - }, - { - "seed": 43, - "auroc": 0.7906, - "au_pr": 0.7724737077727798, - "average_precision": 0.7755020531727549, - "pixel_auroc": 0.9179732879227119, - "pixel_au_pr": 0.041524995711936755, - "pixel_average_precision": 0.04154041374898589 - }, - { - "seed": 44, - "auroc": 0.8055, - "au_pr": 0.8096355999130022, - "average_precision": 0.810914809807684, - "pixel_auroc": 0.9175574803045266, - "pixel_au_pr": 0.04068717301416601, - "pixel_average_precision": 0.04072086553805905 - } - ], - "benchmark_mean": { - "auroc": 0.7951333333333332, - "au_pr": 0.7886626903646583, - "average_precision": 0.7906713476028439, - "pixel_auroc": 0.9174137021418994, - "pixel_au_pr": 0.04132655615768734, - "pixel_average_precision": 0.041348433544105265 - }, - "benchmark_std": { - "auroc": 0.009001296202955072, - "au_pr": 0.019037227337613424, - "average_precision": 0.018243525346706518, - "pixel_auroc": 0.0006436339188803603, - "pixel_au_pr": 0.0005668422663448508, - "pixel_average_precision": 0.0005569716033170332 - }, - "deployment_holdout_profile": { - "seed": 42, - "threshold": 0.0849224328994751, - "fit_normals": 810, - "validation_normals": 91, - "auroc": 0.7905000000000001, - "au_pr": 0.7880878748919639, - "average_precision": 0.7897732654897014, - "pixel_auroc": 0.9102355183098504, - "pixel_au_pr": 0.039144681417868435, - "pixel_average_precision": 0.039151291696416506 - }, - "seconds": 62.73766280000564 - }, - "pcb3": { - "official_train_normals": 905, - "official_test_images": 201, - "benchmark_runs": [ - { - "seed": 42, - "auroc": 0.7870297029702971, - "au_pr": 0.8104200255489605, - "average_precision": 0.8114909738137448, - "pixel_auroc": 0.9329148327640948, - "pixel_au_pr": 0.1287764827542035, - "pixel_average_precision": 0.12875248706618522 - }, - { - "seed": 43, - "auroc": 0.8099999999999999, - "au_pr": 0.8178552814078315, - "average_precision": 0.8189577706195854, - "pixel_auroc": 0.9352837561495217, - "pixel_au_pr": 0.143581430436699, - "pixel_average_precision": 0.14364100585551115 - }, - { - "seed": 44, - "auroc": 0.798019801980198, - "au_pr": 0.805514000894815, - "average_precision": 0.806847271418301, - "pixel_auroc": 0.9337017802212624, - "pixel_au_pr": 0.13761258942453908, - "pixel_average_precision": 0.1376028370963068 - } - ], - "benchmark_mean": { - "auroc": 0.7983498349834983, - "au_pr": 0.8112631026172022, - "average_precision": 0.812432005283877, - "pixel_auroc": 0.9339667897116263, - "pixel_au_pr": 0.1366568342051472, - "pixel_average_precision": 0.1366654433393344 - }, - "benchmark_std": { - "auroc": 0.011488704354523396, - "au_pr": 0.0062136853301794056, - "average_precision": 0.006109844752275779, - "pixel_auroc": 0.0012064916178709522, - "pixel_au_pr": 0.007448605238559986, - "pixel_average_precision": 0.007488392900131238 - }, - "deployment_holdout_profile": { - "seed": 42, - "threshold": 0.08122119307518005, - "fit_normals": 814, - "validation_normals": 91, - "auroc": 0.7747524752475247, - "au_pr": 0.8045196628588029, - "average_precision": 0.8056175108533596, - "pixel_auroc": 0.9294099327005999, - "pixel_au_pr": 0.13226256510452605, - "pixel_average_precision": 0.1322610245459947 - }, - "seconds": 86.13384480000241 - }, - "pcb4": { - "official_train_normals": 904, - "official_test_images": 201, - "benchmark_runs": [ - { - "seed": 42, - "auroc": 0.9296039603960395, - "au_pr": 0.9264685581956622, - "average_precision": 0.9268962317340124, - "pixel_auroc": 0.9649612355233904, - "pixel_au_pr": 0.2848150662221529, - "pixel_average_precision": 0.28485386160082676 - }, - { - "seed": 43, - "auroc": 0.9455445544554456, - "au_pr": 0.9444126592665123, - "average_precision": 0.9447216067906145, - "pixel_auroc": 0.9659001073100977, - "pixel_au_pr": 0.2972460671551258, - "pixel_average_precision": 0.2972609273755548 - }, - { - "seed": 44, - "auroc": 0.9352475247524753, - "au_pr": 0.9277253482488393, - "average_precision": 0.9281977057451503, - "pixel_auroc": 0.9683930607520573, - "pixel_au_pr": 0.2917764048064103, - "pixel_average_precision": 0.29179388828957287 - } - ], - "benchmark_mean": { - "auroc": 0.9367986798679868, - "au_pr": 0.9328688552370047, - "average_precision": 0.9332718480899257, - "pixel_auroc": 0.9664181345285151, - "pixel_au_pr": 0.291279179394563, - "pixel_average_precision": 0.2913028924219848 - }, - "benchmark_std": { - "auroc": 0.008082709718032446, - "au_pr": 0.010016957567704859, - "average_precision": 0.009937111722146195, - "pixel_auroc": 0.001773589650763301, - "pixel_au_pr": 0.006230398934380788, - "pixel_average_precision": 0.006218088773176086 - }, - "deployment_holdout_profile": { - "seed": 42, - "threshold": 0.05957549810409546, - "fit_normals": 813, - "validation_normals": 91, - "auroc": 0.936930693069307, - "au_pr": 0.935289428742797, - "average_precision": 0.9356652909858226, - "pixel_auroc": 0.9686479110465991, - "pixel_au_pr": 0.29322576468181716, - "pixel_average_precision": 0.29326625902921355 - }, - "seconds": 79.89875999998185 - }, - "pipe_fryum": { - "official_train_normals": 450, - "official_test_images": 150, - "benchmark_runs": [ - { - "seed": 42, - "auroc": 0.9705999999999999, - "au_pr": 0.986018793690163, - "average_precision": 0.9860860317049225, - "pixel_auroc": 0.9909730291737511, - "pixel_au_pr": 0.6018618957896934, - "pixel_average_precision": 0.6018712895066785 - }, - { - "seed": 43, - "auroc": 0.9704, - "au_pr": 0.9865430967562028, - "average_precision": 0.9866053109369469, - "pixel_auroc": 0.9909667466666388, - "pixel_au_pr": 0.6029888315587789, - "pixel_average_precision": 0.6030140367863087 - }, - { - "seed": 44, - "auroc": 0.97, - "au_pr": 0.9858010839067707, - "average_precision": 0.9858702591168634, - "pixel_auroc": 0.9908645972891833, - "pixel_au_pr": 0.598149986807201, - "pixel_average_precision": 0.5981538458958431 - } - ], - "benchmark_mean": { - "auroc": 0.9703333333333332, - "au_pr": 0.9861209914510455, - "average_precision": 0.9861872005862442, - "pixel_auroc": 0.990934791043191, - "pixel_au_pr": 0.6010002380518911, - "pixel_average_precision": 0.6010130573962768 - }, - "benchmark_std": { - "auroc": 0.0003055050463303678, - "au_pr": 0.00038141716522415526, - "average_precision": 0.0003778248952397656, - "pixel_auroc": 6.087068095707952e-05, - "pixel_au_pr": 0.00253188569554477, - "pixel_average_precision": 0.0025412173538354992 - }, - "deployment_holdout_profile": { - "seed": 42, - "threshold": 0.08634456992149353, - "fit_normals": 405, - "validation_normals": 45, - "auroc": 0.9686, - "au_pr": 0.9859739502798138, - "average_precision": 0.9860378036811346, - "pixel_auroc": 0.9907989950706518, - "pixel_au_pr": 0.603420526628673, - "pixel_average_precision": 0.6034129205109321 - }, - "seconds": 66.45045070000924 - } - }, - "macro_mean": { - "auroc": 0.8538392280894755, - "au_pr": 0.8646743814043232, - "average_precision": 0.8658458138046231, - "pixel_auroc": 0.9296270879250635, - "pixel_au_pr": 0.33294457605927946, - "pixel_average_precision": 0.33296395330821005 - }, - "macro_runs": [ - { - "seed": 42, - "auroc": 0.8522694719471947, - "au_pr": 0.8640922402477029, - "average_precision": 0.865162338776563, - "pixel_auroc": 0.9296959680169444, - "pixel_au_pr": 0.3323531283802899, - "pixel_average_precision": 0.3323688554659699 - }, - { - "seed": 43, - "auroc": 0.8551842684268426, - "au_pr": 0.8631541904260733, - "average_precision": 0.8644903567475731, - "pixel_auroc": 0.9303334186403451, - "pixel_au_pr": 0.33337858317582486, - "pixel_average_precision": 0.3333979243678186 - }, - { - "seed": 44, - "auroc": 0.8540639438943894, - "au_pr": 0.8667767135391936, - "average_precision": 0.8678847458897335, - "pixel_auroc": 0.9288518771179008, - "pixel_au_pr": 0.3331020166217237, - "pixel_average_precision": 0.3331250800908418 - } - ], - "macro_std": { - "auroc": 0.0014703341539172223, - "au_pr": 0.001880115600420924, - "average_precision": 0.0017974490250325652, - "pixel_auroc": 0.0007431686692634315, - "pixel_au_pr": 0.0005305469182348207, - "pixel_average_precision": 0.0005331201377259799 - }, - "candidate": { - "protocol": { - "schema": 1, - "method": "AnomalyDINO-inspired DINOv2 ViT-S/14; custom full-data adaptation", - "resolution": "short edge448; bicubic; retain aspect; crop trailing pixels to patch multiple14", - "encoder_sha256": "ae1e99fcefd534ed978cdeb8326f08030c96e28b7a81ffcbc98a857c84d14be1", - "split_csv_sha256": "a48557e6033318cb90556f706196bc9d247a776a23ea51aecee5a80dd0332995", - "seeds": [ - 42, - 43, - 44 - ], - "bank_patches": 32768, - "memory_sampling": "per train normal: up to48 PCA foreground +16 other patches, seeded uniform cap", - "foreground": "PCA first component threshold10; center-sign rule; 2D3x3 dilation/closing; <1% mask falls back to all patches", - "score": "mean of top1% foreground cosine distances", - "fit": "all official training normals for benchmark", - "calibration": "separate deployment bank excludes every tenth content-hash-sorted training normal; maximum heldout normal score", - "evaluation": "full official test; masks only for pixel metrics at224x224; image AP and trapezoidal AU-PR separately", - "selection": "one fixed candidate; no test-based hyperparameter changes; seeds42/43/44 all reported; deployment seed42 fixed", - "exposure": "retrospective development comparison; official test identities and earlier results already seen; not an untouched external test", - "references": [ - "https://arxiv.org/html/2405.14529v2", - "https://github.com/dammsi/AnomalyDINO" - ], - "differences_from_paper": "HF encoder; image-balanced limited full-data memory; masking train and test; 2D morphology; no rotation augmentation" - }, - "python": "3.12.4", - "torch": "2.8.0+cu126", - "device": "cuda", - "categories": { - "macaroni2": { - "official_train_normals": 900, - "official_test_images": 200, - "benchmark_runs": [ - { - "seed": 42, - "auroc": 0.8447, - "au_pr": 0.837609437596522, - "average_precision": 0.8387483523714999, - "pixel_auroc": 0.9939494150699683, - "pixel_au_pr": 0.15619858519387228, - "pixel_average_precision": 0.15653869576515458 - }, - { - "seed": 43, - "auroc": 0.8244, - "au_pr": 0.8342875038001054, - "average_precision": 0.835288930423173, - "pixel_auroc": 0.9941328078917665, - "pixel_au_pr": 0.15365590865968637, - "pixel_average_precision": 0.15385826448902645 - }, - { - "seed": 44, - "auroc": 0.8268000000000001, - "au_pr": 0.82322819785278, - "average_precision": 0.8244805378917035, - "pixel_auroc": 0.9932291868085448, - "pixel_au_pr": 0.1521970939306702, - "pixel_average_precision": 0.15240427679230106 - } - ], - "benchmark_mean": { - "auroc": 0.8319666666666667, - "au_pr": 0.8317083797498025, - "average_precision": 0.8328392735621254, - "pixel_auroc": 0.9937704699234265, - "pixel_au_pr": 0.1540171959280763, - "pixel_average_precision": 0.15426707901549405 - }, - "benchmark_std": { - "auroc": 0.01109248995191489, - "au_pr": 0.007529536824525402, - "average_precision": 0.0074426639424422444, - "pixel_auroc": 0.0004776492328203173, - "pixel_au_pr": 0.002025062826209623, - "pixel_average_precision": 0.002097308286485555 - }, - "deployment_holdout_profile": { - "threshold": 0.15817631781101227, - "heatmap_scale": 0.11770220518112187, - "auroc": 0.845, - "au_pr": 0.8435705368551327, - "average_precision": 0.8446602099722114, - "pixel_auroc": 0.9942242061289198, - "pixel_au_pr": 0.15741764917137446, - "pixel_average_precision": 0.15769057747120718 - }, - "seconds": 135.40084509999724 - }, - "macaroni1": { - "official_train_normals": 900, - "official_test_images": 200, - "benchmark_runs": [ - { - "seed": 42, - "auroc": 0.918, - "au_pr": 0.932786840237027, - "average_precision": 0.933081657808966, - "pixel_auroc": 0.9931323622243489, - "pixel_au_pr": 0.22549630696338402, - "pixel_average_precision": 0.22579868648536688 - }, - { - "seed": 43, - "auroc": 0.9107, - "au_pr": 0.9239509925163285, - "average_precision": 0.9243019415241156, - "pixel_auroc": 0.992904762589421, - "pixel_au_pr": 0.21863043402124735, - "pixel_average_precision": 0.2188116322733481 - }, - { - "seed": 44, - "auroc": 0.907, - "au_pr": 0.9199703014532423, - "average_precision": 0.920343639849281, - "pixel_auroc": 0.9928691842690383, - "pixel_au_pr": 0.21706041388603783, - "pixel_average_precision": 0.21738255135304616 - } - ], - "benchmark_mean": { - "auroc": 0.9119, - "au_pr": 0.925569378068866, - "average_precision": 0.9259090797274542, - "pixel_auroc": 0.9929687696942694, - "pixel_au_pr": 0.22039571829022306, - "pixel_average_precision": 0.2206642900372537 - }, - "benchmark_std": { - "auroc": 0.005597320787662625, - "au_pr": 0.006559748123713314, - "average_precision": 0.006519313252850117, - "pixel_auroc": 0.00014278774857695058, - "pixel_au_pr": 0.00448645120510902, - "pixel_average_precision": 0.004503563948029452 - }, - "deployment_holdout_profile": { - "threshold": 0.21722275018692017, - "heatmap_scale": 0.09929629743099211, - "auroc": 0.909, - "au_pr": 0.9251309284382584, - "average_precision": 0.9254645749095916, - "pixel_auroc": 0.9932559185087934, - "pixel_au_pr": 0.22101242411741848, - "pixel_average_precision": 0.22125282869927704 - }, - "seconds": 138.32114929999807 - }, - "pcb1": { - "official_train_normals": 904, - "official_test_images": 200, - "benchmark_runs": [ - { - "seed": 42, - "auroc": 0.9525, - "au_pr": 0.946087107136921, - "average_precision": 0.9464671661037876, - "pixel_auroc": 0.9944586387417026, - "pixel_au_pr": 0.8464118976709029, - "pixel_average_precision": 0.846427424617724 - }, - { - "seed": 43, - "auroc": 0.9479, - "au_pr": 0.9476376952747854, - "average_precision": 0.9479555666854507, - "pixel_auroc": 0.9944482838147902, - "pixel_au_pr": 0.8531528892315858, - "pixel_average_precision": 0.8531825227347262 - }, - { - "seed": 44, - "auroc": 0.9503, - "au_pr": 0.9512781827394374, - "average_precision": 0.9515451522688605, - "pixel_auroc": 0.994454625316606, - "pixel_au_pr": 0.8477368705549233, - "pixel_average_precision": 0.8477233530396995 - } - ], - "benchmark_mean": { - "auroc": 0.9502333333333333, - "au_pr": 0.9483343283837146, - "average_precision": 0.948655961686033, - "pixel_auroc": 0.994453849291033, - "pixel_au_pr": 0.8491005524858041, - "pixel_average_precision": 0.8491111001307164 - }, - "benchmark_std": { - "auroc": 0.0023007245235650113, - "au_pr": 0.002664730707614299, - "average_precision": 0.0026104407177330187, - "pixel_auroc": 5.220899310240183e-06, - "pixel_au_pr": 0.0035714091213073927, - "pixel_average_precision": 0.003584999181875953 - }, - "deployment_holdout_profile": { - "threshold": 0.16181933879852295, - "heatmap_scale": 0.10316987216472613, - "auroc": 0.9597, - "au_pr": 0.9561930064621866, - "average_precision": 0.9564653221826244, - "pixel_auroc": 0.9946015614062951, - "pixel_au_pr": 0.856268349620392, - "pixel_average_precision": 0.8562862818777615 - }, - "seconds": 130.61381800001254 - }, - "capsules": { - "official_train_normals": 542, - "official_test_images": 160, - "benchmark_runs": [ - { - "seed": 42, - "auroc": 0.968, - "au_pr": 0.9763334548720008, - "average_precision": 0.976495652745956, - "pixel_auroc": 0.9694939889285102, - "pixel_au_pr": 0.40129786284523034, - "pixel_average_precision": 0.4012847974451588 - }, - { - "seed": 43, - "auroc": 0.9686666666666668, - "au_pr": 0.9764671035244079, - "average_precision": 0.9766334139497022, - "pixel_auroc": 0.97044846089275, - "pixel_au_pr": 0.397617206547916, - "pixel_average_precision": 0.3976678565607239 - }, - { - "seed": 44, - "auroc": 0.9713333333333333, - "au_pr": 0.9787056543871668, - "average_precision": 0.9788507777162221, - "pixel_auroc": 0.9701251715230256, - "pixel_au_pr": 0.4041945944570431, - "pixel_average_precision": 0.40422112389698794 - } - ], - "benchmark_mean": { - "auroc": 0.9693333333333333, - "au_pr": 0.9771687375945252, - "average_precision": 0.97732661480396, - "pixel_auroc": 0.9700225404480953, - "pixel_au_pr": 0.4010365546167298, - "pixel_average_precision": 0.4010579259676235 - }, - "benchmark_std": { - "auroc": 0.0017638342073763465, - "au_pr": 0.0013326854134417649, - "average_precision": 0.0013217598021768872, - "pixel_auroc": 0.00048544210343352004, - "pixel_au_pr": 0.003296470752106622, - "pixel_average_precision": 0.003282519032027932 - }, - "deployment_holdout_profile": { - "threshold": 0.19718621671199799, - "heatmap_scale": 0.1274158811569204, - "auroc": 0.9683333333333333, - "au_pr": 0.9797118272127361, - "average_precision": 0.9798232872953215, - "pixel_auroc": 0.9704973188279925, - "pixel_au_pr": 0.40366595976940756, - "pixel_average_precision": 0.403655563796705 - }, - "seconds": 94.91161680000369 - }, - "cashew": { - "official_train_normals": 450, - "official_test_images": 150, - "benchmark_runs": [ - { - "seed": 42, - "auroc": 0.9555999999999999, - "au_pr": 0.9798344986141854, - "average_precision": 0.9799284257916656, - "pixel_auroc": 0.9960590367672582, - "pixel_au_pr": 0.6940909426916273, - "pixel_average_precision": 0.694126095923703 - }, - { - "seed": 43, - "auroc": 0.9578000000000001, - "au_pr": 0.9809117646282322, - "average_precision": 0.9809999318079211, - "pixel_auroc": 0.9961226559982549, - "pixel_au_pr": 0.697751529343841, - "pixel_average_precision": 0.6978133678203721 - }, - { - "seed": 44, - "auroc": 0.9688, - "au_pr": 0.9858445920160998, - "average_precision": 0.9859098832312743, - "pixel_auroc": 0.9961110128509749, - "pixel_au_pr": 0.6924916996495216, - "pixel_average_precision": 0.6925347276159604 - } - ], - "benchmark_mean": { - "auroc": 0.9607333333333333, - "au_pr": 0.9821969517528392, - "average_precision": 0.982279413610287, - "pixel_auroc": 0.9960975685388292, - "pixel_au_pr": 0.69477805722833, - "pixel_average_precision": 0.6948247304533451 - }, - "benchmark_std": { - "auroc": 0.0070720105580615155, - "au_pr": 0.0032045413297187, - "average_precision": 0.0031893986168871256, - "pixel_auroc": 3.387349679255494e-05, - "pixel_au_pr": 0.0026963951663697317, - "pixel_average_precision": 0.0027077810576954238 - }, - "deployment_holdout_profile": { - "threshold": 0.13224798440933228, - "heatmap_scale": 0.10505769878625872, - "auroc": 0.9608000000000001, - "au_pr": 0.9816829641673432, - "average_precision": 0.9817707260519815, - "pixel_auroc": 0.9960830910862268, - "pixel_au_pr": 0.703436397078779, - "pixel_average_precision": 0.7034966403298871 - }, - "seconds": 72.7265475000022 - }, - "candle": { - "official_train_normals": 900, - "official_test_images": 200, - "benchmark_runs": [ - { - "seed": 42, - "auroc": 0.9558, - "au_pr": 0.9621606881772008, - "average_precision": 0.9623367827893016, - "pixel_auroc": 0.9903982538707946, - "pixel_au_pr": 0.33895358283555577, - "pixel_average_precision": 0.3389159342327367 - }, - { - "seed": 43, - "auroc": 0.9536, - "au_pr": 0.9544234987148842, - "average_precision": 0.9546667684680096, - "pixel_auroc": 0.9908451687141144, - "pixel_au_pr": 0.3378197922542562, - "pixel_average_precision": 0.33783760689070347 - }, - { - "seed": 44, - "auroc": 0.9443, - "au_pr": 0.9489440077401582, - "average_precision": 0.9492007022384481, - "pixel_auroc": 0.990951012382223, - "pixel_au_pr": 0.32271350806250704, - "pixel_average_precision": 0.32276634541885246 - } - ], - "benchmark_mean": { - "auroc": 0.9512333333333333, - "au_pr": 0.9551760648774144, - "average_precision": 0.9554014178319198, - "pixel_auroc": 0.9907314783223774, - "pixel_au_pr": 0.33316229438410633, - "pixel_average_precision": 0.3331732955140976 - }, - "benchmark_std": { - "auroc": 0.006104370019365886, - "au_pr": 0.00664040114115595, - "average_precision": 0.006598782866979933, - "pixel_auroc": 0.0002933932887254627, - "pixel_au_pr": 0.009066654397648078, - "pixel_average_precision": 0.009028795887483296 - }, - "deployment_holdout_profile": { - "threshold": 0.22504067420959473, - "heatmap_scale": 0.1193666505813595, - "auroc": 0.9410000000000001, - "au_pr": 0.9456741403322482, - "average_precision": 0.9459465742669609, - "pixel_auroc": 0.9911336061961822, - "pixel_au_pr": 0.3375717699673859, - "pixel_average_precision": 0.33767271945011856 - }, - "seconds": 129.0740725999931 - }, - "chewinggum": { - "official_train_normals": 453, - "official_test_images": 150, - "benchmark_runs": [ - { - "seed": 42, - "auroc": 0.9932, - "au_pr": 0.9969466609199811, - "average_precision": 0.9969604682469676, - "pixel_auroc": 0.9954117320863656, - "pixel_au_pr": 0.6850700777255413, - "pixel_average_precision": 0.6850388759883876 - }, - { - "seed": 43, - "auroc": 0.9892000000000001, - "au_pr": 0.9952337041797067, - "average_precision": 0.9952549042275805, - "pixel_auroc": 0.9953773487370392, - "pixel_au_pr": 0.6846896840964964, - "pixel_average_precision": 0.684733727423744 - }, - { - "seed": 44, - "auroc": 0.9916, - "au_pr": 0.996171900969947, - "average_precision": 0.9961895142750861, - "pixel_auroc": 0.9952795650960506, - "pixel_au_pr": 0.6676922561430878, - "pixel_average_precision": 0.6676931239584004 - } - ], - "benchmark_mean": { - "auroc": 0.9913333333333334, - "au_pr": 0.9961174220232115, - "average_precision": 0.996134962249878, - "pixel_auroc": 0.9953562153064851, - "pixel_au_pr": 0.6791506726550418, - "pixel_average_precision": 0.679155242456844 - }, - "benchmark_std": { - "auroc": 0.002013289182738814, - "au_pr": 0.0008577768738086334, - "average_precision": 0.0008540896315069846, - "pixel_auroc": 6.85710926518182e-05, - "pixel_au_pr": 0.00992510234452624, - "pixel_average_precision": 0.009927658297196707 - }, - "deployment_holdout_profile": { - "threshold": 0.1614319533109665, - "heatmap_scale": 0.11275605440139722, - "auroc": 0.9885999999999999, - "au_pr": 0.994444649292763, - "average_precision": 0.9944721280040146, - "pixel_auroc": 0.9952665200400623, - "pixel_au_pr": 0.6596933281197321, - "pixel_average_precision": 0.6597053568827396 - }, - "seconds": 77.3525510999898 - }, - "fryum": { - "official_train_normals": 450, - "official_test_images": 150, - "benchmark_runs": [ - { - "seed": 42, - "auroc": 0.9891999999999999, - "au_pr": 0.9949168165129106, - "average_precision": 0.9949409420549524, - "pixel_auroc": 0.9738082020921681, - "pixel_au_pr": 0.4379800592981127, - "pixel_average_precision": 0.43799433572118596 - }, - { - "seed": 43, - "auroc": 0.9958, - "au_pr": 0.9978909116915007, - "average_precision": 0.997901515122974, - "pixel_auroc": 0.973882263507042, - "pixel_au_pr": 0.43803860398905753, - "pixel_average_precision": 0.4380513505278392 - }, - { - "seed": 44, - "auroc": 0.9892, - "au_pr": 0.9949145081810289, - "average_precision": 0.9949385524097363, - "pixel_auroc": 0.9739487459423446, - "pixel_au_pr": 0.43927674150289875, - "pixel_average_precision": 0.43931148808215037 - } - ], - "benchmark_mean": { - "auroc": 0.9914, - "au_pr": 0.9959074121284801, - "average_precision": 0.9959270031958876, - "pixel_auroc": 0.9738797371805182, - "pixel_au_pr": 0.43843180159668965, - "pixel_average_precision": 0.4384523914437251 - }, - "benchmark_std": { - "auroc": 0.0038105117766515915, - "au_pr": 0.0017177613977139654, - "average_precision": 0.001709977906364863, - "pixel_auroc": 7.03059755631449e-05, - "pixel_au_pr": 0.0007323246916757177, - "pixel_average_precision": 0.000744545463796214 - }, - "deployment_holdout_profile": { - "threshold": 0.15253151953220367, - "heatmap_scale": 0.10057919770479187, - "auroc": 0.9924, - "au_pr": 0.9963414765677349, - "average_precision": 0.9963591766254614, - "pixel_auroc": 0.9735429349543053, - "pixel_au_pr": 0.4359936878538498, - "pixel_average_precision": 0.4360142987071739 - }, - "seconds": 75.21686919999775 - }, - "pcb2": { - "official_train_normals": 901, - "official_test_images": 200, - "benchmark_runs": [ - { - "seed": 42, - "auroc": 0.9202, - "au_pr": 0.9322088542538738, - "average_precision": 0.932545698262865, - "pixel_auroc": 0.9712767185430914, - "pixel_au_pr": 0.26902216961670095, - "pixel_average_precision": 0.269116591248745 - }, - { - "seed": 43, - "auroc": 0.9289000000000001, - "au_pr": 0.9329793541058563, - "average_precision": 0.9333614467676451, - "pixel_auroc": 0.9717626924423868, - "pixel_au_pr": 0.2798493987176048, - "pixel_average_precision": 0.27991198670004014 - }, - { - "seed": 44, - "auroc": 0.9283, - "au_pr": 0.9280660798216491, - "average_precision": 0.9285879887356563, - "pixel_auroc": 0.9716170427305009, - "pixel_au_pr": 0.2697964905619438, - "pixel_average_precision": 0.2698079968958421 - } - ], - "benchmark_mean": { - "auroc": 0.9258000000000001, - "au_pr": 0.9310847627271265, - "average_precision": 0.9314983779220555, - "pixel_auroc": 0.9715521512386598, - "pixel_au_pr": 0.27288935296541655, - "pixel_average_precision": 0.27294552494820906 - }, - "benchmark_std": { - "auroc": 0.004859012245302549, - "au_pr": 0.0026424898047753827, - "average_precision": 0.0025532597435425006, - "pixel_auroc": 0.0002494009562614438, - "pixel_au_pr": 0.006039997589898184, - "pixel_average_precision": 0.006043029244261792 - }, - "deployment_holdout_profile": { - "threshold": 0.341839998960495, - "heatmap_scale": 0.09851976394653338, - "auroc": 0.9062, - "au_pr": 0.9091607663548358, - "average_precision": 0.9098166487308751, - "pixel_auroc": 0.9714470671684394, - "pixel_au_pr": 0.2629794270140921, - "pixel_average_precision": 0.26303790724220233 - }, - "seconds": 134.38419250000152 - }, - "pcb3": { - "official_train_normals": 905, - "official_test_images": 201, - "benchmark_runs": [ - { - "seed": 42, - "auroc": 0.9433663366336634, - "au_pr": 0.9573257944956892, - "average_precision": 0.9574934355764043, - "pixel_auroc": 0.9804594500562178, - "pixel_au_pr": 0.33440243549415977, - "pixel_average_precision": 0.33442549268444677 - }, - { - "seed": 43, - "auroc": 0.9477227722772278, - "au_pr": 0.959595644345721, - "average_precision": 0.9597596806082674, - "pixel_auroc": 0.9805071690010876, - "pixel_au_pr": 0.33373335990639547, - "pixel_average_precision": 0.333819556432083 - }, - { - "seed": 44, - "auroc": 0.9466336633663367, - "au_pr": 0.9577819308568531, - "average_precision": 0.9579591053290832, - "pixel_auroc": 0.9798799216744494, - "pixel_au_pr": 0.33973787538078626, - "pixel_average_precision": 0.3397522193939622 - } - ], - "benchmark_mean": { - "auroc": 0.9459075907590759, - "au_pr": 0.9582344565660877, - "average_precision": 0.9584040738379184, - "pixel_auroc": 0.9802821802439183, - "pixel_au_pr": 0.3359578902604472, - "pixel_average_precision": 0.3359990895034973 - }, - "benchmark_std": { - "auroc": 0.0022671609895175723, - "au_pr": 0.0012006828155516466, - "average_precision": 0.0011968560341587735, - "pixel_auroc": 0.00034918224748437215, - "pixel_au_pr": 0.0032906125824873787, - "pixel_average_precision": 0.003264395451918764 - }, - "deployment_holdout_profile": { - "threshold": 0.16282716393470764, - "heatmap_scale": 0.1029075479507446, - "auroc": 0.9547524752475247, - "au_pr": 0.9643689895252089, - "average_precision": 0.9645187368797429, - "pixel_auroc": 0.9805302802001331, - "pixel_au_pr": 0.3377368540626885, - "pixel_average_precision": 0.33774957148695994 - }, - "seconds": 135.53616119999788 - }, - "pcb4": { - "official_train_normals": 904, - "official_test_images": 201, - "benchmark_runs": [ - { - "seed": 42, - "auroc": 0.9888118811881188, - "au_pr": 0.9880168371253286, - "average_precision": 0.9880817605339174, - "pixel_auroc": 0.9797851572798281, - "pixel_au_pr": 0.2918409934178783, - "pixel_average_precision": 0.2918620534311465 - }, - { - "seed": 43, - "auroc": 0.9905940594059406, - "au_pr": 0.9904921945653063, - "average_precision": 0.9905403726682713, - "pixel_auroc": 0.9800535279608199, - "pixel_au_pr": 0.3113890405329925, - "pixel_average_precision": 0.3114066877489506 - }, - { - "seed": 44, - "auroc": 0.9902970297029704, - "au_pr": 0.9907507181331998, - "average_precision": 0.9907947926063193, - "pixel_auroc": 0.9811058153456667, - "pixel_au_pr": 0.3112462297344757, - "pixel_average_precision": 0.31127896730004057 - } - ], - "benchmark_mean": { - "auroc": 0.9899009900990099, - "au_pr": 0.9897532499412782, - "average_precision": 0.9898056419361693, - "pixel_auroc": 0.9803148335287716, - "pixel_au_pr": 0.3048254212284488, - "pixel_average_precision": 0.3048492361600459 - }, - "benchmark_std": { - "auroc": 0.0009548169070290293, - "au_pr": 0.0015093229307655532, - "average_precision": 0.001498334973559554, - "pixel_auroc": 0.0006980292841980381, - "pixel_au_pr": 0.011245071049441238, - "pixel_average_precision": 0.011247411460137574 - }, - "deployment_holdout_profile": { - "threshold": 0.17516569793224335, - "heatmap_scale": 0.10422959923744202, - "auroc": 0.9865346534653465, - "au_pr": 0.9821331587999459, - "average_precision": 0.9822685098306626, - "pixel_auroc": 0.9806894408642699, - "pixel_au_pr": 0.3216559666615416, - "pixel_average_precision": 0.3216614985757051 - }, - "seconds": 133.8244237000181 - }, - "pipe_fryum": { - "official_train_normals": 450, - "official_test_images": 150, - "benchmark_runs": [ - { - "seed": 42, - "auroc": 0.995, - "au_pr": 0.9977423374213756, - "average_precision": 0.9977526197670599, - "pixel_auroc": 0.9927515748074147, - "pixel_au_pr": 0.47981081512851037, - "pixel_average_precision": 0.4800110544187529 - }, - { - "seed": 43, - "auroc": 0.9964000000000001, - "au_pr": 0.9982273652036702, - "average_precision": 0.9982361328885846, - "pixel_auroc": 0.992764142075617, - "pixel_au_pr": 0.4830566976570724, - "pixel_average_precision": 0.48318326819265506 - }, - { - "seed": 44, - "auroc": 0.9962, - "au_pr": 0.9982256566034399, - "average_precision": 0.9982339839967207, - "pixel_auroc": 0.9927469763458546, - "pixel_au_pr": 0.481216205091409, - "pixel_average_precision": 0.48138223354046783 - } - ], - "benchmark_mean": { - "auroc": 0.9958666666666667, - "au_pr": 0.9980651197428285, - "average_precision": 0.9980742455507885, - "pixel_auroc": 0.9927542310762955, - "pixel_au_pr": 0.4813612392923306, - "pixel_average_precision": 0.48152551871729193 - }, - "benchmark_std": { - "auroc": 0.0007571877794400558, - "au_pr": 0.0002795389956885984, - "average_precision": 0.0002785381715372213, - "pixel_auroc": 8.885797254273498e-06, - "pixel_au_pr": 0.0016277943779494204, - "pixel_average_precision": 0.0015909534997154244 - }, - "deployment_holdout_profile": { - "threshold": 0.18373285233974457, - "heatmap_scale": 0.1333938717842105, - "auroc": 0.9891999999999999, - "au_pr": 0.9951107263654106, - "average_precision": 0.9951337553868363, - "pixel_auroc": 0.9927315263511816, - "pixel_au_pr": 0.47978917789024056, - "pixel_average_precision": 0.47984772131593945 - }, - "seconds": 71.54133030000958 - } - }, - "macro_mean": { - "auroc": 0.9513007150715072, - "au_pr": 0.9574430219630145, - "average_precision": 0.9576880054928729, - "pixel_auroc": 0.98601533539939, - "pixel_au_pr": 0.430425562577637, - "pixel_average_precision": 0.4305021186956786 - }, - "macro_runs": [ - { - "seed": 42, - "auroc": 0.9520315181518151, - "au_pr": 0.9584974439469179, - "average_precision": 0.958736080171112, - "pixel_auroc": 0.9859153775389724, - "pixel_au_pr": 0.43004797740678957, - "pixel_average_precision": 0.4301283364968757 - }, - { - "seed": 43, - "auroc": 0.9509736248624864, - "au_pr": 0.9576748110458753, - "average_precision": 0.9579083837618078, - "pixel_auroc": 0.9861041069687575, - "pixel_au_pr": 0.432448712079846, - "pixel_average_precision": 0.4325231523161844 - }, - { - "seed": 44, - "auroc": 0.95089700220022, - "au_pr": 0.9561568108962502, - "average_precision": 0.9564195525456993, - "pixel_auroc": 0.9860265216904399, - "pixel_au_pr": 0.4287799982462753, - "pixel_average_precision": 0.428854867273976 - } - ], - "macro_std": { - "auroc": 0.0006340525331026325, - "au_pr": 0.001187407008430423, - "average_precision": 0.0011738824455153193, - "pixel_auroc": 9.486068335903378e-05, - "pixel_au_pr": 0.0018632748640743098, - "pixel_average_precision": 0.0018624885601874065 - } - } - }, - "attribution": "VisA \u00b7 Zou et al., ECCV 2022 \u00b7 CC BY 4.0 \u00b7 resized images and model overlays", - "source": "https://github.com/amazon-science/spot-diff" +{ + "schema": 1, + "mode": "saved_examples", + "records": [ + { + "id": "4bff5e6b5e064383a9b85a8a6bec04cc", + "created_at": "2026-11-07T04:31:09.136511+00:00", + "category": "candle", + "verdict": "Anomalous", + "score": 0.19342294335365295, + "threshold": 0.10769653692841528, + "uncertainty_margin": 0.005384826846420765, + "inference_ms": 31.12, + "model_id": "dinov2-tuned-candle-v1", + "batch": "Verified VisA examples", + "filename": "VisA example", + "image_url": "showcase/images/4bff5e6b5e064383a9b85a8a6bec04cc.jpg", + "heatmap_url": "showcase/images/4bff5e6b5e064383a9b85a8a6bec04cc_heatmap.jpg" + }, + { + "id": "da5e3a7125564152afd03d26ef3fb38b", + "created_at": "2026-11-07T04:31:09.248891+00:00", + "category": "candle", + "verdict": "Good", + "score": 0.07099495828151703, + "threshold": 0.10769653692841528, + "uncertainty_margin": 0.005384826846420765, + "inference_ms": 29.68, + "model_id": "dinov2-tuned-candle-v1", + "batch": "Verified VisA examples", + "filename": "VisA example", + "image_url": "showcase/images/da5e3a7125564152afd03d26ef3fb38b.jpg", + "heatmap_url": "showcase/images/da5e3a7125564152afd03d26ef3fb38b_heatmap.jpg" + }, + { + "id": "66ab22d8050144f78e9b9c1b4c7b0b9e", + "created_at": "2026-11-07T04:31:08.115707+00:00", + "category": "capsules", + "verdict": "Anomalous", + "score": 0.161866694688797, + "threshold": 0.10395566150546073, + "uncertainty_margin": 0.005197783075273037, + "inference_ms": 39.56, + "model_id": "dinov2-tuned-capsules-v1", + "batch": "Verified VisA examples", + "filename": "VisA example", + "image_url": "showcase/images/66ab22d8050144f78e9b9c1b4c7b0b9e.jpg", + "heatmap_url": "showcase/images/66ab22d8050144f78e9b9c1b4c7b0b9e_heatmap.jpg" + }, + { + "id": "da28cabe417a4f7f9d81faa0b6ce4146", + "created_at": "2026-11-07T04:31:08.274601+00:00", + "category": "capsules", + "verdict": "Good", + "score": 0.09077998250722885, + "threshold": 0.10395566150546073, + "uncertainty_margin": 0.005197783075273037, + "inference_ms": 47.05, + "model_id": "dinov2-tuned-capsules-v1", + "batch": "Verified VisA examples", + "filename": "VisA example", + "image_url": "showcase/images/da28cabe417a4f7f9d81faa0b6ce4146.jpg", + "heatmap_url": "showcase/images/da28cabe417a4f7f9d81faa0b6ce4146_heatmap.jpg" + }, + { + "id": "def5b9b862a447ac8c61e168af28c263", + "created_at": "2026-11-07T04:31:08.612264+00:00", + "category": "cashew", + "verdict": "Anomalous", + "score": 0.19361598789691925, + "threshold": 0.10727595388889313, + "uncertainty_margin": 0.005363797694444657, + "inference_ms": 32.13, + "model_id": "dinov2-tuned-cashew-v1", + "batch": "Verified VisA examples", + "filename": "VisA example", + "image_url": "showcase/images/def5b9b862a447ac8c61e168af28c263.jpg", + "heatmap_url": "showcase/images/def5b9b862a447ac8c61e168af28c263_heatmap.jpg" + }, + { + "id": "6f8af69aa59d40b488d5d864f502224d", + "created_at": "2026-11-07T04:31:08.773329+00:00", + "category": "cashew", + "verdict": "Uncertain", + "score": 0.10972827672958374, + "threshold": 0.10727595388889313, + "uncertainty_margin": 0.005363797694444657, + "inference_ms": 38.08, + "model_id": "dinov2-tuned-cashew-v1", + "batch": "Verified VisA examples", + "filename": "VisA example", + "image_url": "showcase/images/6f8af69aa59d40b488d5d864f502224d.jpg", + "heatmap_url": "showcase/images/6f8af69aa59d40b488d5d864f502224d_heatmap.jpg" + }, + { + "id": "7a353aa7a8124a0dbe8440f40c282ff4", + "created_at": "2026-11-07T04:31:09.609936+00:00", + "category": "chewinggum", + "verdict": "Anomalous", + "score": 0.33751875162124634, + "threshold": 0.11576281487941742, + "uncertainty_margin": 0.005788140743970872, + "inference_ms": 34.15, + "model_id": "dinov2-tuned-chewinggum-v1", + "batch": "Verified VisA examples", + "filename": "VisA example", + "image_url": "showcase/images/7a353aa7a8124a0dbe8440f40c282ff4.jpg", + "heatmap_url": "showcase/images/7a353aa7a8124a0dbe8440f40c282ff4_heatmap.jpg" + }, + { + "id": "fed8c208317840b2a0c6bea6f404bbc8", + "created_at": "2026-11-07T04:31:09.756854+00:00", + "category": "chewinggum", + "verdict": "Uncertain", + "score": 0.12110640108585358, + "threshold": 0.11576281487941742, + "uncertainty_margin": 0.005788140743970872, + "inference_ms": 40.44, + "model_id": "dinov2-tuned-chewinggum-v1", + "batch": "Verified VisA examples", + "filename": "VisA example", + "image_url": "showcase/images/fed8c208317840b2a0c6bea6f404bbc8.jpg", + "heatmap_url": "showcase/images/fed8c208317840b2a0c6bea6f404bbc8_heatmap.jpg" + }, + { + "id": "d0aa478ff7b24b86804abfde6689f2d5", + "created_at": "2026-11-07T04:31:10.112489+00:00", + "category": "fryum", + "verdict": "Anomalous", + "score": 0.22371983528137207, + "threshold": 0.10525055527687072, + "uncertainty_margin": 0.0052625277638435365, + "inference_ms": 44.82, + "model_id": "dinov2-tuned-fryum-v1", + "batch": "Verified VisA examples", + "filename": "VisA example", + "image_url": "showcase/images/d0aa478ff7b24b86804abfde6689f2d5.jpg", + "heatmap_url": "showcase/images/d0aa478ff7b24b86804abfde6689f2d5_heatmap.jpg" + }, + { + "id": "73effc650ddc4de9a1a8a35aa011c71b", + "created_at": "2026-11-07T04:31:10.242888+00:00", + "category": "fryum", + "verdict": "Good", + "score": 0.0773605927824974, + "threshold": 0.10525055527687072, + "uncertainty_margin": 0.0052625277638435365, + "inference_ms": 42.76, + "model_id": "dinov2-tuned-fryum-v1", + "batch": "Verified VisA examples", + "filename": "VisA example", + "image_url": "showcase/images/73effc650ddc4de9a1a8a35aa011c71b.jpg", + "heatmap_url": "showcase/images/73effc650ddc4de9a1a8a35aa011c71b_heatmap.jpg" + }, + { + "id": "031ddcf70ba240dd98baf8932b418b12", + "created_at": "2026-11-07T04:31:10.562390+00:00", + "category": "macaroni1", + "verdict": "Anomalous", + "score": 0.12035106867551804, + "threshold": 0.0831331416964531, + "uncertainty_margin": 0.004156657084822655, + "inference_ms": 37.09, + "model_id": "dinov2-tuned-macaroni1-v1", + "batch": "Verified VisA examples", + "filename": "VisA example", + "image_url": "showcase/images/031ddcf70ba240dd98baf8932b418b12.jpg", + "heatmap_url": "showcase/images/031ddcf70ba240dd98baf8932b418b12_heatmap.jpg" + }, + { + "id": "99e5aca39a094033b059ed2ece1e4c7a", + "created_at": "2026-11-07T04:31:10.669601+00:00", + "category": "macaroni1", + "verdict": "Anomalous", + "score": 0.09371042251586914, + "threshold": 0.0831331416964531, + "uncertainty_margin": 0.004156657084822655, + "inference_ms": 34.75, + "model_id": "dinov2-tuned-macaroni1-v1", + "batch": "Verified VisA examples", + "filename": "VisA example", + "image_url": "showcase/images/99e5aca39a094033b059ed2ece1e4c7a.jpg", + "heatmap_url": "showcase/images/99e5aca39a094033b059ed2ece1e4c7a_heatmap.jpg" + }, + { + "id": "e80a1c06812b46858fe77c8dcba49e0d", + "created_at": "2026-11-07T04:31:10.971729+00:00", + "category": "macaroni2", + "verdict": "Anomalous", + "score": 0.12074433267116547, + "threshold": 0.09993447512388229, + "uncertainty_margin": 0.004996723756194115, + "inference_ms": 35.36, + "model_id": "dinov2-tuned-macaroni2-v1", + "batch": "Verified VisA examples", + "filename": "VisA example", + "image_url": "showcase/images/e80a1c06812b46858fe77c8dcba49e0d.jpg", + "heatmap_url": "showcase/images/e80a1c06812b46858fe77c8dcba49e0d_heatmap.jpg" + }, + { + "id": "f844a1e1a3c84cb7883c22af86f37dd2", + "created_at": "2026-11-07T04:31:11.103005+00:00", + "category": "macaroni2", + "verdict": "Good", + "score": 0.0933448076248169, + "threshold": 0.09993447512388229, + "uncertainty_margin": 0.004996723756194115, + "inference_ms": 41.66, + "model_id": "dinov2-tuned-macaroni2-v1", + "batch": "Verified VisA examples", + "filename": "VisA example", + "image_url": "showcase/images/f844a1e1a3c84cb7883c22af86f37dd2.jpg", + "heatmap_url": "showcase/images/f844a1e1a3c84cb7883c22af86f37dd2_heatmap.jpg" + }, + { + "id": "ccaaa807f4834da8b402ca8b46073342", + "created_at": "2026-11-07T04:31:07.483820+00:00", + "category": "pcb1", + "verdict": "Anomalous", + "score": 0.2655112147331238, + "threshold": 0.09390439838171005, + "uncertainty_margin": 0.004695219919085503, + "inference_ms": 757.05, + "model_id": "dinov2-tuned-pcb1-v1", + "batch": "Verified VisA examples", + "filename": "VisA example", + "image_url": "showcase/images/ccaaa807f4834da8b402ca8b46073342.jpg", + "heatmap_url": "showcase/images/ccaaa807f4834da8b402ca8b46073342_heatmap.jpg" + }, + { + "id": "1c68ef87cd4b4e10a7efab1b5107d59b", + "created_at": "2026-11-07T04:31:07.690368+00:00", + "category": "pcb1", + "verdict": "Good", + "score": 0.06865152716636658, + "threshold": 0.09390439838171005, + "uncertainty_margin": 0.004695219919085503, + "inference_ms": 39.86, + "model_id": "dinov2-tuned-pcb1-v1", + "batch": "Verified VisA examples", + "filename": "VisA example", + "image_url": "showcase/images/1c68ef87cd4b4e10a7efab1b5107d59b.jpg", + "heatmap_url": "showcase/images/1c68ef87cd4b4e10a7efab1b5107d59b_heatmap.jpg" + }, + { + "id": "861bd29ac3e34efc89c18aad4befcb0a", + "created_at": "2026-11-07T04:31:11.444917+00:00", + "category": "pcb2", + "verdict": "Good", + "score": 0.08604340255260468, + "threshold": 0.09243721514940262, + "uncertainty_margin": 0.004621860757470131, + "inference_ms": 33.85, + "model_id": "dinov2-tuned-pcb2-v1", + "batch": "Verified VisA examples", + "filename": "VisA example", + "image_url": "showcase/images/861bd29ac3e34efc89c18aad4befcb0a.jpg", + "heatmap_url": "showcase/images/861bd29ac3e34efc89c18aad4befcb0a_heatmap.jpg" + }, + { + "id": "24610e481ba14990be2b059b435ec8d1", + "created_at": "2026-11-07T04:31:11.590072+00:00", + "category": "pcb2", + "verdict": "Anomalous", + "score": 0.10201622545719147, + "threshold": 0.09243721514940262, + "uncertainty_margin": 0.004621860757470131, + "inference_ms": 43.52, + "model_id": "dinov2-tuned-pcb2-v1", + "batch": "Verified VisA examples", + "filename": "VisA example", + "image_url": "showcase/images/24610e481ba14990be2b059b435ec8d1.jpg", + "heatmap_url": "showcase/images/24610e481ba14990be2b059b435ec8d1_heatmap.jpg" + }, + { + "id": "944d0897857e443b96ab5e30747cef96", + "created_at": "2026-11-07T04:31:11.945912+00:00", + "category": "pcb3", + "verdict": "Anomalous", + "score": 0.15217359364032745, + "threshold": 0.09173599630594254, + "uncertainty_margin": 0.004586799815297127, + "inference_ms": 50.4, + "model_id": "dinov2-tuned-pcb3-v1", + "batch": "Verified VisA examples", + "filename": "VisA example", + "image_url": "showcase/images/944d0897857e443b96ab5e30747cef96.jpg", + "heatmap_url": "showcase/images/944d0897857e443b96ab5e30747cef96_heatmap.jpg" + }, + { + "id": "27606216a5324123becd9271a9044576", + "created_at": "2026-11-07T04:31:12.075083+00:00", + "category": "pcb3", + "verdict": "Good", + "score": 0.08433570712804794, + "threshold": 0.09173599630594254, + "uncertainty_margin": 0.004586799815297127, + "inference_ms": 36.61, + "model_id": "dinov2-tuned-pcb3-v1", + "batch": "Verified VisA examples", + "filename": "VisA example", + "image_url": "showcase/images/27606216a5324123becd9271a9044576.jpg", + "heatmap_url": "showcase/images/27606216a5324123becd9271a9044576_heatmap.jpg" + }, + { + "id": "9b95eb77b39b403bb68311b0cc1a7174", + "created_at": "2026-11-07T04:31:12.406282+00:00", + "category": "pcb4", + "verdict": "Anomalous", + "score": 0.2023768424987793, + "threshold": 0.1058717742562294, + "uncertainty_margin": 0.0052935887128114706, + "inference_ms": 43.08, + "model_id": "dinov2-tuned-pcb4-v1", + "batch": "Verified VisA examples", + "filename": "VisA example", + "image_url": "showcase/images/9b95eb77b39b403bb68311b0cc1a7174.jpg", + "heatmap_url": "showcase/images/9b95eb77b39b403bb68311b0cc1a7174_heatmap.jpg" + }, + { + "id": "57cbced2975740d2b7845b1660aad8b6", + "created_at": "2026-11-07T04:31:12.523405+00:00", + "category": "pcb4", + "verdict": "Good", + "score": 0.07028265297412872, + "threshold": 0.1058717742562294, + "uncertainty_margin": 0.0052935887128114706, + "inference_ms": 35.66, + "model_id": "dinov2-tuned-pcb4-v1", + "batch": "Verified VisA examples", + "filename": "VisA example", + "image_url": "showcase/images/57cbced2975740d2b7845b1660aad8b6.jpg", + "heatmap_url": "showcase/images/57cbced2975740d2b7845b1660aad8b6_heatmap.jpg" + }, + { + "id": "1213d696bd724a2e9d4ad4af04bda78c", + "created_at": "2026-11-07T04:31:12.870079+00:00", + "category": "pipe_fryum", + "verdict": "Anomalous", + "score": 0.38307350873947144, + "threshold": 0.14284870028495786, + "uncertainty_margin": 0.007142435014247894, + "inference_ms": 53.19, + "model_id": "dinov2-tuned-pipe_fryum-v1", + "batch": "Verified VisA examples", + "filename": "VisA example", + "image_url": "showcase/images/1213d696bd724a2e9d4ad4af04bda78c.jpg", + "heatmap_url": "showcase/images/1213d696bd724a2e9d4ad4af04bda78c_heatmap.jpg" + }, + { + "id": "f92d581f4bc64724b9f3fffb8e38f709", + "created_at": "2026-11-07T04:31:13.005067+00:00", + "category": "pipe_fryum", + "verdict": "Good", + "score": 0.11506223678588867, + "threshold": 0.14284870028495786, + "uncertainty_margin": 0.007142435014247894, + "inference_ms": 38.44, + "model_id": "dinov2-tuned-pipe_fryum-v1", + "batch": "Verified VisA examples", + "filename": "VisA example", + "image_url": "showcase/images/f92d581f4bc64724b9f3fffb8e38f709.jpg", + "heatmap_url": "showcase/images/f92d581f4bc64724b9f3fffb8e38f709_heatmap.jpg" + } + ], + "samples": [ + { + "name": "candle_anomalous", + "category": "candle", + "record_id": "4bff5e6b5e064383a9b85a8a6bec04cc", + "url": "showcase/images/4bff5e6b5e064383a9b85a8a6bec04cc.jpg", + "attribution": "VisA \u00b7 Zou et al., ECCV 2022 \u00b7 CC BY 4.0" + }, + { + "name": "candle_good", + "category": "candle", + "record_id": "da5e3a7125564152afd03d26ef3fb38b", + "url": "showcase/images/da5e3a7125564152afd03d26ef3fb38b.jpg", + "attribution": "VisA \u00b7 Zou et al., ECCV 2022 \u00b7 CC BY 4.0" + }, + { + "name": "capsules_anomalous", + "category": "capsules", + "record_id": "66ab22d8050144f78e9b9c1b4c7b0b9e", + "url": "showcase/images/66ab22d8050144f78e9b9c1b4c7b0b9e.jpg", + "attribution": "VisA \u00b7 Zou et al., ECCV 2022 \u00b7 CC BY 4.0" + }, + { + "name": "capsules_good", + "category": "capsules", + "record_id": "da28cabe417a4f7f9d81faa0b6ce4146", + "url": "showcase/images/da28cabe417a4f7f9d81faa0b6ce4146.jpg", + "attribution": "VisA \u00b7 Zou et al., ECCV 2022 \u00b7 CC BY 4.0" + }, + { + "name": "cashew_anomalous", + "category": "cashew", + "record_id": "def5b9b862a447ac8c61e168af28c263", + "url": "showcase/images/def5b9b862a447ac8c61e168af28c263.jpg", + "attribution": "VisA \u00b7 Zou et al., ECCV 2022 \u00b7 CC BY 4.0" + }, + { + "name": "cashew_good", + "category": "cashew", + "record_id": "6f8af69aa59d40b488d5d864f502224d", + "url": "showcase/images/6f8af69aa59d40b488d5d864f502224d.jpg", + "attribution": "VisA \u00b7 Zou et al., ECCV 2022 \u00b7 CC BY 4.0" + }, + { + "name": "chewinggum_anomalous", + "category": "chewinggum", + "record_id": "7a353aa7a8124a0dbe8440f40c282ff4", + "url": "showcase/images/7a353aa7a8124a0dbe8440f40c282ff4.jpg", + "attribution": "VisA \u00b7 Zou et al., ECCV 2022 \u00b7 CC BY 4.0" + }, + { + "name": "chewinggum_good", + "category": "chewinggum", + "record_id": "fed8c208317840b2a0c6bea6f404bbc8", + "url": "showcase/images/fed8c208317840b2a0c6bea6f404bbc8.jpg", + "attribution": "VisA \u00b7 Zou et al., ECCV 2022 \u00b7 CC BY 4.0" + }, + { + "name": "fryum_anomalous", + "category": "fryum", + "record_id": "d0aa478ff7b24b86804abfde6689f2d5", + "url": "showcase/images/d0aa478ff7b24b86804abfde6689f2d5.jpg", + "attribution": "VisA \u00b7 Zou et al., ECCV 2022 \u00b7 CC BY 4.0" + }, + { + "name": "fryum_good", + "category": "fryum", + "record_id": "73effc650ddc4de9a1a8a35aa011c71b", + "url": "showcase/images/73effc650ddc4de9a1a8a35aa011c71b.jpg", + "attribution": "VisA \u00b7 Zou et al., ECCV 2022 \u00b7 CC BY 4.0" + }, + { + "name": "macaroni1_anomalous", + "category": "macaroni1", + "record_id": "031ddcf70ba240dd98baf8932b418b12", + "url": "showcase/images/031ddcf70ba240dd98baf8932b418b12.jpg", + "attribution": "VisA \u00b7 Zou et al., ECCV 2022 \u00b7 CC BY 4.0" + }, + { + "name": "macaroni1_good", + "category": "macaroni1", + "record_id": "99e5aca39a094033b059ed2ece1e4c7a", + "url": "showcase/images/99e5aca39a094033b059ed2ece1e4c7a.jpg", + "attribution": "VisA \u00b7 Zou et al., ECCV 2022 \u00b7 CC BY 4.0" + }, + { + "name": "macaroni2_anomalous", + "category": "macaroni2", + "record_id": "e80a1c06812b46858fe77c8dcba49e0d", + "url": "showcase/images/e80a1c06812b46858fe77c8dcba49e0d.jpg", + "attribution": "VisA \u00b7 Zou et al., ECCV 2022 \u00b7 CC BY 4.0" + }, + { + "name": "macaroni2_good", + "category": "macaroni2", + "record_id": "f844a1e1a3c84cb7883c22af86f37dd2", + "url": "showcase/images/f844a1e1a3c84cb7883c22af86f37dd2.jpg", + "attribution": "VisA \u00b7 Zou et al., ECCV 2022 \u00b7 CC BY 4.0" + }, + { + "name": "pcb1_anomalous", + "category": "pcb1", + "record_id": "ccaaa807f4834da8b402ca8b46073342", + "url": "showcase/images/ccaaa807f4834da8b402ca8b46073342.jpg", + "attribution": "VisA \u00b7 Zou et al., ECCV 2022 \u00b7 CC BY 4.0" + }, + { + "name": "pcb1_good", + "category": "pcb1", + "record_id": "1c68ef87cd4b4e10a7efab1b5107d59b", + "url": "showcase/images/1c68ef87cd4b4e10a7efab1b5107d59b.jpg", + "attribution": "VisA \u00b7 Zou et al., ECCV 2022 \u00b7 CC BY 4.0" + }, + { + "name": "pcb2_anomalous", + "category": "pcb2", + "record_id": "861bd29ac3e34efc89c18aad4befcb0a", + "url": "showcase/images/861bd29ac3e34efc89c18aad4befcb0a.jpg", + "attribution": "VisA \u00b7 Zou et al., ECCV 2022 \u00b7 CC BY 4.0" + }, + { + "name": "pcb2_good", + "category": "pcb2", + "record_id": "24610e481ba14990be2b059b435ec8d1", + "url": "showcase/images/24610e481ba14990be2b059b435ec8d1.jpg", + "attribution": "VisA \u00b7 Zou et al., ECCV 2022 \u00b7 CC BY 4.0" + }, + { + "name": "pcb3_anomalous", + "category": "pcb3", + "record_id": "944d0897857e443b96ab5e30747cef96", + "url": "showcase/images/944d0897857e443b96ab5e30747cef96.jpg", + "attribution": "VisA \u00b7 Zou et al., ECCV 2022 \u00b7 CC BY 4.0" + }, + { + "name": "pcb3_good", + "category": "pcb3", + "record_id": "27606216a5324123becd9271a9044576", + "url": "showcase/images/27606216a5324123becd9271a9044576.jpg", + "attribution": "VisA \u00b7 Zou et al., ECCV 2022 \u00b7 CC BY 4.0" + }, + { + "name": "pcb4_anomalous", + "category": "pcb4", + "record_id": "9b95eb77b39b403bb68311b0cc1a7174", + "url": "showcase/images/9b95eb77b39b403bb68311b0cc1a7174.jpg", + "attribution": "VisA \u00b7 Zou et al., ECCV 2022 \u00b7 CC BY 4.0" + }, + { + "name": "pcb4_good", + "category": "pcb4", + "record_id": "57cbced2975740d2b7845b1660aad8b6", + "url": "showcase/images/57cbced2975740d2b7845b1660aad8b6.jpg", + "attribution": "VisA \u00b7 Zou et al., ECCV 2022 \u00b7 CC BY 4.0" + }, + { + "name": "pipe_fryum_anomalous", + "category": "pipe_fryum", + "record_id": "1213d696bd724a2e9d4ad4af04bda78c", + "url": "showcase/images/1213d696bd724a2e9d4ad4af04bda78c.jpg", + "attribution": "VisA \u00b7 Zou et al., ECCV 2022 \u00b7 CC BY 4.0" + }, + { + "name": "pipe_fryum_good", + "category": "pipe_fryum", + "record_id": "f92d581f4bc64724b9f3fffb8e38f709", + "url": "showcase/images/f92d581f4bc64724b9f3fffb8e38f709.jpg", + "attribution": "VisA \u00b7 Zou et al., ECCV 2022 \u00b7 CC BY 4.0" + } + ], + "messages": { + "4bff5e6b5e064383a9b85a8a6bec04cc": [], + "da5e3a7125564152afd03d26ef3fb38b": [], + "66ab22d8050144f78e9b9c1b4c7b0b9e": [], + "da28cabe417a4f7f9d81faa0b6ce4146": [], + "def5b9b862a447ac8c61e168af28c263": [], + "6f8af69aa59d40b488d5d864f502224d": [], + "7a353aa7a8124a0dbe8440f40c282ff4": [], + "fed8c208317840b2a0c6bea6f404bbc8": [], + "d0aa478ff7b24b86804abfde6689f2d5": [], + "73effc650ddc4de9a1a8a35aa011c71b": [], + "031ddcf70ba240dd98baf8932b418b12": [], + "99e5aca39a094033b059ed2ece1e4c7a": [], + "e80a1c06812b46858fe77c8dcba49e0d": [], + "f844a1e1a3c84cb7883c22af86f37dd2": [], + "ccaaa807f4834da8b402ca8b46073342": [], + "1c68ef87cd4b4e10a7efab1b5107d59b": [], + "861bd29ac3e34efc89c18aad4befcb0a": [], + "24610e481ba14990be2b059b435ec8d1": [], + "944d0897857e443b96ab5e30747cef96": [], + "27606216a5324123becd9271a9044576": [], + "9b95eb77b39b403bb68311b0cc1a7174": [], + "57cbced2975740d2b7845b1660aad8b6": [], + "1213d696bd724a2e9d4ad4af04bda78c": [], + "f92d581f4bc64724b9f3fffb8e38f709": [] + }, + "evaluation": { + "method": "AnomalyDINO-inspired DINOv2 ViT-S/14 fine-tuned on synthetic defects; 32,768-patch coreset memory", + "profile": "dinov2_tuned_v1", + "protocol": "Official VisA test assignments. The DINOv2 encoder was fine-tuned on synthetic defects made from normal training images (last 4 blocks only). The memory bank is a 32,768-patch coreset of normal-image patches per product. Thresholds are the 95th percentile of held-out normal scores, the same rule for every product; held-out normals are never used to build the memory. Retrospective development evaluation on test images that were seen during development; not an untouched external test.", + "encoder_sha256": "95ac11984ecae1bb14e9a0d98e85650e73365fc3d57ed49c6bfa526e0498adcb", + "device": "cuda", + "categories": { + "pcb1": { + "category": "pcb1", + "available": true, + "model_id": "dinov2-tuned-pcb1-v1", + "method": "AnomalyDINO-inspired DINOv2 ViT-S/14 fine-tuned on synthetic defects; 32,768-patch coreset memory", + "profile": "dinov2_tuned_v1", + "encoder_sha256": "95ac11984ecae1bb14e9a0d98e85650e73365fc3d57ed49c6bfa526e0498adcb", + "bank_sha256": "282ebe91a413a4c66a1f997552867a14a86c8c284100038c5445295184a4f5fd", + "threshold": 0.09390439838171005, + "uncertainty_margin": 0.004695219919085503, + "heatmap_scale": 0.07119274705648429, + "uncertainty_policy": "Fixed \u00b15% of threshold; operational heuristic, not calibrated confidence", + "bank_size_bytes": 23249131, + "encoder_size_bytes": 44136744, + "calibration": { + "method": "Fixed linear 95th percentile of heldout normal scores; no anomalous calibration", + "normal": 91, + "anomalous": 0, + "seed": 42, + "policy": "tuned-normal-quantile-v1", + "quantile": 0.95, + "calibration_above_threshold": 5, + "future_false_positive_rate_guaranteed": false + }, + "train_normal_count": 813, + "metrics": { + "image_auroc": 0.9788, + "average_precision": 0.976301821637879, + "precision": 0.912621359223301, + "recall": 0.94, + "f1": 0.9261083743842364, + "false_positive_rate": 0.09, + "confusion_matrix": [ + [ + 91, + 9 + ], + [ + 6, + 94 + ] + ], + "n_images": 200, + "pixel_auroc_224": 0.9948781306534351, + "pixel_average_precision_224": 0.8829297562485579, + "uncertain_fraction": 0.055, + "latency_median_ms": null, + "peak_gpu_mb": null + }, + "resolution_short_edge": 448, + "patch_size": 14, + "foreground": "Unsupervised PCA threshold/sign heuristic; can fail", + "decision_policy": "tuned-normal-quantile-v1" + }, + "capsules": { + "category": "capsules", + "available": true, + "model_id": "dinov2-tuned-capsules-v1", + "method": "AnomalyDINO-inspired DINOv2 ViT-S/14 fine-tuned on synthetic defects; 32,768-patch coreset memory", + "profile": "dinov2_tuned_v1", + "encoder_sha256": "95ac11984ecae1bb14e9a0d98e85650e73365fc3d57ed49c6bfa526e0498adcb", + "bank_sha256": "f3d63549328eb250a5dda32a78e03e9f16b9537d38a5fa58c83e2defc97defde", + "threshold": 0.10395566150546073, + "uncertainty_margin": 0.005197783075273037, + "heatmap_scale": 0.09393790721893303, + "uncertainty_policy": "Fixed \u00b15% of threshold; operational heuristic, not calibrated confidence", + "bank_size_bytes": 23255377, + "encoder_size_bytes": 44136744, + "calibration": { + "method": "Fixed linear 95th percentile of heldout normal scores; no anomalous calibration", + "normal": 55, + "anomalous": 0, + "seed": 42, + "policy": "tuned-normal-quantile-v1", + "quantile": 0.95, + "calibration_above_threshold": 3, + "future_false_positive_rate_guaranteed": false + }, + "train_normal_count": 487, + "metrics": { + "image_auroc": 0.9778333333333333, + "average_precision": 0.9833586325787514, + "precision": 0.96, + "recall": 0.96, + "f1": 0.96, + "false_positive_rate": 0.06666666666666667, + "confusion_matrix": [ + [ + 56, + 4 + ], + [ + 4, + 96 + ] + ], + "n_images": 160, + "pixel_auroc_224": 0.9778261035822543, + "pixel_average_precision_224": 0.5149128125633966, + "uncertain_fraction": 0.0875, + "latency_median_ms": null, + "peak_gpu_mb": null + }, + "resolution_short_edge": 448, + "patch_size": 14, + "foreground": "Unsupervised PCA threshold/sign heuristic; can fail", + "decision_policy": "tuned-normal-quantile-v1" + }, + "cashew": { + "category": "cashew", + "available": true, + "model_id": "dinov2-tuned-cashew-v1", + "method": "AnomalyDINO-inspired DINOv2 ViT-S/14 fine-tuned on synthetic defects; 32,768-patch coreset memory", + "profile": "dinov2_tuned_v1", + "encoder_sha256": "95ac11984ecae1bb14e9a0d98e85650e73365fc3d57ed49c6bfa526e0498adcb", + "bank_sha256": "848a79463a73d9682bffbf7d397faea9bb74495146ea48a037bf2ebf4f4ed3f2", + "threshold": 0.10727595388889313, + "uncertainty_margin": 0.005363797694444657, + "heatmap_scale": 0.08695902496576309, + "uncertainty_policy": "Fixed \u00b15% of threshold; operational heuristic, not calibrated confidence", + "bank_size_bytes": 23238560, + "encoder_size_bytes": 44136744, + "calibration": { + "method": "Fixed linear 95th percentile of heldout normal scores; no anomalous calibration", + "normal": 45, + "anomalous": 0, + "seed": 42, + "policy": "tuned-normal-quantile-v1", + "quantile": 0.95, + "calibration_above_threshold": 3, + "future_false_positive_rate_guaranteed": false + }, + "train_normal_count": 405, + "metrics": { + "image_auroc": 0.974, + "average_precision": 0.9879244189184127, + "precision": 0.9591836734693877, + "recall": 0.94, + "f1": 0.9494949494949495, + "false_positive_rate": 0.08, + "confusion_matrix": [ + [ + 46, + 4 + ], + [ + 6, + 94 + ] + ], + "n_images": 150, + "pixel_auroc_224": 0.9968688031074235, + "pixel_average_precision_224": 0.7388969040994572, + "uncertain_fraction": 0.10666666666666667, + "latency_median_ms": null, + "peak_gpu_mb": null + }, + "resolution_short_edge": 448, + "patch_size": 14, + "foreground": "Unsupervised PCA threshold/sign heuristic; can fail", + "decision_policy": "tuned-normal-quantile-v1" + }, + "candle": { + "category": "candle", + "available": true, + "model_id": "dinov2-tuned-candle-v1", + "method": "AnomalyDINO-inspired DINOv2 ViT-S/14 fine-tuned on synthetic defects; 32,768-patch coreset memory", + "profile": "dinov2_tuned_v1", + "encoder_sha256": "95ac11984ecae1bb14e9a0d98e85650e73365fc3d57ed49c6bfa526e0498adcb", + "bank_sha256": "12775563ee1c641a96e03c92aafaa52594b8a5adf7d5b58934b64ece6cf7f824", + "threshold": 0.10769653692841528, + "uncertainty_margin": 0.005384826846420765, + "heatmap_scale": 0.08101917594671243, + "uncertainty_policy": "Fixed \u00b15% of threshold; operational heuristic, not calibrated confidence", + "bank_size_bytes": 23248556, + "encoder_size_bytes": 44136744, + "calibration": { + "method": "Fixed linear 95th percentile of heldout normal scores; no anomalous calibration", + "normal": 90, + "anomalous": 0, + "seed": 42, + "policy": "tuned-normal-quantile-v1", + "quantile": 0.95, + "calibration_above_threshold": 5, + "future_false_positive_rate_guaranteed": false + }, + "train_normal_count": 810, + "metrics": { + "image_auroc": 0.9599, + "average_precision": 0.9635102573657932, + "precision": 0.9052631578947369, + "recall": 0.86, + "f1": 0.8820512820512821, + "false_positive_rate": 0.09, + "confusion_matrix": [ + [ + 91, + 9 + ], + [ + 14, + 86 + ] + ], + "n_images": 200, + "pixel_auroc_224": 0.9915738142390015, + "pixel_average_precision_224": 0.40608475735949057, + "uncertain_fraction": 0.035, + "latency_median_ms": null, + "peak_gpu_mb": null + }, + "resolution_short_edge": 448, + "patch_size": 14, + "foreground": "Unsupervised PCA threshold/sign heuristic; can fail", + "decision_policy": "tuned-normal-quantile-v1" + }, + "chewinggum": { + "category": "chewinggum", + "available": true, + "model_id": "dinov2-tuned-chewinggum-v1", + "method": "AnomalyDINO-inspired DINOv2 ViT-S/14 fine-tuned on synthetic defects; 32,768-patch coreset memory", + "profile": "dinov2_tuned_v1", + "encoder_sha256": "95ac11984ecae1bb14e9a0d98e85650e73365fc3d57ed49c6bfa526e0498adcb", + "bank_sha256": "c40c42e84c4cca85cf1a9e3e0316e41c7b7a6c29c7d959754a8fb9d709d232b8", + "threshold": 0.11576281487941742, + "uncertainty_margin": 0.005788140743970872, + "heatmap_scale": 0.09326122194528576, + "uncertainty_policy": "Fixed \u00b15% of threshold; operational heuristic, not calibrated confidence", + "bank_size_bytes": 23230985, + "encoder_size_bytes": 44136744, + "calibration": { + "method": "Fixed linear 95th percentile of heldout normal scores; no anomalous calibration", + "normal": 46, + "anomalous": 0, + "seed": 42, + "policy": "tuned-normal-quantile-v1", + "quantile": 0.95, + "calibration_above_threshold": 3, + "future_false_positive_rate_guaranteed": false + }, + "train_normal_count": 407, + "metrics": { + "image_auroc": 0.9916, + "average_precision": 0.9964316707632301, + "precision": 0.9696969696969697, + "recall": 0.96, + "f1": 0.964824120603015, + "false_positive_rate": 0.06, + "confusion_matrix": [ + [ + 47, + 3 + ], + [ + 4, + 96 + ] + ], + "n_images": 150, + "pixel_auroc_224": 0.9956113261527341, + "pixel_average_precision_224": 0.7341234993437673, + "uncertain_fraction": 0.02, + "latency_median_ms": null, + "peak_gpu_mb": null + }, + "resolution_short_edge": 448, + "patch_size": 14, + "foreground": "Unsupervised PCA threshold/sign heuristic; can fail", + "decision_policy": "tuned-normal-quantile-v1" + }, + "fryum": { + "category": "fryum", + "available": true, + "model_id": "dinov2-tuned-fryum-v1", + "method": "AnomalyDINO-inspired DINOv2 ViT-S/14 fine-tuned on synthetic defects; 32,768-patch coreset memory", + "profile": "dinov2_tuned_v1", + "encoder_sha256": "95ac11984ecae1bb14e9a0d98e85650e73365fc3d57ed49c6bfa526e0498adcb", + "bank_sha256": "a23e9ec257fc5b77bdf55cfa4c86ab11df8e6daee3b48223f8b094ed2106f64d", + "threshold": 0.10525055527687072, + "uncertainty_margin": 0.0052625277638435365, + "heatmap_scale": 0.07980967342853555, + "uncertainty_policy": "Fixed \u00b15% of threshold; operational heuristic, not calibrated confidence", + "bank_size_bytes": 23254817, + "encoder_size_bytes": 44136744, + "calibration": { + "method": "Fixed linear 95th percentile of heldout normal scores; no anomalous calibration", + "normal": 45, + "anomalous": 0, + "seed": 42, + "policy": "tuned-normal-quantile-v1", + "quantile": 0.95, + "calibration_above_threshold": 3, + "future_false_positive_rate_guaranteed": false + }, + "train_normal_count": 405, + "metrics": { + "image_auroc": 0.9902, + "average_precision": 0.9951603881086932, + "precision": 0.9795918367346939, + "recall": 0.96, + "f1": 0.9696969696969697, + "false_positive_rate": 0.04, + "confusion_matrix": [ + [ + 48, + 2 + ], + [ + 4, + 96 + ] + ], + "n_images": 150, + "pixel_auroc_224": 0.9809775229522469, + "pixel_average_precision_224": 0.4965360876901288, + "uncertain_fraction": 0.02, + "latency_median_ms": null, + "peak_gpu_mb": null + }, + "resolution_short_edge": 448, + "patch_size": 14, + "foreground": "Unsupervised PCA threshold/sign heuristic; can fail", + "decision_policy": "tuned-normal-quantile-v1" + }, + "macaroni1": { + "category": "macaroni1", + "available": true, + "model_id": "dinov2-tuned-macaroni1-v1", + "method": "AnomalyDINO-inspired DINOv2 ViT-S/14 fine-tuned on synthetic defects; 32,768-patch coreset memory", + "profile": "dinov2_tuned_v1", + "encoder_sha256": "95ac11984ecae1bb14e9a0d98e85650e73365fc3d57ed49c6bfa526e0498adcb", + "bank_sha256": "bb91183ddb84d8b0168988546c4186cf6de6512e4d72196a0a4b13fd9699d148", + "threshold": 0.09831828400492666, + "uncertainty_margin": 0.004915914200246334, + "heatmap_scale": 0.07764787554740862, + "uncertainty_policy": "Fixed \u00b15% of threshold; operational heuristic, not calibrated confidence", + "bank_size_bytes": 23276388, + "encoder_size_bytes": 44136744, + "calibration": { + "method": "Fixed linear 95th percentile of heldout normal scores; no anomalous calibration", + "normal": 90, + "anomalous": 0, + "seed": 42, + "policy": "tuned-normal-quantile-v1", + "quantile": 0.95, + "calibration_above_threshold": 5, + "future_false_positive_rate_guaranteed": false + }, + "train_normal_count": 810, + "metrics": { + "image_auroc": 0.9471999999999999, + "average_precision": 0.9581494503739729, + "precision": 0.9493670886075949, + "recall": 0.75, + "f1": 0.8379888268156425, + "false_positive_rate": 0.04, + "confusion_matrix": [ + [ + 96, + 4 + ], + [ + 25, + 75 + ] + ], + "n_images": 200, + "pixel_auroc_224": 0.9962604306654536, + "pixel_average_precision_224": 0.1985339563300542, + "uncertain_fraction": 0.08, + "latency_median_ms": null, + "peak_gpu_mb": null + }, + "resolution_short_edge": 448, + "patch_size": 14, + "foreground": "Unsupervised PCA threshold/sign heuristic; can fail", + "decision_policy": "tuned-normal-quantile-v1" + }, + "macaroni2": { + "category": "macaroni2", + "available": true, + "model_id": "dinov2-tuned-macaroni2-v1", + "method": "AnomalyDINO-inspired DINOv2 ViT-S/14 fine-tuned on synthetic defects; 32,768-patch coreset memory", + "profile": "dinov2_tuned_v1", + "encoder_sha256": "95ac11984ecae1bb14e9a0d98e85650e73365fc3d57ed49c6bfa526e0498adcb", + "bank_sha256": "565bf9acc0869b52f4ffd1f6a9d8d3c6500555fa8a5f501bdf4cefdcadc51ae5", + "threshold": 0.10864300690591334, + "uncertainty_margin": 0.005432150345295667, + "heatmap_scale": 0.09322665214538575, + "uncertainty_policy": "Fixed \u00b15% of threshold; operational heuristic, not calibrated confidence", + "bank_size_bytes": 23254139, + "encoder_size_bytes": 44136744, + "calibration": { + "method": "Fixed linear 95th percentile of heldout normal scores; no anomalous calibration", + "normal": 90, + "anomalous": 0, + "seed": 42, + "policy": "tuned-normal-quantile-v1", + "quantile": 0.95, + "calibration_above_threshold": 5, + "future_false_positive_rate_guaranteed": false + }, + "train_normal_count": 810, + "metrics": { + "image_auroc": 0.8969999999999999, + "average_precision": 0.9032903776564074, + "precision": 0.8902439024390244, + "recall": 0.73, + "f1": 0.8021978021978022, + "false_positive_rate": 0.09, + "confusion_matrix": [ + [ + 91, + 9 + ], + [ + 27, + 73 + ] + ], + "n_images": 200, + "pixel_auroc_224": 0.9940951618855306, + "pixel_average_precision_224": 0.16362726373735387, + "uncertain_fraction": 0.205, + "latency_median_ms": null, + "peak_gpu_mb": null + }, + "resolution_short_edge": 448, + "patch_size": 14, + "foreground": "Unsupervised PCA threshold/sign heuristic; can fail", + "decision_policy": "tuned-normal-quantile-v1" + }, + "pcb2": { + "category": "pcb2", + "available": true, + "model_id": "dinov2-tuned-pcb2-v1", + "method": "AnomalyDINO-inspired DINOv2 ViT-S/14 fine-tuned on synthetic defects; 32,768-patch coreset memory", + "profile": "dinov2_tuned_v1", + "encoder_sha256": "95ac11984ecae1bb14e9a0d98e85650e73365fc3d57ed49c6bfa526e0498adcb", + "bank_sha256": "38d1bb2b1ce04df367e16b276f77d1d9ef1abd3463bbcbc5ee5fca77edce5bed", + "threshold": 0.09243721514940262, + "uncertainty_margin": 0.004621860757470131, + "heatmap_scale": 0.07252105534076699, + "uncertainty_policy": "Fixed \u00b15% of threshold; operational heuristic, not calibrated confidence", + "bank_size_bytes": 23257659, + "encoder_size_bytes": 44136744, + "calibration": { + "method": "Fixed linear 95th percentile of heldout normal scores; no anomalous calibration", + "normal": 91, + "anomalous": 0, + "seed": 42, + "policy": "tuned-normal-quantile-v1", + "quantile": 0.95, + "calibration_above_threshold": 5, + "future_false_positive_rate_guaranteed": false + }, + "train_normal_count": 810, + "metrics": { + "image_auroc": 0.9575, + "average_precision": 0.9678848370579266, + "precision": 0.8969072164948454, + "recall": 0.87, + "f1": 0.883248730964467, + "false_positive_rate": 0.1, + "confusion_matrix": [ + [ + 90, + 10 + ], + [ + 13, + 87 + ] + ], + "n_images": 200, + "pixel_auroc_224": 0.9721937213482837, + "pixel_average_precision_224": 0.29801335589310723, + "uncertain_fraction": 0.035, + "latency_median_ms": null, + "peak_gpu_mb": null + }, + "resolution_short_edge": 448, + "patch_size": 14, + "foreground": "Unsupervised PCA threshold/sign heuristic; can fail", + "decision_policy": "tuned-normal-quantile-v1" + }, + "pcb3": { + "category": "pcb3", + "available": true, + "model_id": "dinov2-tuned-pcb3-v1", + "method": "AnomalyDINO-inspired DINOv2 ViT-S/14 fine-tuned on synthetic defects; 32,768-patch coreset memory", + "profile": "dinov2_tuned_v1", + "encoder_sha256": "95ac11984ecae1bb14e9a0d98e85650e73365fc3d57ed49c6bfa526e0498adcb", + "bank_sha256": "b786dfee5f10ab1953fe3807057ddbc57d6b9a85bc9e6b9236d6bc14796dcdfd", + "threshold": 0.09173599630594254, + "uncertainty_margin": 0.004586799815297127, + "heatmap_scale": 0.07605906963348377, + "uncertainty_policy": "Fixed \u00b15% of threshold; operational heuristic, not calibrated confidence", + "bank_size_bytes": 23258829, + "encoder_size_bytes": 44136744, + "calibration": { + "method": "Fixed linear 95th percentile of heldout normal scores; no anomalous calibration", + "normal": 91, + "anomalous": 0, + "seed": 42, + "policy": "tuned-normal-quantile-v1", + "quantile": 0.95, + "calibration_above_threshold": 5, + "future_false_positive_rate_guaranteed": false + }, + "train_normal_count": 814, + "metrics": { + "image_auroc": 0.9928712871287129, + "average_precision": 0.9935456634405582, + "precision": 0.8828828828828829, + "recall": 0.98, + "f1": 0.9289099526066351, + "false_positive_rate": 0.12871287128712872, + "confusion_matrix": [ + [ + 88, + 13 + ], + [ + 2, + 98 + ] + ], + "n_images": 201, + "pixel_auroc_224": 0.9801529756449681, + "pixel_average_precision_224": 0.31863648390631216, + "uncertain_fraction": 0.1044776119402985, + "latency_median_ms": null, + "peak_gpu_mb": null + }, + "resolution_short_edge": 448, + "patch_size": 14, + "foreground": "Unsupervised PCA threshold/sign heuristic; can fail", + "decision_policy": "tuned-normal-quantile-v1" + }, + "pcb4": { + "category": "pcb4", + "available": true, + "model_id": "dinov2-tuned-pcb4-v1", + "method": "AnomalyDINO-inspired DINOv2 ViT-S/14 fine-tuned on synthetic defects; 32,768-patch coreset memory", + "profile": "dinov2_tuned_v1", + "encoder_sha256": "95ac11984ecae1bb14e9a0d98e85650e73365fc3d57ed49c6bfa526e0498adcb", + "bank_sha256": "127c3c32277bb70544d134d6d3034ef03fc33d1c7e82e23c68f1adda63a7f64d", + "threshold": 0.1058717742562294, + "uncertainty_margin": 0.0052935887128114706, + "heatmap_scale": 0.07633256852626799, + "uncertainty_policy": "Fixed \u00b15% of threshold; operational heuristic, not calibrated confidence", + "bank_size_bytes": 23265594, + "encoder_size_bytes": 44136744, + "calibration": { + "method": "Fixed linear 95th percentile of heldout normal scores; no anomalous calibration", + "normal": 91, + "anomalous": 0, + "seed": 42, + "policy": "tuned-normal-quantile-v1", + "quantile": 0.95, + "calibration_above_threshold": 5, + "future_false_positive_rate_guaranteed": false + }, + "train_normal_count": 813, + "metrics": { + "image_auroc": 0.9953465346534653, + "average_precision": 0.9954175606404433, + "precision": 0.979381443298969, + "recall": 0.95, + "f1": 0.9644670050761421, + "false_positive_rate": 0.019801980198019802, + "confusion_matrix": [ + [ + 99, + 2 + ], + [ + 5, + 95 + ] + ], + "n_images": 201, + "pixel_auroc_224": 0.9832394042016657, + "pixel_average_precision_224": 0.37032673876297395, + "uncertain_fraction": 0.03980099502487562, + "latency_median_ms": null, + "peak_gpu_mb": null + }, + "resolution_short_edge": 448, + "patch_size": 14, + "foreground": "Unsupervised PCA threshold/sign heuristic; can fail", + "decision_policy": "tuned-normal-quantile-v1" + }, + "pipe_fryum": { + "category": "pipe_fryum", + "available": true, + "model_id": "dinov2-tuned-pipe_fryum-v1", + "method": "AnomalyDINO-inspired DINOv2 ViT-S/14 fine-tuned on synthetic defects; 32,768-patch coreset memory", + "profile": "dinov2_tuned_v1", + "encoder_sha256": "95ac11984ecae1bb14e9a0d98e85650e73365fc3d57ed49c6bfa526e0498adcb", + "bank_sha256": "4bcf8215c4380b2443185bf062b578772ad11b636af2fdd21e455db9898ab97d", + "threshold": 0.14284870028495786, + "uncertainty_margin": 0.007142435014247894, + "heatmap_scale": 0.1143493586778642, + "uncertainty_policy": "Fixed \u00b15% of threshold; operational heuristic, not calibrated confidence", + "bank_size_bytes": 23266873, + "encoder_size_bytes": 44136744, + "calibration": { + "method": "Fixed linear 95th percentile of heldout normal scores; no anomalous calibration", + "normal": 45, + "anomalous": 0, + "seed": 42, + "policy": "tuned-normal-quantile-v1", + "quantile": 0.95, + "calibration_above_threshold": 3, + "future_false_positive_rate_guaranteed": false + }, + "train_normal_count": 405, + "metrics": { + "image_auroc": 0.9905999999999999, + "average_precision": 0.9960775103939439, + "precision": 0.9801980198019802, + "recall": 0.99, + "f1": 0.9850746268656716, + "false_positive_rate": 0.04, + "confusion_matrix": [ + [ + 48, + 2 + ], + [ + 1, + 99 + ] + ], + "n_images": 150, + "pixel_auroc_224": 0.9929194372262363, + "pixel_average_precision_224": 0.4953619282653999, + "uncertain_fraction": 0.02666666666666667, + "latency_median_ms": null, + "peak_gpu_mb": null + }, + "resolution_short_edge": 448, + "patch_size": 14, + "foreground": "Unsupervised PCA threshold/sign heuristic; can fail", + "decision_policy": "tuned-normal-quantile-v1" + } + }, + "macro_mean": { + "image_auroc": 0.9710709295929593, + "average_precision": 0.9764210490780011, + "precision": 0.9387781292120323, + "recall": 0.9074999999999999, + "f1": 0.9211718867297343, + "false_positive_rate": 0.07043179317931793, + "pixel_auroc_224": 0.9880497359716026, + "pixel_average_precision_224": 0.46816529534999995 + }, + "decision_policy": "tuned-normal-quantile-v1", + "validation_scope": "Held-out-normal thresholds and cached-score/software consistency checks; future recall and false-alarm rates are not guaranteed.", + "policy_selection_context": "One rule for every product: the 95th percentile of held-out normal scores. The test images were already seen in development, so these figures are descriptive.", + "previous_profile": { + "profile": "dinov2_highres_v1", + "macro_mean": { + "image_auroc": 0.950126705170517, + "average_precision": 0.956391637511357, + "precision": 0.9046976613151382, + "recall": 0.8883333333333333, + "f1": 0.895741481363831, + "pixel_auroc_224": 0.9861669559777334, + "pixel_average_precision_224": 0.4315059138196397, + "false_positive_rate": 0.1110038503850385 + }, + "source": "results/macaroni_recall_deployment_evaluation.json" + }, + "source_sha256": { + "experiments/dinov2_tuned_v1/pcb1/normal_calibration.json": "10c8e8b0c908c6cd559f8c34c1bd2a98bd991f32f0a84b09d37929da28b668e1", + "experiments/dinov2_tuned_v1/pcb1/test_progress.json": "5042b54474dcb2981b18711b5067f5ec0857269f83d186adaaea98d7987e4ddf", + "experiments/dinov2_tuned_v1/pcb1/metrics.json": "8d3d286d4945336f592fbf43d6af193d8e0ecad34a441dda3e58df2a32e7d4e0", + "experiments/dinov2_tuned_v1/capsules/normal_calibration.json": "069e6dce404bf6ca6da6c5f6d6853249abdf358c5ba468da97a2b6ced3689435", + "experiments/dinov2_tuned_v1/capsules/test_progress.json": "29797dd9f4b34afc2cb3a66198556bf6e4f755fcb3039747be65e5dc1e51857f", + "experiments/dinov2_tuned_v1/capsules/metrics.json": "233ce88be282f97b2fdf7b505955fc4c013179bbcbe027d5d63d9f4cd01c4538", + "experiments/dinov2_tuned_v1/cashew/normal_calibration.json": "ab44aa627d5e696e6bb0f27c53ad9d83257f67e5d8bf910f5796348ab50d251b", + "experiments/dinov2_tuned_v1/cashew/test_progress.json": "91a59d1e78e061e9d7754cfa920dc7017becc0936cb9135de81eba2d0dbd6126", + "experiments/dinov2_tuned_v1/cashew/metrics.json": "b0e5891710bbc087a846ff4bc3beccef8d7117aa8bc59a8ab9e7da1574721c51", + "experiments/dinov2_tuned_v1/candle/normal_calibration.json": "bfd85bfb1e085557207ed2db7388d8f9585a3fa94919f4ebe9e4734bff327928", + "experiments/dinov2_tuned_v1/candle/test_progress.json": "62e43d4a28d2cc7938143fa3ebf5f24265839ae7f2bf26b5f769d35db4be9b2c", + "experiments/dinov2_tuned_v1/candle/metrics.json": "1f483ab0e7faf80c50b5f8529c497c28f3c12d107f7a05408b2380aab27988d4", + "experiments/dinov2_tuned_v1/chewinggum/normal_calibration.json": "da746616a0cfceadb46062511186ef2cc402b12a2d7fa963c700c5f5e5ced0df", + "experiments/dinov2_tuned_v1/chewinggum/test_progress.json": "62a198fe971cada66612e16d0ce17871a7ebd7ab0d3ce36ae411f8d4afbb1936", + "experiments/dinov2_tuned_v1/chewinggum/metrics.json": "1e15677b0e5ca97565c57ae406b262c0f7178127e8db07478060176d6fe8881e", + "experiments/dinov2_tuned_v1/fryum/normal_calibration.json": "49e63b58dd2a7ccfa83b151c5347788b210362371482fc54932559ca065f5c03", + "experiments/dinov2_tuned_v1/fryum/test_progress.json": "4a8f2794687e983101712d3871ac6ba9ed689e906f530690446b2922945bb396", + "experiments/dinov2_tuned_v1/fryum/metrics.json": "1c39f443abc82a27029d5aec34ac8ca5e4a44498548e081d37f3ca0507f8073d", + "experiments/dinov2_tuned_v1/macaroni1/normal_calibration.json": "4711f1c96e178d79a4d7d03376110e46aa9588ac291429a800f3a6ee8d49c8d7", + "experiments/dinov2_tuned_v1/macaroni1/test_progress.json": "b636712e32760784c12e7e70a40a51ae6f18cca98ce4d94eefcc02a2c1edd509", + "experiments/dinov2_tuned_v1/macaroni1/metrics.json": "41e88cde1e162f7cb7e211d81a7560ded4a1f4b73ef48acf3aa84a5eeb3e766e", + "experiments/dinov2_tuned_v1/macaroni2/normal_calibration.json": "22c1aed92c3c9b601403d729f8a80592f9eb69acfcaf07a93dcf21416dc5709c", + "experiments/dinov2_tuned_v1/macaroni2/test_progress.json": "2bebc24ed05c3c363d9e2e606057fada78aa15a8181d28a09637dd23126e2463", + "experiments/dinov2_tuned_v1/macaroni2/metrics.json": "50a5a7baeba6166ddeb29d948fec4ec4532ef060559325f129a36b993259399e", + "experiments/dinov2_tuned_v1/pcb2/normal_calibration.json": "6d9ff449a83da9e100c7568ba935e468c487500507dfb7b31c84d1007717603a", + "experiments/dinov2_tuned_v1/pcb2/test_progress.json": "3cb32aa588d96b4a1e2b294243e99d3b4557d0877ba4868e855f657e0182497a", + "experiments/dinov2_tuned_v1/pcb2/metrics.json": "63528c0f869c48ed4830690c3330bf3dc7819e2604ba322b9b39c819b23e14fb", + "experiments/dinov2_tuned_v1/pcb3/normal_calibration.json": "c3b89c0b0fefa69a2aa0db19648a0c0551a6398bf8dbf613552f2767c587a94d", + "experiments/dinov2_tuned_v1/pcb3/test_progress.json": "5dd08e213121be78e644e4f43b4759fbb069968c6210f8a4f37db75d9782cc48", + "experiments/dinov2_tuned_v1/pcb3/metrics.json": "2e843f4299a4692ed51f1a34305ab568802040b4fcdcffb75d8a21d360ad11c7", + "experiments/dinov2_tuned_v1/pcb4/normal_calibration.json": "6337ce99ec8066132db2880b813086514e1632b2b389f212dfa98f668067c077", + "experiments/dinov2_tuned_v1/pcb4/test_progress.json": "a4608213970da1d11fb8906ad1a341de21607f8ca1bdb5ccc55db9d9f91ca028", + "experiments/dinov2_tuned_v1/pcb4/metrics.json": "c59903eb2b66939818b2c3cff78adc4a55654cb72db8483b7fd9b6ac3328cc4d", + "experiments/dinov2_tuned_v1/pipe_fryum/normal_calibration.json": "df9dd61ff1ab75daa645d24b6202e5c52f56a4c943f8e8211acfd921cf5c485e", + "experiments/dinov2_tuned_v1/pipe_fryum/test_progress.json": "8054eb7789ad00a557de999fb198a288b901d97a3fd28aa318f6b2a35cd8792c", + "experiments/dinov2_tuned_v1/pipe_fryum/metrics.json": "670dfb6d1824accbd7d336dd16c7290ea9a3611c80d4ba28f3dec9dc214c5a52" + } + }, + "official_evaluation": { + "protocol": { + "schema": 1, + "dataset": "VisA official split_csv/1cls.csv", + "split_csv_sha256": "a48557e6033318cb90556f706196bc9d247a776a23ea51aecee5a80dd0332995", + "method": "Frozen DINOv3 ViT-S/16 + cosine nearest-normal patch memory; custom baseline, not Dinomaly", + "encoder_sha256": "4610ad75edef83e75afdebf162d148dc628045ea6cbb83d67d4708c709c4f91d", + "benchmark_seeds": [ + 42, + 43, + 44 + ], + "bank_patch_limit": 8192, + "image_score": "mean of highest 1% patch distances", + "pixel_evaluation_resolution": 224, + "pixel_metrics": "VisA reference 200-threshold AUROC/AU-PR; normal images included; AP separately", + "preprocessing": "bundled DINOv3 image processor, default 224 input; no augmentation or GT masks in features", + "benchmark": "all official training normals; all official test images; threshold-free ranking metrics", + "deployment": "seed42; 10% official training normals held out; threshold=max held-out normal score; no test anomalies used", + "prior_test_exposure": "retrospective benchmark: test images/results were seen in earlier modified-split experiments; no new test-driven tuning", + "selection_policy": "fixed before execution; all three seeds reported; no best-seed selection", + "sources": [ + "https://github.com/amazon-science/spot-diff", + "https://arxiv.org/html/2207.14315", + "https://raw.githubusercontent.com/amazon-science/spot-diff/main/utils/metrics.py" + ] + }, + "python": "3.12.4", + "torch": "2.8.0+cu126", + "device": "cuda", + "categories": { + "pcb1": { + "official_train_normals": 904, + "official_test_images": 200, + "benchmark_runs": [ + { + "seed": 42, + "auroc": 0.8823, + "au_pr": 0.8652156099418584, + "average_precision": 0.8662377386046971, + "pixel_auroc": 0.9843661984454277, + "pixel_au_pr": 0.7588138431092281, + "pixel_average_precision": 0.7588445707254726 + }, + { + "seed": 43, + "auroc": 0.8833, + "au_pr": 0.8478267819433369, + "average_precision": 0.8493502402186066, + "pixel_auroc": 0.9842690568703282, + "pixel_au_pr": 0.7560718748028801, + "pixel_average_precision": 0.7560583979602433 + }, + { + "seed": 44, + "auroc": 0.8729, + "au_pr": 0.8477510900503791, + "average_precision": 0.849157510741792, + "pixel_auroc": 0.9828381548165445, + "pixel_au_pr": 0.7602114521729626, + "pixel_average_precision": 0.7602556604913916 + } + ], + "benchmark_mean": { + "auroc": 0.8795000000000001, + "au_pr": 0.8535978273118582, + "average_precision": 0.8549151631883652, + "pixel_auroc": 0.9838244700441002, + "pixel_au_pr": 0.7583657233616902, + "pixel_average_precision": 0.7583862097257025 + }, + "benchmark_std": { + "auroc": 0.0057375953151123996, + "au_pr": 0.01006136607246337, + "average_precision": 0.009806111446781554, + "pixel_auroc": 0.0008555538659163021, + "pixel_au_pr": 0.002105856994628281, + "pixel_average_precision": 0.002135842759527955 + }, + "deployment_holdout_profile": { + "seed": 42, + "threshold": 0.08778351545333862, + "fit_normals": 813, + "validation_normals": 91, + "auroc": 0.8823, + "au_pr": 0.8689523679102507, + "average_precision": 0.8701001531382211, + "pixel_auroc": 0.9829881707996662, + "pixel_au_pr": 0.761096603150961, + "pixel_average_precision": 0.7610949764155934 + }, + "seconds": 112.7122111999779 + }, + "capsules": { + "official_train_normals": 542, + "official_test_images": 160, + "benchmark_runs": [ + { + "seed": 42, + "auroc": 0.8064999999999999, + "au_pr": 0.8883355238246444, + "average_precision": 0.8889946957168198, + "pixel_auroc": 0.9314791692599804, + "pixel_au_pr": 0.06111133849830806, + "pixel_average_precision": 0.06111931303510193 + }, + { + "seed": 43, + "auroc": 0.8116666666666668, + "au_pr": 0.892768815037886, + "average_precision": 0.8933734183457129, + "pixel_auroc": 0.9271496681356036, + "pixel_au_pr": 0.06392553683680963, + "pixel_average_precision": 0.06394387473959999 + }, + { + "seed": 44, + "auroc": 0.831, + "au_pr": 0.9045055504943371, + "average_precision": 0.905031503578954, + "pixel_auroc": 0.920030704594082, + "pixel_au_pr": 0.06036921760334449, + "pixel_average_precision": 0.060374057512393456 + } + ], + "benchmark_mean": { + "auroc": 0.8163888888888889, + "au_pr": 0.8952032964522892, + "average_precision": 0.8957998725471622, + "pixel_auroc": 0.9262198473298886, + "pixel_au_pr": 0.061802030979487395, + "pixel_average_precision": 0.06181241509569846 + }, + "benchmark_std": { + "auroc": 0.012914605570323747, + "au_pr": 0.008355385415553805, + "average_precision": 0.008289183409453001, + "pixel_auroc": 0.0057805934686359466, + "pixel_au_pr": 0.0018760713473231134, + "pixel_average_precision": 0.001883133454834655 + }, + "deployment_holdout_profile": { + "seed": 42, + "threshold": 0.06207504868507385, + "fit_normals": 487, + "validation_normals": 55, + "auroc": 0.8285000000000001, + "au_pr": 0.9036303626323163, + "average_precision": 0.9041775948115949, + "pixel_auroc": 0.925380309579376, + "pixel_au_pr": 0.06219526908416476, + "pixel_average_precision": 0.06220455484733658 + }, + "seconds": 73.66336999999476 + }, + "cashew": { + "official_train_normals": 450, + "official_test_images": 150, + "benchmark_runs": [ + { + "seed": 42, + "auroc": 0.9686, + "au_pr": 0.9855796182651859, + "average_precision": 0.9856470397867623, + "pixel_auroc": 0.9959214053889084, + "pixel_au_pr": 0.9063467359578445, + "pixel_average_precision": 0.906363611998445 + }, + { + "seed": 43, + "auroc": 0.9714, + "au_pr": 0.9864154003433409, + "average_precision": 0.9864809726384766, + "pixel_auroc": 0.9956851230701886, + "pixel_au_pr": 0.905553212306003, + "pixel_average_precision": 0.9055719630533584 + }, + { + "seed": 44, + "auroc": 0.9674, + "au_pr": 0.9847871536501108, + "average_precision": 0.9848592880970601, + "pixel_auroc": 0.9954262934889538, + "pixel_au_pr": 0.9028857900152283, + "pixel_average_precision": 0.9029448883372253 + } + ], + "benchmark_mean": { + "auroc": 0.9691333333333333, + "au_pr": 0.9855940574195459, + "average_precision": 0.985662433507433, + "pixel_auroc": 0.9956776073160168, + "pixel_au_pr": 0.9049285794263587, + "pixel_average_precision": 0.9049601544630095 + }, + "benchmark_std": { + "auroc": 0.0020526405757787585, + "au_pr": 0.0008142193748539785, + "average_precision": 0.0008109518561199027, + "pixel_auroc": 0.0002476415015495735, + "pixel_au_pr": 0.0018130530549814719, + "pixel_average_precision": 0.0017895949769051811 + }, + "deployment_holdout_profile": { + "seed": 42, + "threshold": 0.07112658023834229, + "fit_normals": 405, + "validation_normals": 45, + "auroc": 0.9718, + "au_pr": 0.9869784872730237, + "average_precision": 0.9870395707487909, + "pixel_auroc": 0.995439448532811, + "pixel_au_pr": 0.9041546127455985, + "pixel_average_precision": 0.9041673447497144 + }, + "seconds": 67.18520740000531 + }, + "candle": { + "official_train_normals": 900, + "official_test_images": 200, + "benchmark_runs": [ + { + "seed": 42, + "auroc": 0.9124, + "au_pr": 0.9067093867265235, + "average_precision": 0.907317577547275, + "pixel_auroc": 0.9791673272800795, + "pixel_au_pr": 0.19343705864597519, + "pixel_average_precision": 0.19350496168249026 + }, + { + "seed": 43, + "auroc": 0.9188, + "au_pr": 0.9183048196974375, + "average_precision": 0.9187591434503573, + "pixel_auroc": 0.979483321196079, + "pixel_au_pr": 0.18619068410380335, + "pixel_average_precision": 0.18625584865892192 + }, + { + "seed": 44, + "auroc": 0.9185, + "au_pr": 0.9149165895092746, + "average_precision": 0.9154818487384909, + "pixel_auroc": 0.9796341027948368, + "pixel_au_pr": 0.19655647956405858, + "pixel_average_precision": 0.1966224772020632 + } + ], + "benchmark_mean": { + "auroc": 0.9165666666666666, + "au_pr": 0.9133102653110785, + "average_precision": 0.9138528565787077, + "pixel_auroc": 0.979428250423665, + "pixel_au_pr": 0.19206140743794572, + "pixel_average_precision": 0.1921277625144918 + }, + "benchmark_std": { + "auroc": 0.0036115555282084802, + "au_pr": 0.005962275112574286, + "average_precision": 0.005892161672181073, + "pixel_auroc": 0.00023821091027684724, + "pixel_au_pr": 0.005318058016379355, + "pixel_average_precision": 0.005318764424104492 + }, + "deployment_holdout_profile": { + "seed": 42, + "threshold": 0.06003263592720032, + "fit_normals": 810, + "validation_normals": 90, + "auroc": 0.9321, + "au_pr": 0.9351585676489977, + "average_precision": 0.9355012345374768, + "pixel_auroc": 0.9798686015733775, + "pixel_au_pr": 0.19301852070736908, + "pixel_average_precision": 0.1931484756578974 + }, + "seconds": 113.62054019997595 + }, + "chewinggum": { + "official_train_normals": 453, + "official_test_images": 150, + "benchmark_runs": [ + { + "seed": 42, + "auroc": 0.9573999999999999, + "au_pr": 0.9830502868470744, + "average_precision": 0.9831192510451747, + "pixel_auroc": 0.9766855303849944, + "pixel_au_pr": 0.6299510587206012, + "pixel_average_precision": 0.629929382711634 + }, + { + "seed": 43, + "auroc": 0.9588, + "au_pr": 0.9845659784908927, + "average_precision": 0.9846248486924407, + "pixel_auroc": 0.9762049874185391, + "pixel_au_pr": 0.6251718689797755, + "pixel_average_precision": 0.6251574763557178 + }, + { + "seed": 44, + "auroc": 0.9668, + "au_pr": 0.9872811603159687, + "average_precision": 0.9873310764098553, + "pixel_auroc": 0.9754393718474601, + "pixel_au_pr": 0.628449413046543, + "pixel_average_precision": 0.6284537166295275 + } + ], + "benchmark_mean": { + "auroc": 0.961, + "au_pr": 0.984965808551312, + "average_precision": 0.9850250587158236, + "pixel_auroc": 0.9761099632169978, + "pixel_au_pr": 0.6278574469156398, + "pixel_average_precision": 0.6278468585656265 + }, + "benchmark_std": { + "auroc": 0.005071488933242415, + "au_pr": 0.0021435882616210435, + "average_precision": 0.0021342432552906732, + "pixel_auroc": 0.0006284902340739392, + "pixel_au_pr": 0.002443968406057183, + "pixel_average_precision": 0.0024431496269568974 + }, + "deployment_holdout_profile": { + "seed": 42, + "threshold": 0.05347451567649841, + "fit_normals": 407, + "validation_normals": 46, + "auroc": 0.9625999999999999, + "au_pr": 0.9854792314128331, + "average_precision": 0.9855370573897992, + "pixel_auroc": 0.9759074141352108, + "pixel_au_pr": 0.6277173455397616, + "pixel_average_precision": 0.6277079537238726 + }, + "seconds": 66.73736349999672 + }, + "fryum": { + "official_train_normals": 450, + "official_test_images": 150, + "benchmark_runs": [ + { + "seed": 42, + "auroc": 0.9116000000000001, + "au_pr": 0.9574765963875643, + "average_precision": 0.9576928507137918, + "pixel_auroc": 0.9604315182344441, + "pixel_au_pr": 0.3775780213581445, + "pixel_average_precision": 0.3776046761599081 + }, + { + "seed": 43, + "auroc": 0.8862000000000001, + "au_pr": 0.9432783477724793, + "average_precision": 0.9435869919550414, + "pixel_auroc": 0.9583562963953284, + "pixel_au_pr": 0.3747542024223356, + "pixel_average_precision": 0.3747849030743497 + }, + { + "seed": 44, + "auroc": 0.9004, + "au_pr": 0.9514351723489248, + "average_precision": 0.9516899329031522, + "pixel_auroc": 0.9586872744593278, + "pixel_au_pr": 0.37651978163909156, + "pixel_average_precision": 0.3765570093516509 + } + ], + "benchmark_mean": { + "auroc": 0.8994, + "au_pr": 0.9507300388363228, + "average_precision": 0.9509899251906617, + "pixel_auroc": 0.9591583630297, + "pixel_au_pr": 0.3762840018065239, + "pixel_average_precision": 0.37631552952863623 + }, + "benchmark_std": { + "auroc": 0.012729493312775637, + "au_pr": 0.007125340404983236, + "average_precision": 0.007078935013730096, + "pixel_auroc": 0.0011149348641231144, + "pixel_au_pr": 0.0014265982064486373, + "pixel_average_precision": 0.0014253120508163468 + }, + "deployment_holdout_profile": { + "seed": 42, + "threshold": 0.053059279918670654, + "fit_normals": 405, + "validation_normals": 45, + "auroc": 0.8989999999999999, + "au_pr": 0.9499623450465442, + "average_precision": 0.9502271580371828, + "pixel_auroc": 0.95870290751976, + "pixel_au_pr": 0.3758081431639321, + "pixel_average_precision": 0.3758205269856516 + }, + "seconds": 45.03114439998171 + }, + "macaroni1": { + "official_train_normals": 900, + "official_test_images": 200, + "benchmark_runs": [ + { + "seed": 42, + "auroc": 0.8164, + "au_pr": 0.7900379634618211, + "average_precision": 0.7926331212277926, + "pixel_auroc": 0.7283181171780677, + "pixel_au_pr": 0.0015780890385677598, + "pixel_average_precision": 0.0015822262566728654 + }, + { + "seed": 43, + "auroc": 0.8359, + "au_pr": 0.7956190395568308, + "average_precision": 0.7979488439753669, + "pixel_auroc": 0.7306853981697815, + "pixel_au_pr": 0.0014010765391638876, + "pixel_average_precision": 0.0014043048463368265 + }, + { + "seed": 44, + "auroc": 0.8099000000000001, + "au_pr": 0.8008593903199746, + "average_precision": 0.8025537360231381, + "pixel_auroc": 0.7277374329290651, + "pixel_au_pr": 0.0016472824117211124, + "pixel_average_precision": 0.0016523645125773884 + } + ], + "benchmark_mean": { + "auroc": 0.8207333333333334, + "au_pr": 0.7955054644462088, + "average_precision": 0.7977119004087658, + "pixel_auroc": 0.7289136494256381, + "pixel_au_pr": 0.0015421493298175867, + "pixel_average_precision": 0.0015462985385290267 + }, + "benchmark_std": { + "auroc": 0.013530828996529822, + "au_pr": 0.005411607366661578, + "average_precision": 0.004964549946341761, + "pixel_auroc": 0.0015616077479764874, + "pixel_au_pr": 0.00012697669045616823, + "pixel_average_precision": 0.00012787298464535848 + }, + "deployment_holdout_profile": { + "seed": 42, + "threshold": 0.07591500878334045, + "fit_normals": 810, + "validation_normals": 90, + "auroc": 0.8335, + "au_pr": 0.8032695520542, + "average_precision": 0.8058774002646991, + "pixel_auroc": 0.7319699198048704, + "pixel_au_pr": 0.001820719918554894, + "pixel_average_precision": 0.0018246547691389576 + }, + "seconds": 113.06721189999371 + }, + "macaroni2": { + "official_train_normals": 900, + "official_test_images": 200, + "benchmark_runs": [ + { + "seed": 42, + "auroc": 0.4955, + "au_pr": 0.4859157566747824, + "average_precision": 0.4902353735956684, + "pixel_auroc": 0.7944229143717352, + "pixel_au_pr": 0.0022004507218000534, + "pixel_average_precision": 0.002215863502953361 + }, + { + "seed": 43, + "auroc": 0.4796000000000001, + "au_pr": 0.4677863570673503, + "average_precision": 0.4739730801749749, + "pixel_auroc": 0.8020432743793243, + "pixel_au_pr": 0.0021332172565870665, + "pixel_average_precision": 0.0021419399589341134 + }, + { + "seed": 44, + "auroc": 0.47309999999999997, + "au_pr": 0.481108422817926, + "average_precision": 0.4866820080963612, + "pixel_auroc": 0.7959122719175098, + "pixel_au_pr": 0.002358628955417945, + "pixel_average_precision": 0.0023693502334905183 + } + ], + "benchmark_mean": { + "auroc": 0.4827333333333333, + "au_pr": 0.47827017885335293, + "average_precision": 0.48363015395566816, + "pixel_auroc": 0.7974594868895232, + "pixel_au_pr": 0.0022307656446016884, + "pixel_average_precision": 0.0022423845651259977 + }, + "benchmark_std": { + "auroc": 0.011524032858914164, + "au_pr": 0.009392044725900559, + "average_precision": 0.008549906847283857, + "pixel_auroc": 0.0040389203122285795, + "pixel_au_pr": 0.00011572318004966633, + "pixel_average_precision": 0.00011600165213275413 + }, + "deployment_holdout_profile": { + "seed": 42, + "threshold": 0.0805380642414093, + "fit_normals": 810, + "validation_normals": 90, + "auroc": 0.5002, + "au_pr": 0.47564475009156426, + "average_precision": 0.48172379567632917, + "pixel_auroc": 0.7947031866442082, + "pixel_au_pr": 0.002174639270063553, + "pixel_average_precision": 0.0021925647141094167 + }, + "seconds": 67.62013350002235 + }, + "pcb2": { + "official_train_normals": 901, + "official_test_images": 200, + "benchmark_runs": [ + { + "seed": 42, + "auroc": 0.7893, + "au_pr": 0.7838787634081932, + "average_precision": 0.7855971798280925, + "pixel_auroc": 0.91671033819846, + "pixel_au_pr": 0.041767499746959265, + "pixel_average_precision": 0.041784021345270844 + }, + { + "seed": 43, + "auroc": 0.7906, + "au_pr": 0.7724737077727798, + "average_precision": 0.7755020531727549, + "pixel_auroc": 0.9179732879227119, + "pixel_au_pr": 0.041524995711936755, + "pixel_average_precision": 0.04154041374898589 + }, + { + "seed": 44, + "auroc": 0.8055, + "au_pr": 0.8096355999130022, + "average_precision": 0.810914809807684, + "pixel_auroc": 0.9175574803045266, + "pixel_au_pr": 0.04068717301416601, + "pixel_average_precision": 0.04072086553805905 + } + ], + "benchmark_mean": { + "auroc": 0.7951333333333332, + "au_pr": 0.7886626903646583, + "average_precision": 0.7906713476028439, + "pixel_auroc": 0.9174137021418994, + "pixel_au_pr": 0.04132655615768734, + "pixel_average_precision": 0.041348433544105265 + }, + "benchmark_std": { + "auroc": 0.009001296202955072, + "au_pr": 0.019037227337613424, + "average_precision": 0.018243525346706518, + "pixel_auroc": 0.0006436339188803603, + "pixel_au_pr": 0.0005668422663448508, + "pixel_average_precision": 0.0005569716033170332 + }, + "deployment_holdout_profile": { + "seed": 42, + "threshold": 0.0849224328994751, + "fit_normals": 810, + "validation_normals": 91, + "auroc": 0.7905000000000001, + "au_pr": 0.7880878748919639, + "average_precision": 0.7897732654897014, + "pixel_auroc": 0.9102355183098504, + "pixel_au_pr": 0.039144681417868435, + "pixel_average_precision": 0.039151291696416506 + }, + "seconds": 62.73766280000564 + }, + "pcb3": { + "official_train_normals": 905, + "official_test_images": 201, + "benchmark_runs": [ + { + "seed": 42, + "auroc": 0.7870297029702971, + "au_pr": 0.8104200255489605, + "average_precision": 0.8114909738137448, + "pixel_auroc": 0.9329148327640948, + "pixel_au_pr": 0.1287764827542035, + "pixel_average_precision": 0.12875248706618522 + }, + { + "seed": 43, + "auroc": 0.8099999999999999, + "au_pr": 0.8178552814078315, + "average_precision": 0.8189577706195854, + "pixel_auroc": 0.9352837561495217, + "pixel_au_pr": 0.143581430436699, + "pixel_average_precision": 0.14364100585551115 + }, + { + "seed": 44, + "auroc": 0.798019801980198, + "au_pr": 0.805514000894815, + "average_precision": 0.806847271418301, + "pixel_auroc": 0.9337017802212624, + "pixel_au_pr": 0.13761258942453908, + "pixel_average_precision": 0.1376028370963068 + } + ], + "benchmark_mean": { + "auroc": 0.7983498349834983, + "au_pr": 0.8112631026172022, + "average_precision": 0.812432005283877, + "pixel_auroc": 0.9339667897116263, + "pixel_au_pr": 0.1366568342051472, + "pixel_average_precision": 0.1366654433393344 + }, + "benchmark_std": { + "auroc": 0.011488704354523396, + "au_pr": 0.0062136853301794056, + "average_precision": 0.006109844752275779, + "pixel_auroc": 0.0012064916178709522, + "pixel_au_pr": 0.007448605238559986, + "pixel_average_precision": 0.007488392900131238 + }, + "deployment_holdout_profile": { + "seed": 42, + "threshold": 0.08122119307518005, + "fit_normals": 814, + "validation_normals": 91, + "auroc": 0.7747524752475247, + "au_pr": 0.8045196628588029, + "average_precision": 0.8056175108533596, + "pixel_auroc": 0.9294099327005999, + "pixel_au_pr": 0.13226256510452605, + "pixel_average_precision": 0.1322610245459947 + }, + "seconds": 86.13384480000241 + }, + "pcb4": { + "official_train_normals": 904, + "official_test_images": 201, + "benchmark_runs": [ + { + "seed": 42, + "auroc": 0.9296039603960395, + "au_pr": 0.9264685581956622, + "average_precision": 0.9268962317340124, + "pixel_auroc": 0.9649612355233904, + "pixel_au_pr": 0.2848150662221529, + "pixel_average_precision": 0.28485386160082676 + }, + { + "seed": 43, + "auroc": 0.9455445544554456, + "au_pr": 0.9444126592665123, + "average_precision": 0.9447216067906145, + "pixel_auroc": 0.9659001073100977, + "pixel_au_pr": 0.2972460671551258, + "pixel_average_precision": 0.2972609273755548 + }, + { + "seed": 44, + "auroc": 0.9352475247524753, + "au_pr": 0.9277253482488393, + "average_precision": 0.9281977057451503, + "pixel_auroc": 0.9683930607520573, + "pixel_au_pr": 0.2917764048064103, + "pixel_average_precision": 0.29179388828957287 + } + ], + "benchmark_mean": { + "auroc": 0.9367986798679868, + "au_pr": 0.9328688552370047, + "average_precision": 0.9332718480899257, + "pixel_auroc": 0.9664181345285151, + "pixel_au_pr": 0.291279179394563, + "pixel_average_precision": 0.2913028924219848 + }, + "benchmark_std": { + "auroc": 0.008082709718032446, + "au_pr": 0.010016957567704859, + "average_precision": 0.009937111722146195, + "pixel_auroc": 0.001773589650763301, + "pixel_au_pr": 0.006230398934380788, + "pixel_average_precision": 0.006218088773176086 + }, + "deployment_holdout_profile": { + "seed": 42, + "threshold": 0.05957549810409546, + "fit_normals": 813, + "validation_normals": 91, + "auroc": 0.936930693069307, + "au_pr": 0.935289428742797, + "average_precision": 0.9356652909858226, + "pixel_auroc": 0.9686479110465991, + "pixel_au_pr": 0.29322576468181716, + "pixel_average_precision": 0.29326625902921355 + }, + "seconds": 79.89875999998185 + }, + "pipe_fryum": { + "official_train_normals": 450, + "official_test_images": 150, + "benchmark_runs": [ + { + "seed": 42, + "auroc": 0.9705999999999999, + "au_pr": 0.986018793690163, + "average_precision": 0.9860860317049225, + "pixel_auroc": 0.9909730291737511, + "pixel_au_pr": 0.6018618957896934, + "pixel_average_precision": 0.6018712895066785 + }, + { + "seed": 43, + "auroc": 0.9704, + "au_pr": 0.9865430967562028, + "average_precision": 0.9866053109369469, + "pixel_auroc": 0.9909667466666388, + "pixel_au_pr": 0.6029888315587789, + "pixel_average_precision": 0.6030140367863087 + }, + { + "seed": 44, + "auroc": 0.97, + "au_pr": 0.9858010839067707, + "average_precision": 0.9858702591168634, + "pixel_auroc": 0.9908645972891833, + "pixel_au_pr": 0.598149986807201, + "pixel_average_precision": 0.5981538458958431 + } + ], + "benchmark_mean": { + "auroc": 0.9703333333333332, + "au_pr": 0.9861209914510455, + "average_precision": 0.9861872005862442, + "pixel_auroc": 0.990934791043191, + "pixel_au_pr": 0.6010002380518911, + "pixel_average_precision": 0.6010130573962768 + }, + "benchmark_std": { + "auroc": 0.0003055050463303678, + "au_pr": 0.00038141716522415526, + "average_precision": 0.0003778248952397656, + "pixel_auroc": 6.087068095707952e-05, + "pixel_au_pr": 0.00253188569554477, + "pixel_average_precision": 0.0025412173538354992 + }, + "deployment_holdout_profile": { + "seed": 42, + "threshold": 0.08634456992149353, + "fit_normals": 405, + "validation_normals": 45, + "auroc": 0.9686, + "au_pr": 0.9859739502798138, + "average_precision": 0.9860378036811346, + "pixel_auroc": 0.9907989950706518, + "pixel_au_pr": 0.603420526628673, + "pixel_average_precision": 0.6034129205109321 + }, + "seconds": 66.45045070000924 + } + }, + "macro_mean": { + "auroc": 0.8538392280894755, + "au_pr": 0.8646743814043232, + "average_precision": 0.8658458138046231, + "pixel_auroc": 0.9296270879250635, + "pixel_au_pr": 0.33294457605927946, + "pixel_average_precision": 0.33296395330821005 + }, + "macro_runs": [ + { + "seed": 42, + "auroc": 0.8522694719471947, + "au_pr": 0.8640922402477029, + "average_precision": 0.865162338776563, + "pixel_auroc": 0.9296959680169444, + "pixel_au_pr": 0.3323531283802899, + "pixel_average_precision": 0.3323688554659699 + }, + { + "seed": 43, + "auroc": 0.8551842684268426, + "au_pr": 0.8631541904260733, + "average_precision": 0.8644903567475731, + "pixel_auroc": 0.9303334186403451, + "pixel_au_pr": 0.33337858317582486, + "pixel_average_precision": 0.3333979243678186 + }, + { + "seed": 44, + "auroc": 0.8540639438943894, + "au_pr": 0.8667767135391936, + "average_precision": 0.8678847458897335, + "pixel_auroc": 0.9288518771179008, + "pixel_au_pr": 0.3331020166217237, + "pixel_average_precision": 0.3331250800908418 + } + ], + "macro_std": { + "auroc": 0.0014703341539172223, + "au_pr": 0.001880115600420924, + "average_precision": 0.0017974490250325652, + "pixel_auroc": 0.0007431686692634315, + "pixel_au_pr": 0.0005305469182348207, + "pixel_average_precision": 0.0005331201377259799 + }, + "candidate": { + "protocol": { + "schema": 1, + "method": "AnomalyDINO-inspired DINOv2 ViT-S/14; custom full-data adaptation", + "resolution": "short edge448; bicubic; retain aspect; crop trailing pixels to patch multiple14", + "encoder_sha256": "ae1e99fcefd534ed978cdeb8326f08030c96e28b7a81ffcbc98a857c84d14be1", + "split_csv_sha256": "a48557e6033318cb90556f706196bc9d247a776a23ea51aecee5a80dd0332995", + "seeds": [ + 42, + 43, + 44 + ], + "bank_patches": 32768, + "memory_sampling": "per train normal: up to48 PCA foreground +16 other patches, seeded uniform cap", + "foreground": "PCA first component threshold10; center-sign rule; 2D3x3 dilation/closing; <1% mask falls back to all patches", + "score": "mean of top1% foreground cosine distances", + "fit": "all official training normals for benchmark", + "calibration": "separate deployment bank excludes every tenth content-hash-sorted training normal; maximum heldout normal score", + "evaluation": "full official test; masks only for pixel metrics at224x224; image AP and trapezoidal AU-PR separately", + "selection": "one fixed candidate; no test-based hyperparameter changes; seeds42/43/44 all reported; deployment seed42 fixed", + "exposure": "retrospective development comparison; official test identities and earlier results already seen; not an untouched external test", + "references": [ + "https://arxiv.org/html/2405.14529v2", + "https://github.com/dammsi/AnomalyDINO" + ], + "differences_from_paper": "HF encoder; image-balanced limited full-data memory; masking train and test; 2D morphology; no rotation augmentation" + }, + "python": "3.12.4", + "torch": "2.8.0+cu126", + "device": "cuda", + "categories": { + "macaroni2": { + "official_train_normals": 900, + "official_test_images": 200, + "benchmark_runs": [ + { + "seed": 42, + "auroc": 0.8447, + "au_pr": 0.837609437596522, + "average_precision": 0.8387483523714999, + "pixel_auroc": 0.9939494150699683, + "pixel_au_pr": 0.15619858519387228, + "pixel_average_precision": 0.15653869576515458 + }, + { + "seed": 43, + "auroc": 0.8244, + "au_pr": 0.8342875038001054, + "average_precision": 0.835288930423173, + "pixel_auroc": 0.9941328078917665, + "pixel_au_pr": 0.15365590865968637, + "pixel_average_precision": 0.15385826448902645 + }, + { + "seed": 44, + "auroc": 0.8268000000000001, + "au_pr": 0.82322819785278, + "average_precision": 0.8244805378917035, + "pixel_auroc": 0.9932291868085448, + "pixel_au_pr": 0.1521970939306702, + "pixel_average_precision": 0.15240427679230106 + } + ], + "benchmark_mean": { + "auroc": 0.8319666666666667, + "au_pr": 0.8317083797498025, + "average_precision": 0.8328392735621254, + "pixel_auroc": 0.9937704699234265, + "pixel_au_pr": 0.1540171959280763, + "pixel_average_precision": 0.15426707901549405 + }, + "benchmark_std": { + "auroc": 0.01109248995191489, + "au_pr": 0.007529536824525402, + "average_precision": 0.0074426639424422444, + "pixel_auroc": 0.0004776492328203173, + "pixel_au_pr": 0.002025062826209623, + "pixel_average_precision": 0.002097308286485555 + }, + "deployment_holdout_profile": { + "threshold": 0.15817631781101227, + "heatmap_scale": 0.11770220518112187, + "auroc": 0.845, + "au_pr": 0.8435705368551327, + "average_precision": 0.8446602099722114, + "pixel_auroc": 0.9942242061289198, + "pixel_au_pr": 0.15741764917137446, + "pixel_average_precision": 0.15769057747120718 + }, + "seconds": 135.40084509999724 + }, + "macaroni1": { + "official_train_normals": 900, + "official_test_images": 200, + "benchmark_runs": [ + { + "seed": 42, + "auroc": 0.918, + "au_pr": 0.932786840237027, + "average_precision": 0.933081657808966, + "pixel_auroc": 0.9931323622243489, + "pixel_au_pr": 0.22549630696338402, + "pixel_average_precision": 0.22579868648536688 + }, + { + "seed": 43, + "auroc": 0.9107, + "au_pr": 0.9239509925163285, + "average_precision": 0.9243019415241156, + "pixel_auroc": 0.992904762589421, + "pixel_au_pr": 0.21863043402124735, + "pixel_average_precision": 0.2188116322733481 + }, + { + "seed": 44, + "auroc": 0.907, + "au_pr": 0.9199703014532423, + "average_precision": 0.920343639849281, + "pixel_auroc": 0.9928691842690383, + "pixel_au_pr": 0.21706041388603783, + "pixel_average_precision": 0.21738255135304616 + } + ], + "benchmark_mean": { + "auroc": 0.9119, + "au_pr": 0.925569378068866, + "average_precision": 0.9259090797274542, + "pixel_auroc": 0.9929687696942694, + "pixel_au_pr": 0.22039571829022306, + "pixel_average_precision": 0.2206642900372537 + }, + "benchmark_std": { + "auroc": 0.005597320787662625, + "au_pr": 0.006559748123713314, + "average_precision": 0.006519313252850117, + "pixel_auroc": 0.00014278774857695058, + "pixel_au_pr": 0.00448645120510902, + "pixel_average_precision": 0.004503563948029452 + }, + "deployment_holdout_profile": { + "threshold": 0.21722275018692017, + "heatmap_scale": 0.09929629743099211, + "auroc": 0.909, + "au_pr": 0.9251309284382584, + "average_precision": 0.9254645749095916, + "pixel_auroc": 0.9932559185087934, + "pixel_au_pr": 0.22101242411741848, + "pixel_average_precision": 0.22125282869927704 + }, + "seconds": 138.32114929999807 + }, + "pcb1": { + "official_train_normals": 904, + "official_test_images": 200, + "benchmark_runs": [ + { + "seed": 42, + "auroc": 0.9525, + "au_pr": 0.946087107136921, + "average_precision": 0.9464671661037876, + "pixel_auroc": 0.9944586387417026, + "pixel_au_pr": 0.8464118976709029, + "pixel_average_precision": 0.846427424617724 + }, + { + "seed": 43, + "auroc": 0.9479, + "au_pr": 0.9476376952747854, + "average_precision": 0.9479555666854507, + "pixel_auroc": 0.9944482838147902, + "pixel_au_pr": 0.8531528892315858, + "pixel_average_precision": 0.8531825227347262 + }, + { + "seed": 44, + "auroc": 0.9503, + "au_pr": 0.9512781827394374, + "average_precision": 0.9515451522688605, + "pixel_auroc": 0.994454625316606, + "pixel_au_pr": 0.8477368705549233, + "pixel_average_precision": 0.8477233530396995 + } + ], + "benchmark_mean": { + "auroc": 0.9502333333333333, + "au_pr": 0.9483343283837146, + "average_precision": 0.948655961686033, + "pixel_auroc": 0.994453849291033, + "pixel_au_pr": 0.8491005524858041, + "pixel_average_precision": 0.8491111001307164 + }, + "benchmark_std": { + "auroc": 0.0023007245235650113, + "au_pr": 0.002664730707614299, + "average_precision": 0.0026104407177330187, + "pixel_auroc": 5.220899310240183e-06, + "pixel_au_pr": 0.0035714091213073927, + "pixel_average_precision": 0.003584999181875953 + }, + "deployment_holdout_profile": { + "threshold": 0.16181933879852295, + "heatmap_scale": 0.10316987216472613, + "auroc": 0.9597, + "au_pr": 0.9561930064621866, + "average_precision": 0.9564653221826244, + "pixel_auroc": 0.9946015614062951, + "pixel_au_pr": 0.856268349620392, + "pixel_average_precision": 0.8562862818777615 + }, + "seconds": 130.61381800001254 + }, + "capsules": { + "official_train_normals": 542, + "official_test_images": 160, + "benchmark_runs": [ + { + "seed": 42, + "auroc": 0.968, + "au_pr": 0.9763334548720008, + "average_precision": 0.976495652745956, + "pixel_auroc": 0.9694939889285102, + "pixel_au_pr": 0.40129786284523034, + "pixel_average_precision": 0.4012847974451588 + }, + { + "seed": 43, + "auroc": 0.9686666666666668, + "au_pr": 0.9764671035244079, + "average_precision": 0.9766334139497022, + "pixel_auroc": 0.97044846089275, + "pixel_au_pr": 0.397617206547916, + "pixel_average_precision": 0.3976678565607239 + }, + { + "seed": 44, + "auroc": 0.9713333333333333, + "au_pr": 0.9787056543871668, + "average_precision": 0.9788507777162221, + "pixel_auroc": 0.9701251715230256, + "pixel_au_pr": 0.4041945944570431, + "pixel_average_precision": 0.40422112389698794 + } + ], + "benchmark_mean": { + "auroc": 0.9693333333333333, + "au_pr": 0.9771687375945252, + "average_precision": 0.97732661480396, + "pixel_auroc": 0.9700225404480953, + "pixel_au_pr": 0.4010365546167298, + "pixel_average_precision": 0.4010579259676235 + }, + "benchmark_std": { + "auroc": 0.0017638342073763465, + "au_pr": 0.0013326854134417649, + "average_precision": 0.0013217598021768872, + "pixel_auroc": 0.00048544210343352004, + "pixel_au_pr": 0.003296470752106622, + "pixel_average_precision": 0.003282519032027932 + }, + "deployment_holdout_profile": { + "threshold": 0.19718621671199799, + "heatmap_scale": 0.1274158811569204, + "auroc": 0.9683333333333333, + "au_pr": 0.9797118272127361, + "average_precision": 0.9798232872953215, + "pixel_auroc": 0.9704973188279925, + "pixel_au_pr": 0.40366595976940756, + "pixel_average_precision": 0.403655563796705 + }, + "seconds": 94.91161680000369 + }, + "cashew": { + "official_train_normals": 450, + "official_test_images": 150, + "benchmark_runs": [ + { + "seed": 42, + "auroc": 0.9555999999999999, + "au_pr": 0.9798344986141854, + "average_precision": 0.9799284257916656, + "pixel_auroc": 0.9960590367672582, + "pixel_au_pr": 0.6940909426916273, + "pixel_average_precision": 0.694126095923703 + }, + { + "seed": 43, + "auroc": 0.9578000000000001, + "au_pr": 0.9809117646282322, + "average_precision": 0.9809999318079211, + "pixel_auroc": 0.9961226559982549, + "pixel_au_pr": 0.697751529343841, + "pixel_average_precision": 0.6978133678203721 + }, + { + "seed": 44, + "auroc": 0.9688, + "au_pr": 0.9858445920160998, + "average_precision": 0.9859098832312743, + "pixel_auroc": 0.9961110128509749, + "pixel_au_pr": 0.6924916996495216, + "pixel_average_precision": 0.6925347276159604 + } + ], + "benchmark_mean": { + "auroc": 0.9607333333333333, + "au_pr": 0.9821969517528392, + "average_precision": 0.982279413610287, + "pixel_auroc": 0.9960975685388292, + "pixel_au_pr": 0.69477805722833, + "pixel_average_precision": 0.6948247304533451 + }, + "benchmark_std": { + "auroc": 0.0070720105580615155, + "au_pr": 0.0032045413297187, + "average_precision": 0.0031893986168871256, + "pixel_auroc": 3.387349679255494e-05, + "pixel_au_pr": 0.0026963951663697317, + "pixel_average_precision": 0.0027077810576954238 + }, + "deployment_holdout_profile": { + "threshold": 0.13224798440933228, + "heatmap_scale": 0.10505769878625872, + "auroc": 0.9608000000000001, + "au_pr": 0.9816829641673432, + "average_precision": 0.9817707260519815, + "pixel_auroc": 0.9960830910862268, + "pixel_au_pr": 0.703436397078779, + "pixel_average_precision": 0.7034966403298871 + }, + "seconds": 72.7265475000022 + }, + "candle": { + "official_train_normals": 900, + "official_test_images": 200, + "benchmark_runs": [ + { + "seed": 42, + "auroc": 0.9558, + "au_pr": 0.9621606881772008, + "average_precision": 0.9623367827893016, + "pixel_auroc": 0.9903982538707946, + "pixel_au_pr": 0.33895358283555577, + "pixel_average_precision": 0.3389159342327367 + }, + { + "seed": 43, + "auroc": 0.9536, + "au_pr": 0.9544234987148842, + "average_precision": 0.9546667684680096, + "pixel_auroc": 0.9908451687141144, + "pixel_au_pr": 0.3378197922542562, + "pixel_average_precision": 0.33783760689070347 + }, + { + "seed": 44, + "auroc": 0.9443, + "au_pr": 0.9489440077401582, + "average_precision": 0.9492007022384481, + "pixel_auroc": 0.990951012382223, + "pixel_au_pr": 0.32271350806250704, + "pixel_average_precision": 0.32276634541885246 + } + ], + "benchmark_mean": { + "auroc": 0.9512333333333333, + "au_pr": 0.9551760648774144, + "average_precision": 0.9554014178319198, + "pixel_auroc": 0.9907314783223774, + "pixel_au_pr": 0.33316229438410633, + "pixel_average_precision": 0.3331732955140976 + }, + "benchmark_std": { + "auroc": 0.006104370019365886, + "au_pr": 0.00664040114115595, + "average_precision": 0.006598782866979933, + "pixel_auroc": 0.0002933932887254627, + "pixel_au_pr": 0.009066654397648078, + "pixel_average_precision": 0.009028795887483296 + }, + "deployment_holdout_profile": { + "threshold": 0.22504067420959473, + "heatmap_scale": 0.1193666505813595, + "auroc": 0.9410000000000001, + "au_pr": 0.9456741403322482, + "average_precision": 0.9459465742669609, + "pixel_auroc": 0.9911336061961822, + "pixel_au_pr": 0.3375717699673859, + "pixel_average_precision": 0.33767271945011856 + }, + "seconds": 129.0740725999931 + }, + "chewinggum": { + "official_train_normals": 453, + "official_test_images": 150, + "benchmark_runs": [ + { + "seed": 42, + "auroc": 0.9932, + "au_pr": 0.9969466609199811, + "average_precision": 0.9969604682469676, + "pixel_auroc": 0.9954117320863656, + "pixel_au_pr": 0.6850700777255413, + "pixel_average_precision": 0.6850388759883876 + }, + { + "seed": 43, + "auroc": 0.9892000000000001, + "au_pr": 0.9952337041797067, + "average_precision": 0.9952549042275805, + "pixel_auroc": 0.9953773487370392, + "pixel_au_pr": 0.6846896840964964, + "pixel_average_precision": 0.684733727423744 + }, + { + "seed": 44, + "auroc": 0.9916, + "au_pr": 0.996171900969947, + "average_precision": 0.9961895142750861, + "pixel_auroc": 0.9952795650960506, + "pixel_au_pr": 0.6676922561430878, + "pixel_average_precision": 0.6676931239584004 + } + ], + "benchmark_mean": { + "auroc": 0.9913333333333334, + "au_pr": 0.9961174220232115, + "average_precision": 0.996134962249878, + "pixel_auroc": 0.9953562153064851, + "pixel_au_pr": 0.6791506726550418, + "pixel_average_precision": 0.679155242456844 + }, + "benchmark_std": { + "auroc": 0.002013289182738814, + "au_pr": 0.0008577768738086334, + "average_precision": 0.0008540896315069846, + "pixel_auroc": 6.85710926518182e-05, + "pixel_au_pr": 0.00992510234452624, + "pixel_average_precision": 0.009927658297196707 + }, + "deployment_holdout_profile": { + "threshold": 0.1614319533109665, + "heatmap_scale": 0.11275605440139722, + "auroc": 0.9885999999999999, + "au_pr": 0.994444649292763, + "average_precision": 0.9944721280040146, + "pixel_auroc": 0.9952665200400623, + "pixel_au_pr": 0.6596933281197321, + "pixel_average_precision": 0.6597053568827396 + }, + "seconds": 77.3525510999898 + }, + "fryum": { + "official_train_normals": 450, + "official_test_images": 150, + "benchmark_runs": [ + { + "seed": 42, + "auroc": 0.9891999999999999, + "au_pr": 0.9949168165129106, + "average_precision": 0.9949409420549524, + "pixel_auroc": 0.9738082020921681, + "pixel_au_pr": 0.4379800592981127, + "pixel_average_precision": 0.43799433572118596 + }, + { + "seed": 43, + "auroc": 0.9958, + "au_pr": 0.9978909116915007, + "average_precision": 0.997901515122974, + "pixel_auroc": 0.973882263507042, + "pixel_au_pr": 0.43803860398905753, + "pixel_average_precision": 0.4380513505278392 + }, + { + "seed": 44, + "auroc": 0.9892, + "au_pr": 0.9949145081810289, + "average_precision": 0.9949385524097363, + "pixel_auroc": 0.9739487459423446, + "pixel_au_pr": 0.43927674150289875, + "pixel_average_precision": 0.43931148808215037 + } + ], + "benchmark_mean": { + "auroc": 0.9914, + "au_pr": 0.9959074121284801, + "average_precision": 0.9959270031958876, + "pixel_auroc": 0.9738797371805182, + "pixel_au_pr": 0.43843180159668965, + "pixel_average_precision": 0.4384523914437251 + }, + "benchmark_std": { + "auroc": 0.0038105117766515915, + "au_pr": 0.0017177613977139654, + "average_precision": 0.001709977906364863, + "pixel_auroc": 7.03059755631449e-05, + "pixel_au_pr": 0.0007323246916757177, + "pixel_average_precision": 0.000744545463796214 + }, + "deployment_holdout_profile": { + "threshold": 0.15253151953220367, + "heatmap_scale": 0.10057919770479187, + "auroc": 0.9924, + "au_pr": 0.9963414765677349, + "average_precision": 0.9963591766254614, + "pixel_auroc": 0.9735429349543053, + "pixel_au_pr": 0.4359936878538498, + "pixel_average_precision": 0.4360142987071739 + }, + "seconds": 75.21686919999775 + }, + "pcb2": { + "official_train_normals": 901, + "official_test_images": 200, + "benchmark_runs": [ + { + "seed": 42, + "auroc": 0.9202, + "au_pr": 0.9322088542538738, + "average_precision": 0.932545698262865, + "pixel_auroc": 0.9712767185430914, + "pixel_au_pr": 0.26902216961670095, + "pixel_average_precision": 0.269116591248745 + }, + { + "seed": 43, + "auroc": 0.9289000000000001, + "au_pr": 0.9329793541058563, + "average_precision": 0.9333614467676451, + "pixel_auroc": 0.9717626924423868, + "pixel_au_pr": 0.2798493987176048, + "pixel_average_precision": 0.27991198670004014 + }, + { + "seed": 44, + "auroc": 0.9283, + "au_pr": 0.9280660798216491, + "average_precision": 0.9285879887356563, + "pixel_auroc": 0.9716170427305009, + "pixel_au_pr": 0.2697964905619438, + "pixel_average_precision": 0.2698079968958421 + } + ], + "benchmark_mean": { + "auroc": 0.9258000000000001, + "au_pr": 0.9310847627271265, + "average_precision": 0.9314983779220555, + "pixel_auroc": 0.9715521512386598, + "pixel_au_pr": 0.27288935296541655, + "pixel_average_precision": 0.27294552494820906 + }, + "benchmark_std": { + "auroc": 0.004859012245302549, + "au_pr": 0.0026424898047753827, + "average_precision": 0.0025532597435425006, + "pixel_auroc": 0.0002494009562614438, + "pixel_au_pr": 0.006039997589898184, + "pixel_average_precision": 0.006043029244261792 + }, + "deployment_holdout_profile": { + "threshold": 0.341839998960495, + "heatmap_scale": 0.09851976394653338, + "auroc": 0.9062, + "au_pr": 0.9091607663548358, + "average_precision": 0.9098166487308751, + "pixel_auroc": 0.9714470671684394, + "pixel_au_pr": 0.2629794270140921, + "pixel_average_precision": 0.26303790724220233 + }, + "seconds": 134.38419250000152 + }, + "pcb3": { + "official_train_normals": 905, + "official_test_images": 201, + "benchmark_runs": [ + { + "seed": 42, + "auroc": 0.9433663366336634, + "au_pr": 0.9573257944956892, + "average_precision": 0.9574934355764043, + "pixel_auroc": 0.9804594500562178, + "pixel_au_pr": 0.33440243549415977, + "pixel_average_precision": 0.33442549268444677 + }, + { + "seed": 43, + "auroc": 0.9477227722772278, + "au_pr": 0.959595644345721, + "average_precision": 0.9597596806082674, + "pixel_auroc": 0.9805071690010876, + "pixel_au_pr": 0.33373335990639547, + "pixel_average_precision": 0.333819556432083 + }, + { + "seed": 44, + "auroc": 0.9466336633663367, + "au_pr": 0.9577819308568531, + "average_precision": 0.9579591053290832, + "pixel_auroc": 0.9798799216744494, + "pixel_au_pr": 0.33973787538078626, + "pixel_average_precision": 0.3397522193939622 + } + ], + "benchmark_mean": { + "auroc": 0.9459075907590759, + "au_pr": 0.9582344565660877, + "average_precision": 0.9584040738379184, + "pixel_auroc": 0.9802821802439183, + "pixel_au_pr": 0.3359578902604472, + "pixel_average_precision": 0.3359990895034973 + }, + "benchmark_std": { + "auroc": 0.0022671609895175723, + "au_pr": 0.0012006828155516466, + "average_precision": 0.0011968560341587735, + "pixel_auroc": 0.00034918224748437215, + "pixel_au_pr": 0.0032906125824873787, + "pixel_average_precision": 0.003264395451918764 + }, + "deployment_holdout_profile": { + "threshold": 0.16282716393470764, + "heatmap_scale": 0.1029075479507446, + "auroc": 0.9547524752475247, + "au_pr": 0.9643689895252089, + "average_precision": 0.9645187368797429, + "pixel_auroc": 0.9805302802001331, + "pixel_au_pr": 0.3377368540626885, + "pixel_average_precision": 0.33774957148695994 + }, + "seconds": 135.53616119999788 + }, + "pcb4": { + "official_train_normals": 904, + "official_test_images": 201, + "benchmark_runs": [ + { + "seed": 42, + "auroc": 0.9888118811881188, + "au_pr": 0.9880168371253286, + "average_precision": 0.9880817605339174, + "pixel_auroc": 0.9797851572798281, + "pixel_au_pr": 0.2918409934178783, + "pixel_average_precision": 0.2918620534311465 + }, + { + "seed": 43, + "auroc": 0.9905940594059406, + "au_pr": 0.9904921945653063, + "average_precision": 0.9905403726682713, + "pixel_auroc": 0.9800535279608199, + "pixel_au_pr": 0.3113890405329925, + "pixel_average_precision": 0.3114066877489506 + }, + { + "seed": 44, + "auroc": 0.9902970297029704, + "au_pr": 0.9907507181331998, + "average_precision": 0.9907947926063193, + "pixel_auroc": 0.9811058153456667, + "pixel_au_pr": 0.3112462297344757, + "pixel_average_precision": 0.31127896730004057 + } + ], + "benchmark_mean": { + "auroc": 0.9899009900990099, + "au_pr": 0.9897532499412782, + "average_precision": 0.9898056419361693, + "pixel_auroc": 0.9803148335287716, + "pixel_au_pr": 0.3048254212284488, + "pixel_average_precision": 0.3048492361600459 + }, + "benchmark_std": { + "auroc": 0.0009548169070290293, + "au_pr": 0.0015093229307655532, + "average_precision": 0.001498334973559554, + "pixel_auroc": 0.0006980292841980381, + "pixel_au_pr": 0.011245071049441238, + "pixel_average_precision": 0.011247411460137574 + }, + "deployment_holdout_profile": { + "threshold": 0.17516569793224335, + "heatmap_scale": 0.10422959923744202, + "auroc": 0.9865346534653465, + "au_pr": 0.9821331587999459, + "average_precision": 0.9822685098306626, + "pixel_auroc": 0.9806894408642699, + "pixel_au_pr": 0.3216559666615416, + "pixel_average_precision": 0.3216614985757051 + }, + "seconds": 133.8244237000181 + }, + "pipe_fryum": { + "official_train_normals": 450, + "official_test_images": 150, + "benchmark_runs": [ + { + "seed": 42, + "auroc": 0.995, + "au_pr": 0.9977423374213756, + "average_precision": 0.9977526197670599, + "pixel_auroc": 0.9927515748074147, + "pixel_au_pr": 0.47981081512851037, + "pixel_average_precision": 0.4800110544187529 + }, + { + "seed": 43, + "auroc": 0.9964000000000001, + "au_pr": 0.9982273652036702, + "average_precision": 0.9982361328885846, + "pixel_auroc": 0.992764142075617, + "pixel_au_pr": 0.4830566976570724, + "pixel_average_precision": 0.48318326819265506 + }, + { + "seed": 44, + "auroc": 0.9962, + "au_pr": 0.9982256566034399, + "average_precision": 0.9982339839967207, + "pixel_auroc": 0.9927469763458546, + "pixel_au_pr": 0.481216205091409, + "pixel_average_precision": 0.48138223354046783 + } + ], + "benchmark_mean": { + "auroc": 0.9958666666666667, + "au_pr": 0.9980651197428285, + "average_precision": 0.9980742455507885, + "pixel_auroc": 0.9927542310762955, + "pixel_au_pr": 0.4813612392923306, + "pixel_average_precision": 0.48152551871729193 + }, + "benchmark_std": { + "auroc": 0.0007571877794400558, + "au_pr": 0.0002795389956885984, + "average_precision": 0.0002785381715372213, + "pixel_auroc": 8.885797254273498e-06, + "pixel_au_pr": 0.0016277943779494204, + "pixel_average_precision": 0.0015909534997154244 + }, + "deployment_holdout_profile": { + "threshold": 0.18373285233974457, + "heatmap_scale": 0.1333938717842105, + "auroc": 0.9891999999999999, + "au_pr": 0.9951107263654106, + "average_precision": 0.9951337553868363, + "pixel_auroc": 0.9927315263511816, + "pixel_au_pr": 0.47978917789024056, + "pixel_average_precision": 0.47984772131593945 + }, + "seconds": 71.54133030000958 + } + }, + "macro_mean": { + "auroc": 0.9513007150715072, + "au_pr": 0.9574430219630145, + "average_precision": 0.9576880054928729, + "pixel_auroc": 0.98601533539939, + "pixel_au_pr": 0.430425562577637, + "pixel_average_precision": 0.4305021186956786 + }, + "macro_runs": [ + { + "seed": 42, + "auroc": 0.9520315181518151, + "au_pr": 0.9584974439469179, + "average_precision": 0.958736080171112, + "pixel_auroc": 0.9859153775389724, + "pixel_au_pr": 0.43004797740678957, + "pixel_average_precision": 0.4301283364968757 + }, + { + "seed": 43, + "auroc": 0.9509736248624864, + "au_pr": 0.9576748110458753, + "average_precision": 0.9579083837618078, + "pixel_auroc": 0.9861041069687575, + "pixel_au_pr": 0.432448712079846, + "pixel_average_precision": 0.4325231523161844 + }, + { + "seed": 44, + "auroc": 0.95089700220022, + "au_pr": 0.9561568108962502, + "average_precision": 0.9564195525456993, + "pixel_auroc": 0.9860265216904399, + "pixel_au_pr": 0.4287799982462753, + "pixel_average_precision": 0.428854867273976 + } + ], + "macro_std": { + "auroc": 0.0006340525331026325, + "au_pr": 0.001187407008430423, + "average_precision": 0.0011738824455153193, + "pixel_auroc": 9.486068335903378e-05, + "pixel_au_pr": 0.0018632748640743098, + "pixel_average_precision": 0.0018624885601874065 + } + }, + "mvtec": { + "dataset": "MVTec AD", + "scope": "One offline run on 15 products the detector was never built for. Each product's memory comes from its own normal training photos; thresholds are the 95th percentile of held-out normal scores. These products are not available for inspection in this app.", + "protocol_url": "https://github.com/WAYTECHG/DefectRAG/blob/main/docs/MVTEC_EVALUATION.md", + "arms": [ + { + "key": "A_random_frozen", + "label": "Random-sample memory" + }, + { + "key": "B_coreset_frozen", + "label": "Coreset memory" + }, + { + "key": "C_coreset_tuned", + "label": "Coreset + fine-tuned encoder" + } + ], + "products": 15, + "test_images": 1725, + "macro_mean": { + "A_random_frozen": { + "auroc": 0.985898601015946, + "average_precision": 0.9950133869275688, + "pixel_auroc": 0.8855338763708794, + "recall_q95": 0.952362358121102, + "false_alarm_q95": 0.12887259782149388 + }, + "B_coreset_frozen": { + "auroc": 0.9922531989217127, + "average_precision": 0.9973380306223784, + "pixel_auroc": 0.8880871085136053, + "recall_q95": 0.9717860302454951, + "false_alarm_q95": 0.17215185349246528 + }, + "C_coreset_tuned": { + "auroc": 0.9923028240349344, + "average_precision": 0.99753068177661, + "pixel_auroc": 0.8807053045940548, + "recall_q95": 0.974639924356982, + "false_alarm_q95": 0.15884109815584785 + } + }, + "comparisons": { + "B-A": { + "better": 3, + "worse": 0 + }, + "C-B": { + "better": 1, + "worse": 1 + }, + "C-A": { + "better": 3, + "worse": 0 + } + }, + "categories": { + "bottle": { + "n_test": 83, + "arms": { + "A_random_frozen": { + "auroc": 1.0, + "pixel_auroc": 0.9051788535306131, + "average_precision": 0.9999999999999998, + "recall_q95": 1.0, + "false_alarm_q95": 0.15 + }, + "B_coreset_frozen": { + "auroc": 1.0, + "pixel_auroc": 0.9053642827126964, + "average_precision": 0.9999999999999998, + "recall_q95": 1.0, + "false_alarm_q95": 0.2 + }, + "C_coreset_tuned": { + "auroc": 1.0, + "pixel_auroc": 0.9017674078478235, + "average_precision": 0.9999999999999998, + "recall_q95": 1.0, + "false_alarm_q95": 0.2 + } + }, + "differences": { + "B-A": [ + 0.0, + 0.0 + ], + "C-B": [ + 0.0, + 0.0 + ], + "C-A": [ + 0.0, + 0.0 + ] + } + }, + "cable": { + "n_test": 150, + "arms": { + "A_random_frozen": { + "auroc": 0.960832083958021, + "pixel_auroc": 0.9597412765199669, + "average_precision": 0.9798081270101584, + "recall_q95": 0.8695652173913043, + "false_alarm_q95": 0.034482758620689655 + }, + "B_coreset_frozen": { + "auroc": 0.9835082458770614, + "pixel_auroc": 0.9643614107722097, + "average_precision": 0.9905275635304355, + "recall_q95": 0.9565217391304348, + "false_alarm_q95": 0.06896551724137931 + }, + "C_coreset_tuned": { + "auroc": 0.9928785607196402, + "pixel_auroc": 0.9749763220362742, + "average_precision": 0.9958029562404663, + "recall_q95": 0.9565217391304348, + "false_alarm_q95": 0.034482758620689655 + } + }, + "differences": { + "B-A": [ + 0.008245877061469287, + 0.04160419790104941 + ], + "C-B": [ + 0.002436281859070519, + 0.0191201274362819 + ], + "C-A": [ + 0.012743628185907019, + 0.05640929535232375 + ] + } + }, + "capsule": { + "n_test": 132, + "arms": { + "A_random_frozen": { + "auroc": 0.9581172716394096, + "pixel_auroc": 0.9894358804925572, + "average_precision": 0.9871851844531938, + "recall_q95": 0.944954128440367, + "false_alarm_q95": 0.08695652173913043 + }, + "B_coreset_frozen": { + "auroc": 0.9664938173115277, + "pixel_auroc": 0.991324612478818, + "average_precision": 0.9903008820676737, + "recall_q95": 0.926605504587156, + "false_alarm_q95": 0.08695652173913043 + }, + "C_coreset_tuned": { + "auroc": 0.9672915835660152, + "pixel_auroc": 0.9915329694561819, + "average_precision": 0.9909214716542951, + "recall_q95": 0.9541284403669725, + "false_alarm_q95": 0.08695652173913043 + } + }, + "differences": { + "B-A": [ + -0.0003988831272436766, + 0.022736338252891897 + ], + "C-B": [ + -0.0035899481451934223, + 0.0063821300358994915 + ], + "C-A": [ + -0.0011966493817311408, + 0.025528520143597966 + ] + } + }, + "carpet": { + "n_test": 117, + "arms": { + "A_random_frozen": { + "auroc": 1.0, + "pixel_auroc": 0.8782802953235477, + "average_precision": 1.0, + "recall_q95": 1.0, + "false_alarm_q95": 0.25 + }, + "B_coreset_frozen": { + "auroc": 1.0, + "pixel_auroc": 0.8753909427535372, + "average_precision": 1.0, + "recall_q95": 1.0, + "false_alarm_q95": 0.25 + }, + "C_coreset_tuned": { + "auroc": 1.0, + "pixel_auroc": 0.9022536733307487, + "average_precision": 1.0, + "recall_q95": 1.0, + "false_alarm_q95": 0.17857142857142858 + } + }, + "differences": { + "B-A": [ + 0.0, + 0.0 + ], + "C-B": [ + 0.0, + 0.0 + ], + "C-A": [ + 0.0, + 0.0 + ] + } + }, + "grid": { + "n_test": 78, + "arms": { + "A_random_frozen": { + "auroc": 1.0, + "pixel_auroc": 0.9600237262649793, + "average_precision": 1.0000000000000002, + "recall_q95": 1.0, + "false_alarm_q95": 0.09523809523809523 + }, + "B_coreset_frozen": { + "auroc": 1.0, + "pixel_auroc": 0.95931946730094, + "average_precision": 1.0000000000000002, + "recall_q95": 1.0, + "false_alarm_q95": 0.14285714285714285 + }, + "C_coreset_tuned": { + "auroc": 1.0, + "pixel_auroc": 0.9550026041753917, + "average_precision": 1.0000000000000002, + "recall_q95": 1.0, + "false_alarm_q95": 0.14285714285714285 + } + }, + "differences": { + "B-A": [ + 0.0, + 0.0 + ], + "C-B": [ + 0.0, + 0.0 + ], + "C-A": [ + 0.0, + 0.0 + ] + } + }, + "hazelnut": { + "n_test": 110, + "arms": { + "A_random_frozen": { + "auroc": 0.9996428571428572, + "pixel_auroc": 0.9959695447661856, + "average_precision": 0.999798792756539, + "recall_q95": 1.0, + "false_alarm_q95": 0.125 + }, + "B_coreset_frozen": { + "auroc": 0.9992857142857143, + "pixel_auroc": 0.9962781627397679, + "average_precision": 0.9996031746031744, + "recall_q95": 1.0, + "false_alarm_q95": 0.05 + }, + "C_coreset_tuned": { + "auroc": 0.9992857142857143, + "pixel_auroc": 0.9963594732333338, + "average_precision": 0.9996031746031744, + "recall_q95": 1.0, + "false_alarm_q95": 0.05 + } + }, + "differences": { + "B-A": [ + -0.002142857142857224, + 0.0 + ], + "C-B": [ + 0.0, + 0.0 + ], + "C-A": [ + -0.002142857142857113, + 0.0 + ] + } + }, + "leather": { + "n_test": 124, + "arms": { + "A_random_frozen": { + "auroc": 1.0, + "pixel_auroc": 0.6293198404724963, + "average_precision": 1.0000000000000002, + "recall_q95": 1.0, + "false_alarm_q95": 0.28125 + }, + "B_coreset_frozen": { + "auroc": 1.0, + "pixel_auroc": 0.6276518875017026, + "average_precision": 1.0000000000000002, + "recall_q95": 1.0, + "false_alarm_q95": 0.3125 + }, + "C_coreset_tuned": { + "auroc": 1.0, + "pixel_auroc": 0.5622606077477578, + "average_precision": 1.0000000000000002, + "recall_q95": 1.0, + "false_alarm_q95": 0.375 + } + }, + "differences": { + "B-A": [ + 0.0, + 0.0 + ], + "C-B": [ + 0.0, + 0.0 + ], + "C-A": [ + 0.0, + 0.0 + ] + } + }, + "metal_nut": { + "n_test": 115, + "arms": { + "A_random_frozen": { + "auroc": 1.0, + "pixel_auroc": 0.9757335718112187, + "average_precision": 1.0, + "recall_q95": 1.0, + "false_alarm_q95": 0.09090909090909091 + }, + "B_coreset_frozen": { + "auroc": 1.0, + "pixel_auroc": 0.9801457112892008, + "average_precision": 1.0, + "recall_q95": 1.0, + "false_alarm_q95": 0.36363636363636365 + }, + "C_coreset_tuned": { + "auroc": 1.0, + "pixel_auroc": 0.9758987716644242, + "average_precision": 1.0, + "recall_q95": 1.0, + "false_alarm_q95": 0.36363636363636365 + } + }, + "differences": { + "B-A": [ + 0.0, + 0.0 + ], + "C-B": [ + 0.0, + 0.0 + ], + "C-A": [ + 0.0, + 0.0 + ] + } + }, + "pill": { + "n_test": 167, + "arms": { + "A_random_frozen": { + "auroc": 0.9768139661756683, + "pixel_auroc": 0.9764136485436904, + "average_precision": 0.9955071573751723, + "recall_q95": 0.9148936170212766, + "false_alarm_q95": 0.07692307692307693 + }, + "B_coreset_frozen": { + "auroc": 0.9923622476813966, + "pixel_auroc": 0.9846221922152466, + "average_precision": 0.9985493019444828, + "recall_q95": 0.9361702127659575, + "false_alarm_q95": 0.07692307692307693 + }, + "C_coreset_tuned": { + "auroc": 0.9956355701036552, + "pixel_auroc": 0.9843003715151856, + "average_precision": 0.9991863383134195, + "recall_q95": 0.9432624113475178, + "false_alarm_q95": 0.07692307692307693 + } + }, + "differences": { + "B-A": [ + 0.0016366612111292644, + 0.03327877795962908 + ], + "C-B": [ + 0.0, + 0.010092744135297264 + ], + "C-A": [ + 0.0021822149481723896, + 0.04065057283142393 + ] + } + }, + "screw": { + "n_test": 160, + "arms": { + "A_random_frozen": { + "auroc": 0.9227300676368109, + "pixel_auroc": 0.9881335248366288, + "average_precision": 0.9743848466583075, + "recall_q95": 0.7310924369747899, + "false_alarm_q95": 0.07317073170731707 + }, + "B_coreset_frozen": { + "auroc": 0.9629022340643575, + "pixel_auroc": 0.9916337298019416, + "average_precision": 0.9872623994802119, + "recall_q95": 0.907563025210084, + "false_alarm_q95": 0.04878048780487805 + }, + "C_coreset_tuned": { + "auroc": 0.9606476737036278, + "pixel_auroc": 0.9932704550910754, + "average_precision": 0.9867831778790364, + "recall_q95": 0.8907563025210085, + "false_alarm_q95": 0.04878048780487805 + } + }, + "differences": { + "B-A": [ + 0.0176265628202501, + 0.0676470588235294 + ], + "C-B": [ + -0.008408485345357732, + 0.0028694404591105283 + ], + "C-A": [ + 0.01598688255790115, + 0.0653873744619799 + ] + } + }, + "tile": { + "n_test": 117, + "arms": { + "A_random_frozen": { + "auroc": 1.0, + "pixel_auroc": 0.660602466324687, + "average_precision": 0.9999999999999998, + "recall_q95": 1.0, + "false_alarm_q95": 0.06060606060606061 + }, + "B_coreset_frozen": { + "auroc": 1.0, + "pixel_auroc": 0.6583452031414211, + "average_precision": 0.9999999999999998, + "recall_q95": 1.0, + "false_alarm_q95": 0.06060606060606061 + }, + "C_coreset_tuned": { + "auroc": 1.0, + "pixel_auroc": 0.6045030317268419, + "average_precision": 0.9999999999999998, + "recall_q95": 1.0, + "false_alarm_q95": 0.06060606060606061 + } + }, + "differences": { + "B-A": [ + 0.0, + 0.0 + ], + "C-B": [ + 0.0, + 0.0 + ], + "C-A": [ + 0.0, + 0.0 + ] + } + }, + "toothbrush": { + "n_test": 42, + "arms": { + "A_random_frozen": { + "auroc": 1.0, + "pixel_auroc": 0.9928471256158475, + "average_precision": 0.9999999999999999, + "recall_q95": 1.0, + "false_alarm_q95": 0.0 + }, + "B_coreset_frozen": { + "auroc": 1.0, + "pixel_auroc": 0.9934613716601125, + "average_precision": 0.9999999999999999, + "recall_q95": 1.0, + "false_alarm_q95": 0.0 + }, + "C_coreset_tuned": { + "auroc": 1.0, + "pixel_auroc": 0.9939192684582632, + "average_precision": 0.9999999999999999, + "recall_q95": 1.0, + "false_alarm_q95": 0.0 + } + }, + "differences": { + "B-A": [ + 0.0, + 0.0 + ], + "C-B": [ + 0.0, + 0.0 + ], + "C-A": [ + 0.0, + 0.0 + ] + } + }, + "transistor": { + "n_test": 100, + "arms": { + "A_random_frozen": { + "auroc": 0.9970833333333333, + "pixel_auroc": 0.8617579436776412, + "average_precision": 0.9957863017583666, + "recall_q95": 0.85, + "false_alarm_q95": 0.0 + }, + "B_coreset_frozen": { + "auroc": 0.9995833333333334, + "pixel_auroc": 0.8665474098596695, + "average_precision": 0.9993902439024391, + "recall_q95": 0.875, + "false_alarm_q95": 0.0 + }, + "C_coreset_tuned": { + "auroc": 0.9995833333333334, + "pixel_auroc": 0.8637275221370349, + "average_precision": 0.9993902439024391, + "recall_q95": 0.9, + "false_alarm_q95": 0.0 + } + }, + "differences": { + "B-A": [ + -0.0008333333333332444, + 0.009166666666666656 + ], + "C-B": [ + 0.0, + 0.0 + ], + "C-A": [ + -0.0004166666666667318, + 0.009583333333333388 + ] + } + }, + "wood": { + "n_test": 79, + "arms": { + "A_random_frozen": { + "auroc": 0.9798245614035088, + "pixel_auroc": 0.7372840736412815, + "average_precision": 0.994189310801887, + "recall_q95": 0.9833333333333333, + "false_alarm_q95": 0.42105263157894735 + }, + "B_coreset_frozen": { + "auroc": 0.9859649122807017, + "pixel_auroc": 0.7391479058833798, + "average_precision": 0.9959057458108692, + "recall_q95": 0.9833333333333333, + "false_alarm_q95": 0.42105263157894735 + }, + "C_coreset_tuned": { + "auroc": 0.9736842105263158, + "pixel_auroc": 0.7155723356563095, + "average_precision": 0.992339434475335, + "recall_q95": 0.9833333333333333, + "false_alarm_q95": 0.42105263157894735 + } + }, + "differences": { + "B-A": [ + 0.0, + 0.018421052631579005 + ], + "C-B": [ + -0.033333333333333326, + -0.0008771929824561431 + ], + "C-A": [ + -0.02543859649122815, + 0.007894736842105177 + ] + } + }, + "zipper": { + "n_test": 151, + "arms": { + "A_random_frozen": { + "auroc": 0.9934348739495799, + "pixel_auroc": 0.7722863737418493, + "average_precision": 0.9985410830999064, + "recall_q95": 0.9915966386554622, + "false_alarm_q95": 0.1875 + }, + "B_coreset_frozen": { + "auroc": 0.9936974789915967, + "pixel_auroc": 0.7877123375934348, + "average_precision": 0.9985311479963884, + "recall_q95": 0.9915966386554622, + "false_alarm_q95": 0.5 + }, + "C_coreset_tuned": { + "auroc": 0.9955357142857143, + "pixel_auroc": 0.7952347548341744, + "average_precision": 0.9989334295809825, + "recall_q95": 0.9915966386554622, + "false_alarm_q95": 0.34375 + } + }, + "differences": { + "B-A": [ + -0.0031512605042016695, + 0.003939075630252087 + ], + "C-B": [ + 0.0, + 0.005777310924369727 + ], + "C-A": [ + -0.0007878151260504174, + 0.008403361344537896 + ] + } + } + } + } + }, + "attribution": "VisA \u00b7 Zou et al., ECCV 2022 \u00b7 CC BY 4.0 \u00b7 resized images and model overlays", + "source": "https://github.com/amazon-science/spot-diff" } \ No newline at end of file diff --git a/frontend/dist/showcase/images/031ddcf70ba240dd98baf8932b418b12.jpg b/frontend/dist/showcase/images/031ddcf70ba240dd98baf8932b418b12.jpg new file mode 100644 index 0000000000000000000000000000000000000000..f1e286faf3b16c8e42be5ee9293d5c585cc359bf Binary files /dev/null and b/frontend/dist/showcase/images/031ddcf70ba240dd98baf8932b418b12.jpg differ diff --git a/frontend/dist/showcase/images/031ddcf70ba240dd98baf8932b418b12_heatmap.jpg b/frontend/dist/showcase/images/031ddcf70ba240dd98baf8932b418b12_heatmap.jpg new file mode 100644 index 0000000000000000000000000000000000000000..b212e6188572ffa19600007a1d6939f225ff43ac Binary files /dev/null and b/frontend/dist/showcase/images/031ddcf70ba240dd98baf8932b418b12_heatmap.jpg differ diff --git a/frontend/dist/showcase/images/1213d696bd724a2e9d4ad4af04bda78c.jpg b/frontend/dist/showcase/images/1213d696bd724a2e9d4ad4af04bda78c.jpg new file mode 100644 index 0000000000000000000000000000000000000000..0f7bbe015ba5c0fd2bea7868c02730a7fbd07f4d Binary files /dev/null and b/frontend/dist/showcase/images/1213d696bd724a2e9d4ad4af04bda78c.jpg differ diff --git a/frontend/dist/showcase/images/1213d696bd724a2e9d4ad4af04bda78c_heatmap.jpg b/frontend/dist/showcase/images/1213d696bd724a2e9d4ad4af04bda78c_heatmap.jpg new file mode 100644 index 0000000000000000000000000000000000000000..0d4acdec717341ec84aad00951e4d452e39b53a3 Binary files /dev/null and b/frontend/dist/showcase/images/1213d696bd724a2e9d4ad4af04bda78c_heatmap.jpg differ diff --git a/frontend/dist/showcase/images/1c68ef87cd4b4e10a7efab1b5107d59b.jpg b/frontend/dist/showcase/images/1c68ef87cd4b4e10a7efab1b5107d59b.jpg new file mode 100644 index 0000000000000000000000000000000000000000..345c36cd9483a6aad892ff0ebd1fd0ab4deef826 --- /dev/null +++ b/frontend/dist/showcase/images/1c68ef87cd4b4e10a7efab1b5107d59b.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3c5316ce730e9238c859257b3ff5a02659f2dd92073d2c7558d2d9866ce1d179 +size 119710 diff --git a/frontend/dist/showcase/images/1c68ef87cd4b4e10a7efab1b5107d59b_heatmap.jpg b/frontend/dist/showcase/images/1c68ef87cd4b4e10a7efab1b5107d59b_heatmap.jpg new file mode 100644 index 0000000000000000000000000000000000000000..a305da0a84fd89a6676777c15b00e7010c6b7fde --- /dev/null +++ b/frontend/dist/showcase/images/1c68ef87cd4b4e10a7efab1b5107d59b_heatmap.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b89622ff0612c5cf9dc0a97fd09026efba1ce5ff1432f8360b5249dbadebf360 +size 108023 diff --git a/frontend/dist/showcase/images/24610e481ba14990be2b059b435ec8d1.jpg b/frontend/dist/showcase/images/24610e481ba14990be2b059b435ec8d1.jpg new file mode 100644 index 0000000000000000000000000000000000000000..fa57751163d8d100954e839714b8edf453906021 --- /dev/null +++ b/frontend/dist/showcase/images/24610e481ba14990be2b059b435ec8d1.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:214d3c9b05db78355091e88ca0761a5f9c3eddd48818b6c6ab389feb24d4e543 +size 108908 diff --git a/frontend/dist/showcase/images/24610e481ba14990be2b059b435ec8d1_heatmap.jpg b/frontend/dist/showcase/images/24610e481ba14990be2b059b435ec8d1_heatmap.jpg new file mode 100644 index 0000000000000000000000000000000000000000..dcf538ca7770cb48f9b92a423fed6fe940d78711 Binary files /dev/null and b/frontend/dist/showcase/images/24610e481ba14990be2b059b435ec8d1_heatmap.jpg differ diff --git a/frontend/dist/showcase/images/27606216a5324123becd9271a9044576.jpg b/frontend/dist/showcase/images/27606216a5324123becd9271a9044576.jpg new file mode 100644 index 0000000000000000000000000000000000000000..42d592696ab1259f4f88f565a157acaa3c029e01 Binary files /dev/null and b/frontend/dist/showcase/images/27606216a5324123becd9271a9044576.jpg differ diff --git a/frontend/dist/showcase/images/27606216a5324123becd9271a9044576_heatmap.jpg b/frontend/dist/showcase/images/27606216a5324123becd9271a9044576_heatmap.jpg new file mode 100644 index 0000000000000000000000000000000000000000..cd082e52dccbfbcda2e9819595a05cc0b4705aa7 Binary files /dev/null and b/frontend/dist/showcase/images/27606216a5324123becd9271a9044576_heatmap.jpg differ diff --git a/frontend/dist/showcase/images/4bff5e6b5e064383a9b85a8a6bec04cc.jpg b/frontend/dist/showcase/images/4bff5e6b5e064383a9b85a8a6bec04cc.jpg new file mode 100644 index 0000000000000000000000000000000000000000..95f8871acaf36a85b9af54b936fe888601ff534f Binary files /dev/null and b/frontend/dist/showcase/images/4bff5e6b5e064383a9b85a8a6bec04cc.jpg differ diff --git a/frontend/dist/showcase/images/4bff5e6b5e064383a9b85a8a6bec04cc_heatmap.jpg b/frontend/dist/showcase/images/4bff5e6b5e064383a9b85a8a6bec04cc_heatmap.jpg new file mode 100644 index 0000000000000000000000000000000000000000..841f898bc6453be036ed3bba372d3d7a20985739 Binary files /dev/null and b/frontend/dist/showcase/images/4bff5e6b5e064383a9b85a8a6bec04cc_heatmap.jpg differ diff --git a/frontend/dist/showcase/images/57cbced2975740d2b7845b1660aad8b6.jpg b/frontend/dist/showcase/images/57cbced2975740d2b7845b1660aad8b6.jpg new file mode 100644 index 0000000000000000000000000000000000000000..d7abf869238e18f2411e24204e683ef7f7a83c49 Binary files /dev/null and b/frontend/dist/showcase/images/57cbced2975740d2b7845b1660aad8b6.jpg differ diff --git a/frontend/dist/showcase/images/57cbced2975740d2b7845b1660aad8b6_heatmap.jpg b/frontend/dist/showcase/images/57cbced2975740d2b7845b1660aad8b6_heatmap.jpg new file mode 100644 index 0000000000000000000000000000000000000000..78ec758f80d18a5c81a367f68660faaf8fea24b3 Binary files /dev/null and b/frontend/dist/showcase/images/57cbced2975740d2b7845b1660aad8b6_heatmap.jpg differ diff --git a/frontend/dist/showcase/images/66ab22d8050144f78e9b9c1b4c7b0b9e.jpg b/frontend/dist/showcase/images/66ab22d8050144f78e9b9c1b4c7b0b9e.jpg new file mode 100644 index 0000000000000000000000000000000000000000..b09b33bf6d806fa9710e23811a062c5f7d5a5844 Binary files /dev/null and b/frontend/dist/showcase/images/66ab22d8050144f78e9b9c1b4c7b0b9e.jpg differ diff --git a/frontend/dist/showcase/images/66ab22d8050144f78e9b9c1b4c7b0b9e_heatmap.jpg b/frontend/dist/showcase/images/66ab22d8050144f78e9b9c1b4c7b0b9e_heatmap.jpg new file mode 100644 index 0000000000000000000000000000000000000000..18fff1e61619114bbabe09eb12c938a319f94f58 Binary files /dev/null and b/frontend/dist/showcase/images/66ab22d8050144f78e9b9c1b4c7b0b9e_heatmap.jpg differ diff --git a/frontend/dist/showcase/images/6f8af69aa59d40b488d5d864f502224d.jpg b/frontend/dist/showcase/images/6f8af69aa59d40b488d5d864f502224d.jpg new file mode 100644 index 0000000000000000000000000000000000000000..9c295eb25bf7c72204d3cbeca8a894417c59a713 --- /dev/null +++ b/frontend/dist/showcase/images/6f8af69aa59d40b488d5d864f502224d.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:11bca634191651edd3844cce54de5759ed1aafde38098377ac80f6a8638a0a67 +size 145978 diff --git a/frontend/dist/showcase/images/6f8af69aa59d40b488d5d864f502224d_heatmap.jpg b/frontend/dist/showcase/images/6f8af69aa59d40b488d5d864f502224d_heatmap.jpg new file mode 100644 index 0000000000000000000000000000000000000000..a1848737984ae5a4cfdb807049caf69ed3ff39d6 --- /dev/null +++ b/frontend/dist/showcase/images/6f8af69aa59d40b488d5d864f502224d_heatmap.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:16f45bd7d09e1935ff8bdd21c8f22e87a0ce0fb9d89e64ebf869d622a843aeed +size 131220 diff --git a/frontend/dist/showcase/images/73effc650ddc4de9a1a8a35aa011c71b.jpg b/frontend/dist/showcase/images/73effc650ddc4de9a1a8a35aa011c71b.jpg new file mode 100644 index 0000000000000000000000000000000000000000..188095dd60c831abe84fa7ff8f5af2a58572c28a Binary files /dev/null and b/frontend/dist/showcase/images/73effc650ddc4de9a1a8a35aa011c71b.jpg differ diff --git a/frontend/dist/showcase/images/73effc650ddc4de9a1a8a35aa011c71b_heatmap.jpg b/frontend/dist/showcase/images/73effc650ddc4de9a1a8a35aa011c71b_heatmap.jpg new file mode 100644 index 0000000000000000000000000000000000000000..0f14e7fcc716ebb8d2aff5bb7821894a0a8c9e9a Binary files /dev/null and b/frontend/dist/showcase/images/73effc650ddc4de9a1a8a35aa011c71b_heatmap.jpg differ diff --git a/frontend/dist/showcase/images/7a353aa7a8124a0dbe8440f40c282ff4.jpg b/frontend/dist/showcase/images/7a353aa7a8124a0dbe8440f40c282ff4.jpg new file mode 100644 index 0000000000000000000000000000000000000000..9d74d08a88029f40a4ad2bd9ce2c929207139210 Binary files /dev/null and b/frontend/dist/showcase/images/7a353aa7a8124a0dbe8440f40c282ff4.jpg differ diff --git a/frontend/dist/showcase/images/7a353aa7a8124a0dbe8440f40c282ff4_heatmap.jpg b/frontend/dist/showcase/images/7a353aa7a8124a0dbe8440f40c282ff4_heatmap.jpg new file mode 100644 index 0000000000000000000000000000000000000000..c608950e8eadb639de3b5fa4fd86d3203c2d6489 Binary files /dev/null and b/frontend/dist/showcase/images/7a353aa7a8124a0dbe8440f40c282ff4_heatmap.jpg differ diff --git a/frontend/dist/showcase/images/861bd29ac3e34efc89c18aad4befcb0a.jpg b/frontend/dist/showcase/images/861bd29ac3e34efc89c18aad4befcb0a.jpg new file mode 100644 index 0000000000000000000000000000000000000000..5f7f4ea6cdc465134197f78985f4f45cbe16222d --- /dev/null +++ b/frontend/dist/showcase/images/861bd29ac3e34efc89c18aad4befcb0a.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cd47c08948743253fea93313454dbbe18c2337ff9930c5c7bd75bb125042a386 +size 116369 diff --git a/frontend/dist/showcase/images/861bd29ac3e34efc89c18aad4befcb0a_heatmap.jpg b/frontend/dist/showcase/images/861bd29ac3e34efc89c18aad4befcb0a_heatmap.jpg new file mode 100644 index 0000000000000000000000000000000000000000..883828c49e49945f2096de7d6d7cb7716943d807 --- /dev/null +++ b/frontend/dist/showcase/images/861bd29ac3e34efc89c18aad4befcb0a_heatmap.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c65700d5c0c625bb9fdb8000c62fb290007168f82098d079d26041cab84f7ac3 +size 105726 diff --git a/frontend/dist/showcase/images/944d0897857e443b96ab5e30747cef96.jpg b/frontend/dist/showcase/images/944d0897857e443b96ab5e30747cef96.jpg new file mode 100644 index 0000000000000000000000000000000000000000..4ef4b663b9a38344588337ceeb131df9d1dc15a4 Binary files /dev/null and b/frontend/dist/showcase/images/944d0897857e443b96ab5e30747cef96.jpg differ diff --git a/frontend/dist/showcase/images/944d0897857e443b96ab5e30747cef96_heatmap.jpg b/frontend/dist/showcase/images/944d0897857e443b96ab5e30747cef96_heatmap.jpg new file mode 100644 index 0000000000000000000000000000000000000000..8ae203812c3c4b34f40e65eec442eb86612c82f7 Binary files /dev/null and b/frontend/dist/showcase/images/944d0897857e443b96ab5e30747cef96_heatmap.jpg differ diff --git a/frontend/dist/showcase/images/99e5aca39a094033b059ed2ece1e4c7a.jpg b/frontend/dist/showcase/images/99e5aca39a094033b059ed2ece1e4c7a.jpg new file mode 100644 index 0000000000000000000000000000000000000000..9cb340f6bb217d3d425decf5b265272e41073163 Binary files /dev/null and b/frontend/dist/showcase/images/99e5aca39a094033b059ed2ece1e4c7a.jpg differ diff --git a/frontend/dist/showcase/images/99e5aca39a094033b059ed2ece1e4c7a_heatmap.jpg b/frontend/dist/showcase/images/99e5aca39a094033b059ed2ece1e4c7a_heatmap.jpg new file mode 100644 index 0000000000000000000000000000000000000000..283415c4491cbb2d8f6bb044a3c0f5de015c42d0 Binary files /dev/null and b/frontend/dist/showcase/images/99e5aca39a094033b059ed2ece1e4c7a_heatmap.jpg differ diff --git a/frontend/dist/showcase/images/9b95eb77b39b403bb68311b0cc1a7174.jpg b/frontend/dist/showcase/images/9b95eb77b39b403bb68311b0cc1a7174.jpg new file mode 100644 index 0000000000000000000000000000000000000000..bade06181101743514361af01ea5bba0235e8262 Binary files /dev/null and b/frontend/dist/showcase/images/9b95eb77b39b403bb68311b0cc1a7174.jpg differ diff --git a/frontend/dist/showcase/images/9b95eb77b39b403bb68311b0cc1a7174_heatmap.jpg b/frontend/dist/showcase/images/9b95eb77b39b403bb68311b0cc1a7174_heatmap.jpg new file mode 100644 index 0000000000000000000000000000000000000000..9824ee6f3ecf1d61bb018c7d153a2b4c7f74aaef Binary files /dev/null and b/frontend/dist/showcase/images/9b95eb77b39b403bb68311b0cc1a7174_heatmap.jpg differ diff --git a/frontend/dist/showcase/images/ccaaa807f4834da8b402ca8b46073342.jpg b/frontend/dist/showcase/images/ccaaa807f4834da8b402ca8b46073342.jpg new file mode 100644 index 0000000000000000000000000000000000000000..ad6465c7b6b728ead3b4407eeee24bb87e06e3be --- /dev/null +++ b/frontend/dist/showcase/images/ccaaa807f4834da8b402ca8b46073342.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6b795bcc788eb84d9131ddebe111a5401eba96351c12b4359ffd272dbede097c +size 114809 diff --git a/frontend/dist/showcase/images/ccaaa807f4834da8b402ca8b46073342_heatmap.jpg b/frontend/dist/showcase/images/ccaaa807f4834da8b402ca8b46073342_heatmap.jpg new file mode 100644 index 0000000000000000000000000000000000000000..abbbbd86a36aacab98ce01206ca5026510810f05 --- /dev/null +++ b/frontend/dist/showcase/images/ccaaa807f4834da8b402ca8b46073342_heatmap.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e745f223d96d05479c880b35ac82c440ee455269e4b5967957df0455a240223d +size 104321 diff --git a/frontend/dist/showcase/images/d0aa478ff7b24b86804abfde6689f2d5.jpg b/frontend/dist/showcase/images/d0aa478ff7b24b86804abfde6689f2d5.jpg new file mode 100644 index 0000000000000000000000000000000000000000..27b5bad7e98ae70adfbff615c73a9c7b0845c990 Binary files /dev/null and b/frontend/dist/showcase/images/d0aa478ff7b24b86804abfde6689f2d5.jpg differ diff --git a/frontend/dist/showcase/images/d0aa478ff7b24b86804abfde6689f2d5_heatmap.jpg b/frontend/dist/showcase/images/d0aa478ff7b24b86804abfde6689f2d5_heatmap.jpg new file mode 100644 index 0000000000000000000000000000000000000000..ff827c336b46470bc7294b24b2c77907bb0f0585 Binary files /dev/null and b/frontend/dist/showcase/images/d0aa478ff7b24b86804abfde6689f2d5_heatmap.jpg differ diff --git a/frontend/dist/showcase/images/da28cabe417a4f7f9d81faa0b6ce4146.jpg b/frontend/dist/showcase/images/da28cabe417a4f7f9d81faa0b6ce4146.jpg new file mode 100644 index 0000000000000000000000000000000000000000..5e37ab319c0e65776250dfddbea1ccb8fdc35ffe Binary files /dev/null and b/frontend/dist/showcase/images/da28cabe417a4f7f9d81faa0b6ce4146.jpg differ diff --git a/frontend/dist/showcase/images/da28cabe417a4f7f9d81faa0b6ce4146_heatmap.jpg b/frontend/dist/showcase/images/da28cabe417a4f7f9d81faa0b6ce4146_heatmap.jpg new file mode 100644 index 0000000000000000000000000000000000000000..05550f838a5bdb69187b61208dac30fb1cc73e55 Binary files /dev/null and b/frontend/dist/showcase/images/da28cabe417a4f7f9d81faa0b6ce4146_heatmap.jpg differ diff --git a/frontend/dist/showcase/images/da5e3a7125564152afd03d26ef3fb38b.jpg b/frontend/dist/showcase/images/da5e3a7125564152afd03d26ef3fb38b.jpg new file mode 100644 index 0000000000000000000000000000000000000000..c37da1356f72480f91b4954e80b42253ea3138a2 Binary files /dev/null and b/frontend/dist/showcase/images/da5e3a7125564152afd03d26ef3fb38b.jpg differ diff --git a/frontend/dist/showcase/images/da5e3a7125564152afd03d26ef3fb38b_heatmap.jpg b/frontend/dist/showcase/images/da5e3a7125564152afd03d26ef3fb38b_heatmap.jpg new file mode 100644 index 0000000000000000000000000000000000000000..1ffc2b646f452097c0c77cf889817a50488753d5 Binary files /dev/null and b/frontend/dist/showcase/images/da5e3a7125564152afd03d26ef3fb38b_heatmap.jpg differ diff --git a/frontend/dist/showcase/images/def5b9b862a447ac8c61e168af28c263.jpg b/frontend/dist/showcase/images/def5b9b862a447ac8c61e168af28c263.jpg new file mode 100644 index 0000000000000000000000000000000000000000..4e81fe5ae1322da3ec4a4bba01ea396ce805df59 --- /dev/null +++ b/frontend/dist/showcase/images/def5b9b862a447ac8c61e168af28c263.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6b3c74ebde10a6bd5e37c7ab76724e6a8ee05de19b9aed10280ba702b6fdc7d1 +size 160843 diff --git a/frontend/dist/showcase/images/def5b9b862a447ac8c61e168af28c263_heatmap.jpg b/frontend/dist/showcase/images/def5b9b862a447ac8c61e168af28c263_heatmap.jpg new file mode 100644 index 0000000000000000000000000000000000000000..a0025d5985f1f11168a3b267008f49712ff1852b --- /dev/null +++ b/frontend/dist/showcase/images/def5b9b862a447ac8c61e168af28c263_heatmap.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0e40332a04f3f3f4604bd5cc78bc9e6bf65345bb7f82510e13118919ce8f7f2c +size 144406 diff --git a/frontend/dist/showcase/images/e80a1c06812b46858fe77c8dcba49e0d.jpg b/frontend/dist/showcase/images/e80a1c06812b46858fe77c8dcba49e0d.jpg new file mode 100644 index 0000000000000000000000000000000000000000..49ab3b0182424593603e946dd9945bb0552194a0 Binary files /dev/null and b/frontend/dist/showcase/images/e80a1c06812b46858fe77c8dcba49e0d.jpg differ diff --git a/frontend/dist/showcase/images/e80a1c06812b46858fe77c8dcba49e0d_heatmap.jpg b/frontend/dist/showcase/images/e80a1c06812b46858fe77c8dcba49e0d_heatmap.jpg new file mode 100644 index 0000000000000000000000000000000000000000..6dd29159d5c8d955c3b2199df46ad588b6104958 Binary files /dev/null and b/frontend/dist/showcase/images/e80a1c06812b46858fe77c8dcba49e0d_heatmap.jpg differ diff --git a/frontend/dist/showcase/images/f844a1e1a3c84cb7883c22af86f37dd2.jpg b/frontend/dist/showcase/images/f844a1e1a3c84cb7883c22af86f37dd2.jpg new file mode 100644 index 0000000000000000000000000000000000000000..64d94a94900b4ebd85121c00dc16faa30bff790e Binary files /dev/null and b/frontend/dist/showcase/images/f844a1e1a3c84cb7883c22af86f37dd2.jpg differ diff --git a/frontend/dist/showcase/images/f844a1e1a3c84cb7883c22af86f37dd2_heatmap.jpg b/frontend/dist/showcase/images/f844a1e1a3c84cb7883c22af86f37dd2_heatmap.jpg new file mode 100644 index 0000000000000000000000000000000000000000..26f144bdc3e261c950f4dc9ab24d0b4ed1c03387 Binary files /dev/null and b/frontend/dist/showcase/images/f844a1e1a3c84cb7883c22af86f37dd2_heatmap.jpg differ diff --git a/frontend/dist/showcase/images/f92d581f4bc64724b9f3fffb8e38f709.jpg b/frontend/dist/showcase/images/f92d581f4bc64724b9f3fffb8e38f709.jpg new file mode 100644 index 0000000000000000000000000000000000000000..75e2e97e17f36205bf4ed5ee0801957c9099dc6f Binary files /dev/null and b/frontend/dist/showcase/images/f92d581f4bc64724b9f3fffb8e38f709.jpg differ diff --git a/frontend/dist/showcase/images/f92d581f4bc64724b9f3fffb8e38f709_heatmap.jpg b/frontend/dist/showcase/images/f92d581f4bc64724b9f3fffb8e38f709_heatmap.jpg new file mode 100644 index 0000000000000000000000000000000000000000..df3d9f496d010295bbb35420a3ad08524880d53b Binary files /dev/null and b/frontend/dist/showcase/images/f92d581f4bc64724b9f3fffb8e38f709_heatmap.jpg differ diff --git a/frontend/dist/showcase/images/fed8c208317840b2a0c6bea6f404bbc8.jpg b/frontend/dist/showcase/images/fed8c208317840b2a0c6bea6f404bbc8.jpg new file mode 100644 index 0000000000000000000000000000000000000000..65536ea21d0ab8b77b61772559d22a858f3ba5e3 Binary files /dev/null and b/frontend/dist/showcase/images/fed8c208317840b2a0c6bea6f404bbc8.jpg differ diff --git a/frontend/dist/showcase/images/fed8c208317840b2a0c6bea6f404bbc8_heatmap.jpg b/frontend/dist/showcase/images/fed8c208317840b2a0c6bea6f404bbc8_heatmap.jpg new file mode 100644 index 0000000000000000000000000000000000000000..9d3c2885f5766e66875cd1a472a8175efc595d73 Binary files /dev/null and b/frontend/dist/showcase/images/fed8c208317840b2a0c6bea6f404bbc8_heatmap.jpg differ diff --git a/frontend/dist/showcase/inspections.csv b/frontend/dist/showcase/inspections.csv index 1d8a51d694308bce18bcf585a80cb7c2c857578e..1c569e223dc76fe9772d29e5e1bb37220a73db92 100644 --- a/frontend/dist/showcase/inspections.csv +++ b/frontend/dist/showcase/inspections.csv @@ -1,26 +1,25 @@ id,created_at,category,verdict,score,threshold,uncertainty_margin,inference_ms,model_id -18c7586f94de4b6d8ef773779f7cea2f,2026-10-16T01:54:06.141819+00:00,pcb1,Good,0.029462307691574097,0.047802507877349854,0.0023901253938674928,626.97,dinov3-normal-bank-pcb1-v1 -52ee2c6d54934fcfaffb0f273c70dc87,2026-10-16T01:54:06.454213+00:00,pcb1,Anomalous,0.09511521458625793,0.047802507877349854,0.0023901253938674928,79.49,dinov3-normal-bank-pcb1-v1 -e701c08ef3264b20bcb11149f734b219,2026-10-16T01:54:06.826573+00:00,capsules,Uncertain,0.04526650905609131,0.04728597402572632,0.0023642987012863163,47.72,dinov3-normal-bank-capsules-v1 -e3964b50d4cf4860a1f7a926d1ae444a,2026-10-16T01:54:07.099544+00:00,capsules,Anomalous,0.06019875407218933,0.04728597402572632,0.0023642987012863163,53.84,dinov3-normal-bank-capsules-v1 -b5d1bd5c7ed1493ab8f4a849eeeb7712,2026-10-16T01:54:07.485318+00:00,cashew,Good,0.030725598335266113,0.051523059606552124,0.0025761529803276064,53.57,dinov3-normal-bank-cashew-v1 -3243fbe65d59477b9811da0f306535aa,2026-10-16T01:54:07.777072+00:00,cashew,Anomalous,0.07818332314491272,0.051523059606552124,0.0025761529803276064,51.4,dinov3-normal-bank-cashew-v1 -a6226ef392eb417e8991369e890d816b,2026-10-16T03:37:21.911121+00:00,pcb1,Anomalous,0.09611436724662781,0.047802507877349854,0.0023901253938674928,38.44,dinov3-normal-bank-pcb1-v1 -14418c36d94648adbdbc2779a6a33b3c,2026-10-16T05:04:08.792238+00:00,candle,Good,0.022238105535507202,0.04235455393791199,0.0021177276968955996,373.68,dinov3-normal-bank-candle-v1 -7dbb6f27253b450698a1a503cfa9a8c8,2026-10-16T05:04:09.045272+00:00,candle,Anomalous,0.046729326248168945,0.04235455393791199,0.0021177276968955996,34.73,dinov3-normal-bank-candle-v1 -6082416ed1c34be6a4fccd7e406f4a34,2026-10-16T05:04:09.292761+00:00,chewinggum,Good,0.03845283389091492,0.06446045637130737,0.003223022818565369,37.45,dinov3-normal-bank-chewinggum-v1 -dcc3e255b90f466c9087d7e09af1a661,2026-10-16T05:04:09.469926+00:00,chewinggum,Anomalous,0.09018924832344055,0.06446045637130737,0.003223022818565369,29.3,dinov3-normal-bank-chewinggum-v1 -d9023f03ff7945d8928216e8df02a620,2026-10-16T05:04:09.704431+00:00,fryum,Good,0.02073901891708374,0.031331419944763184,0.0015665709972381592,31.32,dinov3-normal-bank-fryum-v1 -118f64eaadfe43ce8b27b955a82c37ba,2026-10-16T05:04:09.853046+00:00,fryum,Uncertain,0.03211769461631775,0.031331419944763184,0.0015665709972381592,29.33,dinov3-normal-bank-fryum-v1 -e335298e27e843c38d81accf54fdb399,2026-10-16T05:04:10.096196+00:00,macaroni1,Anomalous,0.0720357894897461,0.04998299479484558,0.002499149739742279,29.82,dinov3-normal-bank-macaroni1-v1 -1a5f9735b7dd44f18995b62e871ee3b7,2026-10-16T05:04:10.240752+00:00,macaroni1,Good,0.04587012529373169,0.04998299479484558,0.002499149739742279,29.49,dinov3-normal-bank-macaroni1-v1 -d03553a7af274bba808fe090d4a7912b,2026-10-16T05:04:10.476998+00:00,macaroni2,Anomalous,0.07178214192390442,0.056429386138916016,0.002821469306945801,28.18,dinov3-normal-bank-macaroni2-v1 -232cbf03a23f4eb2a3793fa1628e5f9c,2026-10-16T05:04:10.617141+00:00,macaroni2,Uncertain,0.055811017751693726,0.056429386138916016,0.002821469306945801,28.8,dinov3-normal-bank-macaroni2-v1 -99d47a61108f4581b59c6fac6bfc224f,2026-10-16T05:04:10.847182+00:00,pcb2,Anomalous,0.0873120129108429,0.03412127494812012,0.0017060637474060059,28.92,dinov3-normal-bank-pcb2-v1 -c6222fddf36d4c788ae4e96994b3e02b,2026-10-16T05:04:11.008753+00:00,pcb2,Anomalous,0.04729834198951721,0.03412127494812012,0.0017060637474060059,33.07,dinov3-normal-bank-pcb2-v1 -2cb0f86c14d344019b28f77f4628257f,2026-10-16T05:04:11.261839+00:00,pcb3,Anomalous,0.052754610776901245,0.04104718565940857,0.0020523592829704285,27.26,dinov3-normal-bank-pcb3-v1 -b43a98329ac646ef90f19861345d0884,2026-10-16T05:04:11.412727+00:00,pcb3,Uncertain,0.04286506772041321,0.04104718565940857,0.0020523592829704285,31.02,dinov3-normal-bank-pcb3-v1 -d182ffb0791744d08f112d7321e69f1d,2026-10-16T05:04:11.654455+00:00,pcb4,Good,0.040615081787109375,0.043793290853500366,0.0021896645426750182,27.27,dinov3-normal-bank-pcb4-v1 -09c2eda2da134adf829057bc0a4faccb,2026-10-16T05:04:11.824898+00:00,pcb4,Anomalous,0.05046689510345459,0.043793290853500366,0.0021896645426750182,35.16,dinov3-normal-bank-pcb4-v1 -3c255e6f989c4bee88941ef44c2f81dc,2026-10-16T05:04:12.082369+00:00,pipe_fryum,Good,0.04459744691848755,0.05846443772315979,0.0029232218861579896,28.43,dinov3-normal-bank-pipe_fryum-v1 -eba4738a39db4a3192230964d15853bc,2026-10-16T05:04:12.265434+00:00,pipe_fryum,Anomalous,0.08141562342643738,0.05846443772315979,0.0029232218861579896,27.96,dinov3-normal-bank-pipe_fryum-v1 +4bff5e6b5e064383a9b85a8a6bec04cc,2026-11-07T04:31:09.136511+00:00,candle,Anomalous,0.19342294335365295,0.10769653692841528,0.005384826846420765,31.12,dinov2-tuned-candle-v1 +da5e3a7125564152afd03d26ef3fb38b,2026-11-07T04:31:09.248891+00:00,candle,Good,0.07099495828151703,0.10769653692841528,0.005384826846420765,29.68,dinov2-tuned-candle-v1 +66ab22d8050144f78e9b9c1b4c7b0b9e,2026-11-07T04:31:08.115707+00:00,capsules,Anomalous,0.161866694688797,0.10395566150546073,0.005197783075273037,39.56,dinov2-tuned-capsules-v1 +da28cabe417a4f7f9d81faa0b6ce4146,2026-11-07T04:31:08.274601+00:00,capsules,Good,0.09077998250722885,0.10395566150546073,0.005197783075273037,47.05,dinov2-tuned-capsules-v1 +def5b9b862a447ac8c61e168af28c263,2026-11-07T04:31:08.612264+00:00,cashew,Anomalous,0.19361598789691925,0.10727595388889313,0.005363797694444657,32.13,dinov2-tuned-cashew-v1 +6f8af69aa59d40b488d5d864f502224d,2026-11-07T04:31:08.773329+00:00,cashew,Uncertain,0.10972827672958374,0.10727595388889313,0.005363797694444657,38.08,dinov2-tuned-cashew-v1 +7a353aa7a8124a0dbe8440f40c282ff4,2026-11-07T04:31:09.609936+00:00,chewinggum,Anomalous,0.33751875162124634,0.11576281487941742,0.005788140743970872,34.15,dinov2-tuned-chewinggum-v1 +fed8c208317840b2a0c6bea6f404bbc8,2026-11-07T04:31:09.756854+00:00,chewinggum,Uncertain,0.12110640108585358,0.11576281487941742,0.005788140743970872,40.44,dinov2-tuned-chewinggum-v1 +d0aa478ff7b24b86804abfde6689f2d5,2026-11-07T04:31:10.112489+00:00,fryum,Anomalous,0.22371983528137207,0.10525055527687072,0.0052625277638435365,44.82,dinov2-tuned-fryum-v1 +73effc650ddc4de9a1a8a35aa011c71b,2026-11-07T04:31:10.242888+00:00,fryum,Good,0.0773605927824974,0.10525055527687072,0.0052625277638435365,42.76,dinov2-tuned-fryum-v1 +031ddcf70ba240dd98baf8932b418b12,2026-11-07T04:31:10.562390+00:00,macaroni1,Anomalous,0.12035106867551804,0.0831331416964531,0.004156657084822655,37.09,dinov2-tuned-macaroni1-v1 +99e5aca39a094033b059ed2ece1e4c7a,2026-11-07T04:31:10.669601+00:00,macaroni1,Anomalous,0.09371042251586914,0.0831331416964531,0.004156657084822655,34.75,dinov2-tuned-macaroni1-v1 +e80a1c06812b46858fe77c8dcba49e0d,2026-11-07T04:31:10.971729+00:00,macaroni2,Anomalous,0.12074433267116547,0.09993447512388229,0.004996723756194115,35.36,dinov2-tuned-macaroni2-v1 +f844a1e1a3c84cb7883c22af86f37dd2,2026-11-07T04:31:11.103005+00:00,macaroni2,Good,0.0933448076248169,0.09993447512388229,0.004996723756194115,41.66,dinov2-tuned-macaroni2-v1 +ccaaa807f4834da8b402ca8b46073342,2026-11-07T04:31:07.483820+00:00,pcb1,Anomalous,0.2655112147331238,0.09390439838171005,0.004695219919085503,757.05,dinov2-tuned-pcb1-v1 +1c68ef87cd4b4e10a7efab1b5107d59b,2026-11-07T04:31:07.690368+00:00,pcb1,Good,0.06865152716636658,0.09390439838171005,0.004695219919085503,39.86,dinov2-tuned-pcb1-v1 +861bd29ac3e34efc89c18aad4befcb0a,2026-11-07T04:31:11.444917+00:00,pcb2,Good,0.08604340255260468,0.09243721514940262,0.004621860757470131,33.85,dinov2-tuned-pcb2-v1 +24610e481ba14990be2b059b435ec8d1,2026-11-07T04:31:11.590072+00:00,pcb2,Anomalous,0.10201622545719147,0.09243721514940262,0.004621860757470131,43.52,dinov2-tuned-pcb2-v1 +944d0897857e443b96ab5e30747cef96,2026-11-07T04:31:11.945912+00:00,pcb3,Anomalous,0.15217359364032745,0.09173599630594254,0.004586799815297127,50.4,dinov2-tuned-pcb3-v1 +27606216a5324123becd9271a9044576,2026-11-07T04:31:12.075083+00:00,pcb3,Good,0.08433570712804794,0.09173599630594254,0.004586799815297127,36.61,dinov2-tuned-pcb3-v1 +9b95eb77b39b403bb68311b0cc1a7174,2026-11-07T04:31:12.406282+00:00,pcb4,Anomalous,0.2023768424987793,0.1058717742562294,0.0052935887128114706,43.08,dinov2-tuned-pcb4-v1 +57cbced2975740d2b7845b1660aad8b6,2026-11-07T04:31:12.523405+00:00,pcb4,Good,0.07028265297412872,0.1058717742562294,0.0052935887128114706,35.66,dinov2-tuned-pcb4-v1 +1213d696bd724a2e9d4ad4af04bda78c,2026-11-07T04:31:12.870079+00:00,pipe_fryum,Anomalous,0.38307350873947144,0.14284870028495786,0.007142435014247894,53.19,dinov2-tuned-pipe_fryum-v1 +f92d581f4bc64724b9f3fffb8e38f709,2026-11-07T04:31:13.005067+00:00,pipe_fryum,Good,0.11506223678588867,0.14284870028495786,0.007142435014247894,38.44,dinov2-tuned-pipe_fryum-v1 diff --git a/frontend/dist/showcase/manifest.json b/frontend/dist/showcase/manifest.json index 47aba618721f523abf69813dcfca6aa0e8bf0cfb..d1cb453ce6f826ef90ed51f64251d9e7b1197742 100644 --- a/frontend/dist/showcase/manifest.json +++ b/frontend/dist/showcase/manifest.json @@ -1,83 +1,80 @@ -{ - "files": { - "data.json": "f3632529a2286e4b12be151eca04c6ede861b342698c29d879f9c52212954e0f", - "images/09c2eda2da134adf829057bc0a4faccb.jpg": "63552af9d08f3944cd3f61308539f0ff323b9857b4d7e146d2806019ef8bf63b", - "images/09c2eda2da134adf829057bc0a4faccb_heatmap.jpg": "7d87b5c9d8d2e1101839520e130527fcb37c417ca3722652cadfc3eafc27c2c4", - "images/118f64eaadfe43ce8b27b955a82c37ba.jpg": "14b32003bd653507f429364407717aa17cb3633efd7e364ebf30ec58a8e13b18", - "images/118f64eaadfe43ce8b27b955a82c37ba_heatmap.jpg": "a7cdeb32ee115f8649c0faa372851e63ee551d88f091d48a8d70f4dba3179694", - "images/14418c36d94648adbdbc2779a6a33b3c.jpg": "d68fea68234c27a0f3f4b9131eab8113b52b766e5e5c135faff2f3dd9431ad0b", - "images/14418c36d94648adbdbc2779a6a33b3c_heatmap.jpg": "b9f7e99c23fb46454abe690fc6eda5b8b0a3250d0b4b4b1137490d39e928f2ff", - "images/18c7586f94de4b6d8ef773779f7cea2f.jpg": "ef3fd6e784f64b6b4e4e765abaea7e91c33baa2d78a465356fa9a2e1c95d70a9", - "images/18c7586f94de4b6d8ef773779f7cea2f_heatmap.jpg": "928e6a79aa8df1a8d618b7cc148f881a0a4e46b2ce3e154741a778c554a296be", - "images/1a5f9735b7dd44f18995b62e871ee3b7.jpg": "ff41e841944da26af6e3ce91d8f2ef49d4c75ff226051978509df81154b84979", - "images/1a5f9735b7dd44f18995b62e871ee3b7_heatmap.jpg": "20401fd8ab4ca1e8ba0bc830b86c377217d0dfc83df4eb7214e5c3af60f373f0", - "images/232cbf03a23f4eb2a3793fa1628e5f9c.jpg": "88c01e856b10da8c2b413880038ef2488035aff987dac8fc076412aa23df7d2b", - "images/232cbf03a23f4eb2a3793fa1628e5f9c_heatmap.jpg": "b6e5a8d00f6c2c2086463a751954a05607b410a8801e6a8047c76669210b7cfb", - "images/2cb0f86c14d344019b28f77f4628257f.jpg": "f859d91b39f48b63b7bdee5add7ee34798e2ffe01c15e0cb0615cfa86ec6dc38", - "images/2cb0f86c14d344019b28f77f4628257f_heatmap.jpg": "5fe512ab0e9aa92980a644537ccadedb2e11b08dbb39ab047c413b5959677f00", - "images/3243fbe65d59477b9811da0f306535aa.jpg": "35dadc6849b4bfa07fca5b69869054e2e575bd7ab6bc93f52ebabea59fb0723d", - "images/3243fbe65d59477b9811da0f306535aa_heatmap.jpg": "7919fb4dada5aff7fb972ed12cf5bc191ab7bda32e75e30367d9dfb39d9ac671", - "images/3c255e6f989c4bee88941ef44c2f81dc.jpg": "16aabef347ecec8f2cf4a08cfe7d13ef607235c62c2996d1a60db648b5ac2bfd", - "images/3c255e6f989c4bee88941ef44c2f81dc_heatmap.jpg": "0e20bd1d923f87e12f7740926d15a08b29ffaa320254cb3d75b0b7969861a16f", - "images/52ee2c6d54934fcfaffb0f273c70dc87.jpg": "ce3db31f0208276ac70da93545542063915acdd52c5a97fa29e6926bffbebd71", - "images/52ee2c6d54934fcfaffb0f273c70dc87_heatmap.jpg": "4c52c902c25fe7538f1ec5a08466ad901ab66e5348814700bd9488570497c25c", - "images/6082416ed1c34be6a4fccd7e406f4a34.jpg": "b92da3c6e3cf588c5a0d1f357b34465c4a2a9c506266fc57844c1eaf67dddbb9", - "images/6082416ed1c34be6a4fccd7e406f4a34_heatmap.jpg": "2e89d0de096aefbd2267a4ffae3a8664c4bc4574d243c8c68a003cda36fb8a20", - "images/7dbb6f27253b450698a1a503cfa9a8c8.jpg": "4b7bdcd51e32845bd8e00355b338445b03b322e4357229d6c8334024ccd84c5f", - "images/7dbb6f27253b450698a1a503cfa9a8c8_heatmap.jpg": "ebc3563c77c31463c4129c0b73dbf84b08a7c40d11bcb2a94401521fdfeed5fc", - "images/99d47a61108f4581b59c6fac6bfc224f.jpg": "cdb410e5cf5166c38fa31d42a301e9a4ac27257dfdab3b1763aaf82b30fbb540", - "images/99d47a61108f4581b59c6fac6bfc224f_heatmap.jpg": "05445c9a504b05fcc85883b413d32c38b45594d562e2fe9845f049ff64b62d58", - "images/a6226ef392eb417e8991369e890d816b.jpg": "6b795bcc788eb84d9131ddebe111a5401eba96351c12b4359ffd272dbede097c", - "images/a6226ef392eb417e8991369e890d816b_heatmap.jpg": "58324e3c81f8fcc45dfeca404337f112c724b751c9822b33b7a6bf1c647a0bc5", - "images/b43a98329ac646ef90f19861345d0884.jpg": "1393fda01abe53b54abd4449d071c30b8b27e52f416a2a271e100a527ec264dc", - "images/b43a98329ac646ef90f19861345d0884_heatmap.jpg": "467361bd37691b66599f1c7ca21105ec5677cc9ac7ff4796e3b529331e51a26b", - "images/b5d1bd5c7ed1493ab8f4a849eeeb7712.jpg": "1ae1542b9834aaa29d652464d7763f1103e7a416bb0abefd88c29ae1c2465df4", - "images/b5d1bd5c7ed1493ab8f4a849eeeb7712_heatmap.jpg": "9d6e1191b4c0c877098b900f03d8c3749d6dc502cfe88d6e66898ae81236c2bc", - "images/c6222fddf36d4c788ae4e96994b3e02b.jpg": "74b1d6bd0f91293b56eab44cf6669139e8f9491a8f1f48a3893932a6d5b47f1f", - "images/c6222fddf36d4c788ae4e96994b3e02b_heatmap.jpg": "68f830e3489b698aaf164c7ce9cd37e454b163300add69b010d5f0048cfbef9d", - "images/d03553a7af274bba808fe090d4a7912b.jpg": "ee68b606b1b0e9f2fcdd696f1e90c44f8bb0e7413e1776c6884d84a9de9bb4c3", - "images/d03553a7af274bba808fe090d4a7912b_heatmap.jpg": "800626714a345a3c5b822e5f3285cb2d7e32e717c8fe43c17e0b7da99f5b22cc", - "images/d182ffb0791744d08f112d7321e69f1d.jpg": "cb7d0c14de0e748f046c52419a0b82c2a1bc602a0021fb98dceb697f795f85aa", - "images/d182ffb0791744d08f112d7321e69f1d_heatmap.jpg": "455025dd08a72ac19143f1ce2d31896c7bd914691f70609c0c9b497d562eb4f6", - "images/d9023f03ff7945d8928216e8df02a620.jpg": "c168f15a4e2f62dda6cd8baa461a6906b8a34c22c6b1513f89f1ac1ee3fb806c", - "images/d9023f03ff7945d8928216e8df02a620_heatmap.jpg": "39526c629fa9ec7155a1ce8b9ec07ac3180332b82b006f5cb6de2e4f0a8a9f5b", - "images/dcc3e255b90f466c9087d7e09af1a661.jpg": "12aab98cf1fd52d673463b2acdbd6ec73e50c46281f94790fb95f0d71bf1236b", - "images/dcc3e255b90f466c9087d7e09af1a661_heatmap.jpg": "97ce450562cc65ac160ea8c27477545d1432d25fa365d85b995eba822433532b", - "images/e335298e27e843c38d81accf54fdb399.jpg": "489cc9dfca54662f82b38866d60f4ad799b407fc2ed15bfb655b2df3b74dcae0", - "images/e335298e27e843c38d81accf54fdb399_heatmap.jpg": "c6caf8341cb261dcd9144f7387ee11654f16c10788994751ebc26927daa82c02", - "images/e3964b50d4cf4860a1f7a926d1ae444a.jpg": "41edea93c265590c5238f2f12a56bae3c753d0b5926ab4a372bdeafa9591e2c2", - "images/e3964b50d4cf4860a1f7a926d1ae444a_heatmap.jpg": "7ee4640018a44b0d6c5d1d10a753ce068a9bf3379d6a696d206817f83b71ecb5", - "images/e701c08ef3264b20bcb11149f734b219.jpg": "79ad47c49bf364c73f23ee0df308d867c51c2aee93f255d757e07fcdcd2e88d2", - "images/e701c08ef3264b20bcb11149f734b219_heatmap.jpg": "5129b946ae40e204eb79eb56e45e8ab0daa9fd1851fe5c969954c43bf6c09542", - "images/eba4738a39db4a3192230964d15853bc.jpg": "fbff1b0343d4de9f13f018cd0236fa504231da7defea0ab7439c60ea6a883f84", - "images/eba4738a39db4a3192230964d15853bc_heatmap.jpg": "5f9d06ec558b6efaba10d13b7a7efb6412cc81bd2f6ee9fbda4fd8fe2596954d", - "inspections.csv": "14beec17035cf5d8d722b0d8719f0215c937de935603483db3a0a368d7c20e6d", - "reports/09c2eda2da134adf829057bc0a4faccb.html": "50dd7e39899560c389263b45aae95ca38b8780f5a7289fe5fac08133fe0e18d2", - "reports/118f64eaadfe43ce8b27b955a82c37ba.html": "7cb2d14e7d973aad9c548edbf162220488712c6cefc565c33b71a25595186dc1", - "reports/14418c36d94648adbdbc2779a6a33b3c.html": "aa560139ce8d7ebad84ec3a56645a700020d87f51a7424659722cfebfb12d762", - "reports/18c7586f94de4b6d8ef773779f7cea2f.html": "9b1d282aec8b5f03aad28c6a1401700e2318b0a25e69ebbdff63d0401ed35bf4", - "reports/1a5f9735b7dd44f18995b62e871ee3b7.html": "37df93f945ba0fe2d48548d07ba7dbf8e951f5b431d255d655bfc9c51900bcac", - "reports/232cbf03a23f4eb2a3793fa1628e5f9c.html": "fd31b0c65e1bc25e02ae88e01a75685e9b61873a5a64fb3f45647f4e31745fcc", - "reports/2cb0f86c14d344019b28f77f4628257f.html": "8ccdc03808ae1fc046865d82239dd27d9c99c118413db405671dece60ebbea00", - "reports/3243fbe65d59477b9811da0f306535aa.html": "e367fd66df04ae11df7361a1bf88a2ddec6fa8eebcf26070753f4b289a2a2801", - "reports/3c255e6f989c4bee88941ef44c2f81dc.html": "e108f35cdb04ed69079a643de5d93f8e9e8696ac5bc463cd1c607b05d19363f2", - "reports/52ee2c6d54934fcfaffb0f273c70dc87.html": "491daa3e8e59e7266498c3ba0200621fee511c0bf28e6182a6d387849c141cfd", - "reports/6082416ed1c34be6a4fccd7e406f4a34.html": "6a31d17e2b8342cb2c3e47097141940753fa866ea59349c447d8988a58e93e69", - "reports/7dbb6f27253b450698a1a503cfa9a8c8.html": "e7a6ed242239aff5549efe1148ede99c0060a87d3b2bcd9287808aa0500bea58", - "reports/99d47a61108f4581b59c6fac6bfc224f.html": "4dc776fc5e73e03d77afd77b2f8ac8147bac1a19bfe92d1622acdc94d4e9a7a6", - "reports/a6226ef392eb417e8991369e890d816b.html": "5c1687b3940a4cc7a47e3debade57912882af15d4ee39e33da78ce4e10cbac77", - "reports/b43a98329ac646ef90f19861345d0884.html": "ce9a0dd9a705fc6816ca572b179170fc29ca7d8cb8c47fc62c4cb10e8aed3e18", - "reports/b5d1bd5c7ed1493ab8f4a849eeeb7712.html": "590d53bb0cec59074402d17997706721adf90663b20ab9f2183a53d67b7638a8", - "reports/c6222fddf36d4c788ae4e96994b3e02b.html": "31b97ab7c6798b00f613f68cd01939088dba68d314c84c752b4e819554c12334", - "reports/d03553a7af274bba808fe090d4a7912b.html": "4827fe999d4d2dc2580d82d0eeaaa8a7b6b15fab8f16ed27b66b7ca4dd3893c6", - "reports/d182ffb0791744d08f112d7321e69f1d.html": "47005a6042a0b96998acc1a8b70b1d51cf3631ae28e4744810e71eeaf1752a95", - "reports/d9023f03ff7945d8928216e8df02a620.html": "181106336312a518ddafc35ed38ed5743c4fd9a08a7a327d9d9d28cb716a5755", - "reports/dcc3e255b90f466c9087d7e09af1a661.html": "22b221ba45d212b5bfbf34944a30e9236da4b2c12264b8d8a3c03be99bb98fa9", - "reports/e335298e27e843c38d81accf54fdb399.html": "ab8e3afbd4a0f6df5ca538219e7f404250ac73ecc72f904aef3c93a1b3d64a66", - "reports/e3964b50d4cf4860a1f7a926d1ae444a.html": "d66bf6ba0e9b4f7dcc062f932d4bf7e9b6204903ea7398321e52116e9dbba015", - "reports/e701c08ef3264b20bcb11149f734b219.html": "cd38345cf92fcdf78eb668fac14e90cdc3ba27d8934c1156bbc92ff1815767da", - "reports/eba4738a39db4a3192230964d15853bc.html": "fe02d6734ca40fafaf1810d9e7cd36fe6b4c4d6d654ebbb4723d5a50f6082a54" - }, - "records": 25, - "provenance": "allowlisted acceptance + all_categories_acceptance + passed assistant_quality receipts; original saved runtime artifacts; old experiments not repeated" +{ + "files": { + "data.json": "10cb53a0485033528cd6e6cf876f124128a03a7b862ebd9fd2d2f2de7524b20b", + "images/031ddcf70ba240dd98baf8932b418b12.jpg": "a7a985f7a22d07f68188247fab1c7efbec7610043f2429ad2bee4e2cd4f03eea", + "images/031ddcf70ba240dd98baf8932b418b12_heatmap.jpg": "7ff174994b54ffe0a83a22cd7f1da7a70080950cecd62d1efb3c3ccf97e1d16c", + "images/1213d696bd724a2e9d4ad4af04bda78c.jpg": "712c7b1fc42e6de9baf76cc7fae0e3501974d249bbc314ba8c3ac8b49087e87b", + "images/1213d696bd724a2e9d4ad4af04bda78c_heatmap.jpg": "a493b512a3897dcdff2f20ac4e559e57faba7848e8e1429aa4cc021cf094e035", + "images/1c68ef87cd4b4e10a7efab1b5107d59b.jpg": "3c5316ce730e9238c859257b3ff5a02659f2dd92073d2c7558d2d9866ce1d179", + "images/1c68ef87cd4b4e10a7efab1b5107d59b_heatmap.jpg": "b89622ff0612c5cf9dc0a97fd09026efba1ce5ff1432f8360b5249dbadebf360", + "images/24610e481ba14990be2b059b435ec8d1.jpg": "214d3c9b05db78355091e88ca0761a5f9c3eddd48818b6c6ab389feb24d4e543", + "images/24610e481ba14990be2b059b435ec8d1_heatmap.jpg": "871fdd0436f01f2e47f97502a60d4e03a0344b8b0e4ad8fcf19ef4e26219937a", + "images/27606216a5324123becd9271a9044576.jpg": "c73d314ff38009fc83488091b860b4f2190beffb28e60bc329040fdee12d27fb", + "images/27606216a5324123becd9271a9044576_heatmap.jpg": "f620da418f2fa540285a0293cbcdbee5cd24a5553d71a852633e958e547b3abb", + "images/4bff5e6b5e064383a9b85a8a6bec04cc.jpg": "8ec2e6d4353f8efb1eb2ee1b57763dd50a307badfefd8d72406b00f0f8777b6f", + "images/4bff5e6b5e064383a9b85a8a6bec04cc_heatmap.jpg": "47629674bf856e5c7a1ccc6ad2d28e033cdc9d8eeae47c3d13e31b2d5e83159c", + "images/57cbced2975740d2b7845b1660aad8b6.jpg": "cf040fb598bbc8d862da6ec0ab0eab45b210b20a588a4764ed02898a263b25e8", + "images/57cbced2975740d2b7845b1660aad8b6_heatmap.jpg": "116ba22c905c3d14b790590af515cccbbbfeeeee96a46ca6594cdd0757740385", + "images/66ab22d8050144f78e9b9c1b4c7b0b9e.jpg": "9d914a4f85f624b1db4c62d7476c974cd6d04694eda227dbc434b3e103cf6d8e", + "images/66ab22d8050144f78e9b9c1b4c7b0b9e_heatmap.jpg": "27b101519aa0d7ceee9f7ae2dfa9260dbe96eb853f60e78a59d52109a5bcac4a", + "images/6f8af69aa59d40b488d5d864f502224d.jpg": "11bca634191651edd3844cce54de5759ed1aafde38098377ac80f6a8638a0a67", + "images/6f8af69aa59d40b488d5d864f502224d_heatmap.jpg": "16f45bd7d09e1935ff8bdd21c8f22e87a0ce0fb9d89e64ebf869d622a843aeed", + "images/73effc650ddc4de9a1a8a35aa011c71b.jpg": "1bc85cf2cd763e1589d6f066aedfbe9e4ff1c2857f767a9082909a7d63168b89", + "images/73effc650ddc4de9a1a8a35aa011c71b_heatmap.jpg": "4bddf31f1bd71537cec7c7e2edf31e5addce4fa2366b9cdf6eb227a2ab1e9f15", + "images/7a353aa7a8124a0dbe8440f40c282ff4.jpg": "bd0d507ec35a66ed9e6d649da264447d9e5fea9a7cad2a06d7440402aa7dc4ec", + "images/7a353aa7a8124a0dbe8440f40c282ff4_heatmap.jpg": "1a9715dae7bf00c138c8785ad7aa0476c4973df8bac80129a814a3c5e67b4021", + "images/861bd29ac3e34efc89c18aad4befcb0a.jpg": "cd47c08948743253fea93313454dbbe18c2337ff9930c5c7bd75bb125042a386", + "images/861bd29ac3e34efc89c18aad4befcb0a_heatmap.jpg": "c65700d5c0c625bb9fdb8000c62fb290007168f82098d079d26041cab84f7ac3", + "images/944d0897857e443b96ab5e30747cef96.jpg": "4e9ee04007000314d802fe58b62b6e8b18cfebee2425d503a3ef3c120b3b9113", + "images/944d0897857e443b96ab5e30747cef96_heatmap.jpg": "e6f37e8fe25ee41d23b09e9437f109b364bae82a29183d03af746d904fe79aa9", + "images/99e5aca39a094033b059ed2ece1e4c7a.jpg": "5541c5850dc3e952e7f920abe0f0f24eaea73a85d377e40a68a7a12166648d1a", + "images/99e5aca39a094033b059ed2ece1e4c7a_heatmap.jpg": "b2045056fc94f5f2b8a15039783725212ccc1d2fe369c185d5fb0729ed424557", + "images/9b95eb77b39b403bb68311b0cc1a7174.jpg": "47298908ce3ba721b31c1996b3527fe8217a78d11ac217e88e4809bd470803b7", + "images/9b95eb77b39b403bb68311b0cc1a7174_heatmap.jpg": "2e09cd3b84bfa989b115136832cd2677ca992596e9f48632b0430d50fe831173", + "images/ccaaa807f4834da8b402ca8b46073342.jpg": "6b795bcc788eb84d9131ddebe111a5401eba96351c12b4359ffd272dbede097c", + "images/ccaaa807f4834da8b402ca8b46073342_heatmap.jpg": "e745f223d96d05479c880b35ac82c440ee455269e4b5967957df0455a240223d", + "images/d0aa478ff7b24b86804abfde6689f2d5.jpg": "ed2ffac0eec26aebfd77a417213bb361b85be3943cd5b0d40fb52295823a1bcd", + "images/d0aa478ff7b24b86804abfde6689f2d5_heatmap.jpg": "44d1eafaae3d20ac1f01f0469e56f5c6623ba9726b0f11bdb170dfce7f43d63c", + "images/da28cabe417a4f7f9d81faa0b6ce4146.jpg": "0c652134c95c75d8f4163f8f7d108c2d46ae94abd73f0bd28c3acffbabb62b5b", + "images/da28cabe417a4f7f9d81faa0b6ce4146_heatmap.jpg": "ab7c84bfc3e5eda2a35c4bc102cb8a8f0060e042b1bc90bc0654cff2ed1e12a1", + "images/da5e3a7125564152afd03d26ef3fb38b.jpg": "16a34d1f2a4dcdcc71b789c067289e19f347f3f538cccb74a6792d29f8a3c1f8", + "images/da5e3a7125564152afd03d26ef3fb38b_heatmap.jpg": "bb26f0e129ec3d792d482edcba1b7ec837e94964d983a405f29e87045d772e31", + "images/def5b9b862a447ac8c61e168af28c263.jpg": "6b3c74ebde10a6bd5e37c7ab76724e6a8ee05de19b9aed10280ba702b6fdc7d1", + "images/def5b9b862a447ac8c61e168af28c263_heatmap.jpg": "0e40332a04f3f3f4604bd5cc78bc9e6bf65345bb7f82510e13118919ce8f7f2c", + "images/e80a1c06812b46858fe77c8dcba49e0d.jpg": "040e611d500534297559d230e856780adfd2dca194d38627f611c2962a02d7c4", + "images/e80a1c06812b46858fe77c8dcba49e0d_heatmap.jpg": "216e0cf82292bd45b03b98b58d0e656e19c86906f6ec6bcfc601b77dc9fd7de2", + "images/f844a1e1a3c84cb7883c22af86f37dd2.jpg": "5fa09d87c3c703f1f3542e4d455511d8af2dced3b36403f59ca5c5593e91be5b", + "images/f844a1e1a3c84cb7883c22af86f37dd2_heatmap.jpg": "18ed8063a29340005c01ca85ae09dd395b12e280c8b39168f2a12c9c96690145", + "images/f92d581f4bc64724b9f3fffb8e38f709.jpg": "5aaf6be0319568f0b314618892951d353af4652e06131ebc9ae9d074db2c6fc4", + "images/f92d581f4bc64724b9f3fffb8e38f709_heatmap.jpg": "2ee6f312645a063c8fa8c640a490b8c2b12cefaa4d7006a2861f00124841ca8c", + "images/fed8c208317840b2a0c6bea6f404bbc8.jpg": "6a1b2979e5908e1a2f4fd3b28a5f537ef8609084be3ae2c5f2e5a44b993b9c23", + "images/fed8c208317840b2a0c6bea6f404bbc8_heatmap.jpg": "64218ee749b3d4ef6670602d8cd8dffaf82220d227af3705701dc4be86efc98f", + "inspections.csv": "6f3e9268bf8216365548a9ba264ea59d2901e36e8edad5a39ba07d76125423d2", + "reports/031ddcf70ba240dd98baf8932b418b12.html": "6f935d68459e42a7b24745f7bcf2e9082538c8e05a56ad1a3bf17e1fa99902e5", + "reports/1213d696bd724a2e9d4ad4af04bda78c.html": "67a707c24ae5f53fbe90f5998b17e8396b58bf59c67686ea2d8894acbb8cb740", + "reports/1c68ef87cd4b4e10a7efab1b5107d59b.html": "b52ebcb4c7241d7bf048dd320c6404bd42a8cda37b707af1c442d38c02525b5d", + "reports/24610e481ba14990be2b059b435ec8d1.html": "8282ffb6149ce9b6b6dafe6ca3c29d748ae872349423fd08efa64c8d627c1ea4", + "reports/27606216a5324123becd9271a9044576.html": "e4b86d44fa565ebba3d22167672a557d5fa8698cd5c2a561a31c7a226571100d", + "reports/4bff5e6b5e064383a9b85a8a6bec04cc.html": "14798e80d806e0280455d27206bec93a22bf03f96380e404be5061751b1a4280", + "reports/57cbced2975740d2b7845b1660aad8b6.html": "ce22e9afda8353cb1ca0eae82227dd073c25e6215f14496818f773d83c694d53", + "reports/66ab22d8050144f78e9b9c1b4c7b0b9e.html": "245d199921809641ca660f8779557db6a2d4320e1255bee6fb168b150901915d", + "reports/6f8af69aa59d40b488d5d864f502224d.html": "1f9c2072324ef56beba4a35f6c0423852c17ef16244274e27c45bee9551d7adb", + "reports/73effc650ddc4de9a1a8a35aa011c71b.html": "c93977bd75866cfa4528001f6d0187a1189cc02f93eb12b5910ab3a107fbd7c9", + "reports/7a353aa7a8124a0dbe8440f40c282ff4.html": "53dd1d49c837242526cb3b6a8657c11f22f96396e649132b2631e17684680a0e", + "reports/861bd29ac3e34efc89c18aad4befcb0a.html": "c9698098cee03cadaed7405ac101dd864a726cd8143c2c14d01144b544443f42", + "reports/944d0897857e443b96ab5e30747cef96.html": "03de161e6a9170f05a799aee44697357794238e7786e411473e0a156df2af203", + "reports/99e5aca39a094033b059ed2ece1e4c7a.html": "1f52be993bc584dbae9d7fc92fe13d33e2932530cd5c47cbcfa92db447648ed8", + "reports/9b95eb77b39b403bb68311b0cc1a7174.html": "11e3c9bde53d2ca9ba3bdcdf8901045e271ec9212435e7e5525c7d00a124327f", + "reports/ccaaa807f4834da8b402ca8b46073342.html": "390ab63cc8015ce8d398844c34c5c1930319fc82c5641e3ef55ecea825c0b990", + "reports/d0aa478ff7b24b86804abfde6689f2d5.html": "dda0fe578efeb2e10cfd5c2b00154410f9a901acea865e61d6b062cc592041c1", + "reports/da28cabe417a4f7f9d81faa0b6ce4146.html": "4c508fb4952029a0ccba5115ce0664c9799ec083a9a88e334a43e7e9f8dc6276", + "reports/da5e3a7125564152afd03d26ef3fb38b.html": "8743313a04c939429c27c6eee46887bbb976785c9fc131fcbf62727b9461c87f", + "reports/def5b9b862a447ac8c61e168af28c263.html": "0a2691f8973606486cffa74569fa742bfa5b2ea1ccd49c34a8653ffb3e660ec8", + "reports/e80a1c06812b46858fe77c8dcba49e0d.html": "d5660adb3d80974feb42182842023d615ab2fa4284b0b943aba4ab245bf391e6", + "reports/f844a1e1a3c84cb7883c22af86f37dd2.html": "4f7ab63c9ecf7914211b41bf46ef2e76cd832e358ae20fe942b9236d097134d1", + "reports/f92d581f4bc64724b9f3fffb8e38f709.html": "868e4c8d275d0820e55066bc000c1ca039532d56afbf6e491f7e42c43e43d431", + "reports/fed8c208317840b2a0c6bea6f404bbc8.html": "4c1f4a4b188350adea004593ac674104728a57445439f9de345f16897966e24b" + }, + "records": 24, + "provenance": "24 inspections by the deployed tuned detector (dinov2_tuned_v1); results kept as measured, including misses; no assistant conversations" } \ No newline at end of file diff --git a/frontend/dist/showcase/reports/031ddcf70ba240dd98baf8932b418b12.html b/frontend/dist/showcase/reports/031ddcf70ba240dd98baf8932b418b12.html new file mode 100644 index 0000000000000000000000000000000000000000..c09f4e3793ad62e5dc9ea0202a85cfc7e4e7238d --- /dev/null +++ b/frontend/dist/showcase/reports/031ddcf70ba240dd98baf8932b418b12.html @@ -0,0 +1 @@ +Saved DefectRAG example

Saved inspection example

Previously measured VisA example. No live inference runs on this website.

VisA · Zou et al., ECCV 2022 · CC BY 4.0 · resized images and model overlay. Dataset source

id031ddcf70ba240dd98baf8932b418b12
created_at2026-11-07T04:31:10.562390+00:00
categorymacaroni1
verdictAnomalous
score0.12035106867551804
threshold0.0831331416964531
uncertainty_margin0.004156657084822655
inference_ms37.09
model_iddinov2-tuned-macaroni1-v1

Image and measured heatmap

VisA sampleSaved heatmap

Recorded evidence conversation

No evidence conversation was recorded for this inspection.

\ No newline at end of file diff --git a/frontend/dist/showcase/reports/1213d696bd724a2e9d4ad4af04bda78c.html b/frontend/dist/showcase/reports/1213d696bd724a2e9d4ad4af04bda78c.html new file mode 100644 index 0000000000000000000000000000000000000000..2d8d5692f4800bd08dfb3612c8784cef2bd51395 --- /dev/null +++ b/frontend/dist/showcase/reports/1213d696bd724a2e9d4ad4af04bda78c.html @@ -0,0 +1 @@ +Saved DefectRAG example

Saved inspection example

Previously measured VisA example. No live inference runs on this website.

VisA · Zou et al., ECCV 2022 · CC BY 4.0 · resized images and model overlay. Dataset source

id1213d696bd724a2e9d4ad4af04bda78c
created_at2026-11-07T04:31:12.870079+00:00
categorypipe_fryum
verdictAnomalous
score0.38307350873947144
threshold0.14284870028495786
uncertainty_margin0.007142435014247894
inference_ms53.19
model_iddinov2-tuned-pipe_fryum-v1

Image and measured heatmap

VisA sampleSaved heatmap

Recorded evidence conversation

No evidence conversation was recorded for this inspection.

\ No newline at end of file diff --git a/frontend/dist/showcase/reports/1c68ef87cd4b4e10a7efab1b5107d59b.html b/frontend/dist/showcase/reports/1c68ef87cd4b4e10a7efab1b5107d59b.html new file mode 100644 index 0000000000000000000000000000000000000000..5effd7e6e36bb547477ed3dc5739434d6fb8d4ed --- /dev/null +++ b/frontend/dist/showcase/reports/1c68ef87cd4b4e10a7efab1b5107d59b.html @@ -0,0 +1 @@ +Saved DefectRAG example

Saved inspection example

Previously measured VisA example. No live inference runs on this website.

VisA · Zou et al., ECCV 2022 · CC BY 4.0 · resized images and model overlay. Dataset source

id1c68ef87cd4b4e10a7efab1b5107d59b
created_at2026-11-07T04:31:07.690368+00:00
categorypcb1
verdictGood
score0.06865152716636658
threshold0.09390439838171005
uncertainty_margin0.004695219919085503
inference_ms39.86
model_iddinov2-tuned-pcb1-v1

Image and measured heatmap

VisA sampleSaved heatmap

Recorded evidence conversation

No evidence conversation was recorded for this inspection.

\ No newline at end of file diff --git a/frontend/dist/showcase/reports/24610e481ba14990be2b059b435ec8d1.html b/frontend/dist/showcase/reports/24610e481ba14990be2b059b435ec8d1.html new file mode 100644 index 0000000000000000000000000000000000000000..da21964e10ad9c9f9a2f430cdeee7d79c440927b --- /dev/null +++ b/frontend/dist/showcase/reports/24610e481ba14990be2b059b435ec8d1.html @@ -0,0 +1 @@ +Saved DefectRAG example

Saved inspection example

Previously measured VisA example. No live inference runs on this website.

VisA · Zou et al., ECCV 2022 · CC BY 4.0 · resized images and model overlay. Dataset source

id24610e481ba14990be2b059b435ec8d1
created_at2026-11-07T04:31:11.590072+00:00
categorypcb2
verdictAnomalous
score0.10201622545719147
threshold0.09243721514940262
uncertainty_margin0.004621860757470131
inference_ms43.52
model_iddinov2-tuned-pcb2-v1

Image and measured heatmap

VisA sampleSaved heatmap

Recorded evidence conversation

No evidence conversation was recorded for this inspection.

\ No newline at end of file diff --git a/frontend/dist/showcase/reports/27606216a5324123becd9271a9044576.html b/frontend/dist/showcase/reports/27606216a5324123becd9271a9044576.html new file mode 100644 index 0000000000000000000000000000000000000000..d69a96e591103be75f6c8718213ce3fdff5d839c --- /dev/null +++ b/frontend/dist/showcase/reports/27606216a5324123becd9271a9044576.html @@ -0,0 +1 @@ +Saved DefectRAG example

Saved inspection example

Previously measured VisA example. No live inference runs on this website.

VisA · Zou et al., ECCV 2022 · CC BY 4.0 · resized images and model overlay. Dataset source

id27606216a5324123becd9271a9044576
created_at2026-11-07T04:31:12.075083+00:00
categorypcb3
verdictGood
score0.08433570712804794
threshold0.09173599630594254
uncertainty_margin0.004586799815297127
inference_ms36.61
model_iddinov2-tuned-pcb3-v1

Image and measured heatmap

VisA sampleSaved heatmap

Recorded evidence conversation

No evidence conversation was recorded for this inspection.

\ No newline at end of file diff --git a/frontend/dist/showcase/reports/4bff5e6b5e064383a9b85a8a6bec04cc.html b/frontend/dist/showcase/reports/4bff5e6b5e064383a9b85a8a6bec04cc.html new file mode 100644 index 0000000000000000000000000000000000000000..4bd7fdba38e5df04f08dfb8444531da35a544986 --- /dev/null +++ b/frontend/dist/showcase/reports/4bff5e6b5e064383a9b85a8a6bec04cc.html @@ -0,0 +1 @@ +Saved DefectRAG example

Saved inspection example

Previously measured VisA example. No live inference runs on this website.

VisA · Zou et al., ECCV 2022 · CC BY 4.0 · resized images and model overlay. Dataset source

id4bff5e6b5e064383a9b85a8a6bec04cc
created_at2026-11-07T04:31:09.136511+00:00
categorycandle
verdictAnomalous
score0.19342294335365295
threshold0.10769653692841528
uncertainty_margin0.005384826846420765
inference_ms31.12
model_iddinov2-tuned-candle-v1

Image and measured heatmap

VisA sampleSaved heatmap

Recorded evidence conversation

No evidence conversation was recorded for this inspection.

\ No newline at end of file diff --git a/frontend/dist/showcase/reports/57cbced2975740d2b7845b1660aad8b6.html b/frontend/dist/showcase/reports/57cbced2975740d2b7845b1660aad8b6.html new file mode 100644 index 0000000000000000000000000000000000000000..8ef60081a68261536b3dc7c6d267ad10af7caafb --- /dev/null +++ b/frontend/dist/showcase/reports/57cbced2975740d2b7845b1660aad8b6.html @@ -0,0 +1 @@ +Saved DefectRAG example

Saved inspection example

Previously measured VisA example. No live inference runs on this website.

VisA · Zou et al., ECCV 2022 · CC BY 4.0 · resized images and model overlay. Dataset source

id57cbced2975740d2b7845b1660aad8b6
created_at2026-11-07T04:31:12.523405+00:00
categorypcb4
verdictGood
score0.07028265297412872
threshold0.1058717742562294
uncertainty_margin0.0052935887128114706
inference_ms35.66
model_iddinov2-tuned-pcb4-v1

Image and measured heatmap

VisA sampleSaved heatmap

Recorded evidence conversation

No evidence conversation was recorded for this inspection.

\ No newline at end of file diff --git a/frontend/dist/showcase/reports/66ab22d8050144f78e9b9c1b4c7b0b9e.html b/frontend/dist/showcase/reports/66ab22d8050144f78e9b9c1b4c7b0b9e.html new file mode 100644 index 0000000000000000000000000000000000000000..b27c84e02fe4de6ec93c3560bfc28c0e2aaa06fa --- /dev/null +++ b/frontend/dist/showcase/reports/66ab22d8050144f78e9b9c1b4c7b0b9e.html @@ -0,0 +1 @@ +Saved DefectRAG example

Saved inspection example

Previously measured VisA example. No live inference runs on this website.

VisA · Zou et al., ECCV 2022 · CC BY 4.0 · resized images and model overlay. Dataset source

id66ab22d8050144f78e9b9c1b4c7b0b9e
created_at2026-11-07T04:31:08.115707+00:00
categorycapsules
verdictAnomalous
score0.161866694688797
threshold0.10395566150546073
uncertainty_margin0.005197783075273037
inference_ms39.56
model_iddinov2-tuned-capsules-v1

Image and measured heatmap

VisA sampleSaved heatmap

Recorded evidence conversation

No evidence conversation was recorded for this inspection.

\ No newline at end of file diff --git a/frontend/dist/showcase/reports/6f8af69aa59d40b488d5d864f502224d.html b/frontend/dist/showcase/reports/6f8af69aa59d40b488d5d864f502224d.html new file mode 100644 index 0000000000000000000000000000000000000000..7850cb564c97858fa24d338dea934b8287df96c4 --- /dev/null +++ b/frontend/dist/showcase/reports/6f8af69aa59d40b488d5d864f502224d.html @@ -0,0 +1 @@ +Saved DefectRAG example

Saved inspection example

Previously measured VisA example. No live inference runs on this website.

VisA · Zou et al., ECCV 2022 · CC BY 4.0 · resized images and model overlay. Dataset source

id6f8af69aa59d40b488d5d864f502224d
created_at2026-11-07T04:31:08.773329+00:00
categorycashew
verdictUncertain
score0.10972827672958374
threshold0.10727595388889313
uncertainty_margin0.005363797694444657
inference_ms38.08
model_iddinov2-tuned-cashew-v1

Image and measured heatmap

VisA sampleSaved heatmap

Recorded evidence conversation

No evidence conversation was recorded for this inspection.

\ No newline at end of file diff --git a/frontend/dist/showcase/reports/73effc650ddc4de9a1a8a35aa011c71b.html b/frontend/dist/showcase/reports/73effc650ddc4de9a1a8a35aa011c71b.html new file mode 100644 index 0000000000000000000000000000000000000000..196a149dde60c46410c75c0d149335da46d96baa --- /dev/null +++ b/frontend/dist/showcase/reports/73effc650ddc4de9a1a8a35aa011c71b.html @@ -0,0 +1 @@ +Saved DefectRAG example

Saved inspection example

Previously measured VisA example. No live inference runs on this website.

VisA · Zou et al., ECCV 2022 · CC BY 4.0 · resized images and model overlay. Dataset source

id73effc650ddc4de9a1a8a35aa011c71b
created_at2026-11-07T04:31:10.242888+00:00
categoryfryum
verdictGood
score0.0773605927824974
threshold0.10525055527687072
uncertainty_margin0.0052625277638435365
inference_ms42.76
model_iddinov2-tuned-fryum-v1

Image and measured heatmap

VisA sampleSaved heatmap

Recorded evidence conversation

No evidence conversation was recorded for this inspection.

\ No newline at end of file diff --git a/frontend/dist/showcase/reports/7a353aa7a8124a0dbe8440f40c282ff4.html b/frontend/dist/showcase/reports/7a353aa7a8124a0dbe8440f40c282ff4.html new file mode 100644 index 0000000000000000000000000000000000000000..df961d76cfc673f7624770022c7e8f13255c85ad --- /dev/null +++ b/frontend/dist/showcase/reports/7a353aa7a8124a0dbe8440f40c282ff4.html @@ -0,0 +1 @@ +Saved DefectRAG example

Saved inspection example

Previously measured VisA example. No live inference runs on this website.

VisA · Zou et al., ECCV 2022 · CC BY 4.0 · resized images and model overlay. Dataset source

id7a353aa7a8124a0dbe8440f40c282ff4
created_at2026-11-07T04:31:09.609936+00:00
categorychewinggum
verdictAnomalous
score0.33751875162124634
threshold0.11576281487941742
uncertainty_margin0.005788140743970872
inference_ms34.15
model_iddinov2-tuned-chewinggum-v1

Image and measured heatmap

VisA sampleSaved heatmap

Recorded evidence conversation

No evidence conversation was recorded for this inspection.

\ No newline at end of file diff --git a/frontend/dist/showcase/reports/861bd29ac3e34efc89c18aad4befcb0a.html b/frontend/dist/showcase/reports/861bd29ac3e34efc89c18aad4befcb0a.html new file mode 100644 index 0000000000000000000000000000000000000000..8987bce29d4e2a529fca8382669aeee3604191ab --- /dev/null +++ b/frontend/dist/showcase/reports/861bd29ac3e34efc89c18aad4befcb0a.html @@ -0,0 +1 @@ +Saved DefectRAG example

Saved inspection example

Previously measured VisA example. No live inference runs on this website.

VisA · Zou et al., ECCV 2022 · CC BY 4.0 · resized images and model overlay. Dataset source

id861bd29ac3e34efc89c18aad4befcb0a
created_at2026-11-07T04:31:11.444917+00:00
categorypcb2
verdictGood
score0.08604340255260468
threshold0.09243721514940262
uncertainty_margin0.004621860757470131
inference_ms33.85
model_iddinov2-tuned-pcb2-v1

Image and measured heatmap

VisA sampleSaved heatmap

Recorded evidence conversation

No evidence conversation was recorded for this inspection.

\ No newline at end of file diff --git a/frontend/dist/showcase/reports/944d0897857e443b96ab5e30747cef96.html b/frontend/dist/showcase/reports/944d0897857e443b96ab5e30747cef96.html new file mode 100644 index 0000000000000000000000000000000000000000..49d712f72b52d7a8d1229bbc322b15a92a24c5d0 --- /dev/null +++ b/frontend/dist/showcase/reports/944d0897857e443b96ab5e30747cef96.html @@ -0,0 +1 @@ +Saved DefectRAG example

Saved inspection example

Previously measured VisA example. No live inference runs on this website.

VisA · Zou et al., ECCV 2022 · CC BY 4.0 · resized images and model overlay. Dataset source

id944d0897857e443b96ab5e30747cef96
created_at2026-11-07T04:31:11.945912+00:00
categorypcb3
verdictAnomalous
score0.15217359364032745
threshold0.09173599630594254
uncertainty_margin0.004586799815297127
inference_ms50.4
model_iddinov2-tuned-pcb3-v1

Image and measured heatmap

VisA sampleSaved heatmap

Recorded evidence conversation

No evidence conversation was recorded for this inspection.

\ No newline at end of file diff --git a/frontend/dist/showcase/reports/99e5aca39a094033b059ed2ece1e4c7a.html b/frontend/dist/showcase/reports/99e5aca39a094033b059ed2ece1e4c7a.html new file mode 100644 index 0000000000000000000000000000000000000000..46e271b2e0e8d1b0bec0840e1d527c8b2f949a21 --- /dev/null +++ b/frontend/dist/showcase/reports/99e5aca39a094033b059ed2ece1e4c7a.html @@ -0,0 +1 @@ +Saved DefectRAG example

Saved inspection example

Previously measured VisA example. No live inference runs on this website.

VisA · Zou et al., ECCV 2022 · CC BY 4.0 · resized images and model overlay. Dataset source

id99e5aca39a094033b059ed2ece1e4c7a
created_at2026-11-07T04:31:10.669601+00:00
categorymacaroni1
verdictAnomalous
score0.09371042251586914
threshold0.0831331416964531
uncertainty_margin0.004156657084822655
inference_ms34.75
model_iddinov2-tuned-macaroni1-v1

Image and measured heatmap

VisA sampleSaved heatmap

Recorded evidence conversation

No evidence conversation was recorded for this inspection.

\ No newline at end of file diff --git a/frontend/dist/showcase/reports/9b95eb77b39b403bb68311b0cc1a7174.html b/frontend/dist/showcase/reports/9b95eb77b39b403bb68311b0cc1a7174.html new file mode 100644 index 0000000000000000000000000000000000000000..5f567da0340329668f385074d6ca7eef7fd3a691 --- /dev/null +++ b/frontend/dist/showcase/reports/9b95eb77b39b403bb68311b0cc1a7174.html @@ -0,0 +1 @@ +Saved DefectRAG example

Saved inspection example

Previously measured VisA example. No live inference runs on this website.

VisA · Zou et al., ECCV 2022 · CC BY 4.0 · resized images and model overlay. Dataset source

id9b95eb77b39b403bb68311b0cc1a7174
created_at2026-11-07T04:31:12.406282+00:00
categorypcb4
verdictAnomalous
score0.2023768424987793
threshold0.1058717742562294
uncertainty_margin0.0052935887128114706
inference_ms43.08
model_iddinov2-tuned-pcb4-v1

Image and measured heatmap

VisA sampleSaved heatmap

Recorded evidence conversation

No evidence conversation was recorded for this inspection.

\ No newline at end of file diff --git a/frontend/dist/showcase/reports/ccaaa807f4834da8b402ca8b46073342.html b/frontend/dist/showcase/reports/ccaaa807f4834da8b402ca8b46073342.html new file mode 100644 index 0000000000000000000000000000000000000000..55fc3e36062b3114abc55a9e760d418b2a1e75f3 --- /dev/null +++ b/frontend/dist/showcase/reports/ccaaa807f4834da8b402ca8b46073342.html @@ -0,0 +1 @@ +Saved DefectRAG example

Saved inspection example

Previously measured VisA example. No live inference runs on this website.

VisA · Zou et al., ECCV 2022 · CC BY 4.0 · resized images and model overlay. Dataset source

idccaaa807f4834da8b402ca8b46073342
created_at2026-11-07T04:31:07.483820+00:00
categorypcb1
verdictAnomalous
score0.2655112147331238
threshold0.09390439838171005
uncertainty_margin0.004695219919085503
inference_ms757.05
model_iddinov2-tuned-pcb1-v1

Image and measured heatmap

VisA sampleSaved heatmap

Recorded evidence conversation

No evidence conversation was recorded for this inspection.

\ No newline at end of file diff --git a/frontend/dist/showcase/reports/d0aa478ff7b24b86804abfde6689f2d5.html b/frontend/dist/showcase/reports/d0aa478ff7b24b86804abfde6689f2d5.html new file mode 100644 index 0000000000000000000000000000000000000000..b3885057e4b2d1e40b12f3cbd1e72523c2d898bc --- /dev/null +++ b/frontend/dist/showcase/reports/d0aa478ff7b24b86804abfde6689f2d5.html @@ -0,0 +1 @@ +Saved DefectRAG example

Saved inspection example

Previously measured VisA example. No live inference runs on this website.

VisA · Zou et al., ECCV 2022 · CC BY 4.0 · resized images and model overlay. Dataset source

idd0aa478ff7b24b86804abfde6689f2d5
created_at2026-11-07T04:31:10.112489+00:00
categoryfryum
verdictAnomalous
score0.22371983528137207
threshold0.10525055527687072
uncertainty_margin0.0052625277638435365
inference_ms44.82
model_iddinov2-tuned-fryum-v1

Image and measured heatmap

VisA sampleSaved heatmap

Recorded evidence conversation

No evidence conversation was recorded for this inspection.

\ No newline at end of file diff --git a/frontend/dist/showcase/reports/da28cabe417a4f7f9d81faa0b6ce4146.html b/frontend/dist/showcase/reports/da28cabe417a4f7f9d81faa0b6ce4146.html new file mode 100644 index 0000000000000000000000000000000000000000..dcd67ac43df6ae57efd19afbcf24e6677074ff98 --- /dev/null +++ b/frontend/dist/showcase/reports/da28cabe417a4f7f9d81faa0b6ce4146.html @@ -0,0 +1 @@ +Saved DefectRAG example

Saved inspection example

Previously measured VisA example. No live inference runs on this website.

VisA · Zou et al., ECCV 2022 · CC BY 4.0 · resized images and model overlay. Dataset source

idda28cabe417a4f7f9d81faa0b6ce4146
created_at2026-11-07T04:31:08.274601+00:00
categorycapsules
verdictGood
score0.09077998250722885
threshold0.10395566150546073
uncertainty_margin0.005197783075273037
inference_ms47.05
model_iddinov2-tuned-capsules-v1

Image and measured heatmap

VisA sampleSaved heatmap

Recorded evidence conversation

No evidence conversation was recorded for this inspection.

\ No newline at end of file diff --git a/frontend/dist/showcase/reports/da5e3a7125564152afd03d26ef3fb38b.html b/frontend/dist/showcase/reports/da5e3a7125564152afd03d26ef3fb38b.html new file mode 100644 index 0000000000000000000000000000000000000000..baf544314527b462cb963da5ba81f341da25383f --- /dev/null +++ b/frontend/dist/showcase/reports/da5e3a7125564152afd03d26ef3fb38b.html @@ -0,0 +1 @@ +Saved DefectRAG example

Saved inspection example

Previously measured VisA example. No live inference runs on this website.

VisA · Zou et al., ECCV 2022 · CC BY 4.0 · resized images and model overlay. Dataset source

idda5e3a7125564152afd03d26ef3fb38b
created_at2026-11-07T04:31:09.248891+00:00
categorycandle
verdictGood
score0.07099495828151703
threshold0.10769653692841528
uncertainty_margin0.005384826846420765
inference_ms29.68
model_iddinov2-tuned-candle-v1

Image and measured heatmap

VisA sampleSaved heatmap

Recorded evidence conversation

No evidence conversation was recorded for this inspection.

\ No newline at end of file diff --git a/frontend/dist/showcase/reports/def5b9b862a447ac8c61e168af28c263.html b/frontend/dist/showcase/reports/def5b9b862a447ac8c61e168af28c263.html new file mode 100644 index 0000000000000000000000000000000000000000..df865dd2f9ec1ef485e13cb3b055519d5863634b --- /dev/null +++ b/frontend/dist/showcase/reports/def5b9b862a447ac8c61e168af28c263.html @@ -0,0 +1 @@ +Saved DefectRAG example

Saved inspection example

Previously measured VisA example. No live inference runs on this website.

VisA · Zou et al., ECCV 2022 · CC BY 4.0 · resized images and model overlay. Dataset source

iddef5b9b862a447ac8c61e168af28c263
created_at2026-11-07T04:31:08.612264+00:00
categorycashew
verdictAnomalous
score0.19361598789691925
threshold0.10727595388889313
uncertainty_margin0.005363797694444657
inference_ms32.13
model_iddinov2-tuned-cashew-v1

Image and measured heatmap

VisA sampleSaved heatmap

Recorded evidence conversation

No evidence conversation was recorded for this inspection.

\ No newline at end of file diff --git a/frontend/dist/showcase/reports/e80a1c06812b46858fe77c8dcba49e0d.html b/frontend/dist/showcase/reports/e80a1c06812b46858fe77c8dcba49e0d.html new file mode 100644 index 0000000000000000000000000000000000000000..36d464efe6043050339a278d236dfc49b8321e14 --- /dev/null +++ b/frontend/dist/showcase/reports/e80a1c06812b46858fe77c8dcba49e0d.html @@ -0,0 +1 @@ +Saved DefectRAG example

Saved inspection example

Previously measured VisA example. No live inference runs on this website.

VisA · Zou et al., ECCV 2022 · CC BY 4.0 · resized images and model overlay. Dataset source

ide80a1c06812b46858fe77c8dcba49e0d
created_at2026-11-07T04:31:10.971729+00:00
categorymacaroni2
verdictAnomalous
score0.12074433267116547
threshold0.09993447512388229
uncertainty_margin0.004996723756194115
inference_ms35.36
model_iddinov2-tuned-macaroni2-v1

Image and measured heatmap

VisA sampleSaved heatmap

Recorded evidence conversation

No evidence conversation was recorded for this inspection.

\ No newline at end of file diff --git a/frontend/dist/showcase/reports/f844a1e1a3c84cb7883c22af86f37dd2.html b/frontend/dist/showcase/reports/f844a1e1a3c84cb7883c22af86f37dd2.html new file mode 100644 index 0000000000000000000000000000000000000000..49b130c9d4e3b7f79997d5d959d2583878003f18 --- /dev/null +++ b/frontend/dist/showcase/reports/f844a1e1a3c84cb7883c22af86f37dd2.html @@ -0,0 +1 @@ +Saved DefectRAG example

Saved inspection example

Previously measured VisA example. No live inference runs on this website.

VisA · Zou et al., ECCV 2022 · CC BY 4.0 · resized images and model overlay. Dataset source

idf844a1e1a3c84cb7883c22af86f37dd2
created_at2026-11-07T04:31:11.103005+00:00
categorymacaroni2
verdictGood
score0.0933448076248169
threshold0.09993447512388229
uncertainty_margin0.004996723756194115
inference_ms41.66
model_iddinov2-tuned-macaroni2-v1

Image and measured heatmap

VisA sampleSaved heatmap

Recorded evidence conversation

No evidence conversation was recorded for this inspection.

\ No newline at end of file diff --git a/frontend/dist/showcase/reports/f92d581f4bc64724b9f3fffb8e38f709.html b/frontend/dist/showcase/reports/f92d581f4bc64724b9f3fffb8e38f709.html new file mode 100644 index 0000000000000000000000000000000000000000..f541a7fcdefe363ee501b293197f9a1fcc3a9979 --- /dev/null +++ b/frontend/dist/showcase/reports/f92d581f4bc64724b9f3fffb8e38f709.html @@ -0,0 +1 @@ +Saved DefectRAG example

Saved inspection example

Previously measured VisA example. No live inference runs on this website.

VisA · Zou et al., ECCV 2022 · CC BY 4.0 · resized images and model overlay. Dataset source

idf92d581f4bc64724b9f3fffb8e38f709
created_at2026-11-07T04:31:13.005067+00:00
categorypipe_fryum
verdictGood
score0.11506223678588867
threshold0.14284870028495786
uncertainty_margin0.007142435014247894
inference_ms38.44
model_iddinov2-tuned-pipe_fryum-v1

Image and measured heatmap

VisA sampleSaved heatmap

Recorded evidence conversation

No evidence conversation was recorded for this inspection.

\ No newline at end of file diff --git a/frontend/dist/showcase/reports/fed8c208317840b2a0c6bea6f404bbc8.html b/frontend/dist/showcase/reports/fed8c208317840b2a0c6bea6f404bbc8.html new file mode 100644 index 0000000000000000000000000000000000000000..afc66f9abdc52123381a7280bcc081fe9f58ccee --- /dev/null +++ b/frontend/dist/showcase/reports/fed8c208317840b2a0c6bea6f404bbc8.html @@ -0,0 +1 @@ +Saved DefectRAG example

Saved inspection example

Previously measured VisA example. No live inference runs on this website.

VisA · Zou et al., ECCV 2022 · CC BY 4.0 · resized images and model overlay. Dataset source

idfed8c208317840b2a0c6bea6f404bbc8
created_at2026-11-07T04:31:09.756854+00:00
categorychewinggum
verdictUncertain
score0.12110640108585358
threshold0.11576281487941742
uncertainty_margin0.005788140743970872
inference_ms40.44
model_iddinov2-tuned-chewinggum-v1

Image and measured heatmap

VisA sampleSaved heatmap

Recorded evidence conversation

No evidence conversation was recorded for this inspection.

\ No newline at end of file