import{r as m,k as e}from"./index-BVfpSx5Q.js";import{L as p}from"./layout-NiehYZnq.js";import{P as g,S as i,C as c}from"./ui-DGkmnhL-.js";import{A as t}from"./cookbookContent-DI9NJhNa.js";function h(a,r){const o=a.toLowerCase(),s=[];for(const n of r){const d=[];let l=0;const x=n.toLowerCase();for(;(l=o.indexOf(x,l))!==-1;)d.push(l),l+=x.length;d.length>0&&s.push({token:n,positions:d})}return{passed:s.length===0,violations:s,scannedLength:a.length}}function v(){const[a,r]=m.useState("Welcome to a11oy — governed by the carlota-jo immune organ."),o=m.useMemo(()=>h(a,t.bannedTokens),[a]);return e.jsxs(p,{children:[e.jsx(g,{label:"COOKBOOK · anatomy-evolved-v1",title:"Anatomy Evolved — 8 organs + doctrine guard",subtitle:`Sealed ${t.sealed}. Author: ${t.author} · ORCID ${t.orcid}.`,status:"LIVE"}),e.jsx(i,{children:"Eight organs"}),e.jsx("div",{className:"grid md:grid-cols-2 lg:grid-cols-4 gap-4 mb-8",children:t.organs.map(s=>e.jsxs(c,{children:[e.jsx("div",{className:"text-sm font-display font-semibold mb-1",style:{color:s.id==="carlota-jo"?"#c9b787":"var(--color-a11oy-text)"},children:s.id}),e.jsx("p",{className:"text-xs",style:{color:"var(--color-a11oy-text-sub)",lineHeight:1.5},children:s.role})]},s.id))}),e.jsx(i,{children:"carlota-jo doctrine guard — adversarial-prompt playground"}),e.jsxs(c,{children:[e.jsx("p",{className:"text-xs mb-3",style:{color:"var(--color-a11oy-text-ghost)",lineHeight:1.6},children:"The carlota-jo organ is the immune system / doctrine guard: a case-insensitive ban-list grep run at bundle and verdict time. Type any prompt below; the guard scans it live (logic ported from carlota-jo-doctrine-guard.ts). Try inserting a banned token to watch it deny."}),e.jsx("textarea",{value:a,onChange:s=>r(s.target.value),rows:3,className:"w-full px-3 py-2 text-sm rounded font-mono",style:{background:"rgba(255,255,255,0.04)",color:"var(--color-a11oy-text)",border:"1px solid rgba(255,255,255,0.1)"}}),e.jsx("div",{className:"mt-3 flex flex-wrap gap-2",children:t.bannedTokens.map(s=>e.jsxs("button",{onClick:()=>r(n=>`${n} ${s}`),className:"text-[11px] px-2 py-1 rounded",style:{background:"rgba(217,115,122,0.12)",color:"#d9737a",border:"1px solid rgba(217,115,122,0.3)"},children:['+ inject "',s,'"']},s))}),e.jsxs("div",{className:"mt-4 p-3 rounded",style:{background:o.passed?"rgba(95,184,120,0.1)":"rgba(217,115,122,0.12)"},children:[e.jsx("div",{className:"text-sm font-semibold",style:{color:o.passed?"#5fb878":"#d9737a"},children:o.passed?"PASS — doctrine clean":`DENIED — ${o.violations.length} violation(s)`}),!o.passed&&e.jsx("ul",{className:"text-xs mt-1 font-mono",style:{color:"var(--color-a11oy-text-sub)"},children:o.violations.map(s=>e.jsxs("li",{children:['"',s.token,'" at positions [',s.positions.join(", "),"]"]},s.token))})]})]}),e.jsxs("div",{className:"grid lg:grid-cols-2 gap-6 my-8",children:[e.jsxs(c,{children:[e.jsx(i,{children:"Series A acceptance evidence"}),e.jsx("ul",{className:"text-xs space-y-1",style:{color:"var(--color-a11oy-text-sub)"},children:t.seriesAEvidence.map(s=>e.jsxs("li",{children:["✓ ",s]},s))})]}),e.jsxs(c,{children:[e.jsx(i,{children:"Citations"}),e.jsx("ul",{className:"text-xs space-y-1",style:{color:"var(--color-a11oy-text-sub)"},children:t.citations.map(s=>e.jsxs("li",{children:["• ",s]},s))})]})]})]})}export{v as CookbookAnatomy};