From cfcb5d2db5f16d972fee1a77f4f08a47a9eaeacb Mon Sep 17 00:00:00 2001 From: Hitonabi Date: Mon, 20 Jul 2026 17:04:19 +0200 Subject: [PATCH] IDE-Intake: Tiefe-Wahl (simpel/gruendlich) statt einem IDE-Knopf MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Drei Modus-Knoepfe: Box · IDE: simpel · IDE: gruendlich. Die Wahl fliesst als 'AUFWAND (vom Commander gewaehlt): SIMPEL/GRUENDLICH'-Zeile in den Auftrag und UEBERSTIMMT die Groessen-Selbsteinschaetzung von konzept-fliessband (simpel=2 Rollen/1 Runde, gruendlich=volle Kaskade). Skill: bei echter Ambition zur vollen Tiefe (nicht 'im Zweifel kleiner'), explizite Commander-Wahl schlaegt Schaetzung. Auto-Skalierung bleibt Fallback fuer Telegram/Lucy (ohne Knopf). Co-Authored-By: Claude Fable 5 --- backend/routers/ideen.py | 3 +- backend/services/ideen.py | 35 ++++++++++--- deploy/skills/konzept-fliessband/SKILL.md | 13 ++++- ...View-Di2UOnE1.js => AgentView-LDHesxj5.js} | 2 +- .../dist/assets/AuftragsbuchView-DadfFVer.js | 49 ------------------- .../dist/assets/AuftragsbuchView-MX5C46g1.js | 49 +++++++++++++++++++ ...ew-BabmqWxX.js => ChronikView-DziulU9V.js} | 2 +- ...ew-u_EPDy1I.js => ConnectView-Ckkd4eR_.js} | 2 +- ...Bva-XFZC.js => EigenlebenView-BpLy1pkU.js} | 2 +- ...View-BjVVXu3Y.js => GraphView-4Mi6huEE.js} | 2 +- ...View-CYI8_6-q.js => GuideView-BAhrG_68.js} | 2 +- ...ew-Db6bdlag.js => KonsoleView-DuxI06Wh.js} | 2 +- ...iew-e6Kdpx5n.js => MemoryView-B6IXcZEl.js} | 6 +-- ...iew-DRiKlRjv.js => ModelsView-D0ujmpST.js} | 2 +- ...iew-BfvotQrk.js => WissenView-C7GDdv1b.js} | 2 +- ...open-BfZKBC8k.js => book-open-cVx_1TDg.js} | 2 +- ...cle-x-Cjrbyjns.js => circle-x-D1J1uP0I.js} | 2 +- ...e-xml-Bcfg4oSP.js => code-xml-DFsBpkB8.js} | 2 +- .../{copy-HOrvM3LI.js => copy-ZerQbIeQ.js} | 2 +- ...en-J5CPCk3B.js => folder-open-qsFqfA7z.js} | 2 +- .../{index-Cpokgrtb.js => index-CYprWjkZ.js} | 4 +- ...{layers-CMPjDrtd.js => layers-BVmbzkl8.js} | 2 +- ...bulb-BwLArGh_.js => lightbulb-DygeZkD3.js} | 2 +- ...ccw-wHFM0h2t.js => rotate-ccw-CXI0Tldw.js} | 2 +- .../{send-grypp2_x.js => send-CjExvNpv.js} | 2 +- .../{zap-Bc_35rOi.js => zap-hBXNCtdw.js} | 2 +- frontend/dist/index.html | 2 +- frontend/src/views/AuftragsbuchView.tsx | 42 ++++++++++------ 28 files changed, 143 insertions(+), 98 deletions(-) rename frontend/dist/assets/{AgentView-Di2UOnE1.js => AgentView-LDHesxj5.js} (99%) delete mode 100644 frontend/dist/assets/AuftragsbuchView-DadfFVer.js create mode 100644 frontend/dist/assets/AuftragsbuchView-MX5C46g1.js rename frontend/dist/assets/{ChronikView-BabmqWxX.js => ChronikView-DziulU9V.js} (99%) rename frontend/dist/assets/{ConnectView-u_EPDy1I.js => ConnectView-Ckkd4eR_.js} (98%) rename frontend/dist/assets/{EigenlebenView-Bva-XFZC.js => EigenlebenView-BpLy1pkU.js} (98%) rename frontend/dist/assets/{GraphView-BjVVXu3Y.js => GraphView-4Mi6huEE.js} (99%) rename frontend/dist/assets/{GuideView-CYI8_6-q.js => GuideView-BAhrG_68.js} (99%) rename frontend/dist/assets/{KonsoleView-Db6bdlag.js => KonsoleView-DuxI06Wh.js} (98%) rename frontend/dist/assets/{MemoryView-e6Kdpx5n.js => MemoryView-B6IXcZEl.js} (98%) rename frontend/dist/assets/{ModelsView-DRiKlRjv.js => ModelsView-D0ujmpST.js} (99%) rename frontend/dist/assets/{WissenView-BfvotQrk.js => WissenView-C7GDdv1b.js} (98%) rename frontend/dist/assets/{book-open-BfZKBC8k.js => book-open-cVx_1TDg.js} (90%) rename frontend/dist/assets/{circle-x-Cjrbyjns.js => circle-x-D1J1uP0I.js} (89%) rename frontend/dist/assets/{code-xml-Bcfg4oSP.js => code-xml-DFsBpkB8.js} (88%) rename frontend/dist/assets/{copy-HOrvM3LI.js => copy-ZerQbIeQ.js} (90%) rename frontend/dist/assets/{folder-open-J5CPCk3B.js => folder-open-qsFqfA7z.js} (90%) rename frontend/dist/assets/{index-Cpokgrtb.js => index-CYprWjkZ.js} (99%) rename frontend/dist/assets/{layers-CMPjDrtd.js => layers-BVmbzkl8.js} (91%) rename frontend/dist/assets/{lightbulb-BwLArGh_.js => lightbulb-DygeZkD3.js} (90%) rename frontend/dist/assets/{rotate-ccw-wHFM0h2t.js => rotate-ccw-CXI0Tldw.js} (88%) rename frontend/dist/assets/{send-grypp2_x.js => send-CjExvNpv.js} (90%) rename frontend/dist/assets/{zap-Bc_35rOi.js => zap-hBXNCtdw.js} (96%) diff --git a/backend/routers/ideen.py b/backend/routers/ideen.py index a935536..16f4a50 100644 --- a/backend/routers/ideen.py +++ b/backend/routers/ideen.py @@ -13,6 +13,7 @@ class IdeeIn(BaseModel): titel: str notiz: str = "" welt: str = "box" # "box" = Werkstatt baut · "ide" = vorbereiten für Zed + tiefe: str = "" # nur ide: "simpel" | "gruendlich" (leer = Box schätzt selbst) class TaskIn(BaseModel): @@ -31,7 +32,7 @@ def list_queue() -> dict: @router.post("/ideen") def add_idea(body: IdeeIn) -> dict: - res = ideen.add_idea(body.titel, body.notiz, welt=body.welt) + res = ideen.add_idea(body.titel, body.notiz, welt=body.welt, tiefe=body.tiefe) if not res.get("ok"): raise HTTPException(400, res.get("error", "Idee konnte nicht angelegt werden.")) return res diff --git a/backend/services/ideen.py b/backend/services/ideen.py index 3629d81..bad786d 100644 --- a/backend/services/ideen.py +++ b/backend/services/ideen.py @@ -275,7 +275,20 @@ def list_queue() -> dict: return data -def add_idea(titel: str, notiz: str = "", created_by: str = "mc2-ui", welt: str = "box") -> dict: +# Aufwand-Text je Tiefe, den der Commander per Knopf waehlt — wird dem Auftrag +# vorangestellt und ueberstimmt die Groessen-Selbsteinschaetzung von konzept-fliessband. +_AUFWAND = { + "simpel": ("AUFWAND (vom Commander gewaehlt): SIMPEL — nutze die KLEINE konzept-fliessband-" + "Variante: 2 Fach-Rollen, 1 Denk-Runde + 1 Haertetest, frueh raus bei WASSERDICHT. " + "Das ueberstimmt deine eigene Groessen-Einschaetzung."), + "gruendlich": ("AUFWAND (vom Commander gewaehlt): GRUENDLICH — nutze die VOLLE konzept-fliessband-" + "Kaskade: 3-5 Fach-Rollen, bis 3 Denk-Runden, mehrfacher Advocatus-Diaboli-Haertetest. " + "Das ueberstimmt deine eigene Groessen-Einschaetzung, auch wenn das Projekt klein wirkt."), +} + + +def add_idea(titel: str, notiz: str = "", created_by: str = "mc2-ui", + welt: str = "box", tiefe: str = "") -> dict: """Idee in die Queue legen. welt='box' (Default): triage — der Specifier arbeitet sie aus, die Werkstatt baut, @@ -284,18 +297,23 @@ def add_idea(titel: str, notiz: str = "", created_by: str = "mc2-ui", welt: str die Box härtet ein Konzept (konzept-fliessband), legt ein leeres Gitea-Repo an und füllt es NUR mit Doku. Ergebnis ist ein vorbereitetes Projekt, das der Commander in Zed selbst baut (IDE-Welt). Bewusst KEIN --triage: so fasst der Auto-Zerleger die - Karte nie an und die Werkstatt baut sie nie (der Fan-out-Fehler vom 20.07.).""" + Karte nie an und die Werkstatt baut sie nie (der Fan-out-Fehler vom 20.07.). + tiefe (nur ide): 'simpel' | 'gruendlich' — vom Knopf gewaehlte Konzept-Tiefe; leer = + die Box schaetzt selbst (Fallback fuer Telegram/Lucy).""" if not _available(): return {"ok": False, "error": "Die Ideen-Queue lebt auf der Box."} titel = (titel or "").strip() if not (3 <= len(titel) <= 200): return {"ok": False, "error": "Titel bitte zwischen 3 und 200 Zeichen."} welt = "ide" if str(welt).lower() == "ide" else "box" + notiz = (notiz or "").strip() if welt == "ide": args = ["create", titel, "--assignee", "projektstart", "--created-by", created_by, "--json"] + aufwand = _AUFWAND.get(str(tiefe).lower()) + if aufwand: + notiz = aufwand + ("\n\n" + notiz if notiz else "") else: args = ["create", titel, "--triage", "--created-by", created_by, "--json"] - notiz = (notiz or "").strip() if notiz: args[2:2] = ["--body", notiz[:4000]] try: @@ -611,9 +629,14 @@ def konzept_of(task_id: str) -> dict: d = _parse_json(r.stdout) except Exception: return {"available": True, "error": "Karte nicht lesbar."} - haystack = "" + # `kanban show --json` legt die Task-Felder verschachtelt unter "task" ab und + # liefert die jüngste Abschluss-Zusammenfassung als "latest_summary". + haystack, task_status = "", None if isinstance(d, dict): - haystack = str(d.get("result") or "") + "\n" + str(d.get("body") or "") + t = d.get("task") if isinstance(d.get("task"), dict) else d + task_status = t.get("status") + haystack = "\n".join(str(x or "") for x in ( + t.get("result"), t.get("body"), d.get("latest_summary"))) for ev in d.get("events") or []: if isinstance(ev, dict) and ev.get("kind") == "completed": haystack += "\n" + str((ev.get("payload") or {}).get("summary") or "") @@ -645,7 +668,7 @@ def konzept_of(task_id: str) -> dict: data = {"available": True, "repo": repo, "clone_url": clone_url, "datei": used_name, "konzept": konzept[:60000]} # Fertige Konzepte ändern sich selten → cachen (aber nur, wenn die Karte done ist). - if isinstance(d, dict) and d.get("status") == "done": + if task_status == "done": if len(_konzept_cache) >= 20: _konzept_cache.pop(next(iter(_konzept_cache))) _konzept_cache[task_id] = data diff --git a/deploy/skills/konzept-fliessband/SKILL.md b/deploy/skills/konzept-fliessband/SKILL.md index bed4ae7..6a5e8b3 100644 --- a/deploy/skills/konzept-fliessband/SKILL.md +++ b/deploy/skills/konzept-fliessband/SKILL.md @@ -65,8 +65,17 @@ heavy-Rollen einer Runde am Stueck (heavy bleibt warm), DANN der Skeptiker (ein - **Mittel:** 3 Rollen, bis 2 Runden. - **Gross / ambitioniert / viele bewegliche Teile:** volle 3-5 Rollen, bis 3 Runden. Du schaetzt die Groesse aus Idee + Recherche selbst ein und sagst sie im Uebergabe-Text - („Umfang: klein → 1 Runde"). Im Zweifel KLEINER anfangen — eine Runde mehr geht, verschenkte - 20 Minuten nicht. + („Umfang: klein → 1 Runde"). **Woran du „gross" erkennst:** mehrere Subsysteme, echte + Architektur-Entscheidungen, ein Datenmodell, externe Integrationen, Mehrbenutzer/Rechte, + Security-Flaeche. Bei offensichtlich Kleinem im Zweifel kleiner; **bei echter Ambition aber zur + VOLLEN Tiefe** — ein zu flaches Konzept fuer ein grosses Projekt kostet den Commander spaeter + teure Bau-Zeit (er baut auf einem wackligen Plan), das ist schlimmer als ein paar Minuten + Box-Zeit zu viel. +- **★ Explizite Commander-Wahl UEBERSTIMMT deine Einschaetzung.** Steht im Auftrag eine Zeile + „AUFWAND (vom Commander gewaehlt): SIMPEL …" bzw. „… GRUENDLICH …" (der Commander hat im + Auftragsbuch „IDE: simpel" oder „IDE: gruendlich" geklickt), dann HALTE DICH DARAN — SIMPEL = + 2 Rollen/1 Runde, GRUENDLICH = volle 3-5 Rollen/bis 3 Runden — auch wenn deine eigene + Schaetzung anders ausfaellt. Nur wenn KEINE solche Zeile da ist, entscheidest du selbst. - **Max 3 Denk-Runden — keine Endlosschleife.** Nach der letzten Runde (je nach Groesse 1-3) kommt IMMER die Editor-Endfassung, auch wenn Rest-Punkte offen sind (die dann ehrlich als „offene Punkte" ins Dokument). **Frueher raus ist gut:** meldet der Skeptiker WASSERDICHT, sofort zur diff --git a/frontend/dist/assets/AgentView-Di2UOnE1.js b/frontend/dist/assets/AgentView-LDHesxj5.js similarity index 99% rename from frontend/dist/assets/AgentView-Di2UOnE1.js rename to frontend/dist/assets/AgentView-LDHesxj5.js index d0348d8..0fa5cd2 100644 --- a/frontend/dist/assets/AgentView-Di2UOnE1.js +++ b/frontend/dist/assets/AgentView-LDHesxj5.js @@ -1,4 +1,4 @@ -import{c as A,Y as P,l as B,b as M,u as D,r as z,j as e,Z as T,e as a,$ as g,a0 as b,a1 as W,x as f,a2 as j,W as G,X as I,C as N,g as y,q as i}from"./index-Cpokgrtb.js";/** +import{c as A,Y as P,l as B,b as M,u as D,r as z,j as e,Z as T,e as a,$ as g,a0 as b,a1 as W,x as f,a2 as j,W as G,X as I,C as N,g as y,q as i}from"./index-CYprWjkZ.js";/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/AuftragsbuchView-DadfFVer.js b/frontend/dist/assets/AuftragsbuchView-DadfFVer.js deleted file mode 100644 index dba2d13..0000000 --- a/frontend/dist/assets/AuftragsbuchView-DadfFVer.js +++ /dev/null @@ -1,49 +0,0 @@ -import{c as L,j as e,e as v,aa as pe,ab as ne,u as ae,b as le,r as g,a3 as ie,L as C,C as de,U as oe,ac as ge,V as H,X as M,T as V,D as $,M as I,g as K,ad as be,ae as ce,af as fe,q as ue}from"./index-Cpokgrtb.js";import{L as je}from"./lightbulb-BwLArGh_.js";import{C as G}from"./code-xml-Bcfg4oSP.js";import{S as se}from"./send-grypp2_x.js";import{L as Ne}from"./layers-CMPjDrtd.js";import{R as ke}from"./rotate-ccw-wHFM0h2t.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 we=L("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/** - * @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 ye=L("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/** - * @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 ve=L("ClipboardCheck",[["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"}]]);/** - * @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 De=L("FileDiff",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M9 10h6",key:"9gxzsh"}],["path",{d:"M12 13V7",key:"h0r20n"}],["path",{d:"M9 17h6",key:"r8uit2"}]]);/** - * @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 Ce=L("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/** - * @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 Se=L("GitFork",[["circle",{cx:"12",cy:"18",r:"3",key:"1mpf1b"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["path",{d:"M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9",key:"1uq4wg"}],["path",{d:"M12 12v3",key:"158kv8"}]]);/** - * @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 xe=L("Hammer",[["path",{d:"m15 12-8.373 8.373a1 1 0 1 1-3-3L12 9",key:"eefl8a"}],["path",{d:"m18 15 4-4",key:"16gjal"}],["path",{d:"m21.5 11.5-1.914-1.914A2 2 0 0 1 19 8.172V7l-2.26-2.26a6 6 0 0 0-4.202-1.756L9 2.96l.92.82A6.18 6.18 0 0 1 12 8.4V10l2 2h1.172a2 2 0 0 1 1.414.586L18.5 14.5",key:"b7pghm"}]]);/** - * @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 Ae=L("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);function ze({text:t,className:s}){const o=(t||"").split(` -`),a=[];let l=[],c=null;const b=u=>{l.length&&(a.push(e.jsx("ul",{className:"mb-3 ml-4 list-disc space-y-1",children:l},u)),l=[])};return o.forEach((u,m)=>{const d=`l${m}`;if(c!==null){u.trimEnd()==="```"?(a.push(e.jsx("pre",{className:"mb-3 overflow-x-auto rounded-xl border border-border/50 bg-background/50 p-3 font-mono text-[11px] leading-relaxed text-foreground/85",children:c.join(` -`)},d)),c=null):c.push(u);return}if(u.trimStart().startsWith("```")){b(d),c=[];return}const N=u.trimEnd();if(!N.trim()){b(d);return}const n=N.match(/^(#{1,4})\s+(.*)$/);if(n){b(d);const f=n[1].length,E=f===1?"text-base font-bold mt-1 mb-2":f===2?"text-sm font-bold mt-4 mb-1.5":"text-xs font-bold mt-3 mb-1 uppercase tracking-wide text-muted-foreground";a.push(e.jsx("p",{className:v(E,"font-space text-foreground"),children:T(n[2],d)},d));return}const x=N.match(/^\s*[-*•]\s+(.*)$/);if(x){l.push(e.jsx("li",{className:"text-xs leading-relaxed text-foreground/85",children:T(x[1],d)},d));return}const j=N.match(/^\s*\d+\.\s+(.*)$/);if(j){l.push(e.jsx("li",{className:"text-xs leading-relaxed text-foreground/85",children:T(j[1],d)},d));return}b(d),a.push(e.jsx("p",{className:"mb-2 text-xs leading-relaxed text-foreground/85",children:T(N,d)},d))}),b("end"),c!==null&&a.push(e.jsx("pre",{className:"mb-3 overflow-x-auto rounded-xl border border-border/50 bg-background/50 p-3 font-mono text-[11px]",children:c.join(` -`)},"code-end")),e.jsx("div",{className:v("max-w-3xl",s),children:a})}function T(t,s){return t.split(/(\*\*[^*]+\*\*|\*[^*]+\*|`[^`]+`)/g).map((a,l)=>{const c=`${s}-${l}`;return/^\*\*[^*]+\*\*$/.test(a)?e.jsx("b",{className:"font-semibold text-foreground",children:a.slice(2,-2)},c):/^\*[^*]+\*$/.test(a)?e.jsx("i",{children:a.slice(1,-1)},c):/^`[^`]+`$/.test(a)?e.jsx("code",{className:"rounded bg-background/50 px-1 font-mono text-[11px] text-foreground/90",children:a.slice(1,-1)},c):e.jsx("span",{children:a},c)})}const Ee={wartung:"Werkstatt",orchestrator:"Orchestrator",doku:"Doku",feature:"Feature"},Ke={laeuft:{label:"wird eingespielt …",cls:"text-sky-300 border-sky-500/40 bg-sky-500/10",spin:!0},rollback:{label:"Rollback läuft …",cls:"text-amber-300 border-amber-500/40 bg-amber-500/10",spin:!0},eingespielt:{label:"eingespielt ✓",cls:"text-emerald-300 border-emerald-500/40 bg-emerald-500/10"},fehlgeschlagen:{label:"fehlgeschlagen",cls:"text-red-300 border-red-500/40 bg-red-500/10"},zurueckgerollt:{label:"zurückgerollt",cls:"text-amber-300 border-amber-500/40 bg-amber-500/10"},kritisch:{label:"KRITISCH — Box prüfen",cls:"text-red-200 border-red-500/60 bg-red-500/20"},abgelehnt:{label:"abgelehnt",cls:"text-muted-foreground border-border/60 bg-background/30"}};function Q(t){return t?new Date(t*1e3).toLocaleString("de-DE",{day:"2-digit",month:"2-digit",hour:"2-digit",minute:"2-digit"}):"—"}function He(){const{data:t,isLoading:s,refetch:o,isFetching:a}=pe(),{data:l}=ne(),c=ae(),{showAlert:b,showConfirm:u,dialogElement:m}=le(),[d,N]=g.useState({}),n=()=>c.invalidateQueries({queryKey:ue.auftragsbuch});async function x(k,D,B,z){N(w=>({...w,[k]:!0}));try{await K(D,{method:"POST",body:JSON.stringify(B)}),z&&b("Erledigt",z),n()}catch(w){b("Das hat nicht geklappt",String((w==null?void 0:w.message)||w))}finally{N(w=>({...w,[k]:!1}))}}const j=(t==null?void 0:t.items)??[],f=(t==null?void 0:t.skill_kandidaten)??[],E=l!=null&&l.available?l.items.filter(k=>k.status==="blocked").length:0,A=j.length===0&&f.length===0&&E===0;return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"bg-gradient-to-r from-foreground via-foreground to-primary bg-clip-text font-space text-2xl font-bold tracking-tight text-transparent",children:"Auftragsbuch"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Was die Box gebaut oder sich ausgedacht hat — du entscheidest. Annehmen spielt es mit Fangnetz ein (Health-Check, automatischer Rollback)."})]}),e.jsxs("button",{onClick:()=>o(),className:"flex h-9 items-center gap-1.5 rounded-lg border border-border/60 bg-card/45 px-3 text-xs font-semibold text-muted-foreground hover:text-foreground hover:border-primary/40 transition-all cursor-pointer",children:[e.jsx(ie,{className:v("h-3.5 w-3.5",a&&"animate-spin")})," Aktualisieren"]})]}),t&&!t.available&&e.jsx("div",{className:"rounded-2xl border border-amber-500/30 bg-amber-500/5 p-4 text-xs text-amber-300",children:"Das Auftragsbuch lebt auf der Box (liest die Gitea-Branches dort). Im lokalen Dev-Modus ist hier nichts zu sehen."}),s&&e.jsxs("div",{className:"flex items-center gap-2 rounded-2xl border border-border/60 bg-card/30 p-6 text-xs text-muted-foreground",children:[e.jsx(C,{className:"h-4 w-4 animate-spin"})," Vorschläge werden geladen …"]}),(t==null?void 0:t.available)&&A&&e.jsxs("div",{className:"flex items-center gap-3 rounded-2xl border border-emerald-500/25 bg-emerald-500/5 p-5",children:[e.jsx(de,{className:"h-5 w-5 shrink-0 text-emerald-400"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-semibold text-foreground",children:"Nichts zu entscheiden"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Keine offenen Vorschläge. Werkstatt, Orchestrator und Traum melden sich hier, sobald es etwas gibt."})]})]}),e.jsx(We,{}),j.length>0&&e.jsxs("section",{className:"space-y-3",children:[e.jsxs(q,{icon:Ce,children:["Patch-Vorschläge (",j.length,")"]}),j.map(k=>e.jsx(Re,{item:k,busy:d,onAct:x,showConfirm:u},`${k.repo??"mc2"}:${k.branch}`))]}),f.length>0&&e.jsxs("section",{className:"space-y-3",children:[e.jsxs(q,{icon:oe,children:["Skill-Kandidaten aus dem Traum (",f.length,")"]}),f.map(k=>e.jsx(Te,{k,busy:d,onAct:x,showConfirm:u},k.file))]}),m]})}function q({icon:t,children:s}){return e.jsxs("p",{className:"flex items-center gap-1.5 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground/60",children:[e.jsx(t,{className:"h-3.5 w-3.5"})," ",s]})}const Le={triage:{label:"wird ausgearbeitet …",cls:"text-violet-300 border-violet-500/40 bg-violet-500/10",spin:!0},todo:{label:"wartet",cls:"text-muted-foreground border-border/60 bg-background/30"},scheduled:{label:"geplant",cls:"text-muted-foreground border-border/60 bg-background/30"},ready:{label:"gleich dran",cls:"text-sky-300/80 border-sky-500/30 bg-sky-500/5"},running:{label:"in Arbeit …",cls:"text-sky-300 border-sky-500/40 bg-sky-500/10",spin:!0},review:{label:"im Review",cls:"text-amber-300 border-amber-500/40 bg-amber-500/10"},blocked:{label:"hängt — braucht dich",cls:"text-red-300 border-red-500/40 bg-red-500/10"},done:{label:"fertig ✓",cls:"text-emerald-300 border-emerald-500/40 bg-emerald-500/10"}},Be={needs_input:"Die Box hat eine Frage:",capability:"Die Box kam hier nicht weiter:",transient:"Die Aufgabe hakt:"};function We(){var J,X;const{data:t,isLoading:s}=ne(),o=ae(),{showAlert:a,showConfirm:l,dialogElement:c}=le(),[b,u]=g.useState(""),[m,d]=g.useState("box"),[N,n]=g.useState(!1),[x,j]=g.useState({}),[f,E]=g.useState(null),[A,k]=g.useState(null),[D,B]=g.useState({}),z=(t==null?void 0:t.items)??[],w=()=>o.invalidateQueries({queryKey:ue.ideen}),W=f!==null&&(((J=t==null?void 0:t.items.find(r=>r.id===f))==null?void 0:J.status)==="triage"||((X=t==null?void 0:t.items.find(r=>r.id===f))==null?void 0:X.status)==="running"),h=ge(f??"",W);async function S(){const r=b.trim();if(!(r.length<3||N)){n(!0);try{const i=r.length>160?r.slice(0,157)+"…":r;await K("/api/ideen",{method:"POST",body:JSON.stringify({titel:i,notiz:r.length>160?r:"",welt:m})}),u(""),w()}catch(i){a("Das hat nicht geklappt",String((i==null?void 0:i.message)||i))}finally{n(!1)}}}async function he(r){j(i=>({...i,[r]:!0}));try{await K("/api/ideen/archivieren",{method:"POST",body:JSON.stringify({id:r})}),w()}catch(i){a("Das hat nicht geklappt",String((i==null?void 0:i.message)||i))}finally{j(i=>({...i,[r]:!1}))}}async function P(r,i,p,R){j(y=>({...y,[r+i]:!0}));try{await K(p,{method:"POST",body:JSON.stringify(R)}),w()}catch(y){a("Das hat nicht geklappt",String((y==null?void 0:y.message)||y))}finally{j(y=>({...y,[r+i]:!1}))}}async function Z(r){const i=(D[r]||"").trim();if(!(i.length<1||x["ans:"+r])){j(p=>({...p,["ans:"+r]:!0}));try{await K("/api/ideen/antwort",{method:"POST",body:JSON.stringify({id:r,antwort:i})}),B(p=>({...p,[r]:""})),w()}catch(p){a("Das hat nicht geklappt",String((p==null?void 0:p.message)||p))}finally{j(p=>({...p,["ans:"+r]:!1}))}}}const U=r=>{var te,re;const i=Le[r.status]??{label:r.status,cls:"text-muted-foreground border-border/60 bg-background/30"},p=f===r.id,R=r.status==="triage"||r.status==="running"||r.status==="done",y=r.status==="blocked",Y=!!x["ans:"+r.id],O=r.status==="running"&&(r.puls_alter??0)>600,ee=r.status==="todo"||r.status==="ready"||r.status==="scheduled";return e.jsxs("li",{className:v("flex flex-col gap-2 rounded-xl border bg-background/30 px-3 py-2",y?"border-red-500/30":O?"border-amber-500/40":"border-border/40"),children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:v("flex shrink-0 items-center gap-1.5 rounded-lg border px-2 py-0.5 text-[10px] font-bold",i.cls),children:[i.spin&&e.jsx(C,{className:"h-3 w-3 animate-spin"}),i.label]}),O&&e.jsxs("span",{className:"flex shrink-0 items-center gap-1 rounded-lg border border-amber-500/40 bg-amber-500/10 px-2 py-0.5 text-[10px] font-bold text-amber-300",title:"Der Worker lebt, gibt aber kein Lebenszeichen mehr — vermutlich wartet er auf etwas, das nie kommt. „Neuer Versuch“ startet die Karte frisch.",children:[e.jsx(V,{className:"h-3 w-3"})," ",Math.round((r.puls_alter??0)/60)," min ohne Regung"]}),(r.prio??0)!==0&&e.jsxs("span",{className:"shrink-0 rounded bg-background/50 px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",title:"Priorität — höher kommt zuerst dran (bei gleicher Prio: Erstellzeit)",children:["P",r.prio]}),r.welt==="ide"&&e.jsxs("span",{className:"flex shrink-0 items-center gap-1 rounded-lg border border-violet-500/40 bg-violet-500/10 px-2 py-0.5 text-[10px] font-bold text-violet-300",title:"IDE-Welt: die Box bereitet nur vor (Konzept + Repo + Doku, kein Code). Gebaut wird von dir in Zed.",children:[e.jsx(G,{className:"h-3 w-3"})," IDE"]}),e.jsx("span",{className:"min-w-0 flex-1 truncate text-xs text-foreground",title:r.body||r.titel,children:r.titel}),e.jsxs("span",{className:"flex shrink-0 items-center gap-1 text-[10px] text-muted-foreground/70",children:[e.jsx(H,{className:"h-3 w-3"}),Q(r.erstellt)]}),ee&&e.jsxs("span",{className:"flex shrink-0 items-center",children:[e.jsx("button",{disabled:!!x["pr:"+r.id],onClick:()=>P("pr:",r.id,"/api/ideen/prio",{id:r.id,richtung:"hoch"}),title:"Vorziehen (Prio +1)",className:"rounded-md p-1 text-muted-foreground/60 transition-colors hover:text-foreground cursor-pointer disabled:opacity-50",children:e.jsx(ye,{className:"h-3.5 w-3.5"})}),e.jsx("button",{disabled:!!x["pr:"+r.id],onClick:()=>P("pr:",r.id,"/api/ideen/prio",{id:r.id,richtung:"runter"}),title:"Zurückstellen (Prio −1)",className:"rounded-md p-1 text-muted-foreground/60 transition-colors hover:text-foreground cursor-pointer disabled:opacity-50",children:e.jsx(we,{className:"h-3.5 w-3.5"})})]}),(r.status==="running"||y)&&e.jsx("button",{disabled:!!x["rt:"+r.id],onClick:()=>l("Neuer Versuch?",r.status==="running"?`Der laufende Worker von '${r.titel.slice(0,60)}' wird beendet (samt gestarteter Test-Prozesse) und die Karte frisch gestartet. Bisheriger Zwischenstand im Workspace bleibt liegen.`:`Die Karte '${r.titel.slice(0,60)}' wird entsperrt und läuft weiter, sobald ein Platz frei ist.`,()=>P("rt:",r.id,"/api/ideen/retry",{id:r.id})),title:"Neuer Versuch — Karte frisch starten",className:v("shrink-0 rounded-md p-1 transition-colors cursor-pointer disabled:opacity-50",O?"text-amber-300 hover:text-amber-200":"text-muted-foreground/60 hover:text-foreground"),children:x["rt:"+r.id]?e.jsx(C,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(ke,{className:"h-3.5 w-3.5"})}),(r.status==="running"||ee||r.status==="triage")&&e.jsx("button",{disabled:!!x["st:"+r.id],onClick:()=>l("Karte stoppen?",`'${r.titel.slice(0,60)}' wird angehalten${r.status==="running"?" und der laufende Worker beendet":""}. Sie bleibt als gestoppt im Board und kann jederzeit per „Neuer Versuch“ weiterlaufen.`,()=>P("st:",r.id,"/api/ideen/stopp",{id:r.id})),title:"Stoppen — Karte anhalten",className:"shrink-0 rounded-md p-1 text-muted-foreground/60 transition-colors hover:text-red-300 cursor-pointer disabled:opacity-50",children:x["st:"+r.id]?e.jsx(C,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(Ae,{className:"h-3.5 w-3.5"})}),(r.status==="done"||y)&&e.jsx("button",{disabled:!!x[r.id],onClick:()=>he(r.id),title:y?"Aufgeben und aus der Liste räumen (wandert ins Kanban-Archiv)":"Aus der Liste räumen (wandert ins Kanban-Archiv)",className:"shrink-0 rounded-md p-1 text-muted-foreground/60 transition-colors hover:text-foreground cursor-pointer disabled:opacity-50",children:x[r.id]?e.jsx(C,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(M,{className:"h-3.5 w-3.5"})}),r.welt==="ide"&&(r.status==="running"||r.status==="done")&&e.jsxs("button",{onClick:()=>k(A===r.id?null:r.id),title:"Konzept ansehen (das ausgearbeitete KONZEPT.md)",className:v("flex shrink-0 items-center gap-1 rounded-md px-1.5 py-1 text-[10px] font-bold transition-colors cursor-pointer",A===r.id?"text-violet-300":"text-violet-300/70 hover:text-violet-200"),children:[e.jsx(ce,{className:"h-3.5 w-3.5"})," Konzept"]}),R&&e.jsx("button",{onClick:()=>E(p?null:r.id),title:r.status==="done"?"Ergebnis anzeigen":"Worker-Log anzeigen",className:"shrink-0 rounded-md p-1 text-muted-foreground/60 transition-colors hover:text-foreground cursor-pointer",children:p?e.jsx($,{className:"h-3.5 w-3.5"}):e.jsx(I,{className:"h-3.5 w-3.5"})})]}),A===r.id&&e.jsx($e,{id:r.id}),r.status==="running"&&r.notiz&&e.jsxs("p",{className:"-mt-1 ml-1 text-[11px] italic leading-relaxed text-sky-200/80",title:"Jüngste Zwischenmeldung des Workers (Heartbeat)",children:["„",r.notiz,"“"]}),(r.status==="todo"||r.status==="scheduled"||r.status==="ready")&&(((te=r.wartet_auf)==null?void 0:te.length)??0)>0&&e.jsxs("p",{className:"-mt-1 ml-1 text-[10px] text-muted-foreground/70",children:["→ wartet auf: ",r.wartet_auf.join(" · ")]}),y&&e.jsxs("div",{className:"space-y-2 border-t border-red-500/20 pt-2",children:[e.jsxs("p",{className:"flex items-start gap-1.5 text-[11px] leading-relaxed text-red-200/90",children:[e.jsx(fe,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-red-300"}),e.jsxs("span",{children:[e.jsx("b",{children:Be[r.frage_kind||""]??"Die Aufgabe hängt und wartet auf dich:"})," ",r.frage?e.jsx("span",{className:"text-foreground/90",children:r.frage}):e.jsx("span",{className:"text-muted-foreground italic",children:"kein genauer Grund hinterlegt — antworte einfach mit einer Entscheidung, dann läuft sie weiter."})]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{value:D[r.id]||"",onChange:F=>B(me=>({...me,[r.id]:F.target.value})),onKeyDown:F=>{F.key==="Enter"&&Z(r.id)},placeholder:"Deine Antwort — die Box macht damit weiter",maxLength:2e3,className:"h-8 min-w-0 flex-1 rounded-lg border border-border/60 bg-background/60 px-2.5 text-xs text-foreground placeholder:text-muted-foreground/50 focus:border-red-400/50 focus:outline-none"}),e.jsxs("button",{onClick:()=>Z(r.id),disabled:Y||(D[r.id]||"").trim().length<1,className:"flex h-8 shrink-0 items-center gap-1.5 rounded-lg border border-emerald-500/40 bg-emerald-500/10 px-3 text-[10px] font-bold uppercase tracking-wide text-emerald-300 transition-all hover:bg-emerald-500/20 cursor-pointer disabled:opacity-50",children:[Y?e.jsx(C,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(se,{className:"h-3.5 w-3.5"})," Antworten & weiter"]})]})]}),p&&R&&r.status!=="done"&&e.jsx("div",{className:"ml-2 -mt-1",children:e.jsx("div",{className:"rounded-lg border border-border/50 bg-background/50 p-2",children:W&&h.isLoading?e.jsx("p",{className:"text-[10px] text-muted-foreground animate-pulse",children:"Log wird geladen …"}):h.error?e.jsx("p",{className:"text-[10px] text-red-400",children:"Log nicht ladbar"}):(re=h.data)!=null&&re.available&&h.data.lines.length>0?e.jsx("pre",{className:"max-h-64 overflow-auto font-mono text-[10px] leading-relaxed text-foreground/80 whitespace-pre-wrap",children:h.data.lines.join(` -`)}):e.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Kein Log verfügbar"})})}),p&&r.status==="done"&&e.jsx(Ie,{id:r.id})]},r.id)};return t&&!t.available?null:e.jsxs("section",{className:"space-y-3",children:[e.jsxs(q,{icon:je,children:["Ideen-Queue",t?` — ${t.offen} offen`:""]}),e.jsxs("div",{className:"mc-card p-4 space-y-3",children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{value:b,onChange:r=>u(r.target.value),onKeyDown:r=>{r.key==="Enter"&&S()},placeholder:"Neue Idee — einfach hinschreiben, die Box macht den Rest",className:"h-9 min-w-0 flex-1 rounded-lg border border-border/60 bg-background/50 px-3 text-sm text-foreground placeholder:text-muted-foreground/50 focus:border-primary/50 focus:outline-none"}),e.jsxs("button",{onClick:S,disabled:N||b.trim().length<3,className:v("flex h-9 shrink-0 items-center gap-1.5 rounded-lg border px-3 text-[11px] font-bold uppercase tracking-wide transition-all cursor-pointer disabled:opacity-50",m==="ide"?"border-violet-500/40 bg-violet-500/10 text-violet-300 hover:bg-violet-500/20":"border-primary/40 bg-primary/10 text-primary hover:bg-primary/20"),children:[N?e.jsx(C,{className:"h-3.5 w-3.5 animate-spin"}):m==="ide"?e.jsx(G,{className:"h-3.5 w-3.5"}):e.jsx(se,{className:"h-3.5 w-3.5"}),m==="ide"?"Vorbereiten":"In die Queue"]})]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-[11px] text-muted-foreground/70",children:"Modus"}),e.jsxs("div",{className:"flex rounded-lg border border-border/60 p-0.5",children:[e.jsxs("button",{onClick:()=>d("box"),className:v("flex items-center gap-1 rounded px-2 py-1 text-[10px] font-bold uppercase tracking-wide transition-all cursor-pointer",m==="box"?"bg-primary/15 text-primary":"text-muted-foreground/60 hover:text-foreground"),children:[e.jsx(xe,{className:"h-3 w-3"})," Box"]}),e.jsxs("button",{onClick:()=>d("ide"),className:v("flex items-center gap-1 rounded px-2 py-1 text-[10px] font-bold uppercase tracking-wide transition-all cursor-pointer",m==="ide"?"bg-violet-500/15 text-violet-300":"text-muted-foreground/60 hover:text-foreground"),children:[e.jsx(G,{className:"h-3 w-3"})," IDE"]})]})]}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:m==="ide"?e.jsxs(e.Fragment,{children:[e.jsx("b",{className:"text-violet-300/90",children:"IDE-Welt:"})," Die Box denkt das Konzept wasserdicht durch (mehrere Denk-Runden mit Kritiker), legt ein leeres Gitea-Repo an und füllt es nur mit den wichtigen Dokumenten (Konzept, Roadmap, AGENTS.md, .aiexclude) — ",e.jsx("b",{children:"kein Code"}),". Danach öffnest du das Repo in Zed und baust selbst. Das Vorbereiten dauert ein paar Minuten."]}):e.jsx(e.Fragment,{children:"Eine Queue, alle Türen: hier, per Telegram oder im Gespräch mit Lucy. Die Box arbeitet Ideen selbst aus und baut — Code-Ergebnisse erscheinen als Karte unter „Patch-Vorschläge“, nichts davon geht ohne deinen Klick live. Nur reine Doku-Bagatellen zieht die Box nachts selbst ein (mit Fangnetz und Meldung)."})}),s&&e.jsxs("p",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[e.jsx(C,{className:"h-3.5 w-3.5 animate-spin"})," Queue wird geladen …"]}),(t==null?void 0:t.fehler)&&e.jsx("p",{className:"text-xs text-amber-300",children:"Queue gerade nicht lesbar — neuer Versuch läuft."}),z.length>0&&e.jsxs("div",{className:"space-y-3",children:[((t==null?void 0:t.projekte)??[]).map(r=>e.jsx(Ve,{projekt:r,karten:z.filter(i=>i.projekt===r.key),zeile:U},r.key)),(()=>{const r=new Set(((t==null?void 0:t.projekte)??[]).map(p=>p.key)),i=z.filter(p=>!p.projekt||!r.has(p.projekt));return i.length>0?e.jsx("ul",{className:"space-y-1.5",children:i.map(p=>U(p))}):null})()]}),(t==null?void 0:t.available)&&!s&&z.length===0&&e.jsx("p",{className:"text-xs text-muted-foreground/70",children:"Queue ist leer — wirf der Box eine Idee zu."})]}),c]})}const _={blocked:0,running:1,review:2,ready:3,triage:4};function Ve({projekt:t,karten:s,zeile:o}){const[a,l]=g.useState(!1),[c,b]=g.useState(!1),u=s.filter(n=>_[n.status]!==void 0).sort((n,x)=>_[n.status]-_[x.status]||(n.erstellt??0)-(x.erstellt??0)),m=s.filter(n=>n.status==="todo"||n.status==="scheduled").sort((n,x)=>{var j,f;return((j=n.wartet_auf)!=null&&j.length?1:0)-((f=x.wartet_auf)!=null&&f.length?1:0)||(n.erstellt??0)-(x.erstellt??0)}),d=s.filter(n=>n.status==="done").sort((n,x)=>(x.fertig??0)-(n.fertig??0)),N=t.gesamt>0?Math.round(t.fertig/t.gesamt*100):0;return e.jsxs("div",{className:"space-y-2 rounded-xl border border-border/50 bg-background/20 p-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ne,{className:"h-4 w-4 shrink-0 text-primary/70"}),e.jsx("p",{className:"min-w-0 flex-1 truncate text-xs font-semibold text-foreground",title:t.titel,children:t.titel}),e.jsxs("span",{className:"shrink-0 text-[10px] text-muted-foreground",children:[t.fertig," von ",t.gesamt," fertig"]})]}),e.jsx("div",{className:"h-1 overflow-hidden rounded-full bg-background/60",title:`${N}%`,children:e.jsx("div",{className:"h-1 rounded-full bg-primary/70 transition-all",style:{width:`${N}%`}})}),u.length>0&&e.jsx("ul",{className:"space-y-1.5",children:u.map(n=>o(n))}),m.length>0&&e.jsxs("div",{children:[e.jsxs("button",{onClick:()=>l(n=>!n),className:"flex items-center gap-1.5 text-[11px] font-semibold text-muted-foreground hover:text-foreground transition-colors cursor-pointer",children:[a?e.jsx($,{className:"h-3.5 w-3.5"}):e.jsx(I,{className:"h-3.5 w-3.5"}),m.length," Karte",m.length===1?"":"n"," in der Kette — laufen automatisch der Reihe nach"]}),a&&e.jsx("ul",{className:"mt-1.5 space-y-1.5",children:m.map(n=>o(n))})]}),d.length>0&&e.jsxs("div",{children:[e.jsxs("button",{onClick:()=>b(n=>!n),className:"flex items-center gap-1.5 text-[11px] font-semibold text-emerald-300/70 hover:text-emerald-300 transition-colors cursor-pointer",children:[c?e.jsx($,{className:"h-3.5 w-3.5"}):e.jsx(I,{className:"h-3.5 w-3.5"}),d.length," fertig"]}),c&&e.jsx("ul",{className:"mt-1.5 space-y-1.5",children:d.map(n=>o(n))})]})]})}function $e({id:t}){const[s,o]=g.useState(null),[a,l]=g.useState(!1),[c,b]=g.useState(0);return g.useEffect(()=>{let u=!1;return o(null),l(!1),K(`/api/ideen/${t}/konzept`).then(m=>{u||o(m)}).catch(()=>{u||l(!0)}),()=>{u=!0}},[t,c]),e.jsx("div",{className:"ml-2 -mt-1",children:e.jsxs("div",{className:"rounded-lg border border-violet-500/25 bg-violet-500/[0.04] p-3",children:[e.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[e.jsxs("p",{className:"flex items-center gap-1.5 text-[10px] font-bold uppercase tracking-wide text-violet-300",children:[e.jsx(ce,{className:"h-3 w-3"})," Konzept"]}),(s==null?void 0:s.repo)&&e.jsxs("a",{href:`https://git.tobisniceshomelab.ddnsfree.com/${s.repo}`,className:"flex items-center gap-1 text-[10px] text-violet-300/70 hover:text-violet-200",children:[e.jsx(Se,{className:"h-3 w-3"})," ",s.repo]}),e.jsx("button",{onClick:()=>b(u=>u+1),title:"Neu laden",className:"ml-auto rounded p-0.5 text-muted-foreground/50 hover:text-foreground cursor-pointer",children:e.jsx(ie,{className:"h-3 w-3"})})]}),a?e.jsx("p",{className:"text-[11px] text-red-400",children:"Konzept nicht ladbar — später nochmal versuchen."}):s===null?e.jsx("p",{className:"text-[10px] text-muted-foreground animate-pulse",children:"Konzept wird geladen …"}):s.konzept?e.jsx("div",{className:"max-h-[28rem] overflow-y-auto pr-1",children:e.jsx(ze,{text:s.konzept})}):e.jsx("p",{className:"text-[11px] text-muted-foreground italic",children:s.error||"Noch kein Konzept — das Projekt wird gerade vorbereitet."})]})})}function Ie({id:t}){const[s,o]=g.useState(null),[a,l]=g.useState(!1),[c,b]=g.useState(0);g.useEffect(()=>{let m=!1;return l(!1),o(null),K(`/api/ideen/${t}/ergebnis`).then(d=>{m||o(d)}).catch(()=>{m||l(!0)}),()=>{m=!0}},[t,c]);const u=s?s.summary||s.result:"";return e.jsx("div",{className:"ml-2 -mt-1",children:e.jsxs("div",{className:"rounded-lg border border-emerald-500/25 bg-emerald-500/5 p-2.5",children:[e.jsxs("p",{className:"mb-1 flex items-center gap-1.5 text-[10px] font-bold uppercase tracking-wide text-emerald-300",children:[e.jsx(ve,{className:"h-3 w-3"})," Ergebnis des Workers"]}),a?e.jsx("button",{type:"button",onClick:()=>b(m=>m+1),className:"text-[10px] text-red-400 underline decoration-dotted underline-offset-2 hover:text-red-300",children:"Ergebnis nicht ladbar — nochmal versuchen"}):s===null?e.jsx("p",{className:"text-[10px] text-muted-foreground animate-pulse",children:"Wird geladen …"}):u?e.jsx("p",{className:"max-h-64 overflow-y-auto whitespace-pre-wrap text-xs leading-relaxed text-foreground/85",children:u}):e.jsx("p",{className:"text-[10px] text-muted-foreground italic",children:"Der Worker hat keine Abschluss-Zusammenfassung hinterlassen (ältere Karte oder Protokollverstoß)."})]})})}function Pe({item:t}){const s=t.status;if(!s)return null;const o=Ke[s.state];return o?e.jsxs("span",{className:v("flex items-center gap-1.5 rounded-lg border px-2 py-0.5 text-[10px] font-bold",o.cls),title:s.detail,children:[o.spin&&e.jsx(C,{className:"h-3 w-3 animate-spin"}),o.label]}):null}function Re({item:t,busy:s,onAct:o,showConfirm:a}){var z,w,W;const[l,c]=g.useState(!1),[b,u]=g.useState(null),[m,d]=g.useState(!1),[N,n]=g.useState(!1),[x,j]=g.useState(""),f=((z=t.status)==null?void 0:z.state)==="laeuft"||((w=t.status)==null?void 0:w.state)==="rollback",E=((W=t.status)==null?void 0:W.state)==="eingespielt",A=t.repo??"mc2",k=A==="lucy",D=`${A}:${t.branch}`;async function B(){const h=!l;if(c(h),h&&b===null){d(!0);try{const S=await K(`/api/auftragsbuch/diff?branch=${encodeURIComponent(t.branch)}&repo=${A}`);u(S.diff+(S.truncated?` -… (gekürzt)`:""))}catch(S){u(`(Diff nicht ladbar: ${(S==null?void 0:S.message)||S})`)}finally{d(!1)}}}return e.jsxs("div",{className:"mc-card p-4 space-y-3",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("span",{className:"rounded-md border border-primary/30 bg-primary/10 px-1.5 py-0.5 text-[10px] font-bold uppercase tracking-wider text-primary",children:Ee[t.kind]??t.kind}),k&&e.jsx("span",{className:"rounded-md border border-pink-500/40 bg-pink-500/10 px-1.5 py-0.5 text-[10px] font-bold uppercase tracking-wider text-pink-300",title:"Vorschlag fürs Lucy-Repo — Annehmen baut die App am PC neu und startet sie neu, wenn sie läuft.",children:"Lucy"}),e.jsx("span",{className:"font-mono text-[11px] text-muted-foreground truncate",title:t.branch,children:t.branch}),e.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-muted-foreground/70",children:[e.jsx(H,{className:"h-3 w-3"}),Q(t.ts)]}),e.jsx(Pe,{item:t})]}),e.jsx("p",{className:"mt-1.5 text-sm font-semibold text-foreground",children:t.subject||"(ohne Titel)"}),t.body&&e.jsx("p",{className:"mt-1 whitespace-pre-wrap text-xs leading-relaxed text-muted-foreground line-clamp-6",children:t.body}),t.empfehlung&&e.jsxs("p",{className:v("mt-1.5 flex items-start gap-1.5 rounded-lg border px-2 py-1 text-[11px]",t.empfehlung.empfehlung==="ANNEHMEN"&&"border-emerald-500/30 bg-emerald-500/5 text-emerald-300",t.empfehlung.empfehlung==="ABLEHNEN"&&"border-red-500/30 bg-red-500/5 text-red-300",t.empfehlung.empfehlung==="UNKLAR"&&"border-amber-500/30 bg-amber-500/5 text-amber-300"),title:`Nächtliches Kurz-Gutachten (${t.empfehlung.richter}) — eine Meinung, kein Muss. Die Entscheidung bleibt bei dir.`,children:[e.jsx(oe,{className:"mt-0.5 h-3 w-3 shrink-0"}),e.jsxs("span",{children:[e.jsxs("b",{children:["Empfehlung: ",t.empfehlung.empfehlung==="ANNEHMEN"?"Annehmen":t.empfehlung.empfehlung==="ABLEHNEN"?"Ablehnen":"Unklar","."]})," ",t.empfehlung.satz]})]})]}),!f&&!E&&e.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[!t.verwaist&&e.jsxs("button",{disabled:!!s[D],onClick:()=>a("Vorschlag annehmen?",k?`'${t.branch}' wird im Lucy-Repo auf main gemergt, dann baut dein PC die App neu (dist) und startet Lucy neu, falls sie gerade läuft. Der PC muss dafür an sein. Schlägt Build oder Start fehl, dreht die Box den Merge automatisch zurück — die laufende Lucy bleibt die alte.`:`'${t.branch}' wird auf main gemergt und live eingespielt. Die Zentrale startet dabei kurz neu. Geht der Health-Check danach rot, rollt die Box automatisch zurück.${t.frontend_ohne_build?` - -Achtung: Enthält Frontend-Quelltext ohne gebautes Bundle — die Oberfläche bleibt alt, bis am PC gebaut wird.`:""}`,()=>o(D,"/api/auftragsbuch/annehmen",{branch:t.branch,repo:A})),className:"flex h-9 items-center gap-1.5 rounded-lg border border-emerald-500/40 bg-emerald-500/10 px-3 text-[11px] font-bold uppercase tracking-wide text-emerald-300 transition-all hover:bg-emerald-500/20 cursor-pointer disabled:opacity-50",children:[s[D]?e.jsx(C,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(de,{className:"h-3.5 w-3.5"})," Annehmen"]}),e.jsxs("button",{disabled:!!s["ab:"+D],onClick:()=>n(h=>!h),className:"flex h-9 items-center gap-1.5 rounded-lg border border-red-500/30 bg-red-500/5 px-3 text-[11px] font-bold uppercase tracking-wide text-red-300/90 transition-all hover:bg-red-500/15 cursor-pointer disabled:opacity-50",children:[s["ab:"+D]?e.jsx(C,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(M,{className:"h-3.5 w-3.5"})," Ablehnen"]})]})]}),N&&!f&&!E&&e.jsxs("div",{className:"space-y-2 rounded-xl border border-red-500/25 bg-red-500/5 p-3",children:[e.jsxs("p",{className:"text-[11px] text-muted-foreground",children:["Der Branch '",t.branch,"' wird auf Gitea gelöscht (die Arbeit bleibt in der Historie). Sag der Box kurz ",e.jsx("b",{children:"warum"})," — dann schlägt sie dir so etwas nicht wieder vor."]}),e.jsx("input",{value:x,onChange:h=>j(h.target.value),placeholder:"Grund (optional) — z. B. „gibt es schon“ oder „will ich nicht“",maxLength:400,className:"w-full rounded-lg border border-border/60 bg-background/60 px-2.5 py-1.5 text-xs text-foreground placeholder:text-muted-foreground/50 focus:border-red-400/50 focus:outline-none"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("button",{disabled:!!s["ab:"+D],onClick:()=>{n(!1),o("ab:"+D,"/api/auftragsbuch/ablehnen",{branch:t.branch,repo:A,grund:x.trim()})},className:"flex h-8 items-center gap-1.5 rounded-lg border border-red-500/40 bg-red-500/10 px-3 text-[11px] font-bold uppercase tracking-wide text-red-300 transition-all hover:bg-red-500/20 cursor-pointer disabled:opacity-50",children:[e.jsx(M,{className:"h-3.5 w-3.5"})," Wirklich ablehnen"]}),e.jsx("button",{onClick:()=>n(!1),className:"flex h-8 items-center rounded-lg border border-border/60 bg-background/40 px-3 text-[11px] font-semibold text-muted-foreground transition-all hover:text-foreground cursor-pointer",children:"Abbrechen"})]})]}),t.status&&(f||!E)&&t.status.detail&&e.jsx("p",{className:"text-[11px] text-muted-foreground",children:t.status.detail}),t.verwaist&&e.jsxs("p",{className:"rounded-lg border border-red-500/30 bg-red-500/5 px-2 py-1.5 text-[11px] text-red-300/90",children:[e.jsx("b",{children:"Kaputt aufgesetzt:"})," Dieser Branch hat keinen gemeinsamen Ursprung mit main (der Werkstatt-Worker hat nicht richtig geklont) — Annehmen ist technisch unmöglich, deshalb fehlt der Knopf. Am besten ",e.jsx("b",{children:"ablehnen mit Grund"}),"; die Idee kann danach frisch in die Queue."]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-[11px] text-muted-foreground",children:[e.jsxs("span",{className:"rounded bg-background/40 px-1.5 py-0.5 font-mono",children:[t.ahead," Commit",t.ahead===1?"":"s"]}),t.shortstat&&e.jsx("span",{className:"rounded bg-background/40 px-1.5 py-0.5 font-mono",children:t.shortstat.trim()}),t.verwaist&&e.jsxs("span",{className:"flex items-center gap-1 rounded bg-red-500/10 px-1.5 py-0.5 text-red-300",title:"Kein gemeinsamer Vorfahre mit main — git kann diesen Branch niemals mergen.",children:[e.jsx(V,{className:"h-3 w-3"})," kein gemeinsamer Ursprung"]}),t.leer&&e.jsxs("span",{className:"flex items-center gap-1 rounded bg-amber-500/10 px-1.5 py-0.5 text-amber-300",title:"Der Diff gegen main ist leer — der Branch würde nichts verändern (Inhalt schon in main oder am Repo vorbei gearbeitet).",children:[e.jsx(V,{className:"h-3 w-3"})," Diff leer — bringt nichts"]}),t.behind>0&&!t.verwaist&&e.jsxs("span",{className:"flex items-center gap-1 rounded bg-amber-500/10 px-1.5 py-0.5 text-amber-300",title:"main ist seit diesem Vorschlag weitergelaufen — bei Konflikten versucht die Annahme automatisch einen Rebase.",children:[e.jsx(V,{className:"h-3 w-3"})," ",t.behind," hinter main"]}),t.frontend_ohne_build&&e.jsxs("span",{className:"flex items-center gap-1 rounded bg-amber-500/10 px-1.5 py-0.5 text-amber-300",title:"Die Box kann kein Frontend bauen (kein Node) — nach dem Annehmen bleibt die Oberfläche alt, bis am PC gebaut wird.",children:[e.jsx(V,{className:"h-3 w-3"})," Frontend ohne Build"]})]}),e.jsxs("div",{children:[e.jsxs("button",{onClick:B,className:"flex items-center gap-1.5 text-[11px] font-semibold text-muted-foreground hover:text-foreground transition-colors cursor-pointer",children:[l?e.jsx($,{className:"h-3.5 w-3.5"}):e.jsx(I,{className:"h-3.5 w-3.5"}),e.jsx(De,{className:"h-3.5 w-3.5"})," ",t.files.length," Datei",t.files.length===1?"":"en"," — Änderungen ansehen"]}),l&&e.jsxs("div",{className:"mt-2 space-y-2",children:[e.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[t.files.map(h=>e.jsxs("span",{className:"rounded bg-background/40 px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",children:[e.jsx("b",{className:v(h.status.startsWith("A")&&"text-emerald-400",h.status.startsWith("D")&&"text-red-400",h.status.startsWith("M")&&"text-sky-400"),children:h.status})," ",h.path]},h.path)),t.files_truncated&&e.jsx("span",{className:"text-[10px] text-muted-foreground/60",children:"…"})]}),e.jsx("div",{className:"max-h-96 overflow-auto rounded-xl border border-border/50 bg-background/50 p-3",children:m?e.jsx("span",{className:"text-[11px] text-muted-foreground",children:"Diff wird geladen …"}):e.jsx("pre",{className:"text-[10px] leading-relaxed text-foreground/80 whitespace-pre",children:(b??"").split(` -`).map((h,S)=>e.jsx("span",{className:v("block",h.startsWith("+")&&!h.startsWith("+++")&&"text-emerald-300/90 bg-emerald-500/5",h.startsWith("-")&&!h.startsWith("---")&&"text-red-300/90 bg-red-500/5",(h.startsWith("@@")||h.startsWith("diff "))&&"text-sky-300/90"),children:h||" "},S))})})]})]})]})}function Te({k:t,busy:s,onAct:o,showConfirm:a}){const[l,c]=g.useState(!1);return e.jsxs("div",{className:"rounded-2xl border border-violet-500/25 bg-violet-500/[0.04] p-4 shadow-lg shadow-black/15 backdrop-blur-md space-y-3",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("span",{className:"rounded-md border border-violet-500/30 bg-violet-500/10 px-1.5 py-0.5 text-[10px] font-bold uppercase tracking-wider text-violet-300",children:"Traum-Idee"}),e.jsx("span",{className:"font-mono text-[11px] text-muted-foreground truncate",children:t.file}),e.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-muted-foreground/70",children:[e.jsx(H,{className:"h-3 w-3"}),Q(t.mtime)]})]}),e.jsx("p",{className:"mt-1.5 text-sm font-semibold text-foreground",children:t.title})]}),e.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[e.jsxs("button",{disabled:!!s["sk:"+t.file],onClick:()=>a("Werkstatt beauftragen?",`Der Kandidat '${t.title}' geht als Auftrag an die Werkstatt (Orchestrator, propose-only). Das Ergebnis erscheint später als neuer Patch-Vorschlag hier im Auftragsbuch — nichts geht ungefragt live.`,()=>o("sk:"+t.file,"/api/auftragsbuch/skill/annehmen",{file:t.file},"Die Werkstatt arbeitet. Das Ergebnis taucht als neuer Vorschlag im Auftragsbuch auf (das kann einige Minuten dauern).")),className:"flex h-9 items-center gap-1.5 rounded-lg border border-violet-500/40 bg-violet-500/10 px-3 text-[11px] font-bold uppercase tracking-wide text-violet-300 transition-all hover:bg-violet-500/20 cursor-pointer disabled:opacity-50",children:[s["sk:"+t.file]?e.jsx(C,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(xe,{className:"h-3.5 w-3.5"})," Beauftragen"]}),e.jsxs("button",{disabled:!!s["skab:"+t.file],onClick:()=>a("Kandidat verwerfen?",`'${t.title}' wandert ins Archiv des Wissens-Vaults (verworfen/). Der Traum schlägt ihn nicht erneut vor.`,()=>o("skab:"+t.file,"/api/auftragsbuch/skill/ablehnen",{file:t.file})),className:"flex h-9 items-center gap-1.5 rounded-lg border border-red-500/30 bg-red-500/5 px-3 text-[11px] font-bold uppercase tracking-wide text-red-300/90 transition-all hover:bg-red-500/15 cursor-pointer disabled:opacity-50",children:[s["skab:"+t.file]?e.jsx(C,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(M,{className:"h-3.5 w-3.5"})," Verwerfen"]})]})]}),e.jsxs("button",{onClick:()=>c(b=>!b),className:"flex items-center gap-1.5 text-[11px] font-semibold text-muted-foreground hover:text-foreground transition-colors cursor-pointer",children:[l?e.jsx($,{className:"h-3.5 w-3.5"}):e.jsx(I,{className:"h-3.5 w-3.5"}),e.jsx(be,{className:"h-3.5 w-3.5"})," Vorschlag lesen"]}),l&&e.jsx("pre",{className:"max-h-72 overflow-auto rounded-xl border border-border/50 bg-background/50 p-3 text-[11px] leading-relaxed text-foreground/85 whitespace-pre-wrap",children:t.preview})]})}export{He as AuftragsbuchView}; diff --git a/frontend/dist/assets/AuftragsbuchView-MX5C46g1.js b/frontend/dist/assets/AuftragsbuchView-MX5C46g1.js new file mode 100644 index 0000000..92f9e37 --- /dev/null +++ b/frontend/dist/assets/AuftragsbuchView-MX5C46g1.js @@ -0,0 +1,49 @@ +import{c as L,j as e,e as y,aa as ge,ab as ae,u as le,b as ie,r as p,a3 as de,L as S,C as oe,U as ce,ac as be,V as q,X as F,T as P,D as V,M as $,g as K,ad as fe,ae as ue,af as je,q as xe}from"./index-CYprWjkZ.js";import{L as Ne}from"./lightbulb-DygeZkD3.js";import{C as M}from"./code-xml-DFsBpkB8.js";import{S as ne}from"./send-CjExvNpv.js";import{L as ke}from"./layers-BVmbzkl8.js";import{R as we}from"./rotate-ccw-CXI0Tldw.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 ve=L("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/** + * @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 ye=L("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/** + * @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 De=L("ClipboardCheck",[["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"}]]);/** + * @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 Ce=L("FileDiff",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M9 10h6",key:"9gxzsh"}],["path",{d:"M12 13V7",key:"h0r20n"}],["path",{d:"M9 17h6",key:"r8uit2"}]]);/** + * @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 Se=L("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/** + * @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 Ae=L("GitFork",[["circle",{cx:"12",cy:"18",r:"3",key:"1mpf1b"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["path",{d:"M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9",key:"1uq4wg"}],["path",{d:"M12 12v3",key:"158kv8"}]]);/** + * @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 he=L("Hammer",[["path",{d:"m15 12-8.373 8.373a1 1 0 1 1-3-3L12 9",key:"eefl8a"}],["path",{d:"m18 15 4-4",key:"16gjal"}],["path",{d:"m21.5 11.5-1.914-1.914A2 2 0 0 1 19 8.172V7l-2.26-2.26a6 6 0 0 0-4.202-1.756L9 2.96l.92.82A6.18 6.18 0 0 1 12 8.4V10l2 2h1.172a2 2 0 0 1 1.414.586L18.5 14.5",key:"b7pghm"}]]);/** + * @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=L("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);function ze({text:t,className:s}){const o=(t||"").split(` +`),a=[];let l=[],c=null;const g=u=>{l.length&&(a.push(e.jsx("ul",{className:"mb-3 ml-4 list-disc space-y-1",children:l},u)),l=[])};return o.forEach((u,x)=>{const d=`l${x}`;if(c!==null){u.trimEnd()==="```"?(a.push(e.jsx("pre",{className:"mb-3 overflow-x-auto rounded-xl border border-border/50 bg-background/50 p-3 font-mono text-[11px] leading-relaxed text-foreground/85",children:c.join(` +`)},d)),c=null):c.push(u);return}if(u.trimStart().startsWith("```")){g(d),c=[];return}const j=u.trimEnd();if(!j.trim()){g(d);return}const n=j.match(/^(#{1,4})\s+(.*)$/);if(n){g(d);const f=n[1].length,C=f===1?"text-base font-bold mt-1 mb-2":f===2?"text-sm font-bold mt-4 mb-1.5":"text-xs font-bold mt-3 mb-1 uppercase tracking-wide text-muted-foreground";a.push(e.jsx("p",{className:y(C,"font-space text-foreground"),children:T(n[2],d)},d));return}const N=j.match(/^\s*[-*•]\s+(.*)$/);if(N){l.push(e.jsx("li",{className:"text-xs leading-relaxed text-foreground/85",children:T(N[1],d)},d));return}const b=j.match(/^\s*\d+\.\s+(.*)$/);if(b){l.push(e.jsx("li",{className:"text-xs leading-relaxed text-foreground/85",children:T(b[1],d)},d));return}g(d),a.push(e.jsx("p",{className:"mb-2 text-xs leading-relaxed text-foreground/85",children:T(j,d)},d))}),g("end"),c!==null&&a.push(e.jsx("pre",{className:"mb-3 overflow-x-auto rounded-xl border border-border/50 bg-background/50 p-3 font-mono text-[11px]",children:c.join(` +`)},"code-end")),e.jsx("div",{className:y("max-w-3xl",s),children:a})}function T(t,s){return t.split(/(\*\*[^*]+\*\*|\*[^*]+\*|`[^`]+`)/g).map((a,l)=>{const c=`${s}-${l}`;return/^\*\*[^*]+\*\*$/.test(a)?e.jsx("b",{className:"font-semibold text-foreground",children:a.slice(2,-2)},c):/^\*[^*]+\*$/.test(a)?e.jsx("i",{children:a.slice(1,-1)},c):/^`[^`]+`$/.test(a)?e.jsx("code",{className:"rounded bg-background/50 px-1 font-mono text-[11px] text-foreground/90",children:a.slice(1,-1)},c):e.jsx("span",{children:a},c)})}const Ke={wartung:"Werkstatt",orchestrator:"Orchestrator",doku:"Doku",feature:"Feature"},Le={laeuft:{label:"wird eingespielt …",cls:"text-sky-300 border-sky-500/40 bg-sky-500/10",spin:!0},rollback:{label:"Rollback läuft …",cls:"text-amber-300 border-amber-500/40 bg-amber-500/10",spin:!0},eingespielt:{label:"eingespielt ✓",cls:"text-emerald-300 border-emerald-500/40 bg-emerald-500/10"},fehlgeschlagen:{label:"fehlgeschlagen",cls:"text-red-300 border-red-500/40 bg-red-500/10"},zurueckgerollt:{label:"zurückgerollt",cls:"text-amber-300 border-amber-500/40 bg-amber-500/10"},kritisch:{label:"KRITISCH — Box prüfen",cls:"text-red-200 border-red-500/60 bg-red-500/20"},abgelehnt:{label:"abgelehnt",cls:"text-muted-foreground border-border/60 bg-background/30"}};function Q(t){return t?new Date(t*1e3).toLocaleString("de-DE",{day:"2-digit",month:"2-digit",hour:"2-digit",minute:"2-digit"}):"—"}function Qe(){const{data:t,isLoading:s,refetch:o,isFetching:a}=ge(),{data:l}=ae(),c=le(),{showAlert:g,showConfirm:u,dialogElement:x}=ie(),[d,j]=p.useState({}),n=()=>c.invalidateQueries({queryKey:xe.auftragsbuch});async function N(k,A,B,z){j(w=>({...w,[k]:!0}));try{await K(A,{method:"POST",body:JSON.stringify(B)}),z&&g("Erledigt",z),n()}catch(w){g("Das hat nicht geklappt",String((w==null?void 0:w.message)||w))}finally{j(w=>({...w,[k]:!1}))}}const b=(t==null?void 0:t.items)??[],f=(t==null?void 0:t.skill_kandidaten)??[],C=l!=null&&l.available?l.items.filter(k=>k.status==="blocked").length:0,E=b.length===0&&f.length===0&&C===0;return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"bg-gradient-to-r from-foreground via-foreground to-primary bg-clip-text font-space text-2xl font-bold tracking-tight text-transparent",children:"Auftragsbuch"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Was die Box gebaut oder sich ausgedacht hat — du entscheidest. Annehmen spielt es mit Fangnetz ein (Health-Check, automatischer Rollback)."})]}),e.jsxs("button",{onClick:()=>o(),className:"flex h-9 items-center gap-1.5 rounded-lg border border-border/60 bg-card/45 px-3 text-xs font-semibold text-muted-foreground hover:text-foreground hover:border-primary/40 transition-all cursor-pointer",children:[e.jsx(de,{className:y("h-3.5 w-3.5",a&&"animate-spin")})," Aktualisieren"]})]}),t&&!t.available&&e.jsx("div",{className:"rounded-2xl border border-amber-500/30 bg-amber-500/5 p-4 text-xs text-amber-300",children:"Das Auftragsbuch lebt auf der Box (liest die Gitea-Branches dort). Im lokalen Dev-Modus ist hier nichts zu sehen."}),s&&e.jsxs("div",{className:"flex items-center gap-2 rounded-2xl border border-border/60 bg-card/30 p-6 text-xs text-muted-foreground",children:[e.jsx(S,{className:"h-4 w-4 animate-spin"})," Vorschläge werden geladen …"]}),(t==null?void 0:t.available)&&E&&e.jsxs("div",{className:"flex items-center gap-3 rounded-2xl border border-emerald-500/25 bg-emerald-500/5 p-5",children:[e.jsx(oe,{className:"h-5 w-5 shrink-0 text-emerald-400"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-semibold text-foreground",children:"Nichts zu entscheiden"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Keine offenen Vorschläge. Werkstatt, Orchestrator und Traum melden sich hier, sobald es etwas gibt."})]})]}),e.jsx(Pe,{}),b.length>0&&e.jsxs("section",{className:"space-y-3",children:[e.jsxs(H,{icon:Se,children:["Patch-Vorschläge (",b.length,")"]}),b.map(k=>e.jsx(Me,{item:k,busy:d,onAct:N,showConfirm:u},`${k.repo??"mc2"}:${k.branch}`))]}),f.length>0&&e.jsxs("section",{className:"space-y-3",children:[e.jsxs(H,{icon:ce,children:["Skill-Kandidaten aus dem Traum (",f.length,")"]}),f.map(k=>e.jsx(Te,{k,busy:d,onAct:N,showConfirm:u},k.file))]}),x]})}function H({icon:t,children:s}){return e.jsxs("p",{className:"flex items-center gap-1.5 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground/60",children:[e.jsx(t,{className:"h-3.5 w-3.5"})," ",s]})}const Be={triage:{label:"wird ausgearbeitet …",cls:"text-violet-300 border-violet-500/40 bg-violet-500/10",spin:!0},todo:{label:"wartet",cls:"text-muted-foreground border-border/60 bg-background/30"},scheduled:{label:"geplant",cls:"text-muted-foreground border-border/60 bg-background/30"},ready:{label:"gleich dran",cls:"text-sky-300/80 border-sky-500/30 bg-sky-500/5"},running:{label:"in Arbeit …",cls:"text-sky-300 border-sky-500/40 bg-sky-500/10",spin:!0},review:{label:"im Review",cls:"text-amber-300 border-amber-500/40 bg-amber-500/10"},blocked:{label:"hängt — braucht dich",cls:"text-red-300 border-red-500/40 bg-red-500/10"},done:{label:"fertig ✓",cls:"text-emerald-300 border-emerald-500/40 bg-emerald-500/10"}},We={needs_input:"Die Box hat eine Frage:",capability:"Die Box kam hier nicht weiter:",transient:"Die Aufgabe hakt:"};function Pe(){var X,Y;const{data:t,isLoading:s}=ae(),o=le(),{showAlert:a,showConfirm:l,dialogElement:c}=ie(),[g,u]=p.useState(""),[x,d]=p.useState("box"),j=x!=="box",[n,N]=p.useState(!1),[b,f]=p.useState({}),[C,E]=p.useState(null),[k,A]=p.useState(null),[B,z]=p.useState({}),w=(t==null?void 0:t.items)??[],W=()=>o.invalidateQueries({queryKey:xe.ideen}),h=C!==null&&(((X=t==null?void 0:t.items.find(r=>r.id===C))==null?void 0:X.status)==="triage"||((Y=t==null?void 0:t.items.find(r=>r.id===C))==null?void 0:Y.status)==="running"),v=be(C??"",h);async function Z(){const r=g.trim();if(!(r.length<3||n)){N(!0);try{const i=r.length>160?r.slice(0,157)+"…":r;await K("/api/ideen",{method:"POST",body:JSON.stringify({titel:i,notiz:r.length>160?r:"",welt:j?"ide":"box",tiefe:j?x:""})}),u(""),W()}catch(i){a("Das hat nicht geklappt",String((i==null?void 0:i.message)||i))}finally{N(!1)}}}async function me(r){f(i=>({...i,[r]:!0}));try{await K("/api/ideen/archivieren",{method:"POST",body:JSON.stringify({id:r})}),W()}catch(i){a("Das hat nicht geklappt",String((i==null?void 0:i.message)||i))}finally{f(i=>({...i,[r]:!1}))}}async function I(r,i,m,R){f(D=>({...D,[r+i]:!0}));try{await K(m,{method:"POST",body:JSON.stringify(R)}),W()}catch(D){a("Das hat nicht geklappt",String((D==null?void 0:D.message)||D))}finally{f(D=>({...D,[r+i]:!1}))}}async function U(r){const i=(B[r]||"").trim();if(!(i.length<1||b["ans:"+r])){f(m=>({...m,["ans:"+r]:!0}));try{await K("/api/ideen/antwort",{method:"POST",body:JSON.stringify({id:r,antwort:i})}),z(m=>({...m,[r]:""})),W()}catch(m){a("Das hat nicht geklappt",String((m==null?void 0:m.message)||m))}finally{f(m=>({...m,["ans:"+r]:!1}))}}}const J=r=>{var re,se;const i=Be[r.status]??{label:r.status,cls:"text-muted-foreground border-border/60 bg-background/30"},m=C===r.id,R=r.status==="triage"||r.status==="running"||r.status==="done",D=r.status==="blocked",ee=!!b["ans:"+r.id],O=r.status==="running"&&(r.puls_alter??0)>600,te=r.status==="todo"||r.status==="ready"||r.status==="scheduled";return e.jsxs("li",{className:y("flex flex-col gap-2 rounded-xl border bg-background/30 px-3 py-2",D?"border-red-500/30":O?"border-amber-500/40":"border-border/40"),children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:y("flex shrink-0 items-center gap-1.5 rounded-lg border px-2 py-0.5 text-[10px] font-bold",i.cls),children:[i.spin&&e.jsx(S,{className:"h-3 w-3 animate-spin"}),i.label]}),O&&e.jsxs("span",{className:"flex shrink-0 items-center gap-1 rounded-lg border border-amber-500/40 bg-amber-500/10 px-2 py-0.5 text-[10px] font-bold text-amber-300",title:"Der Worker lebt, gibt aber kein Lebenszeichen mehr — vermutlich wartet er auf etwas, das nie kommt. „Neuer Versuch“ startet die Karte frisch.",children:[e.jsx(P,{className:"h-3 w-3"})," ",Math.round((r.puls_alter??0)/60)," min ohne Regung"]}),(r.prio??0)!==0&&e.jsxs("span",{className:"shrink-0 rounded bg-background/50 px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",title:"Priorität — höher kommt zuerst dran (bei gleicher Prio: Erstellzeit)",children:["P",r.prio]}),r.welt==="ide"&&e.jsxs("span",{className:"flex shrink-0 items-center gap-1 rounded-lg border border-violet-500/40 bg-violet-500/10 px-2 py-0.5 text-[10px] font-bold text-violet-300",title:"IDE-Welt: die Box bereitet nur vor (Konzept + Repo + Doku, kein Code). Gebaut wird von dir in Zed.",children:[e.jsx(M,{className:"h-3 w-3"})," IDE"]}),e.jsx("span",{className:"min-w-0 flex-1 truncate text-xs text-foreground",title:r.body||r.titel,children:r.titel}),e.jsxs("span",{className:"flex shrink-0 items-center gap-1 text-[10px] text-muted-foreground/70",children:[e.jsx(q,{className:"h-3 w-3"}),Q(r.erstellt)]}),te&&e.jsxs("span",{className:"flex shrink-0 items-center",children:[e.jsx("button",{disabled:!!b["pr:"+r.id],onClick:()=>I("pr:",r.id,"/api/ideen/prio",{id:r.id,richtung:"hoch"}),title:"Vorziehen (Prio +1)",className:"rounded-md p-1 text-muted-foreground/60 transition-colors hover:text-foreground cursor-pointer disabled:opacity-50",children:e.jsx(ye,{className:"h-3.5 w-3.5"})}),e.jsx("button",{disabled:!!b["pr:"+r.id],onClick:()=>I("pr:",r.id,"/api/ideen/prio",{id:r.id,richtung:"runter"}),title:"Zurückstellen (Prio −1)",className:"rounded-md p-1 text-muted-foreground/60 transition-colors hover:text-foreground cursor-pointer disabled:opacity-50",children:e.jsx(ve,{className:"h-3.5 w-3.5"})})]}),(r.status==="running"||D)&&e.jsx("button",{disabled:!!b["rt:"+r.id],onClick:()=>l("Neuer Versuch?",r.status==="running"?`Der laufende Worker von '${r.titel.slice(0,60)}' wird beendet (samt gestarteter Test-Prozesse) und die Karte frisch gestartet. Bisheriger Zwischenstand im Workspace bleibt liegen.`:`Die Karte '${r.titel.slice(0,60)}' wird entsperrt und läuft weiter, sobald ein Platz frei ist.`,()=>I("rt:",r.id,"/api/ideen/retry",{id:r.id})),title:"Neuer Versuch — Karte frisch starten",className:y("shrink-0 rounded-md p-1 transition-colors cursor-pointer disabled:opacity-50",O?"text-amber-300 hover:text-amber-200":"text-muted-foreground/60 hover:text-foreground"),children:b["rt:"+r.id]?e.jsx(S,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(we,{className:"h-3.5 w-3.5"})}),(r.status==="running"||te||r.status==="triage")&&e.jsx("button",{disabled:!!b["st:"+r.id],onClick:()=>l("Karte stoppen?",`'${r.titel.slice(0,60)}' wird angehalten${r.status==="running"?" und der laufende Worker beendet":""}. Sie bleibt als gestoppt im Board und kann jederzeit per „Neuer Versuch“ weiterlaufen.`,()=>I("st:",r.id,"/api/ideen/stopp",{id:r.id})),title:"Stoppen — Karte anhalten",className:"shrink-0 rounded-md p-1 text-muted-foreground/60 transition-colors hover:text-red-300 cursor-pointer disabled:opacity-50",children:b["st:"+r.id]?e.jsx(S,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(Ee,{className:"h-3.5 w-3.5"})}),(r.status==="done"||D)&&e.jsx("button",{disabled:!!b[r.id],onClick:()=>me(r.id),title:D?"Aufgeben und aus der Liste räumen (wandert ins Kanban-Archiv)":"Aus der Liste räumen (wandert ins Kanban-Archiv)",className:"shrink-0 rounded-md p-1 text-muted-foreground/60 transition-colors hover:text-foreground cursor-pointer disabled:opacity-50",children:b[r.id]?e.jsx(S,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(F,{className:"h-3.5 w-3.5"})}),r.welt==="ide"&&(r.status==="running"||r.status==="done")&&e.jsxs("button",{onClick:()=>A(k===r.id?null:r.id),title:"Konzept ansehen (das ausgearbeitete KONZEPT.md)",className:y("flex shrink-0 items-center gap-1 rounded-md px-1.5 py-1 text-[10px] font-bold transition-colors cursor-pointer",k===r.id?"text-violet-300":"text-violet-300/70 hover:text-violet-200"),children:[e.jsx(ue,{className:"h-3.5 w-3.5"})," Konzept"]}),R&&e.jsx("button",{onClick:()=>E(m?null:r.id),title:r.status==="done"?"Ergebnis anzeigen":"Worker-Log anzeigen",className:"shrink-0 rounded-md p-1 text-muted-foreground/60 transition-colors hover:text-foreground cursor-pointer",children:m?e.jsx(V,{className:"h-3.5 w-3.5"}):e.jsx($,{className:"h-3.5 w-3.5"})})]}),k===r.id&&e.jsx($e,{id:r.id}),r.status==="running"&&r.notiz&&e.jsxs("p",{className:"-mt-1 ml-1 text-[11px] italic leading-relaxed text-sky-200/80",title:"Jüngste Zwischenmeldung des Workers (Heartbeat)",children:["„",r.notiz,"“"]}),(r.status==="todo"||r.status==="scheduled"||r.status==="ready")&&(((re=r.wartet_auf)==null?void 0:re.length)??0)>0&&e.jsxs("p",{className:"-mt-1 ml-1 text-[10px] text-muted-foreground/70",children:["→ wartet auf: ",r.wartet_auf.join(" · ")]}),D&&e.jsxs("div",{className:"space-y-2 border-t border-red-500/20 pt-2",children:[e.jsxs("p",{className:"flex items-start gap-1.5 text-[11px] leading-relaxed text-red-200/90",children:[e.jsx(je,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-red-300"}),e.jsxs("span",{children:[e.jsx("b",{children:We[r.frage_kind||""]??"Die Aufgabe hängt und wartet auf dich:"})," ",r.frage?e.jsx("span",{className:"text-foreground/90",children:r.frage}):e.jsx("span",{className:"text-muted-foreground italic",children:"kein genauer Grund hinterlegt — antworte einfach mit einer Entscheidung, dann läuft sie weiter."})]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{value:B[r.id]||"",onChange:G=>z(pe=>({...pe,[r.id]:G.target.value})),onKeyDown:G=>{G.key==="Enter"&&U(r.id)},placeholder:"Deine Antwort — die Box macht damit weiter",maxLength:2e3,className:"h-8 min-w-0 flex-1 rounded-lg border border-border/60 bg-background/60 px-2.5 text-xs text-foreground placeholder:text-muted-foreground/50 focus:border-red-400/50 focus:outline-none"}),e.jsxs("button",{onClick:()=>U(r.id),disabled:ee||(B[r.id]||"").trim().length<1,className:"flex h-8 shrink-0 items-center gap-1.5 rounded-lg border border-emerald-500/40 bg-emerald-500/10 px-3 text-[10px] font-bold uppercase tracking-wide text-emerald-300 transition-all hover:bg-emerald-500/20 cursor-pointer disabled:opacity-50",children:[ee?e.jsx(S,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(ne,{className:"h-3.5 w-3.5"})," Antworten & weiter"]})]})]}),m&&R&&r.status!=="done"&&e.jsx("div",{className:"ml-2 -mt-1",children:e.jsx("div",{className:"rounded-lg border border-border/50 bg-background/50 p-2",children:h&&v.isLoading?e.jsx("p",{className:"text-[10px] text-muted-foreground animate-pulse",children:"Log wird geladen …"}):v.error?e.jsx("p",{className:"text-[10px] text-red-400",children:"Log nicht ladbar"}):(se=v.data)!=null&&se.available&&v.data.lines.length>0?e.jsx("pre",{className:"max-h-64 overflow-auto font-mono text-[10px] leading-relaxed text-foreground/80 whitespace-pre-wrap",children:v.data.lines.join(` +`)}):e.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Kein Log verfügbar"})})}),m&&r.status==="done"&&e.jsx(Ie,{id:r.id})]},r.id)};return t&&!t.available?null:e.jsxs("section",{className:"space-y-3",children:[e.jsxs(H,{icon:Ne,children:["Ideen-Queue",t?` — ${t.offen} offen`:""]}),e.jsxs("div",{className:"mc-card p-4 space-y-3",children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{value:g,onChange:r=>u(r.target.value),onKeyDown:r=>{r.key==="Enter"&&Z()},placeholder:"Neue Idee — einfach hinschreiben, die Box macht den Rest",className:"h-9 min-w-0 flex-1 rounded-lg border border-border/60 bg-background/50 px-3 text-sm text-foreground placeholder:text-muted-foreground/50 focus:border-primary/50 focus:outline-none"}),e.jsxs("button",{onClick:Z,disabled:n||g.trim().length<3,className:y("flex h-9 shrink-0 items-center gap-1.5 rounded-lg border px-3 text-[11px] font-bold uppercase tracking-wide transition-all cursor-pointer disabled:opacity-50",j?"border-violet-500/40 bg-violet-500/10 text-violet-300 hover:bg-violet-500/20":"border-primary/40 bg-primary/10 text-primary hover:bg-primary/20"),children:[n?e.jsx(S,{className:"h-3.5 w-3.5 animate-spin"}):j?e.jsx(M,{className:"h-3.5 w-3.5"}):e.jsx(ne,{className:"h-3.5 w-3.5"}),j?"Vorbereiten":"In die Queue"]})]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-[11px] text-muted-foreground/70",children:"Modus"}),e.jsxs("div",{className:"flex rounded-lg border border-border/60 p-0.5",children:[e.jsxs("button",{onClick:()=>d("box"),className:y("flex items-center gap-1 rounded px-2 py-1 text-[10px] font-bold uppercase tracking-wide transition-all cursor-pointer",x==="box"?"bg-primary/15 text-primary":"text-muted-foreground/60 hover:text-foreground"),children:[e.jsx(he,{className:"h-3 w-3"})," Box"]}),e.jsxs("button",{onClick:()=>d("simpel"),title:"IDE-Projekt, schnell vorbereitet: knappes Konzept, wenige Denk-Runden. Für kleine, klar umrissene Sachen.",className:y("flex items-center gap-1 rounded px-2 py-1 text-[10px] font-bold uppercase tracking-wide transition-all cursor-pointer",x==="simpel"?"bg-violet-500/15 text-violet-300":"text-muted-foreground/60 hover:text-foreground"),children:[e.jsx(M,{className:"h-3 w-3"})," IDE: simpel"]}),e.jsxs("button",{onClick:()=>d("gruendlich"),title:"IDE-Projekt, gründlich durchdacht: volle Kaskade mit mehreren Rollen und Härtetests. Für große/ambitionierte Projekte.",className:y("flex items-center gap-1 rounded px-2 py-1 text-[10px] font-bold uppercase tracking-wide transition-all cursor-pointer",x==="gruendlich"?"bg-violet-500/15 text-violet-300":"text-muted-foreground/60 hover:text-foreground"),children:[e.jsx(M,{className:"h-3 w-3"})," IDE: gründlich"]})]})]}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:j?e.jsxs(e.Fragment,{children:[e.jsxs("b",{className:"text-violet-300/90",children:["IDE-Welt",x==="gruendlich"?" · gründlich":" · simpel",":"]})," ","Die Box denkt das Konzept durch",x==="gruendlich"?" — volle Kaskade: mehrere Fach-Rollen, bis zu 3 Denk-Runden, mehrfacher Kritiker-Härtetest (für große/ambitionierte Projekte, dauert entsprechend)":" — schlank: 2 Rollen, 1 Denk-Runde (für kleine, klar umrissene Projekte, ein paar Minuten)",", legt ein leeres Gitea-Repo an und füllt es nur mit den wichtigen Dokumenten (Konzept, Roadmap, AGENTS.md, .aiexclude) — ",e.jsx("b",{children:"kein Code"}),". Danach öffnest du das Repo in Zed und baust selbst."]}):e.jsx(e.Fragment,{children:"Eine Queue, alle Türen: hier, per Telegram oder im Gespräch mit Lucy. Die Box arbeitet Ideen selbst aus und baut — Code-Ergebnisse erscheinen als Karte unter „Patch-Vorschläge“, nichts davon geht ohne deinen Klick live. Nur reine Doku-Bagatellen zieht die Box nachts selbst ein (mit Fangnetz und Meldung)."})}),s&&e.jsxs("p",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[e.jsx(S,{className:"h-3.5 w-3.5 animate-spin"})," Queue wird geladen …"]}),(t==null?void 0:t.fehler)&&e.jsx("p",{className:"text-xs text-amber-300",children:"Queue gerade nicht lesbar — neuer Versuch läuft."}),w.length>0&&e.jsxs("div",{className:"space-y-3",children:[((t==null?void 0:t.projekte)??[]).map(r=>e.jsx(Ve,{projekt:r,karten:w.filter(i=>i.projekt===r.key),zeile:J},r.key)),(()=>{const r=new Set(((t==null?void 0:t.projekte)??[]).map(m=>m.key)),i=w.filter(m=>!m.projekt||!r.has(m.projekt));return i.length>0?e.jsx("ul",{className:"space-y-1.5",children:i.map(m=>J(m))}):null})()]}),(t==null?void 0:t.available)&&!s&&w.length===0&&e.jsx("p",{className:"text-xs text-muted-foreground/70",children:"Queue ist leer — wirf der Box eine Idee zu."})]}),c]})}const _={blocked:0,running:1,review:2,ready:3,triage:4};function Ve({projekt:t,karten:s,zeile:o}){const[a,l]=p.useState(!1),[c,g]=p.useState(!1),u=s.filter(n=>_[n.status]!==void 0).sort((n,N)=>_[n.status]-_[N.status]||(n.erstellt??0)-(N.erstellt??0)),x=s.filter(n=>n.status==="todo"||n.status==="scheduled").sort((n,N)=>{var b,f;return((b=n.wartet_auf)!=null&&b.length?1:0)-((f=N.wartet_auf)!=null&&f.length?1:0)||(n.erstellt??0)-(N.erstellt??0)}),d=s.filter(n=>n.status==="done").sort((n,N)=>(N.fertig??0)-(n.fertig??0)),j=t.gesamt>0?Math.round(t.fertig/t.gesamt*100):0;return e.jsxs("div",{className:"space-y-2 rounded-xl border border-border/50 bg-background/20 p-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ke,{className:"h-4 w-4 shrink-0 text-primary/70"}),e.jsx("p",{className:"min-w-0 flex-1 truncate text-xs font-semibold text-foreground",title:t.titel,children:t.titel}),e.jsxs("span",{className:"shrink-0 text-[10px] text-muted-foreground",children:[t.fertig," von ",t.gesamt," fertig"]})]}),e.jsx("div",{className:"h-1 overflow-hidden rounded-full bg-background/60",title:`${j}%`,children:e.jsx("div",{className:"h-1 rounded-full bg-primary/70 transition-all",style:{width:`${j}%`}})}),u.length>0&&e.jsx("ul",{className:"space-y-1.5",children:u.map(n=>o(n))}),x.length>0&&e.jsxs("div",{children:[e.jsxs("button",{onClick:()=>l(n=>!n),className:"flex items-center gap-1.5 text-[11px] font-semibold text-muted-foreground hover:text-foreground transition-colors cursor-pointer",children:[a?e.jsx(V,{className:"h-3.5 w-3.5"}):e.jsx($,{className:"h-3.5 w-3.5"}),x.length," Karte",x.length===1?"":"n"," in der Kette — laufen automatisch der Reihe nach"]}),a&&e.jsx("ul",{className:"mt-1.5 space-y-1.5",children:x.map(n=>o(n))})]}),d.length>0&&e.jsxs("div",{children:[e.jsxs("button",{onClick:()=>g(n=>!n),className:"flex items-center gap-1.5 text-[11px] font-semibold text-emerald-300/70 hover:text-emerald-300 transition-colors cursor-pointer",children:[c?e.jsx(V,{className:"h-3.5 w-3.5"}):e.jsx($,{className:"h-3.5 w-3.5"}),d.length," fertig"]}),c&&e.jsx("ul",{className:"mt-1.5 space-y-1.5",children:d.map(n=>o(n))})]})]})}function $e({id:t}){const[s,o]=p.useState(null),[a,l]=p.useState(!1),[c,g]=p.useState(0);return p.useEffect(()=>{let u=!1;return o(null),l(!1),K(`/api/ideen/${t}/konzept`).then(x=>{u||o(x)}).catch(()=>{u||l(!0)}),()=>{u=!0}},[t,c]),e.jsx("div",{className:"ml-2 -mt-1",children:e.jsxs("div",{className:"rounded-lg border border-violet-500/25 bg-violet-500/[0.04] p-3",children:[e.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[e.jsxs("p",{className:"flex items-center gap-1.5 text-[10px] font-bold uppercase tracking-wide text-violet-300",children:[e.jsx(ue,{className:"h-3 w-3"})," Konzept"]}),(s==null?void 0:s.repo)&&e.jsxs("a",{href:`https://git.tobisniceshomelab.ddnsfree.com/${s.repo}`,className:"flex items-center gap-1 text-[10px] text-violet-300/70 hover:text-violet-200",children:[e.jsx(Ae,{className:"h-3 w-3"})," ",s.repo]}),e.jsx("button",{onClick:()=>g(u=>u+1),title:"Neu laden",className:"ml-auto rounded p-0.5 text-muted-foreground/50 hover:text-foreground cursor-pointer",children:e.jsx(de,{className:"h-3 w-3"})})]}),a?e.jsx("p",{className:"text-[11px] text-red-400",children:"Konzept nicht ladbar — später nochmal versuchen."}):s===null?e.jsx("p",{className:"text-[10px] text-muted-foreground animate-pulse",children:"Konzept wird geladen …"}):s.konzept?e.jsx("div",{className:"max-h-[28rem] overflow-y-auto pr-1",children:e.jsx(ze,{text:s.konzept})}):e.jsx("p",{className:"text-[11px] text-muted-foreground italic",children:s.error||"Noch kein Konzept — das Projekt wird gerade vorbereitet."})]})})}function Ie({id:t}){const[s,o]=p.useState(null),[a,l]=p.useState(!1),[c,g]=p.useState(0);p.useEffect(()=>{let x=!1;return l(!1),o(null),K(`/api/ideen/${t}/ergebnis`).then(d=>{x||o(d)}).catch(()=>{x||l(!0)}),()=>{x=!0}},[t,c]);const u=s?s.summary||s.result:"";return e.jsx("div",{className:"ml-2 -mt-1",children:e.jsxs("div",{className:"rounded-lg border border-emerald-500/25 bg-emerald-500/5 p-2.5",children:[e.jsxs("p",{className:"mb-1 flex items-center gap-1.5 text-[10px] font-bold uppercase tracking-wide text-emerald-300",children:[e.jsx(De,{className:"h-3 w-3"})," Ergebnis des Workers"]}),a?e.jsx("button",{type:"button",onClick:()=>g(x=>x+1),className:"text-[10px] text-red-400 underline decoration-dotted underline-offset-2 hover:text-red-300",children:"Ergebnis nicht ladbar — nochmal versuchen"}):s===null?e.jsx("p",{className:"text-[10px] text-muted-foreground animate-pulse",children:"Wird geladen …"}):u?e.jsx("p",{className:"max-h-64 overflow-y-auto whitespace-pre-wrap text-xs leading-relaxed text-foreground/85",children:u}):e.jsx("p",{className:"text-[10px] text-muted-foreground italic",children:"Der Worker hat keine Abschluss-Zusammenfassung hinterlassen (ältere Karte oder Protokollverstoß)."})]})})}function Re({item:t}){const s=t.status;if(!s)return null;const o=Le[s.state];return o?e.jsxs("span",{className:y("flex items-center gap-1.5 rounded-lg border px-2 py-0.5 text-[10px] font-bold",o.cls),title:s.detail,children:[o.spin&&e.jsx(S,{className:"h-3 w-3 animate-spin"}),o.label]}):null}function Me({item:t,busy:s,onAct:o,showConfirm:a}){var z,w,W;const[l,c]=p.useState(!1),[g,u]=p.useState(null),[x,d]=p.useState(!1),[j,n]=p.useState(!1),[N,b]=p.useState(""),f=((z=t.status)==null?void 0:z.state)==="laeuft"||((w=t.status)==null?void 0:w.state)==="rollback",C=((W=t.status)==null?void 0:W.state)==="eingespielt",E=t.repo??"mc2",k=E==="lucy",A=`${E}:${t.branch}`;async function B(){const h=!l;if(c(h),h&&g===null){d(!0);try{const v=await K(`/api/auftragsbuch/diff?branch=${encodeURIComponent(t.branch)}&repo=${E}`);u(v.diff+(v.truncated?` +… (gekürzt)`:""))}catch(v){u(`(Diff nicht ladbar: ${(v==null?void 0:v.message)||v})`)}finally{d(!1)}}}return e.jsxs("div",{className:"mc-card p-4 space-y-3",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("span",{className:"rounded-md border border-primary/30 bg-primary/10 px-1.5 py-0.5 text-[10px] font-bold uppercase tracking-wider text-primary",children:Ke[t.kind]??t.kind}),k&&e.jsx("span",{className:"rounded-md border border-pink-500/40 bg-pink-500/10 px-1.5 py-0.5 text-[10px] font-bold uppercase tracking-wider text-pink-300",title:"Vorschlag fürs Lucy-Repo — Annehmen baut die App am PC neu und startet sie neu, wenn sie läuft.",children:"Lucy"}),e.jsx("span",{className:"font-mono text-[11px] text-muted-foreground truncate",title:t.branch,children:t.branch}),e.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-muted-foreground/70",children:[e.jsx(q,{className:"h-3 w-3"}),Q(t.ts)]}),e.jsx(Re,{item:t})]}),e.jsx("p",{className:"mt-1.5 text-sm font-semibold text-foreground",children:t.subject||"(ohne Titel)"}),t.body&&e.jsx("p",{className:"mt-1 whitespace-pre-wrap text-xs leading-relaxed text-muted-foreground line-clamp-6",children:t.body}),t.empfehlung&&e.jsxs("p",{className:y("mt-1.5 flex items-start gap-1.5 rounded-lg border px-2 py-1 text-[11px]",t.empfehlung.empfehlung==="ANNEHMEN"&&"border-emerald-500/30 bg-emerald-500/5 text-emerald-300",t.empfehlung.empfehlung==="ABLEHNEN"&&"border-red-500/30 bg-red-500/5 text-red-300",t.empfehlung.empfehlung==="UNKLAR"&&"border-amber-500/30 bg-amber-500/5 text-amber-300"),title:`Nächtliches Kurz-Gutachten (${t.empfehlung.richter}) — eine Meinung, kein Muss. Die Entscheidung bleibt bei dir.`,children:[e.jsx(ce,{className:"mt-0.5 h-3 w-3 shrink-0"}),e.jsxs("span",{children:[e.jsxs("b",{children:["Empfehlung: ",t.empfehlung.empfehlung==="ANNEHMEN"?"Annehmen":t.empfehlung.empfehlung==="ABLEHNEN"?"Ablehnen":"Unklar","."]})," ",t.empfehlung.satz]})]})]}),!f&&!C&&e.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[!t.verwaist&&e.jsxs("button",{disabled:!!s[A],onClick:()=>a("Vorschlag annehmen?",k?`'${t.branch}' wird im Lucy-Repo auf main gemergt, dann baut dein PC die App neu (dist) und startet Lucy neu, falls sie gerade läuft. Der PC muss dafür an sein. Schlägt Build oder Start fehl, dreht die Box den Merge automatisch zurück — die laufende Lucy bleibt die alte.`:`'${t.branch}' wird auf main gemergt und live eingespielt. Die Zentrale startet dabei kurz neu. Geht der Health-Check danach rot, rollt die Box automatisch zurück.${t.frontend_ohne_build?` + +Achtung: Enthält Frontend-Quelltext ohne gebautes Bundle — die Oberfläche bleibt alt, bis am PC gebaut wird.`:""}`,()=>o(A,"/api/auftragsbuch/annehmen",{branch:t.branch,repo:E})),className:"flex h-9 items-center gap-1.5 rounded-lg border border-emerald-500/40 bg-emerald-500/10 px-3 text-[11px] font-bold uppercase tracking-wide text-emerald-300 transition-all hover:bg-emerald-500/20 cursor-pointer disabled:opacity-50",children:[s[A]?e.jsx(S,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(oe,{className:"h-3.5 w-3.5"})," Annehmen"]}),e.jsxs("button",{disabled:!!s["ab:"+A],onClick:()=>n(h=>!h),className:"flex h-9 items-center gap-1.5 rounded-lg border border-red-500/30 bg-red-500/5 px-3 text-[11px] font-bold uppercase tracking-wide text-red-300/90 transition-all hover:bg-red-500/15 cursor-pointer disabled:opacity-50",children:[s["ab:"+A]?e.jsx(S,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(F,{className:"h-3.5 w-3.5"})," Ablehnen"]})]})]}),j&&!f&&!C&&e.jsxs("div",{className:"space-y-2 rounded-xl border border-red-500/25 bg-red-500/5 p-3",children:[e.jsxs("p",{className:"text-[11px] text-muted-foreground",children:["Der Branch '",t.branch,"' wird auf Gitea gelöscht (die Arbeit bleibt in der Historie). Sag der Box kurz ",e.jsx("b",{children:"warum"})," — dann schlägt sie dir so etwas nicht wieder vor."]}),e.jsx("input",{value:N,onChange:h=>b(h.target.value),placeholder:"Grund (optional) — z. B. „gibt es schon“ oder „will ich nicht“",maxLength:400,className:"w-full rounded-lg border border-border/60 bg-background/60 px-2.5 py-1.5 text-xs text-foreground placeholder:text-muted-foreground/50 focus:border-red-400/50 focus:outline-none"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("button",{disabled:!!s["ab:"+A],onClick:()=>{n(!1),o("ab:"+A,"/api/auftragsbuch/ablehnen",{branch:t.branch,repo:E,grund:N.trim()})},className:"flex h-8 items-center gap-1.5 rounded-lg border border-red-500/40 bg-red-500/10 px-3 text-[11px] font-bold uppercase tracking-wide text-red-300 transition-all hover:bg-red-500/20 cursor-pointer disabled:opacity-50",children:[e.jsx(F,{className:"h-3.5 w-3.5"})," Wirklich ablehnen"]}),e.jsx("button",{onClick:()=>n(!1),className:"flex h-8 items-center rounded-lg border border-border/60 bg-background/40 px-3 text-[11px] font-semibold text-muted-foreground transition-all hover:text-foreground cursor-pointer",children:"Abbrechen"})]})]}),t.status&&(f||!C)&&t.status.detail&&e.jsx("p",{className:"text-[11px] text-muted-foreground",children:t.status.detail}),t.verwaist&&e.jsxs("p",{className:"rounded-lg border border-red-500/30 bg-red-500/5 px-2 py-1.5 text-[11px] text-red-300/90",children:[e.jsx("b",{children:"Kaputt aufgesetzt:"})," Dieser Branch hat keinen gemeinsamen Ursprung mit main (der Werkstatt-Worker hat nicht richtig geklont) — Annehmen ist technisch unmöglich, deshalb fehlt der Knopf. Am besten ",e.jsx("b",{children:"ablehnen mit Grund"}),"; die Idee kann danach frisch in die Queue."]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-[11px] text-muted-foreground",children:[e.jsxs("span",{className:"rounded bg-background/40 px-1.5 py-0.5 font-mono",children:[t.ahead," Commit",t.ahead===1?"":"s"]}),t.shortstat&&e.jsx("span",{className:"rounded bg-background/40 px-1.5 py-0.5 font-mono",children:t.shortstat.trim()}),t.verwaist&&e.jsxs("span",{className:"flex items-center gap-1 rounded bg-red-500/10 px-1.5 py-0.5 text-red-300",title:"Kein gemeinsamer Vorfahre mit main — git kann diesen Branch niemals mergen.",children:[e.jsx(P,{className:"h-3 w-3"})," kein gemeinsamer Ursprung"]}),t.leer&&e.jsxs("span",{className:"flex items-center gap-1 rounded bg-amber-500/10 px-1.5 py-0.5 text-amber-300",title:"Der Diff gegen main ist leer — der Branch würde nichts verändern (Inhalt schon in main oder am Repo vorbei gearbeitet).",children:[e.jsx(P,{className:"h-3 w-3"})," Diff leer — bringt nichts"]}),t.behind>0&&!t.verwaist&&e.jsxs("span",{className:"flex items-center gap-1 rounded bg-amber-500/10 px-1.5 py-0.5 text-amber-300",title:"main ist seit diesem Vorschlag weitergelaufen — bei Konflikten versucht die Annahme automatisch einen Rebase.",children:[e.jsx(P,{className:"h-3 w-3"})," ",t.behind," hinter main"]}),t.frontend_ohne_build&&e.jsxs("span",{className:"flex items-center gap-1 rounded bg-amber-500/10 px-1.5 py-0.5 text-amber-300",title:"Die Box kann kein Frontend bauen (kein Node) — nach dem Annehmen bleibt die Oberfläche alt, bis am PC gebaut wird.",children:[e.jsx(P,{className:"h-3 w-3"})," Frontend ohne Build"]})]}),e.jsxs("div",{children:[e.jsxs("button",{onClick:B,className:"flex items-center gap-1.5 text-[11px] font-semibold text-muted-foreground hover:text-foreground transition-colors cursor-pointer",children:[l?e.jsx(V,{className:"h-3.5 w-3.5"}):e.jsx($,{className:"h-3.5 w-3.5"}),e.jsx(Ce,{className:"h-3.5 w-3.5"})," ",t.files.length," Datei",t.files.length===1?"":"en"," — Änderungen ansehen"]}),l&&e.jsxs("div",{className:"mt-2 space-y-2",children:[e.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[t.files.map(h=>e.jsxs("span",{className:"rounded bg-background/40 px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",children:[e.jsx("b",{className:y(h.status.startsWith("A")&&"text-emerald-400",h.status.startsWith("D")&&"text-red-400",h.status.startsWith("M")&&"text-sky-400"),children:h.status})," ",h.path]},h.path)),t.files_truncated&&e.jsx("span",{className:"text-[10px] text-muted-foreground/60",children:"…"})]}),e.jsx("div",{className:"max-h-96 overflow-auto rounded-xl border border-border/50 bg-background/50 p-3",children:x?e.jsx("span",{className:"text-[11px] text-muted-foreground",children:"Diff wird geladen …"}):e.jsx("pre",{className:"text-[10px] leading-relaxed text-foreground/80 whitespace-pre",children:(g??"").split(` +`).map((h,v)=>e.jsx("span",{className:y("block",h.startsWith("+")&&!h.startsWith("+++")&&"text-emerald-300/90 bg-emerald-500/5",h.startsWith("-")&&!h.startsWith("---")&&"text-red-300/90 bg-red-500/5",(h.startsWith("@@")||h.startsWith("diff "))&&"text-sky-300/90"),children:h||" "},v))})})]})]})]})}function Te({k:t,busy:s,onAct:o,showConfirm:a}){const[l,c]=p.useState(!1);return e.jsxs("div",{className:"rounded-2xl border border-violet-500/25 bg-violet-500/[0.04] p-4 shadow-lg shadow-black/15 backdrop-blur-md space-y-3",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("span",{className:"rounded-md border border-violet-500/30 bg-violet-500/10 px-1.5 py-0.5 text-[10px] font-bold uppercase tracking-wider text-violet-300",children:"Traum-Idee"}),e.jsx("span",{className:"font-mono text-[11px] text-muted-foreground truncate",children:t.file}),e.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-muted-foreground/70",children:[e.jsx(q,{className:"h-3 w-3"}),Q(t.mtime)]})]}),e.jsx("p",{className:"mt-1.5 text-sm font-semibold text-foreground",children:t.title})]}),e.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[e.jsxs("button",{disabled:!!s["sk:"+t.file],onClick:()=>a("Werkstatt beauftragen?",`Der Kandidat '${t.title}' geht als Auftrag an die Werkstatt (Orchestrator, propose-only). Das Ergebnis erscheint später als neuer Patch-Vorschlag hier im Auftragsbuch — nichts geht ungefragt live.`,()=>o("sk:"+t.file,"/api/auftragsbuch/skill/annehmen",{file:t.file},"Die Werkstatt arbeitet. Das Ergebnis taucht als neuer Vorschlag im Auftragsbuch auf (das kann einige Minuten dauern).")),className:"flex h-9 items-center gap-1.5 rounded-lg border border-violet-500/40 bg-violet-500/10 px-3 text-[11px] font-bold uppercase tracking-wide text-violet-300 transition-all hover:bg-violet-500/20 cursor-pointer disabled:opacity-50",children:[s["sk:"+t.file]?e.jsx(S,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(he,{className:"h-3.5 w-3.5"})," Beauftragen"]}),e.jsxs("button",{disabled:!!s["skab:"+t.file],onClick:()=>a("Kandidat verwerfen?",`'${t.title}' wandert ins Archiv des Wissens-Vaults (verworfen/). Der Traum schlägt ihn nicht erneut vor.`,()=>o("skab:"+t.file,"/api/auftragsbuch/skill/ablehnen",{file:t.file})),className:"flex h-9 items-center gap-1.5 rounded-lg border border-red-500/30 bg-red-500/5 px-3 text-[11px] font-bold uppercase tracking-wide text-red-300/90 transition-all hover:bg-red-500/15 cursor-pointer disabled:opacity-50",children:[s["skab:"+t.file]?e.jsx(S,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(F,{className:"h-3.5 w-3.5"})," Verwerfen"]})]})]}),e.jsxs("button",{onClick:()=>c(g=>!g),className:"flex items-center gap-1.5 text-[11px] font-semibold text-muted-foreground hover:text-foreground transition-colors cursor-pointer",children:[l?e.jsx(V,{className:"h-3.5 w-3.5"}):e.jsx($,{className:"h-3.5 w-3.5"}),e.jsx(fe,{className:"h-3.5 w-3.5"})," Vorschlag lesen"]}),l&&e.jsx("pre",{className:"max-h-72 overflow-auto rounded-xl border border-border/50 bg-background/50 p-3 text-[11px] leading-relaxed text-foreground/85 whitespace-pre-wrap",children:t.preview})]})}export{Qe as AuftragsbuchView}; diff --git a/frontend/dist/assets/ChronikView-BabmqWxX.js b/frontend/dist/assets/ChronikView-DziulU9V.js similarity index 99% rename from frontend/dist/assets/ChronikView-BabmqWxX.js rename to frontend/dist/assets/ChronikView-DziulU9V.js index c7e2267..7dba25d 100644 --- a/frontend/dist/assets/ChronikView-BabmqWxX.js +++ b/frontend/dist/assets/ChronikView-DziulU9V.js @@ -1,4 +1,4 @@ -import{c as m,ag as S,r as c,j as e,ah as z,L as g,U as M,ai as C,ad as D,aj as A,ak as B,al as Z,e as E,am as L,u as R,b as q,g as k,q as T}from"./index-Cpokgrtb.js";import{R as j}from"./rotate-ccw-wHFM0h2t.js";/** +import{c as m,ag as S,r as c,j as e,ah as z,L as g,U as M,ai as C,ad as D,aj as A,ak as B,al as Z,e as E,am as L,u as R,b as q,g as k,q as T}from"./index-CYprWjkZ.js";import{R as j}from"./rotate-ccw-CXI0Tldw.js";/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/ConnectView-u_EPDy1I.js b/frontend/dist/assets/ConnectView-Ckkd4eR_.js similarity index 98% rename from frontend/dist/assets/ConnectView-u_EPDy1I.js rename to frontend/dist/assets/ConnectView-Ckkd4eR_.js index ce0da5f..6aa3dbd 100644 --- a/frontend/dist/assets/ConnectView-u_EPDy1I.js +++ b/frontend/dist/assets/ConnectView-Ckkd4eR_.js @@ -1,4 +1,4 @@ -import{c as v,r as c,I,J as A,j as e,K as h,x as B,B as H,D as E,M as z,e as M,L as T,N as F,C as K}from"./index-Cpokgrtb.js";import{F as O}from"./folder-open-J5CPCk3B.js";import{C as R}from"./circle-x-Cjrbyjns.js";import{C as W}from"./copy-HOrvM3LI.js";/** +import{c as v,r as c,I,J as A,j as e,K as h,x as B,B as H,D as E,M as z,e as M,L as T,N as F,C as K}from"./index-CYprWjkZ.js";import{F as O}from"./folder-open-qsFqfA7z.js";import{C as R}from"./circle-x-D1J1uP0I.js";import{C as W}from"./copy-ZerQbIeQ.js";/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/EigenlebenView-Bva-XFZC.js b/frontend/dist/assets/EigenlebenView-BpLy1pkU.js similarity index 98% rename from frontend/dist/assets/EigenlebenView-Bva-XFZC.js rename to frontend/dist/assets/EigenlebenView-BpLy1pkU.js index ab91f96..48758a7 100644 --- a/frontend/dist/assets/EigenlebenView-Bva-XFZC.js +++ b/frontend/dist/assets/EigenlebenView-BpLy1pkU.js @@ -1,4 +1,4 @@ -import{c as h,an as b,r as i,j as e,L as g,ao as f,a2 as j,U as k,e as o,D as N,M as v,N as w,g as y}from"./index-Cpokgrtb.js";import{B as S}from"./book-open-BfZKBC8k.js";import{C as z}from"./circle-x-Cjrbyjns.js";/** +import{c as h,an as b,r as i,j as e,L as g,ao as f,a2 as j,U as k,e as o,D as N,M as v,N as w,g as y}from"./index-CYprWjkZ.js";import{B as S}from"./book-open-cVx_1TDg.js";import{C as z}from"./circle-x-D1J1uP0I.js";/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/GraphView-BjVVXu3Y.js b/frontend/dist/assets/GraphView-4Mi6huEE.js similarity index 99% rename from frontend/dist/assets/GraphView-BjVVXu3Y.js rename to frontend/dist/assets/GraphView-4Mi6huEE.js index dbeec2f..2cf9708 100644 --- a/frontend/dist/assets/GraphView-BjVVXu3Y.js +++ b/frontend/dist/assets/GraphView-4Mi6huEE.js @@ -1,4 +1,4 @@ -import{ar as Lt,r as V,as as Zi,at as Gn,au as Vn,av as Ki,aw as Qi,ax as Wn,ay as Bn,az as Ji,j as lt,a3 as to}from"./index-Cpokgrtb.js";function eo(e,n){let r=0;for(let i of e)(i=+i)&&(r+=i);return r}var Xn=180/Math.PI,un={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Vr(e,n,r,i,o,a){var s,u,f;return(s=Math.sqrt(e*e+n*n))&&(e/=s,n/=s),(f=e*r+n*i)&&(r-=e*f,i-=n*f),(u=Math.sqrt(r*r+i*i))&&(r/=u,i/=u,f/=u),e*i180?c+=360:c-l>180&&(l+=360),d.push({i:h.push(o(h)+"rotate(",null,i)-2,x:Lt(l,c)})):c&&h.push(o(h)+"rotate("+c+i)}function u(l,c,h,d){l!==c?d.push({i:h.push(o(h)+"skewX(",null,i)-2,x:Lt(l,c)}):c&&h.push(o(h)+"skewX("+c+i)}function f(l,c,h,d,p,y){if(l!==h||c!==d){var v=p.push(o(p)+"scale(",null,",",null,")");y.push({i:v-4,x:Lt(l,h)},{i:v-2,x:Lt(c,d)})}else(h!==1||d!==1)&&p.push(o(p)+"scale("+h+","+d+")")}return function(l,c){var h=[],d=[];return l=e(l),c=e(c),a(l.translateX,l.translateY,c.translateX,c.translateY,h,d),s(l.rotate,c.rotate,h,d),u(l.skewX,c.skewX,h,d),f(l.scaleX,l.scaleY,c.scaleX,c.scaleY,h,d),l=c=null,function(p){for(var y=-1,v=d.length,_;++ye.length)&&(n=e.length);for(var r=0,i=new Array(n);r180?c+=360:c-l>180&&(l+=360),d.push({i:h.push(o(h)+"rotate(",null,i)-2,x:Lt(l,c)})):c&&h.push(o(h)+"rotate("+c+i)}function u(l,c,h,d){l!==c?d.push({i:h.push(o(h)+"skewX(",null,i)-2,x:Lt(l,c)}):c&&h.push(o(h)+"skewX("+c+i)}function f(l,c,h,d,p,y){if(l!==h||c!==d){var v=p.push(o(p)+"scale(",null,",",null,")");y.push({i:v-4,x:Lt(l,h)},{i:v-2,x:Lt(c,d)})}else(h!==1||d!==1)&&p.push(o(p)+"scale("+h+","+d+")")}return function(l,c){var h=[],d=[];return l=e(l),c=e(c),a(l.translateX,l.translateY,c.translateX,c.translateY,h,d),s(l.rotate,c.rotate,h,d),u(l.skewX,c.skewX,h,d),f(l.scaleX,l.scaleY,c.scaleX,c.scaleY,h,d),l=c=null,function(p){for(var y=-1,v=d.length,_;++ye.length)&&(n=e.length);for(var r=0,i=new Array(n);ra,methodNames:i=[],initPropNames:o=[]}={}){return V.forwardRef((a,s)=>{const u=V.useRef(),f=V.useMemo(()=>{const h=Object.fromEntries(o.filter(d=>a.hasOwnProperty(d)).map(d=>[d,a[d]]));return e(h)},[]);Kn(()=>{f(r(u.current))},V.useLayoutEffect),Kn(()=>f._destructor instanceof Function?f._destructor:void 0);const l=V.useCallback((h,...d)=>f[h]instanceof Function?f[h](...d):void 0,[f]),c=V.useRef({});return Object.keys(xo(a,[...i,...o])).filter(h=>c.current[h]!==a[h]).forEach(h=>l(h,a[h])),c.current=a,V.useImperativeHandle(s,()=>Object.fromEntries(i.map(h=>[h,(...d)=>l(h,...d)])),[l]),Zi.createElement(n,{ref:u})})}function Kn(e,n=V.useEffect){const r=V.useRef(),i=V.useRef(!1),o=V.useRef(!1),[a,s]=V.useState(0);i.current&&(o.current=!0),n(()=>(i.current||(r.current=e(),i.current=!0),s(u=>u+1),()=>{o.current&&(r.current&&r.current(),r.current=void 0,i.current=!1,o.current=!1)}),[])}var fn="http://www.w3.org/1999/xhtml";const Qn={svg:"http://www.w3.org/2000/svg",xhtml:fn,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function qe(e){var n=e+="",r=n.indexOf(":");return r>=0&&(n=e.slice(0,r))!=="xmlns"&&(e=e.slice(r+1)),Qn.hasOwnProperty(n)?{space:Qn[n],local:e}:e}function ko(e){return function(){var n=this.ownerDocument,r=this.namespaceURI;return r===fn&&n.documentElement.namespaceURI===fn?n.createElement(e):n.createElementNS(r,e)}}function Co(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Xr(e){var n=qe(e);return(n.local?Co:ko)(n)}function Ao(){}function An(e){return e==null?Ao:function(){return this.querySelector(e)}}function So(e){typeof e!="function"&&(e=An(e));for(var n=this._groups,r=n.length,i=new Array(r),o=0;o=T&&(T=w+1);!(b=_[T])&&++T=0;)(s=i[o])&&(a&&s.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(s,a),a=s);return this}function Ko(e){e||(e=Qo);function n(h,d){return h&&d?e(h.__data__,d.__data__):!h-!d}for(var r=this._groups,i=r.length,o=new Array(i),a=0;an?1:e>=n?0:NaN}function Jo(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function ta(){return Array.from(this)}function ea(){for(var e=this._groups,n=0,r=e.length;n1?this.each((n==null?ha:typeof n=="function"?pa:da)(e,n,r??"")):Bt(this.node(),e)}function Bt(e,n){return e.style.getPropertyValue(n)||Jr(e).getComputedStyle(e,null).getPropertyValue(n)}function ya(e){return function(){delete this[e]}}function _a(e,n){return function(){this[e]=n}}function va(e,n){return function(){var r=n.apply(this,arguments);r==null?delete this[e]:this[e]=r}}function ma(e,n){return arguments.length>1?this.each((n==null?ya:typeof n=="function"?va:_a)(e,n)):this.node()[e]}function ti(e){return e.trim().split(/^|\s+/)}function Sn(e){return e.classList||new ei(e)}function ei(e){this._node=e,this._names=ti(e.getAttribute("class")||"")}ei.prototype={add:function(e){var n=this._names.indexOf(e);n<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var n=this._names.indexOf(e);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function ni(e,n){for(var r=Sn(e),i=-1,o=n.length;++i=0&&(r=n.slice(i+1),n=n.slice(0,i)),{type:n,name:r}})}function Ba(e){return function(){var n=this.__on;if(n){for(var r=0,i=-1,o=n.length,a;r{}};function ve(){for(var e=0,n=arguments.length,r={},i;e=0&&(i=r.slice(o+1),r=r.slice(0,o)),r&&!n.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:i}})}Ae.prototype=ve.prototype={constructor:Ae,on:function(e,n){var r=this._,i=rs(e+"",r),o,a=-1,s=i.length;if(arguments.length<2){for(;++a0)for(var r=new Array(o),i=0,o,a;i()=>e;function cn(e,{sourceEvent:n,subject:r,target:i,identifier:o,active:a,x:s,y:u,dx:f,dy:l,dispatch:c}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},subject:{value:r,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:u,enumerable:!0,configurable:!0},dx:{value:f,enumerable:!0,configurable:!0},dy:{value:l,enumerable:!0,configurable:!0},_:{value:c}})}cn.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function as(e){return!e.ctrlKey&&!e.button}function ss(){return this.parentNode}function us(e,n){return n??{x:e.x,y:e.y}}function ls(){return navigator.maxTouchPoints||"ontouchstart"in this}function fs(){var e=as,n=ss,r=us,i=ls,o={},a=ve("start","drag","end"),s=0,u,f,l,c,h=0;function d(x){x.on("mousedown.drag",p).filter(i).on("touchstart.drag",_).on("touchmove.drag",g,os).on("touchend.drag touchcancel.drag",w).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(x,b){if(!(c||!e.call(this,x,b))){var C=T(this,n.call(this,x,b),x,b,"mouse");C&&(pt(x.view).on("mousemove.drag",y,pe).on("mouseup.drag",v,pe),ai(x.view),Ze(x),l=!1,u=x.clientX,f=x.clientY,C("start",x))}}function y(x){if(Wt(x),!l){var b=x.clientX-u,C=x.clientY-f;l=b*b+C*C>h}o.mouse("drag",x)}function v(x){pt(x.view).on("mousemove.drag mouseup.drag",null),si(x.view,l),Wt(x),o.mouse("end",x)}function _(x,b){if(e.call(this,x,b)){var C=x.changedTouches,S=n.call(this,x,b),M=C.length,N,P;for(N=0;N=0&&e._call.call(void 0,n),e=e._next;--Xt}function tr(){Ht=(Re=ge.now())+Ge,Xt=ae=0;try{hs()}finally{Xt=0,ps(),Ht=0}}function ds(){var e=ge.now(),n=e-Re;n>ui&&(Ge-=n,Re=e)}function ps(){for(var e,n=ze,r,i=1/0;n;)n._call?(i>n._time&&(i=n._time),e=n,n=n._next):(r=n._next,n._next=null,n=e?e._next=r:ze=r);se=e,hn(i)}function hn(e){if(!Xt){ae&&(ae=clearTimeout(ae));var n=e-Ht;n>24?(e<1/0&&(ae=setTimeout(tr,e-ge.now()-Ge)),Qt&&(Qt=clearInterval(Qt))):(Qt||(Re=ge.now(),Qt=setInterval(ds,ui)),Xt=1,li(tr))}}function er(e,n,r){var i=new Ne;return n=n==null?0:+n,i.restart(o=>{i.stop(),e(o+n)},n,r),i}var gs=ve("start","end","cancel","interrupt"),ys=[],fi=0,nr=1,dn=2,Se=3,rr=4,pn=5,Te=6;function Ve(e,n,r,i,o,a){var s=e.__transition;if(!s)e.__transition={};else if(r in s)return;_s(e,r,{name:n,index:i,group:o,on:gs,tween:ys,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:fi})}function Pn(e,n){var r=vt(e,n);if(r.state>fi)throw new Error("too late; already scheduled");return r}function Ct(e,n){var r=vt(e,n);if(r.state>Se)throw new Error("too late; already running");return r}function vt(e,n){var r=e.__transition;if(!r||!(r=r[n]))throw new Error("transition not found");return r}function _s(e,n,r){var i=e.__transition,o;i[n]=r,r.timer=Mn(a,0,r.time);function a(l){r.state=nr,r.timer.restart(s,r.delay,r.time),r.delay<=l&&s(l-r.delay)}function s(l){var c,h,d,p;if(r.state!==nr)return f();for(c in i)if(p=i[c],p.name===r.name){if(p.state===Se)return er(s);p.state===rr?(p.state=Te,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete i[c]):+cdn&&i.state=0&&(n=n.slice(0,r)),!n||n==="start"})}function Bs(e,n,r){var i,o,a=Ws(n)?Pn:Ct;return function(){var s=a(this,e),u=s.on;u!==i&&(o=(i=u).copy()).on(n,r),s.on=o}}function Xs(e,n){var r=this._id;return arguments.length<2?vt(this.node(),r).on.on(e):this.each(Bs(r,e,n))}function Ys(e){return function(){var n=this.parentNode;for(var r in this.__transition)if(+r!==e)return;n&&n.removeChild(this)}}function Zs(){return this.on("end.remove",Ys(this._id))}function Ks(e){var n=this._name,r=this._id;typeof e!="function"&&(e=An(e));for(var i=this._groups,o=i.length,a=new Array(o),s=0;s()=>e;function wu(e,{sourceEvent:n,target:r,transform:i,dispatch:o}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},transform:{value:i,enumerable:!0,configurable:!0},_:{value:o}})}function Et(e,n,r){this.k=e,this.x=n,this.y=r}Et.prototype={constructor:Et,scale:function(e){return e===1?this:new Et(this.k*e,this.x,this.y)},translate:function(e,n){return e===0&n===0?this:new Et(this.k,this.x+this.k*e,this.y+this.k*n)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var En=new Et(1,0,0);mt.prototype=Et.prototype;function mt(e){for(;!e.__zoom;)if(!(e=e.parentNode))return En;return e.__zoom}function Ke(e){e.stopImmediatePropagation()}function Jt(e){e.preventDefault(),e.stopImmediatePropagation()}function ku(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function Cu(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function ir(){return this.__zoom||En}function Au(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Su(){return navigator.maxTouchPoints||"ontouchstart"in this}function Tu(e,n,r){var i=e.invertX(n[0][0])-r[0][0],o=e.invertX(n[1][0])-r[1][0],a=e.invertY(n[0][1])-r[0][1],s=e.invertY(n[1][1])-r[1][1];return e.translate(o>i?(i+o)/2:Math.min(0,i)||Math.max(0,o),s>a?(a+s)/2:Math.min(0,a)||Math.max(0,s))}function Mu(){var e=ku,n=Cu,r=Tu,i=Au,o=Su,a=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],u=250,f=lo,l=ve("start","zoom","end"),c,h,d,p=500,y=150,v=0,_=10;function g(A){A.property("__zoom",ir).on("wheel.zoom",M,{passive:!1}).on("mousedown.zoom",N).on("dblclick.zoom",P).filter(o).on("touchstart.zoom",R).on("touchmove.zoom",D).on("touchend.zoom touchcancel.zoom",L).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}g.transform=function(A,I,E,k){var O=A.selection?A.selection():A;O.property("__zoom",ir),A!==O?b(A,I,E,k):O.interrupt().each(function(){C(this,arguments).event(k).start().zoom(null,typeof I=="function"?I.apply(this,arguments):I).end()})},g.scaleBy=function(A,I,E,k){g.scaleTo(A,function(){var O=this.__zoom.k,j=typeof I=="function"?I.apply(this,arguments):I;return O*j},E,k)},g.scaleTo=function(A,I,E,k){g.transform(A,function(){var O=n.apply(this,arguments),j=this.__zoom,$=E==null?x(O):typeof E=="function"?E.apply(this,arguments):E,U=j.invert($),F=typeof I=="function"?I.apply(this,arguments):I;return r(T(w(j,F),$,U),O,s)},E,k)},g.translateBy=function(A,I,E,k){g.transform(A,function(){return r(this.__zoom.translate(typeof I=="function"?I.apply(this,arguments):I,typeof E=="function"?E.apply(this,arguments):E),n.apply(this,arguments),s)},null,k)},g.translateTo=function(A,I,E,k,O){g.transform(A,function(){var j=n.apply(this,arguments),$=this.__zoom,U=k==null?x(j):typeof k=="function"?k.apply(this,arguments):k;return r(En.translate(U[0],U[1]).scale($.k).translate(typeof I=="function"?-I.apply(this,arguments):-I,typeof E=="function"?-E.apply(this,arguments):-E),j,s)},k,O)};function w(A,I){return I=Math.max(a[0],Math.min(a[1],I)),I===A.k?A:new Et(I,A.x,A.y)}function T(A,I,E){var k=I[0]-E[0]*A.k,O=I[1]-E[1]*A.k;return k===A.x&&O===A.y?A:new Et(A.k,k,O)}function x(A){return[(+A[0][0]+ +A[1][0])/2,(+A[0][1]+ +A[1][1])/2]}function b(A,I,E,k){A.on("start.zoom",function(){C(this,arguments).event(k).start()}).on("interrupt.zoom end.zoom",function(){C(this,arguments).event(k).end()}).tween("zoom",function(){var O=this,j=arguments,$=C(O,j).event(k),U=n.apply(O,j),F=E==null?x(U):typeof E=="function"?E.apply(O,j):E,q=Math.max(U[1][0]-U[0][0],U[1][1]-U[0][1]),G=O.__zoom,B=typeof I=="function"?I.apply(O,j):I,J=f(G.invert(F).concat(q/G.k),B.invert(F).concat(q/B.k));return function(Y){if(Y===1)Y=B;else{var at=J(Y),tt=q/at[2];Y=new Et(tt,F[0]-at[0]*tt,F[1]-at[1]*tt)}$.zoom(null,Y)}})}function C(A,I,E){return!E&&A.__zooming||new S(A,I)}function S(A,I){this.that=A,this.args=I,this.active=0,this.sourceEvent=null,this.extent=n.apply(A,I),this.taps=0}S.prototype={event:function(A){return A&&(this.sourceEvent=A),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(A,I){return this.mouse&&A!=="mouse"&&(this.mouse[1]=I.invert(this.mouse[0])),this.touch0&&A!=="touch"&&(this.touch0[1]=I.invert(this.touch0[0])),this.touch1&&A!=="touch"&&(this.touch1[1]=I.invert(this.touch1[0])),this.that.__zoom=I,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(A){var I=pt(this.that).datum();l.call(A,this.that,new wu(A,{sourceEvent:this.sourceEvent,target:g,transform:this.that.__zoom,dispatch:l}),I)}};function M(A,...I){if(!e.apply(this,arguments))return;var E=C(this,I).event(A),k=this.__zoom,O=Math.max(a[0],Math.min(a[1],k.k*Math.pow(2,i.apply(this,arguments)))),j=bt(A);if(E.wheel)(E.mouse[0][0]!==j[0]||E.mouse[0][1]!==j[1])&&(E.mouse[1]=k.invert(E.mouse[0]=j)),clearTimeout(E.wheel);else{if(k.k===O)return;E.mouse=[j,k.invert(j)],Me(this),E.start()}Jt(A),E.wheel=setTimeout($,y),E.zoom("mouse",r(T(w(k,O),E.mouse[0],E.mouse[1]),E.extent,s));function $(){E.wheel=null,E.end()}}function N(A,...I){if(d||!e.apply(this,arguments))return;var E=A.currentTarget,k=C(this,I,!0).event(A),O=pt(A.view).on("mousemove.zoom",F,!0).on("mouseup.zoom",q,!0),j=bt(A,E),$=A.clientX,U=A.clientY;ai(A.view),Ke(A),k.mouse=[j,this.__zoom.invert(j)],Me(this),k.start();function F(G){if(Jt(G),!k.moved){var B=G.clientX-$,J=G.clientY-U;k.moved=B*B+J*J>v}k.event(G).zoom("mouse",r(T(k.that.__zoom,k.mouse[0]=bt(G,E),k.mouse[1]),k.extent,s))}function q(G){O.on("mousemove.zoom mouseup.zoom",null),si(G.view,k.moved),Jt(G),k.event(G).end()}}function P(A,...I){if(e.apply(this,arguments)){var E=this.__zoom,k=bt(A.changedTouches?A.changedTouches[0]:A,this),O=E.invert(k),j=E.k*(A.shiftKey?.5:2),$=r(T(w(E,j),k,O),n.apply(this,I),s);Jt(A),u>0?pt(this).transition().duration(u).call(b,$,k,A):pt(this).call(g.transform,$,k,A)}}function R(A,...I){if(e.apply(this,arguments)){var E=A.touches,k=E.length,O=C(this,I,A.changedTouches.length===k).event(A),j,$,U,F;for(Ke(A),$=0;$=n||S<0||h&&M>=a}function g(){var C=Qe();if(_(C))return w(C);u=setTimeout(g,v(C))}function w(C){return u=void 0,d&&i?p(C):(i=o=void 0,s)}function T(){u!==void 0&&clearTimeout(u),l=0,i=f=o=u=void 0}function x(){return u===void 0?s:w(Qe())}function b(){var C=Qe(),S=_(C);if(i=arguments,o=this,f=C,S){if(u===void 0)return y(f);if(h)return clearTimeout(u),u=setTimeout(g,n),p(f)}return u===void 0&&(u=setTimeout(g,n)),s}return b.cancel=T,b.flush=x,b}var tl="Expected a function";function el(e,n,r){var i=!0,o=!0;if(typeof e!="function")throw new TypeError(tl);return De(r)&&(i="leading"in r?!!r.leading:i,o="trailing"in r?!!r.trailing:o),yi(e,n,{leading:i,maxWait:n,trailing:o})}var Ut=Object.freeze({Linear:Object.freeze({None:function(e){return e},In:function(e){return e},Out:function(e){return e},InOut:function(e){return e}}),Quadratic:Object.freeze({In:function(e){return e*e},Out:function(e){return e*(2-e)},InOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)}}),Cubic:Object.freeze({In:function(e){return e*e*e},Out:function(e){return--e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)}}),Quartic:Object.freeze({In:function(e){return e*e*e*e},Out:function(e){return 1- --e*e*e*e},InOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)}}),Quintic:Object.freeze({In:function(e){return e*e*e*e*e},Out:function(e){return--e*e*e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)}}),Sinusoidal:Object.freeze({In:function(e){return 1-Math.sin((1-e)*Math.PI/2)},Out:function(e){return Math.sin(e*Math.PI/2)},InOut:function(e){return .5*(1-Math.sin(Math.PI*(.5-e)))}}),Exponential:Object.freeze({In:function(e){return e===0?0:Math.pow(1024,e-1)},Out:function(e){return e===1?1:1-Math.pow(2,-10*e)},InOut:function(e){return e===0?0:e===1?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(-Math.pow(2,-10*(e-1))+2)}}),Circular:Object.freeze({In:function(e){return 1-Math.sqrt(1-e*e)},Out:function(e){return Math.sqrt(1- --e*e)},InOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)}}),Elastic:Object.freeze({In:function(e){return e===0?0:e===1?1:-Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI)},Out:function(e){return e===0?0:e===1?1:Math.pow(2,-10*e)*Math.sin((e-.1)*5*Math.PI)+1},InOut:function(e){return e===0?0:e===1?1:(e*=2,e<1?-.5*Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI):.5*Math.pow(2,-10*(e-1))*Math.sin((e-1.1)*5*Math.PI)+1)}}),Back:Object.freeze({In:function(e){var n=1.70158;return e===1?1:e*e*((n+1)*e-n)},Out:function(e){var n=1.70158;return e===0?0:--e*e*((n+1)*e+n)+1},InOut:function(e){var n=2.5949095;return(e*=2)<1?.5*(e*e*((n+1)*e-n)):.5*((e-=2)*e*((n+1)*e+n)+2)}}),Bounce:Object.freeze({In:function(e){return 1-Ut.Bounce.Out(1-e)},Out:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},InOut:function(e){return e<.5?Ut.Bounce.In(e*2)*.5:Ut.Bounce.Out(e*2-1)*.5+.5}}),generatePow:function(e){return e===void 0&&(e=4),e=e1e4?1e4:e,{In:function(n){return Math.pow(n,e)},Out:function(n){return 1-Math.pow(1-n,e)},InOut:function(n){return n<.5?Math.pow(n*2,e)/2:(1-Math.pow(2-n*2,e))/2+.5}}}}),ue=function(){return performance.now()},_i=(function(){function e(){this._tweens={},this._tweensAddedDuringUpdate={}}return e.prototype.getAll=function(){var n=this;return Object.keys(this._tweens).map(function(r){return n._tweens[r]})},e.prototype.removeAll=function(){this._tweens={}},e.prototype.add=function(n){this._tweens[n.getId()]=n,this._tweensAddedDuringUpdate[n.getId()]=n},e.prototype.remove=function(n){delete this._tweens[n.getId()],delete this._tweensAddedDuringUpdate[n.getId()]},e.prototype.update=function(n,r){n===void 0&&(n=ue()),r===void 0&&(r=!1);var i=Object.keys(this._tweens);if(i.length===0)return!1;for(;i.length>0;){this._tweensAddedDuringUpdate={};for(var o=0;o1?a(e[r],e[r-1],r-i):a(e[o],e[o+1>r?r:o+1],i-o)},Utils:{Linear:function(e,n,r){return(n-e)*r+e}}},vi=(function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e})(),yn=new _i,ur=(function(){function e(n,r){r===void 0&&(r=yn),this._object=n,this._group=r,this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=Ut.Linear.None,this._interpolationFunction=gn.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=vi.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1}return e.prototype.getId=function(){return this._id},e.prototype.isPlaying=function(){return this._isPlaying},e.prototype.isPaused=function(){return this._isPaused},e.prototype.getDuration=function(){return this._duration},e.prototype.to=function(n,r){if(r===void 0&&(r=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=n,this._propertiesAreSetUp=!1,this._duration=r<0?0:r,this},e.prototype.duration=function(n){return n===void 0&&(n=1e3),this._duration=n<0?0:n,this},e.prototype.dynamic=function(n){return n===void 0&&(n=!1),this._isDynamic=n,this},e.prototype.start=function(n,r){if(n===void 0&&(n=ue()),r===void 0&&(r=!1),this._isPlaying)return this;if(this._group&&this._group.add(this),this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(var i in this._valuesStartRepeat)this._swapEndStartRepeatValues(i),this._valuesStart[i]=this._valuesStartRepeat[i]}if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=n,this._startTime+=this._delayTime,!this._propertiesAreSetUp||r){if(this._propertiesAreSetUp=!0,!this._isDynamic){var o={};for(var a in this._valuesEnd)o[a]=this._valuesEnd[a];this._valuesEnd=o}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,r)}return this},e.prototype.startFromCurrentValues=function(n){return this.start(n,!0)},e.prototype._setupProperties=function(n,r,i,o,a){for(var s in i){var u=n[s],f=Array.isArray(u),l=f?"array":typeof u,c=!f&&Array.isArray(i[s]);if(!(l==="undefined"||l==="function")){if(c){var h=i[s];if(h.length===0)continue;for(var d=[u],p=0,y=h.length;p"u"||a)&&(r[s]=u),f||(r[s]*=1),c?o[s]=i[s].slice().reverse():o[s]=r[s]||0}}},e.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._group&&this._group.remove(this),this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},e.prototype.end=function(){return this._goToEnd=!0,this.update(1/0),this},e.prototype.pause=function(n){return n===void 0&&(n=ue()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=n,this._group&&this._group.remove(this),this)},e.prototype.resume=function(n){return n===void 0&&(n=ue()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=n-this._pauseStart,this._pauseStart=0,this._group&&this._group.add(this),this)},e.prototype.stopChainedTweens=function(){for(var n=0,r=this._chainedTweens.length;ns)return!1;r&&this.start(n,!0)}if(this._goToEnd=!1,nl)return 1;var _=Math.trunc(u/f),g=u-_*f,w=Math.min(g/i._duration,1);return w===0&&u===i._duration?1:w},h=c(),d=this._easingFunction(h);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,d),this._onUpdateCallback&&this._onUpdateCallback(this._object,h),this._duration===0||u>=this._duration)if(this._repeat>0){var p=Math.min(Math.trunc((u-this._duration)/f)+1,this._repeat);isFinite(this._repeat)&&(this._repeat-=p);for(a in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[a]=="string"&&(this._valuesStartRepeat[a]=this._valuesStartRepeat[a]+parseFloat(this._valuesEnd[a])),this._yoyo&&this._swapEndStartRepeatValues(a),this._valuesStart[a]=this._valuesStartRepeat[a];return this._yoyo&&(this._reversed=!this._reversed),this._startTime+=f*p,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var y=0,v=this._chainedTweens.length;ye.length)&&(n=e.length);for(var r=0,i=Array(n);r=0,a=!r&&o&&(n==="hex"||n==="hex6"||n==="hex3"||n==="hex4"||n==="hex8"||n==="name");return a?n==="name"&&this._a===0?this.toName():this.toRgbString():(n==="rgb"&&(i=this.toRgbString()),n==="prgb"&&(i=this.toPercentageRgbString()),(n==="hex"||n==="hex6")&&(i=this.toHexString()),n==="hex3"&&(i=this.toHexString(!0)),n==="hex4"&&(i=this.toHex8String(!0)),n==="hex8"&&(i=this.toHex8String()),n==="name"&&(i=this.toName()),n==="hsl"&&(i=this.toHslString()),n==="hsv"&&(i=this.toHsvString()),i||this.toHexString())},clone:function(){return H(this.toString())},_applyModification:function(n,r){var i=n.apply(null,[this].concat([].slice.call(r)));return this._r=i._r,this._g=i._g,this._b=i._b,this.setAlpha(i._a),this},lighten:function(){return this._applyModification(bl,arguments)},brighten:function(){return this._applyModification(xl,arguments)},darken:function(){return this._applyModification(wl,arguments)},desaturate:function(){return this._applyModification(_l,arguments)},saturate:function(){return this._applyModification(vl,arguments)},greyscale:function(){return this._applyModification(ml,arguments)},spin:function(){return this._applyModification(kl,arguments)},_applyCombination:function(n,r){return n.apply(null,[this].concat([].slice.call(r)))},analogous:function(){return this._applyCombination(Sl,arguments)},complement:function(){return this._applyCombination(Cl,arguments)},monochromatic:function(){return this._applyCombination(Tl,arguments)},splitcomplement:function(){return this._applyCombination(Al,arguments)},triad:function(){return this._applyCombination(pr,[3])},tetrad:function(){return this._applyCombination(pr,[4])}};H.fromRatio=function(e,n){if(je(e)=="object"){var r={};for(var i in e)e.hasOwnProperty(i)&&(i==="a"?r[i]=e[i]:r[i]=le(e[i]));e=r}return H(e,n)};function hl(e){var n={r:0,g:0,b:0},r=1,i=null,o=null,a=null,s=!1,u=!1;return typeof e=="string"&&(e=zl(e)),je(e)=="object"&&(Tt(e.r)&&Tt(e.g)&&Tt(e.b)?(n=dl(e.r,e.g,e.b),s=!0,u=String(e.r).substr(-1)==="%"?"prgb":"rgb"):Tt(e.h)&&Tt(e.s)&&Tt(e.v)?(i=le(e.s),o=le(e.v),n=gl(e.h,i,o),s=!0,u="hsv"):Tt(e.h)&&Tt(e.s)&&Tt(e.l)&&(i=le(e.s),a=le(e.l),n=pl(e.h,i,a),s=!0,u="hsl"),e.hasOwnProperty("a")&&(r=e.a)),r=mi(r),{ok:s,format:e.format||u,r:Math.min(255,Math.max(n.r,0)),g:Math.min(255,Math.max(n.g,0)),b:Math.min(255,Math.max(n.b,0)),a:r}}function dl(e,n,r){return{r:K(e,255)*255,g:K(n,255)*255,b:K(r,255)*255}}function fr(e,n,r){e=K(e,255),n=K(n,255),r=K(r,255);var i=Math.max(e,n,r),o=Math.min(e,n,r),a,s,u=(i+o)/2;if(i==o)a=s=0;else{var f=i-o;switch(s=u>.5?f/(2-i-o):f/(i+o),i){case e:a=(n-r)/f+(n1&&(h-=1),h<1/6?l+(c-l)*6*h:h<1/2?c:h<2/3?l+(c-l)*(2/3-h)*6:l}if(n===0)i=o=a=r;else{var u=r<.5?r*(1+n):r+n-r*n,f=2*r-u;i=s(f,u,e+1/3),o=s(f,u,e),a=s(f,u,e-1/3)}return{r:i*255,g:o*255,b:a*255}}function cr(e,n,r){e=K(e,255),n=K(n,255),r=K(r,255);var i=Math.max(e,n,r),o=Math.min(e,n,r),a,s,u=i,f=i-o;if(s=i===0?0:f/i,i==o)a=0;else{switch(i){case e:a=(n-r)/f+(n>1)+720)%360;--n;)i.h=(i.h+o)%360,a.push(H(i));return a}function Tl(e,n){n=n||6;for(var r=H(e).toHsv(),i=r.h,o=r.s,a=r.v,s=[],u=1/n;n--;)s.push(H({h:i,s:o,v:a})),a=(a+u)%1;return s}H.mix=function(e,n,r){r=r===0?0:r||50;var i=H(e).toRgb(),o=H(n).toRgb(),a=r/100,s={r:(o.r-i.r)*a+i.r,g:(o.g-i.g)*a+i.g,b:(o.b-i.b)*a+i.b,a:(o.a-i.a)*a+i.a};return H(s)};H.readability=function(e,n){var r=H(e),i=H(n);return(Math.max(r.getLuminance(),i.getLuminance())+.05)/(Math.min(r.getLuminance(),i.getLuminance())+.05)};H.isReadable=function(e,n,r){var i=H.readability(e,n),o,a;switch(a=!1,o=Rl(r),o.level+o.size){case"AAsmall":case"AAAlarge":a=i>=4.5;break;case"AAlarge":a=i>=3;break;case"AAAsmall":a=i>=7;break}return a};H.mostReadable=function(e,n,r){var i=null,o=0,a,s,u,f;r=r||{},s=r.includeFallbackColors,u=r.level,f=r.size;for(var l=0;lo&&(o=a,i=H(n[l]));return H.isReadable(e,i,{level:u,size:f})||!s?i:(r.includeFallbackColors=!1,H.mostReadable(e,["#fff","#000"],r))};var _n=H.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},Ml=H.hexNames=Pl(_n);function Pl(e){var n={};for(var r in e)e.hasOwnProperty(r)&&(n[e[r]]=r);return n}function mi(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function K(e,n){Ol(e)&&(e="100%");var r=El(e);return e=Math.min(n,Math.max(0,parseFloat(e))),r&&(e=parseInt(e*n,10)/100),Math.abs(e-n)<1e-6?1:e%n/parseFloat(n)}function We(e){return Math.min(1,Math.max(0,e))}function ft(e){return parseInt(e,16)}function Ol(e){return typeof e=="string"&&e.indexOf(".")!=-1&&parseFloat(e)===1}function El(e){return typeof e=="string"&&e.indexOf("%")!=-1}function _t(e){return e.length==1?"0"+e:""+e}function le(e){return e<=1&&(e=e*100+"%"),e}function bi(e){return Math.round(parseFloat(e)*255).toString(16)}function gr(e){return ft(e)/255}var yt=(function(){var e="[-\\+]?\\d+%?",n="[-\\+]?\\d*\\.\\d+%?",r="(?:"+n+")|(?:"+e+")",i="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?",o="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?";return{CSS_UNIT:new RegExp(r),rgb:new RegExp("rgb"+i),rgba:new RegExp("rgba"+o),hsl:new RegExp("hsl"+i),hsla:new RegExp("hsla"+o),hsv:new RegExp("hsv"+i),hsva:new RegExp("hsva"+o),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}})();function Tt(e){return!!yt.CSS_UNIT.exec(e)}function zl(e){e=e.replace(fl,"").replace(cl,"").toLowerCase();var n=!1;if(_n[e])e=_n[e],n=!0;else if(e=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var r;return(r=yt.rgb.exec(e))?{r:r[1],g:r[2],b:r[3]}:(r=yt.rgba.exec(e))?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=yt.hsl.exec(e))?{h:r[1],s:r[2],l:r[3]}:(r=yt.hsla.exec(e))?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=yt.hsv.exec(e))?{h:r[1],s:r[2],v:r[3]}:(r=yt.hsva.exec(e))?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=yt.hex8.exec(e))?{r:ft(r[1]),g:ft(r[2]),b:ft(r[3]),a:gr(r[4]),format:n?"name":"hex8"}:(r=yt.hex6.exec(e))?{r:ft(r[1]),g:ft(r[2]),b:ft(r[3]),format:n?"name":"hex"}:(r=yt.hex4.exec(e))?{r:ft(r[1]+""+r[1]),g:ft(r[2]+""+r[2]),b:ft(r[3]+""+r[3]),a:gr(r[4]+""+r[4]),format:n?"name":"hex8"}:(r=yt.hex3.exec(e))?{r:ft(r[1]+""+r[1]),g:ft(r[2]+""+r[2]),b:ft(r[3]+""+r[3]),format:n?"name":"hex"}:!1}function Rl(e){var n,r;return e=e||{level:"AA",size:"small"},n=(e.level||"AA").toUpperCase(),r=(e.size||"small").toLowerCase(),n!=="AA"&&n!=="AAA"&&(n="AA"),r!=="small"&&r!=="large"&&(r="small"),{level:n,size:r}}function vn(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,i=Array(n);ri.map(i=>d[i]); -var je=Object.defineProperty;var ke=(d,i,c)=>i in d?je(d,i,{enumerable:!0,configurable:!0,writable:!0,value:c}):d[i]=c;var J=(d,i,c)=>ke(d,typeof i!="symbol"?i+"":i,c);import{c as h,r as s,j as e,u as ve,b as Ne,O as W,Q as Se,C as X,R as Ce,S as Ee,P as Me,U as O,e as x,V as ze,W as De,X as Z,A as Y,_ as Oe,g as j}from"./index-Cpokgrtb.js";import{C as ee}from"./copy-HOrvM3LI.js";import{S as _e}from"./send-grypp2_x.js";import{B as Ge}from"./book-open-BfZKBC8k.js";/** +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/GraphView-4Mi6huEE.js","assets/index-CYprWjkZ.js","assets/index-ioa0JrEi.css"])))=>i.map(i=>d[i]); +var je=Object.defineProperty;var ke=(d,i,c)=>i in d?je(d,i,{enumerable:!0,configurable:!0,writable:!0,value:c}):d[i]=c;var J=(d,i,c)=>ke(d,typeof i!="symbol"?i+"":i,c);import{c as h,r as s,j as e,u as ve,b as Ne,O as W,Q as Se,C as X,R as Ce,S as Ee,P as Me,U as O,e as x,V as ze,W as De,X as Z,A as Y,_ as Oe,g as j}from"./index-CYprWjkZ.js";import{C as ee}from"./copy-ZerQbIeQ.js";import{S as _e}from"./send-CjExvNpv.js";import{B as Ge}from"./book-open-cVx_1TDg.js";/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -34,7 +34,7 @@ var je=Object.defineProperty;var ke=(d,i,c)=>i in d?je(d,i,{enumerable:!0,config * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Pe=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 te extends s.Component{constructor(){super(...arguments);J(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 se=s.lazy(()=>Oe(()=>import("./GraphView-BjVVXu3Y.js"),__vite__mapDeps([0,1,2])).then(d=>({default:d.GraphView}))),k=["identity","knowledge","rules","events"],v=new Set(["auto","agent","hermes"]),N={identity:{label:"Identität",icon:Pe,bg:"bg-cyan-500/10",text:"text-cyan-400"},knowledge:{label:"Wissen",icon:De,bg:"bg-indigo-500/10",text:"text-indigo-400"},rules:{label:"Regeln",icon:Le,bg:"bg-violet-500/10",text:"text-violet-400"},events:{label:"Ereignisse",icon:ze,bg:"bg-amber-500/10",text:"text-amber-400"}},ne={label:"Gedächtnis",icon:Ge,text:"text-muted-foreground"},Re={identity:"border-l-cyan-500/80",knowledge:"border-l-indigo-500/80",rules:"border-l-violet-500/80",events:"border-l-amber-500/80"},_={identity:"#00f5ff",knowledge:"#3b82f6",rules:"#d946ef",events:"#fbbf24"},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: + */const Pe=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 te extends s.Component{constructor(){super(...arguments);J(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 se=s.lazy(()=>Oe(()=>import("./GraphView-4Mi6huEE.js"),__vite__mapDeps([0,1,2])).then(d=>({default:d.GraphView}))),k=["identity","knowledge","rules","events"],v=new Set(["auto","agent","hermes"]),N={identity:{label:"Identität",icon:Pe,bg:"bg-cyan-500/10",text:"text-cyan-400"},knowledge:{label:"Wissen",icon:De,bg:"bg-indigo-500/10",text:"text-indigo-400"},rules:{label:"Regeln",icon:Le,bg:"bg-violet-500/10",text:"text-violet-400"},events:{label:"Ereignisse",icon:ze,bg:"bg-amber-500/10",text:"text-amber-400"}},ne={label:"Gedächtnis",icon:Ge,text:"text-muted-foreground"},Re={identity:"border-l-cyan-500/80",knowledge:"border-l-indigo-500/80",rules:"border-l-violet-500/80",events:"border-l-amber-500/80"},_={identity:"#00f5ff",knowledge:"#3b82f6",rules:"#d946ef",events:"#fbbf24"},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, diff --git a/frontend/dist/assets/ModelsView-DRiKlRjv.js b/frontend/dist/assets/ModelsView-D0ujmpST.js similarity index 99% rename from frontend/dist/assets/ModelsView-DRiKlRjv.js rename to frontend/dist/assets/ModelsView-D0ujmpST.js index 9eb5daa..2711235 100644 --- a/frontend/dist/assets/ModelsView-DRiKlRjv.js +++ b/frontend/dist/assets/ModelsView-D0ujmpST.js @@ -1,4 +1,4 @@ -import{c as E,u as oe,a as Fe,b as ge,j as e,f as ue,d as Re,e as w,g as K,q as P,h as Ie,r as N,C as Y,L as Oe,i as Pe,B as le,k as Te,E as Be,l as de,m as Ge,n as $e,o as He,p as ee,X as pe,P as Qe,H as fe,T as re,s as Ue,t as Ve,v as V,w as We,S as ye,x as Ze,y as Je,z as Xe,A as Ye,D as De,F as et,G as tt}from"./index-Cpokgrtb.js";import{C as rt}from"./code-xml-Bcfg4oSP.js";import{R as st}from"./rotate-ccw-wHFM0h2t.js";import{C as he,Z as ie,L as nt,a as at}from"./zap-Bc_35rOi.js";import{L as ot}from"./layers-CMPjDrtd.js";/** +import{c as E,u as oe,a as Fe,b as ge,j as e,f as ue,d as Re,e as w,g as K,q as P,h as Ie,r as N,C as Y,L as Oe,i as Pe,B as le,k as Te,E as Be,l as de,m as Ge,n as $e,o as He,p as ee,X as pe,P as Qe,H as fe,T as re,s as Ue,t as Ve,v as V,w as We,S as ye,x as Ze,y as Je,z as Xe,A as Ye,D as De,F as et,G as tt}from"./index-CYprWjkZ.js";import{C as rt}from"./code-xml-DFsBpkB8.js";import{R as st}from"./rotate-ccw-CXI0Tldw.js";import{C as he,Z as ie,L as nt,a as at}from"./zap-hBXNCtdw.js";import{L as ot}from"./layers-BVmbzkl8.js";/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/WissenView-BfvotQrk.js b/frontend/dist/assets/WissenView-C7GDdv1b.js similarity index 98% rename from frontend/dist/assets/WissenView-BfvotQrk.js rename to frontend/dist/assets/WissenView-C7GDdv1b.js index 902d373..5cea876 100644 --- a/frontend/dist/assets/WissenView-BfvotQrk.js +++ b/frontend/dist/assets/WissenView-C7GDdv1b.js @@ -1,4 +1,4 @@ -import{ap as y,r as x,g as L,j as e,L as v,S,ae as W,U as C,e as w,aq as E}from"./index-Cpokgrtb.js";import{F as M}from"./folder-open-J5CPCk3B.js";const D={"":"Allgemein",traeume:"Träume",muster:"Muster","skill-kandidaten":"Skill-Kandidaten","skill-kandidaten/beauftragt":"Skill-Kandidaten · beauftragt","skill-kandidaten/verworfen":"Skill-Kandidaten · verworfen"};function T(){const{data:o,isLoading:h}=y(),[l,f]=x.useState(null),[d,r]=x.useState(null),[u,i]=x.useState(!1),[a,p]=x.useState(""),t=x.useMemo(()=>(o==null?void 0:o.files)??[],[o]),m=x.useMemo(()=>{const s=new Map;for(const n of t)s.set(n.name.toLowerCase(),n.path);return s},[t]),g=x.useMemo(()=>{if(!a.trim())return t;const s=a.toLowerCase();return t.filter(n=>n.title.toLowerCase().includes(s)||n.path.toLowerCase().includes(s))},[t,a]),b=x.useMemo(()=>{const s=[];for(const n of g){const c=s.find(k=>k.dir===n.dir);c?c.files.push(n):s.push({dir:n.dir,files:[n]})}return s.sort((n,c)=>n.dir===""?-1:c.dir===""?1:n.dir.localeCompare(c.dir))},[g]);x.useEffect(()=>{if(!l&&t.length){const s=t.find(n=>n.path.toLowerCase()==="index.md");f((s==null?void 0:s.path)??t[0].path)}},[t,l]),x.useEffect(()=>{l&&(i(!0),L(`/api/wissen/datei?pfad=${encodeURIComponent(l)}`).then(r).catch(()=>r({path:l,content:"*(Notiz nicht ladbar)*",mtime:0})).finally(()=>i(!1)))},[l]);const j=s=>{const n=m.get(s.toLowerCase());n&&f(n)};return e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"bg-gradient-to-r from-foreground via-foreground to-primary bg-clip-text font-space text-2xl font-bold tracking-tight text-transparent",children:"Wissen"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Was sich die Box nachts erschließt — Traum-Notizen, Muster und Skill-Ideen aus dem Wissens-Vault, verlinkt wie ein Wiki."})]}),o&&!o.available&&e.jsx("div",{className:"rounded-2xl border border-amber-500/30 bg-amber-500/5 p-4 text-xs text-amber-300",children:"Der Wissens-Vault liegt auf der Box (~/wissens-vault) — im lokalen Dev-Modus nicht verfügbar."}),h&&e.jsxs("div",{className:"flex items-center gap-2 rounded-2xl border border-border/60 bg-card/30 p-6 text-xs text-muted-foreground",children:[e.jsx(v,{className:"h-4 w-4 animate-spin"})," Vault wird geladen …"]}),(o==null?void 0:o.available)&&t.length===0&&e.jsx("div",{className:"rounded-2xl border border-dashed border-border/60 bg-card/20 p-8 text-center text-xs text-muted-foreground",children:"Noch keine Notizen. Der nächtliche Traum (03:15) legt sie an — morgen früh steht hier die erste."}),t.length>0&&e.jsxs("div",{className:"flex flex-col gap-4 lg:flex-row",children:[e.jsxs("aside",{className:"w-full shrink-0 space-y-3 lg:w-72",children:[e.jsxs("div",{className:"relative",children:[e.jsx("input",{value:a,onChange:s=>p(s.target.value),type:"search",placeholder:"Notizen durchsuchen…","aria-label":"Notizen durchsuchen",className:"h-9 w-full rounded-lg border border-border/60 bg-card/45 pl-8 pr-3 text-xs text-foreground outline-none focus:ring-1 focus:ring-primary/50"}),e.jsx(S,{className:"absolute left-2.5 top-2.5 h-3.5 w-3.5 text-muted-foreground"})]}),e.jsx("div",{className:"max-h-[70vh] space-y-3 overflow-y-auto pr-1 scrollbar-thin",children:b.map(({dir:s,files:n})=>e.jsxs("div",{children:[e.jsxs("p",{className:"mb-1 flex items-center gap-1 text-[10px] font-bold uppercase tracking-wider text-muted-foreground/60",children:[e.jsx(M,{className:"h-3 w-3"})," ",D[s]??s]}),e.jsx("div",{className:"space-y-0.5",children:n.map(c=>e.jsxs("button",{onClick:()=>f(c.path),className:w("flex w-full items-center gap-1.5 rounded-lg px-2 py-1.5 text-left text-xs transition-all cursor-pointer",l===c.path?"bg-primary/15 text-primary":"text-muted-foreground hover:bg-accent hover:text-foreground"),children:[e.jsx(W,{className:"h-3.5 w-3.5 shrink-0"}),e.jsx("span",{className:"truncate",title:c.title,children:c.name}),c.neu&&e.jsxs("span",{className:"ml-auto flex items-center gap-0.5 rounded bg-violet-500/15 px-1 py-0.5 text-[8px] font-bold uppercase text-violet-300",children:[e.jsx(C,{className:"h-2.5 w-2.5"}),"neu"]})]},c.path))})]},s||"__root"))})]}),e.jsx("div",{className:"min-w-0 flex-1 mc-card p-5",children:u?e.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[e.jsx(v,{className:"h-4 w-4 animate-spin"})," Notiz wird geladen …"]}):d?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"mb-3 flex items-center justify-between border-b border-border/40 pb-2",children:[e.jsxs("span",{className:"flex items-center gap-1.5 font-mono text-[11px] text-muted-foreground",children:[e.jsx(E,{className:"h-3.5 w-3.5"})," ",d.path]}),d.mtime>0&&e.jsxs("span",{className:"text-[10px] text-muted-foreground/60",children:["Stand ",new Date(d.mtime*1e3).toLocaleString("de-DE",{day:"2-digit",month:"2-digit",hour:"2-digit",minute:"2-digit"})]})]}),e.jsx(z,{text:d.content,onWikiLink:j,known:m})]}):null})]})]})}function z({text:o,onWikiLink:h,known:l}){const f=o.split(` +import{ap as y,r as x,g as L,j as e,L as v,S,ae as W,U as C,e as w,aq as E}from"./index-CYprWjkZ.js";import{F as M}from"./folder-open-qsFqfA7z.js";const D={"":"Allgemein",traeume:"Träume",muster:"Muster","skill-kandidaten":"Skill-Kandidaten","skill-kandidaten/beauftragt":"Skill-Kandidaten · beauftragt","skill-kandidaten/verworfen":"Skill-Kandidaten · verworfen"};function T(){const{data:o,isLoading:h}=y(),[l,f]=x.useState(null),[d,r]=x.useState(null),[u,i]=x.useState(!1),[a,p]=x.useState(""),t=x.useMemo(()=>(o==null?void 0:o.files)??[],[o]),m=x.useMemo(()=>{const s=new Map;for(const n of t)s.set(n.name.toLowerCase(),n.path);return s},[t]),g=x.useMemo(()=>{if(!a.trim())return t;const s=a.toLowerCase();return t.filter(n=>n.title.toLowerCase().includes(s)||n.path.toLowerCase().includes(s))},[t,a]),b=x.useMemo(()=>{const s=[];for(const n of g){const c=s.find(k=>k.dir===n.dir);c?c.files.push(n):s.push({dir:n.dir,files:[n]})}return s.sort((n,c)=>n.dir===""?-1:c.dir===""?1:n.dir.localeCompare(c.dir))},[g]);x.useEffect(()=>{if(!l&&t.length){const s=t.find(n=>n.path.toLowerCase()==="index.md");f((s==null?void 0:s.path)??t[0].path)}},[t,l]),x.useEffect(()=>{l&&(i(!0),L(`/api/wissen/datei?pfad=${encodeURIComponent(l)}`).then(r).catch(()=>r({path:l,content:"*(Notiz nicht ladbar)*",mtime:0})).finally(()=>i(!1)))},[l]);const j=s=>{const n=m.get(s.toLowerCase());n&&f(n)};return e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"bg-gradient-to-r from-foreground via-foreground to-primary bg-clip-text font-space text-2xl font-bold tracking-tight text-transparent",children:"Wissen"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Was sich die Box nachts erschließt — Traum-Notizen, Muster und Skill-Ideen aus dem Wissens-Vault, verlinkt wie ein Wiki."})]}),o&&!o.available&&e.jsx("div",{className:"rounded-2xl border border-amber-500/30 bg-amber-500/5 p-4 text-xs text-amber-300",children:"Der Wissens-Vault liegt auf der Box (~/wissens-vault) — im lokalen Dev-Modus nicht verfügbar."}),h&&e.jsxs("div",{className:"flex items-center gap-2 rounded-2xl border border-border/60 bg-card/30 p-6 text-xs text-muted-foreground",children:[e.jsx(v,{className:"h-4 w-4 animate-spin"})," Vault wird geladen …"]}),(o==null?void 0:o.available)&&t.length===0&&e.jsx("div",{className:"rounded-2xl border border-dashed border-border/60 bg-card/20 p-8 text-center text-xs text-muted-foreground",children:"Noch keine Notizen. Der nächtliche Traum (03:15) legt sie an — morgen früh steht hier die erste."}),t.length>0&&e.jsxs("div",{className:"flex flex-col gap-4 lg:flex-row",children:[e.jsxs("aside",{className:"w-full shrink-0 space-y-3 lg:w-72",children:[e.jsxs("div",{className:"relative",children:[e.jsx("input",{value:a,onChange:s=>p(s.target.value),type:"search",placeholder:"Notizen durchsuchen…","aria-label":"Notizen durchsuchen",className:"h-9 w-full rounded-lg border border-border/60 bg-card/45 pl-8 pr-3 text-xs text-foreground outline-none focus:ring-1 focus:ring-primary/50"}),e.jsx(S,{className:"absolute left-2.5 top-2.5 h-3.5 w-3.5 text-muted-foreground"})]}),e.jsx("div",{className:"max-h-[70vh] space-y-3 overflow-y-auto pr-1 scrollbar-thin",children:b.map(({dir:s,files:n})=>e.jsxs("div",{children:[e.jsxs("p",{className:"mb-1 flex items-center gap-1 text-[10px] font-bold uppercase tracking-wider text-muted-foreground/60",children:[e.jsx(M,{className:"h-3 w-3"})," ",D[s]??s]}),e.jsx("div",{className:"space-y-0.5",children:n.map(c=>e.jsxs("button",{onClick:()=>f(c.path),className:w("flex w-full items-center gap-1.5 rounded-lg px-2 py-1.5 text-left text-xs transition-all cursor-pointer",l===c.path?"bg-primary/15 text-primary":"text-muted-foreground hover:bg-accent hover:text-foreground"),children:[e.jsx(W,{className:"h-3.5 w-3.5 shrink-0"}),e.jsx("span",{className:"truncate",title:c.title,children:c.name}),c.neu&&e.jsxs("span",{className:"ml-auto flex items-center gap-0.5 rounded bg-violet-500/15 px-1 py-0.5 text-[8px] font-bold uppercase text-violet-300",children:[e.jsx(C,{className:"h-2.5 w-2.5"}),"neu"]})]},c.path))})]},s||"__root"))})]}),e.jsx("div",{className:"min-w-0 flex-1 mc-card p-5",children:u?e.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[e.jsx(v,{className:"h-4 w-4 animate-spin"})," Notiz wird geladen …"]}):d?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"mb-3 flex items-center justify-between border-b border-border/40 pb-2",children:[e.jsxs("span",{className:"flex items-center gap-1.5 font-mono text-[11px] text-muted-foreground",children:[e.jsx(E,{className:"h-3.5 w-3.5"})," ",d.path]}),d.mtime>0&&e.jsxs("span",{className:"text-[10px] text-muted-foreground/60",children:["Stand ",new Date(d.mtime*1e3).toLocaleString("de-DE",{day:"2-digit",month:"2-digit",hour:"2-digit",minute:"2-digit"})]})]}),e.jsx(z,{text:d.content,onWikiLink:j,known:m})]}):null})]})]})}function z({text:o,onWikiLink:h,known:l}){const f=o.split(` `),d=[];let r=[],u=null;const i=a=>{r.length&&(d.push(e.jsx("ul",{className:"mb-3 ml-4 list-disc space-y-1",children:r},a)),r=[])};return f.forEach((a,p)=>{const t=`l${p}`;if(u!==null){a.trimEnd()==="```"?(d.push(e.jsx("pre",{className:"mb-3 overflow-x-auto rounded-xl border border-border/50 bg-background/50 p-3 font-mono text-[11px] leading-relaxed text-foreground/85",children:u.join(` `)},t)),u=null):u.push(a);return}if(a.trimStart().startsWith("```")){i(t),u=[];return}const m=a.trimEnd();if(!m.trim()){i(t);return}const g=m.match(/^(#{1,4})\s+(.*)$/);if(g){i(t);const j=g[1].length,s=j===1?"text-lg font-bold mt-1 mb-3":j===2?"text-base font-bold mt-4 mb-2":"text-sm font-bold mt-3 mb-1.5";d.push(e.jsx("p",{className:w(s,"font-space text-foreground"),children:N(g[2],h,l,t)},t));return}const b=m.match(/^\s*[-*•]\s+(.*)$/);if(b){r.push(e.jsx("li",{className:"text-xs leading-relaxed text-foreground/85",children:N(b[1],h,l,t)},t));return}i(t),d.push(e.jsx("p",{className:"mb-2 text-xs leading-relaxed text-foreground/85",children:N(m,h,l,t)},t))}),i("end"),u!==null&&d.push(e.jsx("pre",{className:"mb-3 overflow-x-auto rounded-xl border border-border/50 bg-background/50 p-3 font-mono text-[11px]",children:u.join(` `)},"code-end")),e.jsx("div",{className:"max-w-3xl",children:d})}function N(o,h,l,f){return o.split(/(\[\[[^\]]+\]\]|\*\*[^*]+\*\*|\*[^*]+\*|`[^`]+`)/g).map((r,u)=>{const i=`${f}-${u}`,a=r.match(/^\[\[([^\]|]+)(?:\|([^\]]+))?\]\]$/);if(a){const p=a[1].trim(),t=(a[2]??a[1]).trim();return l.has(p.toLowerCase())?e.jsx("button",{onClick:()=>h(p),className:"rounded bg-primary/10 px-1 text-primary underline decoration-primary/40 underline-offset-2 hover:bg-primary/20 cursor-pointer",children:t},i):e.jsx("span",{className:"rounded bg-background/40 px-1 text-muted-foreground",title:"Notiz existiert (noch) nicht",children:t},i)}return r.startsWith("**")&&r.endsWith("**")?e.jsx("b",{className:"font-semibold text-foreground",children:r.slice(2,-2)},i):r.startsWith("*")&&r.endsWith("*")&&r.length>2?e.jsx("i",{children:r.slice(1,-1)},i):r.startsWith("`")&&r.endsWith("`")?e.jsx("code",{className:"rounded bg-background/50 px-1 font-mono text-[11px] text-teal-300",children:r.slice(1,-1)},i):e.jsx("span",{children:r},i)})}export{T as WissenView}; diff --git a/frontend/dist/assets/book-open-BfZKBC8k.js b/frontend/dist/assets/book-open-cVx_1TDg.js similarity index 90% rename from frontend/dist/assets/book-open-BfZKBC8k.js rename to frontend/dist/assets/book-open-cVx_1TDg.js index f05c657..40f55d3 100644 --- a/frontend/dist/assets/book-open-BfZKBC8k.js +++ b/frontend/dist/assets/book-open-cVx_1TDg.js @@ -1,4 +1,4 @@ -import{c as a}from"./index-Cpokgrtb.js";/** +import{c as a}from"./index-CYprWjkZ.js";/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/circle-x-Cjrbyjns.js b/frontend/dist/assets/circle-x-D1J1uP0I.js similarity index 89% rename from frontend/dist/assets/circle-x-Cjrbyjns.js rename to frontend/dist/assets/circle-x-D1J1uP0I.js index 4e1ac16..24da994 100644 --- a/frontend/dist/assets/circle-x-Cjrbyjns.js +++ b/frontend/dist/assets/circle-x-D1J1uP0I.js @@ -1,4 +1,4 @@ -import{c}from"./index-Cpokgrtb.js";/** +import{c}from"./index-CYprWjkZ.js";/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/code-xml-Bcfg4oSP.js b/frontend/dist/assets/code-xml-DFsBpkB8.js similarity index 88% rename from frontend/dist/assets/code-xml-Bcfg4oSP.js rename to frontend/dist/assets/code-xml-DFsBpkB8.js index 3919f09..05edcf0 100644 --- a/frontend/dist/assets/code-xml-Bcfg4oSP.js +++ b/frontend/dist/assets/code-xml-DFsBpkB8.js @@ -1,4 +1,4 @@ -import{c as e}from"./index-Cpokgrtb.js";/** +import{c as e}from"./index-CYprWjkZ.js";/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/copy-HOrvM3LI.js b/frontend/dist/assets/copy-ZerQbIeQ.js similarity index 90% rename from frontend/dist/assets/copy-HOrvM3LI.js rename to frontend/dist/assets/copy-ZerQbIeQ.js index 839744e..8ed6102 100644 --- a/frontend/dist/assets/copy-HOrvM3LI.js +++ b/frontend/dist/assets/copy-ZerQbIeQ.js @@ -1,4 +1,4 @@ -import{c}from"./index-Cpokgrtb.js";/** +import{c}from"./index-CYprWjkZ.js";/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/folder-open-J5CPCk3B.js b/frontend/dist/assets/folder-open-qsFqfA7z.js similarity index 90% rename from frontend/dist/assets/folder-open-J5CPCk3B.js rename to frontend/dist/assets/folder-open-qsFqfA7z.js index 788b6ec..15b7d9d 100644 --- a/frontend/dist/assets/folder-open-J5CPCk3B.js +++ b/frontend/dist/assets/folder-open-qsFqfA7z.js @@ -1,4 +1,4 @@ -import{c as a}from"./index-Cpokgrtb.js";/** +import{c as a}from"./index-CYprWjkZ.js";/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/index-Cpokgrtb.js b/frontend/dist/assets/index-CYprWjkZ.js similarity index 99% rename from frontend/dist/assets/index-Cpokgrtb.js rename to frontend/dist/assets/index-CYprWjkZ.js index c361e71..b9423d2 100644 --- a/frontend/dist/assets/index-Cpokgrtb.js +++ b/frontend/dist/assets/index-CYprWjkZ.js @@ -1,4 +1,4 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ModelsView-DRiKlRjv.js","assets/code-xml-Bcfg4oSP.js","assets/rotate-ccw-wHFM0h2t.js","assets/zap-Bc_35rOi.js","assets/layers-CMPjDrtd.js","assets/ConnectView-u_EPDy1I.js","assets/folder-open-J5CPCk3B.js","assets/circle-x-Cjrbyjns.js","assets/copy-HOrvM3LI.js","assets/MemoryView-e6Kdpx5n.js","assets/send-grypp2_x.js","assets/book-open-BfZKBC8k.js","assets/GuideView-CYI8_6-q.js","assets/lightbulb-BwLArGh_.js","assets/AuftragsbuchView-DadfFVer.js","assets/ChronikView-BabmqWxX.js","assets/EigenlebenView-Bva-XFZC.js","assets/WissenView-BfvotQrk.js"])))=>i.map(i=>d[i]); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ModelsView-D0ujmpST.js","assets/code-xml-DFsBpkB8.js","assets/rotate-ccw-CXI0Tldw.js","assets/zap-hBXNCtdw.js","assets/layers-BVmbzkl8.js","assets/ConnectView-Ckkd4eR_.js","assets/folder-open-qsFqfA7z.js","assets/circle-x-D1J1uP0I.js","assets/copy-ZerQbIeQ.js","assets/MemoryView-B6IXcZEl.js","assets/send-CjExvNpv.js","assets/book-open-cVx_1TDg.js","assets/GuideView-BAhrG_68.js","assets/lightbulb-DygeZkD3.js","assets/AuftragsbuchView-MX5C46g1.js","assets/ChronikView-DziulU9V.js","assets/EigenlebenView-BpLy1pkU.js","assets/WissenView-C7GDdv1b.js"])))=>i.map(i=>d[i]); var YI=Object.defineProperty;var S1=e=>{throw TypeError(e)};var QI=(e,t,r)=>t in e?YI(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var ws=(e,t,r)=>QI(e,typeof t!="symbol"?t+"":t,r),gm=(e,t,r)=>t.has(e)||S1("Cannot "+r);var $=(e,t,r)=>(gm(e,t,"read from private field"),r?r.call(e):t.get(e)),je=(e,t,r)=>t.has(e)?S1("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),pe=(e,t,r,n)=>(gm(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),ze=(e,t,r)=>(gm(e,t,"access private method"),r);var qc=(e,t,r,n)=>({set _(i){pe(e,t,i,r)},get _(){return $(e,t,n)}});function XI(e,t){for(var r=0;rn[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&n(s)}).observe(document,{childList:!0,subtree:!0});function r(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function n(i){if(i.ep)return;i.ep=!0;const o=r(i);fetch(i.href,o)}})();function Dg(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ym={exports:{}},Ss={},xm={exports:{}},Le={};/** * @license React * react.production.min.js @@ -458,4 +458,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function NY(e,t){if(e){if(typeof e=="string")return dP(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?dP(e,t):void 0}}function dP(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r{if(n!=null){var s=n.getBoundingClientRect(),u=s.width/n.offsetWidth;Fe(u)&&u!==o&&e(iL(u))}},[n,e,o]),i}function fP(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function DY(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=Array(t);r(qW(),null);function Af(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var HY=y.forwardRef((e,t)=>{var r,n,i=y.useRef(null),o=y.useState({containerWidth:Af((r=e.style)===null||r===void 0?void 0:r.width),containerHeight:Af((n=e.style)===null||n===void 0?void 0:n.height)}),s=Pf(o,2),u=s[0],d=s[1],f=y.useCallback((m,v)=>{d(x=>{var k=Math.round(m),S=Math.round(v);return x.containerWidth===k&&x.containerHeight===S?x:{containerWidth:k,containerHeight:S}})},[]),h=y.useCallback(m=>{if(typeof t=="function"&&t(m),i.current!=null&&(i.current.disconnect(),i.current=null),m!=null&&typeof ResizeObserver<"u"){var v=m.getBoundingClientRect(),x=v.width,k=v.height;f(x,k);var S=P=>{var j=P[0];if(j!=null){var _=j.contentRect,O=_.width,N=_.height;f(O,N)}},E=new ResizeObserver(S);E.observe(m),i.current=E}},[t,f]);return y.useEffect(()=>()=>{var m=i.current;m!=null&&m.disconnect()},[f]),y.createElement(y.Fragment,null,y.createElement(Au,{width:u.containerWidth,height:u.containerHeight}),y.createElement("div",Zi({ref:h},e)))}),KY=y.forwardRef((e,t)=>{var r=e.width,n=e.height,i=y.useState({containerWidth:Af(r),containerHeight:Af(n)}),o=Pf(i,2),s=o[0],u=o[1],d=y.useCallback((h,m)=>{u(v=>{var x=Math.round(h),k=Math.round(m);return v.containerWidth===x&&v.containerHeight===k?v:{containerWidth:x,containerHeight:k}})},[]),f=y.useCallback(h=>{if(typeof t=="function"&&t(h),h!=null){var m=h.getBoundingClientRect(),v=m.width,x=m.height;d(v,x)}},[t,d]);return y.createElement(y.Fragment,null,y.createElement(Au,{width:s.containerWidth,height:s.containerHeight}),y.createElement("div",Zi({ref:f},e)))}),VY=y.forwardRef((e,t)=>{var r=e.width,n=e.height;return y.createElement(y.Fragment,null,y.createElement(Au,{width:r,height:n}),y.createElement("div",Zi({ref:t},e)))}),qY=y.forwardRef((e,t)=>{var r=e.width,n=e.height;return typeof r=="string"||typeof n=="string"?y.createElement(KY,Zi({},e,{ref:t})):typeof r=="number"&&typeof n=="number"?y.createElement(VY,Zi({},e,{width:r,height:n,ref:t})):y.createElement(y.Fragment,null,y.createElement(Au,{width:r,height:n}),y.createElement("div",Zi({ref:t},e)))});function GY(e){return e?HY:qY}var YY=y.forwardRef((e,t)=>{var r=e.children,n=e.className,i=e.height,o=e.onClick,s=e.onContextMenu,u=e.onDoubleClick,d=e.onMouseDown,f=e.onMouseEnter,h=e.onMouseLeave,m=e.onMouseMove,v=e.onMouseUp,x=e.onTouchEnd,k=e.onTouchMove,S=e.onTouchStart,E=e.style,P=e.width,j=e.responsive,_=e.dispatchTouchEvents,O=_===void 0?!0:_,N=y.useRef(null),C=xt(),R=y.useState(null),z=Pf(R,2),F=z[0],V=z[1],Q=y.useState(null),B=Pf(Q,2),ue=B[0],G=B[1],le=TY(),fe=hy(),de=(fe==null?void 0:fe.width)>0?fe.width:P,Y=(fe==null?void 0:fe.height)>0?fe.height:i,ae=y.useCallback(Pe=>{le(Pe),typeof t=="function"&&t(Pe),V(Pe),G(Pe),Pe!=null&&(N.current=Pe)},[le,t,V,G]),X=y.useCallback(Pe=>{C(D_(Pe)),C(Rr({handler:o,reactEvent:Pe}))},[C,o]),M=y.useCallback(Pe=>{C(Ng(Pe)),C(Rr({handler:f,reactEvent:Pe}))},[C,f]),T=y.useCallback(Pe=>{C(Sj()),C(Rr({handler:h,reactEvent:Pe}))},[C,h]),Z=y.useCallback(Pe=>{C(Ng(Pe)),C(Rr({handler:m,reactEvent:Pe}))},[C,m]),se=y.useCallback(()=>{C(B_())},[C]),te=y.useCallback(()=>{C(U_())},[C]),ce=y.useCallback(Pe=>{C(F_(Pe.key))},[C]),ge=y.useCallback(Pe=>{C(Rr({handler:s,reactEvent:Pe}))},[C,s]),_e=y.useCallback(Pe=>{C(Rr({handler:u,reactEvent:Pe}))},[C,u]),J=y.useCallback(Pe=>{C(Rr({handler:d,reactEvent:Pe}))},[C,d]),we=y.useCallback(Pe=>{C(Rr({handler:v,reactEvent:Pe}))},[C,v]),Ae=y.useCallback(Pe=>{C(Rr({handler:S,reactEvent:Pe}))},[C,S]),ne=y.useCallback(Pe=>{O&&C(K_(Pe)),C(Rr({handler:k,reactEvent:Pe}))},[C,O,k]),lt=y.useCallback(Pe=>{C(Rr({handler:x,reactEvent:Pe}))},[C,x]),$e=GY(j);return y.createElement(Hj.Provider,{value:F},y.createElement(u5.Provider,{value:ue},y.createElement($e,{width:de??(E==null?void 0:E.width),height:Y??(E==null?void 0:E.height),className:Xe("recharts-wrapper",n),style:DY({position:"relative",cursor:"default",width:de,height:Y},E),onClick:X,onContextMenu:ge,onDoubleClick:_e,onFocus:se,onBlur:te,onKeyDown:ce,onMouseDown:J,onMouseEnter:M,onMouseLeave:T,onMouseMove:Z,onMouseUp:we,onTouchEnd:lt,onTouchMove:ne,onTouchStart:Ae,ref:ae},y.createElement(WY,null),r)))}),QY=["width","height","responsive","children","className","style","compact","title","desc"];function XY(e,t){if(e==null)return{};var r,n,i=ZY(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n{var r=e.width,n=e.height,i=e.responsive,o=e.children,s=e.className,u=e.style,d=e.compact,f=e.title,h=e.desc,m=XY(e,QY),v=on(m);return d?y.createElement(y.Fragment,null,y.createElement(Au,{width:r,height:n}),y.createElement(cP,{otherAttributes:v,title:f,desc:h},o)):y.createElement(YY,{className:s,style:u,width:r,height:n,responsive:i??!1,onClick:e.onClick,onMouseLeave:e.onMouseLeave,onMouseEnter:e.onMouseEnter,onMouseMove:e.onMouseMove,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onContextMenu:e.onContextMenu,onDoubleClick:e.onDoubleClick,onTouchStart:e.onTouchStart,onTouchMove:e.onTouchMove,onTouchEnd:e.onTouchEnd},y.createElement(cP,{otherAttributes:v,title:f,desc:h,ref:t},y.createElement(JV,null,o)))});function Ig(){return Ig=Object.assign?Object.assign.bind():function(e){for(var t=1;ty.createElement(oQ,{chartName:"AreaChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:lQ,tooltipPayloadSearcher:NW,categoricalChartProps:e,ref:t}));const uQ="rgba(130,130,150,0.14)",hv="rgba(130,130,150,0.85)";function cQ(e){if(e<=0)return 10;const t=Math.pow(10,Math.floor(Math.log10(e))),r=e/t;return(r<=1?1:r<=2?2:r<=5?5:10)*t}function Y_(e,t){return`${t==="%"?Math.round(e):e>=1e3?`${(e/1e3).toFixed(1)}k`:Math.round(e).toString()}${t}`}function dQ({active:e,payload:t,unit:r,label:n}){return!e||!(t!=null&&t.length)?null:b.jsxs("div",{className:"rounded-lg border border-border/70 bg-popover/95 px-3 py-2 shadow-xl backdrop-blur",children:[Number.isFinite(n)&&b.jsx("div",{className:"mb-1 border-b border-border/40 pb-1 font-mono text-[10px] text-muted-foreground/80",children:new Date(n).toLocaleTimeString("de-DE",{hour:"2-digit",minute:"2-digit",second:"2-digit"})}),b.jsx("div",{className:"space-y-1",children:t.map(i=>b.jsxs("div",{className:"flex items-center gap-2 text-[11px] font-mono",children:[b.jsx("span",{className:"h-2 w-2 rounded-full",style:{background:i.color}}),b.jsx("span",{className:"uppercase tracking-wider text-muted-foreground",children:i.name}),b.jsx("span",{className:"ml-auto pl-3 font-bold tabular-nums text-foreground",children:Y_(i.value,r)})]},i.dataKey))})]})}function Q_({data:e,series:t,unit:r="%",yMode:n="percent",height:i=176,showTime:o=!1}){var h,m;const s=e.reduce((v,x)=>t.reduce((k,S)=>Math.max(k,Number(x[S.key])||0),v),0),u=n==="percent"?Math.min(100,Math.max(25,Math.ceil(s*1.2/25)*25)):Math.max(cQ(s*1.15),10),d=e.length>1?Number((h=e[e.length-1])==null?void 0:h.t)-Number((m=e[0])==null?void 0:m.t):0,f=v=>new Date(v).toLocaleTimeString("de-DE",d<=10*6e4?{hour:"2-digit",minute:"2-digit",second:"2-digit"}:{hour:"2-digit",minute:"2-digit"});return b.jsx("div",{style:{height:i},className:"w-full",children:b.jsx(tz,{width:"100%",height:"100%",children:b.jsxs(sQ,{data:e,margin:{top:8,right:6,bottom:0,left:-12},children:[b.jsx("defs",{children:t.map(v=>b.jsxs("linearGradient",{id:`grad-${v.key}`,x1:"0",y1:"0",x2:"0",y2:"1",children:[b.jsx("stop",{offset:"0%",stopColor:v.color,stopOpacity:.22}),b.jsx("stop",{offset:"100%",stopColor:v.color,stopOpacity:0})]},v.key))}),b.jsx(w_,{vertical:!1,stroke:uQ}),o?b.jsx(Cg,{dataKey:"t",type:"number",domain:["dataMin","dataMax"],tickFormatter:f,tickCount:5,minTickGap:40,interval:"preserveStartEnd",axisLine:!1,tickLine:!1,tick:{fontSize:10,fill:hv},height:18}):b.jsx(Cg,{dataKey:"t",hide:!0}),b.jsx(T_,{domain:[0,u],ticks:[0,u/2,u],tickFormatter:v=>Y_(v,r),width:42,axisLine:!1,tickLine:!1,tick:{fontSize:10,fill:hv}}),b.jsx(oH,{content:b.jsx(dQ,{unit:r}),cursor:{stroke:hv,strokeOpacity:.4,strokeDasharray:"3 3"}}),t.map(v=>b.jsx(I_,{type:"monotone",dataKey:v.key,name:v.label,stroke:v.color,strokeWidth:2,fill:`url(#grad-${v.key})`,dot:!1,activeDot:{r:3,strokeWidth:0},isAnimationActive:!1,connectNulls:!0},v.key))]})})})}const X_={"1h":60,"24h":1440},mP={live:"Live","1h":"1 h","24h":"24 h"};function Z_({value:e,onChange:t}){return b.jsx("div",{className:"flex rounded-lg border border-border/40 bg-background/30 p-0.5",children:Object.keys(mP).map(r=>b.jsx("button",{onClick:()=>t(r),className:Re("rounded-md px-2 py-0.5 text-[9px] font-bold uppercase tracking-wide transition-all cursor-pointer",e===r?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"),children:mP[r]},r))})}const fQ=[{key:"cpu",label:"CPU",color:"#2dd4bf"},{key:"ram",label:"RAM",color:"#38bdf8"},{key:"gpu",label:"GPU",color:"#a78bfa"},{key:"disk",label:"Disk",color:"#fbbf24"}];function hQ(){var h,m,v,x;const{sys:e,hist:t}=Z3(),[r,n]=y.useState("live"),i=DA(r==="live"?60:X_[r],r!=="live"),o=y.useMemo(()=>{var k;return r==="live"?t:(((k=i.data)==null?void 0:k.points)??[]).map(S=>({t:S.t*1e3,cpu:S.cpu,ram:S.ram,gpu:S.gpu,disk:S.disk}))},[r,t,i.data]),s=!!(e!=null&&e.gpu&&e.gpu.busy_percent!=null&&e.gpu.gtt_used!=null&&e.gpu.gtt_total!=null),u=fQ.filter(k=>k.key!=="gpu"||s),d={cpu:(h=e==null?void 0:e.cpu)==null?void 0:h.percent,ram:(m=e==null?void 0:e.ram)==null?void 0:m.percent,gpu:s?e.gpu.busy_percent:null,disk:(v=e==null?void 0:e.disk)==null?void 0:v.percent},f={cpu:(x=e==null?void 0:e.cpu)!=null&&x.cores?`${e.cpu.cores} Cores`:"",ram:e?`${No(e.ram.used)}/${No(e.ram.total)} GB`:"",gpu:s?`${No(e.gpu.gtt_used)}/${No(e.gpu.gtt_total)} GB`:"",disk:e!=null&&e.disk?`${No(e.disk.used)}/${No(e.disk.total)} GB`:""};return b.jsxs("div",{className:"flex flex-col justify-between mc-card p-5",children:[b.jsxs("div",{children:[b.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[b.jsx(HP,{className:"h-4.5 w-4.5 text-primary"}),b.jsx("h2",{className:"text-sm font-semibold uppercase tracking-wide text-foreground",children:"System-Status"}),r==="live"&&b.jsxs("span",{className:"ml-1 inline-flex items-center gap-1 text-[10px] font-medium text-muted-foreground/70",children:[b.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500 animate-pulse"})," live"]}),b.jsx("div",{className:"ml-auto",children:b.jsx(Z_,{value:r,onChange:n})})]}),e?b.jsxs(b.Fragment,{children:[b.jsx("div",{className:"mb-2 grid grid-cols-2 gap-x-4 gap-y-1.5",children:u.map(k=>b.jsxs("div",{className:"flex min-w-0 items-center gap-1.5",children:[b.jsx("span",{className:"h-2 w-2 shrink-0 rounded-full",style:{background:k.color}}),b.jsx("span",{className:"shrink-0 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:k.label}),b.jsxs("span",{className:"shrink-0 font-mono text-xs font-bold tabular-nums text-foreground",children:[Math.round(d[k.key]??0),"%"]}),f[k.key]&&b.jsx("span",{className:"truncate font-mono text-[10px] text-muted-foreground/60",children:f[k.key]})]},k.key))}),r!=="live"&&o.length===0&&b.jsx("div",{className:"flex h-44 items-center justify-center text-xs text-muted-foreground",children:i.isLoading?"Verlauf wird geladen …":"Noch kein Verlauf — der Sammler baut die Historie gerade erst auf."}),(r==="live"||o.length>0)&&b.jsx(Q_,{data:o,series:u,unit:"%",yMode:"percent",height:176,showTime:!0})]}):b.jsx("div",{className:"flex h-44 items-center justify-center text-xs text-muted-foreground",children:"Lade Systemdaten…"})]}),(e==null?void 0:e.temp)&&(e.temp.cpu||e.temp.gpu)&&b.jsxs("div",{className:"mt-3 flex gap-4 border-t border-border/30 pt-3 font-mono text-xs text-muted-foreground/80",children:[e.temp.cpu!=null&&b.jsxs("span",{children:["CPU Temp: ",e.temp.cpu," °C"]}),e.temp.gpu!=null&&b.jsxs("span",{children:["GPU Temp: ",e.temp.gpu," °C"]})]})]})}const vP=[{key:"prompt",label:"Prompt",color:"#f59e0b"},{key:"completion",label:"Antwort",color:"#2dd4bf"}];function pQ(){const{data:e}=$A(),t=K3(),[r,n]=y.useState("live"),i=DA(r==="live"?60:X_[r],r!=="live"),o=y.useMemo(()=>{var h;if(r==="live")return t;const d=((h=i.data)==null?void 0:h.points)??[],f=[];for(let m=1;mb.jsxs("div",{className:"flex items-center gap-1.5",children:[b.jsx("span",{className:"h-2 w-2 rounded-full",style:{background:d.color}}),b.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:d.label}),b.jsx("span",{className:"font-mono text-xs font-bold tabular-nums text-foreground",children:Math.round((s==null?void 0:s[d.key])??0)})]},d.key))})]})]}),r!=="live"&&o.length===0?b.jsx("div",{className:"flex h-[150px] items-center justify-center text-xs text-muted-foreground",children:i.isLoading?"Verlauf wird geladen …":"Noch kein Verlauf — der Sammler baut die Historie gerade erst auf."}):e?b.jsx(Q_,{data:o,series:vP,unit:" tok/s",yMode:"auto",height:150,showTime:!0}):b.jsx("div",{className:"flex h-[150px] items-center justify-center text-xs text-muted-foreground",children:"Lade Durchsatz…"}),b.jsx("div",{className:"mt-2 border-t border-border/30 pt-2 text-[10px] text-muted-foreground/70",children:"Durchsatz aus dem Gateway abgeleitet (Prefill vs. Generierung). Flach bei Leerlauf."})]})}const Sl=[{key:"stt_ms",label:"STT",color:"#f59e0b"},{key:"vision_ms",label:"Sehen",color:"#a78bfa"},{key:"hirn_ms",label:"Hirn",color:"#2dd4bf"},{key:"gen_ms",label:"Antwort",color:"#60a5fa"}],ja=e=>e==null?"–":`${(e/1e3).toLocaleString("de-DE",{minimumFractionDigits:1,maximumFractionDigits:1})} s`;function mQ(e){const t=Math.max(0,Date.now()/1e3-e);return t<60?`vor ${Math.round(t)} s`:t<3600?`vor ${Math.round(t/60)} min`:`vor ${Math.round(t/3600)} h`}function Mg(e){return Sl.reduce((t,r)=>t+(e[r.key]??0),0)}function vQ(e){let t=null;for(const r of Sl){const n=e[r.key];n!=null&&(t==null||n>t.ms)&&(t={label:r.label,color:r.color,ms:n})}return t}function gQ({t:e,scale:t}){const r=Sl.map(n=>`${n.label} ${ja(e[n.key])}`).join(" · ")+(e.mem0_ms!=null?` (davon Mem0 ${ja(e.mem0_ms)})`:"");return b.jsxs("div",{className:"flex items-center gap-2.5",children:[b.jsx("span",{className:"w-14 shrink-0 text-right font-mono text-[10px] text-muted-foreground/60",children:mQ(e.ts)}),b.jsxs("div",{className:"relative h-4 flex-1 overflow-hidden rounded-sm bg-muted/25",title:r,children:[b.jsx("div",{className:"absolute inset-0 flex",children:Sl.map(n=>{const i=e[n.key];return!i||i<=0?null:b.jsx("div",{style:{width:`${i/t*100}%`,background:n.color},className:"h-full first:rounded-l-sm"},n.key)})}),e.error&&b.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-rose-500/15 text-[10px] font-semibold text-rose-300",children:"Fehler"})]}),b.jsx("span",{className:"w-12 shrink-0 text-right font-mono text-[11px] font-semibold tabular-nums text-foreground",children:e.error?"–":ja(Mg(e))})]})}function yQ(){const{data:e}=C3(12),t=e??[],r=Math.max(1,...t.map(o=>Mg(o))),n=t[0],i=n?vQ(n):null;return b.jsxs("div",{className:"mc-card p-5",children:[b.jsxs("div",{className:"mb-3 flex items-start justify-between gap-3",children:[b.jsxs("div",{children:[b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsx(cT,{className:"h-4.5 w-4.5 text-primary"}),b.jsx("h2",{className:"text-sm font-semibold uppercase tracking-wide text-foreground",children:"Latenz je Turn"}),b.jsxs("span",{className:"ml-1 inline-flex items-center gap-1 text-[10px] font-medium text-muted-foreground/70",children:[b.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500 animate-pulse"})," live"]})]}),n?b.jsxs("div",{className:"mt-2 flex items-baseline gap-2",children:[b.jsx("span",{className:`font-space text-3xl font-bold tracking-tight tabular-nums ${n.error?"text-rose-400":"text-foreground"}`,children:n.error?"Fehler":ja(Mg(n))}),b.jsxs("span",{className:"text-xs text-muted-foreground",children:["letzter Turn",!n.error&&i&&b.jsxs(b.Fragment,{children:[" · Täter: ",b.jsx("span",{style:{color:i.color},className:"font-semibold",children:i.label})," ",ja(i.ms)]})]})]}):b.jsx("div",{className:"mt-2 text-xs text-muted-foreground",children:"Noch kein Voice-Turn aufgezeichnet."}),n&&!n.error&&b.jsxs("div",{className:"mt-0.5 font-mono text-[11px] text-muted-foreground/70",children:[Sl.filter(o=>n[o.key]!=null).map(o=>`${o.label} ${ja(n[o.key])}`).join(" · "),n.mem0_ms!=null&&b.jsxs("span",{className:"text-muted-foreground/50",children:[" · davon Mem0 ",ja(n.mem0_ms)]})]})]}),b.jsx("div",{className:"flex shrink-0 flex-col items-end gap-1 pt-1",children:Sl.map(o=>b.jsxs("div",{className:"flex items-center gap-1.5",children:[b.jsx("span",{className:"h-2 w-2 rounded-full",style:{background:o.color}}),b.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:o.label})]},o.key))})]}),t.length>0?b.jsx("div",{className:"space-y-1.5",children:t.map(o=>b.jsx(gQ,{t:o,scale:r},o.id))}):b.jsx("div",{className:"flex h-[120px] items-center justify-center px-6 text-center text-xs text-muted-foreground",children:"Sprich einmal mit Lucy — dann erscheint hier der Zeit-Wasserfall pro Turn, damit man den einen Hänger sofort sieht."}),b.jsx("div",{className:"mt-3 border-t border-border/30 pt-2 text-[10px] leading-relaxed text-muted-foreground/70",children:'„Hirn" = Zeit bis zum ersten Wort (Agent + Mem0-Suche + Modell); Tool-Runden stecken in „Antwort". Reine Telegram-Turns laufen an MC2 vorbei und erscheinen hier nicht.'})]})}const Of=e=>window.dispatchEvent(new CustomEvent("open-system-drawer",{detail:{tab:e}}));function xQ({onNavigate:e}){var de,Y,ae,X;const{data:t}=RA(),{data:r}=Zg(),{data:n}=LA(),{data:i}=I3(),{data:o}=_3(),{data:s}=N3(),{data:u}=k3(),{data:d}=E3(),f=q3(),{showAlert:h,dialogElement:m}=Xg(),v=xu(),[x,k]=y.useState({});async function S(M,T){k(Z=>({...Z,[M]:!0}));try{if(T.kind==="loadModel")await Me(`/api/models/${encodeURIComponent(T.model)}/load`,{method:"POST"});else{const Z=await Me("/api/maintenance/restart",{method:"POST",body:JSON.stringify({service:T.service})});Z.ok||h("Reparatur nicht ganz geklappt",(Z.err||"Unbekannter Fehler")+(T.needsSudo?` -Tipp: Dafür wird evtl. das Box-Passwort gebraucht (oben rechts hinterlegen).`:""))}v.invalidateQueries({queryKey:De.health}),v.invalidateQueries({queryKey:De.services}),v.invalidateQueries({queryKey:De.models})}catch(Z){h("Reparatur fehlgeschlagen",String((Z==null?void 0:Z.message)||Z))}finally{k(Z=>({...Z,[M]:!1}))}}const E=((de=t==null?void 0:t.running)==null?void 0:de.length)??0,P=(r==null?void 0:r.services.filter(M=>M.ok).length)??0,j=(r==null?void 0:r.services.length)??0,_=j-P,O=(i==null?void 0:i.length)??0,N=(n?(n.os>0?1:0)+(n.engine>0?1:0)+(n.swap>0?1:0)+(n.models>0?1:0):0)+(((Y=n==null?void 0:n.components)==null?void 0:Y.filter(M=>M.update===!0).length)??0),C=u!=null&&u.available?u.open_count:0,R=d!=null&&d.available?d.items.filter(M=>M.status==="blocked").length:0,z=s?[s.gateway,s.memory,s.desktop_gateway]:[],F=z.filter(M=>M==null?void 0:M.ok).length,V=s?s.gateway.ok?s.memory.ok?s.desktop_gateway.ok?"":"Desktop-Gateway":"Gedächtnis-Leitung":"Modell-Leitung":"",Q=(ae=t==null?void 0:t.models)==null?void 0:ae.find(M=>M.role==="hermes"),B=Q!=null&&Q.name?(X=Q.name.split("/").pop())==null?void 0:X.replace(/\.gguf$/i,""):"",ue=i?i.filter(M=>["auto","agent","hermes"].includes(M.source)).length:0,G=r==null?void 0:r.services.filter(M=>!M.ok).map(M=>M.name).join(", "),le=n?[n.os>0&&"OS",n.engine>0&&"Engine",n.swap>0&&"Swap",n.models>0&&"Modelle"].filter(Boolean):[],fe=le.length>0?le.join(" + "):"";return b.jsxs("div",{className:"space-y-6",children:[b.jsxs("div",{children:[b.jsx("h1",{className:"bg-gradient-to-r from-foreground via-foreground to-primary bg-clip-text font-space text-2xl font-bold tracking-tight text-transparent",children:"Cockpit"}),b.jsx("p",{className:"text-sm text-muted-foreground",children:"Deine Box auf einen Blick — Details hinter jeder Kachel."})]}),b.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6 items-start",children:[b.jsxs("div",{className:"lg:col-span-2 space-y-6",children:[b.jsx(bQ,{verdict:f.verdict,memory:f.memory,warns:f.warns,problems:f.problems}),b.jsx(Q3,{}),b.jsxs("section",{children:[b.jsx(xd,{children:"Leistung"}),b.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[b.jsx(hQ,{}),b.jsx(pQ,{})]}),b.jsx("div",{className:"mt-4",children:b.jsx(yQ,{})})]}),b.jsxs("section",{children:[b.jsx(xd,{children:"Bereiche"}),b.jsxs("div",{className:"grid gap-4 grid-cols-2 md:grid-cols-3",children:[b.jsx(Io,{icon:Ug,title:"Auftragsbuch",value:u!=null&&u.available?C:"—",unit:C===1?"Vorschlag":"Vorschläge",tone:u?R>0||C>0?"warn":"ok":"loading",hint:R>0?`${R} Karte${R===1?"":"n"} wartet auf deine Antwort`:C>0?`${C} offene Patches`:"Keine ausstehenden Vorschläge",onClick:()=>e("auftraege")}),b.jsx(Io,{icon:UP,title:"Modelle",value:E,unit:"warm",tone:E>0?"ok":"muted",hint:B?`Hirn: ${B}`:"Kein Hermes-Modell geladen",onClick:()=>e("models")}),b.jsx(Io,{icon:Bg,title:"Gedächtnis",value:i?O:"…",unit:"Notizen",tone:i?"ok":"loading",hint:i?`${O} Fakten (${ue} auto gelernt)`:"Gedächtnis-Pool laden...",onClick:()=>e("memory")}),b.jsx(Io,{icon:Nf,title:"Dienste",value:r?`${P}/${j}`:"…",unit:"laufen",tone:r?_>0?"warn":"ok":"loading",hint:G?`Ausfall: ${G}`:"Alle Dienste online",onClick:()=>Of("maintenance")}),b.jsx(Io,{icon:Hg,title:"Updates",value:n?N>0?N:"0":"…",unit:N>0?"bereit":"aktuell",tone:n?N>0?"warn":"ok":"loading",hint:N>0?`Verfügbar: ${fe}`:"Alles auf dem neuesten Stand",onClick:()=>Of("maintenance")}),b.jsx(Io,{icon:Wg,title:"Verbinden",value:s?`${F}/${z.length}`:"…",unit:"Leitungen",tone:s?F===z.length?"ok":"warn":"loading",hint:V?`Gestört: ${V}`:"Hermes Desktop & IDEs bereit",onClick:()=>e("connect")})]})]})]}),b.jsxs("div",{className:"space-y-6",children:[b.jsx(wQ,{problems:f.problems,pendingCount:N,openAuftraege:C,blockedIdeen:R,busy:x,onRepair:S,onNavigate:e}),b.jsxs("section",{children:[b.jsx(xd,{children:"Anstehendes"}),b.jsx(X3,{})]}),b.jsxs("section",{children:[b.jsx(xd,{children:"Werkzeuge & Diagnose"}),b.jsx(SQ,{agent:o,svcErrors:_,onNavigate:e})]})]})]}),m]})}function xd({children:e}){return b.jsx("p",{className:"mb-2 ml-0.5 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground/60",children:e})}function bQ({verdict:e,memory:t,warns:r,problems:n}){const i=r.length?`${r[0].label}: ${r[0].detail}${r.length>1?` (+${r.length-1} weitere)`:""}`:t.status==="full"?t.text:"Nichts Schlimmes — nur ein Hinweis.",o=n.length?`${n[0].label}: ${n[0].detail}${n.length>1?` (+${n.length-1} weitere)`:""}`:"Ein wichtiger Dienst hakt.",s={loading:{ring:"border-border/60 bg-card/45",icon:_f,iconCls:"text-muted-foreground animate-spin",title:"Box wird geprüft …",sub:"Einen Moment."},gut:{ring:"border-emerald-500/40 bg-emerald-500/5",icon:hT,iconCls:"text-emerald-400",title:"Box gesund",sub:"Alle wichtigen Dienste laufen."},warn:{ring:"border-amber-500/40 bg-amber-500/5",icon:Gs,iconCls:"text-amber-400",title:"Kleinigkeit an der Box",sub:i},problem:{ring:"border-red-500/50 bg-red-500/5",icon:Gs,iconCls:"text-red-400",title:"Box braucht Hilfe",sub:o}}[e],u=s.icon,d={ok:"text-emerald-400",warn:"text-amber-400",full:"text-red-400",unknown:"text-muted-foreground"}[t.status],f={ok:"bg-emerald-500",warn:"bg-amber-500",full:"bg-red-500",unknown:"bg-muted-foreground/40"}[t.status];return b.jsxs("div",{className:Re("flex flex-col gap-4 rounded-2xl border p-5 shadow-lg shadow-black/15 backdrop-blur-md transition-colors sm:flex-row sm:items-center sm:justify-between h-full",s.ring),children:[b.jsxs("div",{className:"flex items-center gap-3",children:[b.jsx("div",{className:"flex h-11 w-11 shrink-0 items-center justify-center rounded-xl border border-border/40 bg-background/30",children:b.jsx(u,{className:Re("h-6 w-6",s.iconCls)})}),b.jsxs("div",{className:"min-w-0",children:[b.jsx("h2",{className:"text-base font-bold tracking-tight text-foreground",children:s.title}),b.jsx("p",{className:"text-xs text-muted-foreground",children:s.sub})]})]}),b.jsxs("div",{className:"w-full max-w-[16rem] rounded-xl border border-border/30 bg-background/20 p-3",children:[b.jsxs("div",{className:"mb-1.5 flex items-center justify-between text-[11px]",children:[b.jsxs("span",{className:"flex items-center gap-1.5 font-semibold uppercase tracking-wider text-muted-foreground",children:[b.jsx(fT,{className:"h-3.5 w-3.5"})," Speicher"]}),b.jsx("span",{className:Re("font-mono font-bold",d),children:t.status==="unknown"?"—":`${t.usedGb.toFixed(1)} / ${t.totalGb.toFixed(1)} GB`})]}),b.jsx("div",{className:"h-2 w-full overflow-hidden rounded-full border border-border/30 bg-background/50",children:b.jsx("div",{className:Re("h-full rounded-full transition-all duration-500",f),style:{width:`${t.pct}%`}})})]})]})}function wQ({problems:e,pendingCount:t,openAuftraege:r,blockedIdeen:n,busy:i,onRepair:o,onNavigate:s}){const u=t>0,d=r>0,f=n>0,h=e.length===0&&!u&&!d&&!f;return b.jsx("div",{className:"h-full flex flex-col justify-between",children:h?b.jsxs("div",{className:"flex items-center gap-3 rounded-2xl border border-emerald-500/25 bg-emerald-500/5 p-4 h-full",children:[b.jsx(tT,{className:"h-5 w-5 shrink-0 text-emerald-400"}),b.jsxs("div",{children:[b.jsx("p",{className:"text-sm font-semibold text-foreground",children:"Nichts zu tun"}),b.jsx("p",{className:"text-xs text-muted-foreground",children:"Alles läuft. Du musst gerade nichts abnicken."})]})]}):b.jsxs("div",{className:"space-y-2 h-full flex flex-col justify-center",children:[e.map(m=>b.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3 rounded-2xl border border-red-500/25 bg-red-500/5 p-4",children:[b.jsxs("div",{className:"flex min-w-0 items-center gap-3 w-full",children:[b.jsx("span",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg border border-red-500/30 bg-background/30 text-red-300",children:b.jsx(m.icon,{className:"h-4.5 w-4.5"})}),b.jsxs("div",{className:"min-w-0 flex-1",children:[b.jsx("p",{className:"text-sm font-bold text-foreground",children:m.label}),b.jsx("p",{className:"truncate text-xs text-muted-foreground",children:m.detail})]})]}),m.repair&&b.jsxs("button",{onClick:()=>m.repair&&o(m.id,m.repair),disabled:!!i[m.id],className:"flex h-9 shrink-0 items-center gap-1.5 rounded-lg border border-red-500/40 bg-red-500/10 px-3 text-[11px] font-bold uppercase tracking-wide text-red-300 transition-all hover:bg-red-500/20 cursor-pointer disabled:opacity-60 w-full sm:w-auto justify-center",children:[i[m.id]?b.jsx(_f,{className:"h-3.5 w-3.5 animate-spin"}):b.jsx(jT,{className:"h-3.5 w-3.5"}),m.repair.label]})]},m.id)),f&&b.jsxs("button",{onClick:()=>s("auftraege"),className:"flex w-full items-center justify-between gap-3 rounded-2xl border border-red-500/30 bg-red-500/5 p-4 text-left transition-all hover:bg-red-500/10 cursor-pointer",children:[b.jsxs("div",{className:"flex items-center gap-3",children:[b.jsx("span",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg border border-red-500/30 bg-background/30 text-red-300",children:b.jsx(WP,{className:"h-4.5 w-4.5"})}),b.jsxs("div",{children:[b.jsxs("p",{className:"text-sm font-bold text-foreground",children:[n," Karte",n===1?"":"n"," braucht deine Antwort"]}),b.jsx("p",{className:"text-xs text-muted-foreground",children:"Die Box hängt an einer Frage und wartet auf dich."})]})]}),b.jsx(Ko,{className:"h-4 w-4 shrink-0 text-red-300/70"})]}),d&&b.jsxs("button",{onClick:()=>s("auftraege"),className:"flex w-full items-center justify-between gap-3 rounded-2xl border border-primary/30 bg-primary/5 p-4 text-left transition-all hover:bg-primary/10 cursor-pointer",children:[b.jsxs("div",{className:"flex items-center gap-3",children:[b.jsx("span",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg border border-primary/30 bg-background/30 text-primary",children:b.jsx(Ug,{className:"h-4.5 w-4.5"})}),b.jsxs("div",{children:[b.jsxs("p",{className:"text-sm font-bold text-foreground",children:[r," Vorschl",r===1?"ag":"äge"," im Auftragsbuch"]}),b.jsx("p",{className:"text-xs text-muted-foreground",children:"Annehmen oder ablehnen."})]})]}),b.jsx(Ko,{className:"h-4 w-4 shrink-0 text-primary/70"})]}),u&&b.jsxs("button",{onClick:()=>Of("maintenance"),className:"flex w-full items-center justify-between gap-3 rounded-2xl border border-amber-500/30 bg-amber-500/5 p-4 text-left transition-all hover:bg-amber-500/10 cursor-pointer",children:[b.jsxs("div",{className:"flex items-center gap-3",children:[b.jsx("span",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg border border-amber-500/30 bg-background/30 text-amber-300",children:b.jsx(Hg,{className:"h-4.5 w-4.5"})}),b.jsxs("div",{children:[b.jsxs("p",{className:"text-sm font-bold text-foreground",children:[t," Update",t===1?"":"s"," bereit"]}),b.jsx("p",{className:"text-xs text-muted-foreground",children:"Ansehen und entscheiden."})]})]}),b.jsx(Ko,{className:"h-4 w-4 shrink-0 text-amber-300/70"})]})]})})}function SQ({agent:e,svcErrors:t,onNavigate:r}){const n=[{label:"Hermes Agent",status:e?e.gateway_reachable?"Bereit":"Offline":"…",tone:e?e.gateway_reachable?"ok":"alert":"loading",action:()=>r("agent")},{label:"Konsole (Box-Shell)",status:e?e.box_console_reachable?"Bereit":"Offline":"…",tone:e?e.box_console_reachable?"ok":"warn":"loading",action:()=>r("konsole")},{label:"Systemlogs & Diagnose",status:t>0?`${t} Fehler`:"Keine Fehler",tone:t>0?"alert":"ok",action:()=>Of("logs")},{label:"Wissens-Vault",status:"Öffnen",tone:"muted",action:()=>r("wissen")},{label:"Chronik & Zeitmaschine",status:"Öffnen",tone:"muted",action:()=>r("chronik")}];return b.jsx("div",{className:"rounded-2xl border border-border/60 bg-card/30 p-4 space-y-3 shadow-sm",children:b.jsx("div",{className:"divide-y divide-border/20",children:n.map((i,o)=>{const s={loading:"bg-muted-foreground/45 animate-pulse",ok:"bg-emerald-500 shadow-[0_0_8px_rgba(16,185,129,0.4)]",warn:"bg-amber-500 shadow-[0_0_8px_rgba(245,158,11,0.4)]",alert:"bg-red-500 shadow-[0_0_8px_rgba(239,68,68,0.4)]",muted:"bg-muted-foreground/30"}[i.tone];return b.jsxs("button",{onClick:i.action,className:"w-full py-2.5 px-1.5 flex items-center justify-between text-left hover:bg-card/45 rounded-lg transition-all group cursor-pointer text-xs",children:[b.jsx("span",{className:"text-muted-foreground group-hover:text-foreground transition-colors font-medium",children:i.label}),b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsx("span",{className:Re("text-[10px] font-semibold font-mono",i.tone==="ok"?"text-emerald-400":i.tone==="warn"?"text-amber-400":i.tone==="alert"?"text-red-400":"text-muted-foreground/60"),children:i.status}),b.jsx("span",{className:Re("h-1.5 w-1.5 rounded-full",s)})]})]},o)})})})}const kQ=y.lazy(()=>In(()=>import("./ModelsView-DRiKlRjv.js"),__vite__mapDeps([0,1,2,3,4])).then(e=>({default:e.ModelsView}))),EQ=y.lazy(()=>In(()=>import("./ConnectView-u_EPDy1I.js"),__vite__mapDeps([5,6,7,8])).then(e=>({default:e.ConnectView}))),PQ=y.lazy(()=>In(()=>import("./MemoryView-e6Kdpx5n.js"),__vite__mapDeps([9,8,10,11])).then(e=>({default:e.MemoryView}))),AQ=y.lazy(()=>In(()=>import("./AgentView-Di2UOnE1.js"),[]).then(e=>({default:e.AgentView}))),OQ=y.lazy(()=>In(()=>import("./KonsoleView-Db6bdlag.js"),[]).then(e=>({default:e.KonsoleView}))),CQ=y.lazy(()=>In(()=>import("./GuideView-CYI8_6-q.js"),__vite__mapDeps([12,11,3,4,13])).then(e=>({default:e.GuideView}))),jQ=y.lazy(()=>In(()=>import("./AuftragsbuchView-DadfFVer.js"),__vite__mapDeps([14,13,1,10,4,2])).then(e=>({default:e.AuftragsbuchView}))),_Q=y.lazy(()=>In(()=>import("./ChronikView-BabmqWxX.js"),__vite__mapDeps([15,2])).then(e=>({default:e.ChronikView}))),NQ=y.lazy(()=>In(()=>import("./EigenlebenView-Bva-XFZC.js"),__vite__mapDeps([16,11,7])).then(e=>({default:e.EigenlebenView}))),IQ=y.lazy(()=>In(()=>import("./WissenView-BfvotQrk.js"),__vite__mapDeps([17,6])).then(e=>({default:e.WissenView})));function MQ(){return b.jsx("div",{className:"flex h-64 items-center justify-center text-muted-foreground",children:b.jsx(_f,{className:"h-5 w-5 animate-spin","aria-label":"Lädt …"})})}const TQ=/Mac|iPhone|iPad/.test(navigator.platform);function DQ(){V3(),S3();const[e,t]=y.useState(()=>{const S=window.location.hash.slice(1);return qo.some(E=>E.id===S)?S:"dashboard"}),r=y.useCallback(S=>{window.location.hash.slice(1)===S?t(S):window.location.hash=S},[]),[n,i]=y.useState(()=>localStorage.getItem("mc_sidebar_collapsed")==="true"),[o,s]=y.useState(!1),[u,d]=y.useState(!1),[f,h]=y.useState("maintenance"),{data:m,isError:v}=TA(),{data:x}=$f();y.useEffect(()=>{document.documentElement.classList.add("dark")},[]),y.useEffect(()=>{const S=E=>{var j;h(((j=E.detail)==null?void 0:j.tab)||"maintenance"),d(!0)};return window.addEventListener("open-system-drawer",S),()=>window.removeEventListener("open-system-drawer",S)},[]),y.useEffect(()=>{const S=E=>{var j;const P=(j=E.detail)==null?void 0:j.view;P&&r(P)};return window.addEventListener("mc-navigate",S),()=>window.removeEventListener("mc-navigate",S)},[r]),y.useEffect(()=>{const S=()=>{const E=window.location.hash.slice(1);qo.some(P=>P.id===E)&&t(E)};return window.addEventListener("hashchange",S),()=>window.removeEventListener("hashchange",S)},[]),y.useEffect(()=>{s(!1)},[e]);const k=qo.find(S=>S.id===e);return b.jsxs("div",{className:"flex h-full relative",children:[b.jsx("div",{className:"fixed inset-0 -z-50 pointer-events-none",style:{backgroundColor:"hsl(224,30%,6%)",backgroundImage:["radial-gradient(45% 40% at 12% 8%, hsl(172 72% 50% / 0.10), transparent 70%)","radial-gradient(50% 45% at 88% 92%, hsl(270 70% 60% / 0.10), transparent 70%)","radial-gradient(40% 35% at 75% 30%, hsl(239 70% 62% / 0.07), transparent 70%)"].join(", ")}}),b.jsx($R,{onNavigate:r}),b.jsx(B3,{open:u,onClose:()=>d(!1),defaultTab:f}),b.jsx("aside",{className:Re("hidden md:flex shrink-0 flex-col border-r border-border/40 bg-card/45 backdrop-blur-md transition-all duration-300 ease-in-out",n?"w-16":"w-60"),children:b.jsx(gP,{collapsed:n,onToggleCollapse:()=>{i(S=>{const E=!S;return localStorage.setItem("mc_sidebar_collapsed",E.toString()),E})},view:e,health:m,backendDown:v,sysStatus:x})}),b.jsxs("div",{className:Re("md:hidden fixed inset-0 z-50 transition-opacity duration-200",o?"opacity-100":"pointer-events-none opacity-0"),"aria-hidden":!o,children:[b.jsx("div",{className:"absolute inset-0 bg-black/60",onClick:()=>s(!1)}),b.jsx("aside",{className:Re("absolute inset-y-0 left-0 flex w-72 max-w-[85vw] flex-col border-r border-border/40 bg-[hsl(224,28%,8%)] transition-transform duration-300 ease-in-out",o?"translate-x-0":"-translate-x-full"),children:b.jsx(gP,{collapsed:!1,onClose:()=>s(!1),view:e,health:m,backendDown:v,sysStatus:x})})]}),b.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[b.jsxs("header",{className:"flex h-14 shrink-0 items-center justify-between gap-3 border-b border-border/40 px-4 md:px-6 bg-card/20 backdrop-blur-sm",children:[b.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[b.jsx("button",{onClick:()=>s(!0),className:"md:hidden p-1.5 -ml-1 rounded-md hover:bg-accent text-muted-foreground transition-colors cursor-pointer","aria-label":"Navigation öffnen",children:b.jsx(yT,{className:"h-5 w-5","aria-hidden":"true"})}),b.jsx("div",{className:"truncate text-xs font-medium text-muted-foreground tracking-wide uppercase font-sans",children:k.hint})]}),b.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[b.jsx(x3,{}),b.jsx("a",{href:"https://git.tobisniceshomelab.ddnsfree.com/Hitonabi/mission-control-v2/src/branch/main/docs/BEDIENUNG.md",target:"_blank",rel:"noopener",className:"hidden sm:flex h-8 items-center rounded-md border border-border/40 bg-background/40 px-2.5 text-xs text-muted-foreground hover:bg-accent hover:text-accent-foreground transition-all cursor-pointer font-semibold",title:"Bedien-Anleitung",children:"Hilfe"}),b.jsxs("button",{onClick:()=>{const S=new KeyboardEvent("keydown",{key:"k",metaKey:!0});document.dispatchEvent(S)},className:"flex items-center gap-2 rounded-md border border-border/40 bg-background/40 px-2.5 py-1.5 text-xs text-muted-foreground hover:bg-accent hover:text-accent-foreground transition-all cursor-pointer",children:[b.jsx(lT,{className:"h-3.5 w-3.5"}),b.jsx("span",{className:"hidden sm:inline",children:"Suchen"}),b.jsx("kbd",{className:"hidden sm:inline rounded bg-muted px-1.5 py-0.5 font-mono text-[9px]",children:TQ?"⌘K":"Strg+K"})]})]})]}),b.jsx("main",{className:"flex-1 overflow-y-auto p-4 md:p-6 scrollbar-thin",children:b.jsxs(y.Suspense,{fallback:b.jsx(MQ,{}),children:[e==="dashboard"&&b.jsx(xQ,{onNavigate:S=>r(S)}),e==="auftraege"&&b.jsx(jQ,{}),e==="models"&&b.jsx(kQ,{}),e==="connect"&&b.jsx(EQ,{}),e==="memory"&&b.jsx(PQ,{}),e==="wissen"&&b.jsx(IQ,{}),e==="chronik"&&b.jsx(_Q,{}),e==="eigenleben"&&b.jsx(NQ,{}),e==="agent"&&b.jsx(AQ,{}),e==="konsole"&&b.jsx(OQ,{}),e==="guide"&&b.jsx(CQ,{})]})})]})]})}function gP({collapsed:e,onToggleCollapse:t,onClose:r,view:n,health:i,backendDown:o,sysStatus:s}){var u,d,f,h,m;return b.jsxs(b.Fragment,{children:[b.jsxs("div",{className:Re("flex items-center py-4 border-b border-border/40 shrink-0",e?"flex-col gap-3 px-2":"justify-between px-5"),children:[b.jsxs("div",{className:"flex items-center gap-2 overflow-hidden",children:[b.jsx("div",{className:"h-7 w-7 rounded-lg bg-primary shadow-md shadow-primary/20 shrink-0"}),!e&&b.jsxs("div",{className:"leading-tight",children:[b.jsx("div",{className:"text-sm font-semibold tracking-wide font-space",children:"Mission Control"}),b.jsx("div",{className:"text-xs text-muted-foreground",children:"2.0"})]})]}),t&&b.jsx("button",{onClick:t,className:"p-1 rounded-md hover:bg-accent text-muted-foreground transition-colors cursor-pointer","aria-label":e?"Seitenleiste ausklappen":"Seitenleiste einklappen",title:e?"Maximieren":"Minimieren",children:e?b.jsx(Ko,{className:"h-4 w-4","aria-hidden":"true"}):b.jsx(nT,{className:"h-4 w-4","aria-hidden":"true"})}),r&&b.jsx("button",{onClick:r,className:"p-1 rounded-md hover:bg-accent text-muted-foreground transition-colors cursor-pointer","aria-label":"Navigation schließen",children:b.jsx(bu,{className:"h-4 w-4","aria-hidden":"true"})})]}),b.jsx("nav",{className:"flex-1 space-y-1 px-3 py-4 overflow-y-auto",children:(()=>{let v=null;return qo.map(x=>{const k=x.group!==v;return v=x.group,b.jsxs("div",{className:"space-y-1",children:[k&&(e?v!==qo[0].group&&b.jsx("div",{className:"my-3 border-t border-border/30"}):b.jsx("div",{className:"mt-5 mb-1.5 px-3 text-[10px] font-bold uppercase tracking-widest text-muted-foreground/40 first:mt-0 select-none",children:x.group})),b.jsxs("a",{href:`#${x.id}`,onClick:r,"aria-current":n===x.id?"page":void 0,className:Re("flex w-full items-center rounded-md text-sm transition-all cursor-pointer",e?"justify-center p-2.5":"gap-3 px-3 py-2",n===x.id?e?"nav-active-collapsed":"nav-active":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),title:e?x.label:void 0,"aria-label":e?x.label:void 0,children:[b.jsx(x.icon,{className:"h-4.5 w-4.5 shrink-0","aria-hidden":"true"}),!e&&b.jsx("span",{className:"truncate",children:x.label})]})]},x.id)})})()}),b.jsx("div",{className:Re("py-3 text-xs text-muted-foreground border-t border-border/40 shrink-0",e?"px-2 text-center":"px-5"),children:e?b.jsx("div",{className:"flex justify-center",children:b.jsx("span",{className:Re("h-2.5 w-2.5 rounded-full ring-2 ring-black/40",o||!i?"bg-red-500":i.engine_reachable?i.brain&&!i.brain.ready?"bg-amber-500 animate-pulse":"bg-emerald-500 animate-pulse":"bg-amber-500"),title:o?"Zentrale antwortet nicht — Anzeigen evtl. veraltet":i?i.engine_reachable?i.brain&&!i.brain.ready?`Hirn offline (${i.brain.model??"fast"})`:"Engine + Hirn online":"Engine offline":"Backend offline"})}):b.jsxs("div",{className:"space-y-2 text-left",children:[o?b.jsxs("span",{className:"flex items-center gap-2 text-red-400",children:[b.jsx("span",{className:"h-2 w-2 rounded-full bg-red-500 animate-pulse"}),b.jsx("span",{className:"truncate",children:"Zentrale antwortet nicht"})]}):i?b.jsxs(b.Fragment,{children:[b.jsxs("span",{className:"flex items-center gap-2",children:[b.jsx("span",{className:Re("h-2 w-2 rounded-full animate-pulse",i.engine_reachable?"bg-emerald-500":"bg-amber-500")}),b.jsxs("span",{className:"truncate",children:["Engine ",i.engine_reachable?"online":"offline"]})]}),i.brain&&!i.brain.ready&&b.jsxs("span",{className:"flex items-center gap-2 text-amber-400",title:`Agent-Hirn '${i.brain.model??"fast"}' lädt nicht/abgestürzt`,children:[b.jsx("span",{className:"h-2 w-2 rounded-full bg-amber-500 animate-pulse"}),b.jsxs("span",{className:"truncate",children:["Hirn offline",i.brain.model?` (${i.brain.model})`:""]})]})]}):b.jsxs("span",{className:"flex items-center gap-2",children:[b.jsx("span",{className:"h-2 w-2 rounded-full bg-red-500"})," ",b.jsx("span",{className:"truncate",children:"Backend offline"})]}),(s==null?void 0:s.versions)&&b.jsxs("div",{className:"space-y-1 text-[9px] text-muted-foreground/60 mt-2 pt-2 border-t border-border/30",children:[b.jsxs("div",{className:"truncate",title:s.versions.mc2?`${s.versions.mc2.branch}-${s.versions.mc2.hash}${s.versions.mc2.dirty?"*":""} (${s.versions.mc2.date})`:"nicht gefunden",children:[b.jsx("strong",{children:"MC2:"})," ",s.versions.mc2?`${s.versions.mc2.hash}${s.versions.mc2.dirty?"*":""}`:"—"]}),b.jsxs("div",{className:"truncate",title:((u=s.versions.engine)==null?void 0:u.type)==="git"?`${s.versions.engine.branch}-${s.versions.engine.hash}${s.versions.engine.dirty?"*":""} (${s.versions.engine.date})`:((d=s.versions.engine)==null?void 0:d.version_text)||"unbekannt",children:[b.jsx("strong",{children:"Engine:"})," ",((f=s.versions.engine)==null?void 0:f.type)==="git"?`${s.versions.engine.hash}${s.versions.engine.dirty?"*":""}`:((m=(h=s.versions.engine)==null?void 0:h.version_text)==null?void 0:m.split(" ").pop())||"—"]}),b.jsxs("div",{className:"truncate",title:s.versions.hermes_agent?`${s.versions.hermes_agent.branch}-${s.versions.hermes_agent.hash}${s.versions.hermes_agent.dirty?"*":""} (${s.versions.hermes_agent.date})`:"nicht gefunden",children:[b.jsx("strong",{children:"Hermes Agent:"})," ",s.versions.hermes_agent?`${s.versions.hermes_agent.hash}${s.versions.hermes_agent.dirty?"*":""}`:"—"]})]})]})})]})}class RQ extends Rg.Component{constructor(){super(...arguments);ws(this,"state",{error:null})}static getDerivedStateFromError(r){return{error:r}}componentDidCatch(r,n){console.error("Unbehandelter UI-Fehler:",r,n.componentStack)}render(){return this.state.error?b.jsx("div",{className:"min-h-screen flex items-center justify-center bg-neutral-950 text-neutral-200 p-8",children:b.jsxs("div",{className:"max-w-lg space-y-4 text-center",children:[b.jsx("div",{className:"text-2xl",children:"Da ist etwas schiefgelaufen."}),b.jsx("div",{className:"text-sm text-neutral-400 break-all",children:this.state.error.message}),b.jsx("button",{className:"px-4 py-2 rounded-lg bg-neutral-800 hover:bg-neutral-700 border border-neutral-700",onClick:()=>window.location.reload(),children:"Neu laden"})]})}):this.props.children}}const $Q=new IM({defaultOptions:{queries:{retry:1,refetchOnWindowFocus:!1,staleTime:5e3}}});oM.createRoot(document.getElementById("root")).render(b.jsx(Rg.StrictMode,{children:b.jsx(RQ,{children:b.jsx(MM,{client:$Q,children:b.jsx(DQ,{})})})}));export{zQ as $,CT as A,Bg as B,tT as C,rT as D,Cv as E,YQ as F,LA as G,fT as H,XQ as I,N3 as J,W1 as K,_f as L,Ko as M,iT as N,I3 as O,V1 as P,KQ as Q,OT as R,kT as S,Gs as T,VP as U,aT as V,Kg as W,bu as X,_3 as Y,sT as Z,In as _,j3 as a,jf as a0,QM as a1,jT as a2,Vo as a3,AT as a4,As as a5,Nf as a6,UP as a7,Wg as a8,cT as a9,k3 as aa,E3 as ab,UQ as ac,Ug as ad,uT as ae,WP as af,P3 as ag,pT as ah,XM as ai,bT as aj,Hg as ak,hT as al,A3 as am,HQ as an,K1 as ao,WQ as ap,gT as aq,lf as ar,Rg as as,su as at,Ek as au,$8 as av,My as aw,mk as ax,pk as ay,Dg as az,Xg as b,ke as c,JQ as d,Re as e,Mm as f,Me as g,qQ as h,BQ as i,b as j,ZM as k,RA as l,VQ as m,$f as n,GQ as o,ZQ as p,De as q,y as r,FQ as s,QQ as t,xu as u,No as v,FR as w,HP as x,wT as y,eX as z}; +Tipp: Dafür wird evtl. das Box-Passwort gebraucht (oben rechts hinterlegen).`:""))}v.invalidateQueries({queryKey:De.health}),v.invalidateQueries({queryKey:De.services}),v.invalidateQueries({queryKey:De.models})}catch(Z){h("Reparatur fehlgeschlagen",String((Z==null?void 0:Z.message)||Z))}finally{k(Z=>({...Z,[M]:!1}))}}const E=((de=t==null?void 0:t.running)==null?void 0:de.length)??0,P=(r==null?void 0:r.services.filter(M=>M.ok).length)??0,j=(r==null?void 0:r.services.length)??0,_=j-P,O=(i==null?void 0:i.length)??0,N=(n?(n.os>0?1:0)+(n.engine>0?1:0)+(n.swap>0?1:0)+(n.models>0?1:0):0)+(((Y=n==null?void 0:n.components)==null?void 0:Y.filter(M=>M.update===!0).length)??0),C=u!=null&&u.available?u.open_count:0,R=d!=null&&d.available?d.items.filter(M=>M.status==="blocked").length:0,z=s?[s.gateway,s.memory,s.desktop_gateway]:[],F=z.filter(M=>M==null?void 0:M.ok).length,V=s?s.gateway.ok?s.memory.ok?s.desktop_gateway.ok?"":"Desktop-Gateway":"Gedächtnis-Leitung":"Modell-Leitung":"",Q=(ae=t==null?void 0:t.models)==null?void 0:ae.find(M=>M.role==="hermes"),B=Q!=null&&Q.name?(X=Q.name.split("/").pop())==null?void 0:X.replace(/\.gguf$/i,""):"",ue=i?i.filter(M=>["auto","agent","hermes"].includes(M.source)).length:0,G=r==null?void 0:r.services.filter(M=>!M.ok).map(M=>M.name).join(", "),le=n?[n.os>0&&"OS",n.engine>0&&"Engine",n.swap>0&&"Swap",n.models>0&&"Modelle"].filter(Boolean):[],fe=le.length>0?le.join(" + "):"";return b.jsxs("div",{className:"space-y-6",children:[b.jsxs("div",{children:[b.jsx("h1",{className:"bg-gradient-to-r from-foreground via-foreground to-primary bg-clip-text font-space text-2xl font-bold tracking-tight text-transparent",children:"Cockpit"}),b.jsx("p",{className:"text-sm text-muted-foreground",children:"Deine Box auf einen Blick — Details hinter jeder Kachel."})]}),b.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6 items-start",children:[b.jsxs("div",{className:"lg:col-span-2 space-y-6",children:[b.jsx(bQ,{verdict:f.verdict,memory:f.memory,warns:f.warns,problems:f.problems}),b.jsx(Q3,{}),b.jsxs("section",{children:[b.jsx(xd,{children:"Leistung"}),b.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[b.jsx(hQ,{}),b.jsx(pQ,{})]}),b.jsx("div",{className:"mt-4",children:b.jsx(yQ,{})})]}),b.jsxs("section",{children:[b.jsx(xd,{children:"Bereiche"}),b.jsxs("div",{className:"grid gap-4 grid-cols-2 md:grid-cols-3",children:[b.jsx(Io,{icon:Ug,title:"Auftragsbuch",value:u!=null&&u.available?C:"—",unit:C===1?"Vorschlag":"Vorschläge",tone:u?R>0||C>0?"warn":"ok":"loading",hint:R>0?`${R} Karte${R===1?"":"n"} wartet auf deine Antwort`:C>0?`${C} offene Patches`:"Keine ausstehenden Vorschläge",onClick:()=>e("auftraege")}),b.jsx(Io,{icon:UP,title:"Modelle",value:E,unit:"warm",tone:E>0?"ok":"muted",hint:B?`Hirn: ${B}`:"Kein Hermes-Modell geladen",onClick:()=>e("models")}),b.jsx(Io,{icon:Bg,title:"Gedächtnis",value:i?O:"…",unit:"Notizen",tone:i?"ok":"loading",hint:i?`${O} Fakten (${ue} auto gelernt)`:"Gedächtnis-Pool laden...",onClick:()=>e("memory")}),b.jsx(Io,{icon:Nf,title:"Dienste",value:r?`${P}/${j}`:"…",unit:"laufen",tone:r?_>0?"warn":"ok":"loading",hint:G?`Ausfall: ${G}`:"Alle Dienste online",onClick:()=>Of("maintenance")}),b.jsx(Io,{icon:Hg,title:"Updates",value:n?N>0?N:"0":"…",unit:N>0?"bereit":"aktuell",tone:n?N>0?"warn":"ok":"loading",hint:N>0?`Verfügbar: ${fe}`:"Alles auf dem neuesten Stand",onClick:()=>Of("maintenance")}),b.jsx(Io,{icon:Wg,title:"Verbinden",value:s?`${F}/${z.length}`:"…",unit:"Leitungen",tone:s?F===z.length?"ok":"warn":"loading",hint:V?`Gestört: ${V}`:"Hermes Desktop & IDEs bereit",onClick:()=>e("connect")})]})]})]}),b.jsxs("div",{className:"space-y-6",children:[b.jsx(wQ,{problems:f.problems,pendingCount:N,openAuftraege:C,blockedIdeen:R,busy:x,onRepair:S,onNavigate:e}),b.jsxs("section",{children:[b.jsx(xd,{children:"Anstehendes"}),b.jsx(X3,{})]}),b.jsxs("section",{children:[b.jsx(xd,{children:"Werkzeuge & Diagnose"}),b.jsx(SQ,{agent:o,svcErrors:_,onNavigate:e})]})]})]}),m]})}function xd({children:e}){return b.jsx("p",{className:"mb-2 ml-0.5 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground/60",children:e})}function bQ({verdict:e,memory:t,warns:r,problems:n}){const i=r.length?`${r[0].label}: ${r[0].detail}${r.length>1?` (+${r.length-1} weitere)`:""}`:t.status==="full"?t.text:"Nichts Schlimmes — nur ein Hinweis.",o=n.length?`${n[0].label}: ${n[0].detail}${n.length>1?` (+${n.length-1} weitere)`:""}`:"Ein wichtiger Dienst hakt.",s={loading:{ring:"border-border/60 bg-card/45",icon:_f,iconCls:"text-muted-foreground animate-spin",title:"Box wird geprüft …",sub:"Einen Moment."},gut:{ring:"border-emerald-500/40 bg-emerald-500/5",icon:hT,iconCls:"text-emerald-400",title:"Box gesund",sub:"Alle wichtigen Dienste laufen."},warn:{ring:"border-amber-500/40 bg-amber-500/5",icon:Gs,iconCls:"text-amber-400",title:"Kleinigkeit an der Box",sub:i},problem:{ring:"border-red-500/50 bg-red-500/5",icon:Gs,iconCls:"text-red-400",title:"Box braucht Hilfe",sub:o}}[e],u=s.icon,d={ok:"text-emerald-400",warn:"text-amber-400",full:"text-red-400",unknown:"text-muted-foreground"}[t.status],f={ok:"bg-emerald-500",warn:"bg-amber-500",full:"bg-red-500",unknown:"bg-muted-foreground/40"}[t.status];return b.jsxs("div",{className:Re("flex flex-col gap-4 rounded-2xl border p-5 shadow-lg shadow-black/15 backdrop-blur-md transition-colors sm:flex-row sm:items-center sm:justify-between h-full",s.ring),children:[b.jsxs("div",{className:"flex items-center gap-3",children:[b.jsx("div",{className:"flex h-11 w-11 shrink-0 items-center justify-center rounded-xl border border-border/40 bg-background/30",children:b.jsx(u,{className:Re("h-6 w-6",s.iconCls)})}),b.jsxs("div",{className:"min-w-0",children:[b.jsx("h2",{className:"text-base font-bold tracking-tight text-foreground",children:s.title}),b.jsx("p",{className:"text-xs text-muted-foreground",children:s.sub})]})]}),b.jsxs("div",{className:"w-full max-w-[16rem] rounded-xl border border-border/30 bg-background/20 p-3",children:[b.jsxs("div",{className:"mb-1.5 flex items-center justify-between text-[11px]",children:[b.jsxs("span",{className:"flex items-center gap-1.5 font-semibold uppercase tracking-wider text-muted-foreground",children:[b.jsx(fT,{className:"h-3.5 w-3.5"})," Speicher"]}),b.jsx("span",{className:Re("font-mono font-bold",d),children:t.status==="unknown"?"—":`${t.usedGb.toFixed(1)} / ${t.totalGb.toFixed(1)} GB`})]}),b.jsx("div",{className:"h-2 w-full overflow-hidden rounded-full border border-border/30 bg-background/50",children:b.jsx("div",{className:Re("h-full rounded-full transition-all duration-500",f),style:{width:`${t.pct}%`}})})]})]})}function wQ({problems:e,pendingCount:t,openAuftraege:r,blockedIdeen:n,busy:i,onRepair:o,onNavigate:s}){const u=t>0,d=r>0,f=n>0,h=e.length===0&&!u&&!d&&!f;return b.jsx("div",{className:"h-full flex flex-col justify-between",children:h?b.jsxs("div",{className:"flex items-center gap-3 rounded-2xl border border-emerald-500/25 bg-emerald-500/5 p-4 h-full",children:[b.jsx(tT,{className:"h-5 w-5 shrink-0 text-emerald-400"}),b.jsxs("div",{children:[b.jsx("p",{className:"text-sm font-semibold text-foreground",children:"Nichts zu tun"}),b.jsx("p",{className:"text-xs text-muted-foreground",children:"Alles läuft. Du musst gerade nichts abnicken."})]})]}):b.jsxs("div",{className:"space-y-2 h-full flex flex-col justify-center",children:[e.map(m=>b.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3 rounded-2xl border border-red-500/25 bg-red-500/5 p-4",children:[b.jsxs("div",{className:"flex min-w-0 items-center gap-3 w-full",children:[b.jsx("span",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg border border-red-500/30 bg-background/30 text-red-300",children:b.jsx(m.icon,{className:"h-4.5 w-4.5"})}),b.jsxs("div",{className:"min-w-0 flex-1",children:[b.jsx("p",{className:"text-sm font-bold text-foreground",children:m.label}),b.jsx("p",{className:"truncate text-xs text-muted-foreground",children:m.detail})]})]}),m.repair&&b.jsxs("button",{onClick:()=>m.repair&&o(m.id,m.repair),disabled:!!i[m.id],className:"flex h-9 shrink-0 items-center gap-1.5 rounded-lg border border-red-500/40 bg-red-500/10 px-3 text-[11px] font-bold uppercase tracking-wide text-red-300 transition-all hover:bg-red-500/20 cursor-pointer disabled:opacity-60 w-full sm:w-auto justify-center",children:[i[m.id]?b.jsx(_f,{className:"h-3.5 w-3.5 animate-spin"}):b.jsx(jT,{className:"h-3.5 w-3.5"}),m.repair.label]})]},m.id)),f&&b.jsxs("button",{onClick:()=>s("auftraege"),className:"flex w-full items-center justify-between gap-3 rounded-2xl border border-red-500/30 bg-red-500/5 p-4 text-left transition-all hover:bg-red-500/10 cursor-pointer",children:[b.jsxs("div",{className:"flex items-center gap-3",children:[b.jsx("span",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg border border-red-500/30 bg-background/30 text-red-300",children:b.jsx(WP,{className:"h-4.5 w-4.5"})}),b.jsxs("div",{children:[b.jsxs("p",{className:"text-sm font-bold text-foreground",children:[n," Karte",n===1?"":"n"," braucht deine Antwort"]}),b.jsx("p",{className:"text-xs text-muted-foreground",children:"Die Box hängt an einer Frage und wartet auf dich."})]})]}),b.jsx(Ko,{className:"h-4 w-4 shrink-0 text-red-300/70"})]}),d&&b.jsxs("button",{onClick:()=>s("auftraege"),className:"flex w-full items-center justify-between gap-3 rounded-2xl border border-primary/30 bg-primary/5 p-4 text-left transition-all hover:bg-primary/10 cursor-pointer",children:[b.jsxs("div",{className:"flex items-center gap-3",children:[b.jsx("span",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg border border-primary/30 bg-background/30 text-primary",children:b.jsx(Ug,{className:"h-4.5 w-4.5"})}),b.jsxs("div",{children:[b.jsxs("p",{className:"text-sm font-bold text-foreground",children:[r," Vorschl",r===1?"ag":"äge"," im Auftragsbuch"]}),b.jsx("p",{className:"text-xs text-muted-foreground",children:"Annehmen oder ablehnen."})]})]}),b.jsx(Ko,{className:"h-4 w-4 shrink-0 text-primary/70"})]}),u&&b.jsxs("button",{onClick:()=>Of("maintenance"),className:"flex w-full items-center justify-between gap-3 rounded-2xl border border-amber-500/30 bg-amber-500/5 p-4 text-left transition-all hover:bg-amber-500/10 cursor-pointer",children:[b.jsxs("div",{className:"flex items-center gap-3",children:[b.jsx("span",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg border border-amber-500/30 bg-background/30 text-amber-300",children:b.jsx(Hg,{className:"h-4.5 w-4.5"})}),b.jsxs("div",{children:[b.jsxs("p",{className:"text-sm font-bold text-foreground",children:[t," Update",t===1?"":"s"," bereit"]}),b.jsx("p",{className:"text-xs text-muted-foreground",children:"Ansehen und entscheiden."})]})]}),b.jsx(Ko,{className:"h-4 w-4 shrink-0 text-amber-300/70"})]})]})})}function SQ({agent:e,svcErrors:t,onNavigate:r}){const n=[{label:"Hermes Agent",status:e?e.gateway_reachable?"Bereit":"Offline":"…",tone:e?e.gateway_reachable?"ok":"alert":"loading",action:()=>r("agent")},{label:"Konsole (Box-Shell)",status:e?e.box_console_reachable?"Bereit":"Offline":"…",tone:e?e.box_console_reachable?"ok":"warn":"loading",action:()=>r("konsole")},{label:"Systemlogs & Diagnose",status:t>0?`${t} Fehler`:"Keine Fehler",tone:t>0?"alert":"ok",action:()=>Of("logs")},{label:"Wissens-Vault",status:"Öffnen",tone:"muted",action:()=>r("wissen")},{label:"Chronik & Zeitmaschine",status:"Öffnen",tone:"muted",action:()=>r("chronik")}];return b.jsx("div",{className:"rounded-2xl border border-border/60 bg-card/30 p-4 space-y-3 shadow-sm",children:b.jsx("div",{className:"divide-y divide-border/20",children:n.map((i,o)=>{const s={loading:"bg-muted-foreground/45 animate-pulse",ok:"bg-emerald-500 shadow-[0_0_8px_rgba(16,185,129,0.4)]",warn:"bg-amber-500 shadow-[0_0_8px_rgba(245,158,11,0.4)]",alert:"bg-red-500 shadow-[0_0_8px_rgba(239,68,68,0.4)]",muted:"bg-muted-foreground/30"}[i.tone];return b.jsxs("button",{onClick:i.action,className:"w-full py-2.5 px-1.5 flex items-center justify-between text-left hover:bg-card/45 rounded-lg transition-all group cursor-pointer text-xs",children:[b.jsx("span",{className:"text-muted-foreground group-hover:text-foreground transition-colors font-medium",children:i.label}),b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsx("span",{className:Re("text-[10px] font-semibold font-mono",i.tone==="ok"?"text-emerald-400":i.tone==="warn"?"text-amber-400":i.tone==="alert"?"text-red-400":"text-muted-foreground/60"),children:i.status}),b.jsx("span",{className:Re("h-1.5 w-1.5 rounded-full",s)})]})]},o)})})})}const kQ=y.lazy(()=>In(()=>import("./ModelsView-D0ujmpST.js"),__vite__mapDeps([0,1,2,3,4])).then(e=>({default:e.ModelsView}))),EQ=y.lazy(()=>In(()=>import("./ConnectView-Ckkd4eR_.js"),__vite__mapDeps([5,6,7,8])).then(e=>({default:e.ConnectView}))),PQ=y.lazy(()=>In(()=>import("./MemoryView-B6IXcZEl.js"),__vite__mapDeps([9,8,10,11])).then(e=>({default:e.MemoryView}))),AQ=y.lazy(()=>In(()=>import("./AgentView-LDHesxj5.js"),[]).then(e=>({default:e.AgentView}))),OQ=y.lazy(()=>In(()=>import("./KonsoleView-DuxI06Wh.js"),[]).then(e=>({default:e.KonsoleView}))),CQ=y.lazy(()=>In(()=>import("./GuideView-BAhrG_68.js"),__vite__mapDeps([12,11,3,4,13])).then(e=>({default:e.GuideView}))),jQ=y.lazy(()=>In(()=>import("./AuftragsbuchView-MX5C46g1.js"),__vite__mapDeps([14,13,1,10,4,2])).then(e=>({default:e.AuftragsbuchView}))),_Q=y.lazy(()=>In(()=>import("./ChronikView-DziulU9V.js"),__vite__mapDeps([15,2])).then(e=>({default:e.ChronikView}))),NQ=y.lazy(()=>In(()=>import("./EigenlebenView-BpLy1pkU.js"),__vite__mapDeps([16,11,7])).then(e=>({default:e.EigenlebenView}))),IQ=y.lazy(()=>In(()=>import("./WissenView-C7GDdv1b.js"),__vite__mapDeps([17,6])).then(e=>({default:e.WissenView})));function MQ(){return b.jsx("div",{className:"flex h-64 items-center justify-center text-muted-foreground",children:b.jsx(_f,{className:"h-5 w-5 animate-spin","aria-label":"Lädt …"})})}const TQ=/Mac|iPhone|iPad/.test(navigator.platform);function DQ(){V3(),S3();const[e,t]=y.useState(()=>{const S=window.location.hash.slice(1);return qo.some(E=>E.id===S)?S:"dashboard"}),r=y.useCallback(S=>{window.location.hash.slice(1)===S?t(S):window.location.hash=S},[]),[n,i]=y.useState(()=>localStorage.getItem("mc_sidebar_collapsed")==="true"),[o,s]=y.useState(!1),[u,d]=y.useState(!1),[f,h]=y.useState("maintenance"),{data:m,isError:v}=TA(),{data:x}=$f();y.useEffect(()=>{document.documentElement.classList.add("dark")},[]),y.useEffect(()=>{const S=E=>{var j;h(((j=E.detail)==null?void 0:j.tab)||"maintenance"),d(!0)};return window.addEventListener("open-system-drawer",S),()=>window.removeEventListener("open-system-drawer",S)},[]),y.useEffect(()=>{const S=E=>{var j;const P=(j=E.detail)==null?void 0:j.view;P&&r(P)};return window.addEventListener("mc-navigate",S),()=>window.removeEventListener("mc-navigate",S)},[r]),y.useEffect(()=>{const S=()=>{const E=window.location.hash.slice(1);qo.some(P=>P.id===E)&&t(E)};return window.addEventListener("hashchange",S),()=>window.removeEventListener("hashchange",S)},[]),y.useEffect(()=>{s(!1)},[e]);const k=qo.find(S=>S.id===e);return b.jsxs("div",{className:"flex h-full relative",children:[b.jsx("div",{className:"fixed inset-0 -z-50 pointer-events-none",style:{backgroundColor:"hsl(224,30%,6%)",backgroundImage:["radial-gradient(45% 40% at 12% 8%, hsl(172 72% 50% / 0.10), transparent 70%)","radial-gradient(50% 45% at 88% 92%, hsl(270 70% 60% / 0.10), transparent 70%)","radial-gradient(40% 35% at 75% 30%, hsl(239 70% 62% / 0.07), transparent 70%)"].join(", ")}}),b.jsx($R,{onNavigate:r}),b.jsx(B3,{open:u,onClose:()=>d(!1),defaultTab:f}),b.jsx("aside",{className:Re("hidden md:flex shrink-0 flex-col border-r border-border/40 bg-card/45 backdrop-blur-md transition-all duration-300 ease-in-out",n?"w-16":"w-60"),children:b.jsx(gP,{collapsed:n,onToggleCollapse:()=>{i(S=>{const E=!S;return localStorage.setItem("mc_sidebar_collapsed",E.toString()),E})},view:e,health:m,backendDown:v,sysStatus:x})}),b.jsxs("div",{className:Re("md:hidden fixed inset-0 z-50 transition-opacity duration-200",o?"opacity-100":"pointer-events-none opacity-0"),"aria-hidden":!o,children:[b.jsx("div",{className:"absolute inset-0 bg-black/60",onClick:()=>s(!1)}),b.jsx("aside",{className:Re("absolute inset-y-0 left-0 flex w-72 max-w-[85vw] flex-col border-r border-border/40 bg-[hsl(224,28%,8%)] transition-transform duration-300 ease-in-out",o?"translate-x-0":"-translate-x-full"),children:b.jsx(gP,{collapsed:!1,onClose:()=>s(!1),view:e,health:m,backendDown:v,sysStatus:x})})]}),b.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[b.jsxs("header",{className:"flex h-14 shrink-0 items-center justify-between gap-3 border-b border-border/40 px-4 md:px-6 bg-card/20 backdrop-blur-sm",children:[b.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[b.jsx("button",{onClick:()=>s(!0),className:"md:hidden p-1.5 -ml-1 rounded-md hover:bg-accent text-muted-foreground transition-colors cursor-pointer","aria-label":"Navigation öffnen",children:b.jsx(yT,{className:"h-5 w-5","aria-hidden":"true"})}),b.jsx("div",{className:"truncate text-xs font-medium text-muted-foreground tracking-wide uppercase font-sans",children:k.hint})]}),b.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[b.jsx(x3,{}),b.jsx("a",{href:"https://git.tobisniceshomelab.ddnsfree.com/Hitonabi/mission-control-v2/src/branch/main/docs/BEDIENUNG.md",target:"_blank",rel:"noopener",className:"hidden sm:flex h-8 items-center rounded-md border border-border/40 bg-background/40 px-2.5 text-xs text-muted-foreground hover:bg-accent hover:text-accent-foreground transition-all cursor-pointer font-semibold",title:"Bedien-Anleitung",children:"Hilfe"}),b.jsxs("button",{onClick:()=>{const S=new KeyboardEvent("keydown",{key:"k",metaKey:!0});document.dispatchEvent(S)},className:"flex items-center gap-2 rounded-md border border-border/40 bg-background/40 px-2.5 py-1.5 text-xs text-muted-foreground hover:bg-accent hover:text-accent-foreground transition-all cursor-pointer",children:[b.jsx(lT,{className:"h-3.5 w-3.5"}),b.jsx("span",{className:"hidden sm:inline",children:"Suchen"}),b.jsx("kbd",{className:"hidden sm:inline rounded bg-muted px-1.5 py-0.5 font-mono text-[9px]",children:TQ?"⌘K":"Strg+K"})]})]})]}),b.jsx("main",{className:"flex-1 overflow-y-auto p-4 md:p-6 scrollbar-thin",children:b.jsxs(y.Suspense,{fallback:b.jsx(MQ,{}),children:[e==="dashboard"&&b.jsx(xQ,{onNavigate:S=>r(S)}),e==="auftraege"&&b.jsx(jQ,{}),e==="models"&&b.jsx(kQ,{}),e==="connect"&&b.jsx(EQ,{}),e==="memory"&&b.jsx(PQ,{}),e==="wissen"&&b.jsx(IQ,{}),e==="chronik"&&b.jsx(_Q,{}),e==="eigenleben"&&b.jsx(NQ,{}),e==="agent"&&b.jsx(AQ,{}),e==="konsole"&&b.jsx(OQ,{}),e==="guide"&&b.jsx(CQ,{})]})})]})]})}function gP({collapsed:e,onToggleCollapse:t,onClose:r,view:n,health:i,backendDown:o,sysStatus:s}){var u,d,f,h,m;return b.jsxs(b.Fragment,{children:[b.jsxs("div",{className:Re("flex items-center py-4 border-b border-border/40 shrink-0",e?"flex-col gap-3 px-2":"justify-between px-5"),children:[b.jsxs("div",{className:"flex items-center gap-2 overflow-hidden",children:[b.jsx("div",{className:"h-7 w-7 rounded-lg bg-primary shadow-md shadow-primary/20 shrink-0"}),!e&&b.jsxs("div",{className:"leading-tight",children:[b.jsx("div",{className:"text-sm font-semibold tracking-wide font-space",children:"Mission Control"}),b.jsx("div",{className:"text-xs text-muted-foreground",children:"2.0"})]})]}),t&&b.jsx("button",{onClick:t,className:"p-1 rounded-md hover:bg-accent text-muted-foreground transition-colors cursor-pointer","aria-label":e?"Seitenleiste ausklappen":"Seitenleiste einklappen",title:e?"Maximieren":"Minimieren",children:e?b.jsx(Ko,{className:"h-4 w-4","aria-hidden":"true"}):b.jsx(nT,{className:"h-4 w-4","aria-hidden":"true"})}),r&&b.jsx("button",{onClick:r,className:"p-1 rounded-md hover:bg-accent text-muted-foreground transition-colors cursor-pointer","aria-label":"Navigation schließen",children:b.jsx(bu,{className:"h-4 w-4","aria-hidden":"true"})})]}),b.jsx("nav",{className:"flex-1 space-y-1 px-3 py-4 overflow-y-auto",children:(()=>{let v=null;return qo.map(x=>{const k=x.group!==v;return v=x.group,b.jsxs("div",{className:"space-y-1",children:[k&&(e?v!==qo[0].group&&b.jsx("div",{className:"my-3 border-t border-border/30"}):b.jsx("div",{className:"mt-5 mb-1.5 px-3 text-[10px] font-bold uppercase tracking-widest text-muted-foreground/40 first:mt-0 select-none",children:x.group})),b.jsxs("a",{href:`#${x.id}`,onClick:r,"aria-current":n===x.id?"page":void 0,className:Re("flex w-full items-center rounded-md text-sm transition-all cursor-pointer",e?"justify-center p-2.5":"gap-3 px-3 py-2",n===x.id?e?"nav-active-collapsed":"nav-active":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),title:e?x.label:void 0,"aria-label":e?x.label:void 0,children:[b.jsx(x.icon,{className:"h-4.5 w-4.5 shrink-0","aria-hidden":"true"}),!e&&b.jsx("span",{className:"truncate",children:x.label})]})]},x.id)})})()}),b.jsx("div",{className:Re("py-3 text-xs text-muted-foreground border-t border-border/40 shrink-0",e?"px-2 text-center":"px-5"),children:e?b.jsx("div",{className:"flex justify-center",children:b.jsx("span",{className:Re("h-2.5 w-2.5 rounded-full ring-2 ring-black/40",o||!i?"bg-red-500":i.engine_reachable?i.brain&&!i.brain.ready?"bg-amber-500 animate-pulse":"bg-emerald-500 animate-pulse":"bg-amber-500"),title:o?"Zentrale antwortet nicht — Anzeigen evtl. veraltet":i?i.engine_reachable?i.brain&&!i.brain.ready?`Hirn offline (${i.brain.model??"fast"})`:"Engine + Hirn online":"Engine offline":"Backend offline"})}):b.jsxs("div",{className:"space-y-2 text-left",children:[o?b.jsxs("span",{className:"flex items-center gap-2 text-red-400",children:[b.jsx("span",{className:"h-2 w-2 rounded-full bg-red-500 animate-pulse"}),b.jsx("span",{className:"truncate",children:"Zentrale antwortet nicht"})]}):i?b.jsxs(b.Fragment,{children:[b.jsxs("span",{className:"flex items-center gap-2",children:[b.jsx("span",{className:Re("h-2 w-2 rounded-full animate-pulse",i.engine_reachable?"bg-emerald-500":"bg-amber-500")}),b.jsxs("span",{className:"truncate",children:["Engine ",i.engine_reachable?"online":"offline"]})]}),i.brain&&!i.brain.ready&&b.jsxs("span",{className:"flex items-center gap-2 text-amber-400",title:`Agent-Hirn '${i.brain.model??"fast"}' lädt nicht/abgestürzt`,children:[b.jsx("span",{className:"h-2 w-2 rounded-full bg-amber-500 animate-pulse"}),b.jsxs("span",{className:"truncate",children:["Hirn offline",i.brain.model?` (${i.brain.model})`:""]})]})]}):b.jsxs("span",{className:"flex items-center gap-2",children:[b.jsx("span",{className:"h-2 w-2 rounded-full bg-red-500"})," ",b.jsx("span",{className:"truncate",children:"Backend offline"})]}),(s==null?void 0:s.versions)&&b.jsxs("div",{className:"space-y-1 text-[9px] text-muted-foreground/60 mt-2 pt-2 border-t border-border/30",children:[b.jsxs("div",{className:"truncate",title:s.versions.mc2?`${s.versions.mc2.branch}-${s.versions.mc2.hash}${s.versions.mc2.dirty?"*":""} (${s.versions.mc2.date})`:"nicht gefunden",children:[b.jsx("strong",{children:"MC2:"})," ",s.versions.mc2?`${s.versions.mc2.hash}${s.versions.mc2.dirty?"*":""}`:"—"]}),b.jsxs("div",{className:"truncate",title:((u=s.versions.engine)==null?void 0:u.type)==="git"?`${s.versions.engine.branch}-${s.versions.engine.hash}${s.versions.engine.dirty?"*":""} (${s.versions.engine.date})`:((d=s.versions.engine)==null?void 0:d.version_text)||"unbekannt",children:[b.jsx("strong",{children:"Engine:"})," ",((f=s.versions.engine)==null?void 0:f.type)==="git"?`${s.versions.engine.hash}${s.versions.engine.dirty?"*":""}`:((m=(h=s.versions.engine)==null?void 0:h.version_text)==null?void 0:m.split(" ").pop())||"—"]}),b.jsxs("div",{className:"truncate",title:s.versions.hermes_agent?`${s.versions.hermes_agent.branch}-${s.versions.hermes_agent.hash}${s.versions.hermes_agent.dirty?"*":""} (${s.versions.hermes_agent.date})`:"nicht gefunden",children:[b.jsx("strong",{children:"Hermes Agent:"})," ",s.versions.hermes_agent?`${s.versions.hermes_agent.hash}${s.versions.hermes_agent.dirty?"*":""}`:"—"]})]})]})})]})}class RQ extends Rg.Component{constructor(){super(...arguments);ws(this,"state",{error:null})}static getDerivedStateFromError(r){return{error:r}}componentDidCatch(r,n){console.error("Unbehandelter UI-Fehler:",r,n.componentStack)}render(){return this.state.error?b.jsx("div",{className:"min-h-screen flex items-center justify-center bg-neutral-950 text-neutral-200 p-8",children:b.jsxs("div",{className:"max-w-lg space-y-4 text-center",children:[b.jsx("div",{className:"text-2xl",children:"Da ist etwas schiefgelaufen."}),b.jsx("div",{className:"text-sm text-neutral-400 break-all",children:this.state.error.message}),b.jsx("button",{className:"px-4 py-2 rounded-lg bg-neutral-800 hover:bg-neutral-700 border border-neutral-700",onClick:()=>window.location.reload(),children:"Neu laden"})]})}):this.props.children}}const $Q=new IM({defaultOptions:{queries:{retry:1,refetchOnWindowFocus:!1,staleTime:5e3}}});oM.createRoot(document.getElementById("root")).render(b.jsx(Rg.StrictMode,{children:b.jsx(RQ,{children:b.jsx(MM,{client:$Q,children:b.jsx(DQ,{})})})}));export{zQ as $,CT as A,Bg as B,tT as C,rT as D,Cv as E,YQ as F,LA as G,fT as H,XQ as I,N3 as J,W1 as K,_f as L,Ko as M,iT as N,I3 as O,V1 as P,KQ as Q,OT as R,kT as S,Gs as T,VP as U,aT as V,Kg as W,bu as X,_3 as Y,sT as Z,In as _,j3 as a,jf as a0,QM as a1,jT as a2,Vo as a3,AT as a4,As as a5,Nf as a6,UP as a7,Wg as a8,cT as a9,k3 as aa,E3 as ab,UQ as ac,Ug as ad,uT as ae,WP as af,P3 as ag,pT as ah,XM as ai,bT as aj,Hg as ak,hT as al,A3 as am,HQ as an,K1 as ao,WQ as ap,gT as aq,lf as ar,Rg as as,su as at,Ek as au,$8 as av,My as aw,mk as ax,pk as ay,Dg as az,Xg as b,ke as c,JQ as d,Re as e,Mm as f,Me as g,qQ as h,BQ as i,b as j,ZM as k,RA as l,VQ as m,$f as n,GQ as o,ZQ as p,De as q,y as r,FQ as s,QQ as t,xu as u,No as v,FR as w,HP as x,wT as y,eX as z}; diff --git a/frontend/dist/assets/layers-CMPjDrtd.js b/frontend/dist/assets/layers-BVmbzkl8.js similarity index 91% rename from frontend/dist/assets/layers-CMPjDrtd.js rename to frontend/dist/assets/layers-BVmbzkl8.js index 986a206..26c33af 100644 --- a/frontend/dist/assets/layers-CMPjDrtd.js +++ b/frontend/dist/assets/layers-BVmbzkl8.js @@ -1,4 +1,4 @@ -import{c as a}from"./index-Cpokgrtb.js";/** +import{c as a}from"./index-CYprWjkZ.js";/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/lightbulb-BwLArGh_.js b/frontend/dist/assets/lightbulb-DygeZkD3.js similarity index 90% rename from frontend/dist/assets/lightbulb-BwLArGh_.js rename to frontend/dist/assets/lightbulb-DygeZkD3.js index d70eae1..762cce3 100644 --- a/frontend/dist/assets/lightbulb-BwLArGh_.js +++ b/frontend/dist/assets/lightbulb-DygeZkD3.js @@ -1,4 +1,4 @@ -import{c as t}from"./index-Cpokgrtb.js";/** +import{c as t}from"./index-CYprWjkZ.js";/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/rotate-ccw-wHFM0h2t.js b/frontend/dist/assets/rotate-ccw-CXI0Tldw.js similarity index 88% rename from frontend/dist/assets/rotate-ccw-wHFM0h2t.js rename to frontend/dist/assets/rotate-ccw-CXI0Tldw.js index 97f41f2..afbdd8e 100644 --- a/frontend/dist/assets/rotate-ccw-wHFM0h2t.js +++ b/frontend/dist/assets/rotate-ccw-CXI0Tldw.js @@ -1,4 +1,4 @@ -import{c as t}from"./index-Cpokgrtb.js";/** +import{c as t}from"./index-CYprWjkZ.js";/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/send-grypp2_x.js b/frontend/dist/assets/send-CjExvNpv.js similarity index 90% rename from frontend/dist/assets/send-grypp2_x.js rename to frontend/dist/assets/send-CjExvNpv.js index b5b4db7..e9c2220 100644 --- a/frontend/dist/assets/send-grypp2_x.js +++ b/frontend/dist/assets/send-CjExvNpv.js @@ -1,4 +1,4 @@ -import{c as a}from"./index-Cpokgrtb.js";/** +import{c as a}from"./index-CYprWjkZ.js";/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/zap-Bc_35rOi.js b/frontend/dist/assets/zap-hBXNCtdw.js similarity index 96% rename from frontend/dist/assets/zap-Bc_35rOi.js rename to frontend/dist/assets/zap-hBXNCtdw.js index 80bfc2e..2f09a4d 100644 --- a/frontend/dist/assets/zap-Bc_35rOi.js +++ b/frontend/dist/assets/zap-hBXNCtdw.js @@ -1,4 +1,4 @@ -import{c as a}from"./index-Cpokgrtb.js";/** +import{c as a}from"./index-CYprWjkZ.js";/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/index.html b/frontend/dist/index.html index 015540e..7cd40f6 100644 --- a/frontend/dist/index.html +++ b/frontend/dist/index.html @@ -7,7 +7,7 @@ Mission Control 2.0 - + diff --git a/frontend/src/views/AuftragsbuchView.tsx b/frontend/src/views/AuftragsbuchView.tsx index ce22607..9311e86 100644 --- a/frontend/src/views/AuftragsbuchView.tsx +++ b/frontend/src/views/AuftragsbuchView.tsx @@ -164,7 +164,9 @@ function IdeenSection() { const qc = useQueryClient() const { showAlert, showConfirm, dialogElement } = useDialog() const [text, setText] = useState("") - const [welt, setWelt] = useState<"box" | "ide">("box") + // Intake-Modus: Box baut · IDE simpel (schnelles Konzept) · IDE gründlich (volle Kaskade). + const [modus, setModus] = useState<"box" | "simpel" | "gruendlich">("box") + const isIde = modus !== "box" const [sending, setSending] = useState(false) const [busy, setBusy] = useState>({}) const [openLog, setOpenLog] = useState(null) @@ -186,7 +188,7 @@ function IdeenSection() { // Lange Eingaben: Kurzfassung als Titel, alles als Notiz — der Specifier der Box // macht daraus ohnehin einen sauberen Auftrag. const titel = t.length > 160 ? t.slice(0, 157) + "…" : t - await api("/api/ideen", { method: "POST", body: JSON.stringify({ titel, notiz: t.length > 160 ? t : "", welt }) }) + await api("/api/ideen", { method: "POST", body: JSON.stringify({ titel, notiz: t.length > 160 ? t : "", welt: isIde ? "ide" : "box", tiefe: isIde ? modus : "" }) }) setText("") reload() } catch (e: any) { @@ -437,35 +439,45 @@ function IdeenSection() { onClick={submit} disabled={sending || text.trim().length < 3} className={cn("flex h-9 shrink-0 items-center gap-1.5 rounded-lg border px-3 text-[11px] font-bold uppercase tracking-wide transition-all cursor-pointer disabled:opacity-50", - welt === "ide" ? "border-violet-500/40 bg-violet-500/10 text-violet-300 hover:bg-violet-500/20" : "border-primary/40 bg-primary/10 text-primary hover:bg-primary/20")}> - {sending ? : welt === "ide" ? : } - {welt === "ide" ? "Vorbereiten" : "In die Queue"} + isIde ? "border-violet-500/40 bg-violet-500/10 text-violet-300 hover:bg-violet-500/20" : "border-primary/40 bg-primary/10 text-primary hover:bg-primary/20")}> + {sending ? : isIde ? : } + {isIde ? "Vorbereiten" : "In die Queue"}
Modus
+

- {welt === "ide" ? ( + {isIde ? ( <> - IDE-Welt: Die Box denkt das Konzept wasserdicht durch - (mehrere Denk-Runden mit Kritiker), legt ein leeres Gitea-Repo an und füllt es nur mit den - wichtigen Dokumenten (Konzept, Roadmap, AGENTS.md, .aiexclude) — kein Code. Danach öffnest - du das Repo in Zed und baust selbst. Das Vorbereiten dauert ein paar Minuten. + IDE-Welt{modus === "gruendlich" ? " · gründlich" : " · simpel"}:{" "} + Die Box denkt das Konzept durch{modus === "gruendlich" + ? " — volle Kaskade: mehrere Fach-Rollen, bis zu 3 Denk-Runden, mehrfacher Kritiker-Härtetest (für große/ambitionierte Projekte, dauert entsprechend)" + : " — schlank: 2 Rollen, 1 Denk-Runde (für kleine, klar umrissene Projekte, ein paar Minuten)"}, legt + ein leeres Gitea-Repo an und füllt es nur mit den wichtigen Dokumenten (Konzept, Roadmap, AGENTS.md, + .aiexclude) — kein Code. Danach öffnest du das Repo in Zed und baust selbst. ) : ( <>