From 2c60caf79037a9b3b24ef8cce12759cfc32cd37b Mon Sep 17 00:00:00 2001 From: Hitonabi Date: Fri, 26 Jun 2026 13:50:46 +0200 Subject: [PATCH] Update API token stats pricing and footer to June 2026 rates --- backend/routers/system.py | 5 +++-- .../dist/assets/{index-CNk5p9Ix.js => index-9qPdHcPL.js} | 2 +- frontend/dist/index.html | 2 +- frontend/src/views/DashboardView.tsx | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) rename frontend/dist/assets/{index-CNk5p9Ix.js => index-9qPdHcPL.js} (97%) diff --git a/backend/routers/system.py b/backend/routers/system.py index 11c4b47..844d9bb 100644 --- a/backend/routers/system.py +++ b/backend/routers/system.py @@ -99,8 +99,9 @@ def token_stats() -> dict: c = stats.get("completion_tokens", 0) total = p + c - # Blended savings based on a premium cloud model rate (e.g. GPT-4o / Claude 3.5 Sonnet: $3.00/1M input, $15.00/1M output) - saved_usd = (p * 3.0 + c * 15.0) / 1_000_000.0 + # Juni 2026 API-Preise (deutlich gestiegen): + # Premium-Modelle (Claude 4 / GPT-5): 15,00 $ / 1M Input-Tokens und 75,00 $ / 1M Output-Tokens + saved_usd = (p * 15.0 + c * 75.0) / 1_000_000.0 saved_eur = saved_usd * 0.92 # 1 USD = 0.92 EUR return { diff --git a/frontend/dist/assets/index-CNk5p9Ix.js b/frontend/dist/assets/index-9qPdHcPL.js similarity index 97% rename from frontend/dist/assets/index-CNk5p9Ix.js rename to frontend/dist/assets/index-9qPdHcPL.js index 286a361..f38b6a2 100644 --- a/frontend/dist/assets/index-CNk5p9Ix.js +++ b/frontend/dist/assets/index-9qPdHcPL.js @@ -352,7 +352,7 @@ Error generating stack: `+i.message+` `)},Vu=function(){var o=parseInt(document.body.getAttribute(Pn)||"0",10);return isFinite(o)?o:0},Qx=function(){p.useEffect(function(){return document.body.setAttribute(Pn,(Vu()+1).toString()),function(){var o=Vu()-1;o<=0?document.body.removeAttribute(Pn):document.body.setAttribute(Pn,o.toString())}},[])},qx=function(o){var d=o.noRelative,a=o.noImportant,c=o.gapMode,f=c===void 0?"margin":c;Qx();var m=p.useMemo(function(){return Hx(f)},[f]);return p.createElement(Gx,{styles:Kx(m,!d,f,a?"":"!important")})},ji=!1;if(typeof window<"u")try{var Wo=Object.defineProperty({},"passive",{get:function(){return ji=!0,!0}});window.addEventListener("test",Wo,Wo),window.removeEventListener("test",Wo,Wo)}catch{ji=!1}var kn=ji?{passive:!1}:!1,Zx=function(o){return o.tagName==="TEXTAREA"},kf=function(o,d){if(!(o instanceof Element))return!1;var a=window.getComputedStyle(o);return a[d]!=="hidden"&&!(a.overflowY===a.overflowX&&!Zx(o)&&a[d]==="visible")},Yx=function(o){return kf(o,"overflowY")},Jx=function(o){return kf(o,"overflowX")},Wu=function(o,d){var a=d.ownerDocument,c=d;do{typeof ShadowRoot<"u"&&c instanceof ShadowRoot&&(c=c.host);var f=Nf(o,c);if(f){var m=Sf(o,c),h=m[1],x=m[2];if(h>x)return!0}c=c.parentNode}while(c&&c!==a.body);return!1},Xx=function(o){var d=o.scrollTop,a=o.scrollHeight,c=o.clientHeight;return[d,a,c]},eg=function(o){var d=o.scrollLeft,a=o.scrollWidth,c=o.clientWidth;return[d,a,c]},Nf=function(o,d){return o==="v"?Yx(d):Jx(d)},Sf=function(o,d){return o==="v"?Xx(d):eg(d)},tg=function(o,d){return o==="h"&&d==="rtl"?-1:1},rg=function(o,d,a,c,f){var m=tg(o,window.getComputedStyle(d).direction),h=m*c,x=a.target,E=d.contains(x),b=!1,k=h>0,P=0,A=0;do{if(!x)break;var I=Sf(o,x),O=I[0],S=I[1],C=I[2],_=S-C-m*O;(O||_)&&Nf(o,x)&&(P+=_,A+=O);var L=x.parentNode;x=L&&L.nodeType===Node.DOCUMENT_FRAGMENT_NODE?L.host:L}while(!E&&x!==document.body||E&&(d.contains(x)||d===x));return(k&&Math.abs(P)<1||!k&&Math.abs(A)<1)&&(b=!0),b},Ho=function(o){return"changedTouches"in o?[o.changedTouches[0].clientX,o.changedTouches[0].clientY]:[0,0]},Hu=function(o){return[o.deltaX,o.deltaY]},Gu=function(o){return o&&"current"in o?o.current:o},ng=function(o,d){return o[0]===d[0]&&o[1]===d[1]},sg=function(o){return` .block-interactivity-`.concat(o,` {pointer-events: none;} .allow-interactivity-`).concat(o,` {pointer-events: all;} -`)},og=0,Nn=[];function lg(o){var d=p.useRef([]),a=p.useRef([0,0]),c=p.useRef(),f=p.useState(og++)[0],m=p.useState(jf)[0],h=p.useRef(o);p.useEffect(function(){h.current=o},[o]),p.useEffect(function(){if(o.inert){document.body.classList.add("block-interactivity-".concat(f));var S=Ex([o.lockRef.current],(o.shards||[]).map(Gu),!0).filter(Boolean);return S.forEach(function(C){return C.classList.add("allow-interactivity-".concat(f))}),function(){document.body.classList.remove("block-interactivity-".concat(f)),S.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(f))})}}},[o.inert,o.lockRef.current,o.shards]);var x=p.useCallback(function(S,C){if("touches"in S&&S.touches.length===2||S.type==="wheel"&&S.ctrlKey)return!h.current.allowPinchZoom;var _=Ho(S),L=a.current,q="deltaX"in S?S.deltaX:L[0]-_[0],Z="deltaY"in S?S.deltaY:L[1]-_[1],H,T=S.target,F=Math.abs(q)>Math.abs(Z)?"h":"v";if("touches"in S&&F==="h"&&T.type==="range")return!1;var ne=window.getSelection(),se=ne&&ne.anchorNode,X=se?se===T||se.contains(T):!1;if(X)return!1;var ye=Wu(F,T);if(!ye)return!0;if(ye?H=F:(H=F==="v"?"h":"v",ye=Wu(F,T)),!ye)return!1;if(!c.current&&"changedTouches"in S&&(q||Z)&&(c.current=H),!H)return!0;var ce=c.current||H;return rg(ce,C,S,ce==="h"?q:Z)},[]),E=p.useCallback(function(S){var C=S;if(!(!Nn.length||Nn[Nn.length-1]!==m)){var _="deltaY"in C?Hu(C):Ho(C),L=d.current.filter(function(H){return H.name===C.type&&(H.target===C.target||C.target===H.shadowParent)&&ng(H.delta,_)})[0];if(L&&L.should){C.cancelable&&C.preventDefault();return}if(!L){var q=(h.current.shards||[]).map(Gu).filter(Boolean).filter(function(H){return H.contains(C.target)}),Z=q.length>0?x(C,q[0]):!h.current.noIsolation;Z&&C.cancelable&&C.preventDefault()}}},[]),b=p.useCallback(function(S,C,_,L){var q={name:S,delta:C,target:_,should:L,shadowParent:ag(_)};d.current.push(q),setTimeout(function(){d.current=d.current.filter(function(Z){return Z!==q})},1)},[]),k=p.useCallback(function(S){a.current=Ho(S),c.current=void 0},[]),P=p.useCallback(function(S){b(S.type,Hu(S),S.target,x(S,o.lockRef.current))},[]),A=p.useCallback(function(S){b(S.type,Ho(S),S.target,x(S,o.lockRef.current))},[]);p.useEffect(function(){return Nn.push(m),o.setCallbacks({onScrollCapture:P,onWheelCapture:P,onTouchMoveCapture:A}),document.addEventListener("wheel",E,kn),document.addEventListener("touchmove",E,kn),document.addEventListener("touchstart",k,kn),function(){Nn=Nn.filter(function(S){return S!==m}),document.removeEventListener("wheel",E,kn),document.removeEventListener("touchmove",E,kn),document.removeEventListener("touchstart",k,kn)}},[]);var I=o.removeScrollBar,O=o.inert;return p.createElement(p.Fragment,null,O?p.createElement(m,{styles:sg(f)}):null,I?p.createElement(qx,{noRelative:o.noRelative,gapMode:o.gapMode}):null)}function ag(o){for(var d=null;o!==null;)o instanceof ShadowRoot&&(d=o.host,o=o.host),o=o.parentNode;return d}const ig=Ox(wf,lg);var Cf=p.forwardRef(function(o,d){return p.createElement(ol,Ft({},o,{ref:d,sideCar:ig}))});Cf.classNames=ol.classNames;var dg=function(o){if(typeof document>"u")return null;var d=Array.isArray(o)?o[0]:o;return d.ownerDocument.body},Sn=new WeakMap,Go=new WeakMap,Ko={},di=0,Ef=function(o){return o&&(o.host||Ef(o.parentNode))},cg=function(o,d){return d.map(function(a){if(o.contains(a))return a;var c=Ef(a);return c&&o.contains(c)?c:(console.error("aria-hidden",a,"in not contained inside",o,". Doing nothing"),null)}).filter(function(a){return!!a})},ug=function(o,d,a,c){var f=cg(d,Array.isArray(o)?o:[o]);Ko[a]||(Ko[a]=new WeakMap);var m=Ko[a],h=[],x=new Set,E=new Set(f),b=function(P){!P||x.has(P)||(x.add(P),b(P.parentNode))};f.forEach(b);var k=function(P){!P||E.has(P)||Array.prototype.forEach.call(P.children,function(A){if(x.has(A))k(A);else try{var I=A.getAttribute(c),O=I!==null&&I!=="false",S=(Sn.get(A)||0)+1,C=(m.get(A)||0)+1;Sn.set(A,S),m.set(A,C),h.push(A),S===1&&O&&Go.set(A,!0),C===1&&A.setAttribute(a,"true"),O||A.setAttribute(c,"true")}catch(_){console.error("aria-hidden: cannot operate on ",A,_)}})};return k(d),x.clear(),di++,function(){h.forEach(function(P){var A=Sn.get(P)-1,I=m.get(P)-1;Sn.set(P,A),m.set(P,I),A||(Go.has(P)||P.removeAttribute(c),Go.delete(P)),I||P.removeAttribute(a)}),di--,di||(Sn=new WeakMap,Sn=new WeakMap,Go=new WeakMap,Ko={})}},fg=function(o,d,a){a===void 0&&(a="data-aria-hidden");var c=Array.from(Array.isArray(o)?o:[o]),f=dg(o);return f?(c.push.apply(c,Array.from(f.querySelectorAll("[aria-live], script"))),ug(c,f,a,"aria-hidden")):function(){return null}},ll="Dialog",[_f]=$h(ll),[pg,zt]=_f(ll),Mf=o=>{const{__scopeDialog:d,children:a,open:c,defaultOpen:f,onOpenChange:m,modal:h=!0}=o,x=p.useRef(null),E=p.useRef(null),[b,k]=Hh({prop:c,defaultProp:f??!1,onChange:m,caller:ll});return n.jsx(pg,{scope:d,triggerRef:x,contentRef:E,contentId:Xt(),titleId:Xt(),descriptionId:Xt(),open:b,onOpenChange:k,onOpenToggle:p.useCallback(()=>k(P=>!P),[k]),modal:h,children:a})};Mf.displayName=ll;var Pf="DialogTrigger",mg=p.forwardRef((o,d)=>{const{__scopeDialog:a,...c}=o,f=zt(Pf,a),m=Kr(d,f.triggerRef);return n.jsx(Je.button,{type:"button","aria-haspopup":"dialog","aria-expanded":f.open,"aria-controls":f.open?f.contentId:void 0,"data-state":Ri(f.open),...c,ref:m,onClick:Sr(o.onClick,f.onOpenToggle)})});mg.displayName=Pf;var Pi="DialogPortal",[hg,Rf]=_f(Pi,{forceMount:void 0}),zf=o=>{const{__scopeDialog:d,forceMount:a,children:c,container:f}=o,m=zt(Pi,d);return n.jsx(hg,{scope:d,forceMount:a,children:p.Children.map(c,h=>n.jsx(sl,{present:a||m.open,children:n.jsx(vf,{asChild:!0,container:f,children:h})}))})};zf.displayName=Pi;var nl="DialogOverlay",Df=p.forwardRef((o,d)=>{const a=Rf(nl,o.__scopeDialog),{forceMount:c=a.forceMount,...f}=o,m=zt(nl,o.__scopeDialog);return m.modal?n.jsx(sl,{present:c||m.open,children:n.jsx(gg,{...f,ref:d})}):null});Df.displayName=nl;var xg=pf("DialogOverlay.RemoveScroll"),gg=p.forwardRef((o,d)=>{const{__scopeDialog:a,...c}=o,f=zt(nl,a),m=ux(),h=Kr(d,m);return n.jsx(Cf,{as:xg,allowPinchZoom:!0,shards:[f.contentRef],children:n.jsx(Je.div,{"data-state":Ri(f.open),...c,ref:h,style:{pointerEvents:"auto",...c.style}})})}),Ln="DialogContent",Lf=p.forwardRef((o,d)=>{const a=Rf(Ln,o.__scopeDialog),{forceMount:c=a.forceMount,...f}=o,m=zt(Ln,o.__scopeDialog);return n.jsx(sl,{present:c||m.open,children:m.modal?n.jsx(vg,{...f,ref:d}):n.jsx(yg,{...f,ref:d})})});Lf.displayName=Ln;var vg=p.forwardRef((o,d)=>{const a=zt(Ln,o.__scopeDialog),c=p.useRef(null),f=Kr(d,a.contentRef,c);return p.useEffect(()=>{const m=c.current;if(m)return fg(m)},[]),n.jsx(Af,{...o,ref:f,trapFocus:a.open,disableOutsidePointerEvents:a.open,onCloseAutoFocus:Sr(o.onCloseAutoFocus,m=>{var h;m.preventDefault(),(h=a.triggerRef.current)==null||h.focus()}),onPointerDownOutside:Sr(o.onPointerDownOutside,m=>{const h=m.detail.originalEvent,x=h.button===0&&h.ctrlKey===!0;(h.button===2||x)&&m.preventDefault()}),onFocusOutside:Sr(o.onFocusOutside,m=>m.preventDefault())})}),yg=p.forwardRef((o,d)=>{const a=zt(Ln,o.__scopeDialog),c=p.useRef(!1),f=p.useRef(!1);return n.jsx(Af,{...o,ref:d,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:m=>{var h,x;(h=o.onCloseAutoFocus)==null||h.call(o,m),m.defaultPrevented||(c.current||(x=a.triggerRef.current)==null||x.focus(),m.preventDefault()),c.current=!1,f.current=!1},onInteractOutside:m=>{var E,b;(E=o.onInteractOutside)==null||E.call(o,m),m.defaultPrevented||(c.current=!0,m.detail.originalEvent.type==="pointerdown"&&(f.current=!0));const h=m.target;((b=a.triggerRef.current)==null?void 0:b.contains(h))&&m.preventDefault(),m.detail.originalEvent.type==="focusin"&&f.current&&m.preventDefault()}})}),Af=p.forwardRef((o,d)=>{const{__scopeDialog:a,trapFocus:c,onOpenAutoFocus:f,onCloseAutoFocus:m,...h}=o,x=zt(Ln,a);return Cx(),n.jsx(n.Fragment,{children:n.jsx(xf,{asChild:!0,loop:!0,trapped:c,onMountAutoFocus:f,onUnmountAutoFocus:m,children:n.jsx(mf,{role:"dialog",id:x.contentId,"aria-describedby":x.descriptionId,"aria-labelledby":x.titleId,"data-state":Ri(x.open),...h,ref:d,deferPointerDownOutside:!0,onDismiss:()=>x.onOpenChange(!1)})})})}),Of="DialogTitle",bg=p.forwardRef((o,d)=>{const{__scopeDialog:a,...c}=o,f=zt(Of,a);return n.jsx(Je.h2,{id:f.titleId,...c,ref:d})});bg.displayName=Of;var Tf="DialogDescription",wg=p.forwardRef((o,d)=>{const{__scopeDialog:a,...c}=o,f=zt(Tf,a);return n.jsx(Je.p,{id:f.descriptionId,...c,ref:d})});wg.displayName=Tf;var If="DialogClose",jg=p.forwardRef((o,d)=>{const{__scopeDialog:a,...c}=o,f=zt(If,a);return n.jsx(Je.button,{type:"button",...c,ref:d,onClick:Sr(o.onClick,()=>f.onOpenChange(!1))})});jg.displayName=If;function Ri(o){return o?"open":"closed"}var js='[cmdk-group=""]',ci='[cmdk-group-items=""]',kg='[cmdk-group-heading=""]',Ff='[cmdk-item=""]',Ku=`${Ff}:not([aria-disabled="true"])`,ki="cmdk-item-select",_n="data-value",Ng=(o,d,a)=>Fh(o,d,a),$f=p.createContext(void 0),Rs=()=>p.useContext($f),Uf=p.createContext(void 0),zi=()=>p.useContext(Uf),Bf=p.createContext(void 0),Vf=p.forwardRef((o,d)=>{let a=Mn(()=>{var v,B;return{search:"",value:(B=(v=o.value)!=null?v:o.defaultValue)!=null?B:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),c=Mn(()=>new Set),f=Mn(()=>new Map),m=Mn(()=>new Map),h=Mn(()=>new Set),x=Wf(o),{label:E,children:b,value:k,onValueChange:P,filter:A,shouldFilter:I,loop:O,disablePointerSelection:S=!1,vimBindings:C=!0,..._}=o,L=Xt(),q=Xt(),Z=Xt(),H=p.useRef(null),T=Ag();Gr(()=>{if(k!==void 0){let v=k.trim();a.current.value=v,F.emit()}},[k]),Gr(()=>{T(6,Me)},[]);let F=p.useMemo(()=>({subscribe:v=>(h.current.add(v),()=>h.current.delete(v)),snapshot:()=>a.current,setState:(v,B,Y)=>{var K,oe,pe,me;if(!Object.is(a.current[v],B)){if(a.current[v]=B,v==="search")ce(),X(),T(1,ye);else if(v==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let w=document.getElementById(Z);w?w.focus():(K=document.getElementById(L))==null||K.focus()}if(T(7,()=>{var w;a.current.selectedItemId=(w=_e())==null?void 0:w.id,F.emit()}),Y||T(5,Me),((oe=x.current)==null?void 0:oe.value)!==void 0){let w=B??"";(me=(pe=x.current).onValueChange)==null||me.call(pe,w);return}}F.emit()}},emit:()=>{h.current.forEach(v=>v())}}),[]),ne=p.useMemo(()=>({value:(v,B,Y)=>{var K;B!==((K=m.current.get(v))==null?void 0:K.value)&&(m.current.set(v,{value:B,keywords:Y}),a.current.filtered.items.set(v,se(B,Y)),T(2,()=>{X(),F.emit()}))},item:(v,B)=>(c.current.add(v),B&&(f.current.has(B)?f.current.get(B).add(v):f.current.set(B,new Set([v]))),T(3,()=>{ce(),X(),a.current.value||ye(),F.emit()}),()=>{m.current.delete(v),c.current.delete(v),a.current.filtered.items.delete(v);let Y=_e();T(4,()=>{ce(),(Y==null?void 0:Y.getAttribute("id"))===v&&ye(),F.emit()})}),group:v=>(f.current.has(v)||f.current.set(v,new Set),()=>{m.current.delete(v),f.current.delete(v)}),filter:()=>x.current.shouldFilter,label:E||o["aria-label"],getDisablePointerSelection:()=>x.current.disablePointerSelection,listId:L,inputId:Z,labelId:q,listInnerRef:H}),[]);function se(v,B){var Y,K;let oe=(K=(Y=x.current)==null?void 0:Y.filter)!=null?K:Ng;return v?oe(v,a.current.search,B):0}function X(){if(!a.current.search||x.current.shouldFilter===!1)return;let v=a.current.filtered.items,B=[];a.current.filtered.groups.forEach(K=>{let oe=f.current.get(K),pe=0;oe.forEach(me=>{let w=v.get(me);pe=Math.max(w,pe)}),B.push([K,pe])});let Y=H.current;Pe().sort((K,oe)=>{var pe,me;let w=K.getAttribute("id"),J=oe.getAttribute("id");return((pe=v.get(J))!=null?pe:0)-((me=v.get(w))!=null?me:0)}).forEach(K=>{let oe=K.closest(ci);oe?oe.appendChild(K.parentElement===oe?K:K.closest(`${ci} > *`)):Y.appendChild(K.parentElement===Y?K:K.closest(`${ci} > *`))}),B.sort((K,oe)=>oe[1]-K[1]).forEach(K=>{var oe;let pe=(oe=H.current)==null?void 0:oe.querySelector(`${js}[${_n}="${encodeURIComponent(K[0])}"]`);pe==null||pe.parentElement.appendChild(pe)})}function ye(){let v=Pe().find(Y=>Y.getAttribute("aria-disabled")!=="true"),B=v==null?void 0:v.getAttribute(_n);F.setState("value",B||void 0)}function ce(){var v,B,Y,K;if(!a.current.search||x.current.shouldFilter===!1){a.current.filtered.count=c.current.size;return}a.current.filtered.groups=new Set;let oe=0;for(let pe of c.current){let me=(B=(v=m.current.get(pe))==null?void 0:v.value)!=null?B:"",w=(K=(Y=m.current.get(pe))==null?void 0:Y.keywords)!=null?K:[],J=se(me,w);a.current.filtered.items.set(pe,J),J>0&&oe++}for(let[pe,me]of f.current)for(let w of me)if(a.current.filtered.items.get(w)>0){a.current.filtered.groups.add(pe);break}a.current.filtered.count=oe}function Me(){var v,B,Y;let K=_e();K&&(((v=K.parentElement)==null?void 0:v.firstChild)===K&&((Y=(B=K.closest(js))==null?void 0:B.querySelector(kg))==null||Y.scrollIntoView({block:"nearest"})),K.scrollIntoView({block:"nearest"}))}function _e(){var v;return(v=H.current)==null?void 0:v.querySelector(`${Ff}[aria-selected="true"]`)}function Pe(){var v;return Array.from(((v=H.current)==null?void 0:v.querySelectorAll(Ku))||[])}function Ne(v){let B=Pe()[v];B&&F.setState("value",B.getAttribute(_n))}function ke(v){var B;let Y=_e(),K=Pe(),oe=K.findIndex(me=>me===Y),pe=K[oe+v];(B=x.current)!=null&&B.loop&&(pe=oe+v<0?K[K.length-1]:oe+v===K.length?K[0]:K[oe+v]),pe&&F.setState("value",pe.getAttribute(_n))}function W(v){let B=_e(),Y=B==null?void 0:B.closest(js),K;for(;Y&&!K;)Y=v>0?Dg(Y,js):Lg(Y,js),K=Y==null?void 0:Y.querySelector(Ku);K?F.setState("value",K.getAttribute(_n)):ke(v)}let ae=()=>Ne(Pe().length-1),G=v=>{v.preventDefault(),v.metaKey?ae():v.altKey?W(1):ke(1)},j=v=>{v.preventDefault(),v.metaKey?Ne(0):v.altKey?W(-1):ke(-1)};return p.createElement(Je.div,{ref:d,tabIndex:-1,..._,"cmdk-root":"",onKeyDown:v=>{var B;(B=_.onKeyDown)==null||B.call(_,v);let Y=v.nativeEvent.isComposing||v.keyCode===229;if(!(v.defaultPrevented||Y))switch(v.key){case"n":case"j":{C&&v.ctrlKey&&G(v);break}case"ArrowDown":{G(v);break}case"p":case"k":{C&&v.ctrlKey&&j(v);break}case"ArrowUp":{j(v);break}case"Home":{v.preventDefault(),Ne(0);break}case"End":{v.preventDefault(),ae();break}case"Enter":{v.preventDefault();let K=_e();if(K){let oe=new Event(ki);K.dispatchEvent(oe)}}}}},p.createElement("label",{"cmdk-label":"",htmlFor:ne.inputId,id:ne.labelId,style:Tg},E),al(o,v=>p.createElement(Uf.Provider,{value:F},p.createElement($f.Provider,{value:ne},v))))}),Sg=p.forwardRef((o,d)=>{var a,c;let f=Xt(),m=p.useRef(null),h=p.useContext(Bf),x=Rs(),E=Wf(o),b=(c=(a=E.current)==null?void 0:a.forceMount)!=null?c:h==null?void 0:h.forceMount;Gr(()=>{if(!b)return x.item(f,h==null?void 0:h.id)},[b]);let k=Hf(f,m,[o.value,o.children,m],o.keywords),P=zi(),A=Cr(T=>T.value&&T.value===k.current),I=Cr(T=>b||x.filter()===!1?!0:T.search?T.filtered.items.get(f)>0:!0);p.useEffect(()=>{let T=m.current;if(!(!T||o.disabled))return T.addEventListener(ki,O),()=>T.removeEventListener(ki,O)},[I,o.onSelect,o.disabled]);function O(){var T,F;S(),(F=(T=E.current).onSelect)==null||F.call(T,k.current)}function S(){P.setState("value",k.current,!0)}if(!I)return null;let{disabled:C,value:_,onSelect:L,forceMount:q,keywords:Z,...H}=o;return p.createElement(Je.div,{ref:Dn(m,d),...H,id:f,"cmdk-item":"",role:"option","aria-disabled":!!C,"aria-selected":!!A,"data-disabled":!!C,"data-selected":!!A,onPointerMove:C||x.getDisablePointerSelection()?void 0:S,onClick:C?void 0:O},o.children)}),Cg=p.forwardRef((o,d)=>{let{heading:a,children:c,forceMount:f,...m}=o,h=Xt(),x=p.useRef(null),E=p.useRef(null),b=Xt(),k=Rs(),P=Cr(I=>f||k.filter()===!1?!0:I.search?I.filtered.groups.has(h):!0);Gr(()=>k.group(h),[]),Hf(h,x,[o.value,o.heading,E]);let A=p.useMemo(()=>({id:h,forceMount:f}),[f]);return p.createElement(Je.div,{ref:Dn(x,d),...m,"cmdk-group":"",role:"presentation",hidden:P?void 0:!0},a&&p.createElement("div",{ref:E,"cmdk-group-heading":"","aria-hidden":!0,id:b},a),al(o,I=>p.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":a?b:void 0},p.createElement(Bf.Provider,{value:A},I))))}),Eg=p.forwardRef((o,d)=>{let{alwaysRender:a,...c}=o,f=p.useRef(null),m=Cr(h=>!h.search);return!a&&!m?null:p.createElement(Je.div,{ref:Dn(f,d),...c,"cmdk-separator":"",role:"separator"})}),_g=p.forwardRef((o,d)=>{let{onValueChange:a,...c}=o,f=o.value!=null,m=zi(),h=Cr(b=>b.search),x=Cr(b=>b.selectedItemId),E=Rs();return p.useEffect(()=>{o.value!=null&&m.setState("search",o.value)},[o.value]),p.createElement(Je.input,{ref:d,...c,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":E.listId,"aria-labelledby":E.labelId,"aria-activedescendant":x,id:E.inputId,type:"text",value:f?o.value:h,onChange:b=>{f||m.setState("search",b.target.value),a==null||a(b.target.value)}})}),Mg=p.forwardRef((o,d)=>{let{children:a,label:c="Suggestions",...f}=o,m=p.useRef(null),h=p.useRef(null),x=Cr(b=>b.selectedItemId),E=Rs();return p.useEffect(()=>{if(h.current&&m.current){let b=h.current,k=m.current,P,A=new ResizeObserver(()=>{P=requestAnimationFrame(()=>{let I=b.offsetHeight;k.style.setProperty("--cmdk-list-height",I.toFixed(1)+"px")})});return A.observe(b),()=>{cancelAnimationFrame(P),A.unobserve(b)}}},[]),p.createElement(Je.div,{ref:Dn(m,d),...f,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":x,"aria-label":c,id:E.listId},al(o,b=>p.createElement("div",{ref:Dn(h,E.listInnerRef),"cmdk-list-sizer":""},b)))}),Pg=p.forwardRef((o,d)=>{let{open:a,onOpenChange:c,overlayClassName:f,contentClassName:m,container:h,...x}=o;return p.createElement(Mf,{open:a,onOpenChange:c},p.createElement(zf,{container:h},p.createElement(Df,{"cmdk-overlay":"",className:f}),p.createElement(Lf,{"aria-label":o.label,"cmdk-dialog":"",className:m},p.createElement(Vf,{ref:d,...x}))))}),Rg=p.forwardRef((o,d)=>Cr(a=>a.filtered.count===0)?p.createElement(Je.div,{ref:d,...o,"cmdk-empty":"",role:"presentation"}):null),zg=p.forwardRef((o,d)=>{let{progress:a,children:c,label:f="Loading...",...m}=o;return p.createElement(Je.div,{ref:d,...m,"cmdk-loading":"",role:"progressbar","aria-valuenow":a,"aria-valuemin":0,"aria-valuemax":100,"aria-label":f},al(o,h=>p.createElement("div",{"aria-hidden":!0},h)))}),Cn=Object.assign(Vf,{List:Mg,Item:Sg,Input:_g,Group:Cg,Separator:Eg,Dialog:Pg,Empty:Rg,Loading:zg});function Dg(o,d){let a=o.nextElementSibling;for(;a;){if(a.matches(d))return a;a=a.nextElementSibling}}function Lg(o,d){let a=o.previousElementSibling;for(;a;){if(a.matches(d))return a;a=a.previousElementSibling}}function Wf(o){let d=p.useRef(o);return Gr(()=>{d.current=o}),d}var Gr=typeof window>"u"?p.useEffect:p.useLayoutEffect;function Mn(o){let d=p.useRef();return d.current===void 0&&(d.current=o()),d}function Cr(o){let d=zi(),a=()=>o(d.snapshot());return p.useSyncExternalStore(d.subscribe,a,a)}function Hf(o,d,a,c=[]){let f=p.useRef(),m=Rs();return Gr(()=>{var h;let x=(()=>{var b;for(let k of a){if(typeof k=="string")return k.trim();if(typeof k=="object"&&"current"in k)return k.current?(b=k.current.textContent)==null?void 0:b.trim():f.current}})(),E=c.map(b=>b.trim());m.value(o,x,E),(h=d.current)==null||h.setAttribute(_n,x),f.current=x}),f}var Ag=()=>{let[o,d]=p.useState(),a=Mn(()=>new Map);return Gr(()=>{a.current.forEach(c=>c()),a.current=new Map},[o]),(c,f)=>{a.current.set(c,f),d({})}};function Og(o){let d=o.type;return typeof d=="function"?d(o.props):"render"in d?d.render(o.props):o}function al({asChild:o,children:d},a){return o&&p.isValidElement(d)?p.cloneElement(Og(d),{ref:d.ref},a(d.props.children)):a(d)}var Tg={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function Ig({onNavigate:o}){const[d,a]=p.useState(!1);return p.useEffect(()=>{const c=f=>{(f.metaKey||f.ctrlKey)&&f.key.toLowerCase()==="k"&&(f.preventDefault(),a(m=>!m))};return document.addEventListener("keydown",c),()=>document.removeEventListener("keydown",c)},[]),n.jsx(Cn.Dialog,{open:d,onOpenChange:a,label:"Befehlspalette",className:"fixed inset-0 z-50 flex items-start justify-center bg-black/50 p-4 pt-[12vh]",onClick:()=>a(!1),children:n.jsxs("div",{className:"w-full max-w-lg overflow-hidden rounded-xl border border-border bg-popover text-popover-foreground shadow-2xl",onClick:c=>c.stopPropagation(),children:[n.jsx(Cn.Input,{autoFocus:!0,placeholder:"Springe zu… (Modelle, Routing, System …)",className:"w-full border-b border-border bg-transparent px-4 py-3 text-sm outline-none placeholder:text-muted-foreground"}),n.jsxs(Cn.List,{className:"max-h-80 overflow-y-auto p-2",children:[n.jsx(Cn.Empty,{className:"px-3 py-6 text-center text-sm text-muted-foreground",children:"Nichts gefunden."}),n.jsx(Cn.Group,{heading:"Bereiche",className:"px-1 py-1 text-xs text-muted-foreground",children:yi.map(c=>n.jsxs(Cn.Item,{value:`${c.label} ${c.hint}`,onSelect:()=>{o(c.id),a(!1)},className:"flex cursor-pointer items-center gap-3 rounded-md px-3 py-2 text-sm text-foreground aria-selected:bg-accent aria-selected:text-accent-foreground",children:[n.jsx(c.icon,{className:"h-4 w-4 text-primary"}),n.jsx("span",{children:c.label}),n.jsx("span",{className:"ml-auto truncate text-xs text-muted-foreground",children:c.hint})]},c.id))})]})]})})}async function fe(o,d){var E;const a={"Content-Type":"application/json",...d==null?void 0:d.headers},c=localStorage.getItem("mc_sudo_password"),f=localStorage.getItem("mc_hf_token");c&&(a["X-Sudo-Password"]=c);let m=d==null?void 0:d.body;if((((E=d==null?void 0:d.method)==null?void 0:E.toUpperCase())||"GET")==="POST"){if(typeof m=="string")try{const b=JSON.parse(m);let k=!1;c&&!("sudo_password"in b)&&(b.sudo_password=c,k=!0),f&&!("hf_token"in b)&&(b.hf_token=f,k=!0),k&&(m=JSON.stringify(b))}catch{}else if(!m){const b={};c&&(b.sudo_password=c),f&&(b.hf_token=f),Object.keys(b).length>0&&(m=JSON.stringify(b))}}const x=await fetch(o,{...d,headers:a,body:m});if(!x.ok)throw new Error(`${x.status} ${x.statusText}`);return x.json()}function Gf(o){var d,a,c="";if(typeof o=="string"||typeof o=="number")c+=o;else if(typeof o=="object")if(Array.isArray(o)){var f=o.length;for(d=0;d{const d=Bg(o),{conflictingClassGroups:a,conflictingClassGroupModifiers:c}=o;return{getClassGroupId:h=>{const x=h.split(Di);return x[0]===""&&x.length!==1&&x.shift(),Kf(x,d)||Ug(h)},getConflictingClassGroupIds:(h,x)=>{const E=a[h]||[];return x&&c[h]?[...E,...c[h]]:E}}},Kf=(o,d)=>{var h;if(o.length===0)return d.classGroupId;const a=o[0],c=d.nextPart.get(a),f=c?Kf(o.slice(1),c):void 0;if(f)return f;if(d.validators.length===0)return;const m=o.join(Di);return(h=d.validators.find(({validator:x})=>x(m)))==null?void 0:h.classGroupId},Qu=/^\[(.+)\]$/,Ug=o=>{if(Qu.test(o)){const d=Qu.exec(o)[1],a=d==null?void 0:d.substring(0,d.indexOf(":"));if(a)return"arbitrary.."+a}},Bg=o=>{const{theme:d,prefix:a}=o,c={nextPart:new Map,validators:[]};return Wg(Object.entries(o.classGroups),a).forEach(([m,h])=>{Ni(h,c,m,d)}),c},Ni=(o,d,a,c)=>{o.forEach(f=>{if(typeof f=="string"){const m=f===""?d:qu(d,f);m.classGroupId=a;return}if(typeof f=="function"){if(Vg(f)){Ni(f(c),d,a,c);return}d.validators.push({validator:f,classGroupId:a});return}Object.entries(f).forEach(([m,h])=>{Ni(h,qu(d,m),a,c)})})},qu=(o,d)=>{let a=o;return d.split(Di).forEach(c=>{a.nextPart.has(c)||a.nextPart.set(c,{nextPart:new Map,validators:[]}),a=a.nextPart.get(c)}),a},Vg=o=>o.isThemeGetter,Wg=(o,d)=>d?o.map(([a,c])=>{const f=c.map(m=>typeof m=="string"?d+m:typeof m=="object"?Object.fromEntries(Object.entries(m).map(([h,x])=>[d+h,x])):m);return[a,f]}):o,Hg=o=>{if(o<1)return{get:()=>{},set:()=>{}};let d=0,a=new Map,c=new Map;const f=(m,h)=>{a.set(m,h),d++,d>o&&(d=0,c=a,a=new Map)};return{get(m){let h=a.get(m);if(h!==void 0)return h;if((h=c.get(m))!==void 0)return f(m,h),h},set(m,h){a.has(m)?a.set(m,h):f(m,h)}}},Qf="!",Gg=o=>{const{separator:d,experimentalParseClassName:a}=o,c=d.length===1,f=d[0],m=d.length,h=x=>{const E=[];let b=0,k=0,P;for(let C=0;Ck?P-k:void 0;return{modifiers:E,hasImportantModifier:I,baseClassName:O,maybePostfixModifierPosition:S}};return a?x=>a({className:x,parseClassName:h}):h},Kg=o=>{if(o.length<=1)return o;const d=[];let a=[];return o.forEach(c=>{c[0]==="["?(d.push(...a.sort(),c),a=[]):a.push(c)}),d.push(...a.sort()),d},Qg=o=>({cache:Hg(o.cacheSize),parseClassName:Gg(o),...$g(o)}),qg=/\s+/,Zg=(o,d)=>{const{parseClassName:a,getClassGroupId:c,getConflictingClassGroupIds:f}=d,m=[],h=o.trim().split(qg);let x="";for(let E=h.length-1;E>=0;E-=1){const b=h[E],{modifiers:k,hasImportantModifier:P,baseClassName:A,maybePostfixModifierPosition:I}=a(b);let O=!!I,S=c(O?A.substring(0,I):A);if(!S){if(!O){x=b+(x.length>0?" "+x:x);continue}if(S=c(A),!S){x=b+(x.length>0?" "+x:x);continue}O=!1}const C=Kg(k).join(":"),_=P?C+Qf:C,L=_+S;if(m.includes(L))continue;m.push(L);const q=f(S,O);for(let Z=0;Z0?" "+x:x)}return x};function Yg(){let o=0,d,a,c="";for(;o{if(typeof o=="string")return o;let d,a="";for(let c=0;cP(k),o());return a=Qg(b),c=a.cache.get,f=a.cache.set,m=x,x(E)}function x(E){const b=c(E);if(b)return b;const k=Zg(E,a);return f(E,k),k}return function(){return m(Yg.apply(null,arguments))}}const Te=o=>{const d=a=>a[o]||[];return d.isThemeGetter=!0,d},Zf=/^\[(?:([a-z-]+):)?(.+)\]$/i,Xg=/^\d+\/\d+$/,e0=new Set(["px","full","screen"]),t0=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,r0=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,n0=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,s0=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,o0=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Jt=o=>Rn(o)||e0.has(o)||Xg.test(o),wr=o=>An(o,"length",p0),Rn=o=>!!o&&!Number.isNaN(Number(o)),ui=o=>An(o,"number",Rn),ks=o=>!!o&&Number.isInteger(Number(o)),l0=o=>o.endsWith("%")&&Rn(o.slice(0,-1)),we=o=>Zf.test(o),jr=o=>t0.test(o),a0=new Set(["length","size","percentage"]),i0=o=>An(o,a0,Yf),d0=o=>An(o,"position",Yf),c0=new Set(["image","url"]),u0=o=>An(o,c0,h0),f0=o=>An(o,"",m0),Ns=()=>!0,An=(o,d,a)=>{const c=Zf.exec(o);return c?c[1]?typeof d=="string"?c[1]===d:d.has(c[1]):a(c[2]):!1},p0=o=>r0.test(o)&&!n0.test(o),Yf=()=>!1,m0=o=>s0.test(o),h0=o=>o0.test(o),x0=()=>{const o=Te("colors"),d=Te("spacing"),a=Te("blur"),c=Te("brightness"),f=Te("borderColor"),m=Te("borderRadius"),h=Te("borderSpacing"),x=Te("borderWidth"),E=Te("contrast"),b=Te("grayscale"),k=Te("hueRotate"),P=Te("invert"),A=Te("gap"),I=Te("gradientColorStops"),O=Te("gradientColorStopPositions"),S=Te("inset"),C=Te("margin"),_=Te("opacity"),L=Te("padding"),q=Te("saturate"),Z=Te("scale"),H=Te("sepia"),T=Te("skew"),F=Te("space"),ne=Te("translate"),se=()=>["auto","contain","none"],X=()=>["auto","hidden","clip","visible","scroll"],ye=()=>["auto",we,d],ce=()=>[we,d],Me=()=>["",Jt,wr],_e=()=>["auto",Rn,we],Pe=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Ne=()=>["solid","dashed","dotted","double","none"],ke=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],W=()=>["start","end","center","between","around","evenly","stretch"],ae=()=>["","0",we],G=()=>["auto","avoid","all","avoid-page","page","left","right","column"],j=()=>[Rn,we];return{cacheSize:500,separator:":",theme:{colors:[Ns],spacing:[Jt,wr],blur:["none","",jr,we],brightness:j(),borderColor:[o],borderRadius:["none","","full",jr,we],borderSpacing:ce(),borderWidth:Me(),contrast:j(),grayscale:ae(),hueRotate:j(),invert:ae(),gap:ce(),gradientColorStops:[o],gradientColorStopPositions:[l0,wr],inset:ye(),margin:ye(),opacity:j(),padding:ce(),saturate:j(),scale:j(),sepia:ae(),skew:j(),space:ce(),translate:ce()},classGroups:{aspect:[{aspect:["auto","square","video",we]}],container:["container"],columns:[{columns:[jr]}],"break-after":[{"break-after":G()}],"break-before":[{"break-before":G()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...Pe(),we]}],overflow:[{overflow:X()}],"overflow-x":[{"overflow-x":X()}],"overflow-y":[{"overflow-y":X()}],overscroll:[{overscroll:se()}],"overscroll-x":[{"overscroll-x":se()}],"overscroll-y":[{"overscroll-y":se()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[S]}],"inset-x":[{"inset-x":[S]}],"inset-y":[{"inset-y":[S]}],start:[{start:[S]}],end:[{end:[S]}],top:[{top:[S]}],right:[{right:[S]}],bottom:[{bottom:[S]}],left:[{left:[S]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ks,we]}],basis:[{basis:ye()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",we]}],grow:[{grow:ae()}],shrink:[{shrink:ae()}],order:[{order:["first","last","none",ks,we]}],"grid-cols":[{"grid-cols":[Ns]}],"col-start-end":[{col:["auto",{span:["full",ks,we]},we]}],"col-start":[{"col-start":_e()}],"col-end":[{"col-end":_e()}],"grid-rows":[{"grid-rows":[Ns]}],"row-start-end":[{row:["auto",{span:[ks,we]},we]}],"row-start":[{"row-start":_e()}],"row-end":[{"row-end":_e()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",we]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",we]}],gap:[{gap:[A]}],"gap-x":[{"gap-x":[A]}],"gap-y":[{"gap-y":[A]}],"justify-content":[{justify:["normal",...W()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...W(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...W(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[L]}],px:[{px:[L]}],py:[{py:[L]}],ps:[{ps:[L]}],pe:[{pe:[L]}],pt:[{pt:[L]}],pr:[{pr:[L]}],pb:[{pb:[L]}],pl:[{pl:[L]}],m:[{m:[C]}],mx:[{mx:[C]}],my:[{my:[C]}],ms:[{ms:[C]}],me:[{me:[C]}],mt:[{mt:[C]}],mr:[{mr:[C]}],mb:[{mb:[C]}],ml:[{ml:[C]}],"space-x":[{"space-x":[F]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[F]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",we,d]}],"min-w":[{"min-w":[we,d,"min","max","fit"]}],"max-w":[{"max-w":[we,d,"none","full","min","max","fit","prose",{screen:[jr]},jr]}],h:[{h:[we,d,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[we,d,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[we,d,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[we,d,"auto","min","max","fit"]}],"font-size":[{text:["base",jr,wr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",ui]}],"font-family":[{font:[Ns]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",we]}],"line-clamp":[{"line-clamp":["none",Rn,ui]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Jt,we]}],"list-image":[{"list-image":["none",we]}],"list-style-type":[{list:["none","disc","decimal",we]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[o]}],"placeholder-opacity":[{"placeholder-opacity":[_]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[o]}],"text-opacity":[{"text-opacity":[_]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Ne(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Jt,wr]}],"underline-offset":[{"underline-offset":["auto",Jt,we]}],"text-decoration-color":[{decoration:[o]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:ce()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",we]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",we]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[_]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...Pe(),d0]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",i0]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},u0]}],"bg-color":[{bg:[o]}],"gradient-from-pos":[{from:[O]}],"gradient-via-pos":[{via:[O]}],"gradient-to-pos":[{to:[O]}],"gradient-from":[{from:[I]}],"gradient-via":[{via:[I]}],"gradient-to":[{to:[I]}],rounded:[{rounded:[m]}],"rounded-s":[{"rounded-s":[m]}],"rounded-e":[{"rounded-e":[m]}],"rounded-t":[{"rounded-t":[m]}],"rounded-r":[{"rounded-r":[m]}],"rounded-b":[{"rounded-b":[m]}],"rounded-l":[{"rounded-l":[m]}],"rounded-ss":[{"rounded-ss":[m]}],"rounded-se":[{"rounded-se":[m]}],"rounded-ee":[{"rounded-ee":[m]}],"rounded-es":[{"rounded-es":[m]}],"rounded-tl":[{"rounded-tl":[m]}],"rounded-tr":[{"rounded-tr":[m]}],"rounded-br":[{"rounded-br":[m]}],"rounded-bl":[{"rounded-bl":[m]}],"border-w":[{border:[x]}],"border-w-x":[{"border-x":[x]}],"border-w-y":[{"border-y":[x]}],"border-w-s":[{"border-s":[x]}],"border-w-e":[{"border-e":[x]}],"border-w-t":[{"border-t":[x]}],"border-w-r":[{"border-r":[x]}],"border-w-b":[{"border-b":[x]}],"border-w-l":[{"border-l":[x]}],"border-opacity":[{"border-opacity":[_]}],"border-style":[{border:[...Ne(),"hidden"]}],"divide-x":[{"divide-x":[x]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[x]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[_]}],"divide-style":[{divide:Ne()}],"border-color":[{border:[f]}],"border-color-x":[{"border-x":[f]}],"border-color-y":[{"border-y":[f]}],"border-color-s":[{"border-s":[f]}],"border-color-e":[{"border-e":[f]}],"border-color-t":[{"border-t":[f]}],"border-color-r":[{"border-r":[f]}],"border-color-b":[{"border-b":[f]}],"border-color-l":[{"border-l":[f]}],"divide-color":[{divide:[f]}],"outline-style":[{outline:["",...Ne()]}],"outline-offset":[{"outline-offset":[Jt,we]}],"outline-w":[{outline:[Jt,wr]}],"outline-color":[{outline:[o]}],"ring-w":[{ring:Me()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[o]}],"ring-opacity":[{"ring-opacity":[_]}],"ring-offset-w":[{"ring-offset":[Jt,wr]}],"ring-offset-color":[{"ring-offset":[o]}],shadow:[{shadow:["","inner","none",jr,f0]}],"shadow-color":[{shadow:[Ns]}],opacity:[{opacity:[_]}],"mix-blend":[{"mix-blend":[...ke(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":ke()}],filter:[{filter:["","none"]}],blur:[{blur:[a]}],brightness:[{brightness:[c]}],contrast:[{contrast:[E]}],"drop-shadow":[{"drop-shadow":["","none",jr,we]}],grayscale:[{grayscale:[b]}],"hue-rotate":[{"hue-rotate":[k]}],invert:[{invert:[P]}],saturate:[{saturate:[q]}],sepia:[{sepia:[H]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[a]}],"backdrop-brightness":[{"backdrop-brightness":[c]}],"backdrop-contrast":[{"backdrop-contrast":[E]}],"backdrop-grayscale":[{"backdrop-grayscale":[b]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[k]}],"backdrop-invert":[{"backdrop-invert":[P]}],"backdrop-opacity":[{"backdrop-opacity":[_]}],"backdrop-saturate":[{"backdrop-saturate":[q]}],"backdrop-sepia":[{"backdrop-sepia":[H]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[h]}],"border-spacing-x":[{"border-spacing-x":[h]}],"border-spacing-y":[{"border-spacing-y":[h]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",we]}],duration:[{duration:j()}],ease:[{ease:["linear","in","out","in-out",we]}],delay:[{delay:j()}],animate:[{animate:["none","spin","ping","pulse","bounce",we]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[Z]}],"scale-x":[{"scale-x":[Z]}],"scale-y":[{"scale-y":[Z]}],rotate:[{rotate:[ks,we]}],"translate-x":[{"translate-x":[ne]}],"translate-y":[{"translate-y":[ne]}],"skew-x":[{"skew-x":[T]}],"skew-y":[{"skew-y":[T]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",we]}],accent:[{accent:["auto",o]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",we]}],"caret-color":[{caret:[o]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":ce()}],"scroll-mx":[{"scroll-mx":ce()}],"scroll-my":[{"scroll-my":ce()}],"scroll-ms":[{"scroll-ms":ce()}],"scroll-me":[{"scroll-me":ce()}],"scroll-mt":[{"scroll-mt":ce()}],"scroll-mr":[{"scroll-mr":ce()}],"scroll-mb":[{"scroll-mb":ce()}],"scroll-ml":[{"scroll-ml":ce()}],"scroll-p":[{"scroll-p":ce()}],"scroll-px":[{"scroll-px":ce()}],"scroll-py":[{"scroll-py":ce()}],"scroll-ps":[{"scroll-ps":ce()}],"scroll-pe":[{"scroll-pe":ce()}],"scroll-pt":[{"scroll-pt":ce()}],"scroll-pr":[{"scroll-pr":ce()}],"scroll-pb":[{"scroll-pb":ce()}],"scroll-pl":[{"scroll-pl":ce()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",we]}],fill:[{fill:[o,"none"]}],"stroke-w":[{stroke:[Jt,wr,ui]}],stroke:[{stroke:[o,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},g0=Jg(x0);function ee(...o){return g0(Fg(o))}function Ps(o){return o?o.replace(/127\.0\.0\.1|localhost/g,"192.168.178.151"):""}function Qr({type:o,title:d,message:a,defaultValue:c,onConfirm:f,onCancel:m}){return n.jsx("div",{className:"fixed inset-0 z-[99] bg-black/60 backdrop-blur-sm flex items-center justify-center p-4",children:n.jsxs("div",{className:"w-full max-w-sm rounded-2xl border border-border/80 bg-card p-6 shadow-2xl space-y-4 animate-in fade-in zoom-in-95 duration-200",children:[n.jsxs("div",{className:"flex items-center justify-between border-b border-border/20 pb-2",children:[n.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-primary",children:d}),n.jsx("button",{onClick:m||(()=>f()),className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground cursor-pointer",children:n.jsx(Hr,{className:"h-4 w-4"})})]}),n.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:a}),o==="prompt"&&n.jsx("input",{type:"text",id:"custom-dialog-input",defaultValue:c,className:"w-full h-9 px-3 text-xs bg-background/40 border border-border/60 rounded-lg outline-none focus:border-primary transition-colors text-foreground",autoFocus:!0,onKeyDown:h=>{var x;if(h.key==="Enter"){const E=(x=document.getElementById("custom-dialog-input"))==null?void 0:x.value;f(E)}}}),n.jsxs("div",{className:"flex justify-end gap-3 pt-2",children:[(o==="confirm"||o==="prompt")&&n.jsx("button",{onClick:m,className:"h-8 px-4 flex items-center justify-center text-xs font-semibold text-muted-foreground border border-border/60 bg-background/20 hover:bg-accent rounded-lg transition-colors cursor-pointer",children:"Abbrechen"}),n.jsx("button",{onClick:()=>{var x;const h=o==="prompt"?(x=document.getElementById("custom-dialog-input"))==null?void 0:x.value:void 0;f(h)},className:"h-8 px-4 flex items-center justify-center text-xs font-semibold text-primary-foreground bg-primary hover:bg-primary/95 rounded-lg transition-colors cursor-pointer",children:o==="confirm"?"Ja, fortfahren":o==="prompt"?"Übernehmen":"OK"})]})]})})}function En(o){return(o/1024**3).toFixed(1)}function Qo({value:o,label:d,detail:a}){const f=2*Math.PI*24,m=f-Math.min(o,100)/100*f,h=o>90?"stroke-red-500":o>75?"stroke-amber-500":"stroke-primary";return n.jsxs("div",{className:"flex flex-col items-center gap-1.5 p-2 bg-background/20 rounded-xl border border-border/40",children:[n.jsxs("div",{className:"relative flex h-16 w-16 items-center justify-center",children:[n.jsxs("svg",{className:"absolute inset-0 h-full w-full -rotate-90",children:[n.jsx("circle",{cx:"32",cy:"32",r:24,className:"stroke-muted fill-none",strokeWidth:"4.5"}),n.jsx("circle",{cx:"32",cy:"32",r:24,className:ee("fill-none transition-all duration-700 ease-out",h),strokeWidth:"4.5",strokeDasharray:f,strokeDashoffset:m,strokeLinecap:"round"})]}),n.jsxs("span",{className:"text-xs font-mono font-bold tracking-tight text-foreground",children:[Math.round(o),"%"]})]}),n.jsx("span",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wider",children:d}),a&&n.jsx("span",{className:"text-[10px] font-mono text-muted-foreground/80",children:a})]})}function v0(){const[o,d]=p.useState(null),[a,c]=p.useState(null),[f,m]=p.useState([]),[h,x]=p.useState([]),[E,b]=p.useState([]),[k,P]=p.useState(null),[A,I]=p.useState([]),[O,S]=p.useState(null),[C,_]=p.useState(""),[L,q]=p.useState(!1),[Z,H]=p.useState(""),[T,F]=p.useState(!1),[ne,se]=p.useState({open:!1,actionPath:"",actionLabel:""}),[X,ye]=p.useState(null),[ce,Me]=p.useState(!1);async function _e(w){try{await fe("/api/agent/brain",{method:"POST",body:JSON.stringify({model:w})}),ye({type:"alert",title:"Erfolgreich",message:`Hermes-Gehirn wurde auf '${w}' geändert. Der Gateway-Dienst wurde neu gestartet.`,onConfirm:()=>ye(null)}),v(),Me(!1)}catch(J){ye({type:"alert",title:"Fehler",message:`Fehler beim Wechseln des Gehirns: ${J.message}`,onConfirm:()=>ye(null)})}}function Pe(w,J,Le){ye({type:"confirm",title:w,message:J,onConfirm:()=>{ye(null),Le()},onCancel:()=>ye(null)})}const[Ne,ke]=p.useState(""),[W,ae]=p.useState("stable"),[G,j]=p.useState(!1);function v(){fe("/api/system/status").then(d).catch(()=>{}),fe("/api/agent/status").then(c).catch(()=>{}),fe("/api/models").then(w=>{m(w.models||[]),x(w.running||[])}).catch(()=>{}),fe("/api/memory?category=").then(w=>b(w.slice(0,3))).catch(()=>{}),fe("/api/maintenance/updates").then(P).catch(()=>{}),fe("/api/jobs").then(w=>I(w.jobs||[])).catch(()=>{}),fe("/api/system/token-stats").then(S).catch(()=>{})}p.useEffect(()=>{v();const w=setInterval(v,3e3);return()=>clearInterval(w)},[]);async function B(w,J,Le,$t){_(`${J} wird ausgeführt...`),q(!0);try{const lt={...Le},nt=await fe(w,{method:"POST",body:JSON.stringify(lt)});if(nt.status==="password_required"||nt.status==="incorrect_password"){se({open:!0,actionPath:w,actionLabel:J,payload:Le,error:nt.status==="incorrect_password"?"Falsches Sudo-Passwort. Bitte erneut versuchen.":void 0}),_("");return}nt.job_id?_(`${J} gestartet (Job-ID: ${nt.job_id})`):nt.ok?_(`${J} erfolgreich ausgeführt.`):_(`Fehler: ${nt.err||"Unbekannter Fehler"}`),v()}catch(lt){_(`Fehler bei ${J}: ${lt.message}`)}finally{q(!1)}}async function Y(){F(!0);try{const w={...ne.payload,sudo_password:Z},J=await fe(ne.actionPath,{method:"POST",body:JSON.stringify(w)});if(J.status==="password_required"||J.status==="incorrect_password"){se(Le=>({...Le,error:"Falsches Sudo-Passwort. Bitte erneut versuchen."}));return}J.job_id?_(`${ne.actionLabel} gestartet (Job-ID: ${J.job_id})`):J.ok?_(`${ne.actionLabel} erfolgreich ausgeführt.`):_(`Fehler: ${J.err||"Unbekannter Fehler"}`),se({open:!1,actionPath:"",actionLabel:""}),H(""),v()}catch(w){_(`Fehler: ${w.message}`),se({open:!1,actionPath:"",actionLabel:""}),H("")}finally{F(!1)}}async function K(w,J){_(`Upgrade für ${w} wird gestartet...`);try{await fe("/api/models/install",{method:"POST",body:JSON.stringify({repo:w,role:J,quant:"Q4_K_M",jinja:!0})}),_("Upgrade-Download gestartet."),v()}catch(Le){_(`Upgrade fehlgeschlagen: ${Le.message}`)}}async function oe(){if(!(!Ne.trim()||G)){j(!0);try{await fe("/api/memory",{method:"POST",body:JSON.stringify({content:Ne,category:W,source:"dashboard"})}),ke(""),fe("/api/memory?category=").then(w=>b(w.slice(0,3))).catch(()=>{})}catch(w){console.error(w)}finally{j(!1)}}}const pe=A.find(w=>w.label.includes("OS-Update")&&(w.state==="running"||w.state==="queued")),me=A.find(w=>w.label.includes("Engine-Update")&&(w.state==="running"||w.state==="queued"));return n.jsxs("div",{className:"space-y-6",children:[ne.open&&n.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm p-4",children:n.jsxs("div",{className:"w-full max-w-sm rounded-2xl border border-border/60 bg-card/90 backdrop-blur-xl p-5 shadow-2xl space-y-4",children:[n.jsxs("div",{className:"flex items-center justify-between border-b border-border/20 pb-2",children:[n.jsx("span",{className:"text-xs font-bold uppercase tracking-wider text-primary font-space",children:"Sudo-Passwort erforderlich"}),n.jsx("button",{onClick:()=>{se({open:!1,actionPath:"",actionLabel:""}),H("")},className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground cursor-pointer",children:n.jsx(Hr,{className:"h-4 w-4"})})]}),n.jsxs("p",{className:"text-[10px] text-muted-foreground leading-normal",children:["Für die Aktion ",n.jsx("strong",{children:ne.actionLabel})," wird das Administrator-Passwort (Sudo) auf der Box benötigt."]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("input",{type:"password",value:Z,onChange:w=>H(w.target.value),placeholder:"Sudo-Passwort eingeben...",className:"w-full h-9 rounded-lg border border-border/60 bg-background/40 px-3 text-xs outline-none focus:ring-1 focus:ring-primary/50 text-foreground",onKeyDown:w=>w.key==="Enter"&&Y(),autoFocus:!0}),ne.error&&n.jsx("div",{className:"text-[10px] font-semibold text-red-400",children:ne.error})]}),n.jsxs("div",{className:"flex gap-2 justify-end",children:[n.jsx("button",{onClick:()=>{se({open:!1,actionPath:"",actionLabel:""}),H("")},className:"h-8 px-3 rounded-lg border border-border/60 bg-background/25 text-[10px] font-bold uppercase hover:bg-accent transition-all cursor-pointer",children:"Abbrechen"}),n.jsx("button",{onClick:Y,disabled:!Z||T,className:"h-8 px-4 rounded-lg bg-primary text-primary-foreground text-[10px] font-bold uppercase hover:opacity-90 transition-all disabled:opacity-50 cursor-pointer flex items-center justify-center gap-1.5",children:T?"Prüfe...":"Ausführen"})]})]})}),n.jsxs("div",{children:[n.jsx("h1",{className:"text-2xl font-space font-bold tracking-tight bg-gradient-to-r from-foreground via-foreground to-primary bg-clip-text text-transparent",children:"Zentrale"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Aktueller Status von System, Modellen und Agent."})]}),n.jsxs("div",{className:"grid gap-6 md:grid-cols-3",children:[n.jsxs("div",{className:"md:col-span-2 flex flex-col justify-between rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/15",children:[n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[n.jsx(gt,{className:"h-4.5 w-4.5 text-primary"}),n.jsx("h2",{className:"text-sm font-semibold tracking-wide uppercase text-foreground",children:"System-Status"})]}),o?n.jsxs("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-4",children:[n.jsx(Qo,{value:o.cpu.percent,label:"CPU",detail:o.cpu.cores?`${o.cpu.cores} Cores`:void 0}),n.jsx(Qo,{value:o.ram.percent,label:"RAM",detail:`${En(o.ram.used)} / ${En(o.ram.total)} GB`}),o.gpu&&o.gpu.busy_percent!=null&&o.gpu.gtt_used!=null&&o.gpu.gtt_total!=null&&n.jsx(Qo,{value:o.gpu.busy_percent,label:"GPU",detail:`${En(o.gpu.gtt_used)} / ${En(o.gpu.gtt_total)} GB`}),o.disk&&n.jsx(Qo,{value:o.disk.percent,label:"Disk",detail:`${En(o.disk.used)} / ${En(o.disk.total)} GB`})]}):n.jsx("div",{className:"h-28 flex items-center justify-center text-xs text-muted-foreground",children:"Lade Systemdaten…"})]}),(o==null?void 0:o.temp)&&(o.temp.cpu||o.temp.gpu)&&n.jsxs("div",{className:"mt-4 flex gap-4 text-xs font-mono text-muted-foreground/80 border-t border-border/30 pt-3",children:[o.temp.cpu!=null&&n.jsxs("span",{children:["CPU Temp: ",o.temp.cpu," °C"]}),o.temp.gpu!=null&&n.jsxs("span",{children:["GPU Temp: ",o.temp.gpu," °C"]})]})]}),n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/15 flex flex-col justify-between",children:[n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-2 border-b border-border/20 pb-2",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(Ch,{className:"h-4.5 w-4.5 text-primary"}),n.jsx("h2",{className:"text-sm font-semibold tracking-wide uppercase text-foreground",children:"Updates & Pflege"})]}),(k==null?void 0:k.last_check)&&n.jsxs("span",{className:"text-[9px] text-muted-foreground/80 font-mono",children:["Zuletzt gesucht: ",new Date(k.last_check*1e3).toLocaleString("de-DE",{day:"2-digit",month:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit"})]})]}),k?n.jsxs("div",{className:"space-y-3",children:[n.jsxs("div",{className:"space-y-1.5",children:[n.jsxs("div",{className:ee("flex items-center justify-between px-3 py-1.5 rounded-lg border text-xs",k.os>0?"border-amber-500/30 bg-amber-500/5 text-amber-400 font-semibold":"border-border/30 bg-background/25 text-muted-foreground"),children:[n.jsx("span",{children:"OS-Pakete"}),n.jsx("span",{className:"font-mono",children:k.os>0?`${k.os} verfügbar`:"aktuell"})]}),n.jsxs("div",{className:ee("flex items-center justify-between px-3 py-1.5 rounded-lg border text-xs",k.engine>0?"border-amber-500/30 bg-amber-500/5 text-amber-400 font-semibold":"border-border/30 bg-background/25 text-muted-foreground"),children:[n.jsx("span",{children:"Engine (llama.cpp)"}),n.jsx("span",{className:"font-mono",children:k.engine>0?"Update verfügbar":"aktuell"})]}),n.jsxs("div",{className:ee("flex items-center justify-between px-3 py-1.5 rounded-lg border text-xs",k.models>0?"border-primary/30 bg-primary/5 text-primary font-semibold animate-pulse":"border-border/30 bg-background/25 text-muted-foreground"),children:[n.jsx("span",{children:"Modell-Upgrades"}),n.jsx("span",{className:"font-mono",children:k.models>0?`${k.models} verfügbar`:"aktuell"})]})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-2 border-t border-border/20 pt-3",children:[n.jsx("button",{onClick:()=>B("/api/maintenance/os-update","OS-Update"),disabled:L||!!pe,className:"h-8 px-2 rounded-lg border border-border/60 bg-background/20 text-[10px] font-bold uppercase hover:border-primary/50 hover:bg-background/40 transition-all cursor-pointer disabled:opacity-50 flex items-center justify-center gap-1",children:pe?n.jsxs(n.Fragment,{children:[n.jsx(Br,{className:"h-3 w-3 animate-spin text-primary"}),n.jsxs("span",{children:["Aktiv (",pe.progress??0,"%)"]})]}):n.jsx("span",{children:"OS Update"})}),n.jsx("button",{onClick:()=>B("/api/maintenance/engine-update","Engine-Update"),disabled:L||!!me,className:"h-8 px-2 rounded-lg border border-border/60 bg-background/20 text-[10px] font-bold uppercase hover:border-primary/50 hover:bg-background/40 transition-all cursor-pointer disabled:opacity-50 flex items-center justify-center gap-1",children:me?n.jsxs(n.Fragment,{children:[n.jsx(Br,{className:"h-3 w-3 animate-spin text-primary"}),n.jsxs("span",{children:["Aktiv (",me.progress??0,"%)"]})]}):n.jsx("span",{children:"Engine Update"})})]}),n.jsxs("button",{onClick:()=>{Pe("Host-System neu starten?","Bist du sicher, dass du das Host-System neu starten willst?",()=>B("/api/maintenance/reboot","Reboot"))},disabled:L,className:"w-full h-8 flex items-center justify-center gap-1.5 rounded-lg border border-red-500/30 bg-red-500/5 text-red-400 text-[10px] font-bold uppercase hover:bg-red-500/10 transition-all cursor-pointer disabled:opacity-50",children:[n.jsx(df,{className:"h-3.5 w-3.5"}),n.jsx("span",{children:"Host Reboot"})]}),k.model_list.length>0&&n.jsxs("div",{className:"space-y-1.5 border-t border-border/20 pt-3",children:[n.jsx("div",{className:"text-[9px] uppercase font-bold text-muted-foreground/60 tracking-wider",children:"Verfügbare Modell-Upgrades:"}),n.jsx("div",{className:"max-h-24 overflow-y-auto space-y-1.5 pr-1 scrollbar-thin",children:k.model_list.map(w=>n.jsxs("div",{className:"flex items-center justify-between p-2 rounded bg-background/25 border border-border/30 text-[10px] font-mono text-muted-foreground",children:[n.jsxs("span",{className:"truncate flex-1 mr-1.5",title:`${w.role}: ${w.repo}`,children:[n.jsx("span",{className:"text-primary font-bold uppercase",children:w.role}),": ",w.repo.split("/").pop()]}),n.jsxs("button",{onClick:()=>K(w.repo,w.role),className:"px-2 py-0.5 text-[8px] font-bold uppercase rounded bg-primary text-primary-foreground hover:opacity-90 transition-all cursor-pointer flex items-center gap-0.5",children:[n.jsx(Vr,{className:"h-2.5 w-2.5"})," Laden"]})]},w.repo))})]})]}):n.jsx("div",{className:"h-24 flex items-center justify-center text-xs text-muted-foreground",children:"Lade Updates..."}),C&&n.jsx("div",{className:"text-[10px] font-mono text-primary font-medium bg-primary/5 p-2 rounded-lg border border-primary/20 break-all leading-normal",children:C}),n.jsxs("div",{className:"text-[9px] text-muted-foreground/60 leading-normal border-t border-border/10 pt-2.5 flex items-start gap-1",children:[n.jsx(Wr,{className:"h-3 w-3 shrink-0 text-muted-foreground/50 mt-0.5"}),n.jsxs("span",{children:["OS-Update & Reboot benötigen NOPASSWD in ",n.jsx("code",{children:"/etc/sudoers"})," (z.B. ",n.jsx("code",{children:"hitonabi ALL=(root) NOPASSWD:..."}),") oder ein gültiges Sudo-Passwort per Pop-up."]})]})]}),n.jsx("div",{className:"mt-4 border-t border-border/30 pt-3 shrink-0",children:n.jsx("button",{onClick:()=>window.dispatchEvent(new CustomEvent("open-system-drawer")),className:"w-full h-8 flex items-center justify-center gap-1.5 rounded-lg bg-primary text-primary-foreground text-xs font-semibold hover:opacity-90 transition-all cursor-pointer shadow-md shadow-primary/10",children:"System-Zentrale öffnen"})})]})]}),n.jsxs("div",{className:"grid gap-6 md:grid-cols-2 xl:grid-cols-4",children:[n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/15 flex flex-col justify-between",children:[n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center justify-between mb-4",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(Ss,{className:"h-4.5 w-4.5 text-primary"}),n.jsx("h2",{className:"text-sm font-semibold tracking-wide uppercase text-foreground",children:"Hermes Agent"})]}),(a==null?void 0:a.webui_url)&&n.jsxs("a",{href:Ps(a.webui_url),target:"_blank",rel:"noopener",className:ee("flex items-center gap-1 px-3 py-1 rounded-lg text-xs font-medium transition-all",a.webui_reachable?"bg-primary text-primary-foreground hover:opacity-90 shadow-md shadow-primary/20":"border border-border text-muted-foreground"),children:[n.jsx(el,{className:"h-3 w-3"})," Hermes öffnen"]})]}),a?n.jsxs("div",{className:"space-y-3",children:[n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n.jsxs("div",{className:"p-3 bg-background/20 rounded-xl border border-border/40",children:[n.jsx("div",{className:"text-[10px] text-muted-foreground uppercase font-semibold",children:"Gateway"}),n.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[n.jsx("span",{className:ee("h-2 w-2 rounded-full",a.gateway_reachable?"bg-emerald-500 animate-pulse":"bg-amber-500")}),n.jsx("span",{className:"text-xs font-medium",children:a.gateway_reachable?"Online":"Offline"})]})]}),n.jsxs("div",{className:"p-3 bg-background/20 rounded-xl border border-border/40",children:[n.jsx("div",{className:"text-[10px] text-muted-foreground uppercase font-semibold",children:"WebUI"}),n.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[n.jsx("span",{className:ee("h-2 w-2 rounded-full",a.webui_reachable?"bg-emerald-500 animate-pulse":"bg-amber-500")}),n.jsx("span",{className:"text-xs font-medium",children:a.webui_reachable?"Online":"Offline"})]})]})]}),n.jsxs("div",{onClick:()=>Me(!0),className:"p-3 bg-background/20 rounded-xl border border-border/40 hover:border-primary/45 hover:bg-background/30 transition-all duration-300 cursor-pointer group",children:[n.jsxs("div",{className:"flex justify-between items-center",children:[n.jsx("span",{className:"text-[10px] text-muted-foreground uppercase font-semibold",children:"Aktives Gehirn"}),n.jsxs("button",{className:"flex items-center gap-1 text-[9px] font-bold uppercase tracking-wider text-primary border border-primary/20 bg-primary/10 hover:bg-primary/20 px-1.5 py-0.5 rounded transition-all cursor-pointer font-space",children:[n.jsx(gt,{className:"h-3 w-3"})," Ändern"]})]}),n.jsxs("div",{className:"text-xs font-medium mt-1 font-mono text-primary flex items-center gap-1.5",children:[n.jsx(Es,{className:"h-3.5 w-3.5"}),a.brain_model?`model: ${a.brain_model}`:"model: auto"]})]})]}):n.jsx("div",{className:"h-28 flex items-center justify-center text-xs text-muted-foreground",children:"Lade Agenten-Status…"})]}),n.jsx("div",{className:"mt-3 text-[10px] text-muted-foreground/80 border-t border-border/30 pt-3",children:"Gedächtnis & Stack-Tools via MCP gekoppelt."})]}),n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/15 flex flex-col justify-between",children:[n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[n.jsx(Es,{className:"h-4.5 w-4.5 text-primary"}),n.jsx("h2",{className:"text-sm font-semibold tracking-wide uppercase text-foreground",children:"Rollen-Belegung"})]}),n.jsx("div",{className:"space-y-2 max-h-48 overflow-y-auto pr-1 scrollbar-thin",children:["fast","heavy","coder","reasoning","vision","scout"].map(w=>{var $t;const J=f.find(lt=>lt.role===w),Le=J?h.includes(J.name):!1;return n.jsxs("div",{className:ee("flex items-center justify-between p-2 rounded-xl border transition-all duration-300",Le?"border-emerald-500/30 bg-emerald-500/5 shadow-sm shadow-emerald-500/5":J?"border-primary/20 bg-primary/5":"border-border/30 bg-background/10 opacity-60"),children:[n.jsx("div",{className:"min-w-0 flex-1 mr-2",children:n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:ee("text-[9px] font-semibold uppercase px-1.5 py-0.5 rounded font-mono border tracking-wider shrink-0",w==="fast"?"bg-cyan-500/15 text-cyan-400 border-cyan-500/25":w==="heavy"?"bg-amber-500/15 text-amber-400 border-amber-500/25":w==="coder"?"bg-violet-500/15 text-violet-400 border-violet-500/25":w==="reasoning"?"bg-emerald-500/15 text-emerald-400 border-emerald-500/25":w==="vision"?"bg-pink-500/15 text-pink-400 border-pink-500/25":"bg-teal-500/15 text-teal-400 border-teal-500/25"),children:w}),n.jsx("span",{className:"text-xs font-semibold truncate font-mono text-foreground",children:J?($t=J.name.split("/").pop())==null?void 0:$t.replace(/\.gguf$/i,""):"nicht zugewiesen"})]})}),n.jsx("div",{className:"flex items-center gap-1.5 shrink-0",children:J?Le?n.jsxs("span",{className:"flex items-center gap-1 text-[8px] font-semibold text-emerald-400 uppercase tracking-wider font-mono",children:[n.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500 animate-pulse"})," warm"]}):n.jsx("span",{className:"text-[8px] font-semibold text-muted-foreground uppercase tracking-wider font-mono",children:"bereit"}):n.jsx("span",{className:"text-[8px] font-semibold text-muted-foreground/60 uppercase tracking-wider font-mono",children:"—"})})]},w)})})]}),n.jsx("div",{className:"mt-4 text-[10px] text-muted-foreground/80 border-t border-border/30 pt-3",children:"Laden erfolgt automatisch per Auto-Swap."})]}),n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/15 flex flex-col justify-between",children:[n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[n.jsx(Cs,{className:"h-4.5 w-4.5 text-primary"}),n.jsx("h2",{className:"text-sm font-semibold tracking-wide uppercase text-foreground",children:"Gedächtnis"})]}),n.jsxs("div",{className:"space-y-3",children:[n.jsx("textarea",{value:Ne,onChange:w=>ke(w.target.value),placeholder:"Fakt / Regel im Pool speichern...",rows:2,className:"w-full resize-none rounded-xl border border-border/50 bg-background/30 p-2 text-[10px] outline-none focus:ring-1 focus:ring-primary transition-all leading-normal"}),n.jsxs("div",{className:"flex items-center gap-2 justify-between",children:[n.jsxs("select",{value:W,onChange:w=>ae(w.target.value),className:"h-7 rounded-lg border border-border/50 bg-background/50 px-2 text-[10px] outline-none cursor-pointer",children:[n.jsx("option",{value:"stable",children:"🔵 Fakt"}),n.jsx("option",{value:"instruction",children:"📋 Regel"}),n.jsx("option",{value:"user",children:"👤 User"}),n.jsx("option",{value:"versioned",children:"🟡 Version"})]}),n.jsxs("button",{onClick:oe,disabled:!Ne.trim()||G,className:"flex h-7 items-center gap-1 rounded-lg bg-primary px-3 text-[10px] font-semibold text-primary-foreground hover:opacity-90 disabled:opacity-50 transition-all cursor-pointer",children:[n.jsx(af,{className:"h-3.5 w-3.5"})," Speichern"]})]})]}),n.jsxs("div",{className:"mt-3.5 space-y-1.5",children:[n.jsx("div",{className:"text-[9px] text-muted-foreground uppercase font-bold tracking-wider",children:"Zuletzt gespeichert:"}),n.jsx("div",{className:"max-h-20 overflow-y-auto space-y-1 pr-1 scrollbar-thin",children:E.length===0?n.jsx("div",{className:"text-[10px] text-muted-foreground/75 py-1",children:"Keine Einträge vorhanden."}):E.map(w=>n.jsxs("div",{className:"text-[10px] bg-background/10 border border-border/30 rounded p-1.5 flex items-start gap-1.5",children:[n.jsx("span",{className:"shrink-0 text-[8px] font-mono text-muted-foreground/80 px-1 py-0.5 rounded bg-muted/20",children:w.category}),n.jsx("span",{className:"truncate flex-1 text-muted-foreground hover:text-foreground transition-colors",title:w.content,children:w.content})]},w.id))})]})]}),n.jsx("div",{className:"mt-4 text-[10px] text-muted-foreground/80 border-t border-border/30 pt-3",children:"Steht allen Clients per MCP zur Verfügung."})]}),n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/15 flex flex-col justify-between",children:[n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[n.jsx(ph,{className:"h-4.5 w-4.5 text-primary animate-pulse"}),n.jsx("h2",{className:"text-sm font-semibold tracking-wide uppercase text-foreground",children:"Effizienz & Ersparnis"})]}),O?n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"grid grid-cols-2 gap-2.5",children:[n.jsxs("div",{className:"p-3 bg-background/20 rounded-xl border border-border/40 text-left",children:[n.jsx("div",{className:"text-[8px] uppercase tracking-wider font-semibold text-muted-foreground/60",children:"Geld gespart"}),n.jsxs("div",{className:"text-base font-bold text-emerald-400 mt-0.5 tracking-tight font-space",children:[O.saved_eur.toLocaleString("de-DE",{minimumFractionDigits:2})," €"]}),n.jsxs("div",{className:"text-[8px] text-muted-foreground/80 mt-0.5 font-mono",children:["(",O.saved_usd.toLocaleString("en-US",{minimumFractionDigits:2})," $)"]})]}),n.jsxs("div",{className:"p-3 bg-background/20 rounded-xl border border-border/40 text-left",children:[n.jsx("div",{className:"text-[8px] uppercase tracking-wider font-semibold text-muted-foreground/60",children:"Gesamt-Tokens"}),n.jsx("div",{className:"text-base font-bold text-primary mt-0.5 tracking-tight font-space",children:O.total_tokens.toLocaleString("de-DE")}),n.jsx("div",{className:"text-[8px] text-muted-foreground/80 mt-0.5 font-mono",children:"(Lokale Inferenz)"})]})]}),n.jsxs("div",{className:"space-y-2 border-t border-border/20 pt-3 text-[10px] text-muted-foreground",children:[n.jsxs("div",{className:"flex justify-between items-center font-mono",children:[n.jsx("span",{children:"Input (Prompts):"}),n.jsxs("span",{className:"font-semibold text-foreground",children:[O.prompt_tokens.toLocaleString("de-DE")," tkn"]})]}),n.jsxs("div",{className:"flex justify-between items-center font-mono",children:[n.jsx("span",{children:"Output (Antworten):"}),n.jsxs("span",{className:"font-semibold text-foreground",children:[O.completion_tokens.toLocaleString("de-DE")," tkn"]})]})]})]}):n.jsx("div",{className:"h-28 flex items-center justify-center text-xs text-muted-foreground",children:"Lade Statistiken…"})]}),n.jsx("div",{className:"mt-4 text-[9px] text-muted-foreground/70 border-t border-border/30 pt-2.5 leading-normal",children:"Berechnet im Vergleich zu Cloud-APIs (Ø 3,00 $ / 15,00 $ pro 1M tkn)."})]})]}),a&&ce&&n.jsx("div",{className:"fixed inset-0 z-50 bg-black/60 backdrop-blur-sm flex items-center justify-center p-4",children:n.jsxs("div",{className:"w-full max-w-md rounded-2xl border border-border/80 bg-card p-6 shadow-2xl space-y-4 animate-in fade-in zoom-in-95 duration-200",children:[n.jsxs("div",{className:"flex items-center justify-between border-b border-border/20 pb-2",children:[n.jsxs("h3",{className:"text-xs font-bold uppercase tracking-wider text-primary flex items-center gap-1.5",children:[n.jsx(gt,{className:"h-4 w-4"}),n.jsx("span",{children:"Hermes-Gehirn konfigurieren"})]}),n.jsx("button",{onClick:()=>Me(!1),className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground cursor-pointer",children:n.jsx(Hr,{className:"h-4 w-4"})})]}),n.jsxs("p",{className:"text-xs text-muted-foreground leading-relaxed",children:['Das „Gehirn" ist das primäre LLM für Hermes. Wähle ein Modell aus deiner Bibliothek oder nutze ein Gateway-Alias (',n.jsx("code",{className:"text-primary font-semibold",children:"auto"})," / ",n.jsx("code",{className:"text-primary font-semibold",children:"fast"})," / ",n.jsx("code",{className:"text-primary font-semibold",children:"heavy"}),"):"]}),n.jsx("div",{className:"space-y-1.5 max-h-60 overflow-y-auto pr-1",children:["auto","fast","heavy",...f.map(w=>{var J;return((J=w.name.split("/").pop())==null?void 0:J.replace(".gguf",""))||w.name})].map(w=>{const J=["auto","fast","heavy"].includes(w);return n.jsxs("button",{onClick:()=>_e(w),className:ee("w-full text-left px-3 py-2.5 rounded-lg text-xs hover:bg-accent flex items-center justify-between font-mono cursor-pointer border border-border/30",a.brain_model===w||!a.brain_model&&w==="auto"?"text-primary font-bold bg-primary/10 border-primary/30":"text-foreground bg-background/20"),children:[n.jsxs("div",{className:"flex flex-col text-left",children:[n.jsx("span",{className:"font-semibold truncate max-w-[280px]",children:w}),n.jsx("span",{className:"text-[9px] text-muted-foreground mt-0.5",children:J?"Gateway Routing Alias":"Installiertes GGUF Modell"})]}),(a.brain_model===w||!a.brain_model&&w==="auto")&&n.jsx(zn,{className:"h-4 w-4 shrink-0 text-primary"})]},w)})})]})}),X&&n.jsx(Qr,{type:X.type,title:X.title,message:X.message,onConfirm:()=>X.onConfirm(),onCancel:X.onCancel})]})}function $r({children:o,tone:d="muted"}){const a={muted:"bg-muted text-muted-foreground",primary:"bg-primary/15 text-primary",warn:"bg-amber-500/15 text-amber-500"};return n.jsx("span",{className:`rounded px-1.5 py-0.5 text-[11px] font-medium ${a[d]}`,children:o})}function Zu({caps:o}){return o?n.jsxs("span",{className:"inline-flex flex-wrap gap-1",children:[o.coder&&n.jsx($r,{children:"💻 Code"}),o.vision&&n.jsx($r,{children:"👁 Bild"}),o.reasoning&&n.jsx($r,{children:"🧠 Reason"}),o.moe&&n.jsxs($r,{tone:"primary",children:["🧩 MoE",o.active_b?`·${o.active_b}b`:""]}),o.tools==="yes"&&n.jsx($r,{tone:"primary",children:"🛠 Tools"}),o.tools==="likely"&&n.jsx($r,{tone:"warn",children:"🛠 Tools?"}),o.embedding&&n.jsx($r,{children:"🔢 Embed"})]}):null}function Si(o){return o?o>1024**3?`${(o/1024**3).toFixed(1)} GB`:`${(o/1024**2).toFixed(0)} MB`:""}function y0(o){if(!o)return"";const d=Math.floor(o/60);return d>0?`${d} min`:`${o} s`}function b0({onError:o}){const[d,a]=p.useState([]),[c,f]=p.useState(null);function m(){fe("/api/jobs").then(b=>a(b.jobs||[])).catch(()=>{})}p.useEffect(()=>{m();const b=setInterval(m,2e3);return()=>clearInterval(b)},[]);async function h(b){try{await fe(`/api/jobs/${b}/cancel`,{method:"POST"}),m()}catch(k){o?o(k.message):f(k.message)}}const x=d.filter(b=>b.state==="running"||b.state==="queued"),E=d.filter(b=>b.state!=="running"&&b.state!=="queued").slice(-3);return x.length===0&&E.length===0?null:n.jsxs("div",{className:"space-y-3 rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-4 shadow-lg shadow-black/10",children:[n.jsx("div",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wider",children:"Aktive Downloads"}),x.map(b=>n.jsxs("div",{className:"space-y-1.5 p-3 rounded-xl bg-background/20 border border-border/40",children:[n.jsxs("div",{className:"flex justify-between items-center text-xs",children:[n.jsx("span",{className:"font-semibold truncate max-w-[250px]",children:b.label}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsxs("span",{className:"text-muted-foreground font-mono",children:[b.progress??0,"% • ",Si(b.done_bytes),"/",Si(b.total_bytes),b.eta_s?` • ETA ${y0(b.eta_s)}`:""]}),n.jsx("button",{onClick:()=>h(b.id),className:"text-[10px] text-red-400 hover:text-red-300 font-semibold border border-red-500/25 bg-red-500/5 px-2 py-0.5 rounded transition-all cursor-pointer",children:"Abbrechen"})]})]}),n.jsx("div",{className:"h-1.5 overflow-hidden rounded-full bg-muted",children:n.jsx("div",{className:"h-full rounded-full bg-primary transition-all duration-500",style:{width:`${b.progress??0}%`}})})]},b.id)),E.map(b=>n.jsxs("div",{className:"flex justify-between items-center text-xs text-muted-foreground px-1",children:[n.jsx("span",{className:"truncate",children:b.label}),n.jsx("span",{className:ee("font-semibold text-[10px] px-1.5 py-0.5 rounded uppercase font-mono",b.state==="done"?"bg-emerald-500/10 text-emerald-400":"bg-amber-500/10 text-amber-400"),children:b.state})]},b.id)),c&&n.jsx(Qr,{type:"alert",title:"Fehler",message:c,onConfirm:()=>f(null)})]})}function Ur(o){if(!o)return"—";const d=o/1024**3;return d>=1?`${d.toFixed(1)} GB`:`${(o/1024**2).toFixed(0)} MB`}function Yu(o){return o?`${Math.round(o/1024)}k`:"—"}function w0({fit:o}){const d={perfect:"bg-emerald-500/15 text-emerald-400 border border-emerald-500/20",marginal:"bg-amber-500/15 text-amber-400 border border-amber-500/20",too_tight:"bg-red-500/15 text-red-400 border border-red-500/20"}[o.level];return n.jsxs("span",{className:ee("rounded px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wider font-mono",d),children:[o.text," • ",o.req_gb," GB RAM"]})}const j0=["fast","heavy","coder","reasoning","agent","vision","scout"];function Ju(o){const d=o.toLowerCase();return d.includes("qwen")?{name:"Qwen",color:"bg-purple-500/20 text-purple-300 border-purple-500/30",initial:"Q"}:d.includes("gemma")?{name:"Gemma",color:"bg-blue-500/20 text-blue-300 border-blue-500/30",initial:"G"}:d.includes("llama")?{name:"Llama",color:"bg-red-500/20 text-red-300 border-red-500/30",initial:"🦙"}:d.includes("mistral")||d.includes("mixtral")?{name:"Mistral",color:"bg-orange-500/20 text-orange-300 border-orange-500/30",initial:"M"}:d.includes("deepseek")?{name:"DeepSeek",color:"bg-cyan-500/20 text-cyan-300 border-cyan-500/30",initial:"D"}:d.includes("hermes")||d.includes("nous")?{name:"Hermes",color:"bg-amber-500/20 text-amber-300 border-amber-500/30",initial:"H"}:d.includes("phi")?{name:"Phi",color:"bg-emerald-500/20 text-emerald-300 border-emerald-500/30",initial:"Φ"}:{name:"Other",color:"bg-slate-500/20 text-slate-300 border-slate-500/30",initial:"AI"}}function k0(){var Zr,tr,Ut,Yr,In;const[o,d]=p.useState([]),[a,c]=p.useState([]),[f,m]=p.useState(null),[h,x]=p.useState(null),[E,b]=p.useState(null),[k,P]=p.useState(!0),[A,I]=p.useState(""),[O,S]=p.useState(null),[C,_]=p.useState(null),[L,q]=p.useState(!1),[Z,H]=p.useState(null),[T,F]=p.useState("grid"),[ne,se]=p.useState("all"),[X,ye]=p.useState(null);function ce(D,re,ve){ye({type:"alert",title:D,message:re,onConfirm:()=>{ye(null)}})}function Me(D,re,ve,Se){ye({type:"confirm",title:D,message:re,onConfirm:()=>{ye(null),ve()},onCancel:()=>{ye(null)}})}function _e(D,re,ve,Se,ze){ye({type:"prompt",title:D,message:re,defaultValue:ve,onConfirm:Nt=>{ye(null),Se(Nt)},onCancel:()=>{ye(null)}})}const Pe=o.filter(D=>ne==="in_use"?!!D.role||a.includes(D.name):!0),[Ne,ke]=p.useState({width:800,height:360}),W=p.useRef(null),ae=p.useCallback(D=>{if(W.current&&(W.current.disconnect(),W.current=null),D){const re=new ResizeObserver(ve=>{if(!ve||ve.length===0)return;const Se=ve[0].contentRect;ke({width:Se.width,height:Se.height})});re.observe(D),W.current=re}},[]),G=Ne.width,j=Ne.height,v=D=>{const re=G*.1,ve=j*D,Se=G*.5,ze=j*.5,Nt=G*.3,Bt=ve,Vt=G*.3;return`M ${re} ${ve} C ${Nt} ${Bt}, ${Vt} ${ze}, ${Se} ${ze}`},B=D=>{const re=G*.5,ve=j*.5,Se=G*.9,ze=j*D,Nt=G*.7,Bt=ve,Vt=G*.7;return`M ${re} ${ve} C ${Nt} ${Bt}, ${Vt} ${ze}, ${Se} ${ze}`};function Y(){Promise.all([fe("/api/models"),fe("/api/routing"),fe("/api/connect"),fe("/api/maintenance/updates")]).then(([D,re,ve,Se])=>{d(D.models||[]),c(D.running||[]),m(re),x(ve),b(Se)}).catch(D=>I(String(D))).finally(()=>P(!1))}p.useEffect(()=>{Y();const D=setInterval(Y,4e3);return()=>clearInterval(D)},[]);async function K(D){try{await fe(`/api/models/${encodeURIComponent(D)}/load`,{method:"POST"}),Y()}catch(re){ce("Fehler",`Fehler beim Laden des Modells: ${re.message}`)}}async function oe(D){try{await fe(`/api/models/${encodeURIComponent(D)}/unload`,{method:"POST"}),Y()}catch(re){ce("Fehler",`Fehler beim Entladen des Modells: ${re.message}`)}}async function pe(){try{await fe("/api/models/unload",{method:"POST"}),Y()}catch(D){ce("Fehler",`Fehler beim Entladen aller Modelle: ${D.message}`)}}async function me(D,re){try{await fe(`/api/models/${encodeURIComponent(re)}/role`,{method:"POST",body:JSON.stringify({role:D||null})}),Y()}catch(ve){ce("Fehler",`Fehler beim Zuweisen der Rolle: ${ve.message||ve}`)}}async function w(D,re){_e("Kontextlänge anpassen","Gib die gewünschte Kontextlänge in Tokens an:",String(re||32768),async ve=>{if(ve)try{await fe(`/api/models/${encodeURIComponent(D)}/ctx`,{method:"POST",body:JSON.stringify({ctx:parseInt(ve,10)})}),Y()}catch(Se){ce("Fehler",`Fehler beim Setzen des Kontexts: ${Se.message||Se}`)}})}async function J(D){Me("Modell löschen?",`Modell '${D}' und alle zugehörigen GGUF-Dateien unwiderruflich von der Box löschen?`,async()=>{try{await fe(`/api/models/${encodeURIComponent(D)}`,{method:"DELETE"}),Y()}catch(re){ce("Fehler",`Fehler beim Löschen: ${re.message||re}`)}})}async function Le(D,re,ve,Se){try{await fe("/api/models/install",{method:"POST",body:JSON.stringify({repo:D,role:re,quant:ve,jinja:Se})}),ce("Herunterladen gestartet",`Download für '${D}' gestartet! Der Fortschritt wird oben angezeigt.`)}catch(ze){ce("Fehler",`Fehler beim Starten des Upgrades: ${ze.message||ze}`)}}async function $t(D){D&&(await navigator.clipboard.writeText(D),q(!0),setTimeout(()=>q(!1),1500))}if(k)return n.jsx("div",{className:"text-xs text-muted-foreground py-12 text-center",children:"Initialisiere HUD Cockpit…"});if(A)return n.jsxs("div",{className:"rounded-xl border border-red-500/20 bg-red-500/5 p-4 text-xs text-red-400",children:["Gateway oder Engine nicht erreichbar (",A,")."]});const lt=o.filter(D=>a.includes(D.name)),nt=lt.reduce((D,re)=>D+(re.size_bytes||0),0),On=16*1024**3,Tn=nt>On?nt*1.2:On,qr=D=>o.find(re=>re.role===D),er=D=>{const re=qr(D);return re?a.includes(re.name):!1};return n.jsxs("div",{className:"space-y-8",children:[n.jsx("style",{children:` +`)},og=0,Nn=[];function lg(o){var d=p.useRef([]),a=p.useRef([0,0]),c=p.useRef(),f=p.useState(og++)[0],m=p.useState(jf)[0],h=p.useRef(o);p.useEffect(function(){h.current=o},[o]),p.useEffect(function(){if(o.inert){document.body.classList.add("block-interactivity-".concat(f));var S=Ex([o.lockRef.current],(o.shards||[]).map(Gu),!0).filter(Boolean);return S.forEach(function(C){return C.classList.add("allow-interactivity-".concat(f))}),function(){document.body.classList.remove("block-interactivity-".concat(f)),S.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(f))})}}},[o.inert,o.lockRef.current,o.shards]);var x=p.useCallback(function(S,C){if("touches"in S&&S.touches.length===2||S.type==="wheel"&&S.ctrlKey)return!h.current.allowPinchZoom;var _=Ho(S),L=a.current,q="deltaX"in S?S.deltaX:L[0]-_[0],Z="deltaY"in S?S.deltaY:L[1]-_[1],H,T=S.target,F=Math.abs(q)>Math.abs(Z)?"h":"v";if("touches"in S&&F==="h"&&T.type==="range")return!1;var ne=window.getSelection(),se=ne&&ne.anchorNode,X=se?se===T||se.contains(T):!1;if(X)return!1;var ye=Wu(F,T);if(!ye)return!0;if(ye?H=F:(H=F==="v"?"h":"v",ye=Wu(F,T)),!ye)return!1;if(!c.current&&"changedTouches"in S&&(q||Z)&&(c.current=H),!H)return!0;var ce=c.current||H;return rg(ce,C,S,ce==="h"?q:Z)},[]),E=p.useCallback(function(S){var C=S;if(!(!Nn.length||Nn[Nn.length-1]!==m)){var _="deltaY"in C?Hu(C):Ho(C),L=d.current.filter(function(H){return H.name===C.type&&(H.target===C.target||C.target===H.shadowParent)&&ng(H.delta,_)})[0];if(L&&L.should){C.cancelable&&C.preventDefault();return}if(!L){var q=(h.current.shards||[]).map(Gu).filter(Boolean).filter(function(H){return H.contains(C.target)}),Z=q.length>0?x(C,q[0]):!h.current.noIsolation;Z&&C.cancelable&&C.preventDefault()}}},[]),b=p.useCallback(function(S,C,_,L){var q={name:S,delta:C,target:_,should:L,shadowParent:ag(_)};d.current.push(q),setTimeout(function(){d.current=d.current.filter(function(Z){return Z!==q})},1)},[]),k=p.useCallback(function(S){a.current=Ho(S),c.current=void 0},[]),P=p.useCallback(function(S){b(S.type,Hu(S),S.target,x(S,o.lockRef.current))},[]),A=p.useCallback(function(S){b(S.type,Ho(S),S.target,x(S,o.lockRef.current))},[]);p.useEffect(function(){return Nn.push(m),o.setCallbacks({onScrollCapture:P,onWheelCapture:P,onTouchMoveCapture:A}),document.addEventListener("wheel",E,kn),document.addEventListener("touchmove",E,kn),document.addEventListener("touchstart",k,kn),function(){Nn=Nn.filter(function(S){return S!==m}),document.removeEventListener("wheel",E,kn),document.removeEventListener("touchmove",E,kn),document.removeEventListener("touchstart",k,kn)}},[]);var I=o.removeScrollBar,O=o.inert;return p.createElement(p.Fragment,null,O?p.createElement(m,{styles:sg(f)}):null,I?p.createElement(qx,{noRelative:o.noRelative,gapMode:o.gapMode}):null)}function ag(o){for(var d=null;o!==null;)o instanceof ShadowRoot&&(d=o.host,o=o.host),o=o.parentNode;return d}const ig=Ox(wf,lg);var Cf=p.forwardRef(function(o,d){return p.createElement(ol,Ft({},o,{ref:d,sideCar:ig}))});Cf.classNames=ol.classNames;var dg=function(o){if(typeof document>"u")return null;var d=Array.isArray(o)?o[0]:o;return d.ownerDocument.body},Sn=new WeakMap,Go=new WeakMap,Ko={},di=0,Ef=function(o){return o&&(o.host||Ef(o.parentNode))},cg=function(o,d){return d.map(function(a){if(o.contains(a))return a;var c=Ef(a);return c&&o.contains(c)?c:(console.error("aria-hidden",a,"in not contained inside",o,". Doing nothing"),null)}).filter(function(a){return!!a})},ug=function(o,d,a,c){var f=cg(d,Array.isArray(o)?o:[o]);Ko[a]||(Ko[a]=new WeakMap);var m=Ko[a],h=[],x=new Set,E=new Set(f),b=function(P){!P||x.has(P)||(x.add(P),b(P.parentNode))};f.forEach(b);var k=function(P){!P||E.has(P)||Array.prototype.forEach.call(P.children,function(A){if(x.has(A))k(A);else try{var I=A.getAttribute(c),O=I!==null&&I!=="false",S=(Sn.get(A)||0)+1,C=(m.get(A)||0)+1;Sn.set(A,S),m.set(A,C),h.push(A),S===1&&O&&Go.set(A,!0),C===1&&A.setAttribute(a,"true"),O||A.setAttribute(c,"true")}catch(_){console.error("aria-hidden: cannot operate on ",A,_)}})};return k(d),x.clear(),di++,function(){h.forEach(function(P){var A=Sn.get(P)-1,I=m.get(P)-1;Sn.set(P,A),m.set(P,I),A||(Go.has(P)||P.removeAttribute(c),Go.delete(P)),I||P.removeAttribute(a)}),di--,di||(Sn=new WeakMap,Sn=new WeakMap,Go=new WeakMap,Ko={})}},fg=function(o,d,a){a===void 0&&(a="data-aria-hidden");var c=Array.from(Array.isArray(o)?o:[o]),f=dg(o);return f?(c.push.apply(c,Array.from(f.querySelectorAll("[aria-live], script"))),ug(c,f,a,"aria-hidden")):function(){return null}},ll="Dialog",[_f]=$h(ll),[pg,zt]=_f(ll),Mf=o=>{const{__scopeDialog:d,children:a,open:c,defaultOpen:f,onOpenChange:m,modal:h=!0}=o,x=p.useRef(null),E=p.useRef(null),[b,k]=Hh({prop:c,defaultProp:f??!1,onChange:m,caller:ll});return n.jsx(pg,{scope:d,triggerRef:x,contentRef:E,contentId:Xt(),titleId:Xt(),descriptionId:Xt(),open:b,onOpenChange:k,onOpenToggle:p.useCallback(()=>k(P=>!P),[k]),modal:h,children:a})};Mf.displayName=ll;var Pf="DialogTrigger",mg=p.forwardRef((o,d)=>{const{__scopeDialog:a,...c}=o,f=zt(Pf,a),m=Kr(d,f.triggerRef);return n.jsx(Je.button,{type:"button","aria-haspopup":"dialog","aria-expanded":f.open,"aria-controls":f.open?f.contentId:void 0,"data-state":Ri(f.open),...c,ref:m,onClick:Sr(o.onClick,f.onOpenToggle)})});mg.displayName=Pf;var Pi="DialogPortal",[hg,Rf]=_f(Pi,{forceMount:void 0}),zf=o=>{const{__scopeDialog:d,forceMount:a,children:c,container:f}=o,m=zt(Pi,d);return n.jsx(hg,{scope:d,forceMount:a,children:p.Children.map(c,h=>n.jsx(sl,{present:a||m.open,children:n.jsx(vf,{asChild:!0,container:f,children:h})}))})};zf.displayName=Pi;var nl="DialogOverlay",Df=p.forwardRef((o,d)=>{const a=Rf(nl,o.__scopeDialog),{forceMount:c=a.forceMount,...f}=o,m=zt(nl,o.__scopeDialog);return m.modal?n.jsx(sl,{present:c||m.open,children:n.jsx(gg,{...f,ref:d})}):null});Df.displayName=nl;var xg=pf("DialogOverlay.RemoveScroll"),gg=p.forwardRef((o,d)=>{const{__scopeDialog:a,...c}=o,f=zt(nl,a),m=ux(),h=Kr(d,m);return n.jsx(Cf,{as:xg,allowPinchZoom:!0,shards:[f.contentRef],children:n.jsx(Je.div,{"data-state":Ri(f.open),...c,ref:h,style:{pointerEvents:"auto",...c.style}})})}),Ln="DialogContent",Lf=p.forwardRef((o,d)=>{const a=Rf(Ln,o.__scopeDialog),{forceMount:c=a.forceMount,...f}=o,m=zt(Ln,o.__scopeDialog);return n.jsx(sl,{present:c||m.open,children:m.modal?n.jsx(vg,{...f,ref:d}):n.jsx(yg,{...f,ref:d})})});Lf.displayName=Ln;var vg=p.forwardRef((o,d)=>{const a=zt(Ln,o.__scopeDialog),c=p.useRef(null),f=Kr(d,a.contentRef,c);return p.useEffect(()=>{const m=c.current;if(m)return fg(m)},[]),n.jsx(Af,{...o,ref:f,trapFocus:a.open,disableOutsidePointerEvents:a.open,onCloseAutoFocus:Sr(o.onCloseAutoFocus,m=>{var h;m.preventDefault(),(h=a.triggerRef.current)==null||h.focus()}),onPointerDownOutside:Sr(o.onPointerDownOutside,m=>{const h=m.detail.originalEvent,x=h.button===0&&h.ctrlKey===!0;(h.button===2||x)&&m.preventDefault()}),onFocusOutside:Sr(o.onFocusOutside,m=>m.preventDefault())})}),yg=p.forwardRef((o,d)=>{const a=zt(Ln,o.__scopeDialog),c=p.useRef(!1),f=p.useRef(!1);return n.jsx(Af,{...o,ref:d,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:m=>{var h,x;(h=o.onCloseAutoFocus)==null||h.call(o,m),m.defaultPrevented||(c.current||(x=a.triggerRef.current)==null||x.focus(),m.preventDefault()),c.current=!1,f.current=!1},onInteractOutside:m=>{var E,b;(E=o.onInteractOutside)==null||E.call(o,m),m.defaultPrevented||(c.current=!0,m.detail.originalEvent.type==="pointerdown"&&(f.current=!0));const h=m.target;((b=a.triggerRef.current)==null?void 0:b.contains(h))&&m.preventDefault(),m.detail.originalEvent.type==="focusin"&&f.current&&m.preventDefault()}})}),Af=p.forwardRef((o,d)=>{const{__scopeDialog:a,trapFocus:c,onOpenAutoFocus:f,onCloseAutoFocus:m,...h}=o,x=zt(Ln,a);return Cx(),n.jsx(n.Fragment,{children:n.jsx(xf,{asChild:!0,loop:!0,trapped:c,onMountAutoFocus:f,onUnmountAutoFocus:m,children:n.jsx(mf,{role:"dialog",id:x.contentId,"aria-describedby":x.descriptionId,"aria-labelledby":x.titleId,"data-state":Ri(x.open),...h,ref:d,deferPointerDownOutside:!0,onDismiss:()=>x.onOpenChange(!1)})})})}),Of="DialogTitle",bg=p.forwardRef((o,d)=>{const{__scopeDialog:a,...c}=o,f=zt(Of,a);return n.jsx(Je.h2,{id:f.titleId,...c,ref:d})});bg.displayName=Of;var Tf="DialogDescription",wg=p.forwardRef((o,d)=>{const{__scopeDialog:a,...c}=o,f=zt(Tf,a);return n.jsx(Je.p,{id:f.descriptionId,...c,ref:d})});wg.displayName=Tf;var If="DialogClose",jg=p.forwardRef((o,d)=>{const{__scopeDialog:a,...c}=o,f=zt(If,a);return n.jsx(Je.button,{type:"button",...c,ref:d,onClick:Sr(o.onClick,()=>f.onOpenChange(!1))})});jg.displayName=If;function Ri(o){return o?"open":"closed"}var js='[cmdk-group=""]',ci='[cmdk-group-items=""]',kg='[cmdk-group-heading=""]',Ff='[cmdk-item=""]',Ku=`${Ff}:not([aria-disabled="true"])`,ki="cmdk-item-select",_n="data-value",Ng=(o,d,a)=>Fh(o,d,a),$f=p.createContext(void 0),Rs=()=>p.useContext($f),Uf=p.createContext(void 0),zi=()=>p.useContext(Uf),Bf=p.createContext(void 0),Vf=p.forwardRef((o,d)=>{let a=Mn(()=>{var v,B;return{search:"",value:(B=(v=o.value)!=null?v:o.defaultValue)!=null?B:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),c=Mn(()=>new Set),f=Mn(()=>new Map),m=Mn(()=>new Map),h=Mn(()=>new Set),x=Wf(o),{label:E,children:b,value:k,onValueChange:P,filter:A,shouldFilter:I,loop:O,disablePointerSelection:S=!1,vimBindings:C=!0,..._}=o,L=Xt(),q=Xt(),Z=Xt(),H=p.useRef(null),T=Ag();Gr(()=>{if(k!==void 0){let v=k.trim();a.current.value=v,F.emit()}},[k]),Gr(()=>{T(6,Me)},[]);let F=p.useMemo(()=>({subscribe:v=>(h.current.add(v),()=>h.current.delete(v)),snapshot:()=>a.current,setState:(v,B,Y)=>{var K,oe,pe,me;if(!Object.is(a.current[v],B)){if(a.current[v]=B,v==="search")ce(),X(),T(1,ye);else if(v==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let w=document.getElementById(Z);w?w.focus():(K=document.getElementById(L))==null||K.focus()}if(T(7,()=>{var w;a.current.selectedItemId=(w=_e())==null?void 0:w.id,F.emit()}),Y||T(5,Me),((oe=x.current)==null?void 0:oe.value)!==void 0){let w=B??"";(me=(pe=x.current).onValueChange)==null||me.call(pe,w);return}}F.emit()}},emit:()=>{h.current.forEach(v=>v())}}),[]),ne=p.useMemo(()=>({value:(v,B,Y)=>{var K;B!==((K=m.current.get(v))==null?void 0:K.value)&&(m.current.set(v,{value:B,keywords:Y}),a.current.filtered.items.set(v,se(B,Y)),T(2,()=>{X(),F.emit()}))},item:(v,B)=>(c.current.add(v),B&&(f.current.has(B)?f.current.get(B).add(v):f.current.set(B,new Set([v]))),T(3,()=>{ce(),X(),a.current.value||ye(),F.emit()}),()=>{m.current.delete(v),c.current.delete(v),a.current.filtered.items.delete(v);let Y=_e();T(4,()=>{ce(),(Y==null?void 0:Y.getAttribute("id"))===v&&ye(),F.emit()})}),group:v=>(f.current.has(v)||f.current.set(v,new Set),()=>{m.current.delete(v),f.current.delete(v)}),filter:()=>x.current.shouldFilter,label:E||o["aria-label"],getDisablePointerSelection:()=>x.current.disablePointerSelection,listId:L,inputId:Z,labelId:q,listInnerRef:H}),[]);function se(v,B){var Y,K;let oe=(K=(Y=x.current)==null?void 0:Y.filter)!=null?K:Ng;return v?oe(v,a.current.search,B):0}function X(){if(!a.current.search||x.current.shouldFilter===!1)return;let v=a.current.filtered.items,B=[];a.current.filtered.groups.forEach(K=>{let oe=f.current.get(K),pe=0;oe.forEach(me=>{let w=v.get(me);pe=Math.max(w,pe)}),B.push([K,pe])});let Y=H.current;Pe().sort((K,oe)=>{var pe,me;let w=K.getAttribute("id"),J=oe.getAttribute("id");return((pe=v.get(J))!=null?pe:0)-((me=v.get(w))!=null?me:0)}).forEach(K=>{let oe=K.closest(ci);oe?oe.appendChild(K.parentElement===oe?K:K.closest(`${ci} > *`)):Y.appendChild(K.parentElement===Y?K:K.closest(`${ci} > *`))}),B.sort((K,oe)=>oe[1]-K[1]).forEach(K=>{var oe;let pe=(oe=H.current)==null?void 0:oe.querySelector(`${js}[${_n}="${encodeURIComponent(K[0])}"]`);pe==null||pe.parentElement.appendChild(pe)})}function ye(){let v=Pe().find(Y=>Y.getAttribute("aria-disabled")!=="true"),B=v==null?void 0:v.getAttribute(_n);F.setState("value",B||void 0)}function ce(){var v,B,Y,K;if(!a.current.search||x.current.shouldFilter===!1){a.current.filtered.count=c.current.size;return}a.current.filtered.groups=new Set;let oe=0;for(let pe of c.current){let me=(B=(v=m.current.get(pe))==null?void 0:v.value)!=null?B:"",w=(K=(Y=m.current.get(pe))==null?void 0:Y.keywords)!=null?K:[],J=se(me,w);a.current.filtered.items.set(pe,J),J>0&&oe++}for(let[pe,me]of f.current)for(let w of me)if(a.current.filtered.items.get(w)>0){a.current.filtered.groups.add(pe);break}a.current.filtered.count=oe}function Me(){var v,B,Y;let K=_e();K&&(((v=K.parentElement)==null?void 0:v.firstChild)===K&&((Y=(B=K.closest(js))==null?void 0:B.querySelector(kg))==null||Y.scrollIntoView({block:"nearest"})),K.scrollIntoView({block:"nearest"}))}function _e(){var v;return(v=H.current)==null?void 0:v.querySelector(`${Ff}[aria-selected="true"]`)}function Pe(){var v;return Array.from(((v=H.current)==null?void 0:v.querySelectorAll(Ku))||[])}function Ne(v){let B=Pe()[v];B&&F.setState("value",B.getAttribute(_n))}function ke(v){var B;let Y=_e(),K=Pe(),oe=K.findIndex(me=>me===Y),pe=K[oe+v];(B=x.current)!=null&&B.loop&&(pe=oe+v<0?K[K.length-1]:oe+v===K.length?K[0]:K[oe+v]),pe&&F.setState("value",pe.getAttribute(_n))}function W(v){let B=_e(),Y=B==null?void 0:B.closest(js),K;for(;Y&&!K;)Y=v>0?Dg(Y,js):Lg(Y,js),K=Y==null?void 0:Y.querySelector(Ku);K?F.setState("value",K.getAttribute(_n)):ke(v)}let ae=()=>Ne(Pe().length-1),G=v=>{v.preventDefault(),v.metaKey?ae():v.altKey?W(1):ke(1)},j=v=>{v.preventDefault(),v.metaKey?Ne(0):v.altKey?W(-1):ke(-1)};return p.createElement(Je.div,{ref:d,tabIndex:-1,..._,"cmdk-root":"",onKeyDown:v=>{var B;(B=_.onKeyDown)==null||B.call(_,v);let Y=v.nativeEvent.isComposing||v.keyCode===229;if(!(v.defaultPrevented||Y))switch(v.key){case"n":case"j":{C&&v.ctrlKey&&G(v);break}case"ArrowDown":{G(v);break}case"p":case"k":{C&&v.ctrlKey&&j(v);break}case"ArrowUp":{j(v);break}case"Home":{v.preventDefault(),Ne(0);break}case"End":{v.preventDefault(),ae();break}case"Enter":{v.preventDefault();let K=_e();if(K){let oe=new Event(ki);K.dispatchEvent(oe)}}}}},p.createElement("label",{"cmdk-label":"",htmlFor:ne.inputId,id:ne.labelId,style:Tg},E),al(o,v=>p.createElement(Uf.Provider,{value:F},p.createElement($f.Provider,{value:ne},v))))}),Sg=p.forwardRef((o,d)=>{var a,c;let f=Xt(),m=p.useRef(null),h=p.useContext(Bf),x=Rs(),E=Wf(o),b=(c=(a=E.current)==null?void 0:a.forceMount)!=null?c:h==null?void 0:h.forceMount;Gr(()=>{if(!b)return x.item(f,h==null?void 0:h.id)},[b]);let k=Hf(f,m,[o.value,o.children,m],o.keywords),P=zi(),A=Cr(T=>T.value&&T.value===k.current),I=Cr(T=>b||x.filter()===!1?!0:T.search?T.filtered.items.get(f)>0:!0);p.useEffect(()=>{let T=m.current;if(!(!T||o.disabled))return T.addEventListener(ki,O),()=>T.removeEventListener(ki,O)},[I,o.onSelect,o.disabled]);function O(){var T,F;S(),(F=(T=E.current).onSelect)==null||F.call(T,k.current)}function S(){P.setState("value",k.current,!0)}if(!I)return null;let{disabled:C,value:_,onSelect:L,forceMount:q,keywords:Z,...H}=o;return p.createElement(Je.div,{ref:Dn(m,d),...H,id:f,"cmdk-item":"",role:"option","aria-disabled":!!C,"aria-selected":!!A,"data-disabled":!!C,"data-selected":!!A,onPointerMove:C||x.getDisablePointerSelection()?void 0:S,onClick:C?void 0:O},o.children)}),Cg=p.forwardRef((o,d)=>{let{heading:a,children:c,forceMount:f,...m}=o,h=Xt(),x=p.useRef(null),E=p.useRef(null),b=Xt(),k=Rs(),P=Cr(I=>f||k.filter()===!1?!0:I.search?I.filtered.groups.has(h):!0);Gr(()=>k.group(h),[]),Hf(h,x,[o.value,o.heading,E]);let A=p.useMemo(()=>({id:h,forceMount:f}),[f]);return p.createElement(Je.div,{ref:Dn(x,d),...m,"cmdk-group":"",role:"presentation",hidden:P?void 0:!0},a&&p.createElement("div",{ref:E,"cmdk-group-heading":"","aria-hidden":!0,id:b},a),al(o,I=>p.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":a?b:void 0},p.createElement(Bf.Provider,{value:A},I))))}),Eg=p.forwardRef((o,d)=>{let{alwaysRender:a,...c}=o,f=p.useRef(null),m=Cr(h=>!h.search);return!a&&!m?null:p.createElement(Je.div,{ref:Dn(f,d),...c,"cmdk-separator":"",role:"separator"})}),_g=p.forwardRef((o,d)=>{let{onValueChange:a,...c}=o,f=o.value!=null,m=zi(),h=Cr(b=>b.search),x=Cr(b=>b.selectedItemId),E=Rs();return p.useEffect(()=>{o.value!=null&&m.setState("search",o.value)},[o.value]),p.createElement(Je.input,{ref:d,...c,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":E.listId,"aria-labelledby":E.labelId,"aria-activedescendant":x,id:E.inputId,type:"text",value:f?o.value:h,onChange:b=>{f||m.setState("search",b.target.value),a==null||a(b.target.value)}})}),Mg=p.forwardRef((o,d)=>{let{children:a,label:c="Suggestions",...f}=o,m=p.useRef(null),h=p.useRef(null),x=Cr(b=>b.selectedItemId),E=Rs();return p.useEffect(()=>{if(h.current&&m.current){let b=h.current,k=m.current,P,A=new ResizeObserver(()=>{P=requestAnimationFrame(()=>{let I=b.offsetHeight;k.style.setProperty("--cmdk-list-height",I.toFixed(1)+"px")})});return A.observe(b),()=>{cancelAnimationFrame(P),A.unobserve(b)}}},[]),p.createElement(Je.div,{ref:Dn(m,d),...f,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":x,"aria-label":c,id:E.listId},al(o,b=>p.createElement("div",{ref:Dn(h,E.listInnerRef),"cmdk-list-sizer":""},b)))}),Pg=p.forwardRef((o,d)=>{let{open:a,onOpenChange:c,overlayClassName:f,contentClassName:m,container:h,...x}=o;return p.createElement(Mf,{open:a,onOpenChange:c},p.createElement(zf,{container:h},p.createElement(Df,{"cmdk-overlay":"",className:f}),p.createElement(Lf,{"aria-label":o.label,"cmdk-dialog":"",className:m},p.createElement(Vf,{ref:d,...x}))))}),Rg=p.forwardRef((o,d)=>Cr(a=>a.filtered.count===0)?p.createElement(Je.div,{ref:d,...o,"cmdk-empty":"",role:"presentation"}):null),zg=p.forwardRef((o,d)=>{let{progress:a,children:c,label:f="Loading...",...m}=o;return p.createElement(Je.div,{ref:d,...m,"cmdk-loading":"",role:"progressbar","aria-valuenow":a,"aria-valuemin":0,"aria-valuemax":100,"aria-label":f},al(o,h=>p.createElement("div",{"aria-hidden":!0},h)))}),Cn=Object.assign(Vf,{List:Mg,Item:Sg,Input:_g,Group:Cg,Separator:Eg,Dialog:Pg,Empty:Rg,Loading:zg});function Dg(o,d){let a=o.nextElementSibling;for(;a;){if(a.matches(d))return a;a=a.nextElementSibling}}function Lg(o,d){let a=o.previousElementSibling;for(;a;){if(a.matches(d))return a;a=a.previousElementSibling}}function Wf(o){let d=p.useRef(o);return Gr(()=>{d.current=o}),d}var Gr=typeof window>"u"?p.useEffect:p.useLayoutEffect;function Mn(o){let d=p.useRef();return d.current===void 0&&(d.current=o()),d}function Cr(o){let d=zi(),a=()=>o(d.snapshot());return p.useSyncExternalStore(d.subscribe,a,a)}function Hf(o,d,a,c=[]){let f=p.useRef(),m=Rs();return Gr(()=>{var h;let x=(()=>{var b;for(let k of a){if(typeof k=="string")return k.trim();if(typeof k=="object"&&"current"in k)return k.current?(b=k.current.textContent)==null?void 0:b.trim():f.current}})(),E=c.map(b=>b.trim());m.value(o,x,E),(h=d.current)==null||h.setAttribute(_n,x),f.current=x}),f}var Ag=()=>{let[o,d]=p.useState(),a=Mn(()=>new Map);return Gr(()=>{a.current.forEach(c=>c()),a.current=new Map},[o]),(c,f)=>{a.current.set(c,f),d({})}};function Og(o){let d=o.type;return typeof d=="function"?d(o.props):"render"in d?d.render(o.props):o}function al({asChild:o,children:d},a){return o&&p.isValidElement(d)?p.cloneElement(Og(d),{ref:d.ref},a(d.props.children)):a(d)}var Tg={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function Ig({onNavigate:o}){const[d,a]=p.useState(!1);return p.useEffect(()=>{const c=f=>{(f.metaKey||f.ctrlKey)&&f.key.toLowerCase()==="k"&&(f.preventDefault(),a(m=>!m))};return document.addEventListener("keydown",c),()=>document.removeEventListener("keydown",c)},[]),n.jsx(Cn.Dialog,{open:d,onOpenChange:a,label:"Befehlspalette",className:"fixed inset-0 z-50 flex items-start justify-center bg-black/50 p-4 pt-[12vh]",onClick:()=>a(!1),children:n.jsxs("div",{className:"w-full max-w-lg overflow-hidden rounded-xl border border-border bg-popover text-popover-foreground shadow-2xl",onClick:c=>c.stopPropagation(),children:[n.jsx(Cn.Input,{autoFocus:!0,placeholder:"Springe zu… (Modelle, Routing, System …)",className:"w-full border-b border-border bg-transparent px-4 py-3 text-sm outline-none placeholder:text-muted-foreground"}),n.jsxs(Cn.List,{className:"max-h-80 overflow-y-auto p-2",children:[n.jsx(Cn.Empty,{className:"px-3 py-6 text-center text-sm text-muted-foreground",children:"Nichts gefunden."}),n.jsx(Cn.Group,{heading:"Bereiche",className:"px-1 py-1 text-xs text-muted-foreground",children:yi.map(c=>n.jsxs(Cn.Item,{value:`${c.label} ${c.hint}`,onSelect:()=>{o(c.id),a(!1)},className:"flex cursor-pointer items-center gap-3 rounded-md px-3 py-2 text-sm text-foreground aria-selected:bg-accent aria-selected:text-accent-foreground",children:[n.jsx(c.icon,{className:"h-4 w-4 text-primary"}),n.jsx("span",{children:c.label}),n.jsx("span",{className:"ml-auto truncate text-xs text-muted-foreground",children:c.hint})]},c.id))})]})]})})}async function fe(o,d){var E;const a={"Content-Type":"application/json",...d==null?void 0:d.headers},c=localStorage.getItem("mc_sudo_password"),f=localStorage.getItem("mc_hf_token");c&&(a["X-Sudo-Password"]=c);let m=d==null?void 0:d.body;if((((E=d==null?void 0:d.method)==null?void 0:E.toUpperCase())||"GET")==="POST"){if(typeof m=="string")try{const b=JSON.parse(m);let k=!1;c&&!("sudo_password"in b)&&(b.sudo_password=c,k=!0),f&&!("hf_token"in b)&&(b.hf_token=f,k=!0),k&&(m=JSON.stringify(b))}catch{}else if(!m){const b={};c&&(b.sudo_password=c),f&&(b.hf_token=f),Object.keys(b).length>0&&(m=JSON.stringify(b))}}const x=await fetch(o,{...d,headers:a,body:m});if(!x.ok)throw new Error(`${x.status} ${x.statusText}`);return x.json()}function Gf(o){var d,a,c="";if(typeof o=="string"||typeof o=="number")c+=o;else if(typeof o=="object")if(Array.isArray(o)){var f=o.length;for(d=0;d{const d=Bg(o),{conflictingClassGroups:a,conflictingClassGroupModifiers:c}=o;return{getClassGroupId:h=>{const x=h.split(Di);return x[0]===""&&x.length!==1&&x.shift(),Kf(x,d)||Ug(h)},getConflictingClassGroupIds:(h,x)=>{const E=a[h]||[];return x&&c[h]?[...E,...c[h]]:E}}},Kf=(o,d)=>{var h;if(o.length===0)return d.classGroupId;const a=o[0],c=d.nextPart.get(a),f=c?Kf(o.slice(1),c):void 0;if(f)return f;if(d.validators.length===0)return;const m=o.join(Di);return(h=d.validators.find(({validator:x})=>x(m)))==null?void 0:h.classGroupId},Qu=/^\[(.+)\]$/,Ug=o=>{if(Qu.test(o)){const d=Qu.exec(o)[1],a=d==null?void 0:d.substring(0,d.indexOf(":"));if(a)return"arbitrary.."+a}},Bg=o=>{const{theme:d,prefix:a}=o,c={nextPart:new Map,validators:[]};return Wg(Object.entries(o.classGroups),a).forEach(([m,h])=>{Ni(h,c,m,d)}),c},Ni=(o,d,a,c)=>{o.forEach(f=>{if(typeof f=="string"){const m=f===""?d:qu(d,f);m.classGroupId=a;return}if(typeof f=="function"){if(Vg(f)){Ni(f(c),d,a,c);return}d.validators.push({validator:f,classGroupId:a});return}Object.entries(f).forEach(([m,h])=>{Ni(h,qu(d,m),a,c)})})},qu=(o,d)=>{let a=o;return d.split(Di).forEach(c=>{a.nextPart.has(c)||a.nextPart.set(c,{nextPart:new Map,validators:[]}),a=a.nextPart.get(c)}),a},Vg=o=>o.isThemeGetter,Wg=(o,d)=>d?o.map(([a,c])=>{const f=c.map(m=>typeof m=="string"?d+m:typeof m=="object"?Object.fromEntries(Object.entries(m).map(([h,x])=>[d+h,x])):m);return[a,f]}):o,Hg=o=>{if(o<1)return{get:()=>{},set:()=>{}};let d=0,a=new Map,c=new Map;const f=(m,h)=>{a.set(m,h),d++,d>o&&(d=0,c=a,a=new Map)};return{get(m){let h=a.get(m);if(h!==void 0)return h;if((h=c.get(m))!==void 0)return f(m,h),h},set(m,h){a.has(m)?a.set(m,h):f(m,h)}}},Qf="!",Gg=o=>{const{separator:d,experimentalParseClassName:a}=o,c=d.length===1,f=d[0],m=d.length,h=x=>{const E=[];let b=0,k=0,P;for(let C=0;Ck?P-k:void 0;return{modifiers:E,hasImportantModifier:I,baseClassName:O,maybePostfixModifierPosition:S}};return a?x=>a({className:x,parseClassName:h}):h},Kg=o=>{if(o.length<=1)return o;const d=[];let a=[];return o.forEach(c=>{c[0]==="["?(d.push(...a.sort(),c),a=[]):a.push(c)}),d.push(...a.sort()),d},Qg=o=>({cache:Hg(o.cacheSize),parseClassName:Gg(o),...$g(o)}),qg=/\s+/,Zg=(o,d)=>{const{parseClassName:a,getClassGroupId:c,getConflictingClassGroupIds:f}=d,m=[],h=o.trim().split(qg);let x="";for(let E=h.length-1;E>=0;E-=1){const b=h[E],{modifiers:k,hasImportantModifier:P,baseClassName:A,maybePostfixModifierPosition:I}=a(b);let O=!!I,S=c(O?A.substring(0,I):A);if(!S){if(!O){x=b+(x.length>0?" "+x:x);continue}if(S=c(A),!S){x=b+(x.length>0?" "+x:x);continue}O=!1}const C=Kg(k).join(":"),_=P?C+Qf:C,L=_+S;if(m.includes(L))continue;m.push(L);const q=f(S,O);for(let Z=0;Z0?" "+x:x)}return x};function Yg(){let o=0,d,a,c="";for(;o{if(typeof o=="string")return o;let d,a="";for(let c=0;cP(k),o());return a=Qg(b),c=a.cache.get,f=a.cache.set,m=x,x(E)}function x(E){const b=c(E);if(b)return b;const k=Zg(E,a);return f(E,k),k}return function(){return m(Yg.apply(null,arguments))}}const Te=o=>{const d=a=>a[o]||[];return d.isThemeGetter=!0,d},Zf=/^\[(?:([a-z-]+):)?(.+)\]$/i,Xg=/^\d+\/\d+$/,e0=new Set(["px","full","screen"]),t0=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,r0=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,n0=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,s0=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,o0=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Jt=o=>Rn(o)||e0.has(o)||Xg.test(o),wr=o=>An(o,"length",p0),Rn=o=>!!o&&!Number.isNaN(Number(o)),ui=o=>An(o,"number",Rn),ks=o=>!!o&&Number.isInteger(Number(o)),l0=o=>o.endsWith("%")&&Rn(o.slice(0,-1)),we=o=>Zf.test(o),jr=o=>t0.test(o),a0=new Set(["length","size","percentage"]),i0=o=>An(o,a0,Yf),d0=o=>An(o,"position",Yf),c0=new Set(["image","url"]),u0=o=>An(o,c0,h0),f0=o=>An(o,"",m0),Ns=()=>!0,An=(o,d,a)=>{const c=Zf.exec(o);return c?c[1]?typeof d=="string"?c[1]===d:d.has(c[1]):a(c[2]):!1},p0=o=>r0.test(o)&&!n0.test(o),Yf=()=>!1,m0=o=>s0.test(o),h0=o=>o0.test(o),x0=()=>{const o=Te("colors"),d=Te("spacing"),a=Te("blur"),c=Te("brightness"),f=Te("borderColor"),m=Te("borderRadius"),h=Te("borderSpacing"),x=Te("borderWidth"),E=Te("contrast"),b=Te("grayscale"),k=Te("hueRotate"),P=Te("invert"),A=Te("gap"),I=Te("gradientColorStops"),O=Te("gradientColorStopPositions"),S=Te("inset"),C=Te("margin"),_=Te("opacity"),L=Te("padding"),q=Te("saturate"),Z=Te("scale"),H=Te("sepia"),T=Te("skew"),F=Te("space"),ne=Te("translate"),se=()=>["auto","contain","none"],X=()=>["auto","hidden","clip","visible","scroll"],ye=()=>["auto",we,d],ce=()=>[we,d],Me=()=>["",Jt,wr],_e=()=>["auto",Rn,we],Pe=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Ne=()=>["solid","dashed","dotted","double","none"],ke=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],W=()=>["start","end","center","between","around","evenly","stretch"],ae=()=>["","0",we],G=()=>["auto","avoid","all","avoid-page","page","left","right","column"],j=()=>[Rn,we];return{cacheSize:500,separator:":",theme:{colors:[Ns],spacing:[Jt,wr],blur:["none","",jr,we],brightness:j(),borderColor:[o],borderRadius:["none","","full",jr,we],borderSpacing:ce(),borderWidth:Me(),contrast:j(),grayscale:ae(),hueRotate:j(),invert:ae(),gap:ce(),gradientColorStops:[o],gradientColorStopPositions:[l0,wr],inset:ye(),margin:ye(),opacity:j(),padding:ce(),saturate:j(),scale:j(),sepia:ae(),skew:j(),space:ce(),translate:ce()},classGroups:{aspect:[{aspect:["auto","square","video",we]}],container:["container"],columns:[{columns:[jr]}],"break-after":[{"break-after":G()}],"break-before":[{"break-before":G()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...Pe(),we]}],overflow:[{overflow:X()}],"overflow-x":[{"overflow-x":X()}],"overflow-y":[{"overflow-y":X()}],overscroll:[{overscroll:se()}],"overscroll-x":[{"overscroll-x":se()}],"overscroll-y":[{"overscroll-y":se()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[S]}],"inset-x":[{"inset-x":[S]}],"inset-y":[{"inset-y":[S]}],start:[{start:[S]}],end:[{end:[S]}],top:[{top:[S]}],right:[{right:[S]}],bottom:[{bottom:[S]}],left:[{left:[S]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ks,we]}],basis:[{basis:ye()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",we]}],grow:[{grow:ae()}],shrink:[{shrink:ae()}],order:[{order:["first","last","none",ks,we]}],"grid-cols":[{"grid-cols":[Ns]}],"col-start-end":[{col:["auto",{span:["full",ks,we]},we]}],"col-start":[{"col-start":_e()}],"col-end":[{"col-end":_e()}],"grid-rows":[{"grid-rows":[Ns]}],"row-start-end":[{row:["auto",{span:[ks,we]},we]}],"row-start":[{"row-start":_e()}],"row-end":[{"row-end":_e()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",we]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",we]}],gap:[{gap:[A]}],"gap-x":[{"gap-x":[A]}],"gap-y":[{"gap-y":[A]}],"justify-content":[{justify:["normal",...W()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...W(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...W(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[L]}],px:[{px:[L]}],py:[{py:[L]}],ps:[{ps:[L]}],pe:[{pe:[L]}],pt:[{pt:[L]}],pr:[{pr:[L]}],pb:[{pb:[L]}],pl:[{pl:[L]}],m:[{m:[C]}],mx:[{mx:[C]}],my:[{my:[C]}],ms:[{ms:[C]}],me:[{me:[C]}],mt:[{mt:[C]}],mr:[{mr:[C]}],mb:[{mb:[C]}],ml:[{ml:[C]}],"space-x":[{"space-x":[F]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[F]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",we,d]}],"min-w":[{"min-w":[we,d,"min","max","fit"]}],"max-w":[{"max-w":[we,d,"none","full","min","max","fit","prose",{screen:[jr]},jr]}],h:[{h:[we,d,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[we,d,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[we,d,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[we,d,"auto","min","max","fit"]}],"font-size":[{text:["base",jr,wr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",ui]}],"font-family":[{font:[Ns]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",we]}],"line-clamp":[{"line-clamp":["none",Rn,ui]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Jt,we]}],"list-image":[{"list-image":["none",we]}],"list-style-type":[{list:["none","disc","decimal",we]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[o]}],"placeholder-opacity":[{"placeholder-opacity":[_]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[o]}],"text-opacity":[{"text-opacity":[_]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Ne(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Jt,wr]}],"underline-offset":[{"underline-offset":["auto",Jt,we]}],"text-decoration-color":[{decoration:[o]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:ce()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",we]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",we]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[_]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...Pe(),d0]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",i0]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},u0]}],"bg-color":[{bg:[o]}],"gradient-from-pos":[{from:[O]}],"gradient-via-pos":[{via:[O]}],"gradient-to-pos":[{to:[O]}],"gradient-from":[{from:[I]}],"gradient-via":[{via:[I]}],"gradient-to":[{to:[I]}],rounded:[{rounded:[m]}],"rounded-s":[{"rounded-s":[m]}],"rounded-e":[{"rounded-e":[m]}],"rounded-t":[{"rounded-t":[m]}],"rounded-r":[{"rounded-r":[m]}],"rounded-b":[{"rounded-b":[m]}],"rounded-l":[{"rounded-l":[m]}],"rounded-ss":[{"rounded-ss":[m]}],"rounded-se":[{"rounded-se":[m]}],"rounded-ee":[{"rounded-ee":[m]}],"rounded-es":[{"rounded-es":[m]}],"rounded-tl":[{"rounded-tl":[m]}],"rounded-tr":[{"rounded-tr":[m]}],"rounded-br":[{"rounded-br":[m]}],"rounded-bl":[{"rounded-bl":[m]}],"border-w":[{border:[x]}],"border-w-x":[{"border-x":[x]}],"border-w-y":[{"border-y":[x]}],"border-w-s":[{"border-s":[x]}],"border-w-e":[{"border-e":[x]}],"border-w-t":[{"border-t":[x]}],"border-w-r":[{"border-r":[x]}],"border-w-b":[{"border-b":[x]}],"border-w-l":[{"border-l":[x]}],"border-opacity":[{"border-opacity":[_]}],"border-style":[{border:[...Ne(),"hidden"]}],"divide-x":[{"divide-x":[x]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[x]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[_]}],"divide-style":[{divide:Ne()}],"border-color":[{border:[f]}],"border-color-x":[{"border-x":[f]}],"border-color-y":[{"border-y":[f]}],"border-color-s":[{"border-s":[f]}],"border-color-e":[{"border-e":[f]}],"border-color-t":[{"border-t":[f]}],"border-color-r":[{"border-r":[f]}],"border-color-b":[{"border-b":[f]}],"border-color-l":[{"border-l":[f]}],"divide-color":[{divide:[f]}],"outline-style":[{outline:["",...Ne()]}],"outline-offset":[{"outline-offset":[Jt,we]}],"outline-w":[{outline:[Jt,wr]}],"outline-color":[{outline:[o]}],"ring-w":[{ring:Me()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[o]}],"ring-opacity":[{"ring-opacity":[_]}],"ring-offset-w":[{"ring-offset":[Jt,wr]}],"ring-offset-color":[{"ring-offset":[o]}],shadow:[{shadow:["","inner","none",jr,f0]}],"shadow-color":[{shadow:[Ns]}],opacity:[{opacity:[_]}],"mix-blend":[{"mix-blend":[...ke(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":ke()}],filter:[{filter:["","none"]}],blur:[{blur:[a]}],brightness:[{brightness:[c]}],contrast:[{contrast:[E]}],"drop-shadow":[{"drop-shadow":["","none",jr,we]}],grayscale:[{grayscale:[b]}],"hue-rotate":[{"hue-rotate":[k]}],invert:[{invert:[P]}],saturate:[{saturate:[q]}],sepia:[{sepia:[H]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[a]}],"backdrop-brightness":[{"backdrop-brightness":[c]}],"backdrop-contrast":[{"backdrop-contrast":[E]}],"backdrop-grayscale":[{"backdrop-grayscale":[b]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[k]}],"backdrop-invert":[{"backdrop-invert":[P]}],"backdrop-opacity":[{"backdrop-opacity":[_]}],"backdrop-saturate":[{"backdrop-saturate":[q]}],"backdrop-sepia":[{"backdrop-sepia":[H]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[h]}],"border-spacing-x":[{"border-spacing-x":[h]}],"border-spacing-y":[{"border-spacing-y":[h]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",we]}],duration:[{duration:j()}],ease:[{ease:["linear","in","out","in-out",we]}],delay:[{delay:j()}],animate:[{animate:["none","spin","ping","pulse","bounce",we]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[Z]}],"scale-x":[{"scale-x":[Z]}],"scale-y":[{"scale-y":[Z]}],rotate:[{rotate:[ks,we]}],"translate-x":[{"translate-x":[ne]}],"translate-y":[{"translate-y":[ne]}],"skew-x":[{"skew-x":[T]}],"skew-y":[{"skew-y":[T]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",we]}],accent:[{accent:["auto",o]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",we]}],"caret-color":[{caret:[o]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":ce()}],"scroll-mx":[{"scroll-mx":ce()}],"scroll-my":[{"scroll-my":ce()}],"scroll-ms":[{"scroll-ms":ce()}],"scroll-me":[{"scroll-me":ce()}],"scroll-mt":[{"scroll-mt":ce()}],"scroll-mr":[{"scroll-mr":ce()}],"scroll-mb":[{"scroll-mb":ce()}],"scroll-ml":[{"scroll-ml":ce()}],"scroll-p":[{"scroll-p":ce()}],"scroll-px":[{"scroll-px":ce()}],"scroll-py":[{"scroll-py":ce()}],"scroll-ps":[{"scroll-ps":ce()}],"scroll-pe":[{"scroll-pe":ce()}],"scroll-pt":[{"scroll-pt":ce()}],"scroll-pr":[{"scroll-pr":ce()}],"scroll-pb":[{"scroll-pb":ce()}],"scroll-pl":[{"scroll-pl":ce()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",we]}],fill:[{fill:[o,"none"]}],"stroke-w":[{stroke:[Jt,wr,ui]}],stroke:[{stroke:[o,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},g0=Jg(x0);function ee(...o){return g0(Fg(o))}function Ps(o){return o?o.replace(/127\.0\.0\.1|localhost/g,"192.168.178.151"):""}function Qr({type:o,title:d,message:a,defaultValue:c,onConfirm:f,onCancel:m}){return n.jsx("div",{className:"fixed inset-0 z-[99] bg-black/60 backdrop-blur-sm flex items-center justify-center p-4",children:n.jsxs("div",{className:"w-full max-w-sm rounded-2xl border border-border/80 bg-card p-6 shadow-2xl space-y-4 animate-in fade-in zoom-in-95 duration-200",children:[n.jsxs("div",{className:"flex items-center justify-between border-b border-border/20 pb-2",children:[n.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-primary",children:d}),n.jsx("button",{onClick:m||(()=>f()),className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground cursor-pointer",children:n.jsx(Hr,{className:"h-4 w-4"})})]}),n.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:a}),o==="prompt"&&n.jsx("input",{type:"text",id:"custom-dialog-input",defaultValue:c,className:"w-full h-9 px-3 text-xs bg-background/40 border border-border/60 rounded-lg outline-none focus:border-primary transition-colors text-foreground",autoFocus:!0,onKeyDown:h=>{var x;if(h.key==="Enter"){const E=(x=document.getElementById("custom-dialog-input"))==null?void 0:x.value;f(E)}}}),n.jsxs("div",{className:"flex justify-end gap-3 pt-2",children:[(o==="confirm"||o==="prompt")&&n.jsx("button",{onClick:m,className:"h-8 px-4 flex items-center justify-center text-xs font-semibold text-muted-foreground border border-border/60 bg-background/20 hover:bg-accent rounded-lg transition-colors cursor-pointer",children:"Abbrechen"}),n.jsx("button",{onClick:()=>{var x;const h=o==="prompt"?(x=document.getElementById("custom-dialog-input"))==null?void 0:x.value:void 0;f(h)},className:"h-8 px-4 flex items-center justify-center text-xs font-semibold text-primary-foreground bg-primary hover:bg-primary/95 rounded-lg transition-colors cursor-pointer",children:o==="confirm"?"Ja, fortfahren":o==="prompt"?"Übernehmen":"OK"})]})]})})}function En(o){return(o/1024**3).toFixed(1)}function Qo({value:o,label:d,detail:a}){const f=2*Math.PI*24,m=f-Math.min(o,100)/100*f,h=o>90?"stroke-red-500":o>75?"stroke-amber-500":"stroke-primary";return n.jsxs("div",{className:"flex flex-col items-center gap-1.5 p-2 bg-background/20 rounded-xl border border-border/40",children:[n.jsxs("div",{className:"relative flex h-16 w-16 items-center justify-center",children:[n.jsxs("svg",{className:"absolute inset-0 h-full w-full -rotate-90",children:[n.jsx("circle",{cx:"32",cy:"32",r:24,className:"stroke-muted fill-none",strokeWidth:"4.5"}),n.jsx("circle",{cx:"32",cy:"32",r:24,className:ee("fill-none transition-all duration-700 ease-out",h),strokeWidth:"4.5",strokeDasharray:f,strokeDashoffset:m,strokeLinecap:"round"})]}),n.jsxs("span",{className:"text-xs font-mono font-bold tracking-tight text-foreground",children:[Math.round(o),"%"]})]}),n.jsx("span",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wider",children:d}),a&&n.jsx("span",{className:"text-[10px] font-mono text-muted-foreground/80",children:a})]})}function v0(){const[o,d]=p.useState(null),[a,c]=p.useState(null),[f,m]=p.useState([]),[h,x]=p.useState([]),[E,b]=p.useState([]),[k,P]=p.useState(null),[A,I]=p.useState([]),[O,S]=p.useState(null),[C,_]=p.useState(""),[L,q]=p.useState(!1),[Z,H]=p.useState(""),[T,F]=p.useState(!1),[ne,se]=p.useState({open:!1,actionPath:"",actionLabel:""}),[X,ye]=p.useState(null),[ce,Me]=p.useState(!1);async function _e(w){try{await fe("/api/agent/brain",{method:"POST",body:JSON.stringify({model:w})}),ye({type:"alert",title:"Erfolgreich",message:`Hermes-Gehirn wurde auf '${w}' geändert. Der Gateway-Dienst wurde neu gestartet.`,onConfirm:()=>ye(null)}),v(),Me(!1)}catch(J){ye({type:"alert",title:"Fehler",message:`Fehler beim Wechseln des Gehirns: ${J.message}`,onConfirm:()=>ye(null)})}}function Pe(w,J,Le){ye({type:"confirm",title:w,message:J,onConfirm:()=>{ye(null),Le()},onCancel:()=>ye(null)})}const[Ne,ke]=p.useState(""),[W,ae]=p.useState("stable"),[G,j]=p.useState(!1);function v(){fe("/api/system/status").then(d).catch(()=>{}),fe("/api/agent/status").then(c).catch(()=>{}),fe("/api/models").then(w=>{m(w.models||[]),x(w.running||[])}).catch(()=>{}),fe("/api/memory?category=").then(w=>b(w.slice(0,3))).catch(()=>{}),fe("/api/maintenance/updates").then(P).catch(()=>{}),fe("/api/jobs").then(w=>I(w.jobs||[])).catch(()=>{}),fe("/api/system/token-stats").then(S).catch(()=>{})}p.useEffect(()=>{v();const w=setInterval(v,3e3);return()=>clearInterval(w)},[]);async function B(w,J,Le,$t){_(`${J} wird ausgeführt...`),q(!0);try{const lt={...Le},nt=await fe(w,{method:"POST",body:JSON.stringify(lt)});if(nt.status==="password_required"||nt.status==="incorrect_password"){se({open:!0,actionPath:w,actionLabel:J,payload:Le,error:nt.status==="incorrect_password"?"Falsches Sudo-Passwort. Bitte erneut versuchen.":void 0}),_("");return}nt.job_id?_(`${J} gestartet (Job-ID: ${nt.job_id})`):nt.ok?_(`${J} erfolgreich ausgeführt.`):_(`Fehler: ${nt.err||"Unbekannter Fehler"}`),v()}catch(lt){_(`Fehler bei ${J}: ${lt.message}`)}finally{q(!1)}}async function Y(){F(!0);try{const w={...ne.payload,sudo_password:Z},J=await fe(ne.actionPath,{method:"POST",body:JSON.stringify(w)});if(J.status==="password_required"||J.status==="incorrect_password"){se(Le=>({...Le,error:"Falsches Sudo-Passwort. Bitte erneut versuchen."}));return}J.job_id?_(`${ne.actionLabel} gestartet (Job-ID: ${J.job_id})`):J.ok?_(`${ne.actionLabel} erfolgreich ausgeführt.`):_(`Fehler: ${J.err||"Unbekannter Fehler"}`),se({open:!1,actionPath:"",actionLabel:""}),H(""),v()}catch(w){_(`Fehler: ${w.message}`),se({open:!1,actionPath:"",actionLabel:""}),H("")}finally{F(!1)}}async function K(w,J){_(`Upgrade für ${w} wird gestartet...`);try{await fe("/api/models/install",{method:"POST",body:JSON.stringify({repo:w,role:J,quant:"Q4_K_M",jinja:!0})}),_("Upgrade-Download gestartet."),v()}catch(Le){_(`Upgrade fehlgeschlagen: ${Le.message}`)}}async function oe(){if(!(!Ne.trim()||G)){j(!0);try{await fe("/api/memory",{method:"POST",body:JSON.stringify({content:Ne,category:W,source:"dashboard"})}),ke(""),fe("/api/memory?category=").then(w=>b(w.slice(0,3))).catch(()=>{})}catch(w){console.error(w)}finally{j(!1)}}}const pe=A.find(w=>w.label.includes("OS-Update")&&(w.state==="running"||w.state==="queued")),me=A.find(w=>w.label.includes("Engine-Update")&&(w.state==="running"||w.state==="queued"));return n.jsxs("div",{className:"space-y-6",children:[ne.open&&n.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm p-4",children:n.jsxs("div",{className:"w-full max-w-sm rounded-2xl border border-border/60 bg-card/90 backdrop-blur-xl p-5 shadow-2xl space-y-4",children:[n.jsxs("div",{className:"flex items-center justify-between border-b border-border/20 pb-2",children:[n.jsx("span",{className:"text-xs font-bold uppercase tracking-wider text-primary font-space",children:"Sudo-Passwort erforderlich"}),n.jsx("button",{onClick:()=>{se({open:!1,actionPath:"",actionLabel:""}),H("")},className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground cursor-pointer",children:n.jsx(Hr,{className:"h-4 w-4"})})]}),n.jsxs("p",{className:"text-[10px] text-muted-foreground leading-normal",children:["Für die Aktion ",n.jsx("strong",{children:ne.actionLabel})," wird das Administrator-Passwort (Sudo) auf der Box benötigt."]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("input",{type:"password",value:Z,onChange:w=>H(w.target.value),placeholder:"Sudo-Passwort eingeben...",className:"w-full h-9 rounded-lg border border-border/60 bg-background/40 px-3 text-xs outline-none focus:ring-1 focus:ring-primary/50 text-foreground",onKeyDown:w=>w.key==="Enter"&&Y(),autoFocus:!0}),ne.error&&n.jsx("div",{className:"text-[10px] font-semibold text-red-400",children:ne.error})]}),n.jsxs("div",{className:"flex gap-2 justify-end",children:[n.jsx("button",{onClick:()=>{se({open:!1,actionPath:"",actionLabel:""}),H("")},className:"h-8 px-3 rounded-lg border border-border/60 bg-background/25 text-[10px] font-bold uppercase hover:bg-accent transition-all cursor-pointer",children:"Abbrechen"}),n.jsx("button",{onClick:Y,disabled:!Z||T,className:"h-8 px-4 rounded-lg bg-primary text-primary-foreground text-[10px] font-bold uppercase hover:opacity-90 transition-all disabled:opacity-50 cursor-pointer flex items-center justify-center gap-1.5",children:T?"Prüfe...":"Ausführen"})]})]})}),n.jsxs("div",{children:[n.jsx("h1",{className:"text-2xl font-space font-bold tracking-tight bg-gradient-to-r from-foreground via-foreground to-primary bg-clip-text text-transparent",children:"Zentrale"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Aktueller Status von System, Modellen und Agent."})]}),n.jsxs("div",{className:"grid gap-6 md:grid-cols-3",children:[n.jsxs("div",{className:"md:col-span-2 flex flex-col justify-between rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/15",children:[n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[n.jsx(gt,{className:"h-4.5 w-4.5 text-primary"}),n.jsx("h2",{className:"text-sm font-semibold tracking-wide uppercase text-foreground",children:"System-Status"})]}),o?n.jsxs("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-4",children:[n.jsx(Qo,{value:o.cpu.percent,label:"CPU",detail:o.cpu.cores?`${o.cpu.cores} Cores`:void 0}),n.jsx(Qo,{value:o.ram.percent,label:"RAM",detail:`${En(o.ram.used)} / ${En(o.ram.total)} GB`}),o.gpu&&o.gpu.busy_percent!=null&&o.gpu.gtt_used!=null&&o.gpu.gtt_total!=null&&n.jsx(Qo,{value:o.gpu.busy_percent,label:"GPU",detail:`${En(o.gpu.gtt_used)} / ${En(o.gpu.gtt_total)} GB`}),o.disk&&n.jsx(Qo,{value:o.disk.percent,label:"Disk",detail:`${En(o.disk.used)} / ${En(o.disk.total)} GB`})]}):n.jsx("div",{className:"h-28 flex items-center justify-center text-xs text-muted-foreground",children:"Lade Systemdaten…"})]}),(o==null?void 0:o.temp)&&(o.temp.cpu||o.temp.gpu)&&n.jsxs("div",{className:"mt-4 flex gap-4 text-xs font-mono text-muted-foreground/80 border-t border-border/30 pt-3",children:[o.temp.cpu!=null&&n.jsxs("span",{children:["CPU Temp: ",o.temp.cpu," °C"]}),o.temp.gpu!=null&&n.jsxs("span",{children:["GPU Temp: ",o.temp.gpu," °C"]})]})]}),n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/15 flex flex-col justify-between",children:[n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-2 border-b border-border/20 pb-2",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(Ch,{className:"h-4.5 w-4.5 text-primary"}),n.jsx("h2",{className:"text-sm font-semibold tracking-wide uppercase text-foreground",children:"Updates & Pflege"})]}),(k==null?void 0:k.last_check)&&n.jsxs("span",{className:"text-[9px] text-muted-foreground/80 font-mono",children:["Zuletzt gesucht: ",new Date(k.last_check*1e3).toLocaleString("de-DE",{day:"2-digit",month:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit"})]})]}),k?n.jsxs("div",{className:"space-y-3",children:[n.jsxs("div",{className:"space-y-1.5",children:[n.jsxs("div",{className:ee("flex items-center justify-between px-3 py-1.5 rounded-lg border text-xs",k.os>0?"border-amber-500/30 bg-amber-500/5 text-amber-400 font-semibold":"border-border/30 bg-background/25 text-muted-foreground"),children:[n.jsx("span",{children:"OS-Pakete"}),n.jsx("span",{className:"font-mono",children:k.os>0?`${k.os} verfügbar`:"aktuell"})]}),n.jsxs("div",{className:ee("flex items-center justify-between px-3 py-1.5 rounded-lg border text-xs",k.engine>0?"border-amber-500/30 bg-amber-500/5 text-amber-400 font-semibold":"border-border/30 bg-background/25 text-muted-foreground"),children:[n.jsx("span",{children:"Engine (llama.cpp)"}),n.jsx("span",{className:"font-mono",children:k.engine>0?"Update verfügbar":"aktuell"})]}),n.jsxs("div",{className:ee("flex items-center justify-between px-3 py-1.5 rounded-lg border text-xs",k.models>0?"border-primary/30 bg-primary/5 text-primary font-semibold animate-pulse":"border-border/30 bg-background/25 text-muted-foreground"),children:[n.jsx("span",{children:"Modell-Upgrades"}),n.jsx("span",{className:"font-mono",children:k.models>0?`${k.models} verfügbar`:"aktuell"})]})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-2 border-t border-border/20 pt-3",children:[n.jsx("button",{onClick:()=>B("/api/maintenance/os-update","OS-Update"),disabled:L||!!pe,className:"h-8 px-2 rounded-lg border border-border/60 bg-background/20 text-[10px] font-bold uppercase hover:border-primary/50 hover:bg-background/40 transition-all cursor-pointer disabled:opacity-50 flex items-center justify-center gap-1",children:pe?n.jsxs(n.Fragment,{children:[n.jsx(Br,{className:"h-3 w-3 animate-spin text-primary"}),n.jsxs("span",{children:["Aktiv (",pe.progress??0,"%)"]})]}):n.jsx("span",{children:"OS Update"})}),n.jsx("button",{onClick:()=>B("/api/maintenance/engine-update","Engine-Update"),disabled:L||!!me,className:"h-8 px-2 rounded-lg border border-border/60 bg-background/20 text-[10px] font-bold uppercase hover:border-primary/50 hover:bg-background/40 transition-all cursor-pointer disabled:opacity-50 flex items-center justify-center gap-1",children:me?n.jsxs(n.Fragment,{children:[n.jsx(Br,{className:"h-3 w-3 animate-spin text-primary"}),n.jsxs("span",{children:["Aktiv (",me.progress??0,"%)"]})]}):n.jsx("span",{children:"Engine Update"})})]}),n.jsxs("button",{onClick:()=>{Pe("Host-System neu starten?","Bist du sicher, dass du das Host-System neu starten willst?",()=>B("/api/maintenance/reboot","Reboot"))},disabled:L,className:"w-full h-8 flex items-center justify-center gap-1.5 rounded-lg border border-red-500/30 bg-red-500/5 text-red-400 text-[10px] font-bold uppercase hover:bg-red-500/10 transition-all cursor-pointer disabled:opacity-50",children:[n.jsx(df,{className:"h-3.5 w-3.5"}),n.jsx("span",{children:"Host Reboot"})]}),k.model_list.length>0&&n.jsxs("div",{className:"space-y-1.5 border-t border-border/20 pt-3",children:[n.jsx("div",{className:"text-[9px] uppercase font-bold text-muted-foreground/60 tracking-wider",children:"Verfügbare Modell-Upgrades:"}),n.jsx("div",{className:"max-h-24 overflow-y-auto space-y-1.5 pr-1 scrollbar-thin",children:k.model_list.map(w=>n.jsxs("div",{className:"flex items-center justify-between p-2 rounded bg-background/25 border border-border/30 text-[10px] font-mono text-muted-foreground",children:[n.jsxs("span",{className:"truncate flex-1 mr-1.5",title:`${w.role}: ${w.repo}`,children:[n.jsx("span",{className:"text-primary font-bold uppercase",children:w.role}),": ",w.repo.split("/").pop()]}),n.jsxs("button",{onClick:()=>K(w.repo,w.role),className:"px-2 py-0.5 text-[8px] font-bold uppercase rounded bg-primary text-primary-foreground hover:opacity-90 transition-all cursor-pointer flex items-center gap-0.5",children:[n.jsx(Vr,{className:"h-2.5 w-2.5"})," Laden"]})]},w.repo))})]})]}):n.jsx("div",{className:"h-24 flex items-center justify-center text-xs text-muted-foreground",children:"Lade Updates..."}),C&&n.jsx("div",{className:"text-[10px] font-mono text-primary font-medium bg-primary/5 p-2 rounded-lg border border-primary/20 break-all leading-normal",children:C}),n.jsxs("div",{className:"text-[9px] text-muted-foreground/60 leading-normal border-t border-border/10 pt-2.5 flex items-start gap-1",children:[n.jsx(Wr,{className:"h-3 w-3 shrink-0 text-muted-foreground/50 mt-0.5"}),n.jsxs("span",{children:["OS-Update & Reboot benötigen NOPASSWD in ",n.jsx("code",{children:"/etc/sudoers"})," (z.B. ",n.jsx("code",{children:"hitonabi ALL=(root) NOPASSWD:..."}),") oder ein gültiges Sudo-Passwort per Pop-up."]})]})]}),n.jsx("div",{className:"mt-4 border-t border-border/30 pt-3 shrink-0",children:n.jsx("button",{onClick:()=>window.dispatchEvent(new CustomEvent("open-system-drawer")),className:"w-full h-8 flex items-center justify-center gap-1.5 rounded-lg bg-primary text-primary-foreground text-xs font-semibold hover:opacity-90 transition-all cursor-pointer shadow-md shadow-primary/10",children:"System-Zentrale öffnen"})})]})]}),n.jsxs("div",{className:"grid gap-6 md:grid-cols-2 xl:grid-cols-4",children:[n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/15 flex flex-col justify-between",children:[n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center justify-between mb-4",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(Ss,{className:"h-4.5 w-4.5 text-primary"}),n.jsx("h2",{className:"text-sm font-semibold tracking-wide uppercase text-foreground",children:"Hermes Agent"})]}),(a==null?void 0:a.webui_url)&&n.jsxs("a",{href:Ps(a.webui_url),target:"_blank",rel:"noopener",className:ee("flex items-center gap-1 px-3 py-1 rounded-lg text-xs font-medium transition-all",a.webui_reachable?"bg-primary text-primary-foreground hover:opacity-90 shadow-md shadow-primary/20":"border border-border text-muted-foreground"),children:[n.jsx(el,{className:"h-3 w-3"})," Hermes öffnen"]})]}),a?n.jsxs("div",{className:"space-y-3",children:[n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n.jsxs("div",{className:"p-3 bg-background/20 rounded-xl border border-border/40",children:[n.jsx("div",{className:"text-[10px] text-muted-foreground uppercase font-semibold",children:"Gateway"}),n.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[n.jsx("span",{className:ee("h-2 w-2 rounded-full",a.gateway_reachable?"bg-emerald-500 animate-pulse":"bg-amber-500")}),n.jsx("span",{className:"text-xs font-medium",children:a.gateway_reachable?"Online":"Offline"})]})]}),n.jsxs("div",{className:"p-3 bg-background/20 rounded-xl border border-border/40",children:[n.jsx("div",{className:"text-[10px] text-muted-foreground uppercase font-semibold",children:"WebUI"}),n.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[n.jsx("span",{className:ee("h-2 w-2 rounded-full",a.webui_reachable?"bg-emerald-500 animate-pulse":"bg-amber-500")}),n.jsx("span",{className:"text-xs font-medium",children:a.webui_reachable?"Online":"Offline"})]})]})]}),n.jsxs("div",{onClick:()=>Me(!0),className:"p-3 bg-background/20 rounded-xl border border-border/40 hover:border-primary/45 hover:bg-background/30 transition-all duration-300 cursor-pointer group",children:[n.jsxs("div",{className:"flex justify-between items-center",children:[n.jsx("span",{className:"text-[10px] text-muted-foreground uppercase font-semibold",children:"Aktives Gehirn"}),n.jsxs("button",{className:"flex items-center gap-1 text-[9px] font-bold uppercase tracking-wider text-primary border border-primary/20 bg-primary/10 hover:bg-primary/20 px-1.5 py-0.5 rounded transition-all cursor-pointer font-space",children:[n.jsx(gt,{className:"h-3 w-3"})," Ändern"]})]}),n.jsxs("div",{className:"text-xs font-medium mt-1 font-mono text-primary flex items-center gap-1.5",children:[n.jsx(Es,{className:"h-3.5 w-3.5"}),a.brain_model?`model: ${a.brain_model}`:"model: auto"]})]})]}):n.jsx("div",{className:"h-28 flex items-center justify-center text-xs text-muted-foreground",children:"Lade Agenten-Status…"})]}),n.jsx("div",{className:"mt-3 text-[10px] text-muted-foreground/80 border-t border-border/30 pt-3",children:"Gedächtnis & Stack-Tools via MCP gekoppelt."})]}),n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/15 flex flex-col justify-between",children:[n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[n.jsx(Es,{className:"h-4.5 w-4.5 text-primary"}),n.jsx("h2",{className:"text-sm font-semibold tracking-wide uppercase text-foreground",children:"Rollen-Belegung"})]}),n.jsx("div",{className:"space-y-2 max-h-48 overflow-y-auto pr-1 scrollbar-thin",children:["fast","heavy","coder","reasoning","vision","scout"].map(w=>{var $t;const J=f.find(lt=>lt.role===w),Le=J?h.includes(J.name):!1;return n.jsxs("div",{className:ee("flex items-center justify-between p-2 rounded-xl border transition-all duration-300",Le?"border-emerald-500/30 bg-emerald-500/5 shadow-sm shadow-emerald-500/5":J?"border-primary/20 bg-primary/5":"border-border/30 bg-background/10 opacity-60"),children:[n.jsx("div",{className:"min-w-0 flex-1 mr-2",children:n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:ee("text-[9px] font-semibold uppercase px-1.5 py-0.5 rounded font-mono border tracking-wider shrink-0",w==="fast"?"bg-cyan-500/15 text-cyan-400 border-cyan-500/25":w==="heavy"?"bg-amber-500/15 text-amber-400 border-amber-500/25":w==="coder"?"bg-violet-500/15 text-violet-400 border-violet-500/25":w==="reasoning"?"bg-emerald-500/15 text-emerald-400 border-emerald-500/25":w==="vision"?"bg-pink-500/15 text-pink-400 border-pink-500/25":"bg-teal-500/15 text-teal-400 border-teal-500/25"),children:w}),n.jsx("span",{className:"text-xs font-semibold truncate font-mono text-foreground",children:J?($t=J.name.split("/").pop())==null?void 0:$t.replace(/\.gguf$/i,""):"nicht zugewiesen"})]})}),n.jsx("div",{className:"flex items-center gap-1.5 shrink-0",children:J?Le?n.jsxs("span",{className:"flex items-center gap-1 text-[8px] font-semibold text-emerald-400 uppercase tracking-wider font-mono",children:[n.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500 animate-pulse"})," warm"]}):n.jsx("span",{className:"text-[8px] font-semibold text-muted-foreground uppercase tracking-wider font-mono",children:"bereit"}):n.jsx("span",{className:"text-[8px] font-semibold text-muted-foreground/60 uppercase tracking-wider font-mono",children:"—"})})]},w)})})]}),n.jsx("div",{className:"mt-4 text-[10px] text-muted-foreground/80 border-t border-border/30 pt-3",children:"Laden erfolgt automatisch per Auto-Swap."})]}),n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/15 flex flex-col justify-between",children:[n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[n.jsx(Cs,{className:"h-4.5 w-4.5 text-primary"}),n.jsx("h2",{className:"text-sm font-semibold tracking-wide uppercase text-foreground",children:"Gedächtnis"})]}),n.jsxs("div",{className:"space-y-3",children:[n.jsx("textarea",{value:Ne,onChange:w=>ke(w.target.value),placeholder:"Fakt / Regel im Pool speichern...",rows:2,className:"w-full resize-none rounded-xl border border-border/50 bg-background/30 p-2 text-[10px] outline-none focus:ring-1 focus:ring-primary transition-all leading-normal"}),n.jsxs("div",{className:"flex items-center gap-2 justify-between",children:[n.jsxs("select",{value:W,onChange:w=>ae(w.target.value),className:"h-7 rounded-lg border border-border/50 bg-background/50 px-2 text-[10px] outline-none cursor-pointer",children:[n.jsx("option",{value:"stable",children:"🔵 Fakt"}),n.jsx("option",{value:"instruction",children:"📋 Regel"}),n.jsx("option",{value:"user",children:"👤 User"}),n.jsx("option",{value:"versioned",children:"🟡 Version"})]}),n.jsxs("button",{onClick:oe,disabled:!Ne.trim()||G,className:"flex h-7 items-center gap-1 rounded-lg bg-primary px-3 text-[10px] font-semibold text-primary-foreground hover:opacity-90 disabled:opacity-50 transition-all cursor-pointer",children:[n.jsx(af,{className:"h-3.5 w-3.5"})," Speichern"]})]})]}),n.jsxs("div",{className:"mt-3.5 space-y-1.5",children:[n.jsx("div",{className:"text-[9px] text-muted-foreground uppercase font-bold tracking-wider",children:"Zuletzt gespeichert:"}),n.jsx("div",{className:"max-h-20 overflow-y-auto space-y-1 pr-1 scrollbar-thin",children:E.length===0?n.jsx("div",{className:"text-[10px] text-muted-foreground/75 py-1",children:"Keine Einträge vorhanden."}):E.map(w=>n.jsxs("div",{className:"text-[10px] bg-background/10 border border-border/30 rounded p-1.5 flex items-start gap-1.5",children:[n.jsx("span",{className:"shrink-0 text-[8px] font-mono text-muted-foreground/80 px-1 py-0.5 rounded bg-muted/20",children:w.category}),n.jsx("span",{className:"truncate flex-1 text-muted-foreground hover:text-foreground transition-colors",title:w.content,children:w.content})]},w.id))})]})]}),n.jsx("div",{className:"mt-4 text-[10px] text-muted-foreground/80 border-t border-border/30 pt-3",children:"Steht allen Clients per MCP zur Verfügung."})]}),n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/15 flex flex-col justify-between",children:[n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[n.jsx(ph,{className:"h-4.5 w-4.5 text-primary animate-pulse"}),n.jsx("h2",{className:"text-sm font-semibold tracking-wide uppercase text-foreground",children:"Effizienz & Ersparnis"})]}),O?n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"grid grid-cols-2 gap-2.5",children:[n.jsxs("div",{className:"p-3 bg-background/20 rounded-xl border border-border/40 text-left",children:[n.jsx("div",{className:"text-[8px] uppercase tracking-wider font-semibold text-muted-foreground/60",children:"Geld gespart"}),n.jsxs("div",{className:"text-base font-bold text-emerald-400 mt-0.5 tracking-tight font-space",children:[O.saved_eur.toLocaleString("de-DE",{minimumFractionDigits:2})," €"]}),n.jsxs("div",{className:"text-[8px] text-muted-foreground/80 mt-0.5 font-mono",children:["(",O.saved_usd.toLocaleString("en-US",{minimumFractionDigits:2})," $)"]})]}),n.jsxs("div",{className:"p-3 bg-background/20 rounded-xl border border-border/40 text-left",children:[n.jsx("div",{className:"text-[8px] uppercase tracking-wider font-semibold text-muted-foreground/60",children:"Gesamt-Tokens"}),n.jsx("div",{className:"text-base font-bold text-primary mt-0.5 tracking-tight font-space",children:O.total_tokens.toLocaleString("de-DE")}),n.jsx("div",{className:"text-[8px] text-muted-foreground/80 mt-0.5 font-mono",children:"(Lokale Inferenz)"})]})]}),n.jsxs("div",{className:"space-y-2 border-t border-border/20 pt-3 text-[10px] text-muted-foreground",children:[n.jsxs("div",{className:"flex justify-between items-center font-mono",children:[n.jsx("span",{children:"Input (Prompts):"}),n.jsxs("span",{className:"font-semibold text-foreground",children:[O.prompt_tokens.toLocaleString("de-DE")," tkn"]})]}),n.jsxs("div",{className:"flex justify-between items-center font-mono",children:[n.jsx("span",{children:"Output (Antworten):"}),n.jsxs("span",{className:"font-semibold text-foreground",children:[O.completion_tokens.toLocaleString("de-DE")," tkn"]})]})]})]}):n.jsx("div",{className:"h-28 flex items-center justify-center text-xs text-muted-foreground",children:"Lade Statistiken…"})]}),n.jsx("div",{className:"mt-4 text-[9px] text-muted-foreground/70 border-t border-border/30 pt-2.5 leading-normal",children:"Berechnet im Vergleich zu Cloud-APIs von Juni 2026 (Ø 15,00 $ / 75,00 $ pro 1M tkn)."})]})]}),a&&ce&&n.jsx("div",{className:"fixed inset-0 z-50 bg-black/60 backdrop-blur-sm flex items-center justify-center p-4",children:n.jsxs("div",{className:"w-full max-w-md rounded-2xl border border-border/80 bg-card p-6 shadow-2xl space-y-4 animate-in fade-in zoom-in-95 duration-200",children:[n.jsxs("div",{className:"flex items-center justify-between border-b border-border/20 pb-2",children:[n.jsxs("h3",{className:"text-xs font-bold uppercase tracking-wider text-primary flex items-center gap-1.5",children:[n.jsx(gt,{className:"h-4 w-4"}),n.jsx("span",{children:"Hermes-Gehirn konfigurieren"})]}),n.jsx("button",{onClick:()=>Me(!1),className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground cursor-pointer",children:n.jsx(Hr,{className:"h-4 w-4"})})]}),n.jsxs("p",{className:"text-xs text-muted-foreground leading-relaxed",children:['Das „Gehirn" ist das primäre LLM für Hermes. Wähle ein Modell aus deiner Bibliothek oder nutze ein Gateway-Alias (',n.jsx("code",{className:"text-primary font-semibold",children:"auto"})," / ",n.jsx("code",{className:"text-primary font-semibold",children:"fast"})," / ",n.jsx("code",{className:"text-primary font-semibold",children:"heavy"}),"):"]}),n.jsx("div",{className:"space-y-1.5 max-h-60 overflow-y-auto pr-1",children:["auto","fast","heavy",...f.map(w=>{var J;return((J=w.name.split("/").pop())==null?void 0:J.replace(".gguf",""))||w.name})].map(w=>{const J=["auto","fast","heavy"].includes(w);return n.jsxs("button",{onClick:()=>_e(w),className:ee("w-full text-left px-3 py-2.5 rounded-lg text-xs hover:bg-accent flex items-center justify-between font-mono cursor-pointer border border-border/30",a.brain_model===w||!a.brain_model&&w==="auto"?"text-primary font-bold bg-primary/10 border-primary/30":"text-foreground bg-background/20"),children:[n.jsxs("div",{className:"flex flex-col text-left",children:[n.jsx("span",{className:"font-semibold truncate max-w-[280px]",children:w}),n.jsx("span",{className:"text-[9px] text-muted-foreground mt-0.5",children:J?"Gateway Routing Alias":"Installiertes GGUF Modell"})]}),(a.brain_model===w||!a.brain_model&&w==="auto")&&n.jsx(zn,{className:"h-4 w-4 shrink-0 text-primary"})]},w)})})]})}),X&&n.jsx(Qr,{type:X.type,title:X.title,message:X.message,onConfirm:()=>X.onConfirm(),onCancel:X.onCancel})]})}function $r({children:o,tone:d="muted"}){const a={muted:"bg-muted text-muted-foreground",primary:"bg-primary/15 text-primary",warn:"bg-amber-500/15 text-amber-500"};return n.jsx("span",{className:`rounded px-1.5 py-0.5 text-[11px] font-medium ${a[d]}`,children:o})}function Zu({caps:o}){return o?n.jsxs("span",{className:"inline-flex flex-wrap gap-1",children:[o.coder&&n.jsx($r,{children:"💻 Code"}),o.vision&&n.jsx($r,{children:"👁 Bild"}),o.reasoning&&n.jsx($r,{children:"🧠 Reason"}),o.moe&&n.jsxs($r,{tone:"primary",children:["🧩 MoE",o.active_b?`·${o.active_b}b`:""]}),o.tools==="yes"&&n.jsx($r,{tone:"primary",children:"🛠 Tools"}),o.tools==="likely"&&n.jsx($r,{tone:"warn",children:"🛠 Tools?"}),o.embedding&&n.jsx($r,{children:"🔢 Embed"})]}):null}function Si(o){return o?o>1024**3?`${(o/1024**3).toFixed(1)} GB`:`${(o/1024**2).toFixed(0)} MB`:""}function y0(o){if(!o)return"";const d=Math.floor(o/60);return d>0?`${d} min`:`${o} s`}function b0({onError:o}){const[d,a]=p.useState([]),[c,f]=p.useState(null);function m(){fe("/api/jobs").then(b=>a(b.jobs||[])).catch(()=>{})}p.useEffect(()=>{m();const b=setInterval(m,2e3);return()=>clearInterval(b)},[]);async function h(b){try{await fe(`/api/jobs/${b}/cancel`,{method:"POST"}),m()}catch(k){o?o(k.message):f(k.message)}}const x=d.filter(b=>b.state==="running"||b.state==="queued"),E=d.filter(b=>b.state!=="running"&&b.state!=="queued").slice(-3);return x.length===0&&E.length===0?null:n.jsxs("div",{className:"space-y-3 rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-4 shadow-lg shadow-black/10",children:[n.jsx("div",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wider",children:"Aktive Downloads"}),x.map(b=>n.jsxs("div",{className:"space-y-1.5 p-3 rounded-xl bg-background/20 border border-border/40",children:[n.jsxs("div",{className:"flex justify-between items-center text-xs",children:[n.jsx("span",{className:"font-semibold truncate max-w-[250px]",children:b.label}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsxs("span",{className:"text-muted-foreground font-mono",children:[b.progress??0,"% • ",Si(b.done_bytes),"/",Si(b.total_bytes),b.eta_s?` • ETA ${y0(b.eta_s)}`:""]}),n.jsx("button",{onClick:()=>h(b.id),className:"text-[10px] text-red-400 hover:text-red-300 font-semibold border border-red-500/25 bg-red-500/5 px-2 py-0.5 rounded transition-all cursor-pointer",children:"Abbrechen"})]})]}),n.jsx("div",{className:"h-1.5 overflow-hidden rounded-full bg-muted",children:n.jsx("div",{className:"h-full rounded-full bg-primary transition-all duration-500",style:{width:`${b.progress??0}%`}})})]},b.id)),E.map(b=>n.jsxs("div",{className:"flex justify-between items-center text-xs text-muted-foreground px-1",children:[n.jsx("span",{className:"truncate",children:b.label}),n.jsx("span",{className:ee("font-semibold text-[10px] px-1.5 py-0.5 rounded uppercase font-mono",b.state==="done"?"bg-emerald-500/10 text-emerald-400":"bg-amber-500/10 text-amber-400"),children:b.state})]},b.id)),c&&n.jsx(Qr,{type:"alert",title:"Fehler",message:c,onConfirm:()=>f(null)})]})}function Ur(o){if(!o)return"—";const d=o/1024**3;return d>=1?`${d.toFixed(1)} GB`:`${(o/1024**2).toFixed(0)} MB`}function Yu(o){return o?`${Math.round(o/1024)}k`:"—"}function w0({fit:o}){const d={perfect:"bg-emerald-500/15 text-emerald-400 border border-emerald-500/20",marginal:"bg-amber-500/15 text-amber-400 border border-amber-500/20",too_tight:"bg-red-500/15 text-red-400 border border-red-500/20"}[o.level];return n.jsxs("span",{className:ee("rounded px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wider font-mono",d),children:[o.text," • ",o.req_gb," GB RAM"]})}const j0=["fast","heavy","coder","reasoning","agent","vision","scout"];function Ju(o){const d=o.toLowerCase();return d.includes("qwen")?{name:"Qwen",color:"bg-purple-500/20 text-purple-300 border-purple-500/30",initial:"Q"}:d.includes("gemma")?{name:"Gemma",color:"bg-blue-500/20 text-blue-300 border-blue-500/30",initial:"G"}:d.includes("llama")?{name:"Llama",color:"bg-red-500/20 text-red-300 border-red-500/30",initial:"🦙"}:d.includes("mistral")||d.includes("mixtral")?{name:"Mistral",color:"bg-orange-500/20 text-orange-300 border-orange-500/30",initial:"M"}:d.includes("deepseek")?{name:"DeepSeek",color:"bg-cyan-500/20 text-cyan-300 border-cyan-500/30",initial:"D"}:d.includes("hermes")||d.includes("nous")?{name:"Hermes",color:"bg-amber-500/20 text-amber-300 border-amber-500/30",initial:"H"}:d.includes("phi")?{name:"Phi",color:"bg-emerald-500/20 text-emerald-300 border-emerald-500/30",initial:"Φ"}:{name:"Other",color:"bg-slate-500/20 text-slate-300 border-slate-500/30",initial:"AI"}}function k0(){var Zr,tr,Ut,Yr,In;const[o,d]=p.useState([]),[a,c]=p.useState([]),[f,m]=p.useState(null),[h,x]=p.useState(null),[E,b]=p.useState(null),[k,P]=p.useState(!0),[A,I]=p.useState(""),[O,S]=p.useState(null),[C,_]=p.useState(null),[L,q]=p.useState(!1),[Z,H]=p.useState(null),[T,F]=p.useState("grid"),[ne,se]=p.useState("all"),[X,ye]=p.useState(null);function ce(D,re,ve){ye({type:"alert",title:D,message:re,onConfirm:()=>{ye(null)}})}function Me(D,re,ve,Se){ye({type:"confirm",title:D,message:re,onConfirm:()=>{ye(null),ve()},onCancel:()=>{ye(null)}})}function _e(D,re,ve,Se,ze){ye({type:"prompt",title:D,message:re,defaultValue:ve,onConfirm:Nt=>{ye(null),Se(Nt)},onCancel:()=>{ye(null)}})}const Pe=o.filter(D=>ne==="in_use"?!!D.role||a.includes(D.name):!0),[Ne,ke]=p.useState({width:800,height:360}),W=p.useRef(null),ae=p.useCallback(D=>{if(W.current&&(W.current.disconnect(),W.current=null),D){const re=new ResizeObserver(ve=>{if(!ve||ve.length===0)return;const Se=ve[0].contentRect;ke({width:Se.width,height:Se.height})});re.observe(D),W.current=re}},[]),G=Ne.width,j=Ne.height,v=D=>{const re=G*.1,ve=j*D,Se=G*.5,ze=j*.5,Nt=G*.3,Bt=ve,Vt=G*.3;return`M ${re} ${ve} C ${Nt} ${Bt}, ${Vt} ${ze}, ${Se} ${ze}`},B=D=>{const re=G*.5,ve=j*.5,Se=G*.9,ze=j*D,Nt=G*.7,Bt=ve,Vt=G*.7;return`M ${re} ${ve} C ${Nt} ${Bt}, ${Vt} ${ze}, ${Se} ${ze}`};function Y(){Promise.all([fe("/api/models"),fe("/api/routing"),fe("/api/connect"),fe("/api/maintenance/updates")]).then(([D,re,ve,Se])=>{d(D.models||[]),c(D.running||[]),m(re),x(ve),b(Se)}).catch(D=>I(String(D))).finally(()=>P(!1))}p.useEffect(()=>{Y();const D=setInterval(Y,4e3);return()=>clearInterval(D)},[]);async function K(D){try{await fe(`/api/models/${encodeURIComponent(D)}/load`,{method:"POST"}),Y()}catch(re){ce("Fehler",`Fehler beim Laden des Modells: ${re.message}`)}}async function oe(D){try{await fe(`/api/models/${encodeURIComponent(D)}/unload`,{method:"POST"}),Y()}catch(re){ce("Fehler",`Fehler beim Entladen des Modells: ${re.message}`)}}async function pe(){try{await fe("/api/models/unload",{method:"POST"}),Y()}catch(D){ce("Fehler",`Fehler beim Entladen aller Modelle: ${D.message}`)}}async function me(D,re){try{await fe(`/api/models/${encodeURIComponent(re)}/role`,{method:"POST",body:JSON.stringify({role:D||null})}),Y()}catch(ve){ce("Fehler",`Fehler beim Zuweisen der Rolle: ${ve.message||ve}`)}}async function w(D,re){_e("Kontextlänge anpassen","Gib die gewünschte Kontextlänge in Tokens an:",String(re||32768),async ve=>{if(ve)try{await fe(`/api/models/${encodeURIComponent(D)}/ctx`,{method:"POST",body:JSON.stringify({ctx:parseInt(ve,10)})}),Y()}catch(Se){ce("Fehler",`Fehler beim Setzen des Kontexts: ${Se.message||Se}`)}})}async function J(D){Me("Modell löschen?",`Modell '${D}' und alle zugehörigen GGUF-Dateien unwiderruflich von der Box löschen?`,async()=>{try{await fe(`/api/models/${encodeURIComponent(D)}`,{method:"DELETE"}),Y()}catch(re){ce("Fehler",`Fehler beim Löschen: ${re.message||re}`)}})}async function Le(D,re,ve,Se){try{await fe("/api/models/install",{method:"POST",body:JSON.stringify({repo:D,role:re,quant:ve,jinja:Se})}),ce("Herunterladen gestartet",`Download für '${D}' gestartet! Der Fortschritt wird oben angezeigt.`)}catch(ze){ce("Fehler",`Fehler beim Starten des Upgrades: ${ze.message||ze}`)}}async function $t(D){D&&(await navigator.clipboard.writeText(D),q(!0),setTimeout(()=>q(!1),1500))}if(k)return n.jsx("div",{className:"text-xs text-muted-foreground py-12 text-center",children:"Initialisiere HUD Cockpit…"});if(A)return n.jsxs("div",{className:"rounded-xl border border-red-500/20 bg-red-500/5 p-4 text-xs text-red-400",children:["Gateway oder Engine nicht erreichbar (",A,")."]});const lt=o.filter(D=>a.includes(D.name)),nt=lt.reduce((D,re)=>D+(re.size_bytes||0),0),On=16*1024**3,Tn=nt>On?nt*1.2:On,qr=D=>o.find(re=>re.role===D),er=D=>{const re=qr(D);return re?a.includes(re.name):!1};return n.jsxs("div",{className:"space-y-8",children:[n.jsx("style",{children:` @keyframes flow-dash { to { stroke-dashoffset: -20; diff --git a/frontend/dist/index.html b/frontend/dist/index.html index 6a3e13b..3b1ff33 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/DashboardView.tsx b/frontend/src/views/DashboardView.tsx index cb9c307..6b3560a 100644 --- a/frontend/src/views/DashboardView.tsx +++ b/frontend/src/views/DashboardView.tsx @@ -756,7 +756,7 @@ export function DashboardView() { )}
- Berechnet im Vergleich zu Cloud-APIs (Ø 3,00 $ / 15,00 $ pro 1M tkn). + Berechnet im Vergleich zu Cloud-APIs von Juni 2026 (Ø 15,00 $ / 75,00 $ pro 1M tkn).