const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/GraphView-D56vUGn7.js","assets/index-DgTg5QdX.js","assets/index-Cq_BqGQa.css"])))=>i.map(i=>d[i]); var ke=Object.defineProperty;var ve=(d,i,c)=>i in d?ke(d,i,{enumerable:!0,configurable:!0,writable:!0,value:c}):d[i]=c;var U=(d,i,c)=>ve(d,typeof i!="symbol"?i+"":i,c);import{c as h,r as s,j as e,u as Ne,b as Se,I as J,J as Ce,C as W,K as Ee,S as Me,M as ze,N as _,e as x,O as _e,Q as Oe,X,v as Z,_ as Te,g as j}from"./index-DgTg5QdX.js";import{C as Y}from"./copy-BdEWnHoH.js";import{S as Ae}from"./send-o-W_9aTj.js";import{B as De}from"./book-open-lYTKOEmg.js";/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Ge=h("List",[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Ie=h("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Le=h("MessagesSquare",[["path",{d:"M14 9a2 2 0 0 1-2 2H6l-4 4V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2z",key:"p1xzt8"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v11l-4-4h-6a2 2 0 0 1-2-2v-1",key:"1cx29u"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Fe=h("Minimize2",[["polyline",{points:"4 14 10 14 10 20",key:"11kfnr"}],["polyline",{points:"20 10 14 10 14 4",key:"rlmsce"}],["line",{x1:"14",x2:"21",y1:"10",y2:"3",key:"o5lafz"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Pe=h("Scroll",[["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const ee=h("Share2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Re=h("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);class re extends s.Component{constructor(){super(...arguments);U(this,"state",{error:null})}static getDerivedStateFromError(c){return{error:c}}render(){return this.state.error?e.jsxs("div",{className:"h-[480px] rounded-2xl border border-red-500/20 bg-red-500/5 p-6 text-xs text-red-400 overflow-auto",children:[e.jsx("div",{className:"font-semibold mb-2",children:"Graph konnte nicht gerendert werden"}),e.jsx("pre",{className:"whitespace-pre-wrap break-words text-[11px] leading-relaxed",children:this.state.error.message})]}):this.props.children}}const te=s.lazy(()=>Te(()=>import("./GraphView-D56vUGn7.js"),__vite__mapDeps([0,1,2])).then(d=>({default:d.GraphView}))),k=["identity","knowledge","rules","events"],se=new Set(["auto","agent","hermes"]),O={identity:{label:"Identität",icon:Re,bg:"bg-cyan-500/10",text:"text-cyan-400"},knowledge:{label:"Wissen",icon:Oe,bg:"bg-indigo-500/10",text:"text-indigo-400"},rules:{label:"Regeln",icon:Pe,bg:"bg-violet-500/10",text:"text-violet-400"},events:{label:"Ereignisse",icon:_e,bg:"bg-amber-500/10",text:"text-amber-400"}},ne={label:"Gedächtnis",icon:De,text:"text-muted-foreground"},Ve={identity:"border-l-cyan-500/80",knowledge:"border-l-indigo-500/80",rules:"border-l-violet-500/80",events:"border-l-amber-500/80"},ae=`Hi Hermes! Lass uns ein kurzes Onboarding machen, damit du dich künftig an mich erinnerst. Stell mir nacheinander ein paar kurze Fragen zu: 1) wer ich bin und woran ich gerade arbeite, 2) wie ich angesprochen werden möchte, 3) meine bevorzugten Tools, Sprachen und Arbeitsweise, 4) wichtige Regeln/Konventionen, die du beachten sollst, 5) meine Infrastruktur (Server, Dienste – ohne Geheimnisse). Frag immer nur eine sache auf einmal und fass am Ende zusammen, was du dir gemerkt hast.`;function Qe(){const[d,i]=s.useState(""),[c,oe]=s.useState(""),[v,T]=s.useState(""),[A,le]=s.useState("knowledge"),[de,D]=s.useState(!1),[G,I]=s.useState(!1),[N,ie]=s.useState("liste"),[ce,w]=s.useState(!1),[p,g]=s.useState(null),[m,L]=s.useState(!1),[F,ue]=s.useState(()=>typeof window<"u"&&window.matchMedia("(min-width: 1024px)").matches);s.useEffect(()=>{const r=window.matchMedia("(min-width: 1024px)"),t=n=>ue(n.matches);return r.addEventListener("change",t),()=>r.removeEventListener("change",t)},[]);const P=Ne(),{showAlert:f,showConfirm:R,dialogElement:xe}=Se(),{data:u=[]}=J({}),{data:y=[],error:V}=J({q:c,category:d}),{data:b}=Ce(!0),$=V?String(V):"";s.useEffect(()=>{if(!m)return;const r=t=>{t.key==="Escape"&&L(!1)};return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[m]);const S=()=>{P.invalidateQueries({queryKey:["memory"]}),P.invalidateQueries({queryKey:["memory-graph"]})},C=s.useMemo(()=>{const r=u.length,t=u.filter(n=>se.has(n.source)).length;return{total:r,auto:t,manual:r-t,cats:new Set(u.map(n=>n.category)).size}},[u]),me=u.length===0,E=s.useDeferredValue(c),q=s.useMemo(()=>{const r=b??{nodes:[],edges:[]};if(!E.trim())return r;const t=E.toLowerCase(),n=r.nodes.filter(a=>a.content.toLowerCase().includes(t)),l=new Set(n.map(a=>a.id));return{nodes:n,edges:r.edges.filter(a=>l.has(a.source)&&l.has(a.target))}},[b,E]),ge=s.useMemo(()=>{const r={};return y.forEach(t=>{var n;(r[n=t.category]??(r[n]=[])).push(t)}),r},[y]),he=s.useMemo(()=>y.filter(r=>!k.includes(r.category)),[y]);async function pe(){v.trim()&&(await j("/api/memory",{method:"POST",body:JSON.stringify({content:v,category:A,source:"ui"})}),T(""),w(!1),S())}function K(r){R("Eintrag löschen?","Diesen Gedächtnis-Eintrag dauerhaft entfernen?",async()=>{try{await j(`/api/memory/${r}`,{method:"DELETE"}),S()}catch(t){f("Fehler",`Löschen fehlgeschlagen: ${t.message||t}`)}})}async function M(){try{await navigator.clipboard.writeText(ae),I(!0),setTimeout(()=>I(!1),1800)}catch{f("Kopieren fehlgeschlagen","Markiere den Prompt und kopiere ihn manuell (Strg+C).")}}function be(){M(),window.dispatchEvent(new CustomEvent("mc-navigate",{detail:{view:"terminal"}}))}async function fe(){D(!0);try{const r=await j("/api/memory/dedupe",{method:"POST",body:JSON.stringify({apply:!1})});if(r.duplicate_count===0){f("Ergebnis","Keine Dubletten gefunden — alles sauber.");return}const t=l=>l.length>90?l.slice(0,90)+"…":l,n=r.groups.slice(0,5).map(l=>`✓ bleibt: „${t(l.keep.content)}" ✗ weg: ${l.remove.map(a=>`„${t(a.content)}"`).join(", ")}`).join(` `)+(r.groups.length>5?` … und ${r.groups.length-5} weitere Gruppe(n).`:"");R("Deduplizierung bestätigen",`${r.duplicate_count} Dublette(n) in ${r.groups.length} Gruppe(n) gefunden: ${n} Zusammenführen?`,async()=>{try{await j("/api/memory/dedupe",{method:"POST",body:JSON.stringify({apply:!0})}),S()}catch(l){f("Fehler",`Fehler beim Löschen: ${l.message}`)}})}catch(r){f("Fehler",`Fehler bei der Deduplizierung: ${r.message}`)}finally{D(!1)}}const o=s.useMemo(()=>u.find(r=>r.id===p),[u,p]),H=s.useMemo(()=>{if(!o||!b)return[];const r=new Set([...b.edges.filter(t=>t.source===o.id).map(t=>t.target),...b.edges.filter(t=>t.target===o.id).map(t=>t.source)]);return u.filter(t=>r.has(t.id))},[o,b,u]),z={identity:"#00f5ff",knowledge:"#3b82f6",rules:"#d946ef",events:"#fbbf24"},ye={identity:"Identität",knowledge:"Wissen",rules:"Regeln",events:"Ereignisse"},B=new Set(["auto","agent","hermes"]);return e.jsxs("div",{className:"space-y-6",children:[me?e.jsxs("div",{className:"rounded-2xl border border-dashed border-border/60 bg-card/20 p-8 sm:p-10 flex flex-col items-center text-center gap-5",children:[e.jsx("div",{className:"h-14 w-14 rounded-2xl bg-primary/10 flex items-center justify-center",children:e.jsx(Le,{className:"h-7 w-7 text-primary"})}),e.jsxs("div",{className:"space-y-1.5 max-w-lg",children:[e.jsx("h3",{className:"text-base font-semibold text-foreground",children:"Lass Hermes dich kennenlernen"}),e.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:"Statt Fakten einzutippen: führ ein kurzes Onboarding-Gespräch mit Hermes. Was ihr besprecht, merkt sich das Gedächtnis automatisch — du musst nichts manuell pflegen."})]}),e.jsxs("div",{className:"w-full max-w-lg text-left",children:[e.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[e.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground/60",children:"Sende das an Hermes"}),e.jsx("button",{onClick:M,className:"flex items-center gap-1 text-[10px] font-semibold text-muted-foreground hover:text-foreground transition-colors",children:G?e.jsxs(e.Fragment,{children:[e.jsx(W,{className:"h-3 w-3 text-emerald-400"})," Kopiert"]}):e.jsxs(e.Fragment,{children:[e.jsx(Y,{className:"h-3 w-3"})," Kopieren"]})})]}),e.jsx("pre",{className:"w-full rounded-xl border border-border/60 bg-background/40 p-3.5 text-[11px] leading-relaxed text-foreground/90 whitespace-pre-wrap font-mono",children:ae})]}),e.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-2",children:[e.jsxs("button",{onClick:be,className:"h-9 px-4 rounded-lg bg-primary text-primary-foreground text-xs font-semibold hover:opacity-90 transition-all flex items-center gap-1.5 cursor-pointer",children:[e.jsx(Ee,{className:"h-4 w-4"})," Im Terminal starten"]}),e.jsxs("button",{onClick:M,className:"h-9 px-4 rounded-lg border border-border/60 bg-card text-xs font-semibold hover:border-primary/50 transition-all flex items-center gap-1.5 cursor-pointer",children:[G?e.jsx(W,{className:"h-4 w-4 text-emerald-400"}):e.jsx(Y,{className:"h-4 w-4"})," Prompt kopieren"]})]}),e.jsxs("p",{className:"text-[11px] text-muted-foreground/70 flex items-center gap-1.5",children:[e.jsx(Ae,{className:"h-3 w-3"})," Funktioniert genauso über Telegram —"," ",e.jsx("button",{onClick:()=>w(!0),className:"underline hover:text-foreground",children:"oder lieber manuell anlegen"}),"."]})]}):e.jsxs("div",{className:x("bg-[#030712] overflow-hidden transition-all duration-300 ease-in-out",m?"fixed inset-0 z-50 w-screen h-screen":"relative w-full h-[calc(100vh-8.5rem)] min-h-[620px] rounded-2xl border border-border/60 flex flex-col lg:block"),children:[F&&e.jsx("div",{className:"absolute inset-0 z-0 hidden lg:block",children:e.jsx(re,{children:e.jsx(s.Suspense,{fallback:e.jsx("div",{className:"absolute inset-0 flex items-center justify-center text-xs text-muted-foreground",children:"Graph wird geladen…"}),children:e.jsx(te,{data:q,selectedNodeId:p,onNodeSelect:g})})})}),e.jsxs("div",{className:x("z-10 flex flex-col transition-all duration-300",m?"lg:absolute lg:left-6 lg:top-6 lg:bottom-6 lg:w-96 lg:rounded-xl lg:border lg:border-border/40 lg:bg-background/65 lg:backdrop-blur-md lg:p-4 lg:shadow-2xl lg:shadow-black/50 lg:h-[calc(100%-3rem)]":"lg:absolute lg:left-4 lg:top-4 lg:bottom-4 lg:w-96 lg:rounded-xl lg:border lg:border-border/40 lg:bg-background/65 lg:backdrop-blur-md lg:p-4 lg:shadow-2xl lg:shadow-black/50 lg:h-[calc(100%-2rem)]","w-full h-full p-4 flex-1 lg:flex-none",N==="graph"&&"hidden lg:flex"),children:[e.jsxs("div",{className:"space-y-3 mb-3 shrink-0",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-xl font-space font-bold tracking-tight bg-gradient-to-r from-foreground via-foreground to-primary bg-clip-text text-transparent",children:"Gedächtnis-Pool"}),e.jsx("p",{className:"text-[11px] text-muted-foreground leading-relaxed mt-0.5",children:"IDEs & Gateway lesen und lernen hier per MCP."})]}),e.jsx("button",{onClick:()=>L(!m),className:"p-1.5 rounded-lg border border-border/40 bg-card/45 hover:border-primary/50 text-muted-foreground hover:text-foreground transition-all cursor-pointer hidden lg:block",title:m?"Vollbild verlassen (Esc)":"In Vollbild maximieren",children:m?e.jsx(Fe,{className:"h-4 w-4"}):e.jsx(Ie,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[e.jsxs("span",{className:"text-[9px] font-semibold bg-primary/10 text-primary border border-primary/20 px-2 py-0.5 rounded-md",children:[C.total," Fakten"]}),e.jsxs("span",{className:"text-[9px] font-semibold bg-emerald-500/10 text-emerald-400 border border-emerald-500/20 px-2 py-0.5 rounded-md",children:[C.auto," auto"]}),e.jsxs("span",{className:"text-[9px] font-semibold bg-card/60 text-muted-foreground border border-border/40 px-2 py-0.5 rounded-md",children:[C.cats," Kat."]})]}),e.jsxs("div",{className:"flex items-center gap-1.5 w-full",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx("input",{value:c,onChange:r=>oe(r.target.value),"aria-label":"Gedächtnis durchsuchen",type:"search",placeholder:"Semantisch suchen…",className:"w-full h-8 pl-8 pr-3 rounded-lg border border-border/50 bg-background/40 text-[11px] outline-none focus:ring-1 focus:ring-primary/50 text-foreground"}),e.jsx(Me,{className:"absolute left-2.5 top-2.5 h-3.5 w-3.5 text-muted-foreground"})]}),e.jsx("button",{onClick:()=>w(r=>!r),title:"Eintrag hinzufügen",className:"h-8 w-8 shrink-0 rounded-lg bg-primary text-primary-foreground text-xs font-semibold hover:opacity-90 transition-all flex items-center justify-center cursor-pointer shadow-md shadow-primary/10",children:e.jsx(ze,{className:"h-4 w-4"})}),e.jsx("button",{onClick:fe,disabled:de,title:"Deduplizieren",className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-lg border border-border/60 bg-card/45 hover:border-primary/50 transition-all cursor-pointer shadow-md disabled:opacity-50",children:e.jsx(_,{className:"h-3.5 w-3.5 text-primary"})}),e.jsx("div",{className:"flex items-center gap-1 p-0.5 bg-card/30 border border-border/40 rounded-lg lg:hidden",children:[["liste",Ge],["graph",ee]].map(([r,t])=>e.jsx("button",{onClick:()=>ie(r),className:x("flex h-7 w-7 items-center justify-center rounded-md transition-all cursor-pointer",N===r?"bg-primary text-primary-foreground":"text-muted-foreground"),children:e.jsx(t,{className:"h-3.5 w-3.5"})},r))})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1 p-0.5 bg-card/30 border border-border/40 rounded-lg w-full overflow-x-auto shrink-0 scrollbar-none",children:[e.jsx("button",{onClick:()=>i(""),className:x("h-6 px-2 rounded-md text-[9px] font-semibold uppercase tracking-wider transition-all cursor-pointer shrink-0",d?"text-muted-foreground hover:text-foreground":"bg-primary text-primary-foreground"),children:"Alle"}),k.map(r=>{const t=O[r]||ne;return e.jsx("button",{onClick:()=>i(r),className:x("h-6 px-2 rounded-md text-[9px] font-semibold uppercase tracking-wider transition-all cursor-pointer flex items-center gap-1 shrink-0",d===r?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"),children:t.label},r)})]})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto pr-1 scrollbar-thin space-y-4",children:[ce&&e.jsxs("div",{className:"rounded-xl border border-border/50 bg-background/50 p-3 space-y-2 shrink-0",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("div",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground",children:"Neuer Eintrag"}),e.jsx("button",{onClick:()=>w(!1),className:"text-muted-foreground hover:text-foreground",children:e.jsx(X,{className:"h-3.5 w-3.5"})})]}),e.jsx("textarea",{value:v,onChange:r=>T(r.target.value),rows:2,placeholder:"Vorliebe, Regel oder Fakt…",className:"w-full resize-none rounded-lg border border-border/50 bg-background/30 p-2 text-[11px] outline-none focus:ring-1 focus:ring-primary/50 text-foreground leading-relaxed"}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("select",{value:A,onChange:r=>le(r.target.value),className:"h-7 rounded-md border border-border/50 bg-background/50 px-1 text-[10px] outline-none text-foreground cursor-pointer",children:k.map(r=>{var t;return e.jsx("option",{value:r,className:"bg-popover text-foreground",children:((t=O[r])==null?void 0:t.label)||r},r)})}),e.jsx("button",{onClick:pe,className:"h-7 px-2.5 rounded-md bg-primary text-primary-foreground text-[10px] font-semibold hover:opacity-90 transition-all cursor-pointer",children:"Speichern"})]})]}),$&&e.jsxs("div",{className:"rounded-lg border border-red-500/20 bg-red-500/5 p-3 text-[10px] text-red-400",children:["Fehler: ",$]}),y.length===0?e.jsx("div",{className:"text-[11px] text-muted-foreground border border-dashed border-border/60 rounded-xl p-8 text-center bg-card/10",children:"Keine Einträge gefunden."}):e.jsx("div",{className:"space-y-4",children:[...k,"__other"].map(r=>{const t=r==="__other"?he:ge[r]||[];if(!t.length)return null;const n=O[r]||ne,l=n.icon;return e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5 px-0.5",children:[e.jsx(l,{className:x("h-3 w-3",n.text)}),e.jsx("span",{className:x("text-[9px] font-bold uppercase tracking-wider",n.text),children:n.label}),e.jsx("span",{className:"text-[9px] font-mono text-muted-foreground/60 bg-card/50 rounded px-1",children:t.length})]}),e.jsx("div",{className:"space-y-1.5",children:t.map(a=>{const we=se.has(a.source),Q=p===a.id;return e.jsxs("div",{onClick:()=>g(Q?null:a.id),className:x("flex items-start justify-between gap-3 p-2.5 rounded-lg border border-l-4 transition-all group cursor-pointer text-left",Q?"bg-primary/10 border-primary shadow-md":"bg-card/45 border-border/40 hover:bg-card/75",Ve[a.category]||"border-l-muted"),children:[e.jsx("span",{className:"text-[11px] text-foreground leading-relaxed break-words whitespace-pre-wrap flex-1 min-w-0",children:a.content}),e.jsxs("div",{className:"flex items-center gap-1.5 shrink-0 self-center",children:[we&&e.jsx("span",{title:"Auto gelernt",children:e.jsx(_,{className:"h-2.5 w-2.5 text-emerald-400"})}),e.jsx("button",{onClick:je=>{je.stopPropagation(),K(a.id),p===a.id&&g(null)},className:"h-5 w-5 rounded-md flex items-center justify-center border border-border/40 text-muted-foreground hover:text-red-400 hover:bg-red-500/5 transition-all opacity-0 group-hover:opacity-100",children:e.jsx(Z,{className:"h-3.5 w-3.5"})})]})]},a.id)})})]},r)})})]})]}),!F&&N==="graph"&&e.jsx("div",{className:"w-full h-[500px] relative lg:hidden",children:e.jsx(re,{children:e.jsx(s.Suspense,{fallback:e.jsx("div",{className:"h-full rounded-2xl border border-border/60 bg-card/30 flex items-center justify-center text-xs text-muted-foreground",children:"Graph wird geladen…"}),children:e.jsx(te,{data:q,selectedNodeId:p,onNodeSelect:g})})})}),o&&e.jsxs("div",{className:x("z-10 flex flex-col transition-all duration-300",m?"lg:absolute lg:right-6 lg:top-6 lg:bottom-6 lg:w-80 lg:rounded-xl lg:border lg:border-border/40 lg:bg-background/65 lg:backdrop-blur-md lg:p-4 lg:shadow-2xl lg:shadow-black/50 lg:h-[calc(100%-3rem)]":"lg:absolute lg:right-4 lg:top-4 lg:bottom-4 lg:w-80 lg:rounded-xl lg:border lg:border-border/40 lg:bg-background/65 lg:backdrop-blur-md lg:p-4 lg:shadow-2xl lg:shadow-black/50 lg:h-[calc(100%-2rem)]","w-full p-4 border-t border-border/60 bg-card/45 shrink-0 flex flex-col"),children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3 shrink-0",children:[e.jsx("span",{className:"w-2.5 h-2.5 rounded-full",style:{background:z[o.category]}}),e.jsx("span",{className:"text-[9px] font-bold uppercase tracking-wider",style:{color:z[o.category]},children:ye[o.category]||o.category}),e.jsxs("span",{className:`ml-auto text-[9px] font-mono flex items-center gap-1 ${B.has(o.source)?"text-emerald-400":"text-muted-foreground/70"}`,children:[B.has(o.source)&&e.jsx(_,{className:"h-2.5 w-2.5"}),o.source]}),e.jsx("button",{onClick:()=>g(null),className:"text-muted-foreground hover:text-foreground ml-1.5 cursor-pointer",children:e.jsx(X,{className:"h-4 w-4"})})]}),e.jsx("div",{className:"flex-1 overflow-y-auto pr-1 scrollbar-thin text-xs text-foreground leading-relaxed mb-4 break-words whitespace-pre-wrap text-left",children:o.content}),e.jsxs("div",{className:"mt-auto shrink-0 space-y-3 pt-3 border-t border-border/30",children:[e.jsxs("div",{className:"text-[9px] font-bold uppercase tracking-wider text-muted-foreground/70 flex items-center gap-1",children:[e.jsx(ee,{className:"h-2.5 w-2.5"})," verwandte Fakten"]}),e.jsx("div",{className:"flex flex-col gap-1 max-h-40 overflow-y-auto scrollbar-none text-left",children:H.length?H.map(r=>e.jsxs("button",{onClick:()=>g(r.id),className:"flex items-center gap-2 text-[10px] text-muted-foreground hover:text-foreground text-left transition-colors cursor-pointer py-0.5",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full shrink-0",style:{background:z[r.category]}}),e.jsx("span",{className:"truncate",children:r.content})]},r.id)):e.jsx("span",{className:"text-[10px] text-muted-foreground/60",children:"—"})}),e.jsxs("button",{onClick:()=>{K(o.id),g(null)},className:"flex w-full items-center justify-center gap-1.5 text-[10px] font-bold text-red-400 border border-red-500/20 rounded-lg py-2 hover:bg-red-500/5 transition-all cursor-pointer",children:[e.jsx(Z,{className:"h-3.5 w-3.5"})," Eintrag vergessen"]})]})]})]}),xe]})}export{Qe as MemoryView};