From 18f361d4856d0e3b4e284e7224feb40d72061a86 Mon Sep 17 00:00:00 2001 From: Hitonabi Date: Fri, 26 Jun 2026 08:06:01 +0200 Subject: [PATCH] fix: resolve SVG dimension observer loading mount lifecycle issue using callback refs --- frontend/dist/assets/index-CFlBNApe.js | 350 ------------------------- frontend/dist/assets/index-izDdu6A_.js | 350 +++++++++++++++++++++++++ frontend/dist/index.html | 2 +- frontend/src/views/AgentView.tsx | 27 +- frontend/src/views/ModelsView.tsx | 27 +- 5 files changed, 383 insertions(+), 373 deletions(-) delete mode 100644 frontend/dist/assets/index-CFlBNApe.js create mode 100644 frontend/dist/assets/index-izDdu6A_.js diff --git a/frontend/dist/assets/index-CFlBNApe.js b/frontend/dist/assets/index-CFlBNApe.js deleted file mode 100644 index 09f269c..0000000 --- a/frontend/dist/assets/index-CFlBNApe.js +++ /dev/null @@ -1,350 +0,0 @@ -function Um(s,u){for(var a=0;ac[f]})}}}return Object.freeze(Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}))}(function(){const u=document.createElement("link").relList;if(u&&u.supports&&u.supports("modulepreload"))return;for(const f of document.querySelectorAll('link[rel="modulepreload"]'))c(f);new MutationObserver(f=>{for(const h of f)if(h.type==="childList")for(const p of h.addedNodes)p.tagName==="LINK"&&p.rel==="modulepreload"&&c(p)}).observe(document,{childList:!0,subtree:!0});function a(f){const h={};return f.integrity&&(h.integrity=f.integrity),f.referrerPolicy&&(h.referrerPolicy=f.referrerPolicy),f.crossOrigin==="use-credentials"?h.credentials="include":f.crossOrigin==="anonymous"?h.credentials="omit":h.credentials="same-origin",h}function c(f){if(f.ep)return;f.ep=!0;const h=a(f);fetch(f.href,h)}})();function Qd(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var Ba={exports:{}},fo={},Wa={exports:{}},je={};/** - * @license React - * react.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var md;function Bm(){if(md)return je;md=1;var s=Symbol.for("react.element"),u=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),c=Symbol.for("react.strict_mode"),f=Symbol.for("react.profiler"),h=Symbol.for("react.provider"),p=Symbol.for("react.context"),g=Symbol.for("react.forward_ref"),N=Symbol.for("react.suspense"),C=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),_=Symbol.iterator;function P(y){return y===null||typeof y!="object"?null:(y=_&&y[_]||y["@@iterator"],typeof y=="function"?y:null)}var L={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},O=Object.assign,k={};function R(y,x,A){this.props=y,this.context=x,this.refs=k,this.updater=A||L}R.prototype.isReactComponent={},R.prototype.setState=function(y,x){if(typeof y!="object"&&typeof y!="function"&&y!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,y,x,"setState")},R.prototype.forceUpdate=function(y){this.updater.enqueueForceUpdate(this,y,"forceUpdate")};function D(){}D.prototype=R.prototype;function M(y,x,A){this.props=y,this.context=x,this.refs=k,this.updater=A||L}var F=M.prototype=new D;F.constructor=M,O(F,R.prototype),F.isPureReactComponent=!0;var G=Array.isArray,Y=Object.prototype.hasOwnProperty,Q={current:null},ee={key:!0,ref:!0,__self:!0,__source:!0};function ve(y,x,A){var V,B={},q=null,X=null;if(x!=null)for(V in x.ref!==void 0&&(X=x.ref),x.key!==void 0&&(q=""+x.key),x)Y.call(x,V)&&!ee.hasOwnProperty(V)&&(B[V]=x[V]);var de=arguments.length-2;if(de===1)B.children=A;else if(1>>1,x=K[y];if(0>>1;yf(B,Z))qf(X,B)?(K[y]=X,K[q]=Z,y=q):(K[y]=B,K[V]=Z,y=V);else if(qf(X,Z))K[y]=X,K[q]=Z,y=q;else break e}}return te}function f(K,te){var Z=K.sortIndex-te.sortIndex;return Z!==0?Z:K.id-te.id}if(typeof performance=="object"&&typeof performance.now=="function"){var h=performance;s.unstable_now=function(){return h.now()}}else{var p=Date,g=p.now();s.unstable_now=function(){return p.now()-g}}var N=[],C=[],j=1,_=null,P=3,L=!1,O=!1,k=!1,R=typeof setTimeout=="function"?setTimeout:null,D=typeof clearTimeout=="function"?clearTimeout:null,M=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function F(K){for(var te=a(C);te!==null;){if(te.callback===null)c(C);else if(te.startTime<=K)c(C),te.sortIndex=te.expirationTime,u(N,te);else break;te=a(C)}}function G(K){if(k=!1,F(K),!O)if(a(N)!==null)O=!0,Ee(Y);else{var te=a(C);te!==null&&Ne(G,te.startTime-K)}}function Y(K,te){O=!1,k&&(k=!1,D(ve),ve=-1),L=!0;var Z=P;try{for(F(te),_=a(N);_!==null&&(!(_.expirationTime>te)||K&&!ae());){var y=_.callback;if(typeof y=="function"){_.callback=null,P=_.priorityLevel;var x=y(_.expirationTime<=te);te=s.unstable_now(),typeof x=="function"?_.callback=x:_===a(N)&&c(N),F(te)}else c(N);_=a(N)}if(_!==null)var A=!0;else{var V=a(C);V!==null&&Ne(G,V.startTime-te),A=!1}return A}finally{_=null,P=Z,L=!1}}var Q=!1,ee=null,ve=-1,se=5,T=-1;function ae(){return!(s.unstable_now()-TK||125y?(K.sortIndex=Z,u(C,K),a(N)===null&&K===a(C)&&(k?(D(ve),ve=-1):k=!0,Ne(G,Z-y))):(K.sortIndex=x,u(N,K),O||L||(O=!0,Ee(Y))),K},s.unstable_shouldYield=ae,s.unstable_wrapCallback=function(K){var te=P;return function(){var Z=P;P=te;try{return K.apply(this,arguments)}finally{P=Z}}}})(Ga)),Ga}var yd;function Gm(){return yd||(yd=1,Ha.exports=Hm()),Ha.exports}/** - * @license React - * react-dom.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var bd;function Km(){if(bd)return ct;bd=1;var s=mi(),u=Gm();function a(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),N=Object.prototype.hasOwnProperty,C=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,j={},_={};function P(e){return N.call(_,e)?!0:N.call(j,e)?!1:C.test(e)?_[e]=!0:(j[e]=!0,!1)}function L(e,t,r,o){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return o?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function O(e,t,r,o){if(t===null||typeof t>"u"||L(e,t,r,o))return!0;if(o)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function k(e,t,r,o,l,i,d){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=o,this.attributeNamespace=l,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=d}var R={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){R[e]=new k(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];R[t]=new k(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){R[e]=new k(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){R[e]=new k(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){R[e]=new k(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){R[e]=new k(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){R[e]=new k(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){R[e]=new k(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){R[e]=new k(e,5,!1,e.toLowerCase(),null,!1,!1)});var D=/[\-:]([a-z])/g;function M(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(D,M);R[t]=new k(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(D,M);R[t]=new k(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(D,M);R[t]=new k(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){R[e]=new k(e,1,!1,e.toLowerCase(),null,!1,!1)}),R.xlinkHref=new k("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){R[e]=new k(e,1,!1,e.toLowerCase(),null,!0,!0)});function F(e,t,r,o){var l=R.hasOwnProperty(t)?R[t]:null;(l!==null?l.type!==0:o||!(2v||l[d]!==i[v]){var b=` -`+l[d].replace(" at new "," at ");return e.displayName&&b.includes("")&&(b=b.replace("",e.displayName)),b}while(1<=d&&0<=v);break}}}finally{A=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?x(e):""}function B(e){switch(e.tag){case 5:return x(e.type);case 16:return x("Lazy");case 13:return x("Suspense");case 19:return x("SuspenseList");case 0:case 2:case 15:return e=V(e.type,!1),e;case 11:return e=V(e.type.render,!1),e;case 1:return e=V(e.type,!0),e;default:return""}}function q(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case ee:return"Fragment";case Q:return"Portal";case se:return"Profiler";case ve:return"StrictMode";case ke:return"Suspense";case ye:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case ae:return(e.displayName||"Context")+".Consumer";case T:return(e._context.displayName||"Context")+".Provider";case ue:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Se:return t=e.displayName||null,t!==null?t:q(e.type)||"Memo";case Ee:t=e._payload,e=e._init;try{return q(e(t))}catch{}}return null}function X(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return q(t);case 8:return t===ve?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function de(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function he(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Fe(e){var t=he(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),o=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var l=r.get,i=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(d){o=""+d,i.call(this,d)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return o},setValue:function(d){o=""+d},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function yr(e){e._valueTracker||(e._valueTracker=Fe(e))}function Cn(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),o="";return e&&(o=he(e)?e.checked?"true":"false":e.value),e=o,e!==r?(t.setValue(e),!0):!1}function br(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Ir(e,t){var r=t.checked;return Z({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function I(e,t){var r=t.defaultValue==null?"":t.defaultValue,o=t.checked!=null?t.checked:t.defaultChecked;r=de(t.value!=null?t.value:r),e._wrapperState={initialChecked:o,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function me(e,t){t=t.checked,t!=null&&F(e,"checked",t,!1)}function we(e,t){me(e,t);var r=de(t.value),o=t.type;if(r!=null)o==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(o==="submit"||o==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?$e(e,t.type,r):t.hasOwnProperty("defaultValue")&&$e(e,t.type,de(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Oe(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var o=t.type;if(!(o!=="submit"&&o!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function $e(e,t,r){(t!=="number"||br(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var ht=Array.isArray;function Xe(e,t,r,o){if(e=e.options,t){t={};for(var l=0;l"+t.valueOf().toString()+"",t=wo.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function En(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var _n={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Hf=["Webkit","ms","Moz","O"];Object.keys(_n).forEach(function(e){Hf.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),_n[t]=_n[e]})});function Pi(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||_n.hasOwnProperty(e)&&_n[e]?(""+t).trim():t+"px"}function Mi(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var o=r.indexOf("--")===0,l=Pi(r,t[r],o);r==="float"&&(r="cssFloat"),o?e.setProperty(r,l):e[r]=l}}var Gf=Z({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function el(e,t){if(t){if(Gf[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(a(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(a(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(a(61))}if(t.style!=null&&typeof t.style!="object")throw Error(a(62))}}function tl(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var rl=null;function nl(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ol=null,Fr=null,$r=null;function Ri(e){if(e=Zn(e)){if(typeof ol!="function")throw Error(a(280));var t=e.stateNode;t&&(t=Vo(t),ol(e.stateNode,e.type,t))}}function zi(e){Fr?$r?$r.push(e):$r=[e]:Fr=e}function Li(){if(Fr){var e=Fr,t=$r;if($r=Fr=null,Ri(e),t)for(e=0;e>>=0,e===0?32:31-(np(e)/op|0)|0}var Co=64,Eo=4194304;function zn(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function _o(e,t){var r=e.pendingLanes;if(r===0)return 0;var o=0,l=e.suspendedLanes,i=e.pingedLanes,d=r&268435455;if(d!==0){var v=d&~l;v!==0?o=zn(v):(i&=d,i!==0&&(o=zn(i)))}else d=r&~l,d!==0?o=zn(d):i!==0&&(o=zn(i));if(o===0)return 0;if(t!==0&&t!==o&&(t&l)===0&&(l=o&-o,i=t&-t,l>=i||l===16&&(i&4194240)!==0))return t;if((o&4)!==0&&(o|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=o;0r;r++)t.push(e);return t}function Ln(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-kt(t),e[t]=r}function ip(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var o=e.eventTimes;for(e=e.expirationTimes;0=Un),au=" ",iu=!1;function uu(e,t){switch(e){case"keyup":return Ap.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function cu(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Wr=!1;function Ip(e,t){switch(e){case"compositionend":return cu(t);case"keypress":return t.which!==32?null:(iu=!0,au);case"textInput":return e=t.data,e===au&&iu?null:e;default:return null}}function Fp(e,t){if(Wr)return e==="compositionend"||!kl&&uu(e,t)?(e=tu(),Lo=gl=Xt=null,Wr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:r,offset:t-e};e=o}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=xu(r)}}function yu(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?yu(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function bu(){for(var e=window,t=br();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=br(e.document)}return t}function Sl(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function Qp(e){var t=bu(),r=e.focusedElem,o=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&yu(r.ownerDocument.documentElement,r)){if(o!==null&&Sl(r)){if(t=o.start,e=o.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var l=r.textContent.length,i=Math.min(o.start,l);o=o.end===void 0?i:Math.min(o.end,l),!e.extend&&i>o&&(l=o,o=i,i=l),l=vu(r,i);var d=vu(r,o);l&&d&&(e.rangeCount!==1||e.anchorNode!==l.node||e.anchorOffset!==l.offset||e.focusNode!==d.node||e.focusOffset!==d.offset)&&(t=t.createRange(),t.setStart(l.node,l.offset),e.removeAllRanges(),i>o?(e.addRange(t),e.extend(d.node,d.offset)):(t.setEnd(d.node,d.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r=document.documentMode,Vr=null,Cl=null,Hn=null,El=!1;function wu(e,t,r){var o=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;El||Vr==null||Vr!==br(o)||(o=Vr,"selectionStart"in o&&Sl(o)?o={start:o.selectionStart,end:o.selectionEnd}:(o=(o.ownerDocument&&o.ownerDocument.defaultView||window).getSelection(),o={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}),Hn&&Vn(Hn,o)||(Hn=o,o=Uo(Cl,"onSelect"),0Yr||(e.current=Fl[Yr],Fl[Yr]=null,Yr--)}function Me(e,t){Yr++,Fl[Yr]=e.current,e.current=t}var rr={},Je=tr(rr),st=tr(!1),jr=rr;function Zr(e,t){var r=e.type.contextTypes;if(!r)return rr;var o=e.stateNode;if(o&&o.__reactInternalMemoizedUnmaskedChildContext===t)return o.__reactInternalMemoizedMaskedChildContext;var l={},i;for(i in r)l[i]=t[i];return o&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=l),l}function lt(e){return e=e.childContextTypes,e!=null}function Ho(){ze(st),ze(Je)}function Au(e,t,r){if(Je.current!==rr)throw Error(a(168));Me(Je,t),Me(st,r)}function Tu(e,t,r){var o=e.stateNode;if(t=t.childContextTypes,typeof o.getChildContext!="function")return r;o=o.getChildContext();for(var l in o)if(!(l in t))throw Error(a(108,X(e)||"Unknown",l));return Z({},r,o)}function Go(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||rr,jr=Je.current,Me(Je,e),Me(st,st.current),!0}function Iu(e,t,r){var o=e.stateNode;if(!o)throw Error(a(169));r?(e=Tu(e,t,jr),o.__reactInternalMemoizedMergedChildContext=e,ze(st),ze(Je),Me(Je,e)):ze(st),Me(st,r)}var Ft=null,Ko=!1,$l=!1;function Fu(e){Ft===null?Ft=[e]:Ft.push(e)}function lm(e){Ko=!0,Fu(e)}function nr(){if(!$l&&Ft!==null){$l=!0;var e=0,t=Pe;try{var r=Ft;for(Pe=1;e>=d,l-=d,$t=1<<32-kt(t)+l|r<ge?(Qe=pe,pe=null):Qe=pe.sibling;var _e=$(S,pe,E[ge],H);if(_e===null){pe===null&&(pe=Qe);break}e&&pe&&_e.alternate===null&&t(S,pe),w=i(_e,w,ge),fe===null?le=_e:fe.sibling=_e,fe=_e,pe=Qe}if(ge===E.length)return r(S,pe),De&&Sr(S,ge),le;if(pe===null){for(;gege?(Qe=pe,pe=null):Qe=pe.sibling;var fr=$(S,pe,_e.value,H);if(fr===null){pe===null&&(pe=Qe);break}e&&pe&&fr.alternate===null&&t(S,pe),w=i(fr,w,ge),fe===null?le=fr:fe.sibling=fr,fe=fr,pe=Qe}if(_e.done)return r(S,pe),De&&Sr(S,ge),le;if(pe===null){for(;!_e.done;ge++,_e=E.next())_e=W(S,_e.value,H),_e!==null&&(w=i(_e,w,ge),fe===null?le=_e:fe.sibling=_e,fe=_e);return De&&Sr(S,ge),le}for(pe=o(S,pe);!_e.done;ge++,_e=E.next())_e=J(pe,S,ge,_e.value,H),_e!==null&&(e&&_e.alternate!==null&&pe.delete(_e.key===null?ge:_e.key),w=i(_e,w,ge),fe===null?le=_e:fe.sibling=_e,fe=_e);return e&&pe.forEach(function($m){return t(S,$m)}),De&&Sr(S,ge),le}function Be(S,w,E,H){if(typeof E=="object"&&E!==null&&E.type===ee&&E.key===null&&(E=E.props.children),typeof E=="object"&&E!==null){switch(E.$$typeof){case Y:e:{for(var le=E.key,fe=w;fe!==null;){if(fe.key===le){if(le=E.type,le===ee){if(fe.tag===7){r(S,fe.sibling),w=l(fe,E.props.children),w.return=S,S=w;break e}}else if(fe.elementType===le||typeof le=="object"&&le!==null&&le.$$typeof===Ee&&Hu(le)===fe.type){r(S,fe.sibling),w=l(fe,E.props),w.ref=qn(S,fe,E),w.return=S,S=w;break e}r(S,fe);break}else t(S,fe);fe=fe.sibling}E.type===ee?(w=Lr(E.props.children,S.mode,H,E.key),w.return=S,S=w):(H=ws(E.type,E.key,E.props,null,S.mode,H),H.ref=qn(S,w,E),H.return=S,S=H)}return d(S);case Q:e:{for(fe=E.key;w!==null;){if(w.key===fe)if(w.tag===4&&w.stateNode.containerInfo===E.containerInfo&&w.stateNode.implementation===E.implementation){r(S,w.sibling),w=l(w,E.children||[]),w.return=S,S=w;break e}else{r(S,w);break}else t(S,w);w=w.sibling}w=Ta(E,S.mode,H),w.return=S,S=w}return d(S);case Ee:return fe=E._init,Be(S,w,fe(E._payload),H)}if(ht(E))return ne(S,w,E,H);if(te(E))return oe(S,w,E,H);qo(S,E)}return typeof E=="string"&&E!==""||typeof E=="number"?(E=""+E,w!==null&&w.tag===6?(r(S,w.sibling),w=l(w,E),w.return=S,S=w):(r(S,w),w=Aa(E,S.mode,H),w.return=S,S=w),d(S)):r(S,w)}return Be}var en=Gu(!0),Ku=Gu(!1),Xo=tr(null),Jo=null,tn=null,Gl=null;function Kl(){Gl=tn=Jo=null}function Ql(e){var t=Xo.current;ze(Xo),e._currentValue=t}function Yl(e,t,r){for(;e!==null;){var o=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,o!==null&&(o.childLanes|=t)):o!==null&&(o.childLanes&t)!==t&&(o.childLanes|=t),e===r)break;e=e.return}}function rn(e,t){Jo=e,Gl=tn=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(at=!0),e.firstContext=null)}function vt(e){var t=e._currentValue;if(Gl!==e)if(e={context:e,memoizedValue:t,next:null},tn===null){if(Jo===null)throw Error(a(308));tn=e,Jo.dependencies={lanes:0,firstContext:e}}else tn=tn.next=e;return t}var Cr=null;function Zl(e){Cr===null?Cr=[e]:Cr.push(e)}function Qu(e,t,r,o){var l=t.interleaved;return l===null?(r.next=r,Zl(t)):(r.next=l.next,l.next=r),t.interleaved=r,Bt(e,o)}function Bt(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var or=!1;function ql(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Yu(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Wt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function sr(e,t,r){var o=e.updateQueue;if(o===null)return null;if(o=o.shared,(Ce&2)!==0){var l=o.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),o.pending=t,Bt(e,r)}return l=o.interleaved,l===null?(t.next=t,Zl(o)):(t.next=l.next,l.next=t),o.interleaved=t,Bt(e,r)}function es(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var o=t.lanes;o&=e.pendingLanes,r|=o,t.lanes=r,dl(e,r)}}function Zu(e,t){var r=e.updateQueue,o=e.alternate;if(o!==null&&(o=o.updateQueue,r===o)){var l=null,i=null;if(r=r.firstBaseUpdate,r!==null){do{var d={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};i===null?l=i=d:i=i.next=d,r=r.next}while(r!==null);i===null?l=i=t:i=i.next=t}else l=i=t;r={baseState:o.baseState,firstBaseUpdate:l,lastBaseUpdate:i,shared:o.shared,effects:o.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function ts(e,t,r,o){var l=e.updateQueue;or=!1;var i=l.firstBaseUpdate,d=l.lastBaseUpdate,v=l.shared.pending;if(v!==null){l.shared.pending=null;var b=v,z=b.next;b.next=null,d===null?i=z:d.next=z,d=b;var U=e.alternate;U!==null&&(U=U.updateQueue,v=U.lastBaseUpdate,v!==d&&(v===null?U.firstBaseUpdate=z:v.next=z,U.lastBaseUpdate=b))}if(i!==null){var W=l.baseState;d=0,U=z=b=null,v=i;do{var $=v.lane,J=v.eventTime;if((o&$)===$){U!==null&&(U=U.next={eventTime:J,lane:0,tag:v.tag,payload:v.payload,callback:v.callback,next:null});e:{var ne=e,oe=v;switch($=t,J=r,oe.tag){case 1:if(ne=oe.payload,typeof ne=="function"){W=ne.call(J,W,$);break e}W=ne;break e;case 3:ne.flags=ne.flags&-65537|128;case 0:if(ne=oe.payload,$=typeof ne=="function"?ne.call(J,W,$):ne,$==null)break e;W=Z({},W,$);break e;case 2:or=!0}}v.callback!==null&&v.lane!==0&&(e.flags|=64,$=l.effects,$===null?l.effects=[v]:$.push(v))}else J={eventTime:J,lane:$,tag:v.tag,payload:v.payload,callback:v.callback,next:null},U===null?(z=U=J,b=W):U=U.next=J,d|=$;if(v=v.next,v===null){if(v=l.shared.pending,v===null)break;$=v,v=$.next,$.next=null,l.lastBaseUpdate=$,l.shared.pending=null}}while(!0);if(U===null&&(b=W),l.baseState=b,l.firstBaseUpdate=z,l.lastBaseUpdate=U,t=l.shared.interleaved,t!==null){l=t;do d|=l.lane,l=l.next;while(l!==t)}else i===null&&(l.shared.lanes=0);Pr|=d,e.lanes=d,e.memoizedState=W}}function qu(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;tr?r:4,e(!0);var o=ra.transition;ra.transition={};try{e(!1),t()}finally{Pe=r,ra.transition=o}}function gc(){return yt().memoizedState}function cm(e,t,r){var o=ur(e);if(r={lane:o,action:r,hasEagerState:!1,eagerState:null,next:null},xc(e))vc(t,r);else if(r=Qu(e,t,r,o),r!==null){var l=ot();_t(r,e,o,l),yc(r,t,o)}}function dm(e,t,r){var o=ur(e),l={lane:o,action:r,hasEagerState:!1,eagerState:null,next:null};if(xc(e))vc(t,l);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var d=t.lastRenderedState,v=i(d,r);if(l.hasEagerState=!0,l.eagerState=v,jt(v,d)){var b=t.interleaved;b===null?(l.next=l,Zl(t)):(l.next=b.next,b.next=l),t.interleaved=l;return}}catch{}finally{}r=Qu(e,t,l,o),r!==null&&(l=ot(),_t(r,e,o,l),yc(r,t,o))}}function xc(e){var t=e.alternate;return e===Te||t!==null&&t===Te}function vc(e,t){to=os=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function yc(e,t,r){if((r&4194240)!==0){var o=t.lanes;o&=e.pendingLanes,r|=o,t.lanes=r,dl(e,r)}}var as={readContext:vt,useCallback:et,useContext:et,useEffect:et,useImperativeHandle:et,useInsertionEffect:et,useLayoutEffect:et,useMemo:et,useReducer:et,useRef:et,useState:et,useDebugValue:et,useDeferredValue:et,useTransition:et,useMutableSource:et,useSyncExternalStore:et,useId:et,unstable_isNewReconciler:!1},fm={readContext:vt,useCallback:function(e,t){return Ot().memoizedState=[e,t===void 0?null:t],e},useContext:vt,useEffect:ic,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,ss(4194308,4,dc.bind(null,t,e),r)},useLayoutEffect:function(e,t){return ss(4194308,4,e,t)},useInsertionEffect:function(e,t){return ss(4,2,e,t)},useMemo:function(e,t){var r=Ot();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var o=Ot();return t=r!==void 0?r(t):t,o.memoizedState=o.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},o.queue=e,e=e.dispatch=cm.bind(null,Te,e),[o.memoizedState,e]},useRef:function(e){var t=Ot();return e={current:e},t.memoizedState=e},useState:lc,useDebugValue:ua,useDeferredValue:function(e){return Ot().memoizedState=e},useTransition:function(){var e=lc(!1),t=e[0];return e=um.bind(null,e[1]),Ot().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var o=Te,l=Ot();if(De){if(r===void 0)throw Error(a(407));r=r()}else{if(r=t(),Ke===null)throw Error(a(349));(_r&30)!==0||tc(o,t,r)}l.memoizedState=r;var i={value:r,getSnapshot:t};return l.queue=i,ic(nc.bind(null,o,i,e),[e]),o.flags|=2048,oo(9,rc.bind(null,o,i,r,t),void 0,null),r},useId:function(){var e=Ot(),t=Ke.identifierPrefix;if(De){var r=Ut,o=$t;r=(o&~(1<<32-kt(o)-1)).toString(32)+r,t=":"+t+"R"+r,r=ro++,0<\/script>",e=e.removeChild(e.firstChild)):typeof o.is=="string"?e=d.createElement(r,{is:o.is}):(e=d.createElement(r),r==="select"&&(d=e,o.multiple?d.multiple=!0:o.size&&(d.size=o.size))):e=d.createElementNS(e,r),e[zt]=t,e[Yn]=o,Fc(e,t,!1,!1),t.stateNode=e;e:{switch(d=tl(r,o),r){case"dialog":Re("cancel",e),Re("close",e),l=o;break;case"iframe":case"object":case"embed":Re("load",e),l=o;break;case"video":case"audio":for(l=0;lan&&(t.flags|=128,o=!0,so(i,!1),t.lanes=4194304)}else{if(!o)if(e=rs(d),e!==null){if(t.flags|=128,o=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),so(i,!0),i.tail===null&&i.tailMode==="hidden"&&!d.alternate&&!De)return tt(t),null}else 2*Ue()-i.renderingStartTime>an&&r!==1073741824&&(t.flags|=128,o=!0,so(i,!1),t.lanes=4194304);i.isBackwards?(d.sibling=t.child,t.child=d):(r=i.last,r!==null?r.sibling=d:t.child=d,i.last=d)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Ue(),t.sibling=null,r=Ae.current,Me(Ae,o?r&1|2:r&1),t):(tt(t),null);case 22:case 23:return La(),o=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==o&&(t.flags|=8192),o&&(t.mode&1)!==0?(mt&1073741824)!==0&&(tt(t),t.subtreeFlags&6&&(t.flags|=8192)):tt(t),null;case 24:return null;case 25:return null}throw Error(a(156,t.tag))}function bm(e,t){switch(Bl(t),t.tag){case 1:return lt(t.type)&&Ho(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return nn(),ze(st),ze(Je),ta(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return Jl(t),null;case 13:if(ze(Ae),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(a(340));Jr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ze(Ae),null;case 4:return nn(),null;case 10:return Ql(t.type._context),null;case 22:case 23:return La(),null;case 24:return null;default:return null}}var ds=!1,rt=!1,wm=typeof WeakSet=="function"?WeakSet:Set,re=null;function sn(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(o){Ie(e,t,o)}else r.current=null}function wa(e,t,r){try{r()}catch(o){Ie(e,t,o)}}var Bc=!1;function km(e,t){if(Ll=Ro,e=bu(),Sl(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var o=r.getSelection&&r.getSelection();if(o&&o.rangeCount!==0){r=o.anchorNode;var l=o.anchorOffset,i=o.focusNode;o=o.focusOffset;try{r.nodeType,i.nodeType}catch{r=null;break e}var d=0,v=-1,b=-1,z=0,U=0,W=e,$=null;t:for(;;){for(var J;W!==r||l!==0&&W.nodeType!==3||(v=d+l),W!==i||o!==0&&W.nodeType!==3||(b=d+o),W.nodeType===3&&(d+=W.nodeValue.length),(J=W.firstChild)!==null;)$=W,W=J;for(;;){if(W===e)break t;if($===r&&++z===l&&(v=d),$===i&&++U===o&&(b=d),(J=W.nextSibling)!==null)break;W=$,$=W.parentNode}W=J}r=v===-1||b===-1?null:{start:v,end:b}}else r=null}r=r||{start:0,end:0}}else r=null;for(Ol={focusedElem:e,selectionRange:r},Ro=!1,re=t;re!==null;)if(t=re,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,re=e;else for(;re!==null;){t=re;try{var ne=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(ne!==null){var oe=ne.memoizedProps,Be=ne.memoizedState,S=t.stateNode,w=S.getSnapshotBeforeUpdate(t.elementType===t.type?oe:St(t.type,oe),Be);S.__reactInternalSnapshotBeforeUpdate=w}break;case 3:var E=t.stateNode.containerInfo;E.nodeType===1?E.textContent="":E.nodeType===9&&E.documentElement&&E.removeChild(E.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(a(163))}}catch(H){Ie(t,t.return,H)}if(e=t.sibling,e!==null){e.return=t.return,re=e;break}re=t.return}return ne=Bc,Bc=!1,ne}function lo(e,t,r){var o=t.updateQueue;if(o=o!==null?o.lastEffect:null,o!==null){var l=o=o.next;do{if((l.tag&e)===e){var i=l.destroy;l.destroy=void 0,i!==void 0&&wa(t,r,i)}l=l.next}while(l!==o)}}function fs(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var o=r.create;r.destroy=o()}r=r.next}while(r!==t)}}function ka(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function Wc(e){var t=e.alternate;t!==null&&(e.alternate=null,Wc(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[zt],delete t[Yn],delete t[Il],delete t[om],delete t[sm])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Vc(e){return e.tag===5||e.tag===3||e.tag===4}function Hc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Vc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function ja(e,t,r){var o=e.tag;if(o===5||o===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=Wo));else if(o!==4&&(e=e.child,e!==null))for(ja(e,t,r),e=e.sibling;e!==null;)ja(e,t,r),e=e.sibling}function Na(e,t,r){var o=e.tag;if(o===5||o===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(o!==4&&(e=e.child,e!==null))for(Na(e,t,r),e=e.sibling;e!==null;)Na(e,t,r),e=e.sibling}var Ye=null,Ct=!1;function lr(e,t,r){for(r=r.child;r!==null;)Gc(e,t,r),r=r.sibling}function Gc(e,t,r){if(Rt&&typeof Rt.onCommitFiberUnmount=="function")try{Rt.onCommitFiberUnmount(So,r)}catch{}switch(r.tag){case 5:rt||sn(r,t);case 6:var o=Ye,l=Ct;Ye=null,lr(e,t,r),Ye=o,Ct=l,Ye!==null&&(Ct?(e=Ye,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Ye.removeChild(r.stateNode));break;case 18:Ye!==null&&(Ct?(e=Ye,r=r.stateNode,e.nodeType===8?Tl(e.parentNode,r):e.nodeType===1&&Tl(e,r),In(e)):Tl(Ye,r.stateNode));break;case 4:o=Ye,l=Ct,Ye=r.stateNode.containerInfo,Ct=!0,lr(e,t,r),Ye=o,Ct=l;break;case 0:case 11:case 14:case 15:if(!rt&&(o=r.updateQueue,o!==null&&(o=o.lastEffect,o!==null))){l=o=o.next;do{var i=l,d=i.destroy;i=i.tag,d!==void 0&&((i&2)!==0||(i&4)!==0)&&wa(r,t,d),l=l.next}while(l!==o)}lr(e,t,r);break;case 1:if(!rt&&(sn(r,t),o=r.stateNode,typeof o.componentWillUnmount=="function"))try{o.props=r.memoizedProps,o.state=r.memoizedState,o.componentWillUnmount()}catch(v){Ie(r,t,v)}lr(e,t,r);break;case 21:lr(e,t,r);break;case 22:r.mode&1?(rt=(o=rt)||r.memoizedState!==null,lr(e,t,r),rt=o):lr(e,t,r);break;default:lr(e,t,r)}}function Kc(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new wm),t.forEach(function(o){var l=Rm.bind(null,e,o);r.has(o)||(r.add(o),o.then(l,l))})}}function Et(e,t){var r=t.deletions;if(r!==null)for(var o=0;ol&&(l=d),o&=~i}if(o=l,o=Ue()-o,o=(120>o?120:480>o?480:1080>o?1080:1920>o?1920:3e3>o?3e3:4320>o?4320:1960*Nm(o/1960))-o,10e?16:e,ir===null)var o=!1;else{if(e=ir,ir=null,xs=0,(Ce&6)!==0)throw Error(a(331));var l=Ce;for(Ce|=4,re=e.current;re!==null;){var i=re,d=i.child;if((re.flags&16)!==0){var v=i.deletions;if(v!==null){for(var b=0;bUe()-Ea?Rr(e,0):Ca|=r),ut(e,t)}function ld(e,t){t===0&&((e.mode&1)===0?t=1:(t=Eo,Eo<<=1,(Eo&130023424)===0&&(Eo=4194304)));var r=ot();e=Bt(e,t),e!==null&&(Ln(e,t,r),ut(e,r))}function Mm(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),ld(e,r)}function Rm(e,t){var r=0;switch(e.tag){case 13:var o=e.stateNode,l=e.memoizedState;l!==null&&(r=l.retryLane);break;case 19:o=e.stateNode;break;default:throw Error(a(314))}o!==null&&o.delete(t),ld(e,r)}var ad;ad=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||st.current)at=!0;else{if((e.lanes&r)===0&&(t.flags&128)===0)return at=!1,vm(e,t,r);at=(e.flags&131072)!==0}else at=!1,De&&(t.flags&1048576)!==0&&$u(t,Yo,t.index);switch(t.lanes=0,t.tag){case 2:var o=t.type;cs(e,t),e=t.pendingProps;var l=Zr(t,Je.current);rn(t,r),l=oa(null,t,o,e,l,r);var i=sa();return t.flags|=1,typeof l=="object"&&l!==null&&typeof l.render=="function"&&l.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,lt(o)?(i=!0,Go(t)):i=!1,t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,ql(t),l.updater=is,t.stateNode=l,l._reactInternals=t,da(t,o,e,r),t=ha(null,t,o,!0,i,r)):(t.tag=0,De&&i&&Ul(t),nt(null,t,l,r),t=t.child),t;case 16:o=t.elementType;e:{switch(cs(e,t),e=t.pendingProps,l=o._init,o=l(o._payload),t.type=o,l=t.tag=Lm(o),e=St(o,e),l){case 0:t=ma(null,t,o,e,r);break e;case 1:t=Lc(null,t,o,e,r);break e;case 11:t=_c(null,t,o,e,r);break e;case 14:t=Pc(null,t,o,St(o.type,e),r);break e}throw Error(a(306,o,""))}return t;case 0:return o=t.type,l=t.pendingProps,l=t.elementType===o?l:St(o,l),ma(e,t,o,l,r);case 1:return o=t.type,l=t.pendingProps,l=t.elementType===o?l:St(o,l),Lc(e,t,o,l,r);case 3:e:{if(Oc(t),e===null)throw Error(a(387));o=t.pendingProps,i=t.memoizedState,l=i.element,Yu(e,t),ts(t,o,null,r);var d=t.memoizedState;if(o=d.element,i.isDehydrated)if(i={element:o,isDehydrated:!1,cache:d.cache,pendingSuspenseBoundaries:d.pendingSuspenseBoundaries,transitions:d.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){l=on(Error(a(423)),t),t=Dc(e,t,o,r,l);break e}else if(o!==l){l=on(Error(a(424)),t),t=Dc(e,t,o,r,l);break e}else for(pt=er(t.stateNode.containerInfo.firstChild),ft=t,De=!0,Nt=null,r=Ku(t,null,o,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Jr(),o===l){t=Vt(e,t,r);break e}nt(e,t,o,r)}t=t.child}return t;case 5:return Xu(t),e===null&&Vl(t),o=t.type,l=t.pendingProps,i=e!==null?e.memoizedProps:null,d=l.children,Dl(o,l)?d=null:i!==null&&Dl(o,i)&&(t.flags|=32),zc(e,t),nt(e,t,d,r),t.child;case 6:return e===null&&Vl(t),null;case 13:return Ac(e,t,r);case 4:return Xl(t,t.stateNode.containerInfo),o=t.pendingProps,e===null?t.child=en(t,null,o,r):nt(e,t,o,r),t.child;case 11:return o=t.type,l=t.pendingProps,l=t.elementType===o?l:St(o,l),_c(e,t,o,l,r);case 7:return nt(e,t,t.pendingProps,r),t.child;case 8:return nt(e,t,t.pendingProps.children,r),t.child;case 12:return nt(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(o=t.type._context,l=t.pendingProps,i=t.memoizedProps,d=l.value,Me(Xo,o._currentValue),o._currentValue=d,i!==null)if(jt(i.value,d)){if(i.children===l.children&&!st.current){t=Vt(e,t,r);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var v=i.dependencies;if(v!==null){d=i.child;for(var b=v.firstContext;b!==null;){if(b.context===o){if(i.tag===1){b=Wt(-1,r&-r),b.tag=2;var z=i.updateQueue;if(z!==null){z=z.shared;var U=z.pending;U===null?b.next=b:(b.next=U.next,U.next=b),z.pending=b}}i.lanes|=r,b=i.alternate,b!==null&&(b.lanes|=r),Yl(i.return,r,t),v.lanes|=r;break}b=b.next}}else if(i.tag===10)d=i.type===t.type?null:i.child;else if(i.tag===18){if(d=i.return,d===null)throw Error(a(341));d.lanes|=r,v=d.alternate,v!==null&&(v.lanes|=r),Yl(d,r,t),d=i.sibling}else d=i.child;if(d!==null)d.return=i;else for(d=i;d!==null;){if(d===t){d=null;break}if(i=d.sibling,i!==null){i.return=d.return,d=i;break}d=d.return}i=d}nt(e,t,l.children,r),t=t.child}return t;case 9:return l=t.type,o=t.pendingProps.children,rn(t,r),l=vt(l),o=o(l),t.flags|=1,nt(e,t,o,r),t.child;case 14:return o=t.type,l=St(o,t.pendingProps),l=St(o.type,l),Pc(e,t,o,l,r);case 15:return Mc(e,t,t.type,t.pendingProps,r);case 17:return o=t.type,l=t.pendingProps,l=t.elementType===o?l:St(o,l),cs(e,t),t.tag=1,lt(o)?(e=!0,Go(t)):e=!1,rn(t,r),wc(t,o,l),da(t,o,l,r),ha(null,t,o,!0,e,r);case 19:return Ic(e,t,r);case 22:return Rc(e,t,r)}throw Error(a(156,t.tag))};function id(e,t){return Ui(e,t)}function zm(e,t,r,o){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=o,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function wt(e,t,r,o){return new zm(e,t,r,o)}function Da(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Lm(e){if(typeof e=="function")return Da(e)?1:0;if(e!=null){if(e=e.$$typeof,e===ue)return 11;if(e===Se)return 14}return 2}function dr(e,t){var r=e.alternate;return r===null?(r=wt(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function ws(e,t,r,o,l,i){var d=2;if(o=e,typeof e=="function")Da(e)&&(d=1);else if(typeof e=="string")d=5;else e:switch(e){case ee:return Lr(r.children,l,i,t);case ve:d=8,l|=8;break;case se:return e=wt(12,r,t,l|2),e.elementType=se,e.lanes=i,e;case ke:return e=wt(13,r,t,l),e.elementType=ke,e.lanes=i,e;case ye:return e=wt(19,r,t,l),e.elementType=ye,e.lanes=i,e;case Ne:return ks(r,l,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case T:d=10;break e;case ae:d=9;break e;case ue:d=11;break e;case Se:d=14;break e;case Ee:d=16,o=null;break e}throw Error(a(130,e==null?e:typeof e,""))}return t=wt(d,r,t,l),t.elementType=e,t.type=o,t.lanes=i,t}function Lr(e,t,r,o){return e=wt(7,e,o,t),e.lanes=r,e}function ks(e,t,r,o){return e=wt(22,e,o,t),e.elementType=Ne,e.lanes=r,e.stateNode={isHidden:!1},e}function Aa(e,t,r){return e=wt(6,e,null,t),e.lanes=r,e}function Ta(e,t,r){return t=wt(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Om(e,t,r,o,l){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=cl(0),this.expirationTimes=cl(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=cl(0),this.identifierPrefix=o,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function Ia(e,t,r,o,l,i,d,v,b){return e=new Om(e,t,r,v,b),t===1?(t=1,i===!0&&(t|=8)):t=0,i=wt(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:o,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},ql(i),e}function Dm(e,t,r){var o=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(u){console.error(u)}}return s(),Va.exports=Km(),Va.exports}var kd;function Qm(){if(kd)return Ps;kd=1;var s=Zd();return Ps.createRoot=s.createRoot,Ps.hydrateRoot=s.hydrateRoot,Ps}var Ym=Qm();const Zm=Qd(Ym);/** - * @license lucide-react v0.460.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const qm=s=>s.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),qd=(...s)=>s.filter((u,a,c)=>!!u&&u.trim()!==""&&c.indexOf(u)===a).join(" ").trim();/** - * @license lucide-react v0.460.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */var Xm={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** - * @license lucide-react v0.460.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Jm=m.forwardRef(({color:s="currentColor",size:u=24,strokeWidth:a=2,absoluteStrokeWidth:c,className:f="",children:h,iconNode:p,...g},N)=>m.createElement("svg",{ref:N,...Xm,width:u,height:u,stroke:s,strokeWidth:c?Number(a)*24/Number(u):a,className:qd("lucide",f),...g},[...p.map(([C,j])=>m.createElement(C,j)),...Array.isArray(h)?h:[h]]));/** - * @license lucide-react v0.460.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const xe=(s,u)=>{const a=m.forwardRef(({className:c,...f},h)=>m.createElement(Jm,{ref:h,iconNode:u,className:qd(`lucide-${qm(s)}`,c),...f}));return a.displayName=`${s}`,a};/** - * @license lucide-react v0.460.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const gi=xe("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/** - * @license lucide-react v0.460.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Xd=xe("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);/** - * @license lucide-react v0.460.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Gs=xe("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/** - * @license lucide-react v0.460.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const eh=xe("Boxes",[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]]);/** - * @license lucide-react v0.460.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Ks=xe("Brain",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]]);/** - * @license lucide-react v0.460.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const bn=xe("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** - * @license lucide-react v0.460.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const th=xe("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** - * @license lucide-react v0.460.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const rh=xe("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/** - * @license lucide-react v0.460.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const nh=xe("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** - * @license lucide-react v0.460.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const oh=xe("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** - * @license lucide-react v0.460.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const sh=xe("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** - * @license lucide-react v0.460.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const lh=xe("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/** - * @license lucide-react v0.460.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Jd=xe("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/** - * @license lucide-react v0.460.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ah=xe("Command",[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]]);/** - * @license lucide-react v0.460.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ih=xe("Compass",[["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",key:"9ktpf1"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/** - * @license lucide-react v0.460.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const uh=xe("Construction",[["rect",{x:"2",y:"6",width:"20",height:"8",rx:"1",key:"1estib"}],["path",{d:"M17 14v7",key:"7m2elx"}],["path",{d:"M7 14v7",key:"1cm7wv"}],["path",{d:"M17 3v3",key:"1v4jwn"}],["path",{d:"M7 3v3",key:"7o6guu"}],["path",{d:"M10 14 2.3 6.3",key:"1023jk"}],["path",{d:"m14 6 7.7 7.7",key:"1s8pl2"}],["path",{d:"m8 6 8 8",key:"hl96qh"}]]);/** - * @license lucide-react v0.460.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const xi=xe("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/** - * @license lucide-react v0.460.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Dr=xe("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);/** - * @license lucide-react v0.460.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const wn=xe("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/** - * @license lucide-react v0.460.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Bs=xe("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/** - * @license lucide-react v0.460.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ch=xe("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** - * @license lucide-react v0.460.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const dh=xe("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/** - * @license lucide-react v0.460.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const fh=xe("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/** - * @license lucide-react v0.460.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const si=xe("HardDrive",[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]]);/** - * @license lucide-react v0.460.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ph=xe("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/** - * @license lucide-react v0.460.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Ws=xe("Layers",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);/** - * @license lucide-react v0.460.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const mh=xe("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);/** - * @license lucide-react v0.460.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const hh=xe("PenLine",[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z",key:"1ykcvy"}]]);/** - * @license lucide-react v0.460.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const gh=xe("Plug",[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M9 8V2",key:"14iosj"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z",key:"osxo6l"}]]);/** - * @license lucide-react v0.460.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ef=xe("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** - * @license lucide-react v0.460.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const tf=xe("Power",[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]]);/** - * @license lucide-react v0.460.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const kn=xe("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/** - * @license lucide-react v0.460.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const xh=xe("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/** - * @license lucide-react v0.460.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const vh=xe("Scroll",[["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]]);/** - * @license lucide-react v0.460.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const vi=xe("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** - * @license lucide-react v0.460.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const yh=xe("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);/** - * @license lucide-react v0.460.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const bh=xe("ShieldAlert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);/** - * @license lucide-react v0.460.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const go=xe("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);/** - * @license lucide-react v0.460.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const wh=xe("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/** - * @license lucide-react v0.460.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const rf=xe("Star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);/** - * @license lucide-react v0.460.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const kh=xe("Tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);/** - * @license lucide-react v0.460.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const yi=xe("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/** - * @license lucide-react v0.460.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const li=xe("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/** - * @license lucide-react v0.460.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const jh=xe("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/** - * @license lucide-react v0.460.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Nh=xe("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/** - * @license lucide-react v0.460.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Qs=xe("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),ai=[{id:"dashboard",label:"Zentrale",hint:"System- & Stack-Status",icon:mh},{id:"models",label:"Modell-Zentrale",hint:"Verwalten, laden & Gateway-Routing",icon:eh},{id:"system",label:"Diagnose",hint:"Metriken, Dienste, Logs",icon:Dr},{id:"memory",label:"Gedächtnis",hint:"Geteiltes Memory verwalten",icon:Ks},{id:"connect",label:"Verbinden",hint:"IDE-/Agent-Configs erzeugen",icon:gh},{id:"agent",label:"Hermes",hint:"Agent-Status & WebUI öffnen",icon:Gs},{id:"guide",label:"Anleitung",hint:"Einrichten & Vibe-Coding",icon:sh}];var jd=1,Sh=.9,Ch=.8,Eh=.17,Ka=.1,Qa=.999,_h=.9999,Ph=.99,Mh=/[\\\/_+.#"@\[\(\{&]/,Rh=/[\\\/_+.#"@\[\(\{&]/g,zh=/[\s-]/,nf=/[\s-]/g;function ii(s,u,a,c,f,h,p){if(h===u.length)return f===s.length?jd:Ph;var g=`${f},${h}`;if(p[g]!==void 0)return p[g];for(var N=c.charAt(h),C=a.indexOf(N,f),j=0,_,P,L,O;C>=0;)_=ii(s,u,a,c,C+1,h+1,p),_>j&&(C===f?_*=jd:Mh.test(s.charAt(C-1))?(_*=Ch,L=s.slice(f,C-1).match(Rh),L&&f>0&&(_*=Math.pow(Qa,L.length))):zh.test(s.charAt(C-1))?(_*=Sh,O=s.slice(f,C-1).match(nf),O&&f>0&&(_*=Math.pow(Qa,O.length))):(_*=Eh,f>0&&(_*=Math.pow(Qa,C-f))),s.charAt(C)!==u.charAt(h)&&(_*=_h)),(__&&(_=P*Ka)),_>j&&(j=_),C=a.indexOf(N,C+1);return p[g]=j,j}function Nd(s){return s.toLowerCase().replace(nf," ")}function Lh(s,u,a){return s=a&&a.length>0?`${s+" "+a.join(" ")}`:s,ii(s,u,Nd(s),Nd(u),0,0,{})}function xr(s,u,{checkForDefaultPrevented:a=!0}={}){return function(f){if(s==null||s(f),a===!1||!f.defaultPrevented)return u==null?void 0:u(f)}}function Sd(s,u){if(typeof s=="function")return s(u);s!=null&&(s.current=u)}function jn(...s){return u=>{let a=!1;const c=s.map(f=>{const h=Sd(f,u);return!a&&typeof h=="function"&&(a=!0),h});if(a)return()=>{for(let f=0;f{var D;const{scope:P,children:L,...O}=_,k=((D=P==null?void 0:P[s])==null?void 0:D[N])||g,R=m.useMemo(()=>O,Object.values(O));return n.jsx(k.Provider,{value:R,children:L})};C.displayName=h+"Provider";function j(_,P){var k;const L=((k=P==null?void 0:P[s])==null?void 0:k[N])||g,O=m.useContext(L);if(O)return O;if(p!==void 0)return p;throw new Error(`\`${_}\` must be used within \`${h}\``)}return[C,j]}const f=()=>{const h=a.map(p=>m.createContext(p));return function(g){const N=(g==null?void 0:g[s])||h;return m.useMemo(()=>({[`__scope${s}`]:{...g,[s]:N}}),[g,N])}};return f.scopeName=s,[c,Dh(f,...u)]}function Dh(...s){const u=s[0];if(s.length===1)return u;const a=()=>{const c=s.map(f=>({useScope:f(),scopeName:f.scopeName}));return function(h){const p=c.reduce((g,{useScope:N,scopeName:C})=>{const _=N(h)[`__scope${C}`];return{...g,..._}},{});return m.useMemo(()=>({[`__scope${u.scopeName}`]:p}),[p])}};return a.scopeName=u.scopeName,a}var xo=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},Ah=hi[" useId ".trim().toString()]||(()=>{}),Th=0;function Kt(s){const[u,a]=m.useState(Ah());return xo(()=>{a(c=>c??String(Th++))},[s]),u?`radix-${u}`:""}var Ih=hi[" useInsertionEffect ".trim().toString()]||xo;function Fh({prop:s,defaultProp:u,onChange:a=()=>{},caller:c}){const[f,h,p]=$h({defaultProp:u,onChange:a}),g=s!==void 0,N=g?s:f;{const j=m.useRef(s!==void 0);m.useEffect(()=>{const _=j.current;_!==g&&console.warn(`${c} is changing from ${_?"controlled":"uncontrolled"} to ${g?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),j.current=g},[g,c])}const C=m.useCallback(j=>{var _;if(g){const P=Uh(j)?j(s):j;P!==s&&((_=p.current)==null||_.call(p,P))}else h(j)},[g,s,h,p]);return[N,C]}function $h({defaultProp:s,onChange:u}){const[a,c]=m.useState(s),f=m.useRef(a),h=m.useRef(u);return Ih(()=>{h.current=u},[u]),m.useEffect(()=>{var p;f.current!==a&&((p=h.current)==null||p.call(h,a),f.current=a)},[a,f]),[a,c,h]}function Uh(s){return typeof s=="function"}var of=Zd();function sf(s){const u=m.forwardRef((a,c)=>{let{children:f,...h}=a,p=null,g=!1;const N=[];Cd(f)&&typeof Ms=="function"&&(f=Ms(f._payload)),m.Children.forEach(f,P=>{var L;if(Gh(P)){g=!0;const O=P;let k="child"in O.props?O.props.child:O.props.children;Cd(k)&&typeof Ms=="function"&&(k=Ms(k._payload)),p=Wh(O,k),N.push((L=p==null?void 0:p.props)==null?void 0:L.children)}else N.push(P)}),p?p=m.cloneElement(p,void 0,N):!g&&m.Children.count(f)===1&&m.isValidElement(f)&&(p=f);const C=p?Hh(p):void 0,j=Tr(c,C);if(!p){if(f||f===0)throw new Error(g?Zh(s):Yh(s));return f}const _=Vh(h,p.props??{});return p.type!==m.Fragment&&(_.ref=c?j:C),m.cloneElement(p,_)});return u.displayName=`${s}.Slot`,u}var Bh=Symbol.for("radix.slottable"),Wh=(s,u)=>{if("child"in s.props){const a=s.props.child;return m.isValidElement(a)?m.cloneElement(a,void 0,s.props.children(a.props.children)):null}return m.isValidElement(u)?u:null};function Vh(s,u){const a={...u};for(const c in u){const f=s[c],h=u[c];/^on[A-Z]/.test(c)?f&&h?a[c]=(...g)=>{const N=h(...g);return f(...g),N}:f&&(a[c]=f):c==="style"?a[c]={...f,...h}:c==="className"&&(a[c]=[f,h].filter(Boolean).join(" "))}return{...s,...a}}function Hh(s){var c,f;let u=(c=Object.getOwnPropertyDescriptor(s.props,"ref"))==null?void 0:c.get,a=u&&"isReactWarning"in u&&u.isReactWarning;return a?s.ref:(u=(f=Object.getOwnPropertyDescriptor(s,"ref"))==null?void 0:f.get,a=u&&"isReactWarning"in u&&u.isReactWarning,a?s.props.ref:s.props.ref||s.ref)}function Gh(s){return m.isValidElement(s)&&typeof s.type=="function"&&"__radixId"in s.type&&s.type.__radixId===Bh}var Kh=Symbol.for("react.lazy");function Cd(s){return s!=null&&typeof s=="object"&&"$$typeof"in s&&s.$$typeof===Kh&&"_payload"in s&&Qh(s._payload)}function Qh(s){return typeof s=="object"&&s!==null&&"then"in s}var Yh=s=>`${s} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,Zh=s=>`${s} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,Ms=hi[" use ".trim().toString()],qh=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],qe=qh.reduce((s,u)=>{const a=sf(`Primitive.${u}`),c=m.forwardRef((f,h)=>{const{asChild:p,...g}=f,N=p?a:u;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),n.jsx(N,{...g,ref:h})});return c.displayName=`Primitive.${u}`,{...s,[u]:c}},{});function Xh(s,u){s&&of.flushSync(()=>s.dispatchEvent(u))}function vo(s){const u=m.useRef(s);return m.useEffect(()=>{u.current=s}),m.useMemo(()=>((...a)=>{var c;return(c=u.current)==null?void 0:c.call(u,...a)}),[])}function Jh(s,u=globalThis==null?void 0:globalThis.document){const a=vo(s);m.useEffect(()=>{const c=f=>{f.key==="Escape"&&a(f)};return u.addEventListener("keydown",c,{capture:!0}),()=>u.removeEventListener("keydown",c,{capture:!0})},[a,u])}var eg="DismissableLayer",ui="dismissableLayer.update",tg="dismissableLayer.pointerDownOutside",rg="dismissableLayer.focusOutside",Ed,bi=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),lf=m.forwardRef((s,u)=>{const{disableOutsidePointerEvents:a=!1,deferPointerDownOutside:c=!1,onEscapeKeyDown:f,onPointerDownOutside:h,onFocusOutside:p,onInteractOutside:g,onDismiss:N,...C}=s,j=m.useContext(bi),[_,P]=m.useState(null),L=(_==null?void 0:_.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,O]=m.useState({}),k=Tr(u,se=>P(se)),R=Array.from(j.layers),[D]=[...j.layersWithOutsidePointerEventsDisabled].slice(-1),M=R.indexOf(D),F=_?R.indexOf(_):-1,G=j.layersWithOutsidePointerEventsDisabled.size>0,Y=F>=M,Q=m.useRef(!1),ee=lg(se=>{const T=se.target;if(!(T instanceof Node))return;const ae=[...j.branches].some(ue=>ue.contains(T));!Y||ae||(h==null||h(se),g==null||g(se),se.defaultPrevented||N==null||N())},{ownerDocument:L,deferPointerDownOutside:c,isDeferredPointerDownOutsideRef:Q,dismissableSurfaces:j.dismissableSurfaces}),ve=ag(se=>{if(c&&Q.current)return;const T=se.target;[...j.branches].some(ue=>ue.contains(T))||(p==null||p(se),g==null||g(se),se.defaultPrevented||N==null||N())},L);return Jh(se=>{F===j.layers.size-1&&(f==null||f(se),!se.defaultPrevented&&N&&(se.preventDefault(),N()))},L),m.useEffect(()=>{if(_)return a&&(j.layersWithOutsidePointerEventsDisabled.size===0&&(Ed=L.body.style.pointerEvents,L.body.style.pointerEvents="none"),j.layersWithOutsidePointerEventsDisabled.add(_)),j.layers.add(_),_d(),()=>{a&&(j.layersWithOutsidePointerEventsDisabled.delete(_),j.layersWithOutsidePointerEventsDisabled.size===0&&(L.body.style.pointerEvents=Ed))}},[_,L,a,j]),m.useEffect(()=>()=>{_&&(j.layers.delete(_),j.layersWithOutsidePointerEventsDisabled.delete(_),_d())},[_,j]),m.useEffect(()=>{const se=()=>O({});return document.addEventListener(ui,se),()=>document.removeEventListener(ui,se)},[]),n.jsx(qe.div,{...C,ref:k,style:{pointerEvents:G?Y?"auto":"none":void 0,...s.style},onFocusCapture:xr(s.onFocusCapture,ve.onFocusCapture),onBlurCapture:xr(s.onBlurCapture,ve.onBlurCapture),onPointerDownCapture:xr(s.onPointerDownCapture,ee.onPointerDownCapture)})});lf.displayName=eg;var ng="DismissableLayerBranch",og=m.forwardRef((s,u)=>{const a=m.useContext(bi),c=m.useRef(null),f=Tr(u,c);return m.useEffect(()=>{const h=c.current;if(h)return a.branches.add(h),()=>{a.branches.delete(h)}},[a.branches]),n.jsx(qe.div,{...s,ref:f})});og.displayName=ng;function sg(){const s=m.useContext(bi),[u,a]=m.useState(null);return m.useEffect(()=>{if(u)return s.dismissableSurfaces.add(u),()=>{s.dismissableSurfaces.delete(u)}},[u,s.dismissableSurfaces]),a}function lg(s,u){const{ownerDocument:a=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:c=!1,isDeferredPointerDownOutsideRef:f,dismissableSurfaces:h}=u,p=vo(s),g=m.useRef(!1),N=m.useRef(!1),C=m.useRef(new Map),j=m.useRef(()=>{});return m.useEffect(()=>{function _(){N.current=!1,f.current=!1,C.current.clear()}function P(){return Array.from(C.current.values()).some(Boolean)}function L(M){if(!N.current)return;const F=M.target;F instanceof Node&&[...h].some(Y=>Y.contains(F))||C.current.set(M.type,!0),M.type==="click"&&window.setTimeout(()=>{N.current&&j.current()},0)}function O(M){N.current&&C.current.set(M.type,!1)}const k=M=>{if(M.target&&!g.current){let F=function(){a.removeEventListener("click",j.current);const Y=P();_(),Y||af(tg,p,G,{discrete:!0})};const G={originalEvent:M};N.current=!0,f.current=c&&M.button===0,C.current.clear(),!c||M.button!==0?F():(a.removeEventListener("click",j.current),j.current=F,a.addEventListener("click",j.current,{once:!0}))}else a.removeEventListener("click",j.current),_();g.current=!1},R=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const M of R)a.addEventListener(M,L,!0),a.addEventListener(M,O);const D=window.setTimeout(()=>{a.addEventListener("pointerdown",k)},0);return()=>{window.clearTimeout(D),a.removeEventListener("pointerdown",k),a.removeEventListener("click",j.current);for(const M of R)a.removeEventListener(M,L,!0),a.removeEventListener(M,O)}},[a,p,c,f,h]),{onPointerDownCapture:()=>g.current=!0}}function ag(s,u=globalThis==null?void 0:globalThis.document){const a=vo(s),c=m.useRef(!1);return m.useEffect(()=>{const f=h=>{h.target&&!c.current&&af(rg,a,{originalEvent:h},{discrete:!1})};return u.addEventListener("focusin",f),()=>u.removeEventListener("focusin",f)},[u,a]),{onFocusCapture:()=>c.current=!0,onBlurCapture:()=>c.current=!1}}function _d(){const s=new CustomEvent(ui);document.dispatchEvent(s)}function af(s,u,a,{discrete:c}){const f=a.originalEvent.target,h=new CustomEvent(s,{bubbles:!1,cancelable:!0,detail:a});u&&f.addEventListener(s,u,{once:!0}),c?Xh(f,h):f.dispatchEvent(h)}var Ya="focusScope.autoFocusOnMount",Za="focusScope.autoFocusOnUnmount",Pd={bubbles:!1,cancelable:!0},ig="FocusScope",uf=m.forwardRef((s,u)=>{const{loop:a=!1,trapped:c=!1,onMountAutoFocus:f,onUnmountAutoFocus:h,...p}=s,[g,N]=m.useState(null),C=vo(f),j=vo(h),_=m.useRef(null),P=Tr(u,k=>N(k)),L=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(c){let k=function(F){if(L.paused||!g)return;const G=F.target;g.contains(G)?_.current=G:gr(_.current,{select:!0})},R=function(F){if(L.paused||!g)return;const G=F.relatedTarget;G!==null&&(g.contains(G)||gr(_.current,{select:!0}))},D=function(F){if(document.activeElement===document.body)for(const Y of F)Y.removedNodes.length>0&&gr(g)};document.addEventListener("focusin",k),document.addEventListener("focusout",R);const M=new MutationObserver(D);return g&&M.observe(g,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",k),document.removeEventListener("focusout",R),M.disconnect()}}},[c,g,L.paused]),m.useEffect(()=>{if(g){Rd.add(L);const k=document.activeElement;if(!g.contains(k)){const D=new CustomEvent(Ya,Pd);g.addEventListener(Ya,C),g.dispatchEvent(D),D.defaultPrevented||(ug(mg(cf(g)),{select:!0}),document.activeElement===k&&gr(g))}return()=>{g.removeEventListener(Ya,C),setTimeout(()=>{const D=new CustomEvent(Za,Pd);g.addEventListener(Za,j),g.dispatchEvent(D),D.defaultPrevented||gr(k??document.body,{select:!0}),g.removeEventListener(Za,j),Rd.remove(L)},0)}}},[g,C,j,L]);const O=m.useCallback(k=>{if(!a&&!c||L.paused)return;const R=k.key==="Tab"&&!k.altKey&&!k.ctrlKey&&!k.metaKey,D=document.activeElement;if(R&&D){const M=k.currentTarget,[F,G]=cg(M);F&&G?!k.shiftKey&&D===G?(k.preventDefault(),a&&gr(F,{select:!0})):k.shiftKey&&D===F&&(k.preventDefault(),a&&gr(G,{select:!0})):D===M&&k.preventDefault()}},[a,c,L.paused]);return n.jsx(qe.div,{tabIndex:-1,...p,ref:P,onKeyDown:O})});uf.displayName=ig;function ug(s,{select:u=!1}={}){const a=document.activeElement;for(const c of s)if(gr(c,{select:u}),document.activeElement!==a)return}function cg(s){const u=cf(s),a=Md(u,s),c=Md(u.reverse(),s);return[a,c]}function cf(s){const u=[],a=document.createTreeWalker(s,NodeFilter.SHOW_ELEMENT,{acceptNode:c=>{const f=c.tagName==="INPUT"&&c.type==="hidden";return c.disabled||c.hidden||f?NodeFilter.FILTER_SKIP:c.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;a.nextNode();)u.push(a.currentNode);return u}function Md(s,u){for(const a of s)if(!dg(a,{upTo:u}))return a}function dg(s,{upTo:u}){if(getComputedStyle(s).visibility==="hidden")return!0;for(;s;){if(u!==void 0&&s===u)return!1;if(getComputedStyle(s).display==="none")return!0;s=s.parentElement}return!1}function fg(s){return s instanceof HTMLInputElement&&"select"in s}function gr(s,{select:u=!1}={}){if(s&&s.focus){const a=document.activeElement;s.focus({preventScroll:!0}),s!==a&&fg(s)&&u&&s.select()}}var Rd=pg();function pg(){let s=[];return{add(u){const a=s[0];u!==a&&(a==null||a.pause()),s=zd(s,u),s.unshift(u)},remove(u){var a;s=zd(s,u),(a=s[0])==null||a.resume()}}}function zd(s,u){const a=[...s],c=a.indexOf(u);return c!==-1&&a.splice(c,1),a}function mg(s){return s.filter(u=>u.tagName!=="A")}var hg="Portal",df=m.forwardRef((s,u)=>{var g;const{container:a,...c}=s,[f,h]=m.useState(!1);xo(()=>h(!0),[]);const p=a||f&&((g=globalThis==null?void 0:globalThis.document)==null?void 0:g.body);return p?of.createPortal(n.jsx(qe.div,{...c,ref:u}),p):null});df.displayName=hg;function gg(s,u){return m.useReducer((a,c)=>u[a][c]??a,s)}var Ys=s=>{const{present:u,children:a}=s,c=xg(u),f=typeof a=="function"?a({present:c.isPresent}):m.Children.only(a),h=vg(c.ref,yg(f));return typeof a=="function"||c.isPresent?m.cloneElement(f,{ref:h}):null};Ys.displayName="Presence";function xg(s){const[u,a]=m.useState(),c=m.useRef(null),f=m.useRef(s),h=m.useRef("none"),p=s?"mounted":"unmounted",[g,N]=gg(p,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const C=Rs(c.current);h.current=g==="mounted"?C:"none"},[g]),xo(()=>{const C=c.current,j=f.current;if(j!==s){const P=h.current,L=Rs(C);s?N("MOUNT"):L==="none"||(C==null?void 0:C.display)==="none"?N("UNMOUNT"):N(j&&P!==L?"ANIMATION_OUT":"UNMOUNT"),f.current=s}},[s,N]),xo(()=>{if(u){let C;const j=u.ownerDocument.defaultView??window,_=L=>{const k=Rs(c.current).includes(CSS.escape(L.animationName));if(L.target===u&&k&&(N("ANIMATION_END"),!f.current)){const R=u.style.animationFillMode;u.style.animationFillMode="forwards",C=j.setTimeout(()=>{u.style.animationFillMode==="forwards"&&(u.style.animationFillMode=R)})}},P=L=>{L.target===u&&(h.current=Rs(c.current))};return u.addEventListener("animationstart",P),u.addEventListener("animationcancel",_),u.addEventListener("animationend",_),()=>{j.clearTimeout(C),u.removeEventListener("animationstart",P),u.removeEventListener("animationcancel",_),u.removeEventListener("animationend",_)}}else N("ANIMATION_END")},[u,N]),{isPresent:["mounted","unmountSuspended"].includes(g),ref:m.useCallback(C=>{c.current=C?getComputedStyle(C):null,a(C)},[])}}function Ld(s,u){if(typeof s=="function")return s(u);s!=null&&(s.current=u)}function vg(...s){const u=m.useRef(s);return u.current=s,m.useCallback(a=>{const c=u.current;let f=!1;const h=c.map(p=>{const g=Ld(p,a);return!f&&typeof g=="function"&&(f=!0),g});if(f)return()=>{for(let p=0;p{At||(At={start:Od(),end:Od()});const{start:s,end:u}=At;return document.body.firstElementChild!==s&&document.body.insertAdjacentElement("afterbegin",s),document.body.lastElementChild!==u&&document.body.insertAdjacentElement("beforeend",u),zs++,()=>{zs===1&&(At==null||At.start.remove(),At==null||At.end.remove(),At=null),zs=Math.max(0,zs-1)}},[])}function Od(){const s=document.createElement("span");return s.setAttribute("data-radix-focus-guard",""),s.tabIndex=0,s.style.outline="none",s.style.opacity="0",s.style.position="fixed",s.style.pointerEvents="none",s}var Tt=function(){return Tt=Object.assign||function(u){for(var a,c=1,f=arguments.length;c"u")return Tg;var u=Ig(s),a=document.documentElement.clientWidth,c=window.innerWidth;return{left:u[0],top:u[1],right:u[2],gap:Math.max(0,c-a+u[2]-u[0])}},$g=hf(),vn="data-scroll-locked",Ug=function(s,u,a,c){var f=s.left,h=s.top,p=s.right,g=s.gap;return a===void 0&&(a="margin"),` - .`.concat(kg,` { - overflow: hidden `).concat(c,`; - padding-right: `).concat(g,"px ").concat(c,`; - } - body[`).concat(vn,`] { - overflow: hidden `).concat(c,`; - overscroll-behavior: contain; - `).concat([u&&"position: relative ".concat(c,";"),a==="margin"&&` - padding-left: `.concat(f,`px; - padding-top: `).concat(h,`px; - padding-right: `).concat(p,`px; - margin-left:0; - margin-top:0; - margin-right: `).concat(g,"px ").concat(c,`; - `),a==="padding"&&"padding-right: ".concat(g,"px ").concat(c,";")].filter(Boolean).join(""),` - } - - .`).concat($s,` { - right: `).concat(g,"px ").concat(c,`; - } - - .`).concat(Us,` { - margin-right: `).concat(g,"px ").concat(c,`; - } - - .`).concat($s," .").concat($s,` { - right: 0 `).concat(c,`; - } - - .`).concat(Us," .").concat(Us,` { - margin-right: 0 `).concat(c,`; - } - - body[`).concat(vn,`] { - `).concat(jg,": ").concat(g,`px; - } -`)},Ad=function(){var s=parseInt(document.body.getAttribute(vn)||"0",10);return isFinite(s)?s:0},Bg=function(){m.useEffect(function(){return document.body.setAttribute(vn,(Ad()+1).toString()),function(){var s=Ad()-1;s<=0?document.body.removeAttribute(vn):document.body.setAttribute(vn,s.toString())}},[])},Wg=function(s){var u=s.noRelative,a=s.noImportant,c=s.gapMode,f=c===void 0?"margin":c;Bg();var h=m.useMemo(function(){return Fg(f)},[f]);return m.createElement($g,{styles:Ug(h,!u,f,a?"":"!important")})},ci=!1;if(typeof window<"u")try{var Ls=Object.defineProperty({},"passive",{get:function(){return ci=!0,!0}});window.addEventListener("test",Ls,Ls),window.removeEventListener("test",Ls,Ls)}catch{ci=!1}var cn=ci?{passive:!1}:!1,Vg=function(s){return s.tagName==="TEXTAREA"},gf=function(s,u){if(!(s instanceof Element))return!1;var a=window.getComputedStyle(s);return a[u]!=="hidden"&&!(a.overflowY===a.overflowX&&!Vg(s)&&a[u]==="visible")},Hg=function(s){return gf(s,"overflowY")},Gg=function(s){return gf(s,"overflowX")},Td=function(s,u){var a=u.ownerDocument,c=u;do{typeof ShadowRoot<"u"&&c instanceof ShadowRoot&&(c=c.host);var f=xf(s,c);if(f){var h=vf(s,c),p=h[1],g=h[2];if(p>g)return!0}c=c.parentNode}while(c&&c!==a.body);return!1},Kg=function(s){var u=s.scrollTop,a=s.scrollHeight,c=s.clientHeight;return[u,a,c]},Qg=function(s){var u=s.scrollLeft,a=s.scrollWidth,c=s.clientWidth;return[u,a,c]},xf=function(s,u){return s==="v"?Hg(u):Gg(u)},vf=function(s,u){return s==="v"?Kg(u):Qg(u)},Yg=function(s,u){return s==="h"&&u==="rtl"?-1:1},Zg=function(s,u,a,c,f){var h=Yg(s,window.getComputedStyle(u).direction),p=h*c,g=a.target,N=u.contains(g),C=!1,j=p>0,_=0,P=0;do{if(!g)break;var L=vf(s,g),O=L[0],k=L[1],R=L[2],D=k-R-h*O;(O||D)&&xf(s,g)&&(_+=D,P+=O);var M=g.parentNode;g=M&&M.nodeType===Node.DOCUMENT_FRAGMENT_NODE?M.host:M}while(!N&&g!==document.body||N&&(u.contains(g)||u===g));return(j&&Math.abs(_)<1||!j&&Math.abs(P)<1)&&(C=!0),C},Os=function(s){return"changedTouches"in s?[s.changedTouches[0].clientX,s.changedTouches[0].clientY]:[0,0]},Id=function(s){return[s.deltaX,s.deltaY]},Fd=function(s){return s&&"current"in s?s.current:s},qg=function(s,u){return s[0]===u[0]&&s[1]===u[1]},Xg=function(s){return` - .block-interactivity-`.concat(s,` {pointer-events: none;} - .allow-interactivity-`).concat(s,` {pointer-events: all;} -`)},Jg=0,dn=[];function ex(s){var u=m.useRef([]),a=m.useRef([0,0]),c=m.useRef(),f=m.useState(Jg++)[0],h=m.useState(hf)[0],p=m.useRef(s);m.useEffect(function(){p.current=s},[s]),m.useEffect(function(){if(s.inert){document.body.classList.add("block-interactivity-".concat(f));var k=wg([s.lockRef.current],(s.shards||[]).map(Fd),!0).filter(Boolean);return k.forEach(function(R){return R.classList.add("allow-interactivity-".concat(f))}),function(){document.body.classList.remove("block-interactivity-".concat(f)),k.forEach(function(R){return R.classList.remove("allow-interactivity-".concat(f))})}}},[s.inert,s.lockRef.current,s.shards]);var g=m.useCallback(function(k,R){if("touches"in k&&k.touches.length===2||k.type==="wheel"&&k.ctrlKey)return!p.current.allowPinchZoom;var D=Os(k),M=a.current,F="deltaX"in k?k.deltaX:M[0]-D[0],G="deltaY"in k?k.deltaY:M[1]-D[1],Y,Q=k.target,ee=Math.abs(F)>Math.abs(G)?"h":"v";if("touches"in k&&ee==="h"&&Q.type==="range")return!1;var ve=window.getSelection(),se=ve&&ve.anchorNode,T=se?se===Q||se.contains(Q):!1;if(T)return!1;var ae=Td(ee,Q);if(!ae)return!0;if(ae?Y=ee:(Y=ee==="v"?"h":"v",ae=Td(ee,Q)),!ae)return!1;if(!c.current&&"changedTouches"in k&&(F||G)&&(c.current=Y),!Y)return!0;var ue=c.current||Y;return Zg(ue,R,k,ue==="h"?F:G)},[]),N=m.useCallback(function(k){var R=k;if(!(!dn.length||dn[dn.length-1]!==h)){var D="deltaY"in R?Id(R):Os(R),M=u.current.filter(function(Y){return Y.name===R.type&&(Y.target===R.target||R.target===Y.shadowParent)&&qg(Y.delta,D)})[0];if(M&&M.should){R.cancelable&&R.preventDefault();return}if(!M){var F=(p.current.shards||[]).map(Fd).filter(Boolean).filter(function(Y){return Y.contains(R.target)}),G=F.length>0?g(R,F[0]):!p.current.noIsolation;G&&R.cancelable&&R.preventDefault()}}},[]),C=m.useCallback(function(k,R,D,M){var F={name:k,delta:R,target:D,should:M,shadowParent:tx(D)};u.current.push(F),setTimeout(function(){u.current=u.current.filter(function(G){return G!==F})},1)},[]),j=m.useCallback(function(k){a.current=Os(k),c.current=void 0},[]),_=m.useCallback(function(k){C(k.type,Id(k),k.target,g(k,s.lockRef.current))},[]),P=m.useCallback(function(k){C(k.type,Os(k),k.target,g(k,s.lockRef.current))},[]);m.useEffect(function(){return dn.push(h),s.setCallbacks({onScrollCapture:_,onWheelCapture:_,onTouchMoveCapture:P}),document.addEventListener("wheel",N,cn),document.addEventListener("touchmove",N,cn),document.addEventListener("touchstart",j,cn),function(){dn=dn.filter(function(k){return k!==h}),document.removeEventListener("wheel",N,cn),document.removeEventListener("touchmove",N,cn),document.removeEventListener("touchstart",j,cn)}},[]);var L=s.removeScrollBar,O=s.inert;return m.createElement(m.Fragment,null,O?m.createElement(h,{styles:Xg(f)}):null,L?m.createElement(Wg,{noRelative:s.noRelative,gapMode:s.gapMode}):null)}function tx(s){for(var u=null;s!==null;)s instanceof ShadowRoot&&(u=s.host,s=s.host),s=s.parentNode;return u}const rx=Mg(mf,ex);var yf=m.forwardRef(function(s,u){return m.createElement(Zs,Tt({},s,{ref:u,sideCar:rx}))});yf.classNames=Zs.classNames;var nx=function(s){if(typeof document>"u")return null;var u=Array.isArray(s)?s[0]:s;return u.ownerDocument.body},fn=new WeakMap,Ds=new WeakMap,As={},ei=0,bf=function(s){return s&&(s.host||bf(s.parentNode))},ox=function(s,u){return u.map(function(a){if(s.contains(a))return a;var c=bf(a);return c&&s.contains(c)?c:(console.error("aria-hidden",a,"in not contained inside",s,". Doing nothing"),null)}).filter(function(a){return!!a})},sx=function(s,u,a,c){var f=ox(u,Array.isArray(s)?s:[s]);As[a]||(As[a]=new WeakMap);var h=As[a],p=[],g=new Set,N=new Set(f),C=function(_){!_||g.has(_)||(g.add(_),C(_.parentNode))};f.forEach(C);var j=function(_){!_||N.has(_)||Array.prototype.forEach.call(_.children,function(P){if(g.has(P))j(P);else try{var L=P.getAttribute(c),O=L!==null&&L!=="false",k=(fn.get(P)||0)+1,R=(h.get(P)||0)+1;fn.set(P,k),h.set(P,R),p.push(P),k===1&&O&&Ds.set(P,!0),R===1&&P.setAttribute(a,"true"),O||P.setAttribute(c,"true")}catch(D){console.error("aria-hidden: cannot operate on ",P,D)}})};return j(u),g.clear(),ei++,function(){p.forEach(function(_){var P=fn.get(_)-1,L=h.get(_)-1;fn.set(_,P),h.set(_,L),P||(Ds.has(_)||_.removeAttribute(c),Ds.delete(_)),L||_.removeAttribute(a)}),ei--,ei||(fn=new WeakMap,fn=new WeakMap,Ds=new WeakMap,As={})}},lx=function(s,u,a){a===void 0&&(a="data-aria-hidden");var c=Array.from(Array.isArray(s)?s:[s]),f=nx(s);return f?(c.push.apply(c,Array.from(f.querySelectorAll("[aria-live], script"))),sx(c,f,a,"aria-hidden")):function(){return null}},qs="Dialog",[wf]=Oh(qs),[ax,Pt]=wf(qs),kf=s=>{const{__scopeDialog:u,children:a,open:c,defaultOpen:f,onOpenChange:h,modal:p=!0}=s,g=m.useRef(null),N=m.useRef(null),[C,j]=Fh({prop:c,defaultProp:f??!1,onChange:h,caller:qs});return n.jsx(ax,{scope:u,triggerRef:g,contentRef:N,contentId:Kt(),titleId:Kt(),descriptionId:Kt(),open:C,onOpenChange:j,onOpenToggle:m.useCallback(()=>j(_=>!_),[j]),modal:p,children:a})};kf.displayName=qs;var jf="DialogTrigger",ix=m.forwardRef((s,u)=>{const{__scopeDialog:a,...c}=s,f=Pt(jf,a),h=Tr(u,f.triggerRef);return n.jsx(qe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":f.open,"aria-controls":f.open?f.contentId:void 0,"data-state":ki(f.open),...c,ref:h,onClick:xr(s.onClick,f.onOpenToggle)})});ix.displayName=jf;var wi="DialogPortal",[ux,Nf]=wf(wi,{forceMount:void 0}),Sf=s=>{const{__scopeDialog:u,forceMount:a,children:c,container:f}=s,h=Pt(wi,u);return n.jsx(ux,{scope:u,forceMount:a,children:m.Children.map(c,p=>n.jsx(Ys,{present:a||h.open,children:n.jsx(df,{asChild:!0,container:f,children:p})}))})};Sf.displayName=wi;var Vs="DialogOverlay",Cf=m.forwardRef((s,u)=>{const a=Nf(Vs,s.__scopeDialog),{forceMount:c=a.forceMount,...f}=s,h=Pt(Vs,s.__scopeDialog);return h.modal?n.jsx(Ys,{present:c||h.open,children:n.jsx(dx,{...f,ref:u})}):null});Cf.displayName=Vs;var cx=sf("DialogOverlay.RemoveScroll"),dx=m.forwardRef((s,u)=>{const{__scopeDialog:a,...c}=s,f=Pt(Vs,a),h=sg(),p=Tr(u,h);return n.jsx(yf,{as:cx,allowPinchZoom:!0,shards:[f.contentRef],children:n.jsx(qe.div,{"data-state":ki(f.open),...c,ref:p,style:{pointerEvents:"auto",...c.style}})})}),Nn="DialogContent",Ef=m.forwardRef((s,u)=>{const a=Nf(Nn,s.__scopeDialog),{forceMount:c=a.forceMount,...f}=s,h=Pt(Nn,s.__scopeDialog);return n.jsx(Ys,{present:c||h.open,children:h.modal?n.jsx(fx,{...f,ref:u}):n.jsx(px,{...f,ref:u})})});Ef.displayName=Nn;var fx=m.forwardRef((s,u)=>{const a=Pt(Nn,s.__scopeDialog),c=m.useRef(null),f=Tr(u,a.contentRef,c);return m.useEffect(()=>{const h=c.current;if(h)return lx(h)},[]),n.jsx(_f,{...s,ref:f,trapFocus:a.open,disableOutsidePointerEvents:a.open,onCloseAutoFocus:xr(s.onCloseAutoFocus,h=>{var p;h.preventDefault(),(p=a.triggerRef.current)==null||p.focus()}),onPointerDownOutside:xr(s.onPointerDownOutside,h=>{const p=h.detail.originalEvent,g=p.button===0&&p.ctrlKey===!0;(p.button===2||g)&&h.preventDefault()}),onFocusOutside:xr(s.onFocusOutside,h=>h.preventDefault())})}),px=m.forwardRef((s,u)=>{const a=Pt(Nn,s.__scopeDialog),c=m.useRef(!1),f=m.useRef(!1);return n.jsx(_f,{...s,ref:u,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:h=>{var p,g;(p=s.onCloseAutoFocus)==null||p.call(s,h),h.defaultPrevented||(c.current||(g=a.triggerRef.current)==null||g.focus(),h.preventDefault()),c.current=!1,f.current=!1},onInteractOutside:h=>{var N,C;(N=s.onInteractOutside)==null||N.call(s,h),h.defaultPrevented||(c.current=!0,h.detail.originalEvent.type==="pointerdown"&&(f.current=!0));const p=h.target;((C=a.triggerRef.current)==null?void 0:C.contains(p))&&h.preventDefault(),h.detail.originalEvent.type==="focusin"&&f.current&&h.preventDefault()}})}),_f=m.forwardRef((s,u)=>{const{__scopeDialog:a,trapFocus:c,onOpenAutoFocus:f,onCloseAutoFocus:h,...p}=s,g=Pt(Nn,a);return bg(),n.jsx(n.Fragment,{children:n.jsx(uf,{asChild:!0,loop:!0,trapped:c,onMountAutoFocus:f,onUnmountAutoFocus:h,children:n.jsx(lf,{role:"dialog",id:g.contentId,"aria-describedby":g.descriptionId,"aria-labelledby":g.titleId,"data-state":ki(g.open),...p,ref:u,deferPointerDownOutside:!0,onDismiss:()=>g.onOpenChange(!1)})})})}),Pf="DialogTitle",mx=m.forwardRef((s,u)=>{const{__scopeDialog:a,...c}=s,f=Pt(Pf,a);return n.jsx(qe.h2,{id:f.titleId,...c,ref:u})});mx.displayName=Pf;var Mf="DialogDescription",hx=m.forwardRef((s,u)=>{const{__scopeDialog:a,...c}=s,f=Pt(Mf,a);return n.jsx(qe.p,{id:f.descriptionId,...c,ref:u})});hx.displayName=Mf;var Rf="DialogClose",gx=m.forwardRef((s,u)=>{const{__scopeDialog:a,...c}=s,f=Pt(Rf,a);return n.jsx(qe.button,{type:"button",...c,ref:u,onClick:xr(s.onClick,()=>f.onOpenChange(!1))})});gx.displayName=Rf;function ki(s){return s?"open":"closed"}var po='[cmdk-group=""]',ti='[cmdk-group-items=""]',xx='[cmdk-group-heading=""]',zf='[cmdk-item=""]',$d=`${zf}:not([aria-disabled="true"])`,di="cmdk-item-select",gn="data-value",vx=(s,u,a)=>Lh(s,u,a),Lf=m.createContext(void 0),yo=()=>m.useContext(Lf),Of=m.createContext(void 0),ji=()=>m.useContext(Of),Df=m.createContext(void 0),Af=m.forwardRef((s,u)=>{let a=xn(()=>{var x,A;return{search:"",value:(A=(x=s.value)!=null?x:s.defaultValue)!=null?A:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),c=xn(()=>new Set),f=xn(()=>new Map),h=xn(()=>new Map),p=xn(()=>new Set),g=Tf(s),{label:N,children:C,value:j,onValueChange:_,filter:P,shouldFilter:L,loop:O,disablePointerSelection:k=!1,vimBindings:R=!0,...D}=s,M=Kt(),F=Kt(),G=Kt(),Y=m.useRef(null),Q=Px();Ar(()=>{if(j!==void 0){let x=j.trim();a.current.value=x,ee.emit()}},[j]),Ar(()=>{Q(6,ke)},[]);let ee=m.useMemo(()=>({subscribe:x=>(p.current.add(x),()=>p.current.delete(x)),snapshot:()=>a.current,setState:(x,A,V)=>{var B,q,X,de;if(!Object.is(a.current[x],A)){if(a.current[x]=A,x==="search")ue(),T(),Q(1,ae);else if(x==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let he=document.getElementById(G);he?he.focus():(B=document.getElementById(M))==null||B.focus()}if(Q(7,()=>{var he;a.current.selectedItemId=(he=ye())==null?void 0:he.id,ee.emit()}),V||Q(5,ke),((q=g.current)==null?void 0:q.value)!==void 0){let he=A??"";(de=(X=g.current).onValueChange)==null||de.call(X,he);return}}ee.emit()}},emit:()=>{p.current.forEach(x=>x())}}),[]),ve=m.useMemo(()=>({value:(x,A,V)=>{var B;A!==((B=h.current.get(x))==null?void 0:B.value)&&(h.current.set(x,{value:A,keywords:V}),a.current.filtered.items.set(x,se(A,V)),Q(2,()=>{T(),ee.emit()}))},item:(x,A)=>(c.current.add(x),A&&(f.current.has(A)?f.current.get(A).add(x):f.current.set(A,new Set([x]))),Q(3,()=>{ue(),T(),a.current.value||ae(),ee.emit()}),()=>{h.current.delete(x),c.current.delete(x),a.current.filtered.items.delete(x);let V=ye();Q(4,()=>{ue(),(V==null?void 0:V.getAttribute("id"))===x&&ae(),ee.emit()})}),group:x=>(f.current.has(x)||f.current.set(x,new Set),()=>{h.current.delete(x),f.current.delete(x)}),filter:()=>g.current.shouldFilter,label:N||s["aria-label"],getDisablePointerSelection:()=>g.current.disablePointerSelection,listId:M,inputId:G,labelId:F,listInnerRef:Y}),[]);function se(x,A){var V,B;let q=(B=(V=g.current)==null?void 0:V.filter)!=null?B:vx;return x?q(x,a.current.search,A):0}function T(){if(!a.current.search||g.current.shouldFilter===!1)return;let x=a.current.filtered.items,A=[];a.current.filtered.groups.forEach(B=>{let q=f.current.get(B),X=0;q.forEach(de=>{let he=x.get(de);X=Math.max(he,X)}),A.push([B,X])});let V=Y.current;Se().sort((B,q)=>{var X,de;let he=B.getAttribute("id"),Fe=q.getAttribute("id");return((X=x.get(Fe))!=null?X:0)-((de=x.get(he))!=null?de:0)}).forEach(B=>{let q=B.closest(ti);q?q.appendChild(B.parentElement===q?B:B.closest(`${ti} > *`)):V.appendChild(B.parentElement===V?B:B.closest(`${ti} > *`))}),A.sort((B,q)=>q[1]-B[1]).forEach(B=>{var q;let X=(q=Y.current)==null?void 0:q.querySelector(`${po}[${gn}="${encodeURIComponent(B[0])}"]`);X==null||X.parentElement.appendChild(X)})}function ae(){let x=Se().find(V=>V.getAttribute("aria-disabled")!=="true"),A=x==null?void 0:x.getAttribute(gn);ee.setState("value",A||void 0)}function ue(){var x,A,V,B;if(!a.current.search||g.current.shouldFilter===!1){a.current.filtered.count=c.current.size;return}a.current.filtered.groups=new Set;let q=0;for(let X of c.current){let de=(A=(x=h.current.get(X))==null?void 0:x.value)!=null?A:"",he=(B=(V=h.current.get(X))==null?void 0:V.keywords)!=null?B:[],Fe=se(de,he);a.current.filtered.items.set(X,Fe),Fe>0&&q++}for(let[X,de]of f.current)for(let he of de)if(a.current.filtered.items.get(he)>0){a.current.filtered.groups.add(X);break}a.current.filtered.count=q}function ke(){var x,A,V;let B=ye();B&&(((x=B.parentElement)==null?void 0:x.firstChild)===B&&((V=(A=B.closest(po))==null?void 0:A.querySelector(xx))==null||V.scrollIntoView({block:"nearest"})),B.scrollIntoView({block:"nearest"}))}function ye(){var x;return(x=Y.current)==null?void 0:x.querySelector(`${zf}[aria-selected="true"]`)}function Se(){var x;return Array.from(((x=Y.current)==null?void 0:x.querySelectorAll($d))||[])}function Ee(x){let A=Se()[x];A&&ee.setState("value",A.getAttribute(gn))}function Ne(x){var A;let V=ye(),B=Se(),q=B.findIndex(de=>de===V),X=B[q+x];(A=g.current)!=null&&A.loop&&(X=q+x<0?B[B.length-1]:q+x===B.length?B[0]:B[q+x]),X&&ee.setState("value",X.getAttribute(gn))}function K(x){let A=ye(),V=A==null?void 0:A.closest(po),B;for(;V&&!B;)V=x>0?Ex(V,po):_x(V,po),B=V==null?void 0:V.querySelector($d);B?ee.setState("value",B.getAttribute(gn)):Ne(x)}let te=()=>Ee(Se().length-1),Z=x=>{x.preventDefault(),x.metaKey?te():x.altKey?K(1):Ne(1)},y=x=>{x.preventDefault(),x.metaKey?Ee(0):x.altKey?K(-1):Ne(-1)};return m.createElement(qe.div,{ref:u,tabIndex:-1,...D,"cmdk-root":"",onKeyDown:x=>{var A;(A=D.onKeyDown)==null||A.call(D,x);let V=x.nativeEvent.isComposing||x.keyCode===229;if(!(x.defaultPrevented||V))switch(x.key){case"n":case"j":{R&&x.ctrlKey&&Z(x);break}case"ArrowDown":{Z(x);break}case"p":case"k":{R&&x.ctrlKey&&y(x);break}case"ArrowUp":{y(x);break}case"Home":{x.preventDefault(),Ee(0);break}case"End":{x.preventDefault(),te();break}case"Enter":{x.preventDefault();let B=ye();if(B){let q=new Event(di);B.dispatchEvent(q)}}}}},m.createElement("label",{"cmdk-label":"",htmlFor:ve.inputId,id:ve.labelId,style:Rx},N),Xs(s,x=>m.createElement(Of.Provider,{value:ee},m.createElement(Lf.Provider,{value:ve},x))))}),yx=m.forwardRef((s,u)=>{var a,c;let f=Kt(),h=m.useRef(null),p=m.useContext(Df),g=yo(),N=Tf(s),C=(c=(a=N.current)==null?void 0:a.forceMount)!=null?c:p==null?void 0:p.forceMount;Ar(()=>{if(!C)return g.item(f,p==null?void 0:p.id)},[C]);let j=If(f,h,[s.value,s.children,h],s.keywords),_=ji(),P=vr(Q=>Q.value&&Q.value===j.current),L=vr(Q=>C||g.filter()===!1?!0:Q.search?Q.filtered.items.get(f)>0:!0);m.useEffect(()=>{let Q=h.current;if(!(!Q||s.disabled))return Q.addEventListener(di,O),()=>Q.removeEventListener(di,O)},[L,s.onSelect,s.disabled]);function O(){var Q,ee;k(),(ee=(Q=N.current).onSelect)==null||ee.call(Q,j.current)}function k(){_.setState("value",j.current,!0)}if(!L)return null;let{disabled:R,value:D,onSelect:M,forceMount:F,keywords:G,...Y}=s;return m.createElement(qe.div,{ref:jn(h,u),...Y,id:f,"cmdk-item":"",role:"option","aria-disabled":!!R,"aria-selected":!!P,"data-disabled":!!R,"data-selected":!!P,onPointerMove:R||g.getDisablePointerSelection()?void 0:k,onClick:R?void 0:O},s.children)}),bx=m.forwardRef((s,u)=>{let{heading:a,children:c,forceMount:f,...h}=s,p=Kt(),g=m.useRef(null),N=m.useRef(null),C=Kt(),j=yo(),_=vr(L=>f||j.filter()===!1?!0:L.search?L.filtered.groups.has(p):!0);Ar(()=>j.group(p),[]),If(p,g,[s.value,s.heading,N]);let P=m.useMemo(()=>({id:p,forceMount:f}),[f]);return m.createElement(qe.div,{ref:jn(g,u),...h,"cmdk-group":"",role:"presentation",hidden:_?void 0:!0},a&&m.createElement("div",{ref:N,"cmdk-group-heading":"","aria-hidden":!0,id:C},a),Xs(s,L=>m.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":a?C:void 0},m.createElement(Df.Provider,{value:P},L))))}),wx=m.forwardRef((s,u)=>{let{alwaysRender:a,...c}=s,f=m.useRef(null),h=vr(p=>!p.search);return!a&&!h?null:m.createElement(qe.div,{ref:jn(f,u),...c,"cmdk-separator":"",role:"separator"})}),kx=m.forwardRef((s,u)=>{let{onValueChange:a,...c}=s,f=s.value!=null,h=ji(),p=vr(C=>C.search),g=vr(C=>C.selectedItemId),N=yo();return m.useEffect(()=>{s.value!=null&&h.setState("search",s.value)},[s.value]),m.createElement(qe.input,{ref:u,...c,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":N.listId,"aria-labelledby":N.labelId,"aria-activedescendant":g,id:N.inputId,type:"text",value:f?s.value:p,onChange:C=>{f||h.setState("search",C.target.value),a==null||a(C.target.value)}})}),jx=m.forwardRef((s,u)=>{let{children:a,label:c="Suggestions",...f}=s,h=m.useRef(null),p=m.useRef(null),g=vr(C=>C.selectedItemId),N=yo();return m.useEffect(()=>{if(p.current&&h.current){let C=p.current,j=h.current,_,P=new ResizeObserver(()=>{_=requestAnimationFrame(()=>{let L=C.offsetHeight;j.style.setProperty("--cmdk-list-height",L.toFixed(1)+"px")})});return P.observe(C),()=>{cancelAnimationFrame(_),P.unobserve(C)}}},[]),m.createElement(qe.div,{ref:jn(h,u),...f,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":g,"aria-label":c,id:N.listId},Xs(s,C=>m.createElement("div",{ref:jn(p,N.listInnerRef),"cmdk-list-sizer":""},C)))}),Nx=m.forwardRef((s,u)=>{let{open:a,onOpenChange:c,overlayClassName:f,contentClassName:h,container:p,...g}=s;return m.createElement(kf,{open:a,onOpenChange:c},m.createElement(Sf,{container:p},m.createElement(Cf,{"cmdk-overlay":"",className:f}),m.createElement(Ef,{"aria-label":s.label,"cmdk-dialog":"",className:h},m.createElement(Af,{ref:u,...g}))))}),Sx=m.forwardRef((s,u)=>vr(a=>a.filtered.count===0)?m.createElement(qe.div,{ref:u,...s,"cmdk-empty":"",role:"presentation"}):null),Cx=m.forwardRef((s,u)=>{let{progress:a,children:c,label:f="Loading...",...h}=s;return m.createElement(qe.div,{ref:u,...h,"cmdk-loading":"",role:"progressbar","aria-valuenow":a,"aria-valuemin":0,"aria-valuemax":100,"aria-label":f},Xs(s,p=>m.createElement("div",{"aria-hidden":!0},p)))}),pn=Object.assign(Af,{List:jx,Item:yx,Input:kx,Group:bx,Separator:wx,Dialog:Nx,Empty:Sx,Loading:Cx});function Ex(s,u){let a=s.nextElementSibling;for(;a;){if(a.matches(u))return a;a=a.nextElementSibling}}function _x(s,u){let a=s.previousElementSibling;for(;a;){if(a.matches(u))return a;a=a.previousElementSibling}}function Tf(s){let u=m.useRef(s);return Ar(()=>{u.current=s}),u}var Ar=typeof window>"u"?m.useEffect:m.useLayoutEffect;function xn(s){let u=m.useRef();return u.current===void 0&&(u.current=s()),u}function vr(s){let u=ji(),a=()=>s(u.snapshot());return m.useSyncExternalStore(u.subscribe,a,a)}function If(s,u,a,c=[]){let f=m.useRef(),h=yo();return Ar(()=>{var p;let g=(()=>{var C;for(let j of a){if(typeof j=="string")return j.trim();if(typeof j=="object"&&"current"in j)return j.current?(C=j.current.textContent)==null?void 0:C.trim():f.current}})(),N=c.map(C=>C.trim());h.value(s,g,N),(p=u.current)==null||p.setAttribute(gn,g),f.current=g}),f}var Px=()=>{let[s,u]=m.useState(),a=xn(()=>new Map);return Ar(()=>{a.current.forEach(c=>c()),a.current=new Map},[s]),(c,f)=>{a.current.set(c,f),u({})}};function Mx(s){let u=s.type;return typeof u=="function"?u(s.props):"render"in u?u.render(s.props):s}function Xs({asChild:s,children:u},a){return s&&m.isValidElement(u)?m.cloneElement(Mx(u),{ref:u.ref},a(u.props.children)):a(u)}var Rx={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function zx({onNavigate:s}){const[u,a]=m.useState(!1);return m.useEffect(()=>{const c=f=>{(f.metaKey||f.ctrlKey)&&f.key.toLowerCase()==="k"&&(f.preventDefault(),a(h=>!h))};return document.addEventListener("keydown",c),()=>document.removeEventListener("keydown",c)},[]),n.jsx(pn.Dialog,{open:u,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(pn.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(pn.List,{className:"max-h-80 overflow-y-auto p-2",children:[n.jsx(pn.Empty,{className:"px-3 py-6 text-center text-sm text-muted-foreground",children:"Nichts gefunden."}),n.jsx(pn.Group,{heading:"Bereiche",className:"px-1 py-1 text-xs text-muted-foreground",children:ai.map(c=>n.jsxs(pn.Item,{value:`${c.label} ${c.hint}`,onSelect:()=>{s(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 ce(s,u){const a=await fetch(s,{headers:{"Content-Type":"application/json"},...u});if(!a.ok)throw new Error(`${a.status} ${a.statusText}`);return a.json()}function Ff(s){var u,a,c="";if(typeof s=="string"||typeof s=="number")c+=s;else if(typeof s=="object")if(Array.isArray(s)){var f=s.length;for(u=0;u{const u=Ax(s),{conflictingClassGroups:a,conflictingClassGroupModifiers:c}=s;return{getClassGroupId:p=>{const g=p.split(Ni);return g[0]===""&&g.length!==1&&g.shift(),$f(g,u)||Dx(p)},getConflictingClassGroupIds:(p,g)=>{const N=a[p]||[];return g&&c[p]?[...N,...c[p]]:N}}},$f=(s,u)=>{var p;if(s.length===0)return u.classGroupId;const a=s[0],c=u.nextPart.get(a),f=c?$f(s.slice(1),c):void 0;if(f)return f;if(u.validators.length===0)return;const h=s.join(Ni);return(p=u.validators.find(({validator:g})=>g(h)))==null?void 0:p.classGroupId},Ud=/^\[(.+)\]$/,Dx=s=>{if(Ud.test(s)){const u=Ud.exec(s)[1],a=u==null?void 0:u.substring(0,u.indexOf(":"));if(a)return"arbitrary.."+a}},Ax=s=>{const{theme:u,prefix:a}=s,c={nextPart:new Map,validators:[]};return Ix(Object.entries(s.classGroups),a).forEach(([h,p])=>{fi(p,c,h,u)}),c},fi=(s,u,a,c)=>{s.forEach(f=>{if(typeof f=="string"){const h=f===""?u:Bd(u,f);h.classGroupId=a;return}if(typeof f=="function"){if(Tx(f)){fi(f(c),u,a,c);return}u.validators.push({validator:f,classGroupId:a});return}Object.entries(f).forEach(([h,p])=>{fi(p,Bd(u,h),a,c)})})},Bd=(s,u)=>{let a=s;return u.split(Ni).forEach(c=>{a.nextPart.has(c)||a.nextPart.set(c,{nextPart:new Map,validators:[]}),a=a.nextPart.get(c)}),a},Tx=s=>s.isThemeGetter,Ix=(s,u)=>u?s.map(([a,c])=>{const f=c.map(h=>typeof h=="string"?u+h:typeof h=="object"?Object.fromEntries(Object.entries(h).map(([p,g])=>[u+p,g])):h);return[a,f]}):s,Fx=s=>{if(s<1)return{get:()=>{},set:()=>{}};let u=0,a=new Map,c=new Map;const f=(h,p)=>{a.set(h,p),u++,u>s&&(u=0,c=a,a=new Map)};return{get(h){let p=a.get(h);if(p!==void 0)return p;if((p=c.get(h))!==void 0)return f(h,p),p},set(h,p){a.has(h)?a.set(h,p):f(h,p)}}},Uf="!",$x=s=>{const{separator:u,experimentalParseClassName:a}=s,c=u.length===1,f=u[0],h=u.length,p=g=>{const N=[];let C=0,j=0,_;for(let R=0;Rj?_-j:void 0;return{modifiers:N,hasImportantModifier:L,baseClassName:O,maybePostfixModifierPosition:k}};return a?g=>a({className:g,parseClassName:p}):p},Ux=s=>{if(s.length<=1)return s;const u=[];let a=[];return s.forEach(c=>{c[0]==="["?(u.push(...a.sort(),c),a=[]):a.push(c)}),u.push(...a.sort()),u},Bx=s=>({cache:Fx(s.cacheSize),parseClassName:$x(s),...Ox(s)}),Wx=/\s+/,Vx=(s,u)=>{const{parseClassName:a,getClassGroupId:c,getConflictingClassGroupIds:f}=u,h=[],p=s.trim().split(Wx);let g="";for(let N=p.length-1;N>=0;N-=1){const C=p[N],{modifiers:j,hasImportantModifier:_,baseClassName:P,maybePostfixModifierPosition:L}=a(C);let O=!!L,k=c(O?P.substring(0,L):P);if(!k){if(!O){g=C+(g.length>0?" "+g:g);continue}if(k=c(P),!k){g=C+(g.length>0?" "+g:g);continue}O=!1}const R=Ux(j).join(":"),D=_?R+Uf:R,M=D+k;if(h.includes(M))continue;h.push(M);const F=f(k,O);for(let G=0;G0?" "+g:g)}return g};function Hx(){let s=0,u,a,c="";for(;s{if(typeof s=="string")return s;let u,a="";for(let c=0;c_(j),s());return a=Bx(C),c=a.cache.get,f=a.cache.set,h=g,g(N)}function g(N){const C=c(N);if(C)return C;const j=Vx(N,a);return f(N,j),j}return function(){return h(Hx.apply(null,arguments))}}const Le=s=>{const u=a=>a[s]||[];return u.isThemeGetter=!0,u},Wf=/^\[(?:([a-z-]+):)?(.+)\]$/i,Kx=/^\d+\/\d+$/,Qx=new Set(["px","full","screen"]),Yx=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Zx=/\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$/,qx=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Xx=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Jx=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Gt=s=>yn(s)||Qx.has(s)||Kx.test(s),pr=s=>Sn(s,"length",a0),yn=s=>!!s&&!Number.isNaN(Number(s)),ri=s=>Sn(s,"number",yn),mo=s=>!!s&&Number.isInteger(Number(s)),e0=s=>s.endsWith("%")&&yn(s.slice(0,-1)),be=s=>Wf.test(s),mr=s=>Yx.test(s),t0=new Set(["length","size","percentage"]),r0=s=>Sn(s,t0,Vf),n0=s=>Sn(s,"position",Vf),o0=new Set(["image","url"]),s0=s=>Sn(s,o0,u0),l0=s=>Sn(s,"",i0),ho=()=>!0,Sn=(s,u,a)=>{const c=Wf.exec(s);return c?c[1]?typeof u=="string"?c[1]===u:u.has(c[1]):a(c[2]):!1},a0=s=>Zx.test(s)&&!qx.test(s),Vf=()=>!1,i0=s=>Xx.test(s),u0=s=>Jx.test(s),c0=()=>{const s=Le("colors"),u=Le("spacing"),a=Le("blur"),c=Le("brightness"),f=Le("borderColor"),h=Le("borderRadius"),p=Le("borderSpacing"),g=Le("borderWidth"),N=Le("contrast"),C=Le("grayscale"),j=Le("hueRotate"),_=Le("invert"),P=Le("gap"),L=Le("gradientColorStops"),O=Le("gradientColorStopPositions"),k=Le("inset"),R=Le("margin"),D=Le("opacity"),M=Le("padding"),F=Le("saturate"),G=Le("scale"),Y=Le("sepia"),Q=Le("skew"),ee=Le("space"),ve=Le("translate"),se=()=>["auto","contain","none"],T=()=>["auto","hidden","clip","visible","scroll"],ae=()=>["auto",be,u],ue=()=>[be,u],ke=()=>["",Gt,pr],ye=()=>["auto",yn,be],Se=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Ee=()=>["solid","dashed","dotted","double","none"],Ne=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],K=()=>["start","end","center","between","around","evenly","stretch"],te=()=>["","0",be],Z=()=>["auto","avoid","all","avoid-page","page","left","right","column"],y=()=>[yn,be];return{cacheSize:500,separator:":",theme:{colors:[ho],spacing:[Gt,pr],blur:["none","",mr,be],brightness:y(),borderColor:[s],borderRadius:["none","","full",mr,be],borderSpacing:ue(),borderWidth:ke(),contrast:y(),grayscale:te(),hueRotate:y(),invert:te(),gap:ue(),gradientColorStops:[s],gradientColorStopPositions:[e0,pr],inset:ae(),margin:ae(),opacity:y(),padding:ue(),saturate:y(),scale:y(),sepia:te(),skew:y(),space:ue(),translate:ue()},classGroups:{aspect:[{aspect:["auto","square","video",be]}],container:["container"],columns:[{columns:[mr]}],"break-after":[{"break-after":Z()}],"break-before":[{"break-before":Z()}],"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:[...Se(),be]}],overflow:[{overflow:T()}],"overflow-x":[{"overflow-x":T()}],"overflow-y":[{"overflow-y":T()}],overscroll:[{overscroll:se()}],"overscroll-x":[{"overscroll-x":se()}],"overscroll-y":[{"overscroll-y":se()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[k]}],"inset-x":[{"inset-x":[k]}],"inset-y":[{"inset-y":[k]}],start:[{start:[k]}],end:[{end:[k]}],top:[{top:[k]}],right:[{right:[k]}],bottom:[{bottom:[k]}],left:[{left:[k]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",mo,be]}],basis:[{basis:ae()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",be]}],grow:[{grow:te()}],shrink:[{shrink:te()}],order:[{order:["first","last","none",mo,be]}],"grid-cols":[{"grid-cols":[ho]}],"col-start-end":[{col:["auto",{span:["full",mo,be]},be]}],"col-start":[{"col-start":ye()}],"col-end":[{"col-end":ye()}],"grid-rows":[{"grid-rows":[ho]}],"row-start-end":[{row:["auto",{span:[mo,be]},be]}],"row-start":[{"row-start":ye()}],"row-end":[{"row-end":ye()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",be]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",be]}],gap:[{gap:[P]}],"gap-x":[{"gap-x":[P]}],"gap-y":[{"gap-y":[P]}],"justify-content":[{justify:["normal",...K()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...K(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...K(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[M]}],px:[{px:[M]}],py:[{py:[M]}],ps:[{ps:[M]}],pe:[{pe:[M]}],pt:[{pt:[M]}],pr:[{pr:[M]}],pb:[{pb:[M]}],pl:[{pl:[M]}],m:[{m:[R]}],mx:[{mx:[R]}],my:[{my:[R]}],ms:[{ms:[R]}],me:[{me:[R]}],mt:[{mt:[R]}],mr:[{mr:[R]}],mb:[{mb:[R]}],ml:[{ml:[R]}],"space-x":[{"space-x":[ee]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[ee]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",be,u]}],"min-w":[{"min-w":[be,u,"min","max","fit"]}],"max-w":[{"max-w":[be,u,"none","full","min","max","fit","prose",{screen:[mr]},mr]}],h:[{h:[be,u,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[be,u,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[be,u,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[be,u,"auto","min","max","fit"]}],"font-size":[{text:["base",mr,pr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",ri]}],"font-family":[{font:[ho]}],"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",be]}],"line-clamp":[{"line-clamp":["none",yn,ri]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Gt,be]}],"list-image":[{"list-image":["none",be]}],"list-style-type":[{list:["none","disc","decimal",be]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[s]}],"placeholder-opacity":[{"placeholder-opacity":[D]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[s]}],"text-opacity":[{"text-opacity":[D]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Ee(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Gt,pr]}],"underline-offset":[{"underline-offset":["auto",Gt,be]}],"text-decoration-color":[{decoration:[s]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:ue()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",be]}],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",be]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[D]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...Se(),n0]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",r0]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},s0]}],"bg-color":[{bg:[s]}],"gradient-from-pos":[{from:[O]}],"gradient-via-pos":[{via:[O]}],"gradient-to-pos":[{to:[O]}],"gradient-from":[{from:[L]}],"gradient-via":[{via:[L]}],"gradient-to":[{to:[L]}],rounded:[{rounded:[h]}],"rounded-s":[{"rounded-s":[h]}],"rounded-e":[{"rounded-e":[h]}],"rounded-t":[{"rounded-t":[h]}],"rounded-r":[{"rounded-r":[h]}],"rounded-b":[{"rounded-b":[h]}],"rounded-l":[{"rounded-l":[h]}],"rounded-ss":[{"rounded-ss":[h]}],"rounded-se":[{"rounded-se":[h]}],"rounded-ee":[{"rounded-ee":[h]}],"rounded-es":[{"rounded-es":[h]}],"rounded-tl":[{"rounded-tl":[h]}],"rounded-tr":[{"rounded-tr":[h]}],"rounded-br":[{"rounded-br":[h]}],"rounded-bl":[{"rounded-bl":[h]}],"border-w":[{border:[g]}],"border-w-x":[{"border-x":[g]}],"border-w-y":[{"border-y":[g]}],"border-w-s":[{"border-s":[g]}],"border-w-e":[{"border-e":[g]}],"border-w-t":[{"border-t":[g]}],"border-w-r":[{"border-r":[g]}],"border-w-b":[{"border-b":[g]}],"border-w-l":[{"border-l":[g]}],"border-opacity":[{"border-opacity":[D]}],"border-style":[{border:[...Ee(),"hidden"]}],"divide-x":[{"divide-x":[g]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[g]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[D]}],"divide-style":[{divide:Ee()}],"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:["",...Ee()]}],"outline-offset":[{"outline-offset":[Gt,be]}],"outline-w":[{outline:[Gt,pr]}],"outline-color":[{outline:[s]}],"ring-w":[{ring:ke()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[s]}],"ring-opacity":[{"ring-opacity":[D]}],"ring-offset-w":[{"ring-offset":[Gt,pr]}],"ring-offset-color":[{"ring-offset":[s]}],shadow:[{shadow:["","inner","none",mr,l0]}],"shadow-color":[{shadow:[ho]}],opacity:[{opacity:[D]}],"mix-blend":[{"mix-blend":[...Ne(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Ne()}],filter:[{filter:["","none"]}],blur:[{blur:[a]}],brightness:[{brightness:[c]}],contrast:[{contrast:[N]}],"drop-shadow":[{"drop-shadow":["","none",mr,be]}],grayscale:[{grayscale:[C]}],"hue-rotate":[{"hue-rotate":[j]}],invert:[{invert:[_]}],saturate:[{saturate:[F]}],sepia:[{sepia:[Y]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[a]}],"backdrop-brightness":[{"backdrop-brightness":[c]}],"backdrop-contrast":[{"backdrop-contrast":[N]}],"backdrop-grayscale":[{"backdrop-grayscale":[C]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[j]}],"backdrop-invert":[{"backdrop-invert":[_]}],"backdrop-opacity":[{"backdrop-opacity":[D]}],"backdrop-saturate":[{"backdrop-saturate":[F]}],"backdrop-sepia":[{"backdrop-sepia":[Y]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[p]}],"border-spacing-x":[{"border-spacing-x":[p]}],"border-spacing-y":[{"border-spacing-y":[p]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",be]}],duration:[{duration:y()}],ease:[{ease:["linear","in","out","in-out",be]}],delay:[{delay:y()}],animate:[{animate:["none","spin","ping","pulse","bounce",be]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[G]}],"scale-x":[{"scale-x":[G]}],"scale-y":[{"scale-y":[G]}],rotate:[{rotate:[mo,be]}],"translate-x":[{"translate-x":[ve]}],"translate-y":[{"translate-y":[ve]}],"skew-x":[{"skew-x":[Q]}],"skew-y":[{"skew-y":[Q]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",be]}],accent:[{accent:["auto",s]}],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",be]}],"caret-color":[{caret:[s]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":ue()}],"scroll-mx":[{"scroll-mx":ue()}],"scroll-my":[{"scroll-my":ue()}],"scroll-ms":[{"scroll-ms":ue()}],"scroll-me":[{"scroll-me":ue()}],"scroll-mt":[{"scroll-mt":ue()}],"scroll-mr":[{"scroll-mr":ue()}],"scroll-mb":[{"scroll-mb":ue()}],"scroll-ml":[{"scroll-ml":ue()}],"scroll-p":[{"scroll-p":ue()}],"scroll-px":[{"scroll-px":ue()}],"scroll-py":[{"scroll-py":ue()}],"scroll-ps":[{"scroll-ps":ue()}],"scroll-pe":[{"scroll-pe":ue()}],"scroll-pt":[{"scroll-pt":ue()}],"scroll-pr":[{"scroll-pr":ue()}],"scroll-pb":[{"scroll-pb":ue()}],"scroll-pl":[{"scroll-pl":ue()}],"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",be]}],fill:[{fill:[s,"none"]}],"stroke-w":[{stroke:[Gt,pr,ri]}],stroke:[{stroke:[s,"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"]}}},d0=Gx(c0);function ie(...s){return d0(Lx(s))}function Hs(s){return s?s.replace(/127\.0\.0\.1|localhost/g,"192.168.178.151"):""}function mn(s){return(s/1024**3).toFixed(1)}function Ts({value:s,label:u,detail:a}){const f=2*Math.PI*24,h=f-Math.min(s,100)/100*f,p=s>90?"stroke-red-500":s>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:ie("fill-none transition-all duration-700 ease-out",p),strokeWidth:"4.5",strokeDasharray:f,strokeDashoffset:h,strokeLinecap:"round"})]}),n.jsxs("span",{className:"text-xs font-mono font-bold tracking-tight text-foreground",children:[Math.round(s),"%"]})]}),n.jsx("span",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wider",children:u}),a&&n.jsx("span",{className:"text-[10px] font-mono text-muted-foreground/80",children:a})]})}function f0(){const[s,u]=m.useState(null),[a,c]=m.useState(null),[f,h]=m.useState([]),[p,g]=m.useState([]),[N,C]=m.useState([]),[j,_]=m.useState(null),[P,L]=m.useState([]),[O,k]=m.useState(""),[R,D]=m.useState(!1),[M,F]=m.useState(""),[G,Y]=m.useState(!1),[Q,ee]=m.useState({open:!1,actionPath:"",actionLabel:""}),[ve,se]=m.useState(""),[T,ae]=m.useState("stable"),[ue,ke]=m.useState(!1);function ye(){ce("/api/system/status").then(u).catch(()=>{}),ce("/api/agent/status").then(c).catch(()=>{}),ce("/api/models").then(x=>{h(x.models||[]),g(x.running||[])}).catch(()=>{}),ce("/api/memory?category=").then(x=>C(x.slice(0,3))).catch(()=>{}),ce("/api/maintenance/updates").then(_).catch(()=>{}),ce("/api/jobs").then(x=>L(x.jobs||[])).catch(()=>{})}m.useEffect(()=>{ye();const x=setInterval(ye,3e3);return()=>clearInterval(x)},[]);async function Se(x,A,V,B){k(`${A} wird ausgeführt...`),D(!0);try{const q={...V},X=await ce(x,{method:"POST",body:JSON.stringify(q)});if(X.status==="password_required"||X.status==="incorrect_password"){ee({open:!0,actionPath:x,actionLabel:A,payload:V,error:X.status==="incorrect_password"?"Falsches Sudo-Passwort. Bitte erneut versuchen.":void 0}),k("");return}X.job_id?k(`${A} gestartet (Job-ID: ${X.job_id})`):X.ok?k(`${A} erfolgreich ausgeführt.`):k(`Fehler: ${X.err||"Unbekannter Fehler"}`),ye()}catch(q){k(`Fehler bei ${A}: ${q.message}`)}finally{D(!1)}}async function Ee(){Y(!0);try{const x={...Q.payload,sudo_password:M},A=await ce(Q.actionPath,{method:"POST",body:JSON.stringify(x)});if(A.status==="password_required"||A.status==="incorrect_password"){ee(V=>({...V,error:"Falsches Sudo-Passwort. Bitte erneut versuchen."}));return}A.job_id?k(`${Q.actionLabel} gestartet (Job-ID: ${A.job_id})`):A.ok?k(`${Q.actionLabel} erfolgreich ausgeführt.`):k(`Fehler: ${A.err||"Unbekannter Fehler"}`),ee({open:!1,actionPath:"",actionLabel:""}),F(""),ye()}catch(x){k(`Fehler: ${x.message}`),ee({open:!1,actionPath:"",actionLabel:""}),F("")}finally{Y(!1)}}async function Ne(x,A){k(`Upgrade für ${x} wird gestartet...`);try{await ce("/api/models/install",{method:"POST",body:JSON.stringify({repo:x,role:A,quant:"Q4_K_M",jinja:!0})}),k("Upgrade-Download gestartet."),ye()}catch(V){k(`Upgrade fehlgeschlagen: ${V.message}`)}}async function K(){if(!(!ve.trim()||ue)){ke(!0);try{await ce("/api/memory",{method:"POST",body:JSON.stringify({content:ve,category:T,source:"dashboard"})}),se(""),ce("/api/memory?category=").then(x=>C(x.slice(0,3))).catch(()=>{})}catch(x){console.error(x)}finally{ke(!1)}}}const te=f.filter(x=>x.role),Z=P.find(x=>x.label.includes("OS-Update")&&(x.state==="running"||x.state==="queued")),y=P.find(x=>x.label.includes("Engine-Update")&&(x.state==="running"||x.state==="queued"));return n.jsxs("div",{className:"space-y-6",children:[Q.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:()=>{ee({open:!1,actionPath:"",actionLabel:""}),F("")},className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground cursor-pointer",children:n.jsx(Qs,{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:Q.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:M,onChange:x=>F(x.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:x=>x.key==="Enter"&&Ee(),autoFocus:!0}),Q.error&&n.jsx("div",{className:"text-[10px] font-semibold text-red-400",children:Q.error})]}),n.jsxs("div",{className:"flex gap-2 justify-end",children:[n.jsx("button",{onClick:()=>{ee({open:!1,actionPath:"",actionLabel:""}),F("")},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:Ee,disabled:!M||G,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:G?"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(Dr,{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"})]}),s?n.jsxs("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-4",children:[n.jsx(Ts,{value:s.cpu.percent,label:"CPU",detail:s.cpu.cores?`${s.cpu.cores} Cores`:void 0}),n.jsx(Ts,{value:s.ram.percent,label:"RAM",detail:`${mn(s.ram.used)} / ${mn(s.ram.total)} GB`}),s.gpu&&s.gpu.busy_percent!=null&&s.gpu.gtt_used!=null&&s.gpu.gtt_total!=null&&n.jsx(Ts,{value:s.gpu.busy_percent,label:"GPU",detail:`${mn(s.gpu.gtt_used)} / ${mn(s.gpu.gtt_total)} GB`}),s.disk&&n.jsx(Ts,{value:s.disk.percent,label:"Disk",detail:`${mn(s.disk.used)} / ${mn(s.disk.total)} GB`})]}):n.jsx("div",{className:"h-28 flex items-center justify-center text-xs text-muted-foreground",children:"Lade Systemdaten…"})]}),(s==null?void 0:s.temp)&&(s.temp.cpu||s.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:[s.temp.cpu!=null&&n.jsxs("span",{children:["CPU Temp: ",s.temp.cpu," °C"]}),s.temp.gpu!=null&&n.jsxs("span",{children:["GPU Temp: ",s.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(bh,{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"})]}),(j==null?void 0:j.last_check)&&n.jsxs("span",{className:"text-[9px] text-muted-foreground/80 font-mono",children:["Zuletzt gesucht: ",new Date(j.last_check*1e3).toLocaleString("de-DE",{day:"2-digit",month:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit"})]})]}),j?n.jsxs("div",{className:"space-y-3",children:[n.jsxs("div",{className:"space-y-1.5",children:[n.jsxs("div",{className:ie("flex items-center justify-between px-3 py-1.5 rounded-lg border text-xs",j.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:j.os>0?`${j.os} verfügbar`:"aktuell"})]}),n.jsxs("div",{className:ie("flex items-center justify-between px-3 py-1.5 rounded-lg border text-xs",j.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:j.engine>0?"Update verfügbar":"aktuell"})]}),n.jsxs("div",{className:ie("flex items-center justify-between px-3 py-1.5 rounded-lg border text-xs",j.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:j.models>0?`${j.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:()=>Se("/api/maintenance/os-update","OS-Update"),disabled:R||!!Z,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:Z?n.jsxs(n.Fragment,{children:[n.jsx(kn,{className:"h-3 w-3 animate-spin text-primary"}),n.jsxs("span",{children:["Aktiv (",Z.progress??0,"%)"]})]}):n.jsx("span",{children:"OS Update"})}),n.jsx("button",{onClick:()=>Se("/api/maintenance/engine-update","Engine-Update"),disabled:R||!!y,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:y?n.jsxs(n.Fragment,{children:[n.jsx(kn,{className:"h-3 w-3 animate-spin text-primary"}),n.jsxs("span",{children:["Aktiv (",y.progress??0,"%)"]})]}):n.jsx("span",{children:"Engine Update"})})]}),n.jsxs("button",{onClick:()=>{confirm("Bist du sicher, dass du das Host-System neu starten willst?")&&Se("/api/maintenance/reboot","Reboot")},disabled:R,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(tf,{className:"h-3.5 w-3.5"}),n.jsx("span",{children:"Host Reboot"})]}),j.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:j.model_list.map(x=>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:`${x.role}: ${x.repo}`,children:[n.jsx("span",{className:"text-primary font-bold uppercase",children:x.role}),": ",x.repo.split("/").pop()]}),n.jsxs("button",{onClick:()=>Ne(x.repo,x.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(wn,{className:"h-2.5 w-2.5"})," Laden"]})]},x.repo))})]})]}):n.jsx("div",{className:"h-24 flex items-center justify-center text-xs text-muted-foreground",children:"Lade Updates..."}),O&&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:O}),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(go,{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-3",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(Gs,{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:Hs(a.webui_url),target:"_blank",rel:"noopener",className:ie("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(Bs,{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:ie("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:ie("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",{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:"Aktives Gehirn"}),n.jsxs("div",{className:"text-xs font-medium mt-1 font-mono text-primary flex items-center gap-1.5",children:[n.jsx(Ws,{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(Ws,{className:"h-4.5 w-4.5 text-primary"}),n.jsx("h2",{className:"text-sm font-semibold tracking-wide uppercase text-foreground",children:"Aktive Rollen"})]}),n.jsx("div",{className:"space-y-2 max-h-48 overflow-y-auto pr-1 scrollbar-thin",children:te.length===0?n.jsx("div",{className:"text-xs text-muted-foreground py-6 text-center",children:"Keine Modelle als Rollen zugewiesen."}):te.map(x=>{const A=p.includes(x.name);return n.jsxs("div",{className:ie("flex items-center justify-between p-2.5 rounded-xl border transition-all duration-300",A?"border-primary/50 bg-primary/5 shadow-md shadow-primary/5":"border-border/40 bg-background/20"),children:[n.jsxs("div",{className:"min-w-0 flex-1 mr-2",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:ie("text-[9px] font-semibold uppercase px-1.5 py-0.5 rounded font-mono",x.role==="fast"?"bg-cyan-500/15 text-cyan-400":x.role==="heavy"?"bg-amber-500/15 text-amber-400":x.role==="coder"?"bg-violet-500/15 text-violet-400":x.role==="vision"?"bg-pink-500/15 text-pink-400":"bg-muted text-muted-foreground"),children:x.role}),A&&n.jsxs("span",{className:"flex h-2 w-2 relative",children:[n.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-emerald-400 opacity-75"}),n.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-emerald-500"})]})]}),n.jsx("div",{className:"text-[10px] font-medium mt-1 truncate",title:x.name,children:x.name})]}),n.jsx("div",{className:"text-[9px] font-mono text-muted-foreground shrink-0",children:A?"Warm":"Bereit"})]},x.name)})})]}),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(Ks,{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:ve,onChange:x=>se(x.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:T,onChange:x=>ae(x.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:K,disabled:!ve.trim()||ue,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(ef,{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:N.length===0?n.jsx("div",{className:"text-[10px] text-muted-foreground/75 py-1",children:"Keine Einträge vorhanden."}):N.map(x=>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:x.category}),n.jsx("span",{className:"truncate flex-1 text-muted-foreground hover:text-foreground transition-colors",title:x.content,children:x.content})]},x.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."})]})]})]})}function Or({children:s,tone:u="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[u]}`,children:s})}function Wd({caps:s}){return s?n.jsxs("span",{className:"inline-flex flex-wrap gap-1",children:[s.coder&&n.jsx(Or,{children:"💻 Code"}),s.vision&&n.jsx(Or,{children:"👁 Bild"}),s.reasoning&&n.jsx(Or,{children:"🧠 Reason"}),s.moe&&n.jsxs(Or,{tone:"primary",children:["🧩 MoE",s.active_b?`·${s.active_b}b`:""]}),s.tools==="yes"&&n.jsx(Or,{tone:"primary",children:"🛠 Tools"}),s.tools==="likely"&&n.jsx(Or,{tone:"warn",children:"🛠 Tools?"}),s.embedding&&n.jsx(Or,{children:"🔢 Embed"})]}):null}function pi(s){return s?s>1024**3?`${(s/1024**3).toFixed(1)} GB`:`${(s/1024**2).toFixed(0)} MB`:""}function p0(s){if(!s)return"";const u=Math.floor(s/60);return u>0?`${u} min`:`${s} s`}function m0(){const[s,u]=m.useState([]);function a(){ce("/api/jobs").then(p=>u(p.jobs||[])).catch(()=>{})}m.useEffect(()=>{a();const p=setInterval(a,2e3);return()=>clearInterval(p)},[]);async function c(p){try{await ce(`/api/jobs/${p}/cancel`,{method:"POST"}),a()}catch(g){alert(`Fehler: ${g.message}`)}}const f=s.filter(p=>p.state==="running"||p.state==="queued"),h=s.filter(p=>p.state!=="running"&&p.state!=="queued").slice(-3);return f.length===0&&h.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"}),f.map(p=>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:p.label}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsxs("span",{className:"text-muted-foreground font-mono",children:[p.progress??0,"% • ",pi(p.done_bytes),"/",pi(p.total_bytes),p.eta_s?` • ETA ${p0(p.eta_s)}`:""]}),n.jsx("button",{onClick:()=>c(p.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:`${p.progress??0}%`}})})]},p.id)),h.map(p=>n.jsxs("div",{className:"flex justify-between items-center text-xs text-muted-foreground px-1",children:[n.jsx("span",{className:"truncate",children:p.label}),n.jsx("span",{className:ie("font-semibold text-[10px] px-1.5 py-0.5 rounded uppercase font-mono",p.state==="done"?"bg-emerald-500/10 text-emerald-400":"bg-amber-500/10 text-amber-400"),children:p.state})]},p.id))]})}function hn(s){if(!s)return"—";const u=s/1024**3;return u>=1?`${u.toFixed(1)} GB`:`${(s/1024**2).toFixed(0)} MB`}function Vd(s){return s?`${Math.round(s/1024)}k`:"—"}function h0({fit:s}){const u={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"}[s.level];return n.jsxs("span",{className:ie("rounded px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wider font-mono",u),children:[s.text," • ",s.req_gb," GB RAM"]})}const g0=["fast","heavy","coder","reasoning","agent","vision","scout"];function Hd(s){const u=s.toLowerCase();return u.includes("qwen")?{name:"Qwen",color:"bg-purple-500/20 text-purple-300 border-purple-500/30",initial:"Q"}:u.includes("gemma")?{name:"Gemma",color:"bg-blue-500/20 text-blue-300 border-blue-500/30",initial:"G"}:u.includes("llama")?{name:"Llama",color:"bg-red-500/20 text-red-300 border-red-500/30",initial:"🦙"}:u.includes("mistral")||u.includes("mixtral")?{name:"Mistral",color:"bg-orange-500/20 text-orange-300 border-orange-500/30",initial:"M"}:u.includes("deepseek")?{name:"DeepSeek",color:"bg-cyan-500/20 text-cyan-300 border-cyan-500/30",initial:"D"}:u.includes("hermes")||u.includes("nous")?{name:"Hermes",color:"bg-amber-500/20 text-amber-300 border-amber-500/30",initial:"H"}:u.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 x0(){var Fe,yr,Cn,br,Ir;const[s,u]=m.useState([]),[a,c]=m.useState([]),[f,h]=m.useState(null),[p,g]=m.useState(null),[N,C]=m.useState(null),[j,_]=m.useState(!0),[P,L]=m.useState(""),[O,k]=m.useState(null),[R,D]=m.useState(null),[M,F]=m.useState(!1),[G,Y]=m.useState(null),[Q,ee]=m.useState("grid"),[ve,se]=m.useState({width:800,height:360}),T=m.useRef(null);m.useEffect(()=>{if(!T.current)return;const I=new ResizeObserver(me=>{if(!me||me.length===0)return;const we=me[0].contentRect;se({width:we.width,height:we.height})});return I.observe(T.current),()=>I.disconnect()},[]);const ae=ve.width,ue=ve.height,ke=I=>{const me=ae*.1,we=ue*I,Oe=ae*.5,$e=ue*.5,ht=ae*.3,Xe=we,Mt=ae*.3;return`M ${me} ${we} C ${ht} ${Xe}, ${Mt} ${$e}, ${Oe} ${$e}`},ye=I=>{const me=ae*.5,we=ue*.5,Oe=ae*.9,$e=ue*I,ht=ae*.7,Xe=we,Mt=ae*.7;return`M ${me} ${we} C ${ht} ${Xe}, ${Mt} ${$e}, ${Oe} ${$e}`};function Se(){Promise.all([ce("/api/models"),ce("/api/routing"),ce("/api/connect"),ce("/api/maintenance/updates")]).then(([I,me,we,Oe])=>{u(I.models||[]),c(I.running||[]),h(me),g(we),C(Oe)}).catch(I=>L(String(I))).finally(()=>_(!1))}m.useEffect(()=>{Se();const I=setInterval(Se,4e3);return()=>clearInterval(I)},[]);async function Ee(I){try{await ce(`/api/models/${encodeURIComponent(I)}/load`,{method:"POST"}),Se()}catch(me){alert(`Fehler beim Laden des Modells: ${me.message}`)}}async function Ne(I){try{await ce(`/api/models/${encodeURIComponent(I)}/unload`,{method:"POST"}),Se()}catch(me){alert(`Fehler beim Entladen des Modells: ${me.message}`)}}async function K(){try{await ce("/api/models/unload",{method:"POST"}),Se()}catch(I){alert(`Fehler beim Entladen aller Modelle: ${I.message}`)}}async function te(I,me){D(null);try{await ce(`/api/models/${encodeURIComponent(me)}/role`,{method:"POST",body:JSON.stringify({role:I||null})}),Se()}catch(we){alert(`Fehler beim Zuweisen der Rolle: ${we}`)}}async function Z(I,me){const we=prompt("Kontextlänge (Tokens):",String(me||32768));if(we)try{await ce(`/api/models/${encodeURIComponent(I)}/ctx`,{method:"POST",body:JSON.stringify({ctx:parseInt(we,10)})}),Se()}catch(Oe){alert(`Fehler beim Setzen des Kontexts: ${Oe}`)}}async function y(I){if(confirm(`Modell '${I}' und alle zugehörigen GGUF-Dateien unwiderruflich von der Box löschen?`))try{await ce(`/api/models/${encodeURIComponent(I)}`,{method:"DELETE"}),Se()}catch(me){alert(`Fehler beim Löschen: ${me}`)}}async function x(I,me,we,Oe){try{await ce("/api/models/install",{method:"POST",body:JSON.stringify({repo:I,role:me,quant:we,jinja:Oe})}),alert(`Download für '${I}' gestartet! Der Fortschritt wird oben angezeigt.`)}catch($e){alert(`Fehler beim Starten des Upgrades: ${$e}`)}}async function A(I){I&&(await navigator.clipboard.writeText(I),F(!0),setTimeout(()=>F(!1),1500))}if(j)return n.jsx("div",{className:"text-xs text-muted-foreground py-12 text-center",children:"Initialisiere HUD Cockpit…"});if(P)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 (",P,")."]});const V=s.filter(I=>a.includes(I.name)),B=V.reduce((I,me)=>I+(me.size_bytes||0),0),q=16*1024**3,X=B>q?B*1.2:q,de=I=>s.find(me=>me.role===I),he=I=>{const me=de(I);return me?a.includes(me.name):!1};return n.jsxs("div",{className:"space-y-8",children:[n.jsx("style",{children:` - @keyframes flow-dash { - to { - stroke-dashoffset: -20; - } - } - .animate-flow-cyan { - stroke-dasharray: 4 6; - animation: flow-dash 1s linear infinite; - } - `}),n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10 space-y-3.5",children:[n.jsxs("div",{className:"flex justify-between items-center",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(si,{className:"h-4.5 w-4.5 text-primary"}),n.jsx("span",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"VRAM / Memory Belegung"})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsxs("span",{className:"text-[10px] font-mono text-muted-foreground",children:["Llama Swap VRAM-Pool: ",hn(B)," / ",hn(X)," geladen"]}),a.length>0&&n.jsx("button",{onClick:K,className:"h-6 px-2.5 rounded border border-amber-500/30 bg-amber-500/5 hover:bg-amber-500/10 text-amber-400 text-[9px] font-bold uppercase transition-all cursor-pointer",children:"Alle entladen"})]})]}),n.jsx("div",{className:"h-7 w-full rounded-xl bg-background/50 border border-border/40 overflow-hidden flex p-0.5 relative group",children:V.length===0?n.jsx("div",{className:"w-full h-full flex items-center justify-center text-[10px] text-muted-foreground/60 italic font-mono select-none",children:"VRAM Leer — Auto-Swap lädt Modelle bei Anfrage"}):V.map((I,me)=>{var $e;const we=(I.size_bytes||0)/X*100,Oe=["from-teal-500 to-emerald-500","from-indigo-500 to-blue-500","from-purple-500 to-pink-500","from-cyan-500 to-sky-500"][me%4];return n.jsxs("div",{style:{width:`${we}%`},className:ie("h-full rounded bg-gradient-to-r flex items-center justify-between px-2.5 transition-all text-white/95 shrink-0 shadow-inner select-none",Oe),title:`${I.name} (${hn(I.size_bytes)})`,children:[n.jsxs("span",{className:"text-[9px] font-bold truncate max-w-[120px] font-space tracking-wide",children:[I.role?`[${I.role}] `:"",($e=I.name.split("/").pop())==null?void 0:$e.replace(".gguf","")]}),n.jsx("span",{className:"text-[8px] font-mono opacity-80",children:hn(I.size_bytes)})]},I.name)})})]}),n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-6 shadow-lg shadow-black/10 space-y-4",children:[n.jsxs("div",{children:[n.jsx("span",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"Interactive Gateway Graph"}),n.jsx("p",{className:"text-[10px] text-muted-foreground mt-0.5 leading-relaxed",children:"Klicke links auf Editoren, um Configs zu kopieren. Klicke rechts auf Rollen, um GGUF-Zuweisungen live zu ändern."})]}),n.jsxs("div",{ref:T,className:"relative w-full h-[360px] border border-border/30 rounded-xl bg-black/25 overflow-hidden flex",children:[n.jsxs("svg",{className:"absolute inset-0 pointer-events-none w-full h-full",children:[n.jsxs("defs",{children:[n.jsxs("linearGradient",{id:"cyan-to-teal",x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[n.jsx("stop",{offset:"0%",stopColor:"#06b6d4",stopOpacity:"0.45"}),n.jsx("stop",{offset:"100%",stopColor:"#0d9488",stopOpacity:"0.45"})]}),n.jsxs("linearGradient",{id:"active-glow",x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[n.jsx("stop",{offset:"0%",stopColor:"#3b82f6",stopOpacity:"0.8"}),n.jsx("stop",{offset:"100%",stopColor:"#10b981",stopOpacity:"0.8"})]})]}),n.jsx("path",{d:ke(.1),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),(G==="roocode"||O==="roocode")&&n.jsx("path",{d:ke(.1),stroke:"#06b6d4",strokeWidth:"2.5",fill:"none",className:"animate-flow-cyan"}),n.jsx("path",{d:ke(.3),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),(G==="cursor"||O==="cursor")&&n.jsx("path",{d:ke(.3),stroke:"#06b6d4",strokeWidth:"2.5",fill:"none",className:"animate-flow-cyan"}),n.jsx("path",{d:ke(.5),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),(G==="opencode"||O==="opencode")&&n.jsx("path",{d:ke(.5),stroke:"#06b6d4",strokeWidth:"2.5",fill:"none",className:"animate-flow-cyan"}),n.jsx("path",{d:ke(.7),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),(G==="zed"||O==="zed")&&n.jsx("path",{d:ke(.7),stroke:"#06b6d4",strokeWidth:"2.5",fill:"none",className:"animate-flow-cyan"}),n.jsx("path",{d:ke(.9),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),(G==="continue"||O==="continue")&&n.jsx("path",{d:ke(.9),stroke:"#06b6d4",strokeWidth:"2.5",fill:"none",className:"animate-flow-cyan"}),n.jsx("path",{d:ye(.12),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),he("fast")&&n.jsx("path",{d:ye(.12),stroke:"url(#active-glow)",strokeWidth:"2.5",fill:"none",className:"animate-flow-cyan"}),n.jsx("path",{d:ye(.31),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),he("heavy")&&n.jsx("path",{d:ye(.31),stroke:"url(#active-glow)",strokeWidth:"2.5",fill:"none",className:"animate-flow-cyan"}),n.jsx("path",{d:ye(.5),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),he("coder")&&n.jsx("path",{d:ye(.5),stroke:"url(#active-glow)",strokeWidth:"2.5",fill:"none",className:"animate-flow-cyan"}),n.jsx("path",{d:ye(.69),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),he("vision")&&n.jsx("path",{d:ye(.69),stroke:"url(#active-glow)",strokeWidth:"2.5",fill:"none",className:"animate-flow-cyan"}),n.jsx("path",{d:ye(.88),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),he("scout")&&n.jsx("path",{d:ye(.88),stroke:"url(#active-glow)",strokeWidth:"2.5",fill:"none",className:"animate-flow-cyan"})]}),n.jsxs("div",{className:"absolute cursor-pointer select-none z-10 w-28 h-8 -translate-y-1/2 -translate-x-1/2 rounded-xl border border-border/60 bg-card/75 backdrop-blur-md flex items-center justify-center gap-1.5 px-2 hover:border-primary transition-all text-[10px] font-semibold text-foreground shadow shadow-black/20",style:{left:"10%",top:"10%"},onMouseEnter:()=>Y("roocode"),onMouseLeave:()=>Y(null),onClick:()=>k(I=>I==="roocode"?null:"roocode"),children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-cyan-400 animate-pulse"}),n.jsx("span",{children:"Roo Code"})]}),n.jsxs("div",{className:"absolute cursor-pointer select-none z-10 w-28 h-8 -translate-y-1/2 -translate-x-1/2 rounded-xl border border-border/60 bg-card/75 backdrop-blur-md flex items-center justify-center gap-1.5 px-2 hover:border-primary transition-all text-[10px] font-semibold text-foreground shadow shadow-black/20",style:{left:"10%",top:"30%"},onMouseEnter:()=>Y("cursor"),onMouseLeave:()=>Y(null),onClick:()=>k(I=>I==="cursor"?null:"cursor"),children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-cyan-400 animate-pulse"}),n.jsx("span",{children:"Cursor IDE"})]}),n.jsxs("div",{className:"absolute cursor-pointer select-none z-10 w-28 h-8 -translate-y-1/2 -translate-x-1/2 rounded-xl border border-border/60 bg-card/75 backdrop-blur-md flex items-center justify-center gap-1.5 px-2 hover:border-primary transition-all text-[10px] font-semibold text-foreground shadow shadow-black/20",style:{left:"10%",top:"50%"},onMouseEnter:()=>Y("opencode"),onMouseLeave:()=>Y(null),onClick:()=>k(I=>I==="opencode"?null:"opencode"),children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-cyan-400 animate-pulse"}),n.jsx("span",{children:"OpenCode"})]}),n.jsxs("div",{className:"absolute cursor-pointer select-none z-10 w-28 h-8 -translate-y-1/2 -translate-x-1/2 rounded-xl border border-border/60 bg-card/75 backdrop-blur-md flex items-center justify-center gap-1.5 px-2 hover:border-primary transition-all text-[10px] font-semibold text-foreground shadow shadow-black/20",style:{left:"10%",top:"70%"},onMouseEnter:()=>Y("zed"),onMouseLeave:()=>Y(null),onClick:()=>k(I=>I==="zed"?null:"zed"),children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-cyan-400 animate-pulse"}),n.jsx("span",{children:"Zed"})]}),n.jsxs("div",{className:"absolute cursor-pointer select-none z-10 w-28 h-8 -translate-y-1/2 -translate-x-1/2 rounded-xl border border-border/60 bg-card/75 backdrop-blur-md flex items-center justify-center gap-1.5 px-2 hover:border-primary transition-all text-[10px] font-semibold text-foreground shadow shadow-black/20",style:{left:"10%",top:"90%"},onMouseEnter:()=>Y("continue"),onMouseLeave:()=>Y(null),onClick:()=>k(I=>I==="continue"?null:"continue"),children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-cyan-400 animate-pulse"}),n.jsx("span",{children:"Continue"})]}),n.jsxs("div",{className:"absolute select-none z-10 w-36 py-3 px-4 -translate-y-1/2 -translate-x-1/2 rounded-2xl border border-primary/50 bg-card/90 backdrop-blur-md flex flex-col items-center justify-center text-center shadow-lg shadow-primary/5",style:{left:"50%",top:"50%"},children:[n.jsx("div",{className:"text-[10px] uppercase font-bold text-primary font-space tracking-wide",children:"Gateway Auto"}),n.jsxs("div",{className:"text-[10px] font-mono text-muted-foreground mt-0.5",children:["Schwelle: > ",f!=null&&f.heavy_threshold_chars?f.heavy_threshold_chars/1e3:"4","k Zeichen"]}),n.jsx("div",{className:"mt-1 px-1.5 py-0.5 rounded bg-primary/10 border border-primary/20 text-[9px] font-semibold text-primary uppercase font-mono",children:"Auto-Swap"})]}),g0.map(I=>{var ht;const me=["12%","31%","50%","69%","88%"],we=de(I),Oe=we?a.includes(we.name):!1;if(I==="reasoning"||I==="agent")return null;const $e={fast:0,heavy:1,coder:2,vision:3,scout:4}[I];return n.jsxs("div",{className:ie("absolute z-10 w-44 py-1.5 px-3 -translate-y-1/2 -translate-x-1/2 rounded-xl border flex flex-col justify-center hover:border-primary/50 transition-all text-left shadow select-none cursor-pointer",Oe?"border-emerald-500/50 bg-emerald-500/5 shadow-emerald-500/5":we?"border-border/60 bg-card/75":"border-dashed border-border/40 bg-background/20"),style:{left:"90%",top:me[$e]},onClick:()=>D(R===I?null:I),children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground",children:I}),Oe&&n.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-400 animate-pulse"})]}),n.jsx("div",{className:"text-[10px] font-mono font-medium truncate mt-0.5 text-foreground max-w-[150px]",children:we?(ht=we.name.split("/").pop())==null?void 0:ht.replace(".gguf",""):"Keine Zuweisung"}),R===I&&n.jsxs("div",{className:"absolute right-0 top-full mt-1 z-35 w-52 rounded-xl border border-border/80 bg-popover/95 backdrop-blur-md p-1.5 shadow-2xl space-y-1",children:[n.jsx("div",{className:"text-[9px] uppercase font-bold text-muted-foreground/60 px-2 py-1 select-none",children:"Modell zuweisen:"}),n.jsx("button",{onClick:()=>te(I,""),className:"w-full text-left px-2.5 py-1.5 rounded-lg text-[10px] hover:bg-accent text-red-400 font-semibold cursor-pointer",children:"Zuweisung entfernen"}),s.map(Xe=>{var Mt;return n.jsxs("button",{onClick:()=>te(I,Xe.name),className:ie("w-full text-left px-2.5 py-1.5 rounded-lg text-[10px] hover:bg-accent flex items-center justify-between font-mono cursor-pointer",Xe.role===I?"text-primary font-bold":"text-foreground"),children:[n.jsx("span",{className:"truncate max-w-[150px]",children:(Mt=Xe.name.split("/").pop())==null?void 0:Mt.replace(".gguf","")}),Xe.role===I&&n.jsx(bn,{className:"h-3 w-3 shrink-0"})]},Xe.name)})]})]},I)}),O&&p&&n.jsxs("div",{className:"absolute z-30 md:w-96 w-[90%] rounded-2xl border border-border/80 bg-card/95 backdrop-blur-xl p-4 shadow-2xl space-y-3 flex flex-col justify-between",style:{left:"22%",top:O==="roocode"?"5%":O==="cursor"?"20%":O==="opencode"?"40%":O==="zed"?"55%":"65%"},children:[n.jsxs("div",{className:"flex items-center justify-between border-b border-border/20 pb-2",children:[n.jsxs("span",{className:"text-[11px] font-bold uppercase tracking-wider text-primary",children:[O==="roocode"&&"Roo Code Setup",O==="cursor"&&"Cursor Setup",O==="opencode"&&"OpenCode Setup",O==="zed"&&"Zed Setup",O==="continue"&&"Continue Setup"]}),n.jsx("button",{onClick:()=>k(null),className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground cursor-pointer",children:n.jsx(Qs,{className:"h-3.5 w-3.5"})})]}),n.jsxs("div",{className:"text-[10px] text-muted-foreground leading-relaxed space-y-2",children:[O==="roocode"&&n.jsxs("ul",{className:"list-decimal pl-4 space-y-1",children:[n.jsxs("li",{children:["Suche in VS Code nach der Erweiterung ",n.jsx("strong",{children:"Roo Code"})," und installiere sie."]}),n.jsxs("li",{children:["Wähle in den Roo Code Einstellungen: Provider: ",n.jsx("strong",{children:"OpenAI Compatible"}),"."]}),n.jsxs("li",{children:["Füge das untenstehende JSON-Snippet in die ",n.jsx("code",{children:"settings.json"})," ein."]})]}),O==="cursor"&&n.jsxs("ul",{className:"list-decimal pl-4 space-y-1",children:[n.jsxs("li",{children:["Öffne Cursor Settings ➔ ",n.jsx("strong",{children:"Models"}),"."]}),n.jsxs("li",{children:["Deaktiviere Cloud-Modelle, klappe ",n.jsx("strong",{children:"OpenAI API"})," auf."]}),n.jsxs("li",{children:["Trage die Base URL unten ein und aktiviere das Modell ",n.jsx("strong",{children:"auto"}),"."]})]}),O==="opencode"&&n.jsxs("ul",{className:"list-decimal pl-4 space-y-1",children:[n.jsxs("li",{children:["Öffne die ",n.jsx("code",{children:"opencode.jsonc"})," Konfigurationsdatei."]}),n.jsxs("li",{children:["Ersetze den Provider-Eintrag unter ",n.jsx("code",{children:"provider"})," mit dem Snippet unten."]})]}),O==="zed"&&n.jsxs("ul",{className:"list-decimal pl-4 space-y-1",children:[n.jsxs("li",{children:["Öffne die Zed Settings (",n.jsx("code",{children:"ctrl+,"}),")."]}),n.jsxs("li",{children:["Füge das untenstehende JSON-Segment unter ",n.jsx("code",{children:"language_models"})," ein."]})]}),O==="continue"&&n.jsxs("ul",{className:"list-decimal pl-4 space-y-1",children:[n.jsx("li",{children:"Klicke auf das Zahnrad-Symbol in der Continue-Erweiterung."}),n.jsxs("li",{children:["Füge den Gateway-Eintrag zum ",n.jsx("code",{children:"models"}),"-Array hinzu."]})]})]}),p.tools&&n.jsxs("div",{className:"relative rounded-xl border border-border/40 bg-black/40 overflow-hidden mt-1 shrink-0",children:[n.jsxs("div",{className:"flex items-center justify-between px-3 py-1.5 border-b border-border/20 bg-black/20",children:[n.jsx("span",{className:"text-[8px] font-mono text-muted-foreground",children:"JSON Config"}),n.jsxs("button",{onClick:()=>{var I,me,we,Oe,$e;return A(O==="roocode"?(I=p.tools.cline)==null?void 0:I.snippet:O==="cursor"?(me=p.tools.cursor)==null?void 0:me.snippet:O==="opencode"?(we=p.tools.opencode)==null?void 0:we.snippet:O==="zed"?(Oe=p.tools.zed)==null?void 0:Oe.snippet:($e=p.tools.continue)==null?void 0:$e.snippet)},className:"text-[9px] font-semibold text-primary hover:text-primary-foreground flex items-center gap-1 cursor-pointer",children:[M?n.jsx(bn,{className:"h-3 w-3 text-emerald-400"}):n.jsx(xi,{className:"h-3 w-3"}),n.jsx("span",{children:M?"Kopiert":"Kopieren"})]})]}),n.jsx("pre",{className:"p-3 max-h-36 overflow-y-auto text-[9px] font-mono text-cyan-200/90 whitespace-pre scrollbar-thin select-text",children:n.jsxs("code",{children:[O==="roocode"&&((Fe=p.tools.cline)==null?void 0:Fe.snippet),O==="cursor"&&((yr=p.tools.cursor)==null?void 0:yr.snippet),O==="opencode"&&((Cn=p.tools.opencode)==null?void 0:Cn.snippet),O==="zed"&&((br=p.tools.zed)==null?void 0:br.snippet),O==="continue"&&((Ir=p.tools.continue)==null?void 0:Ir.snippet)]})})]})]})]}),n.jsxs("div",{className:"flex flex-wrap items-center gap-6 mt-3 text-[10px] text-muted-foreground border-t border-border/20 pt-3",children:[n.jsxs("span",{className:"flex items-center gap-1.5",children:[n.jsx("span",{className:"h-2 w-2 rounded-full bg-cyan-400"}),n.jsx("span",{children:"Cyan-Fluss: Client-Anfrage an Gateway"})]}),n.jsxs("span",{className:"flex items-center gap-1.5",children:[n.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-500 animate-pulse"}),n.jsx("span",{children:"Grüner Puls: Aktive Verbindung / Warmes Modell geladen"})]}),n.jsxs("span",{className:"flex items-center gap-1.5",children:[n.jsx("span",{className:"h-2 w-2 rounded bg-gradient-to-r from-teal-500 to-emerald-500"}),n.jsx("span",{children:"VRAM-Verlauf: Modellspezifischer Speicheranteil"})]})]})]}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex items-center justify-between px-1",children:[n.jsx("div",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Installierte Modell-Bibliothek"}),n.jsxs("div",{className:"flex rounded-lg border border-border/40 bg-card/45 p-0.5",children:[n.jsx("button",{onClick:()=>ee("grid"),className:ie("px-2.5 py-1 rounded-md text-[9px] font-bold uppercase transition-all cursor-pointer",Q==="grid"?"bg-primary text-primary-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:"Grid"}),n.jsx("button",{onClick:()=>ee("list"),className:ie("px-2.5 py-1 rounded-md text-[9px] font-bold uppercase transition-all cursor-pointer",Q==="list"?"bg-primary text-primary-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:"List"})]})]}),Q==="grid"?n.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:s.length===0?n.jsx("div",{className:"col-span-full text-xs text-muted-foreground border border-dashed border-border/60 rounded-2xl p-12 text-center select-none",children:'Keine Modelle konfiguriert. Verwende den Tab "Modelle finden" zum Herunterladen.'}):s.map(I=>{const me=a.includes(I.name),we=N==null?void 0:N.model_list.find($e=>$e.role===I.role),Oe=Hd(I.name);return n.jsxs("div",{className:ie("rounded-2xl border bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10 flex flex-col justify-between gap-4 transition-all duration-300 hover:border-primary/40 group",me?"border-primary/45 shadow-primary/5":"border-border/60"),children:[n.jsxs("div",{className:"space-y-3",children:[n.jsx("div",{className:"flex items-start justify-between gap-3",children:n.jsxs("div",{className:"flex gap-2.5 min-w-0",children:[n.jsx("div",{className:ie("w-7 h-7 rounded-lg border flex items-center justify-center font-bold text-xs shrink-0 shadow-sm",Oe.color),title:Oe.name,children:Oe.initial}),n.jsxs("div",{className:"min-w-0",children:[n.jsx("h3",{className:"text-xs font-bold tracking-tight text-foreground line-clamp-2 break-all font-mono",title:I.name,children:I.name.split("/").pop()}),n.jsxs("div",{className:"flex items-center gap-2 flex-wrap mt-1",children:[n.jsx("span",{className:"text-[9px] font-mono text-muted-foreground bg-background/40 px-1.5 py-0.5 rounded border border-border/30",children:I.quant||"GGUF"}),me&&n.jsxs("span",{className:"flex items-center gap-1 text-[9px] font-semibold text-emerald-400 uppercase tracking-wider",children:[n.jsx(gi,{className:"h-3 w-3 animate-pulse"})," Warm"]}),I.role&&n.jsx("span",{className:"px-1.5 py-0.5 rounded bg-primary/10 border border-primary/20 text-[9px] font-mono text-primary font-bold uppercase",children:I.role})]})]})]})}),n.jsx("div",{className:"border-t border-border/30 pt-3 flex flex-wrap gap-1",children:n.jsx(Wd,{caps:I.capabilities})})]}),n.jsxs("div",{className:"space-y-3 pt-1",children:[n.jsxs("div",{className:"grid grid-cols-2 gap-2 text-[10px] font-mono text-muted-foreground",children:[n.jsxs("div",{className:"flex items-center gap-1.5 p-2 bg-background/20 rounded-lg border border-border/20",children:[n.jsx(si,{className:"h-3.5 w-3.5 text-primary/80"}),n.jsxs("div",{children:[n.jsx("div",{className:"text-[8px] uppercase tracking-wider font-semibold text-muted-foreground/60",children:"Größe"}),n.jsx("div",{className:"text-foreground font-semibold",children:hn(I.size_bytes)})]})]}),n.jsxs("div",{className:"flex items-center gap-1.5 p-2 bg-background/20 rounded-lg border border-border/20",children:[n.jsx(hh,{className:"h-3.5 w-3.5 text-primary/80"}),n.jsxs("div",{children:[n.jsx("div",{className:"text-[8px] uppercase tracking-wider font-semibold text-muted-foreground/60",children:"Kontext"}),n.jsx("div",{className:"text-foreground font-semibold",children:Vd(I.ctx)})]})]})]}),we&&n.jsxs("div",{className:"p-3 bg-amber-500/5 border border-amber-500/30 rounded-xl space-y-2 flex flex-col justify-between shrink-0",children:[n.jsxs("div",{className:"text-[9px] font-semibold text-amber-400 flex items-center gap-1",children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-400 animate-ping"}),n.jsxs("span",{children:["Upgrade verfügbar: ",we.repo.split("/").pop()]})]}),n.jsxs("button",{onClick:()=>x(we.repo,I.role,I.quant||"Q4_K_M",I.capabilities.tools!=="no"),className:"h-7 w-full flex items-center justify-center gap-1 rounded-lg bg-amber-500 text-black text-[10px] font-bold hover:bg-amber-400 transition-colors cursor-pointer",children:[n.jsx(wn,{className:"h-3 w-3"})," Smart-Swap starten"]})]}),n.jsxs("div",{className:"flex items-center gap-1.5 border-t border-border/20 pt-3 mt-auto",children:[n.jsx("button",{onClick:()=>me?Ne(I.name):Ee(I.name),className:ie("flex-1 h-7 rounded-lg text-[9px] font-bold uppercase transition-all cursor-pointer border flex items-center justify-center gap-1",me?"border-amber-500/30 bg-amber-500/5 hover:bg-amber-500/15 text-amber-400":"border-primary/30 bg-primary/5 hover:bg-primary/15 text-primary"),children:me?"Entladen":"Laden"}),n.jsx("button",{onClick:()=>Z(I.name,I.ctx),className:"h-7 px-2.5 rounded-lg border border-border/40 text-[9px] font-bold uppercase hover:bg-accent text-muted-foreground transition-colors cursor-pointer",title:"Kontextlänge anpassen",children:"Ctx"}),n.jsx("button",{onClick:()=>y(I.name),className:"h-7 w-7 rounded-lg border border-border/40 text-muted-foreground hover:text-red-400 hover:bg-red-500/5 flex items-center justify-center transition-colors cursor-pointer",title:"Modell löschen",children:n.jsx(li,{className:"h-3.5 w-3.5"})})]})]})]},I.name)})}):n.jsx("div",{className:"space-y-2",children:s.length===0?n.jsx("div",{className:"text-xs text-muted-foreground border border-dashed border-border/60 rounded-2xl p-12 text-center select-none",children:'Keine Modelle konfiguriert. Verwende den Tab "Modelle finden" zum Herunterladen.'}):s.map(I=>{const me=a.includes(I.name),we=Hd(I.name);return n.jsxs("div",{className:ie("rounded-xl border bg-card/45 backdrop-blur-md p-3.5 shadow-lg shadow-black/5 flex flex-col sm:flex-row sm:items-center justify-between gap-3 hover:border-primary/40 transition-all",me?"border-primary/45":"border-border/60"),children:[n.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[n.jsx("div",{className:ie("w-8 h-8 rounded-lg border border-border/40 flex items-center justify-center font-bold text-xs shrink-0 shadow-sm",we.color),title:we.name,children:we.initial}),n.jsxs("div",{className:"min-w-0 text-left",children:[n.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[n.jsx("h4",{className:"text-xs font-bold text-foreground truncate max-w-[250px] sm:max-w-[400px] break-all font-mono",title:I.name,children:I.name.split("/").pop()}),I.role&&n.jsx("span",{className:"px-1.5 py-0.5 rounded bg-primary/10 border border-primary/20 text-[8px] font-mono text-primary font-bold uppercase shrink-0",children:I.role}),me&&n.jsxs("span",{className:"flex items-center gap-0.5 text-[8px] font-semibold text-emerald-400 uppercase tracking-wider shrink-0",children:[n.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500 animate-pulse"})," warm"]})]}),n.jsxs("div",{className:"text-[10px] text-muted-foreground/80 flex items-center gap-2 mt-0.5",children:[n.jsxs("span",{children:["Größe: ",hn(I.size_bytes)]}),n.jsx("span",{children:"•"}),n.jsxs("span",{children:["Kontext: ",Vd(I.ctx)]}),n.jsx("span",{children:"•"}),n.jsx("span",{className:"font-mono text-[9px]",children:I.quant||"GGUF"})]})]})]}),n.jsxs("div",{className:"flex items-center gap-3 shrink-0 self-end sm:self-auto",children:[n.jsx("div",{className:"hidden lg:flex flex-wrap gap-1",children:n.jsx(Wd,{caps:I.capabilities})}),n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx("button",{onClick:()=>me?Ne(I.name):Ee(I.name),className:ie("h-7 px-3 rounded-lg text-[9px] font-bold uppercase transition-all cursor-pointer border flex items-center gap-1",me?"border-amber-500/30 bg-amber-500/5 hover:bg-amber-500/15 text-amber-400":"border-primary/30 bg-primary/5 hover:bg-primary/15 text-primary"),children:me?"Entladen":"Laden"}),n.jsx("button",{onClick:()=>Z(I.name,I.ctx),className:"h-7 px-2.5 rounded-lg border border-border/40 text-[9px] font-bold uppercase hover:bg-accent text-muted-foreground transition-all cursor-pointer",title:"Kontextlänge anpassen",children:"Ctx"}),n.jsx("button",{onClick:()=>y(I.name),className:"h-7 w-7 rounded-lg flex items-center justify-center border border-border/40 text-muted-foreground hover:text-red-400 hover:bg-red-500/5 transition-all cursor-pointer",title:"Modell löschen",children:n.jsx(li,{className:"h-3.5 w-3.5"})})]})]})]},I.name)})})]})]})}function v0(){const[s,u]=m.useState(""),[a,c]=m.useState([]),[f,h]=m.useState("Q4_K_M"),[p,g]=m.useState(""),[N,C]=m.useState(""),[j,_]=m.useState([]);async function P(k){const R=k??s;if(R.trim()){g("Analysiere HuggingFace Repository...");try{const D=await ce(`/api/hf/quants?repo=${encodeURIComponent(R)}`);u(D.repo),c(D.quants),D.quants.length&&h(D.quants.includes("Q4_K_M")?"Q4_K_M":D.quants[0]),g(D.quants.length?"":"Keine GGUF-Dateien in diesem Repository gefunden.")}catch(D){g(`Fehler: ${D}`)}}}async function L(){if(N.trim()){g("Durchsuche HuggingFace...");try{const k=await ce(`/api/hf/search?q=${encodeURIComponent(N)}`);_(k.results),g(k.results.length?"":"Keine Ergebnisse gefunden.")}catch(k){g(`Suche fehlgeschlagen: ${k}`)}}}async function O(){if(s.trim()){g("Download-Job wird initiiert...");try{await ce("/api/models/install",{method:"POST",body:JSON.stringify({repo:s,quant:f,jinja:!0})}),g(`Download gestartet: ${s} (${f}). Fortschritt wird oben angezeigt.`)}catch(k){g(`Download-Fehler: ${k}`)}}}return n.jsxs("div",{className:"space-y-4 rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10",children:[n.jsx("div",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"HF Download & Suche"}),n.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[n.jsx("input",{value:s,onChange:k=>u(k.target.value),placeholder:"HF-URL oder org/repo (z.B. unsloth/Qwen2.5-Coder-7B-Instruct-GGUF)",className:"flex-1 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"}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx("button",{onClick:()=>P(),className:"h-9 px-4 rounded-lg border border-border/60 bg-background/20 text-xs font-semibold hover:border-primary/50 hover:bg-background/40 transition-all cursor-pointer whitespace-nowrap",children:"Quants laden"}),a.length>0&&n.jsxs(n.Fragment,{children:[n.jsx("select",{value:f,onChange:k=>h(k.target.value),className:"h-9 rounded-lg border border-border/60 bg-background/40 px-3 text-xs outline-none text-foreground font-semibold",children:a.map(k=>n.jsx("option",{value:k,className:"bg-popover text-foreground",children:k},k))}),n.jsxs("button",{onClick:O,className:"h-9 px-4 rounded-lg bg-primary text-primary-foreground text-xs font-semibold hover:opacity-90 transition-all cursor-pointer flex items-center gap-1.5",children:[n.jsx(wn,{className:"h-3.5 w-3.5"})," Herunterladen"]})]})]})]}),n.jsxs("div",{className:"flex gap-2 border-t border-border/20 pt-4",children:[n.jsxs("div",{className:"relative flex-1",children:[n.jsx("input",{value:N,onChange:k=>C(k.target.value),onKeyDown:k=>k.key==="Enter"&&L(),placeholder:"HuggingFace durchsuchen (z.B. Llama-3.1)...",className:"w-full h-9 pl-9 pr-3 rounded-lg border border-border/60 bg-background/40 text-xs outline-none focus:ring-1 focus:ring-primary/50 text-foreground"}),n.jsx(vi,{className:"absolute left-3 top-2.5 h-3.5 w-3.5 text-muted-foreground"})]}),n.jsx("button",{onClick:L,className:"h-9 px-4 rounded-lg border border-border/60 bg-background/20 text-xs font-semibold hover:border-primary/50 hover:bg-background/40 transition-all cursor-pointer",children:"Suchen"})]}),j.length>0&&n.jsx("div",{className:"max-h-48 space-y-1.5 overflow-y-auto border border-border/40 bg-background/20 p-2 rounded-xl scrollbar-thin",children:j.map(k=>n.jsxs("button",{onClick:()=>{u(k.repo),_([]),C(""),P(k.repo)},className:"flex w-full items-center justify-between rounded-lg px-3 py-2 text-left text-xs bg-background/10 border border-border/10 hover:border-primary/30 hover:bg-background/30 transition-all",children:[n.jsx("span",{className:"font-semibold truncate",children:k.repo}),n.jsxs("span",{className:"text-[10px] font-mono text-muted-foreground flex items-center gap-1 shrink-0",children:[n.jsx(wn,{className:"h-3 w-3"})," ",k.downloads.toLocaleString()]})]},k.repo))}),p&&n.jsx("div",{className:"text-[10px] font-medium text-primary font-mono",children:p})]})}const y0={vision:{title:"Bilder & Vision",desc:"Verarbeitet Bilder, Screenshots und visuelle Diagramme in multimodalen Chats.",icon:ch},coder:{title:"Coden & Entwicklung",desc:"Autovervollständigung, Refactoring und Codegenerierung direkt in deiner IDE.",icon:Jd},reasoning:{title:"Logik & Nachdenken",desc:"Komplexe logische Gedankengänge, Mathematik und tiefgründiges Planen (Reasoning).",icon:Ks},agent:{title:"Autonomer Agent (Hermes)",desc:"Führt selbstständig Terminalbefehle aus und interagiert mit deinem Homelab.",icon:Gs},scout:{title:"Allrounder & Chat",desc:"Schnelle Antworten, Zusammenfassungen, Übersetzungen und alltägliche Fragen.",icon:ih}};function b0(){const[s,u]=m.useState(null),[a,c]=m.useState([]),[f,h]=m.useState(null),[p,g]=m.useState(""),[N,C]=m.useState(!0),[j,_]=m.useState({}),[P,L]=m.useState({}),[O,k]=m.useState(!1);m.useEffect(()=>{Promise.all([ce("/api/discover"),ce("/api/models"),ce("/api/maintenance/updates").catch(()=>null)]).then(([D,M,F])=>{u(D),c(M.models||[]),F&&h(F)}).catch(D=>g(String(D))).finally(()=>C(!1))},[]);async function R(D,M,F,G){_(Y=>({...Y,[D]:"Starte..."}));try{await ce("/api/models/install",{method:"POST",body:JSON.stringify({repo:D,role:M,quant:F,jinja:G})}),_(Y=>({...Y,[D]:"Download läuft"}))}catch{_(Q=>({...Q,[D]:"Fehler"}))}}return N?n.jsx("div",{className:"text-xs text-muted-foreground py-12 text-center",children:"Analysiere Hardware und suche passende GGUF-Empfehlungen…"}):p||!s?n.jsxs("div",{className:"rounded-xl border border-red-500/20 bg-red-500/5 p-4 text-xs text-red-400",children:["Empfehlungsdienst temporär nicht erreichbar (",p,")."]}):n.jsxs("div",{className:"space-y-8",children:[n.jsxs("div",{className:"text-[10px] font-mono text-muted-foreground bg-background/25 border border-border/40 p-4 rounded-xl flex flex-col sm:flex-row sm:items-center justify-between gap-3 shadow-sm",children:[n.jsxs("div",{children:["Modell-Registry geladen für ",n.jsxs("span",{className:"text-foreground font-bold",children:[s.sys_ram_gb," GB"]})," System-RAM."]}),n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx(rf,{className:"h-3.5 w-3.5 text-primary fill-primary/20"}),n.jsx("span",{children:"Empfehlungen sind automatisch auf deine Box-Hardware optimiert."})]})]}),n.jsx("div",{className:"grid gap-6 md:grid-cols-2",children:s.categories.map(D=>{const M=y0[D.role]||{title:D.title||D.role,desc:"Spezifisches Modell für diese Systemrolle.",icon:Ws},F=M.icon,G=a.find(T=>T.role===D.role),Y=f==null?void 0:f.model_list.find(T=>T.role===D.role),Q=D.models.find(T=>T.repo===D.recommended)||D.models[0];if(!Q)return null;const ee=j[Q.repo],ve=D.models.filter(T=>T.repo!==D.recommended),se=!!P[D.role];return n.jsxs("div",{className:ie("rounded-2xl border bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10 flex flex-col justify-between gap-5 transition-all duration-300 hover:border-primary/40",G?"border-border/60":"border-primary/20 shadow-primary/5"),children:[n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex items-start justify-between gap-3",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-10 h-10 rounded-xl bg-primary/10 border border-primary/20 flex items-center justify-center text-primary shadow-sm shrink-0",children:n.jsx(F,{className:"h-5.5 w-5.5"})}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-sm font-bold tracking-tight text-foreground",children:M.title}),n.jsxs("span",{className:"text-[9px] font-mono text-muted-foreground uppercase bg-background/50 px-1.5 py-0.5 rounded border border-border/30 inline-block mt-0.5",children:["Rolle: ",D.role]})]})]}),G?n.jsxs("span",{className:"flex items-center gap-1.5 text-[9px] font-bold text-emerald-400 uppercase tracking-wider bg-emerald-500/10 border border-emerald-500/20 px-2.5 py-1 rounded-lg",children:[n.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500 animate-pulse"}),"Aktiviert"]}):n.jsx("span",{className:"text-[9px] font-bold text-primary/70 uppercase tracking-wider bg-primary/10 border border-primary/20 px-2.5 py-1 rounded-lg",children:"Frei"})]}),n.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:M.desc}),n.jsx("div",{className:"p-3.5 rounded-xl bg-background/35 border border-border/30 space-y-2.5",children:G?n.jsxs("div",{className:"space-y-1.5",children:[n.jsx("div",{className:"text-[9px] font-bold uppercase tracking-wider text-muted-foreground/60",children:"Aktive GGUF-Belegung"}),n.jsx("div",{className:"text-xs font-mono font-bold text-foreground truncate",title:G.name,children:G.name.split("/").pop()}),n.jsxs("div",{className:"text-[10px] text-muted-foreground/80 flex items-center gap-2",children:[n.jsxs("span",{children:["Größe: ",pi(G.size_bytes||0)]}),n.jsx("span",{children:"•"}),n.jsxs("span",{children:["Quant: ",G.quant||"GGUF"]})]})]}):n.jsxs("div",{className:"space-y-1.5",children:[n.jsx("div",{className:"text-[9px] font-bold uppercase tracking-wider text-primary/80",children:"Empfohlenes Modell"}),n.jsx("div",{className:"text-xs font-mono font-bold text-foreground truncate",title:Q.name,children:Q.name}),n.jsxs("div",{className:"text-[10px] text-muted-foreground/80 flex items-center gap-2 flex-wrap",children:[n.jsxs("span",{children:["Ersteller: ",Q.author]}),n.jsx("span",{children:"•"}),n.jsxs("span",{children:["Quant: ",Q.quant]})]}),n.jsx("div",{className:"flex items-center gap-1.5 pt-0.5",children:n.jsx(h0,{fit:Q.fit})})]})}),n.jsx("div",{className:"pt-1",children:G?Y?n.jsxs("div",{className:"space-y-2",children:[n.jsxs("div",{className:"text-[9px] font-semibold text-amber-400 flex items-center gap-1.5",children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-400 animate-ping shrink-0"}),n.jsxs("span",{children:["Bessere Version in der Registry: ",Y.repo.split("/").pop()]})]}),n.jsxs("button",{onClick:()=>R(Y.repo,D.role,Q.quant||"Q4_K_M",Q.caps.tools!=="no"),disabled:!!j[Y.repo],className:"h-8 w-full flex items-center justify-center gap-1.5 rounded-lg bg-amber-500 text-black text-xs font-bold hover:bg-amber-400 disabled:opacity-50 transition-all cursor-pointer shadow-md shadow-amber-500/10",children:[n.jsx(wn,{className:"h-3.5 w-3.5"}),j[Y.repo]||"Auf neue Version aktualisieren"]})]}):n.jsxs("div",{className:"h-8 flex items-center justify-center gap-1.5 text-[10px] font-bold text-emerald-400 uppercase tracking-wide bg-emerald-500/5 border border-emerald-500/10 rounded-lg select-none",children:[n.jsx(bn,{className:"h-4 w-4"})," Auf neuestem Stand"]}):n.jsxs("button",{onClick:()=>R(Q.repo,D.role,Q.quant||"Q4_K_M",Q.caps.tools!=="no"),disabled:!!ee,className:ie("h-8 w-full flex items-center justify-center gap-1.5 rounded-lg text-xs font-bold transition-all cursor-pointer border",ee?"border-primary/40 bg-primary/5 text-primary":"bg-primary text-primary-foreground hover:opacity-90 shadow-md shadow-primary/10"),children:[n.jsx(wn,{className:"h-3.5 w-3.5"}),ee||"Optimales Modell einsetzen"]})})]}),ve.length>0&&n.jsxs("div",{className:"border-t border-border/20 pt-3",children:[n.jsxs("button",{onClick:()=>L(T=>({...T,[D.role]:!se})),className:"flex items-center gap-1.5 text-[10px] text-muted-foreground/80 hover:text-foreground transition-colors cursor-pointer",children:[se?n.jsx(oh,{className:"h-3 w-3"}):n.jsx(th,{className:"h-3 w-3"}),n.jsxs("span",{children:["Alternative Empfehlungen anzeigen (",ve.length,")"]})]}),se&&n.jsx("div",{className:"mt-2.5 space-y-2 max-h-36 overflow-y-auto pr-1 scrollbar-thin",children:ve.map(T=>n.jsxs("div",{className:"p-2 rounded-lg bg-background/25 border border-border/20 flex items-center justify-between gap-3",children:[n.jsxs("div",{className:"min-w-0",children:[n.jsx("div",{className:"text-[10px] font-mono font-bold text-foreground truncate",title:T.name,children:T.name}),n.jsxs("div",{className:"text-[9px] text-muted-foreground flex items-center gap-1.5 mt-0.5",children:[n.jsxs("span",{children:["Quant: ",T.quant]}),n.jsx("span",{children:"•"}),n.jsx("span",{children:T.fit.text})]})]}),n.jsx("button",{onClick:()=>R(T.repo,D.role,T.quant||"Q4_K_M",T.caps.tools!=="no"),disabled:!!j[T.repo],className:"h-6 px-2.5 rounded bg-background/40 hover:bg-background/80 border border-border/40 text-[9px] font-bold text-foreground transition-all cursor-pointer shrink-0 disabled:opacity-50",children:j[T.repo]||"Installieren"})]},T.repo))})]})]},D.role)})}),n.jsxs("div",{className:"border border-border/50 bg-card/20 rounded-2xl overflow-hidden shadow-md mt-4",children:[n.jsxs("button",{onClick:()=>k(!O),className:"w-full px-5 py-4 flex items-center justify-between text-xs font-bold uppercase tracking-wider text-muted-foreground hover:bg-card/30 transition-colors cursor-pointer",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(vi,{className:"h-4 w-4 text-primary"}),n.jsx("span",{children:"Eigenes Modell von Hugging Face laden (Erweiterte Ansicht)"})]}),n.jsx("span",{className:"text-[10px] text-primary hover:underline",children:O?"Ausblenden ▲":"Anzeigen ▼"})]}),O&&n.jsx("div",{className:"p-5 border-t border-border/20 bg-card/10",children:n.jsx(v0,{})})]})]})}function w0(){const[s,u]=m.useState("cockpit");return n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:"flex flex-col sm:flex-row justify-between sm:items-center gap-4",children:[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:"Modell-Zentrale"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Verwalte deine Modelle und passe das Gateway-Routing live über das interaktive Cockpit an."})]}),n.jsx("div",{className:"flex rounded-xl border border-border/60 bg-card/45 backdrop-blur-md p-1 self-start",children:["cockpit","discover"].map(a=>n.jsx("button",{onClick:()=>u(a),className:ie("rounded-lg px-4 py-1.5 text-xs font-semibold tracking-wide uppercase transition-all cursor-pointer",s===a?"bg-primary text-primary-foreground shadow-md shadow-primary/10":"text-muted-foreground hover:text-foreground"),children:a==="cockpit"?"Cockpit":"Modelle finden"},a))})]}),n.jsx(m0,{}),n.jsx("div",{className:"transition-all duration-300",children:s==="cockpit"?n.jsx(x0,{}):n.jsx(b0,{})})]})}function hr(s){return(s/1024**3).toFixed(1)}function Is({label:s,percent:u,detail:a,icon:c}){const f=u>90?"bg-red-500 shadow-md shadow-red-500/20":u>75?"bg-amber-500 shadow-md shadow-amber-500/20":"bg-primary shadow-md shadow-primary/20";return n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10 flex flex-col justify-between gap-3 hover:border-primary/30 transition-all duration-300",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(c,{className:"h-4.5 w-4.5 text-primary"}),n.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-foreground",children:s})]}),n.jsxs("span",{className:"text-xs font-mono font-bold text-foreground",children:[Math.round(u),"%"]})]}),n.jsx("div",{className:"w-full h-2 bg-background/40 rounded-full overflow-hidden border border-border/20",children:n.jsx("div",{className:ie("h-full transition-all duration-700 ease-out",f),style:{width:`${Math.min(u,100)}%`}})}),a&&n.jsx("div",{className:"text-[10px] font-mono text-muted-foreground/80",children:a})]})}function k0(){const[s,u]=m.useState(null),[a,c]=m.useState(null),[f,h]=m.useState(""),[p,g]=m.useState(""),[N,C]=m.useState({});function j(){ce("/api/system/status").then(u).catch(L=>h(String(L))),ce("/api/system/services").then(c).catch(()=>{})}m.useEffect(()=>{j();const L=setInterval(j,3e3);return()=>clearInterval(L)},[]);async function _(){g("Backup snapshotted...");try{const L=await ce("/api/system/backup",{method:"POST"});g(L.ok?`Snapshot erzeugt: ${L.snapshot} (${L.files.length} Dateien)`:"Keine Änderungen zu sichern.")}catch(L){g(`Fehler: ${L.message}`)}}async function P(L){C(O=>({...O,[L]:!0}));try{const O=await ce("/api/maintenance/restart",{method:"POST",body:JSON.stringify({service:L})});O.ok?alert(`Dienst ${L} wurde erfolgreich neu gestartet.`):alert(`Fehler beim Neustart: ${O.err||"Unbekannter Fehler"}`)}catch(O){alert(`Fehler: ${O.message}`)}finally{C(O=>({...O,[L]:!1}))}}return n.jsxs("div",{className:"space-y-6",children:[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:"System-Diagnose & Status"}),n.jsx("p",{className:"text-sm text-muted-foreground flex items-center gap-1",children:"Echtzeit-Ressourcen der Box, Dienst-Überwachung und Systempflege."})]}),f&&n.jsxs("div",{className:"rounded-xl border border-red-500/20 bg-red-500/5 p-4 text-xs text-red-400 font-mono",children:["System-Status nicht lesbar (",f,")."]}),s&&n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[n.jsx(Is,{label:"CPU",percent:s.cpu.percent,detail:s.cpu.cores?`${s.cpu.cores} Cores`:void 0,icon:Dr}),n.jsx(Is,{label:"RAM",percent:s.ram.percent,detail:`${hr(s.ram.used)} / ${hr(s.ram.total)} GB`,icon:gi}),s.gpu&&s.gpu.busy_percent!=null&&n.jsx(Is,{label:"GPU",percent:s.gpu.busy_percent,detail:s.gpu.gtt_used!=null&&s.gpu.gtt_total?`${hr(s.gpu.gtt_used)} / ${hr(s.gpu.gtt_total)} GB (GTT/unified)`:s.gpu.vram_used!=null&&s.gpu.vram_total?`${hr(s.gpu.vram_used)} / ${hr(s.gpu.vram_total)} GB VRAM`:void 0,icon:Dr}),s.disk&&n.jsx(Is,{label:"Disk",percent:s.disk.percent,detail:`${hr(s.disk.used)} / ${hr(s.disk.total)} GB`,icon:si})]}),s.temp&&(s.temp.cpu||s.temp.gpu)&&n.jsxs("div",{className:"flex gap-3 text-[10px] font-mono text-muted-foreground bg-background/25 border border-border/40 p-2.5 rounded-xl self-start w-fit",children:[s.temp.cpu!=null&&n.jsxs("span",{className:"flex items-center gap-1",children:["CPU-Temperatur: ",n.jsxs("span",{className:"text-foreground font-bold",children:[s.temp.cpu," °C"]})]}),s.temp.cpu!=null&&s.temp.gpu!=null&&n.jsx("span",{children:"|"}),s.temp.gpu!=null&&n.jsxs("span",{className:"flex items-center gap-1",children:["GPU-Temperatur: ",n.jsxs("span",{className:"text-foreground font-bold",children:[s.temp.gpu," °C"]})]})]})]}),a&&n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10 space-y-4",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("div",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Homelab-Dienste"}),n.jsx("button",{onClick:()=>window.dispatchEvent(new CustomEvent("open-system-drawer",{detail:{tab:"logs"}})),className:"h-7 px-3 rounded-lg border border-border/60 bg-background/25 text-[10px] font-bold uppercase hover:bg-accent text-muted-foreground transition-all cursor-pointer",children:"System-Logs anzeigen"})]}),n.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:a.services.map(L=>n.jsxs("div",{className:"flex items-center justify-between p-3.5 rounded-xl bg-background/20 border border-border/30 hover:border-primary/20 transition-all group",children:[n.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[n.jsx("span",{className:ie("h-2.5 w-2.5 rounded-full ring-2 ring-black/40",L.ok?"bg-emerald-500":"bg-amber-500")}),n.jsxs("div",{className:"truncate",children:[n.jsx("div",{className:"text-xs font-bold text-foreground truncate",children:L.name}),n.jsx("div",{className:"text-[9px] text-muted-foreground/60 font-mono mt-0.5 truncate",children:L.url})]})]}),n.jsx("button",{onClick:()=>P(L.name),disabled:N[L.name],className:"h-7 w-7 rounded-lg border border-border/40 text-muted-foreground hover:text-primary hover:bg-primary/5 flex items-center justify-center transition-all opacity-0 group-hover:opacity-100",title:"Dienst neu starten",children:n.jsx(kn,{className:ie("h-3.5 w-3.5",N[L.name]&&"animate-spin")})})]},L.name))}),n.jsxs("div",{className:"flex flex-wrap gap-4 border-t border-border/20 pt-4 text-[10px] font-semibold text-muted-foreground",children:[n.jsxs("a",{href:Hs(a.links.engine_ui),target:"_blank",rel:"noopener",className:"flex items-center gap-1 text-primary hover:text-primary-foreground hover:bg-primary/10 px-2 py-1 rounded transition-colors",children:[n.jsx(Bs,{className:"h-3 w-3"})," Engine Dashboard (llama-swap)"]}),n.jsxs("a",{href:Hs(a.links.gateway),target:"_blank",rel:"noopener",className:"flex items-center gap-1 text-primary hover:text-primary-foreground hover:bg-primary/10 px-2 py-1 rounded transition-colors",children:[n.jsx(Bs,{className:"h-3 w-3"})," OpenAI Gateway"]})]})]}),n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10 flex flex-col sm:flex-row justify-between sm:items-center gap-4",children:[n.jsxs("div",{className:"space-y-1",children:[n.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"System-Backup & Snapshot"}),n.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Erzeuge einen Git-Snapshot der aktuellen Konfigurationen und des System-Zustands."})]}),n.jsx("div",{className:"flex items-center gap-3 self-start sm:self-auto shrink-0",children:n.jsxs("button",{onClick:_,className:"h-9 px-4 rounded-lg bg-primary text-primary-foreground text-xs font-semibold hover:opacity-90 transition-all flex items-center gap-1.5 cursor-pointer shadow-md shadow-primary/10",children:[n.jsx(xh,{className:"h-4 w-4"})," Snapshot erstellen"]})})]}),p&&n.jsx("div",{className:"text-[10px] font-mono text-primary font-medium bg-primary/5 p-3 rounded-xl border border-primary/20",children:p})]})}function j0(){const[s,u]=m.useState(localStorage.getItem("mc_host")||"192.168.178.151"),[a,c]=m.useState(localStorage.getItem("mc_mcp_path")||""),[f,h]=m.useState(null),[p,g]=m.useState("cline"),[N,C]=m.useState(!1),[j,_]=m.useState("");m.useEffect(()=>{const R=new URLSearchParams;R.set("host",s),a&&R.set("mcp_path",a),ce(`/api/connect?${R}`).then(h).catch(D=>_(String(D)))},[s,a]);function P(R){u(R),R&&localStorage.setItem("mc_host",R)}function L(R){c(R),localStorage.setItem("mc_mcp_path",R)}const O=f==null?void 0:f.tools[p];async function k(){O&&(await navigator.clipboard.writeText(O.snippet),C(!0),setTimeout(()=>C(!1),1500))}return n.jsxs("div",{className:"space-y-6",children:[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:"Verbindung & Integration"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Kopiere vorgefertigte Konfigurationsdateien für deinen lokalen PC (IDEs, Cline, Roo Code, Cursor), um direkt auf das geteilte Gedächtnis und den Auto-Swap-Gateway der Box zuzugreifen."})]}),n.jsxs("div",{className:"grid gap-4 md:grid-cols-2 p-5 rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md shadow-lg shadow-black/10",children:[n.jsxs("div",{className:"space-y-1.5",children:[n.jsxs("label",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground flex items-center gap-1.5",children:[n.jsx(fh,{className:"h-3.5 w-3.5 text-primary"})," Box LAN IP-Adresse"]}),n.jsx("input",{value:s,onChange:R=>P(R.target.value),placeholder:"z.B. 192.168.178.151",className:"w-full h-9 rounded-lg border border-border/60 bg-background/40 px-3 font-mono text-xs outline-none focus:ring-1 focus:ring-primary/50 text-foreground"})]}),n.jsxs("div",{className:"space-y-1.5",children:[n.jsxs("label",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground flex items-center gap-1.5",children:[n.jsx(dh,{className:"h-3.5 w-3.5 text-primary"})," Lokaler MCP-Scriptpfad"]}),n.jsx("input",{value:a,onChange:R=>L(R.target.value),placeholder:"z.B. F:\\Coding Stuff\\mission-control-2\\mcp\\mcp_memory.py",className:"w-full h-9 rounded-lg border border-border/60 bg-background/40 px-3 font-mono text-xs outline-none focus:ring-1 focus:ring-primary/50 text-foreground"})]})]}),j&&n.jsxs("div",{className:"rounded-xl border border-red-500/20 bg-red-500/5 p-4 text-xs text-red-400",children:["Fehler beim Generieren der Snippets: ",j]}),f&&n.jsxs("div",{className:"space-y-4",children:[n.jsx("div",{className:"flex flex-wrap gap-1 bg-card/20 p-1 border border-border/40 rounded-xl max-w-fit",children:Object.entries(f.tools).map(([R,D])=>n.jsx("button",{onClick:()=>g(R),className:ie("rounded-lg px-4 py-1.5 text-xs font-semibold tracking-wide uppercase transition-all cursor-pointer",p===R?"bg-primary text-primary-foreground shadow-md shadow-primary/10":"text-muted-foreground hover:text-foreground"),children:D.label},R))}),O&&n.jsxs("div",{className:"space-y-3",children:[O.note&&n.jsxs("div",{className:"flex items-start gap-2.5 p-3 rounded-xl bg-primary/5 border border-primary/20 text-xs text-muted-foreground leading-relaxed",children:[n.jsx(ph,{className:"h-4.5 w-4.5 text-primary shrink-0 mt-0.5"}),n.jsx("span",{children:O.note})]}),n.jsxs("div",{className:"flex flex-col border border-border/60 bg-black/60 rounded-2xl overflow-hidden shadow-2xl",children:[n.jsxs("div",{className:"flex h-11 items-center justify-between px-4 border-b border-border/40 bg-black/40 shrink-0",children:[n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx("span",{className:"h-3 w-3 rounded-full bg-red-500/80 shadow-md shadow-red-500/10"}),n.jsx("span",{className:"h-3 w-3 rounded-full bg-amber-500/80 shadow-md shadow-amber-500/10"}),n.jsx("span",{className:"h-3 w-3 rounded-full bg-emerald-500/80 shadow-md shadow-emerald-500/10"})]}),n.jsxs("div",{className:"flex items-center gap-1.5 text-[10px] font-mono text-muted-foreground/75 bg-background/30 px-3 py-1 rounded-md border border-border/20",children:[n.jsx(yi,{className:"h-3.5 w-3.5 text-primary"}),n.jsx("span",{children:p==="cline"||p==="cursor"?"config.json":"settings.json"})]}),n.jsxs("button",{onClick:k,className:"flex h-7 px-2.5 items-center gap-1.5 rounded-lg border border-border/40 bg-background/30 text-[10px] font-semibold text-muted-foreground hover:text-foreground hover:bg-background/60 transition-all cursor-pointer",children:[N?n.jsx(bn,{className:"h-3.5 w-3.5 text-emerald-400"}):n.jsx(xi,{className:"h-3.5 w-3.5"}),n.jsx("span",{children:N?"Kopiert":"Kopieren"})]})]}),n.jsx("pre",{className:"p-5 overflow-x-auto text-xs font-mono text-cyan-200/90 whitespace-pre leading-relaxed scrollbar-thin select-text bg-black/10",children:n.jsx("code",{children:O.snippet})})]})]})]})]})}const Gd=["user","instruction","stable","versioned","ephemeral"],ni={user:{label:"User",icon:jh,color:"text-cyan-400",border:"border-cyan-500/30",bg:"bg-cyan-500/10",text:"text-cyan-400"},instruction:{label:"Regel",icon:vh,color:"text-violet-400",border:"border-violet-500/30",bg:"bg-violet-500/10",text:"text-violet-400"},stable:{label:"Fakt",icon:go,color:"text-indigo-400",border:"border-indigo-500/30",bg:"bg-indigo-500/10",text:"text-indigo-400"},versioned:{label:"Version",icon:kh,color:"text-amber-400",border:"border-amber-500/30",bg:"bg-amber-500/10",text:"text-amber-400"},ephemeral:{label:"Temporär",icon:lh,color:"text-pink-400",border:"border-pink-500/30",bg:"bg-pink-500/10",text:"text-pink-400"}},Kd={label:"Gedächtnis",icon:Xd,bg:"bg-muted/10",text:"text-muted-foreground"},N0={user:"border-l-cyan-500/80",instruction:"border-l-violet-500/80",stable:"border-l-indigo-500/80",versioned:"border-l-amber-500/80",ephemeral:"border-l-pink-500/80"};function S0(){const[s,u]=m.useState([]),[a,c]=m.useState(""),[f,h]=m.useState(""),[p,g]=m.useState(""),[N,C]=m.useState("stable"),[j,_]=m.useState(""),[P,L]=m.useState(!1);function O(){const M=new URLSearchParams;f&&M.set("q",f),a&&M.set("category",a),ce(`/api/memory?${M}`).then(u).catch(F=>_(String(F)))}m.useEffect(O,[f,a]);async function k(){p.trim()&&(await ce("/api/memory",{method:"POST",body:JSON.stringify({content:p,category:N,source:"ui"})}),g(""),O())}async function R(M){await ce(`/api/memory/${M}`,{method:"DELETE"}),O()}async function D(){L(!0);try{const M=await ce("/api/memory/dedupe",{method:"POST",body:JSON.stringify({apply:!1})});if(M.duplicate_count===0){alert("Keine Dubletten gefunden — alles sauber.");return}confirm(`${M.duplicate_count} Dublette(n) in ${M.groups.length} Gruppe(n) gefunden. Entfernen?`)&&(await ce("/api/memory/dedupe",{method:"POST",body:JSON.stringify({apply:!0})}),O())}catch(M){alert(`Fehler: ${M.message}`)}finally{L(!1)}}return n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:"flex flex-col sm:flex-row justify-between sm:items-center gap-4",children:[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:"Gedächtnis-Pool (Memory)"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Die geteilte Konstitution des Systems. Alle Instanzen (Hermes, IDEs, Gateway) lesen und schreiben hierauf per MCP-Protokoll."})]}),n.jsxs("button",{onClick:D,disabled:P,className:"flex h-9 px-4 items-center gap-1.5 text-xs font-semibold rounded-lg border border-border/60 bg-card hover:border-primary/50 transition-all cursor-pointer shadow-md disabled:opacity-50 shrink-0 self-start",children:[n.jsx(wh,{className:"h-4 w-4 text-primary animate-pulse"}),n.jsx("span",{children:"Deduplizieren"})]})]}),n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10 space-y-4",children:[n.jsx("div",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Neuen Eintrag anlegen"}),n.jsx("textarea",{value:p,onChange:M=>g(M.target.value),placeholder:"Füge eine neue Regel, eine Vorliebe oder einen stabilen Fakt über das Projekt oder dich hinzu...",rows:3,className:"w-full resize-none rounded-xl border border-border/60 bg-background/30 p-3.5 text-xs outline-none focus:ring-1 focus:ring-primary/50 text-foreground transition-all leading-relaxed"}),n.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wider",children:"Kategorie"}),n.jsx("select",{value:N,onChange:M=>C(M.target.value),className:"h-8 rounded-lg border border-border/60 bg-background/50 px-2 py-1 text-xs outline-none font-semibold text-foreground cursor-pointer",children:Gd.map(M=>{var F;return n.jsx("option",{value:M,className:"bg-popover text-foreground",children:((F=ni[M])==null?void 0:F.label)||M},M)})})]}),n.jsxs("button",{onClick:k,className:"h-9 px-4 rounded-lg bg-primary text-primary-foreground text-xs font-semibold hover:opacity-90 transition-all flex items-center gap-1.5 cursor-pointer shadow-md shadow-primary/10",children:[n.jsx(ef,{className:"h-4 w-4"})," Speichern"]})]})]}),n.jsxs("div",{className:"flex flex-col md:flex-row items-stretch md:items-center gap-3",children:[n.jsxs("div",{className:"relative flex-1",children:[n.jsx("input",{value:f,onChange:M=>h(M.target.value),placeholder:"Gedächtnis durchsuchen...",className:"w-full h-9 pl-9 pr-3 rounded-lg border border-border/60 bg-card/45 text-xs outline-none focus:ring-1 focus:ring-primary/50 text-foreground"}),n.jsx(vi,{className:"absolute left-3 top-2.5 h-3.5 w-3.5 text-muted-foreground"})]}),n.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 p-1 bg-card/30 border border-border/40 rounded-xl overflow-x-auto max-w-full",children:[n.jsx("button",{onClick:()=>c(""),className:ie("h-7 px-3 rounded-lg text-[10px] font-semibold uppercase tracking-wider transition-all cursor-pointer whitespace-nowrap",a?"text-muted-foreground hover:text-foreground":"bg-primary text-primary-foreground"),children:"Alle"}),Gd.map(M=>{const F=ni[M]||Kd,G=F.icon;return n.jsxs("button",{onClick:()=>c(M),className:ie("h-7 px-2.5 rounded-lg text-[10px] font-semibold uppercase tracking-wider transition-all cursor-pointer flex items-center gap-1 whitespace-nowrap",a===M?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"),children:[n.jsx(G,{className:"h-3 w-3"}),n.jsx("span",{children:F.label})]},M)})]})]}),j&&n.jsxs("div",{className:"rounded-xl border border-red-500/20 bg-red-500/5 p-4 text-xs text-red-400",children:["Fehler beim Laden des Gedächtnisses: ",j]}),n.jsx("div",{className:"space-y-3",children:s.length===0?n.jsx("div",{className:"text-xs text-muted-foreground border border-dashed border-border/60 rounded-2xl p-12 text-center",children:"Keine Einträge für die aktuellen Filterkriterien gefunden."}):s.map(M=>{const F=ni[M.category]||Kd,G=F.icon;return n.jsxs("div",{className:ie("flex items-start justify-between gap-4 p-4 rounded-xl border border-l-4 bg-card/45 backdrop-blur-md border-border/60 shadow-md shadow-black/5 hover:border-primary/20 transition-all group",N0[M.category]||"border-l-muted"),children:[n.jsxs("div",{className:"flex items-start gap-3 flex-1 min-w-0",children:[n.jsxs("span",{className:ie("flex items-center gap-1 px-2 py-0.5 rounded text-[9px] font-bold uppercase tracking-wider font-mono shrink-0",F.bg,F.text),children:[n.jsx(G,{className:"h-3 w-3"}),n.jsx("span",{className:"hidden sm:inline",children:F.label})]}),n.jsx("span",{className:"text-xs text-foreground leading-relaxed break-words whitespace-pre-wrap flex-1",children:M.content})]}),n.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[n.jsx("span",{className:"text-[9px] font-mono text-muted-foreground/60 bg-background/20 px-1.5 py-0.5 rounded uppercase tracking-wider",children:M.source}),n.jsx("button",{onClick:()=>R(M.id),className:"h-7 w-7 rounded-lg flex items-center justify-center border border-border/40 text-muted-foreground hover:text-red-400 hover:bg-red-500/5 transition-all opacity-0 group-hover:opacity-100",title:"Eintrag löschen",children:n.jsx(li,{className:"h-3.5 w-3.5"})})]})]},M.id)})})]})}function Fs({label:s,ok:u,detail:a,icon:c}){return n.jsxs("div",{className:ie("rounded-2xl border bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10 flex flex-col justify-between gap-3 hover:border-primary/40 transition-all duration-300",u?"border-border/60":"border-amber-500/30"),children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground",children:s}),n.jsx(c,{className:ie("h-4.5 w-4.5",u?"text-primary":"text-amber-500")})]}),n.jsxs("div",{className:"space-y-1.5",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:ie("h-2 w-2 rounded-full ring-2 ring-black/40",u?"bg-emerald-500 animate-pulse":"bg-amber-500")}),n.jsx("span",{className:"text-xs font-semibold text-foreground",children:u?"Bereit / Online":"Offline / Inaktiv"})]}),a&&n.jsx("div",{className:"text-[10px] font-mono text-muted-foreground truncate max-w-[200px]",title:a,children:a})]})]})}const C0=["fast","heavy","coder","reasoning","agent","vision","scout"];function E0(){var Ee,Ne,K,te,Z;const[s,u]=m.useState(null),[a,c]=m.useState(""),[f,h]=m.useState([]),[p,g]=m.useState([]),[N,C]=m.useState(null),[j,_]=m.useState(null),[P,L]=m.useState(null),[O,k]=m.useState(null),[R,D]=m.useState(!1),[M,F]=m.useState(null),[G,Y]=m.useState({width:800,height:360}),Q=m.useRef(null);m.useEffect(()=>{if(!Q.current)return;const y=new ResizeObserver(x=>{if(!x||x.length===0)return;const A=x[0].contentRect;Y({width:A.width,height:A.height})});return y.observe(Q.current),()=>y.disconnect()},[]);const ee=G.width,ve=G.height,se=y=>{const x=ee*.1,A=ve*y,V=ee*.5,B=ve*.5,q=ee*.3,X=A,de=ee*.3;return`M ${x} ${A} C ${q} ${X}, ${de} ${B}, ${V} ${B}`},T=y=>{const x=ee*.5,A=ve*.5,V=ee*.9,B=ve*y,q=ee*.7,X=A,de=ee*.7;return`M ${x} ${A} C ${q} ${X}, ${de} ${B}, ${V} ${B}`};function ae(){ce("/api/agent/status").then(u).catch(y=>c(String(y))),Promise.all([ce("/api/models"),ce("/api/routing"),ce("/api/connect")]).then(([y,x,A])=>{h(y.models||[]),g(y.running||[]),C(x),_(A)}).catch(y=>console.error("Error loading graph data in AgentView",y))}m.useEffect(()=>{ae();const y=setInterval(ae,5e3);return()=>clearInterval(y)},[]);const ue=y=>f.find(x=>x.role===y),ke=y=>{const x=ue(y);return x?p.includes(x.name):!1};async function ye(y,x){k(null);try{await ce(`/api/models/${encodeURIComponent(x)}/role`,{method:"POST",body:JSON.stringify({role:y||null})}),ae()}catch(A){alert(`Fehler beim Zuweisen der Rolle: ${A}`)}}async function Se(y){y&&(await navigator.clipboard.writeText(y),D(!0),setTimeout(()=>D(!1),1500))}return n.jsxs("div",{className:"space-y-6",children:[n.jsx("style",{children:` - @keyframes flow-dash { - to { - stroke-dashoffset: -20; - } - } - .animate-flow-cyan { - stroke-dasharray: 4 6; - animation: flow-dash 1s linear infinite; - } - `}),n.jsxs("div",{className:"flex flex-col sm:flex-row justify-between sm:items-center gap-4",children:[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:"Hermes Agenten-Cockpit"}),n.jsxs("p",{className:"text-sm text-muted-foreground",children:["Hermes ist ein autonomer Agent, der im Hintergrund der Box läuft (Port ",n.jsx("code",{children:":8642"}),") und seine eigene UI besitzt."]})]}),(s==null?void 0:s.webui_url)&&n.jsxs("a",{href:Hs(s.webui_url),target:"_blank",rel:"noopener",className:ie("flex h-9 px-4 items-center gap-1.5 text-xs font-semibold rounded-lg transition-all cursor-pointer shadow-md shrink-0 self-start",s.webui_reachable?"bg-primary text-primary-foreground hover:opacity-90 shadow-primary/10":"border border-border/60 text-muted-foreground bg-background/20"),children:[n.jsx(Bs,{className:"h-4 w-4"}),n.jsx("span",{children:"Hermes WebUI öffnen"})]})]}),a&&n.jsxs("div",{className:"rounded-xl border border-red-500/20 bg-red-500/5 p-4 text-xs text-red-400 font-mono",children:["Status nicht lesbar (",a,")."]}),s&&n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[n.jsx(Fs,{label:"Agent Gateway",ok:s.gateway_reachable,detail:"Port :8642 (REST API)",icon:Gs}),n.jsx(Fs,{label:"Agent WebUI",ok:s.webui_reachable,detail:"Port :8787 (Chat UI)",icon:gi}),n.jsx(Fs,{label:"Aktives Gehirn",ok:s.gateway_reachable,detail:s.brain_model?`Model: ${s.brain_model}`:"Model: auto",icon:Dr}),n.jsx(Fs,{label:"Verdrahtung",ok:s.has_config,detail:`Config: ${s.has_config?"✓":"—"} · Skills: ${s.has_skills?"✓":"—"} · Memory: ${s.has_memories?"✓":"—"}`,icon:Nh})]}),n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-6 shadow-lg shadow-black/10 space-y-4",children:[n.jsxs("div",{children:[n.jsx("span",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"Interactive Gateway Graph (Duplikat)"}),n.jsx("p",{className:"text-[10px] text-muted-foreground mt-0.5 leading-relaxed",children:"Visualisiert die Kopplung der Client-Editoren mit dem OpenAI-Gateway und den aktiven Modell-Rollen."})]}),n.jsxs("div",{ref:Q,className:"relative w-full h-[360px] border border-border/30 rounded-xl bg-black/25 overflow-hidden flex",children:[n.jsxs("svg",{className:"absolute inset-0 pointer-events-none w-full h-full",children:[n.jsxs("defs",{children:[n.jsxs("linearGradient",{id:"cyan-to-teal",x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[n.jsx("stop",{offset:"0%",stopColor:"#06b6d4",stopOpacity:"0.45"}),n.jsx("stop",{offset:"100%",stopColor:"#0d9488",stopOpacity:"0.45"})]}),n.jsxs("linearGradient",{id:"active-glow",x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[n.jsx("stop",{offset:"0%",stopColor:"#3b82f6",stopOpacity:"0.8"}),n.jsx("stop",{offset:"100%",stopColor:"#10b981",stopOpacity:"0.8"})]})]}),n.jsx("path",{d:se(.1),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),(M==="roocode"||P==="roocode")&&n.jsx("path",{d:se(.1),stroke:"#06b6d4",strokeWidth:"2.5",fill:"none",className:"animate-flow-cyan"}),n.jsx("path",{d:se(.3),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),(M==="cursor"||P==="cursor")&&n.jsx("path",{d:se(.3),stroke:"#06b6d4",strokeWidth:"2.5",fill:"none",className:"animate-flow-cyan"}),n.jsx("path",{d:se(.5),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),(M==="opencode"||P==="opencode")&&n.jsx("path",{d:se(.5),stroke:"#06b6d4",strokeWidth:"2.5",fill:"none",className:"animate-flow-cyan"}),n.jsx("path",{d:se(.7),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),(M==="zed"||P==="zed")&&n.jsx("path",{d:se(.7),stroke:"#06b6d4",strokeWidth:"2.5",fill:"none",className:"animate-flow-cyan"}),n.jsx("path",{d:se(.9),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),(M==="continue"||P==="continue")&&n.jsx("path",{d:se(.9),stroke:"#06b6d4",strokeWidth:"2.5",fill:"none",className:"animate-flow-cyan"}),n.jsx("path",{d:T(.12),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),ke("fast")&&n.jsx("path",{d:T(.12),stroke:"url(#active-glow)",strokeWidth:"2.5",fill:"none",className:"animate-flow-cyan"}),n.jsx("path",{d:T(.31),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),ke("heavy")&&n.jsx("path",{d:T(.31),stroke:"url(#active-glow)",strokeWidth:"2.5",fill:"none",className:"animate-flow-cyan"}),n.jsx("path",{d:T(.5),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),ke("coder")&&n.jsx("path",{d:T(.5),stroke:"url(#active-glow)",strokeWidth:"2.5",fill:"none",className:"animate-flow-cyan"}),n.jsx("path",{d:T(.69),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),ke("vision")&&n.jsx("path",{d:T(.69),stroke:"url(#active-glow)",strokeWidth:"2.5",fill:"none",className:"animate-flow-cyan"}),n.jsx("path",{d:T(.88),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),ke("scout")&&n.jsx("path",{d:T(.88),stroke:"url(#active-glow)",strokeWidth:"2.5",fill:"none",className:"animate-flow-cyan"})]}),n.jsxs("div",{className:"absolute cursor-pointer select-none z-10 w-28 h-8 -translate-y-1/2 -translate-x-1/2 rounded-xl border border-border/60 bg-card/75 backdrop-blur-md flex items-center justify-center gap-1.5 px-2 hover:border-primary transition-all text-[10px] font-semibold text-foreground shadow shadow-black/20",style:{left:"10%",top:"10%"},onMouseEnter:()=>F("roocode"),onMouseLeave:()=>F(null),onClick:()=>L(y=>y==="roocode"?null:"roocode"),children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-cyan-400 animate-pulse"}),n.jsx("span",{children:"Roo Code"})]}),n.jsxs("div",{className:"absolute cursor-pointer select-none z-10 w-28 h-8 -translate-y-1/2 -translate-x-1/2 rounded-xl border border-border/60 bg-card/75 backdrop-blur-md flex items-center justify-center gap-1.5 px-2 hover:border-primary transition-all text-[10px] font-semibold text-foreground shadow shadow-black/20",style:{left:"10%",top:"30%"},onMouseEnter:()=>F("cursor"),onMouseLeave:()=>F(null),onClick:()=>L(y=>y==="cursor"?null:"cursor"),children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-cyan-400 animate-pulse"}),n.jsx("span",{children:"Cursor IDE"})]}),n.jsxs("div",{className:"absolute cursor-pointer select-none z-10 w-28 h-8 -translate-y-1/2 -translate-x-1/2 rounded-xl border border-border/60 bg-card/75 backdrop-blur-md flex items-center justify-center gap-1.5 px-2 hover:border-primary transition-all text-[10px] font-semibold text-foreground shadow shadow-black/20",style:{left:"10%",top:"50%"},onMouseEnter:()=>F("opencode"),onMouseLeave:()=>F(null),onClick:()=>L(y=>y==="opencode"?null:"opencode"),children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-cyan-400 animate-pulse"}),n.jsx("span",{children:"OpenCode"})]}),n.jsxs("div",{className:"absolute cursor-pointer select-none z-10 w-28 h-8 -translate-y-1/2 -translate-x-1/2 rounded-xl border border-border/60 bg-card/75 backdrop-blur-md flex items-center justify-center gap-1.5 px-2 hover:border-primary transition-all text-[10px] font-semibold text-foreground shadow shadow-black/20",style:{left:"10%",top:"70%"},onMouseEnter:()=>F("zed"),onMouseLeave:()=>F(null),onClick:()=>L(y=>y==="zed"?null:"zed"),children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-cyan-400 animate-pulse"}),n.jsx("span",{children:"Zed"})]}),n.jsxs("div",{className:"absolute cursor-pointer select-none z-10 w-28 h-8 -translate-y-1/2 -translate-x-1/2 rounded-xl border border-border/60 bg-card/75 backdrop-blur-md flex items-center justify-center gap-1.5 px-2 hover:border-primary transition-all text-[10px] font-semibold text-foreground shadow shadow-black/20",style:{left:"10%",top:"90%"},onMouseEnter:()=>F("continue"),onMouseLeave:()=>F(null),onClick:()=>L(y=>y==="continue"?null:"continue"),children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-cyan-400 animate-pulse"}),n.jsx("span",{children:"Continue"})]}),n.jsxs("div",{className:"absolute select-none z-10 w-36 py-3 px-4 -translate-y-1/2 -translate-x-1/2 rounded-2xl border border-primary/50 bg-card/90 backdrop-blur-md flex flex-col items-center justify-center text-center shadow-lg shadow-primary/5",style:{left:"50%",top:"50%"},children:[n.jsx("div",{className:"text-[10px] uppercase font-bold text-primary font-space tracking-wide",children:"Gateway Auto"}),n.jsxs("div",{className:"text-[10px] font-mono text-muted-foreground mt-0.5",children:["Schwelle: > ",N!=null&&N.heavy_threshold_chars?N.heavy_threshold_chars/1e3:"4","k Zeichen"]}),n.jsx("div",{className:"mt-1 px-1.5 py-0.5 rounded bg-primary/10 border border-primary/20 text-[9px] font-semibold text-primary uppercase font-mono",children:"Auto-Swap"})]}),C0.map(y=>{var q;const x=["12%","31%","50%","69%","88%"],A=ue(y),V=A?p.includes(A.name):!1;if(y==="reasoning"||y==="agent")return null;const B={fast:0,heavy:1,coder:2,vision:3,scout:4}[y];return n.jsxs("div",{className:ie("absolute z-10 w-44 py-1.5 px-3 -translate-y-1/2 -translate-x-1/2 rounded-xl border flex flex-col justify-center hover:border-primary/50 transition-all text-left shadow select-none cursor-pointer",V?"border-emerald-500/50 bg-emerald-500/5 shadow-emerald-500/5":A?"border-border/60 bg-card/75":"border-dashed border-border/40 bg-background/20"),style:{left:"90%",top:x[B]},onClick:()=>k(O===y?null:y),children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground",children:y}),V&&n.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-400 animate-pulse"})]}),n.jsx("div",{className:"text-[10px] font-mono font-medium truncate mt-0.5 text-foreground max-w-[150px]",children:A?(q=A.name.split("/").pop())==null?void 0:q.replace(".gguf",""):"Keine Zuweisung"}),O===y&&n.jsxs("div",{className:"absolute right-0 top-full mt-1 z-35 w-52 rounded-xl border border-border/80 bg-popover/95 backdrop-blur-md p-1.5 shadow-2xl space-y-1",children:[n.jsx("div",{className:"text-[9px] uppercase font-bold text-muted-foreground/60 px-2 py-1 select-none",children:"Modell zuweisen:"}),n.jsx("button",{onClick:()=>ye(y,""),className:"w-full text-left px-2.5 py-1.5 rounded-lg text-[10px] hover:bg-accent text-red-400 font-semibold cursor-pointer",children:"Zuweisung entfernen"}),f.map(X=>{var de;return n.jsxs("button",{onClick:()=>ye(y,X.name),className:ie("w-full text-left px-2.5 py-1.5 rounded-lg text-[10px] hover:bg-accent flex items-center justify-between font-mono cursor-pointer",X.role===y?"text-primary font-bold":"text-foreground"),children:[n.jsx("span",{className:"truncate max-w-[150px]",children:(de=X.name.split("/").pop())==null?void 0:de.replace(".gguf","")}),X.role===y&&n.jsx(bn,{className:"h-3 w-3 shrink-0"})]},X.name)})]})]},y)}),P&&j&&n.jsxs("div",{className:"absolute z-30 md:w-96 w-[90%] rounded-2xl border border-border/80 bg-card/95 backdrop-blur-xl p-4 shadow-2xl space-y-3 flex flex-col justify-between",style:{left:"22%",top:P==="roocode"?"5%":P==="cursor"?"20%":P==="opencode"?"40%":P==="zed"?"55%":"65%"},children:[n.jsxs("div",{className:"flex items-center justify-between border-b border-border/20 pb-2",children:[n.jsxs("span",{className:"text-[11px] font-bold uppercase tracking-wider text-primary",children:[P==="roocode"&&"Roo Code Setup",P==="cursor"&&"Cursor Setup",P==="opencode"&&"OpenCode Setup",P==="zed"&&"Zed Setup",P==="continue"&&"Continue Setup"]}),n.jsx("button",{onClick:()=>L(null),className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground cursor-pointer",children:n.jsx(Qs,{className:"h-3.5 w-3.5"})})]}),n.jsxs("div",{className:"text-[10px] text-muted-foreground leading-relaxed space-y-2",children:[P==="roocode"&&n.jsxs("ul",{className:"list-decimal pl-4 space-y-1",children:[n.jsxs("li",{children:["Suche in VS Code nach der Erweiterung ",n.jsx("strong",{children:"Roo Code"})," und installiere sie."]}),n.jsxs("li",{children:["Wähle in den Roo Code Einstellungen: Provider: ",n.jsx("strong",{children:"OpenAI Compatible"}),"."]}),n.jsxs("li",{children:["Füge das untenstehende JSON-Snippet in die ",n.jsx("code",{children:"settings.json"})," ein."]})]}),P==="cursor"&&n.jsxs("ul",{className:"list-decimal pl-4 space-y-1",children:[n.jsxs("li",{children:["Öffne Cursor Settings ➔ ",n.jsx("strong",{children:"Models"}),"."]}),n.jsxs("li",{children:["Deaktiviere Cloud-Modelle, klappe ",n.jsx("strong",{children:"OpenAI API"})," auf."]}),n.jsxs("li",{children:["Trage die Base URL unten ein und aktiviere das Modell ",n.jsx("strong",{children:"auto"}),"."]})]}),P==="opencode"&&n.jsxs("ul",{className:"list-decimal pl-4 space-y-1",children:[n.jsxs("li",{children:["Öffne die ",n.jsx("code",{children:"opencode.jsonc"})," Konfigurationsdatei."]}),n.jsxs("li",{children:["Ersetze den Provider-Eintrag unter ",n.jsx("code",{children:"provider"})," mit dem Snippet unten."]})]}),P==="zed"&&n.jsxs("ul",{className:"list-decimal pl-4 space-y-1",children:[n.jsxs("li",{children:["Öffne die Zed Settings (",n.jsx("code",{children:"ctrl+,"}),")."]}),n.jsxs("li",{children:["Füge das untenstehende JSON-Segment unter ",n.jsx("code",{children:"language_models"})," ein."]})]}),P==="continue"&&n.jsxs("ul",{className:"list-decimal pl-4 space-y-1",children:[n.jsx("li",{children:"Klicke auf das Zahnrad-Symbol in der Continue-Erweiterung."}),n.jsxs("li",{children:["Füge den Gateway-Eintrag zum ",n.jsx("code",{children:"models"}),"-Array hinzu."]})]})]}),j.tools&&n.jsxs("div",{className:"relative rounded-xl border border-border/40 bg-black/40 overflow-hidden mt-1 shrink-0",children:[n.jsxs("div",{className:"flex items-center justify-between px-3 py-1.5 border-b border-border/20 bg-black/20",children:[n.jsx("span",{className:"text-[8px] font-mono text-muted-foreground",children:"JSON Config"}),n.jsxs("button",{onClick:()=>{var y,x,A,V,B;return Se(P==="roocode"?(y=j.tools.cline)==null?void 0:y.snippet:P==="cursor"?(x=j.tools.cursor)==null?void 0:x.snippet:P==="opencode"?(A=j.tools.opencode)==null?void 0:A.snippet:P==="zed"?(V=j.tools.zed)==null?void 0:V.snippet:(B=j.tools.continue)==null?void 0:B.snippet)},className:"text-[9px] font-semibold text-primary hover:text-primary-foreground flex items-center gap-1 cursor-pointer",children:[R?n.jsx(bn,{className:"h-3 w-3 text-emerald-400"}):n.jsx(xi,{className:"h-3 w-3"}),n.jsx("span",{children:R?"Kopiert":"Kopieren"})]})]}),n.jsx("pre",{className:"p-3 max-h-36 overflow-y-auto text-[9px] font-mono text-cyan-200/90 whitespace-pre scrollbar-thin select-text",children:n.jsxs("code",{children:[P==="roocode"&&((Ee=j.tools.cline)==null?void 0:Ee.snippet),P==="cursor"&&((Ne=j.tools.cursor)==null?void 0:Ne.snippet),P==="opencode"&&((K=j.tools.opencode)==null?void 0:K.snippet),P==="zed"&&((te=j.tools.zed)==null?void 0:te.snippet),P==="continue"&&((Z=j.tools.continue)==null?void 0:Z.snippet)]})})]})]})]}),n.jsxs("div",{className:"flex flex-wrap items-center gap-6 mt-3 text-[10px] text-muted-foreground border-t border-border/20 pt-3",children:[n.jsxs("span",{className:"flex items-center gap-1.5",children:[n.jsx("span",{className:"h-2 w-2 rounded-full bg-cyan-400"}),n.jsx("span",{children:"Cyan-Fluss: Client-Anfrage an Gateway"})]}),n.jsxs("span",{className:"flex items-center gap-1.5",children:[n.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-500 animate-pulse"}),n.jsx("span",{children:"Grüner Puls: Aktive Verbindung / Warmes Modell geladen"})]}),n.jsxs("span",{className:"flex items-center gap-1.5",children:[n.jsx("span",{className:"h-2 w-2 rounded bg-gradient-to-r from-teal-500 to-emerald-500"}),n.jsx("span",{children:"VRAM-Verlauf: Modellspezifischer Speicheranteil"})]})]})]}),n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-6 space-y-4 shadow-lg shadow-black/10",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(go,{className:"h-5 w-5 text-primary"}),n.jsx("h3",{className:"text-sm font-bold uppercase tracking-wider text-foreground",children:"SSH-Kopplung & Sandbox-Umgehung"})]}),n.jsxs("div",{className:"grid gap-6 md:grid-cols-2 text-xs text-muted-foreground leading-relaxed text-left",children:[n.jsxs("div",{className:"space-y-3",children:[n.jsx("h4",{className:"text-xs font-bold text-foreground",children:"1. Warum verweigert Hermes Aktionen auf dem PC?"}),n.jsx("p",{children:"Hermes ist standardmäßig so ausgerichtet, dass er sich als virtueller Assistent ohne Systemzugriff versteht. Um dies zu umgehen, musst du Hermes' **System-Prompt** in der Chat-WebUI anpassen."}),n.jsxs("div",{className:"p-3 bg-background/25 rounded-xl border border-border/30 font-mono text-[9px] text-cyan-300",children:[n.jsx("span",{className:"text-muted-foreground/60",children:"Beispiel System-Prompt Erweiterung:"}),n.jsx("br",{}),'"Du hast über das terminal-Tool vollen SSH-Zugriff auf den Windows-PC des Users (TobisPC). Nutze SSH-Befehle um Aktionen dort auszuführen, wenn danach gefragt wird. Behaupte nie, du könntest das nicht!"']})]}),n.jsxs("div",{className:"space-y-3",children:[n.jsx("h4",{className:"text-xs font-bold text-foreground",children:"2. SSH-Verbindung zum lokalen Windows-PC einrichten"}),n.jsx("p",{children:"Damit der Agent Befehle auf deinem PC ausführen kann, muss OpenSSH auf Windows aktiv und mit einem Key gekoppelt sein:"}),n.jsxs("ul",{className:"list-disc pl-4 space-y-1.5 text-[11px]",children:[n.jsxs("li",{children:[n.jsx("strong",{children:"OpenSSH Server auf Windows starten:"})," In PowerShell als Admin ausführen: ",n.jsx("code",{className:"text-foreground font-mono",children:"Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0"})]}),n.jsxs("li",{children:[n.jsx("strong",{children:"SSH-Key auf der Box erzeugen:"})," ",n.jsx("code",{className:"text-foreground font-mono",children:"ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519_hermes_agent"})]}),n.jsxs("li",{children:[n.jsx("strong",{children:"Key autorisieren:"})," Kopiere den Inhalt von ",n.jsx("code",{className:"text-foreground font-mono",children:"~/.ssh/id_ed25519_hermes_agent.pub"})," in deine Windows-Datei ",n.jsx("code",{className:"text-foreground font-mono",children:"C:\\Users\\TobisPC\\.ssh\\authorized_keys"})]})]})]})]})]}),!s.gateway_reachable&&n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-6 space-y-4 shadow-lg shadow-black/10 text-left",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(go,{className:"h-5 w-5 text-amber-500"}),n.jsx("h3",{className:"text-sm font-bold uppercase tracking-wider text-foreground",children:"Hermes-Agent Diagnostics"})]}),n.jsxs("div",{className:"text-xs text-muted-foreground space-y-3 leading-relaxed",children:[n.jsx("p",{children:"Der Hermes-Dienst ist auf der Box derzeit offline oder kann sich nicht mit dem lokalen llama-swap verbinden."}),n.jsxs("p",{children:["Stelle sicher, dass die systemd-Dienste auf der Box laufen. Du kannst den Status im ",n.jsx("strong",{children:"OS & Updates Drawer"})," prüfen und die Dienste bei Bedarf neu starten."]}),n.jsxs("div",{className:"p-3.5 bg-background/25 rounded-xl border border-border/30 font-mono text-[10px] space-y-1",children:[n.jsx("div",{className:"text-muted-foreground/60",children:"# Dienste manuell auf der Box prüfen:"}),n.jsx("div",{className:"text-primary",children:"systemctl --user status hermes-gateway"}),n.jsx("div",{className:"text-primary",children:"systemctl --user status hermes-webui"})]}),n.jsxs("p",{children:["Weitere Einrichtungsdetails (Brain-Konfiguration, MCP-Kopplungen, SSH-Tunneling und Such-Engines) findest du in der Dokumentationsdatei:",n.jsx("code",{className:"ml-1 px-1.5 py-0.5 rounded bg-muted/40 text-foreground border border-border/30",children:"docs/HERMES_SETUP.md"}),"."]})]})]})]})]})}function _0(){const[s,u]=m.useState("roocode"),[a,c]=m.useState(null),f="192.168.178.151",[h,p]=m.useState(!1),[g,N]=m.useState(null);function C(){p(!0),ce("/api/health").then(j=>{c(j),N(j.engine_reachable?"success":"partial")}).catch(()=>{c(null),N("fail")}).finally(()=>p(!1))}return m.useEffect(()=>{C()},[]),n.jsxs("div",{className:"space-y-6",children:[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:"Stack-Anleitung & Vibe-Coding-Guide"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Einsteigerfreundliche Erklärungen zu deinem Stack und Schritt-für-Schritt-Anleitungen zur Anbindung deiner Editoren."})]}),n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10 flex flex-col sm:flex-row justify-between sm:items-center gap-4",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("span",{className:ie("h-3 w-3 rounded-full ring-2 ring-black/40",g==="success"&&"bg-emerald-500 animate-pulse",g==="partial"&&"bg-amber-500",g==="fail"&&"bg-red-500",!g&&"bg-muted")}),n.jsxs("div",{children:[n.jsx("div",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"Lokaler Verbindungs-Check"}),n.jsxs("div",{className:"text-[10px] text-muted-foreground mt-0.5 font-mono",children:[g==="success"&&`Erfolgreich! Dein PC hat Zugriff auf das Box-Gateway (v${(a==null?void 0:a.version)||""}).`,g==="partial"&&"Gateway erreichbar, aber die llama-cpp-Engine ist offline.",g==="fail"&&"Verbindung fehlgeschlagen. Ist die Box im selben LAN-Netzwerk?",!g&&"Verbindung wird geprüft..."]})]})]}),n.jsxs("button",{onClick:C,disabled:h,className:"h-8 px-3 flex items-center gap-1.5 text-xs font-semibold rounded-lg border border-border/60 bg-background/20 hover:border-primary/50 transition-colors disabled:opacity-50 cursor-pointer self-start sm:self-auto shrink-0",children:[n.jsx(kn,{className:ie("h-3.5 w-3.5",h&&"animate-spin")}),n.jsx("span",{children:"Testen"})]})]}),n.jsxs("div",{className:"space-y-3",children:[n.jsxs("div",{className:"flex items-center gap-2 px-1",children:[n.jsx(Xd,{className:"h-4.5 w-4.5 text-primary"}),n.jsx("h2",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"Wie funktioniert mein Stack?"})]}),n.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[n.jsxs("div",{className:"p-4 rounded-xl border border-border/60 bg-card/20 space-y-2",children:[n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx(Dr,{className:"h-4 w-4 text-cyan-400"}),n.jsx("h3",{className:"text-xs font-bold text-foreground",children:"1. Die Zentrale"})]}),n.jsx("p",{className:"text-[11px] text-muted-foreground leading-relaxed",children:"Dein Dashboard. Hier siehst du die CPU-/RAM- und GPU-Last der Box und siehst sofort, ob Updates anstehen."})]}),n.jsxs("div",{className:"p-4 rounded-xl border border-border/60 bg-card/20 space-y-2",children:[n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx(Ws,{className:"h-4 w-4 text-violet-400"}),n.jsx("h3",{className:"text-xs font-bold text-foreground",children:"2. Modell-Zentrale"})]}),n.jsxs("p",{className:"text-[11px] text-muted-foreground leading-relaxed",children:["Deine GGUF-Datenbank. Gesteuert von ",n.jsx("strong",{children:"llama-swap"}),". Lädt dein schnelles Alltags-Hirn (`fast`) oder dein schweres Logik-Hirn (`heavy`) vollautomatisch im VRAM."]})]}),n.jsxs("div",{className:"p-4 rounded-xl border border-border/60 bg-card/20 space-y-2",children:[n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx(Ks,{className:"h-4 w-4 text-indigo-400"}),n.jsx("h3",{className:"text-xs font-bold text-foreground",children:"3. Das Gedächtnis"})]}),n.jsx("p",{className:"text-[11px] text-muted-foreground leading-relaxed",children:"Dein geteiltes Langzeitgedächtnis (Memory-Pool). Hier merkt sich dein Agent Regeln, Projekt-Details und Vorlieben."})]})]})]}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex items-center gap-2 px-1",children:[n.jsx(Jd,{className:"h-4.5 w-4.5 text-primary"}),n.jsx("h2",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"Vibe Coding auf dem PC einrichten"})]}),n.jsxs("div",{className:"flex gap-1.5 bg-card/20 p-1 border border-border/40 rounded-xl max-w-fit",children:[n.jsxs("button",{onClick:()=>u("roocode"),className:ie("rounded-lg px-4 py-1.5 text-xs font-semibold tracking-wide uppercase transition-all cursor-pointer flex items-center gap-1.5",s==="roocode"?"bg-primary text-primary-foreground shadow-md shadow-primary/10":"text-muted-foreground hover:text-foreground"),children:[n.jsx(rf,{className:"h-3.5 w-3.5 fill-amber-400/20"}),"Roo Code (VS Code)"]}),n.jsx("button",{onClick:()=>u("cursor"),className:ie("rounded-lg px-4 py-1.5 text-xs font-semibold tracking-wide uppercase transition-all cursor-pointer",s==="cursor"?"bg-primary text-primary-foreground shadow-md shadow-primary/10":"text-muted-foreground hover:text-foreground"),children:"Cursor IDE"}),n.jsx("button",{onClick:()=>u("opencode"),className:ie("rounded-lg px-4 py-1.5 text-xs font-semibold tracking-wide uppercase transition-all cursor-pointer",s==="opencode"?"bg-primary text-primary-foreground shadow-md shadow-primary/10":"text-muted-foreground hover:text-foreground"),children:"OpenCode Desktop"})]}),n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-6 space-y-4 shadow-lg shadow-black/10",children:[s==="roocode"&&n.jsxs("div",{className:"space-y-4 text-xs leading-relaxed text-muted-foreground",children:[n.jsxs("div",{className:"space-y-1",children:[n.jsx("h3",{className:"text-sm font-bold text-foreground",children:"Roo Code Kopplung (Empfohlene Open-Source-Erweiterung)"}),n.jsx("p",{children:"Roo Code ist die beliebteste und flexibelste Vibe-Coding-Erweiterung für VS Code im Jahr 2026. Sie ermöglicht vollen Zugriff auf das Terminal und das MCP-Gedächtnis."})]}),n.jsxs("div",{className:"space-y-3.5 border-t border-border/20 pt-4",children:[n.jsxs("div",{className:"space-y-1",children:[n.jsxs("div",{className:"font-semibold text-foreground flex items-center gap-1.5",children:[n.jsx("span",{className:"h-4.5 w-4.5 rounded-full bg-primary/20 text-primary flex items-center justify-center font-mono text-[10px]",children:"1"}),"Roo Code installieren"]}),n.jsxs("p",{className:"pl-6",children:["Suche in VS Code nach der Erweiterung ",n.jsx("strong",{children:"Roo Code"})," und installiere sie."]})]}),n.jsxs("div",{className:"space-y-1",children:[n.jsxs("div",{className:"font-semibold text-foreground flex items-center gap-1.5",children:[n.jsx("span",{className:"h-4.5 w-4.5 rounded-full bg-primary/20 text-primary flex items-center justify-center font-mono text-[10px]",children:"2"}),"API-Anbindung konfigurieren"]}),n.jsx("p",{className:"pl-6",children:"Klicke auf das Roo-Code-Symbol in der Sidebar, öffne die Einstellungen (Zahnrad) und stelle folgendes ein:"}),n.jsx("div",{className:"pl-6 pt-1",children:n.jsxs("div",{className:"p-3 bg-background/25 rounded-xl border border-border/30 font-mono text-[10px] space-y-1 text-foreground",children:[n.jsxs("div",{children:[n.jsx("span",{className:"text-muted-foreground/60",children:"API Provider:"})," OpenAI Compatible"]}),n.jsxs("div",{children:[n.jsx("span",{className:"text-muted-foreground/60",children:"Base URL:"})," http://",f,":9001/v1"]}),n.jsxs("div",{children:[n.jsx("span",{className:"text-muted-foreground/60",children:"API Key:"})," ",n.jsx("span",{className:"italic text-muted-foreground/50",children:'beliebig (z.B. "local")'})]}),n.jsxs("div",{children:[n.jsx("span",{className:"text-muted-foreground/60",children:"Model ID:"})," auto"]})]})})]}),n.jsxs("div",{className:"space-y-1",children:[n.jsxs("div",{className:"font-semibold text-foreground flex items-center gap-1.5",children:[n.jsx("span",{className:"h-4.5 w-4.5 rounded-full bg-primary/20 text-primary flex items-center justify-center font-mono text-[10px]",children:"3"}),"MCP Gedächtnis verknüpfen (Optional, aber empfohlen)"]}),n.jsxs("p",{className:"pl-6",children:["Damit Roo Code auf deinen ",n.jsx("strong",{children:"Gedächtnis-Pool"})," zugreifen kann, kopiere die MCP-Konfiguration aus dem Reiter ",n.jsx("strong",{children:"Verbinden"})," und füge sie in deine lokale Roo-Code-Konfigurationsdatei ein."]})]})]})]}),s==="cursor"&&n.jsxs("div",{className:"space-y-4 text-xs leading-relaxed text-muted-foreground",children:[n.jsxs("div",{className:"space-y-1",children:[n.jsx("h3",{className:"text-sm font-bold text-foreground",children:"Cursor IDE Kopplung (Proprietäre All-in-One IDE)"}),n.jsx("p",{children:"Cursor ist ein polierter, extrem schneller VS-Code-Fork mit hervorragenden, tief integrierten Autovervollständigungen (Tab-Completions)."})]}),n.jsxs("div",{className:"space-y-3.5 border-t border-border/20 pt-4",children:[n.jsxs("div",{className:"space-y-1",children:[n.jsxs("div",{className:"font-semibold text-foreground flex items-center gap-1.5",children:[n.jsx("span",{className:"h-4.5 w-4.5 rounded-full bg-primary/20 text-primary flex items-center justify-center font-mono text-[10px]",children:"1"}),"Einstellungen öffnen"]}),n.jsxs("p",{className:"pl-6",children:["Öffne Cursor, klicke oben rechts auf das Zahnrad (Settings) und navigiere zu ",n.jsx("strong",{children:"Models"}),"."]})]}),n.jsxs("div",{className:"space-y-1",children:[n.jsxs("div",{className:"font-semibold text-foreground flex items-center gap-1.5",children:[n.jsx("span",{className:"h-4.5 w-4.5 rounded-full bg-primary/20 text-primary flex items-center justify-center font-mono text-[10px]",children:"2"}),"OpenAI API überschreiben"]}),n.jsxs("p",{className:"pl-6",children:["Deaktiviere die Standard-Cloudmodelle, klappe den Bereich ",n.jsx("strong",{children:"OpenAI API"})," auf und konfiguriere:"]}),n.jsx("div",{className:"pl-6 pt-1",children:n.jsxs("div",{className:"p-3 bg-background/25 rounded-xl border border-border/30 font-mono text-[10px] space-y-1 text-foreground",children:[n.jsxs("div",{children:[n.jsx("span",{className:"text-muted-foreground/60",children:"Override Base URL:"})," http://",f,":9001/v1"]}),n.jsxs("div",{children:[n.jsx("span",{className:"text-muted-foreground/60",children:"API Key:"})," ",n.jsx("span",{className:"italic text-muted-foreground/50",children:'beliebig (z.B. "local")'})]})]})})]}),n.jsxs("div",{className:"space-y-1",children:[n.jsxs("div",{className:"font-semibold text-foreground flex items-center gap-1.5",children:[n.jsx("span",{className:"h-4.5 w-4.5 rounded-full bg-primary/20 text-primary flex items-center justify-center font-mono text-[10px]",children:"3"}),"Modell hinzufügen"]}),n.jsxs("p",{className:"pl-6",children:["Trage in der Modell-Liste ein neues Modell mit dem Namen ",n.jsx("strong",{children:"auto"})," ein und wähle es als aktives Modell aus. Cursor leitet ab jetzt alle deine Anfragen an die Box weiter."]})]})]})]}),s==="opencode"&&n.jsxs("div",{className:"space-y-4 text-xs leading-relaxed text-muted-foreground",children:[n.jsxs("div",{className:"space-y-1",children:[n.jsx("h3",{className:"text-sm font-bold text-foreground",children:"OpenCode Desktop Kopplung (Open-Source Vibe-Coding-App)"}),n.jsx("p",{children:"OpenCode ist eine standalone Desktop-App für ein ablenkungsfreies Coden über natürliche Sprache. Es trennt den KI-Prozess von deinem Editor."})]}),n.jsxs("div",{className:"space-y-3.5 border-t border-border/20 pt-4",children:[n.jsxs("div",{className:"space-y-1",children:[n.jsxs("div",{className:"font-semibold text-foreground flex items-center gap-1.5",children:[n.jsx("span",{className:"h-4.5 w-4.5 rounded-full bg-primary/20 text-primary flex items-center justify-center font-mono text-[10px]",children:"1"}),"OpenCode Desktop herunterladen"]}),n.jsx("p",{className:"pl-6",children:"Lade die Desktop-Anwendung von der offiziellen Website (opencode.ai) herunter und starte sie."})]}),n.jsxs("div",{className:"space-y-1",children:[n.jsxs("div",{className:"font-semibold text-foreground flex items-center gap-1.5",children:[n.jsx("span",{className:"h-4.5 w-4.5 rounded-full bg-primary/20 text-primary flex items-center justify-center font-mono text-[10px]",children:"2"}),"Endpunkt auf Box-Gateway setzen"]}),n.jsx("p",{className:"pl-6",children:"Gehe in den Bereich Einstellungen ➔ Provider, deaktiviere die Cloud-Voreinstellungen und trage deinen lokalen Server ein:"}),n.jsx("div",{className:"pl-6 pt-1",children:n.jsxs("div",{className:"p-3 bg-background/25 rounded-xl border border-border/30 font-mono text-[10px] space-y-1 text-foreground",children:[n.jsxs("div",{children:[n.jsx("span",{className:"text-muted-foreground/60",children:"Base URL:"})," http://",f,":9001/v1"]}),n.jsxs("div",{children:[n.jsx("span",{className:"text-muted-foreground/60",children:"Model:"})," auto"]})]})})]}),n.jsxs("div",{className:"space-y-1",children:[n.jsxs("div",{className:"font-semibold text-foreground flex items-center gap-1.5",children:[n.jsx("span",{className:"h-4.5 w-4.5 rounded-full bg-primary/20 text-primary flex items-center justify-center font-mono text-[10px]",children:"3"}),"Erster Vibe-Coding Test"]}),n.jsx("p",{className:"pl-6",children:'Starte eine neue Session und teste die Verbindung mit einem einfachen Prompt, z. B. *"Erstelle ein einfaches Skript, das die Fibonaccizahlen berechnet"*. Das Box-Gateway tauscht das Modell im Hintergrund vollautomatisch aus.'})]})]})]})]})]}),n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 space-y-3 shadow-lg shadow-black/10",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(yi,{className:"h-4.5 w-4.5 text-primary"}),n.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"Was tun, wenn das Coden hakt?"})]}),n.jsxs("ul",{className:"text-[11px] text-muted-foreground space-y-2 list-disc pl-4 leading-relaxed",children:[n.jsxs("li",{children:[n.jsx("strong",{children:"Keine Verbindung?"})," Überprüfe im Live-Verbindungsprüfer oben, ob die Box-IP erreichbar ist. Stelle sicher, dass dein lokaler PC im selben WLAN/LAN-Netzwerk wie die Box eingeloggt ist."]}),n.jsxs("li",{children:[n.jsx("strong",{children:"Modell antwortet nicht?"})," Schaue unter ",n.jsx("strong",{children:"Diagnose"}),", ob der Dienst `llama-swap` aktiv (grün) ist. Wenn nicht, klicke daneben auf ",n.jsx("strong",{children:"Restart"}),"."]}),n.jsxs("li",{children:[n.jsx("strong",{children:"Hermes Agent reagiert merkwürdig?"})," Starte in der Hermes WebUI einfach eine frische Session (neuen Chat). Ältere Chats sammeln Kontext-Müll an."]})]})]})]})}function P0({title:s,hint:u}){return n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{children:[n.jsx("h1",{className:"text-xl font-semibold",children:s}),n.jsx("p",{className:"text-sm text-muted-foreground",children:u})]}),n.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 rounded-xl border border-dashed border-border bg-card/50 py-20 text-center",children:[n.jsx(uh,{className:"h-8 w-8 text-muted-foreground"}),n.jsx("div",{className:"text-sm text-muted-foreground",children:"Kommt in einer späteren Phase."})]})]})}const M0=[{id:"llama-swap",label:"Llama Swap",type:"system"},{id:"mission-control-2",label:"Mission Control 2",type:"user"},{id:"hermes-gateway",label:"Hermes Gateway",type:"user"},{id:"hermes-dashboard",label:"Hermes Dashboard",type:"user"},{id:"hermes-webui",label:"Hermes WebUI",type:"user"}];function oi(s){return s==null?"":s>1024**3?`${(s/1024**3).toFixed(2)} GB`:`${(s/1024**2).toFixed(1)} MB`}function R0({open:s,onClose:u,defaultTab:a="maintenance"}){const[c,f]=m.useState(null),[h,p]=m.useState([]),[g,N]=m.useState("llama-swap"),[C,j]=m.useState(""),[_,P]=m.useState(!1),[L,O]=m.useState({}),[k,R]=m.useState("maintenance");m.useEffect(()=>{s&&a&&R(a)},[s,a]);const D=m.useRef(null);function M(){ce("/api/maintenance/updates").then(f).catch(T=>console.error("Error loading updates",T))}function F(){ce("/api/jobs").then(T=>p(T.jobs||[])).catch(T=>console.error("Error loading jobs",T))}function G(T){P(!0),ce(`/api/maintenance/logs?service=${T}&lines=150`).then(ae=>{ae.ok?j(ae.text):j(`Fehler beim Laden der Logs: ${ae.err||"Unbekannter Fehler"}`)}).catch(ae=>j(`Fehler: ${ae.message}`)).finally(()=>{P(!1),setTimeout(()=>{D.current&&(D.current.scrollTop=D.current.scrollHeight)},50)})}m.useEffect(()=>{if(!s)return;M(),F();const T=setInterval(()=>{F(),M()},3e3);return()=>clearInterval(T)},[s]),m.useEffect(()=>{!s||k!=="logs"||G(g)},[s,k,g]);async function Y(){try{await ce("/api/maintenance/os-update",{method:"POST"}),F(),R("maintenance")}catch(T){alert(`Fehler beim Starten des OS-Updates: ${T.message}`)}}async function Q(){try{await ce("/api/maintenance/engine-update",{method:"POST"}),F(),R("maintenance")}catch(T){alert(`Fehler: ${T.message}`)}}async function ee(){if(confirm("Bist du sicher, dass du das gesamte Host-System neu starten willst?"))try{await ce("/api/maintenance/reboot",{method:"POST"}),alert("Reboot ausgelöst. System startet neu..."),u()}catch(T){alert(`Fehler: ${T.message}`)}}async function ve(T){O(ae=>({...ae,[T]:!0}));try{const ae=await ce("/api/maintenance/restart",{method:"POST",body:JSON.stringify({service:T})});ae.ok?(alert(`Dienst ${T} wurde erfolgreich neu gestartet.`),k==="logs"&&g===T&&G(T)):alert(`Fehler beim Neustart: ${ae.err||"Unbekannter Fehler"}`)}catch(ae){alert(`Fehler: ${ae.message}`)}finally{O(ae=>({...ae,[T]:!1}))}}async function se(T){try{await ce(`/api/jobs/${T}/cancel`,{method:"POST"}),F()}catch(ae){alert(`Fehler beim Abbrechen: ${ae.message}`)}}return n.jsxs(n.Fragment,{children:[n.jsx("div",{className:ie("fixed inset-0 bg-black/60 backdrop-blur-sm z-50 transition-opacity duration-300",s?"opacity-100 pointer-events-auto":"opacity-0 pointer-events-none"),onClick:u}),n.jsxs("div",{className:ie("fixed inset-y-0 right-0 w-full sm:w-[500px] bg-card/85 backdrop-blur-xl border-l border-border/60 shadow-2xl z-50 flex flex-col transform transition-transform duration-300 ease-in-out font-sans text-foreground",s?"translate-x-0":"translate-x-full"),children:[n.jsxs("div",{className:"flex h-16 shrink-0 items-center justify-between border-b border-border/40 px-6",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(Dr,{className:"h-4.5 w-4.5 text-primary"}),n.jsx("h2",{className:"text-sm font-semibold tracking-wide uppercase font-space",children:"OS-Zentrale & Pflege"})]}),n.jsx("button",{onClick:u,className:"flex h-8 w-8 items-center justify-center rounded-lg border border-border/40 text-muted-foreground hover:bg-accent transition-colors",children:n.jsx(Qs,{className:"h-4 w-4"})})]}),n.jsxs("div",{className:"flex border-b border-border/40 px-6",children:[n.jsx("button",{onClick:()=>R("maintenance"),className:ie("flex-1 py-3 text-xs font-semibold uppercase tracking-wider border-b-2 text-center transition-all",k==="maintenance"?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"),children:"System-Wartung"}),n.jsx("button",{onClick:()=>R("logs"),className:ie("flex-1 py-3 text-xs font-semibold uppercase tracking-wider border-b-2 text-center transition-all",k==="logs"?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"),children:"System-Logs"})]}),n.jsx("div",{className:"flex-1 overflow-y-auto p-6 space-y-6",children:k==="maintenance"?n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"space-y-3",children:[n.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Wartungsaktionen"}),n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n.jsxs("button",{onClick:Y,className:"flex flex-col items-start gap-1 p-4 rounded-xl border border-border/60 bg-background/20 hover:border-primary/50 transition-all text-left group",children:[n.jsx(go,{className:"h-5 w-5 text-cyan-400 mb-1 group-hover:scale-105 transition-transform"}),n.jsx("span",{className:"text-xs font-semibold",children:"OS Update (apt)"}),n.jsx("span",{className:"text-[10px] text-muted-foreground",children:c!=null&&c.os?`${c.os} Updates verfügbar`:"Auf neuestem Stand"})]}),n.jsxs("button",{onClick:Q,className:"flex flex-col items-start gap-1 p-4 rounded-xl border border-border/60 bg-background/20 hover:border-primary/50 transition-all text-left group",children:[n.jsx(yh,{className:"h-5 w-5 text-violet-400 mb-1 group-hover:scale-105 transition-transform"}),n.jsx("span",{className:"text-xs font-semibold",children:"Engine Update"}),n.jsx("span",{className:"text-[10px] text-muted-foreground",children:c!=null&&c.engine?"Update verfügbar":"Auf neuestem Stand"})]})]}),n.jsxs("button",{onClick:ee,className:"flex w-full items-center gap-3 p-3 rounded-xl border border-red-500/20 bg-red-500/5 hover:bg-red-500/10 text-red-400 transition-all text-left text-xs font-semibold",children:[n.jsx(tf,{className:"h-4.5 w-4.5"}),n.jsxs("div",{children:[n.jsx("div",{children:"Host-System neu starten (Reboot)"}),n.jsx("div",{className:"text-[10px] text-red-400/80 font-normal",children:"Startet das gesamte Betriebssystem des Homelabs neu"})]})]})]}),n.jsxs("div",{className:"space-y-3",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Hintergrund-Aufgaben"}),n.jsxs("span",{className:"text-[10px] font-mono bg-primary/10 text-primary px-1.5 py-0.5 rounded-full",children:[h.filter(T=>T.state==="running"||T.state==="queued").length," Aktiv"]})]}),n.jsx("div",{className:"space-y-3",children:h.length===0?n.jsx("div",{className:"text-xs text-muted-foreground border border-dashed border-border/60 rounded-xl p-6 text-center",children:"Aktuell keine aktiven Hintergrund-Jobs."}):h.map(T=>{const ae=T.state==="running"||T.state==="queued";return n.jsxs("div",{className:ie("p-3 rounded-xl border transition-all duration-300",ae?"border-primary/40 bg-primary/5 shadow-md shadow-primary/5":"border-border/40 bg-background/20 opacity-80"),children:[n.jsxs("div",{className:"flex items-start justify-between gap-3",children:[n.jsxs("div",{className:"space-y-1",children:[n.jsxs("div",{className:"text-xs font-semibold flex items-center gap-1.5",children:[ae&&n.jsxs("span",{className:"flex h-2 w-2 relative",children:[n.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-primary opacity-75"}),n.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-primary"})]}),T.label]}),n.jsxs("div",{className:"text-[10px] font-mono text-muted-foreground uppercase flex items-center gap-2",children:[n.jsxs("span",{children:["ID: ",T.id]}),n.jsx("span",{children:"•"}),n.jsx("span",{className:ie(T.state==="done"&&"text-emerald-400",T.state==="failed"&&"text-red-400",T.state==="running"&&"text-primary",T.state==="queued"&&"text-amber-400",T.state==="canceled"&&"text-muted-foreground"),children:T.state})]})]}),ae&&n.jsx("button",{onClick:()=>se(T.id),className:"text-[10px] font-semibold text-red-400 hover:text-red-300 border border-red-500/20 bg-red-500/5 hover:bg-red-500/10 px-2 py-0.5 rounded transition-colors",children:"Abbrechen"})]}),T.state==="running"&&n.jsxs("div",{className:"mt-3 space-y-1",children:[n.jsx("div",{className:"w-full h-1.5 bg-muted rounded-full overflow-hidden",children:n.jsx("div",{className:"h-full bg-primary transition-all duration-500",style:{width:`${T.progress??0}%`}})}),n.jsxs("div",{className:"flex justify-between items-center text-[9px] font-mono text-muted-foreground",children:[n.jsxs("span",{children:[T.progress??0,"%"]}),T.done_bytes!=null&&T.total_bytes!=null&&n.jsxs("span",{children:[oi(T.done_bytes)," / ",oi(T.total_bytes),T.rate_bps!=null&&` (${oi(T.rate_bps)}/s)`]}),T.eta_s!=null&&n.jsxs("span",{children:["ETA: ",T.eta_s,"s"]})]})]})]},T.id)})})]})]}):n.jsxs("div",{className:"flex flex-col h-full space-y-4",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("select",{value:g,onChange:T=>N(T.target.value),className:"flex-1 h-9 px-3 text-xs bg-background/40 border border-border/60 rounded-lg outline-none text-foreground font-semibold",children:M0.map(T=>n.jsxs("option",{value:T.id,children:[T.label," (",T.type==="system"?"systemd-root":"user",")"]},T.id))}),n.jsxs("button",{onClick:()=>ve(g),disabled:L[g],className:"flex h-9 px-3 items-center gap-1.5 text-xs font-semibold rounded-lg border border-border/60 bg-background/20 hover:border-primary/50 transition-colors disabled:opacity-50",title:"Dienst neu starten",children:[n.jsx(kn,{className:ie("h-3.5 w-3.5",L[g]&&"animate-spin")}),"Restart"]})]}),n.jsxs("div",{className:"flex-1 flex flex-col min-h-[300px] border border-border/60 bg-black/50 rounded-xl overflow-hidden shadow-inner",children:[n.jsxs("div",{className:"flex h-9 items-center justify-between px-4 border-b border-border/40 bg-black/30 shrink-0",children:[n.jsxs("div",{className:"flex items-center gap-1.5 text-[10px] font-mono text-muted-foreground",children:[n.jsx(yi,{className:"h-3 w-3 text-primary"}),n.jsxs("span",{children:["stdout/stderr - ",g]})]}),n.jsx("button",{onClick:()=>G(g),disabled:_,className:"text-muted-foreground hover:text-foreground transition-colors",children:n.jsx(kn,{className:ie("h-3 w-3",_&&"animate-spin")})})]}),n.jsx("pre",{ref:D,className:"flex-1 p-4 overflow-y-auto text-[10px] font-mono text-cyan-300/90 whitespace-pre-wrap select-text leading-relaxed scrollbar-thin",children:_&&!C?n.jsx("span",{className:"text-muted-foreground",children:"Lade Logs..."}):C||n.jsx("span",{className:"text-muted-foreground",children:"Keine Logeinträge vorhanden."})})]})]})})]})]})}function z0(){var L,O,k,R,D;const[s,u]=m.useState("dashboard"),[a,c]=m.useState(null),[f,h]=m.useState(()=>localStorage.getItem("mc_sidebar_collapsed")==="true"),[p,g]=m.useState(null),[N,C]=m.useState(!1),[j,_]=m.useState("maintenance");m.useEffect(()=>{const M=()=>ce("/api/health").then(c).catch(()=>c(null));M();const F=setInterval(M,1e4);return()=>clearInterval(F)},[]),m.useEffect(()=>{const M=()=>ce("/api/system/status").then(g).catch(()=>{});M();const F=setInterval(M,2e4);return()=>clearInterval(F)},[]),m.useEffect(()=>{document.documentElement.classList.add("dark")},[]),m.useEffect(()=>{const M=F=>{var Y;_(((Y=F.detail)==null?void 0:Y.tab)||"maintenance"),C(!0)};return window.addEventListener("open-system-drawer",M),()=>window.removeEventListener("open-system-drawer",M)},[]);const P=ai.find(M=>M.id===s);return n.jsxs("div",{className:"flex h-full relative",children:[n.jsxs("div",{className:"fixed inset-0 -z-50 pointer-events-none overflow-hidden bg-[hsl(224,30%,6%)]",children:[n.jsx("div",{className:"absolute inset-0 opacity-35 animate-aurora bg-gradient-to-tr from-teal-500/20 via-indigo-500/15 to-purple-500/20 blur-[130px]"}),n.jsx("div",{className:"absolute top-[-10%] left-[-10%] h-[50%] w-[50%] rounded-full bg-teal-500/15 blur-[160px]"}),n.jsx("div",{className:"absolute bottom-[-10%] right-[-10%] h-[50%] w-[50%] rounded-full bg-purple-500/15 blur-[160px]"}),n.jsx("div",{className:"absolute top-[30%] right-[20%] h-[40%] w-[40%] rounded-full bg-indigo-500/10 blur-[140px]"})]}),n.jsx(zx,{onNavigate:u}),n.jsx(R0,{open:N,onClose:()=>C(!1),defaultTab:j}),n.jsxs("aside",{className:ie("flex shrink-0 flex-col border-r border-border/40 bg-card/45 backdrop-blur-md transition-all duration-300 ease-in-out",f?"w-16":"w-60"),children:[n.jsxs("div",{className:ie("flex items-center py-4 border-b border-border/40 shrink-0",f?"flex-col gap-3 px-2":"justify-between px-5"),children:[n.jsxs("div",{className:"flex items-center gap-2 overflow-hidden",children:[n.jsx("div",{className:"h-7 w-7 rounded-lg bg-primary shadow-md shadow-primary/20 shrink-0"}),!f&&n.jsxs("div",{className:"leading-tight",children:[n.jsx("div",{className:"text-sm font-semibold tracking-wide font-space",children:"Mission Control"}),n.jsx("div",{className:"text-xs text-muted-foreground",children:"2.0"})]})]}),n.jsx("button",{onClick:()=>{h(M=>{const F=!M;return localStorage.setItem("mc_sidebar_collapsed",F.toString()),F})},className:"p-1 rounded-md hover:bg-accent text-muted-foreground transition-colors cursor-pointer",title:f?"Maximieren":"Minimieren",children:f?n.jsx(nh,{className:"h-4 w-4"}):n.jsx(rh,{className:"h-4 w-4"})})]}),n.jsx("nav",{className:"flex-1 space-y-1 px-3 py-4 overflow-y-auto",children:ai.map(M=>n.jsxs("button",{onClick:()=>u(M.id),className:ie("flex w-full items-center rounded-md text-sm transition-all cursor-pointer",f?"justify-center p-2.5":"gap-3 px-3 py-2",s===M.id?"bg-primary/15 text-primary shadow-sm shadow-primary/5":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),title:f?M.label:void 0,children:[n.jsx(M.icon,{className:"h-4.5 w-4.5 shrink-0"}),!f&&n.jsx("span",{className:"truncate",children:M.label})]},M.id))}),n.jsx("div",{className:ie("py-3 text-xs text-muted-foreground border-t border-border/40 shrink-0",f?"px-2 text-center":"px-5"),children:f?n.jsx("div",{className:"flex justify-center",children:n.jsx("span",{className:ie("h-2.5 w-2.5 rounded-full ring-2 ring-black/40",a?a.engine_reachable?"bg-emerald-500 animate-pulse":"bg-amber-500":"bg-red-500"),title:a?`Engine ${a.engine_reachable?"online":"offline"}`:"Backend offline"})}):n.jsxs("div",{className:"space-y-2 text-left",children:[a?n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx("span",{className:ie("h-2 w-2 rounded-full animate-pulse",a.engine_reachable?"bg-emerald-500":"bg-amber-500")}),n.jsxs("span",{className:"truncate",children:["Engine ",a.engine_reachable?"online":"offline"]})]}):n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"h-2 w-2 rounded-full bg-red-500"})," ",n.jsx("span",{className:"truncate",children:"Backend offline"})]}),(p==null?void 0:p.versions)&&n.jsxs("div",{className:"space-y-1 text-[9px] text-muted-foreground/60 mt-2 pt-2 border-t border-border/30",children:[n.jsxs("div",{className:"truncate",title:p.versions.mc2?`${p.versions.mc2.branch}-${p.versions.mc2.hash}${p.versions.mc2.dirty?"*":""} (${p.versions.mc2.date})`:"nicht gefunden",children:[n.jsx("strong",{children:"MC2:"})," ",p.versions.mc2?`${p.versions.mc2.hash}${p.versions.mc2.dirty?"*":""}`:"—"]}),n.jsxs("div",{className:"truncate",title:((L=p.versions.engine)==null?void 0:L.type)==="git"?`${p.versions.engine.branch}-${p.versions.engine.hash}${p.versions.engine.dirty?"*":""} (${p.versions.engine.date})`:((O=p.versions.engine)==null?void 0:O.version_text)||"unbekannt",children:[n.jsx("strong",{children:"Engine:"})," ",((k=p.versions.engine)==null?void 0:k.type)==="git"?`${p.versions.engine.hash}${p.versions.engine.dirty?"*":""}`:((D=(R=p.versions.engine)==null?void 0:R.version_text)==null?void 0:D.split(" ").pop())||"—"]}),n.jsxs("div",{className:"truncate",title:p.versions.hermes_ui?`${p.versions.hermes_ui.branch}-${p.versions.hermes_ui.hash}${p.versions.hermes_ui.dirty?"*":""} (${p.versions.hermes_ui.date})`:"nicht gefunden",children:[n.jsx("strong",{children:"Hermes UI:"})," ",p.versions.hermes_ui?`${p.versions.hermes_ui.hash}${p.versions.hermes_ui.dirty?"*":""}`:"—"]}),n.jsxs("div",{className:"truncate",title:p.versions.hermes_agent?`${p.versions.hermes_agent.branch}-${p.versions.hermes_agent.hash}${p.versions.hermes_agent.dirty?"*":""} (${p.versions.hermes_agent.date})`:"nicht gefunden",children:[n.jsx("strong",{children:"Hermes Agent:"})," ",p.versions.hermes_agent?`${p.versions.hermes_agent.hash}${p.versions.hermes_agent.dirty?"*":""}`:"—"]})]})]})})]}),n.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[n.jsxs("header",{className:"flex h-14 shrink-0 items-center justify-between border-b border-border/40 px-6 bg-card/20 backdrop-blur-sm",children:[n.jsx("div",{className:"text-xs font-medium text-muted-foreground tracking-wide uppercase font-sans",children:P.hint}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("a",{href:"https://git.tobisniceshomelab.ddnsfree.com/Hitonabi/mission-control-v2/src/branch/main/docs/BEDIENUNG.md",target:"_blank",rel:"noopener",className:"flex h-8 items-center rounded-md border border-border/40 bg-background/40 px-2.5 text-xs text-muted-foreground hover:bg-accent hover:text-accent-foreground transition-all cursor-pointer font-semibold",title:"Bedien-Anleitung",children:"Hilfe"}),n.jsxs("button",{onClick:()=>{const M=new KeyboardEvent("keydown",{key:"k",metaKey:!0});document.dispatchEvent(M)},className:"flex items-center gap-2 rounded-md border border-border/40 bg-background/40 px-2.5 py-1.5 text-xs text-muted-foreground hover:bg-accent hover:text-accent-foreground transition-all cursor-pointer",children:[n.jsx(ah,{className:"h-3.5 w-3.5"}),n.jsx("span",{children:"Suchen"}),n.jsx("kbd",{className:"rounded bg-muted px-1.5 py-0.5 font-mono text-[9px]",children:"⌘K"})]})]})]}),n.jsxs("main",{className:"flex-1 overflow-y-auto p-6 scrollbar-thin",children:[s==="dashboard"&&n.jsx(f0,{}),s==="models"&&n.jsx(w0,{}),s==="system"&&n.jsx(k0,{}),s==="connect"&&n.jsx(j0,{}),s==="memory"&&n.jsx(S0,{}),s==="agent"&&n.jsx(E0,{}),s==="guide"&&n.jsx(_0,{}),!["dashboard","models","system","connect","memory","agent","guide"].includes(s)&&n.jsx(P0,{title:P.label,hint:P.hint})]})]})]})}Zm.createRoot(document.getElementById("root")).render(n.jsx(Yd.StrictMode,{children:n.jsx(z0,{})})); diff --git a/frontend/dist/assets/index-izDdu6A_.js b/frontend/dist/assets/index-izDdu6A_.js new file mode 100644 index 0000000..b1ed513 --- /dev/null +++ b/frontend/dist/assets/index-izDdu6A_.js @@ -0,0 +1,350 @@ +function Um(s,u){for(var a=0;ac[f]})}}}return Object.freeze(Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}))}(function(){const u=document.createElement("link").relList;if(u&&u.supports&&u.supports("modulepreload"))return;for(const f of document.querySelectorAll('link[rel="modulepreload"]'))c(f);new MutationObserver(f=>{for(const g of f)if(g.type==="childList")for(const p of g.addedNodes)p.tagName==="LINK"&&p.rel==="modulepreload"&&c(p)}).observe(document,{childList:!0,subtree:!0});function a(f){const g={};return f.integrity&&(g.integrity=f.integrity),f.referrerPolicy&&(g.referrerPolicy=f.referrerPolicy),f.crossOrigin==="use-credentials"?g.credentials="include":f.crossOrigin==="anonymous"?g.credentials="omit":g.credentials="same-origin",g}function c(f){if(f.ep)return;f.ep=!0;const g=a(f);fetch(f.href,g)}})();function Qd(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var Wa={exports:{}},po={},Va={exports:{}},ke={};/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var md;function Bm(){if(md)return ke;md=1;var s=Symbol.for("react.element"),u=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),c=Symbol.for("react.strict_mode"),f=Symbol.for("react.profiler"),g=Symbol.for("react.provider"),p=Symbol.for("react.context"),x=Symbol.for("react.forward_ref"),N=Symbol.for("react.suspense"),C=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),_=Symbol.iterator;function P(k){return k===null||typeof k!="object"?null:(k=_&&k[_]||k["@@iterator"],typeof k=="function"?k:null)}var L={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},O=Object.assign,w={};function R(k,h,T){this.props=k,this.context=h,this.refs=w,this.updater=T||L}R.prototype.isReactComponent={},R.prototype.setState=function(k,h){if(typeof k!="object"&&typeof k!="function"&&k!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,k,h,"setState")},R.prototype.forceUpdate=function(k){this.updater.enqueueForceUpdate(this,k,"forceUpdate")};function D(){}D.prototype=R.prototype;function M(k,h,T){this.props=k,this.context=h,this.refs=w,this.updater=T||L}var F=M.prototype=new D;F.constructor=M,O(F,R.prototype),F.isPureReactComponent=!0;var K=Array.isArray,Y=Object.prototype.hasOwnProperty,Q={current:null},se={key:!0,ref:!0,__self:!0,__source:!0};function ge(k,h,T){var U,B={},q=null,J=null;if(h!=null)for(U in h.ref!==void 0&&(J=h.ref),h.key!==void 0&&(q=""+h.key),h)Y.call(h,U)&&!se.hasOwnProperty(U)&&(B[U]=h[U]);var ce=arguments.length-2;if(ce===1)B.children=T;else if(1>>1,h=G[k];if(0>>1;kf(B,Z))qf(J,B)?(G[k]=J,G[q]=Z,k=q):(G[k]=B,G[U]=Z,k=U);else if(qf(J,Z))G[k]=J,G[q]=Z,k=q;else break e}}return ee}function f(G,ee){var Z=G.sortIndex-ee.sortIndex;return Z!==0?Z:G.id-ee.id}if(typeof performance=="object"&&typeof performance.now=="function"){var g=performance;s.unstable_now=function(){return g.now()}}else{var p=Date,x=p.now();s.unstable_now=function(){return p.now()-x}}var N=[],C=[],j=1,_=null,P=3,L=!1,O=!1,w=!1,R=typeof setTimeout=="function"?setTimeout:null,D=typeof clearTimeout=="function"?clearTimeout:null,M=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function F(G){for(var ee=a(C);ee!==null;){if(ee.callback===null)c(C);else if(ee.startTime<=G)c(C),ee.sortIndex=ee.expirationTime,u(N,ee);else break;ee=a(C)}}function K(G){if(w=!1,F(G),!O)if(a(N)!==null)O=!0,Ne(Y);else{var ee=a(C);ee!==null&&Se(K,ee.startTime-G)}}function Y(G,ee){O=!1,w&&(w=!1,D(ge),ge=-1),L=!0;var Z=P;try{for(F(ee),_=a(N);_!==null&&(!(_.expirationTime>ee)||G&&!ae());){var k=_.callback;if(typeof k=="function"){_.callback=null,P=_.priorityLevel;var h=k(_.expirationTime<=ee);ee=s.unstable_now(),typeof h=="function"?_.callback=h:_===a(N)&&c(N),F(ee)}else c(N);_=a(N)}if(_!==null)var T=!0;else{var U=a(C);U!==null&&Se(K,U.startTime-ee),T=!1}return T}finally{_=null,P=Z,L=!1}}var Q=!1,se=null,ge=-1,de=5,A=-1;function ae(){return!(s.unstable_now()-AG||125k?(G.sortIndex=Z,u(C,G),a(N)===null&&G===a(C)&&(w?(D(ge),ge=-1):w=!0,Se(K,Z-k))):(G.sortIndex=h,u(N,G),O||L||(O=!0,Ne(Y))),G},s.unstable_shouldYield=ae,s.unstable_wrapCallback=function(G){var ee=P;return function(){var Z=P;P=ee;try{return G.apply(this,arguments)}finally{P=Z}}}})(Ka)),Ka}var yd;function Gm(){return yd||(yd=1,Ga.exports=Hm()),Ga.exports}/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var bd;function Km(){if(bd)return ut;bd=1;var s=hi(),u=Gm();function a(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),N=Object.prototype.hasOwnProperty,C=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,j={},_={};function P(e){return N.call(_,e)?!0:N.call(j,e)?!1:C.test(e)?_[e]=!0:(j[e]=!0,!1)}function L(e,t,r,o){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return o?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function O(e,t,r,o){if(t===null||typeof t>"u"||L(e,t,r,o))return!0;if(o)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function w(e,t,r,o,l,i,d){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=o,this.attributeNamespace=l,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=d}var R={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){R[e]=new w(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];R[t]=new w(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){R[e]=new w(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){R[e]=new w(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){R[e]=new w(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){R[e]=new w(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){R[e]=new w(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){R[e]=new w(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){R[e]=new w(e,5,!1,e.toLowerCase(),null,!1,!1)});var D=/[\-:]([a-z])/g;function M(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(D,M);R[t]=new w(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(D,M);R[t]=new w(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(D,M);R[t]=new w(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){R[e]=new w(e,1,!1,e.toLowerCase(),null,!1,!1)}),R.xlinkHref=new w("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){R[e]=new w(e,1,!1,e.toLowerCase(),null,!0,!0)});function F(e,t,r,o){var l=R.hasOwnProperty(t)?R[t]:null;(l!==null?l.type!==0:o||!(2v||l[d]!==i[v]){var y=` +`+l[d].replace(" at new "," at ");return e.displayName&&y.includes("")&&(y=y.replace("",e.displayName)),y}while(1<=d&&0<=v);break}}}finally{T=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?h(e):""}function B(e){switch(e.tag){case 5:return h(e.type);case 16:return h("Lazy");case 13:return h("Suspense");case 19:return h("SuspenseList");case 0:case 2:case 15:return e=U(e.type,!1),e;case 11:return e=U(e.type.render,!1),e;case 1:return e=U(e.type,!0),e;default:return""}}function q(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case se:return"Fragment";case Q:return"Portal";case de:return"Profiler";case ge:return"StrictMode";case _e:return"Suspense";case ve:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case ae:return(e.displayName||"Context")+".Consumer";case A:return(e._context.displayName||"Context")+".Provider";case ne:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case je:return t=e.displayName||null,t!==null?t:q(e.type)||"Memo";case Ne:t=e._payload,e=e._init;try{return q(e(t))}catch{}}return null}function J(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return q(t);case 8:return t===ge?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function ce(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function me(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Re(e){var t=me(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),o=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var l=r.get,i=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(d){o=""+d,i.call(this,d)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return o},setValue:function(d){o=""+d},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function yr(e){e._valueTracker||(e._valueTracker=Re(e))}function Cn(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),o="";return e&&(o=me(e)?e.checked?"true":"false":e.value),e=o,e!==r?(t.setValue(e),!0):!1}function br(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Ir(e,t){var r=t.checked;return Z({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function En(e,t){var r=t.defaultValue==null?"":t.defaultValue,o=t.checked!=null?t.checked:t.defaultChecked;r=ce(t.value!=null?t.value:r),e._wrapperState={initialChecked:o,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function I(e,t){t=t.checked,t!=null&&F(e,"checked",t,!1)}function he(e,t){I(e,t);var r=ce(t.value),o=t.type;if(r!=null)o==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(o==="submit"||o==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Me(e,t.type,r):t.hasOwnProperty("defaultValue")&&Me(e,t.type,ce(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function we(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var o=t.type;if(!(o!=="submit"&&o!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function Me(e,t,r){(t!=="number"||br(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var Te=Array.isArray;function ct(e,t,r,o){if(e=e.options,t){t={};for(var l=0;l"+t.valueOf().toString()+"",t=ko.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function _n(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var Pn={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Hf=["Webkit","ms","Moz","O"];Object.keys(Pn).forEach(function(e){Hf.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Pn[t]=Pn[e]})});function Pi(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||Pn.hasOwnProperty(e)&&Pn[e]?(""+t).trim():t+"px"}function Mi(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var o=r.indexOf("--")===0,l=Pi(r,t[r],o);r==="float"&&(r="cssFloat"),o?e.setProperty(r,l):e[r]=l}}var Gf=Z({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function tl(e,t){if(t){if(Gf[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(a(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(a(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(a(61))}if(t.style!=null&&typeof t.style!="object")throw Error(a(62))}}function rl(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var nl=null;function ol(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var sl=null,Fr=null,$r=null;function Ri(e){if(e=qn(e)){if(typeof sl!="function")throw Error(a(280));var t=e.stateNode;t&&(t=Ho(t),sl(e.stateNode,e.type,t))}}function zi(e){Fr?$r?$r.push(e):$r=[e]:Fr=e}function Li(){if(Fr){var e=Fr,t=$r;if($r=Fr=null,Ri(e),t)for(e=0;e>>=0,e===0?32:31-(np(e)/op|0)|0}var Eo=64,_o=4194304;function Ln(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Po(e,t){var r=e.pendingLanes;if(r===0)return 0;var o=0,l=e.suspendedLanes,i=e.pingedLanes,d=r&268435455;if(d!==0){var v=d&~l;v!==0?o=Ln(v):(i&=d,i!==0&&(o=Ln(i)))}else d=r&~l,d!==0?o=Ln(d):i!==0&&(o=Ln(i));if(o===0)return 0;if(t!==0&&t!==o&&(t&l)===0&&(l=o&-o,i=t&-t,l>=i||l===16&&(i&4194240)!==0))return t;if((o&4)!==0&&(o|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=o;0r;r++)t.push(e);return t}function On(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-kt(t),e[t]=r}function ip(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var o=e.eventTimes;for(e=e.expirationTimes;0=Bn),au=" ",iu=!1;function uu(e,t){switch(e){case"keyup":return Ap.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function cu(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Wr=!1;function Ip(e,t){switch(e){case"compositionend":return cu(t);case"keypress":return t.which!==32?null:(iu=!0,au);case"textInput":return e=t.data,e===au&&iu?null:e;default:return null}}function Fp(e,t){if(Wr)return e==="compositionend"||!jl&&uu(e,t)?(e=tu(),Oo=xl=Xt=null,Wr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:r,offset:t-e};e=o}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=xu(r)}}function yu(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?yu(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function bu(){for(var e=window,t=br();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=br(e.document)}return t}function Cl(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function Qp(e){var t=bu(),r=e.focusedElem,o=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&yu(r.ownerDocument.documentElement,r)){if(o!==null&&Cl(r)){if(t=o.start,e=o.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var l=r.textContent.length,i=Math.min(o.start,l);o=o.end===void 0?i:Math.min(o.end,l),!e.extend&&i>o&&(l=o,o=i,i=l),l=vu(r,i);var d=vu(r,o);l&&d&&(e.rangeCount!==1||e.anchorNode!==l.node||e.anchorOffset!==l.offset||e.focusNode!==d.node||e.focusOffset!==d.offset)&&(t=t.createRange(),t.setStart(l.node,l.offset),e.removeAllRanges(),i>o?(e.addRange(t),e.extend(d.node,d.offset)):(t.setEnd(d.node,d.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r=document.documentMode,Vr=null,El=null,Gn=null,_l=!1;function wu(e,t,r){var o=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;_l||Vr==null||Vr!==br(o)||(o=Vr,"selectionStart"in o&&Cl(o)?o={start:o.selectionStart,end:o.selectionEnd}:(o=(o.ownerDocument&&o.ownerDocument.defaultView||window).getSelection(),o={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}),Gn&&Hn(Gn,o)||(Gn=o,o=Bo(El,"onSelect"),0Yr||(e.current=$l[Yr],$l[Yr]=null,Yr--)}function ze(e,t){Yr++,$l[Yr]=e.current,e.current=t}var rr={},Xe=tr(rr),ot=tr(!1),jr=rr;function Zr(e,t){var r=e.type.contextTypes;if(!r)return rr;var o=e.stateNode;if(o&&o.__reactInternalMemoizedUnmaskedChildContext===t)return o.__reactInternalMemoizedMaskedChildContext;var l={},i;for(i in r)l[i]=t[i];return o&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=l),l}function st(e){return e=e.childContextTypes,e!=null}function Go(){Oe(ot),Oe(Xe)}function Au(e,t,r){if(Xe.current!==rr)throw Error(a(168));ze(Xe,t),ze(ot,r)}function Tu(e,t,r){var o=e.stateNode;if(t=t.childContextTypes,typeof o.getChildContext!="function")return r;o=o.getChildContext();for(var l in o)if(!(l in t))throw Error(a(108,J(e)||"Unknown",l));return Z({},r,o)}function Ko(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||rr,jr=Xe.current,ze(Xe,e),ze(ot,ot.current),!0}function Iu(e,t,r){var o=e.stateNode;if(!o)throw Error(a(169));r?(e=Tu(e,t,jr),o.__reactInternalMemoizedMergedChildContext=e,Oe(ot),Oe(Xe),ze(Xe,e)):Oe(ot),ze(ot,r)}var Ft=null,Qo=!1,Ul=!1;function Fu(e){Ft===null?Ft=[e]:Ft.push(e)}function lm(e){Qo=!0,Fu(e)}function nr(){if(!Ul&&Ft!==null){Ul=!0;var e=0,t=Pe;try{var r=Ft;for(Pe=1;e>=d,l-=d,$t=1<<32-kt(t)+l|r<xe?(Qe=pe,pe=null):Qe=pe.sibling;var Ee=$(S,pe,E[xe],H);if(Ee===null){pe===null&&(pe=Qe);break}e&&pe&&Ee.alternate===null&&t(S,pe),b=i(Ee,b,xe),fe===null?le=Ee:fe.sibling=Ee,fe=Ee,pe=Qe}if(xe===E.length)return r(S,pe),Ae&&Sr(S,xe),le;if(pe===null){for(;xexe?(Qe=pe,pe=null):Qe=pe.sibling;var fr=$(S,pe,Ee.value,H);if(fr===null){pe===null&&(pe=Qe);break}e&&pe&&fr.alternate===null&&t(S,pe),b=i(fr,b,xe),fe===null?le=fr:fe.sibling=fr,fe=fr,pe=Qe}if(Ee.done)return r(S,pe),Ae&&Sr(S,xe),le;if(pe===null){for(;!Ee.done;xe++,Ee=E.next())Ee=V(S,Ee.value,H),Ee!==null&&(b=i(Ee,b,xe),fe===null?le=Ee:fe.sibling=Ee,fe=Ee);return Ae&&Sr(S,xe),le}for(pe=o(S,pe);!Ee.done;xe++,Ee=E.next())Ee=X(pe,S,xe,Ee.value,H),Ee!==null&&(e&&Ee.alternate!==null&&pe.delete(Ee.key===null?xe:Ee.key),b=i(Ee,b,xe),fe===null?le=Ee:fe.sibling=Ee,fe=Ee);return e&&pe.forEach(function($m){return t(S,$m)}),Ae&&Sr(S,xe),le}function Be(S,b,E,H){if(typeof E=="object"&&E!==null&&E.type===se&&E.key===null&&(E=E.props.children),typeof E=="object"&&E!==null){switch(E.$$typeof){case Y:e:{for(var le=E.key,fe=b;fe!==null;){if(fe.key===le){if(le=E.type,le===se){if(fe.tag===7){r(S,fe.sibling),b=l(fe,E.props.children),b.return=S,S=b;break e}}else if(fe.elementType===le||typeof le=="object"&&le!==null&&le.$$typeof===Ne&&Hu(le)===fe.type){r(S,fe.sibling),b=l(fe,E.props),b.ref=Xn(S,fe,E),b.return=S,S=b;break e}r(S,fe);break}else t(S,fe);fe=fe.sibling}E.type===se?(b=Lr(E.props.children,S.mode,H,E.key),b.return=S,S=b):(H=ks(E.type,E.key,E.props,null,S.mode,H),H.ref=Xn(S,b,E),H.return=S,S=H)}return d(S);case Q:e:{for(fe=E.key;b!==null;){if(b.key===fe)if(b.tag===4&&b.stateNode.containerInfo===E.containerInfo&&b.stateNode.implementation===E.implementation){r(S,b.sibling),b=l(b,E.children||[]),b.return=S,S=b;break e}else{r(S,b);break}else t(S,b);b=b.sibling}b=Ia(E,S.mode,H),b.return=S,S=b}return d(S);case Ne:return fe=E._init,Be(S,b,fe(E._payload),H)}if(Te(E))return re(S,b,E,H);if(ee(E))return oe(S,b,E,H);Xo(S,E)}return typeof E=="string"&&E!==""||typeof E=="number"?(E=""+E,b!==null&&b.tag===6?(r(S,b.sibling),b=l(b,E),b.return=S,S=b):(r(S,b),b=Ta(E,S.mode,H),b.return=S,S=b),d(S)):r(S,b)}return Be}var en=Gu(!0),Ku=Gu(!1),Jo=tr(null),es=null,tn=null,Kl=null;function Ql(){Kl=tn=es=null}function Yl(e){var t=Jo.current;Oe(Jo),e._currentValue=t}function Zl(e,t,r){for(;e!==null;){var o=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,o!==null&&(o.childLanes|=t)):o!==null&&(o.childLanes&t)!==t&&(o.childLanes|=t),e===r)break;e=e.return}}function rn(e,t){es=e,Kl=tn=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(lt=!0),e.firstContext=null)}function vt(e){var t=e._currentValue;if(Kl!==e)if(e={context:e,memoizedValue:t,next:null},tn===null){if(es===null)throw Error(a(308));tn=e,es.dependencies={lanes:0,firstContext:e}}else tn=tn.next=e;return t}var Cr=null;function ql(e){Cr===null?Cr=[e]:Cr.push(e)}function Qu(e,t,r,o){var l=t.interleaved;return l===null?(r.next=r,ql(t)):(r.next=l.next,l.next=r),t.interleaved=r,Bt(e,o)}function Bt(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var or=!1;function Xl(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Yu(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Wt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function sr(e,t,r){var o=e.updateQueue;if(o===null)return null;if(o=o.shared,(Ce&2)!==0){var l=o.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),o.pending=t,Bt(e,r)}return l=o.interleaved,l===null?(t.next=t,ql(o)):(t.next=l.next,l.next=t),o.interleaved=t,Bt(e,r)}function ts(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var o=t.lanes;o&=e.pendingLanes,r|=o,t.lanes=r,fl(e,r)}}function Zu(e,t){var r=e.updateQueue,o=e.alternate;if(o!==null&&(o=o.updateQueue,r===o)){var l=null,i=null;if(r=r.firstBaseUpdate,r!==null){do{var d={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};i===null?l=i=d:i=i.next=d,r=r.next}while(r!==null);i===null?l=i=t:i=i.next=t}else l=i=t;r={baseState:o.baseState,firstBaseUpdate:l,lastBaseUpdate:i,shared:o.shared,effects:o.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function rs(e,t,r,o){var l=e.updateQueue;or=!1;var i=l.firstBaseUpdate,d=l.lastBaseUpdate,v=l.shared.pending;if(v!==null){l.shared.pending=null;var y=v,z=y.next;y.next=null,d===null?i=z:d.next=z,d=y;var W=e.alternate;W!==null&&(W=W.updateQueue,v=W.lastBaseUpdate,v!==d&&(v===null?W.firstBaseUpdate=z:v.next=z,W.lastBaseUpdate=y))}if(i!==null){var V=l.baseState;d=0,W=z=y=null,v=i;do{var $=v.lane,X=v.eventTime;if((o&$)===$){W!==null&&(W=W.next={eventTime:X,lane:0,tag:v.tag,payload:v.payload,callback:v.callback,next:null});e:{var re=e,oe=v;switch($=t,X=r,oe.tag){case 1:if(re=oe.payload,typeof re=="function"){V=re.call(X,V,$);break e}V=re;break e;case 3:re.flags=re.flags&-65537|128;case 0:if(re=oe.payload,$=typeof re=="function"?re.call(X,V,$):re,$==null)break e;V=Z({},V,$);break e;case 2:or=!0}}v.callback!==null&&v.lane!==0&&(e.flags|=64,$=l.effects,$===null?l.effects=[v]:$.push(v))}else X={eventTime:X,lane:$,tag:v.tag,payload:v.payload,callback:v.callback,next:null},W===null?(z=W=X,y=V):W=W.next=X,d|=$;if(v=v.next,v===null){if(v=l.shared.pending,v===null)break;$=v,v=$.next,$.next=null,l.lastBaseUpdate=$,l.shared.pending=null}}while(!0);if(W===null&&(y=V),l.baseState=y,l.firstBaseUpdate=z,l.lastBaseUpdate=W,t=l.shared.interleaved,t!==null){l=t;do d|=l.lane,l=l.next;while(l!==t)}else i===null&&(l.shared.lanes=0);Pr|=d,e.lanes=d,e.memoizedState=V}}function qu(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;tr?r:4,e(!0);var o=na.transition;na.transition={};try{e(!1),t()}finally{Pe=r,na.transition=o}}function gc(){return yt().memoizedState}function cm(e,t,r){var o=ur(e);if(r={lane:o,action:r,hasEagerState:!1,eagerState:null,next:null},xc(e))vc(t,r);else if(r=Qu(e,t,r,o),r!==null){var l=nt();_t(r,e,o,l),yc(r,t,o)}}function dm(e,t,r){var o=ur(e),l={lane:o,action:r,hasEagerState:!1,eagerState:null,next:null};if(xc(e))vc(t,l);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var d=t.lastRenderedState,v=i(d,r);if(l.hasEagerState=!0,l.eagerState=v,jt(v,d)){var y=t.interleaved;y===null?(l.next=l,ql(t)):(l.next=y.next,y.next=l),t.interleaved=l;return}}catch{}finally{}r=Qu(e,t,l,o),r!==null&&(l=nt(),_t(r,e,o,l),yc(r,t,o))}}function xc(e){var t=e.alternate;return e===Fe||t!==null&&t===Fe}function vc(e,t){ro=ss=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function yc(e,t,r){if((r&4194240)!==0){var o=t.lanes;o&=e.pendingLanes,r|=o,t.lanes=r,fl(e,r)}}var is={readContext:vt,useCallback:Je,useContext:Je,useEffect:Je,useImperativeHandle:Je,useInsertionEffect:Je,useLayoutEffect:Je,useMemo:Je,useReducer:Je,useRef:Je,useState:Je,useDebugValue:Je,useDeferredValue:Je,useTransition:Je,useMutableSource:Je,useSyncExternalStore:Je,useId:Je,unstable_isNewReconciler:!1},fm={readContext:vt,useCallback:function(e,t){return Lt().memoizedState=[e,t===void 0?null:t],e},useContext:vt,useEffect:ic,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,ls(4194308,4,dc.bind(null,t,e),r)},useLayoutEffect:function(e,t){return ls(4194308,4,e,t)},useInsertionEffect:function(e,t){return ls(4,2,e,t)},useMemo:function(e,t){var r=Lt();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var o=Lt();return t=r!==void 0?r(t):t,o.memoizedState=o.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},o.queue=e,e=e.dispatch=cm.bind(null,Fe,e),[o.memoizedState,e]},useRef:function(e){var t=Lt();return e={current:e},t.memoizedState=e},useState:lc,useDebugValue:ca,useDeferredValue:function(e){return Lt().memoizedState=e},useTransition:function(){var e=lc(!1),t=e[0];return e=um.bind(null,e[1]),Lt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var o=Fe,l=Lt();if(Ae){if(r===void 0)throw Error(a(407));r=r()}else{if(r=t(),Ke===null)throw Error(a(349));(_r&30)!==0||tc(o,t,r)}l.memoizedState=r;var i={value:r,getSnapshot:t};return l.queue=i,ic(nc.bind(null,o,i,e),[e]),o.flags|=2048,so(9,rc.bind(null,o,i,r,t),void 0,null),r},useId:function(){var e=Lt(),t=Ke.identifierPrefix;if(Ae){var r=Ut,o=$t;r=(o&~(1<<32-kt(o)-1)).toString(32)+r,t=":"+t+"R"+r,r=no++,0<\/script>",e=e.removeChild(e.firstChild)):typeof o.is=="string"?e=d.createElement(r,{is:o.is}):(e=d.createElement(r),r==="select"&&(d=e,o.multiple?d.multiple=!0:o.size&&(d.size=o.size))):e=d.createElementNS(e,r),e[Rt]=t,e[Zn]=o,Fc(e,t,!1,!1),t.stateNode=e;e:{switch(d=rl(r,o),r){case"dialog":Le("cancel",e),Le("close",e),l=o;break;case"iframe":case"object":case"embed":Le("load",e),l=o;break;case"video":case"audio":for(l=0;lan&&(t.flags|=128,o=!0,lo(i,!1),t.lanes=4194304)}else{if(!o)if(e=ns(d),e!==null){if(t.flags|=128,o=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),lo(i,!0),i.tail===null&&i.tailMode==="hidden"&&!d.alternate&&!Ae)return et(t),null}else 2*Ue()-i.renderingStartTime>an&&r!==1073741824&&(t.flags|=128,o=!0,lo(i,!1),t.lanes=4194304);i.isBackwards?(d.sibling=t.child,t.child=d):(r=i.last,r!==null?r.sibling=d:t.child=d,i.last=d)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Ue(),t.sibling=null,r=Ie.current,ze(Ie,o?r&1|2:r&1),t):(et(t),null);case 22:case 23:return Oa(),o=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==o&&(t.flags|=8192),o&&(t.mode&1)!==0?(ht&1073741824)!==0&&(et(t),t.subtreeFlags&6&&(t.flags|=8192)):et(t),null;case 24:return null;case 25:return null}throw Error(a(156,t.tag))}function bm(e,t){switch(Wl(t),t.tag){case 1:return st(t.type)&&Go(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return nn(),Oe(ot),Oe(Xe),ra(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return ea(t),null;case 13:if(Oe(Ie),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(a(340));Jr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Oe(Ie),null;case 4:return nn(),null;case 10:return Yl(t.type._context),null;case 22:case 23:return Oa(),null;case 24:return null;default:return null}}var fs=!1,tt=!1,wm=typeof WeakSet=="function"?WeakSet:Set,te=null;function sn(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(o){$e(e,t,o)}else r.current=null}function ka(e,t,r){try{r()}catch(o){$e(e,t,o)}}var Bc=!1;function km(e,t){if(Ol=zo,e=bu(),Cl(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var o=r.getSelection&&r.getSelection();if(o&&o.rangeCount!==0){r=o.anchorNode;var l=o.anchorOffset,i=o.focusNode;o=o.focusOffset;try{r.nodeType,i.nodeType}catch{r=null;break e}var d=0,v=-1,y=-1,z=0,W=0,V=e,$=null;t:for(;;){for(var X;V!==r||l!==0&&V.nodeType!==3||(v=d+l),V!==i||o!==0&&V.nodeType!==3||(y=d+o),V.nodeType===3&&(d+=V.nodeValue.length),(X=V.firstChild)!==null;)$=V,V=X;for(;;){if(V===e)break t;if($===r&&++z===l&&(v=d),$===i&&++W===o&&(y=d),(X=V.nextSibling)!==null)break;V=$,$=V.parentNode}V=X}r=v===-1||y===-1?null:{start:v,end:y}}else r=null}r=r||{start:0,end:0}}else r=null;for(Dl={focusedElem:e,selectionRange:r},zo=!1,te=t;te!==null;)if(t=te,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,te=e;else for(;te!==null;){t=te;try{var re=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(re!==null){var oe=re.memoizedProps,Be=re.memoizedState,S=t.stateNode,b=S.getSnapshotBeforeUpdate(t.elementType===t.type?oe:St(t.type,oe),Be);S.__reactInternalSnapshotBeforeUpdate=b}break;case 3:var E=t.stateNode.containerInfo;E.nodeType===1?E.textContent="":E.nodeType===9&&E.documentElement&&E.removeChild(E.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(a(163))}}catch(H){$e(t,t.return,H)}if(e=t.sibling,e!==null){e.return=t.return,te=e;break}te=t.return}return re=Bc,Bc=!1,re}function ao(e,t,r){var o=t.updateQueue;if(o=o!==null?o.lastEffect:null,o!==null){var l=o=o.next;do{if((l.tag&e)===e){var i=l.destroy;l.destroy=void 0,i!==void 0&&ka(t,r,i)}l=l.next}while(l!==o)}}function ps(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var o=r.create;r.destroy=o()}r=r.next}while(r!==t)}}function ja(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function Wc(e){var t=e.alternate;t!==null&&(e.alternate=null,Wc(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Rt],delete t[Zn],delete t[Fl],delete t[om],delete t[sm])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Vc(e){return e.tag===5||e.tag===3||e.tag===4}function Hc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Vc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Na(e,t,r){var o=e.tag;if(o===5||o===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=Vo));else if(o!==4&&(e=e.child,e!==null))for(Na(e,t,r),e=e.sibling;e!==null;)Na(e,t,r),e=e.sibling}function Sa(e,t,r){var o=e.tag;if(o===5||o===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(o!==4&&(e=e.child,e!==null))for(Sa(e,t,r),e=e.sibling;e!==null;)Sa(e,t,r),e=e.sibling}var Ye=null,Ct=!1;function lr(e,t,r){for(r=r.child;r!==null;)Gc(e,t,r),r=r.sibling}function Gc(e,t,r){if(Mt&&typeof Mt.onCommitFiberUnmount=="function")try{Mt.onCommitFiberUnmount(Co,r)}catch{}switch(r.tag){case 5:tt||sn(r,t);case 6:var o=Ye,l=Ct;Ye=null,lr(e,t,r),Ye=o,Ct=l,Ye!==null&&(Ct?(e=Ye,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Ye.removeChild(r.stateNode));break;case 18:Ye!==null&&(Ct?(e=Ye,r=r.stateNode,e.nodeType===8?Il(e.parentNode,r):e.nodeType===1&&Il(e,r),Fn(e)):Il(Ye,r.stateNode));break;case 4:o=Ye,l=Ct,Ye=r.stateNode.containerInfo,Ct=!0,lr(e,t,r),Ye=o,Ct=l;break;case 0:case 11:case 14:case 15:if(!tt&&(o=r.updateQueue,o!==null&&(o=o.lastEffect,o!==null))){l=o=o.next;do{var i=l,d=i.destroy;i=i.tag,d!==void 0&&((i&2)!==0||(i&4)!==0)&&ka(r,t,d),l=l.next}while(l!==o)}lr(e,t,r);break;case 1:if(!tt&&(sn(r,t),o=r.stateNode,typeof o.componentWillUnmount=="function"))try{o.props=r.memoizedProps,o.state=r.memoizedState,o.componentWillUnmount()}catch(v){$e(r,t,v)}lr(e,t,r);break;case 21:lr(e,t,r);break;case 22:r.mode&1?(tt=(o=tt)||r.memoizedState!==null,lr(e,t,r),tt=o):lr(e,t,r);break;default:lr(e,t,r)}}function Kc(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new wm),t.forEach(function(o){var l=Rm.bind(null,e,o);r.has(o)||(r.add(o),o.then(l,l))})}}function Et(e,t){var r=t.deletions;if(r!==null)for(var o=0;ol&&(l=d),o&=~i}if(o=l,o=Ue()-o,o=(120>o?120:480>o?480:1080>o?1080:1920>o?1920:3e3>o?3e3:4320>o?4320:1960*Nm(o/1960))-o,10e?16:e,ir===null)var o=!1;else{if(e=ir,ir=null,vs=0,(Ce&6)!==0)throw Error(a(331));var l=Ce;for(Ce|=4,te=e.current;te!==null;){var i=te,d=i.child;if((te.flags&16)!==0){var v=i.deletions;if(v!==null){for(var y=0;yUe()-_a?Rr(e,0):Ea|=r),it(e,t)}function ld(e,t){t===0&&((e.mode&1)===0?t=1:(t=_o,_o<<=1,(_o&130023424)===0&&(_o=4194304)));var r=nt();e=Bt(e,t),e!==null&&(On(e,t,r),it(e,r))}function Mm(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),ld(e,r)}function Rm(e,t){var r=0;switch(e.tag){case 13:var o=e.stateNode,l=e.memoizedState;l!==null&&(r=l.retryLane);break;case 19:o=e.stateNode;break;default:throw Error(a(314))}o!==null&&o.delete(t),ld(e,r)}var ad;ad=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||ot.current)lt=!0;else{if((e.lanes&r)===0&&(t.flags&128)===0)return lt=!1,vm(e,t,r);lt=(e.flags&131072)!==0}else lt=!1,Ae&&(t.flags&1048576)!==0&&$u(t,Zo,t.index);switch(t.lanes=0,t.tag){case 2:var o=t.type;ds(e,t),e=t.pendingProps;var l=Zr(t,Xe.current);rn(t,r),l=sa(null,t,o,e,l,r);var i=la();return t.flags|=1,typeof l=="object"&&l!==null&&typeof l.render=="function"&&l.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,st(o)?(i=!0,Ko(t)):i=!1,t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,Xl(t),l.updater=us,t.stateNode=l,l._reactInternals=t,fa(t,o,e,r),t=ga(null,t,o,!0,i,r)):(t.tag=0,Ae&&i&&Bl(t),rt(null,t,l,r),t=t.child),t;case 16:o=t.elementType;e:{switch(ds(e,t),e=t.pendingProps,l=o._init,o=l(o._payload),t.type=o,l=t.tag=Lm(o),e=St(o,e),l){case 0:t=ha(null,t,o,e,r);break e;case 1:t=Lc(null,t,o,e,r);break e;case 11:t=_c(null,t,o,e,r);break e;case 14:t=Pc(null,t,o,St(o.type,e),r);break e}throw Error(a(306,o,""))}return t;case 0:return o=t.type,l=t.pendingProps,l=t.elementType===o?l:St(o,l),ha(e,t,o,l,r);case 1:return o=t.type,l=t.pendingProps,l=t.elementType===o?l:St(o,l),Lc(e,t,o,l,r);case 3:e:{if(Oc(t),e===null)throw Error(a(387));o=t.pendingProps,i=t.memoizedState,l=i.element,Yu(e,t),rs(t,o,null,r);var d=t.memoizedState;if(o=d.element,i.isDehydrated)if(i={element:o,isDehydrated:!1,cache:d.cache,pendingSuspenseBoundaries:d.pendingSuspenseBoundaries,transitions:d.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){l=on(Error(a(423)),t),t=Dc(e,t,o,r,l);break e}else if(o!==l){l=on(Error(a(424)),t),t=Dc(e,t,o,r,l);break e}else for(mt=er(t.stateNode.containerInfo.firstChild),pt=t,Ae=!0,Nt=null,r=Ku(t,null,o,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Jr(),o===l){t=Vt(e,t,r);break e}rt(e,t,o,r)}t=t.child}return t;case 5:return Xu(t),e===null&&Hl(t),o=t.type,l=t.pendingProps,i=e!==null?e.memoizedProps:null,d=l.children,Al(o,l)?d=null:i!==null&&Al(o,i)&&(t.flags|=32),zc(e,t),rt(e,t,d,r),t.child;case 6:return e===null&&Hl(t),null;case 13:return Ac(e,t,r);case 4:return Jl(t,t.stateNode.containerInfo),o=t.pendingProps,e===null?t.child=en(t,null,o,r):rt(e,t,o,r),t.child;case 11:return o=t.type,l=t.pendingProps,l=t.elementType===o?l:St(o,l),_c(e,t,o,l,r);case 7:return rt(e,t,t.pendingProps,r),t.child;case 8:return rt(e,t,t.pendingProps.children,r),t.child;case 12:return rt(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(o=t.type._context,l=t.pendingProps,i=t.memoizedProps,d=l.value,ze(Jo,o._currentValue),o._currentValue=d,i!==null)if(jt(i.value,d)){if(i.children===l.children&&!ot.current){t=Vt(e,t,r);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var v=i.dependencies;if(v!==null){d=i.child;for(var y=v.firstContext;y!==null;){if(y.context===o){if(i.tag===1){y=Wt(-1,r&-r),y.tag=2;var z=i.updateQueue;if(z!==null){z=z.shared;var W=z.pending;W===null?y.next=y:(y.next=W.next,W.next=y),z.pending=y}}i.lanes|=r,y=i.alternate,y!==null&&(y.lanes|=r),Zl(i.return,r,t),v.lanes|=r;break}y=y.next}}else if(i.tag===10)d=i.type===t.type?null:i.child;else if(i.tag===18){if(d=i.return,d===null)throw Error(a(341));d.lanes|=r,v=d.alternate,v!==null&&(v.lanes|=r),Zl(d,r,t),d=i.sibling}else d=i.child;if(d!==null)d.return=i;else for(d=i;d!==null;){if(d===t){d=null;break}if(i=d.sibling,i!==null){i.return=d.return,d=i;break}d=d.return}i=d}rt(e,t,l.children,r),t=t.child}return t;case 9:return l=t.type,o=t.pendingProps.children,rn(t,r),l=vt(l),o=o(l),t.flags|=1,rt(e,t,o,r),t.child;case 14:return o=t.type,l=St(o,t.pendingProps),l=St(o.type,l),Pc(e,t,o,l,r);case 15:return Mc(e,t,t.type,t.pendingProps,r);case 17:return o=t.type,l=t.pendingProps,l=t.elementType===o?l:St(o,l),ds(e,t),t.tag=1,st(o)?(e=!0,Ko(t)):e=!1,rn(t,r),wc(t,o,l),fa(t,o,l,r),ga(null,t,o,!0,e,r);case 19:return Ic(e,t,r);case 22:return Rc(e,t,r)}throw Error(a(156,t.tag))};function id(e,t){return Ui(e,t)}function zm(e,t,r,o){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=o,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function wt(e,t,r,o){return new zm(e,t,r,o)}function Aa(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Lm(e){if(typeof e=="function")return Aa(e)?1:0;if(e!=null){if(e=e.$$typeof,e===ne)return 11;if(e===je)return 14}return 2}function dr(e,t){var r=e.alternate;return r===null?(r=wt(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function ks(e,t,r,o,l,i){var d=2;if(o=e,typeof e=="function")Aa(e)&&(d=1);else if(typeof e=="string")d=5;else e:switch(e){case se:return Lr(r.children,l,i,t);case ge:d=8,l|=8;break;case de:return e=wt(12,r,t,l|2),e.elementType=de,e.lanes=i,e;case _e:return e=wt(13,r,t,l),e.elementType=_e,e.lanes=i,e;case ve:return e=wt(19,r,t,l),e.elementType=ve,e.lanes=i,e;case Se:return js(r,l,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case A:d=10;break e;case ae:d=9;break e;case ne:d=11;break e;case je:d=14;break e;case Ne:d=16,o=null;break e}throw Error(a(130,e==null?e:typeof e,""))}return t=wt(d,r,t,l),t.elementType=e,t.type=o,t.lanes=i,t}function Lr(e,t,r,o){return e=wt(7,e,o,t),e.lanes=r,e}function js(e,t,r,o){return e=wt(22,e,o,t),e.elementType=Se,e.lanes=r,e.stateNode={isHidden:!1},e}function Ta(e,t,r){return e=wt(6,e,null,t),e.lanes=r,e}function Ia(e,t,r){return t=wt(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Om(e,t,r,o,l){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=dl(0),this.expirationTimes=dl(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=dl(0),this.identifierPrefix=o,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function Fa(e,t,r,o,l,i,d,v,y){return e=new Om(e,t,r,v,y),t===1?(t=1,i===!0&&(t|=8)):t=0,i=wt(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:o,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Xl(i),e}function Dm(e,t,r){var o=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(u){console.error(u)}}return s(),Ha.exports=Km(),Ha.exports}var kd;function Qm(){if(kd)return Ms;kd=1;var s=Zd();return Ms.createRoot=s.createRoot,Ms.hydrateRoot=s.hydrateRoot,Ms}var Ym=Qm();const Zm=Qd(Ym);/** + * @license lucide-react v0.460.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const qm=s=>s.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),qd=(...s)=>s.filter((u,a,c)=>!!u&&u.trim()!==""&&c.indexOf(u)===a).join(" ").trim();/** + * @license lucide-react v0.460.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */var Xm={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** + * @license lucide-react v0.460.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Jm=m.forwardRef(({color:s="currentColor",size:u=24,strokeWidth:a=2,absoluteStrokeWidth:c,className:f="",children:g,iconNode:p,...x},N)=>m.createElement("svg",{ref:N,...Xm,width:u,height:u,stroke:s,strokeWidth:c?Number(a)*24/Number(u):a,className:qd("lucide",f),...x},[...p.map(([C,j])=>m.createElement(C,j)),...Array.isArray(g)?g:[g]]));/** + * @license lucide-react v0.460.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ye=(s,u)=>{const a=m.forwardRef(({className:c,...f},g)=>m.createElement(Jm,{ref:g,iconNode:u,className:qd(`lucide-${qm(s)}`,c),...f}));return a.displayName=`${s}`,a};/** + * @license lucide-react v0.460.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const xi=ye("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/** + * @license lucide-react v0.460.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Xd=ye("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);/** + * @license lucide-react v0.460.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ks=ye("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/** + * @license lucide-react v0.460.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const eh=ye("Boxes",[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]]);/** + * @license lucide-react v0.460.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Qs=ye("Brain",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]]);/** + * @license lucide-react v0.460.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const bn=ye("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** + * @license lucide-react v0.460.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const th=ye("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** + * @license lucide-react v0.460.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const rh=ye("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/** + * @license lucide-react v0.460.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const nh=ye("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** + * @license lucide-react v0.460.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const oh=ye("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** + * @license lucide-react v0.460.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const sh=ye("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** + * @license lucide-react v0.460.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const lh=ye("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/** + * @license lucide-react v0.460.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Jd=ye("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/** + * @license lucide-react v0.460.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ah=ye("Command",[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]]);/** + * @license lucide-react v0.460.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ih=ye("Compass",[["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",key:"9ktpf1"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/** + * @license lucide-react v0.460.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const uh=ye("Construction",[["rect",{x:"2",y:"6",width:"20",height:"8",rx:"1",key:"1estib"}],["path",{d:"M17 14v7",key:"7m2elx"}],["path",{d:"M7 14v7",key:"1cm7wv"}],["path",{d:"M17 3v3",key:"1v4jwn"}],["path",{d:"M7 3v3",key:"7o6guu"}],["path",{d:"M10 14 2.3 6.3",key:"1023jk"}],["path",{d:"m14 6 7.7 7.7",key:"1s8pl2"}],["path",{d:"m8 6 8 8",key:"hl96qh"}]]);/** + * @license lucide-react v0.460.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const vi=ye("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/** + * @license lucide-react v0.460.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Dr=ye("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);/** + * @license lucide-react v0.460.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const wn=ye("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/** + * @license lucide-react v0.460.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ws=ye("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/** + * @license lucide-react v0.460.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ch=ye("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** + * @license lucide-react v0.460.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const dh=ye("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/** + * @license lucide-react v0.460.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const fh=ye("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/** + * @license lucide-react v0.460.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const li=ye("HardDrive",[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]]);/** + * @license lucide-react v0.460.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ph=ye("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/** + * @license lucide-react v0.460.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Vs=ye("Layers",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);/** + * @license lucide-react v0.460.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const mh=ye("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);/** + * @license lucide-react v0.460.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const hh=ye("PenLine",[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z",key:"1ykcvy"}]]);/** + * @license lucide-react v0.460.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const gh=ye("Plug",[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M9 8V2",key:"14iosj"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z",key:"osxo6l"}]]);/** + * @license lucide-react v0.460.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ef=ye("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** + * @license lucide-react v0.460.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const tf=ye("Power",[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]]);/** + * @license lucide-react v0.460.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const kn=ye("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/** + * @license lucide-react v0.460.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const xh=ye("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/** + * @license lucide-react v0.460.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const vh=ye("Scroll",[["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]]);/** + * @license lucide-react v0.460.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const yi=ye("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** + * @license lucide-react v0.460.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const yh=ye("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);/** + * @license lucide-react v0.460.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const bh=ye("ShieldAlert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);/** + * @license lucide-react v0.460.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const xo=ye("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);/** + * @license lucide-react v0.460.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const wh=ye("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/** + * @license lucide-react v0.460.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const rf=ye("Star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);/** + * @license lucide-react v0.460.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const kh=ye("Tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);/** + * @license lucide-react v0.460.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const bi=ye("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/** + * @license lucide-react v0.460.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ai=ye("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/** + * @license lucide-react v0.460.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const jh=ye("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/** + * @license lucide-react v0.460.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Nh=ye("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/** + * @license lucide-react v0.460.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ys=ye("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),ii=[{id:"dashboard",label:"Zentrale",hint:"System- & Stack-Status",icon:mh},{id:"models",label:"Modell-Zentrale",hint:"Verwalten, laden & Gateway-Routing",icon:eh},{id:"system",label:"Diagnose",hint:"Metriken, Dienste, Logs",icon:Dr},{id:"memory",label:"Gedächtnis",hint:"Geteiltes Memory verwalten",icon:Qs},{id:"connect",label:"Verbinden",hint:"IDE-/Agent-Configs erzeugen",icon:gh},{id:"agent",label:"Hermes",hint:"Agent-Status & WebUI öffnen",icon:Ks},{id:"guide",label:"Anleitung",hint:"Einrichten & Vibe-Coding",icon:sh}];var jd=1,Sh=.9,Ch=.8,Eh=.17,Qa=.1,Ya=.999,_h=.9999,Ph=.99,Mh=/[\\\/_+.#"@\[\(\{&]/,Rh=/[\\\/_+.#"@\[\(\{&]/g,zh=/[\s-]/,nf=/[\s-]/g;function ui(s,u,a,c,f,g,p){if(g===u.length)return f===s.length?jd:Ph;var x=`${f},${g}`;if(p[x]!==void 0)return p[x];for(var N=c.charAt(g),C=a.indexOf(N,f),j=0,_,P,L,O;C>=0;)_=ui(s,u,a,c,C+1,g+1,p),_>j&&(C===f?_*=jd:Mh.test(s.charAt(C-1))?(_*=Ch,L=s.slice(f,C-1).match(Rh),L&&f>0&&(_*=Math.pow(Ya,L.length))):zh.test(s.charAt(C-1))?(_*=Sh,O=s.slice(f,C-1).match(nf),O&&f>0&&(_*=Math.pow(Ya,O.length))):(_*=Eh,f>0&&(_*=Math.pow(Ya,C-f))),s.charAt(C)!==u.charAt(g)&&(_*=_h)),(__&&(_=P*Qa)),_>j&&(j=_),C=a.indexOf(N,C+1);return p[x]=j,j}function Nd(s){return s.toLowerCase().replace(nf," ")}function Lh(s,u,a){return s=a&&a.length>0?`${s+" "+a.join(" ")}`:s,ui(s,u,Nd(s),Nd(u),0,0,{})}function xr(s,u,{checkForDefaultPrevented:a=!0}={}){return function(f){if(s==null||s(f),a===!1||!f.defaultPrevented)return u==null?void 0:u(f)}}function Sd(s,u){if(typeof s=="function")return s(u);s!=null&&(s.current=u)}function jn(...s){return u=>{let a=!1;const c=s.map(f=>{const g=Sd(f,u);return!a&&typeof g=="function"&&(a=!0),g});if(a)return()=>{for(let f=0;f{var D;const{scope:P,children:L,...O}=_,w=((D=P==null?void 0:P[s])==null?void 0:D[N])||x,R=m.useMemo(()=>O,Object.values(O));return n.jsx(w.Provider,{value:R,children:L})};C.displayName=g+"Provider";function j(_,P){var w;const L=((w=P==null?void 0:P[s])==null?void 0:w[N])||x,O=m.useContext(L);if(O)return O;if(p!==void 0)return p;throw new Error(`\`${_}\` must be used within \`${g}\``)}return[C,j]}const f=()=>{const g=a.map(p=>m.createContext(p));return function(x){const N=(x==null?void 0:x[s])||g;return m.useMemo(()=>({[`__scope${s}`]:{...x,[s]:N}}),[x,N])}};return f.scopeName=s,[c,Dh(f,...u)]}function Dh(...s){const u=s[0];if(s.length===1)return u;const a=()=>{const c=s.map(f=>({useScope:f(),scopeName:f.scopeName}));return function(g){const p=c.reduce((x,{useScope:N,scopeName:C})=>{const _=N(g)[`__scope${C}`];return{...x,..._}},{});return m.useMemo(()=>({[`__scope${u.scopeName}`]:p}),[p])}};return a.scopeName=u.scopeName,a}var vo=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},Ah=gi[" useId ".trim().toString()]||(()=>{}),Th=0;function Kt(s){const[u,a]=m.useState(Ah());return vo(()=>{a(c=>c??String(Th++))},[s]),u?`radix-${u}`:""}var Ih=gi[" useInsertionEffect ".trim().toString()]||vo;function Fh({prop:s,defaultProp:u,onChange:a=()=>{},caller:c}){const[f,g,p]=$h({defaultProp:u,onChange:a}),x=s!==void 0,N=x?s:f;{const j=m.useRef(s!==void 0);m.useEffect(()=>{const _=j.current;_!==x&&console.warn(`${c} is changing from ${_?"controlled":"uncontrolled"} to ${x?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),j.current=x},[x,c])}const C=m.useCallback(j=>{var _;if(x){const P=Uh(j)?j(s):j;P!==s&&((_=p.current)==null||_.call(p,P))}else g(j)},[x,s,g,p]);return[N,C]}function $h({defaultProp:s,onChange:u}){const[a,c]=m.useState(s),f=m.useRef(a),g=m.useRef(u);return Ih(()=>{g.current=u},[u]),m.useEffect(()=>{var p;f.current!==a&&((p=g.current)==null||p.call(g,a),f.current=a)},[a,f]),[a,c,g]}function Uh(s){return typeof s=="function"}var of=Zd();function sf(s){const u=m.forwardRef((a,c)=>{let{children:f,...g}=a,p=null,x=!1;const N=[];Cd(f)&&typeof Rs=="function"&&(f=Rs(f._payload)),m.Children.forEach(f,P=>{var L;if(Gh(P)){x=!0;const O=P;let w="child"in O.props?O.props.child:O.props.children;Cd(w)&&typeof Rs=="function"&&(w=Rs(w._payload)),p=Wh(O,w),N.push((L=p==null?void 0:p.props)==null?void 0:L.children)}else N.push(P)}),p?p=m.cloneElement(p,void 0,N):!x&&m.Children.count(f)===1&&m.isValidElement(f)&&(p=f);const C=p?Hh(p):void 0,j=Tr(c,C);if(!p){if(f||f===0)throw new Error(x?Zh(s):Yh(s));return f}const _=Vh(g,p.props??{});return p.type!==m.Fragment&&(_.ref=c?j:C),m.cloneElement(p,_)});return u.displayName=`${s}.Slot`,u}var Bh=Symbol.for("radix.slottable"),Wh=(s,u)=>{if("child"in s.props){const a=s.props.child;return m.isValidElement(a)?m.cloneElement(a,void 0,s.props.children(a.props.children)):null}return m.isValidElement(u)?u:null};function Vh(s,u){const a={...u};for(const c in u){const f=s[c],g=u[c];/^on[A-Z]/.test(c)?f&&g?a[c]=(...x)=>{const N=g(...x);return f(...x),N}:f&&(a[c]=f):c==="style"?a[c]={...f,...g}:c==="className"&&(a[c]=[f,g].filter(Boolean).join(" "))}return{...s,...a}}function Hh(s){var c,f;let u=(c=Object.getOwnPropertyDescriptor(s.props,"ref"))==null?void 0:c.get,a=u&&"isReactWarning"in u&&u.isReactWarning;return a?s.ref:(u=(f=Object.getOwnPropertyDescriptor(s,"ref"))==null?void 0:f.get,a=u&&"isReactWarning"in u&&u.isReactWarning,a?s.props.ref:s.props.ref||s.ref)}function Gh(s){return m.isValidElement(s)&&typeof s.type=="function"&&"__radixId"in s.type&&s.type.__radixId===Bh}var Kh=Symbol.for("react.lazy");function Cd(s){return s!=null&&typeof s=="object"&&"$$typeof"in s&&s.$$typeof===Kh&&"_payload"in s&&Qh(s._payload)}function Qh(s){return typeof s=="object"&&s!==null&&"then"in s}var Yh=s=>`${s} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,Zh=s=>`${s} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,Rs=gi[" use ".trim().toString()],qh=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],qe=qh.reduce((s,u)=>{const a=sf(`Primitive.${u}`),c=m.forwardRef((f,g)=>{const{asChild:p,...x}=f,N=p?a:u;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),n.jsx(N,{...x,ref:g})});return c.displayName=`Primitive.${u}`,{...s,[u]:c}},{});function Xh(s,u){s&&of.flushSync(()=>s.dispatchEvent(u))}function yo(s){const u=m.useRef(s);return m.useEffect(()=>{u.current=s}),m.useMemo(()=>((...a)=>{var c;return(c=u.current)==null?void 0:c.call(u,...a)}),[])}function Jh(s,u=globalThis==null?void 0:globalThis.document){const a=yo(s);m.useEffect(()=>{const c=f=>{f.key==="Escape"&&a(f)};return u.addEventListener("keydown",c,{capture:!0}),()=>u.removeEventListener("keydown",c,{capture:!0})},[a,u])}var eg="DismissableLayer",ci="dismissableLayer.update",tg="dismissableLayer.pointerDownOutside",rg="dismissableLayer.focusOutside",Ed,wi=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),lf=m.forwardRef((s,u)=>{const{disableOutsidePointerEvents:a=!1,deferPointerDownOutside:c=!1,onEscapeKeyDown:f,onPointerDownOutside:g,onFocusOutside:p,onInteractOutside:x,onDismiss:N,...C}=s,j=m.useContext(wi),[_,P]=m.useState(null),L=(_==null?void 0:_.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,O]=m.useState({}),w=Tr(u,de=>P(de)),R=Array.from(j.layers),[D]=[...j.layersWithOutsidePointerEventsDisabled].slice(-1),M=R.indexOf(D),F=_?R.indexOf(_):-1,K=j.layersWithOutsidePointerEventsDisabled.size>0,Y=F>=M,Q=m.useRef(!1),se=lg(de=>{const A=de.target;if(!(A instanceof Node))return;const ae=[...j.branches].some(ne=>ne.contains(A));!Y||ae||(g==null||g(de),x==null||x(de),de.defaultPrevented||N==null||N())},{ownerDocument:L,deferPointerDownOutside:c,isDeferredPointerDownOutsideRef:Q,dismissableSurfaces:j.dismissableSurfaces}),ge=ag(de=>{if(c&&Q.current)return;const A=de.target;[...j.branches].some(ne=>ne.contains(A))||(p==null||p(de),x==null||x(de),de.defaultPrevented||N==null||N())},L);return Jh(de=>{F===j.layers.size-1&&(f==null||f(de),!de.defaultPrevented&&N&&(de.preventDefault(),N()))},L),m.useEffect(()=>{if(_)return a&&(j.layersWithOutsidePointerEventsDisabled.size===0&&(Ed=L.body.style.pointerEvents,L.body.style.pointerEvents="none"),j.layersWithOutsidePointerEventsDisabled.add(_)),j.layers.add(_),_d(),()=>{a&&(j.layersWithOutsidePointerEventsDisabled.delete(_),j.layersWithOutsidePointerEventsDisabled.size===0&&(L.body.style.pointerEvents=Ed))}},[_,L,a,j]),m.useEffect(()=>()=>{_&&(j.layers.delete(_),j.layersWithOutsidePointerEventsDisabled.delete(_),_d())},[_,j]),m.useEffect(()=>{const de=()=>O({});return document.addEventListener(ci,de),()=>document.removeEventListener(ci,de)},[]),n.jsx(qe.div,{...C,ref:w,style:{pointerEvents:K?Y?"auto":"none":void 0,...s.style},onFocusCapture:xr(s.onFocusCapture,ge.onFocusCapture),onBlurCapture:xr(s.onBlurCapture,ge.onBlurCapture),onPointerDownCapture:xr(s.onPointerDownCapture,se.onPointerDownCapture)})});lf.displayName=eg;var ng="DismissableLayerBranch",og=m.forwardRef((s,u)=>{const a=m.useContext(wi),c=m.useRef(null),f=Tr(u,c);return m.useEffect(()=>{const g=c.current;if(g)return a.branches.add(g),()=>{a.branches.delete(g)}},[a.branches]),n.jsx(qe.div,{...s,ref:f})});og.displayName=ng;function sg(){const s=m.useContext(wi),[u,a]=m.useState(null);return m.useEffect(()=>{if(u)return s.dismissableSurfaces.add(u),()=>{s.dismissableSurfaces.delete(u)}},[u,s.dismissableSurfaces]),a}function lg(s,u){const{ownerDocument:a=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:c=!1,isDeferredPointerDownOutsideRef:f,dismissableSurfaces:g}=u,p=yo(s),x=m.useRef(!1),N=m.useRef(!1),C=m.useRef(new Map),j=m.useRef(()=>{});return m.useEffect(()=>{function _(){N.current=!1,f.current=!1,C.current.clear()}function P(){return Array.from(C.current.values()).some(Boolean)}function L(M){if(!N.current)return;const F=M.target;F instanceof Node&&[...g].some(Y=>Y.contains(F))||C.current.set(M.type,!0),M.type==="click"&&window.setTimeout(()=>{N.current&&j.current()},0)}function O(M){N.current&&C.current.set(M.type,!1)}const w=M=>{if(M.target&&!x.current){let F=function(){a.removeEventListener("click",j.current);const Y=P();_(),Y||af(tg,p,K,{discrete:!0})};const K={originalEvent:M};N.current=!0,f.current=c&&M.button===0,C.current.clear(),!c||M.button!==0?F():(a.removeEventListener("click",j.current),j.current=F,a.addEventListener("click",j.current,{once:!0}))}else a.removeEventListener("click",j.current),_();x.current=!1},R=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const M of R)a.addEventListener(M,L,!0),a.addEventListener(M,O);const D=window.setTimeout(()=>{a.addEventListener("pointerdown",w)},0);return()=>{window.clearTimeout(D),a.removeEventListener("pointerdown",w),a.removeEventListener("click",j.current);for(const M of R)a.removeEventListener(M,L,!0),a.removeEventListener(M,O)}},[a,p,c,f,g]),{onPointerDownCapture:()=>x.current=!0}}function ag(s,u=globalThis==null?void 0:globalThis.document){const a=yo(s),c=m.useRef(!1);return m.useEffect(()=>{const f=g=>{g.target&&!c.current&&af(rg,a,{originalEvent:g},{discrete:!1})};return u.addEventListener("focusin",f),()=>u.removeEventListener("focusin",f)},[u,a]),{onFocusCapture:()=>c.current=!0,onBlurCapture:()=>c.current=!1}}function _d(){const s=new CustomEvent(ci);document.dispatchEvent(s)}function af(s,u,a,{discrete:c}){const f=a.originalEvent.target,g=new CustomEvent(s,{bubbles:!1,cancelable:!0,detail:a});u&&f.addEventListener(s,u,{once:!0}),c?Xh(f,g):f.dispatchEvent(g)}var Za="focusScope.autoFocusOnMount",qa="focusScope.autoFocusOnUnmount",Pd={bubbles:!1,cancelable:!0},ig="FocusScope",uf=m.forwardRef((s,u)=>{const{loop:a=!1,trapped:c=!1,onMountAutoFocus:f,onUnmountAutoFocus:g,...p}=s,[x,N]=m.useState(null),C=yo(f),j=yo(g),_=m.useRef(null),P=Tr(u,w=>N(w)),L=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(c){let w=function(F){if(L.paused||!x)return;const K=F.target;x.contains(K)?_.current=K:gr(_.current,{select:!0})},R=function(F){if(L.paused||!x)return;const K=F.relatedTarget;K!==null&&(x.contains(K)||gr(_.current,{select:!0}))},D=function(F){if(document.activeElement===document.body)for(const Y of F)Y.removedNodes.length>0&&gr(x)};document.addEventListener("focusin",w),document.addEventListener("focusout",R);const M=new MutationObserver(D);return x&&M.observe(x,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",R),M.disconnect()}}},[c,x,L.paused]),m.useEffect(()=>{if(x){Rd.add(L);const w=document.activeElement;if(!x.contains(w)){const D=new CustomEvent(Za,Pd);x.addEventListener(Za,C),x.dispatchEvent(D),D.defaultPrevented||(ug(mg(cf(x)),{select:!0}),document.activeElement===w&&gr(x))}return()=>{x.removeEventListener(Za,C),setTimeout(()=>{const D=new CustomEvent(qa,Pd);x.addEventListener(qa,j),x.dispatchEvent(D),D.defaultPrevented||gr(w??document.body,{select:!0}),x.removeEventListener(qa,j),Rd.remove(L)},0)}}},[x,C,j,L]);const O=m.useCallback(w=>{if(!a&&!c||L.paused)return;const R=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,D=document.activeElement;if(R&&D){const M=w.currentTarget,[F,K]=cg(M);F&&K?!w.shiftKey&&D===K?(w.preventDefault(),a&&gr(F,{select:!0})):w.shiftKey&&D===F&&(w.preventDefault(),a&&gr(K,{select:!0})):D===M&&w.preventDefault()}},[a,c,L.paused]);return n.jsx(qe.div,{tabIndex:-1,...p,ref:P,onKeyDown:O})});uf.displayName=ig;function ug(s,{select:u=!1}={}){const a=document.activeElement;for(const c of s)if(gr(c,{select:u}),document.activeElement!==a)return}function cg(s){const u=cf(s),a=Md(u,s),c=Md(u.reverse(),s);return[a,c]}function cf(s){const u=[],a=document.createTreeWalker(s,NodeFilter.SHOW_ELEMENT,{acceptNode:c=>{const f=c.tagName==="INPUT"&&c.type==="hidden";return c.disabled||c.hidden||f?NodeFilter.FILTER_SKIP:c.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;a.nextNode();)u.push(a.currentNode);return u}function Md(s,u){for(const a of s)if(!dg(a,{upTo:u}))return a}function dg(s,{upTo:u}){if(getComputedStyle(s).visibility==="hidden")return!0;for(;s;){if(u!==void 0&&s===u)return!1;if(getComputedStyle(s).display==="none")return!0;s=s.parentElement}return!1}function fg(s){return s instanceof HTMLInputElement&&"select"in s}function gr(s,{select:u=!1}={}){if(s&&s.focus){const a=document.activeElement;s.focus({preventScroll:!0}),s!==a&&fg(s)&&u&&s.select()}}var Rd=pg();function pg(){let s=[];return{add(u){const a=s[0];u!==a&&(a==null||a.pause()),s=zd(s,u),s.unshift(u)},remove(u){var a;s=zd(s,u),(a=s[0])==null||a.resume()}}}function zd(s,u){const a=[...s],c=a.indexOf(u);return c!==-1&&a.splice(c,1),a}function mg(s){return s.filter(u=>u.tagName!=="A")}var hg="Portal",df=m.forwardRef((s,u)=>{var x;const{container:a,...c}=s,[f,g]=m.useState(!1);vo(()=>g(!0),[]);const p=a||f&&((x=globalThis==null?void 0:globalThis.document)==null?void 0:x.body);return p?of.createPortal(n.jsx(qe.div,{...c,ref:u}),p):null});df.displayName=hg;function gg(s,u){return m.useReducer((a,c)=>u[a][c]??a,s)}var Zs=s=>{const{present:u,children:a}=s,c=xg(u),f=typeof a=="function"?a({present:c.isPresent}):m.Children.only(a),g=vg(c.ref,yg(f));return typeof a=="function"||c.isPresent?m.cloneElement(f,{ref:g}):null};Zs.displayName="Presence";function xg(s){const[u,a]=m.useState(),c=m.useRef(null),f=m.useRef(s),g=m.useRef("none"),p=s?"mounted":"unmounted",[x,N]=gg(p,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const C=zs(c.current);g.current=x==="mounted"?C:"none"},[x]),vo(()=>{const C=c.current,j=f.current;if(j!==s){const P=g.current,L=zs(C);s?N("MOUNT"):L==="none"||(C==null?void 0:C.display)==="none"?N("UNMOUNT"):N(j&&P!==L?"ANIMATION_OUT":"UNMOUNT"),f.current=s}},[s,N]),vo(()=>{if(u){let C;const j=u.ownerDocument.defaultView??window,_=L=>{const w=zs(c.current).includes(CSS.escape(L.animationName));if(L.target===u&&w&&(N("ANIMATION_END"),!f.current)){const R=u.style.animationFillMode;u.style.animationFillMode="forwards",C=j.setTimeout(()=>{u.style.animationFillMode==="forwards"&&(u.style.animationFillMode=R)})}},P=L=>{L.target===u&&(g.current=zs(c.current))};return u.addEventListener("animationstart",P),u.addEventListener("animationcancel",_),u.addEventListener("animationend",_),()=>{j.clearTimeout(C),u.removeEventListener("animationstart",P),u.removeEventListener("animationcancel",_),u.removeEventListener("animationend",_)}}else N("ANIMATION_END")},[u,N]),{isPresent:["mounted","unmountSuspended"].includes(x),ref:m.useCallback(C=>{c.current=C?getComputedStyle(C):null,a(C)},[])}}function Ld(s,u){if(typeof s=="function")return s(u);s!=null&&(s.current=u)}function vg(...s){const u=m.useRef(s);return u.current=s,m.useCallback(a=>{const c=u.current;let f=!1;const g=c.map(p=>{const x=Ld(p,a);return!f&&typeof x=="function"&&(f=!0),x});if(f)return()=>{for(let p=0;p{Dt||(Dt={start:Od(),end:Od()});const{start:s,end:u}=Dt;return document.body.firstElementChild!==s&&document.body.insertAdjacentElement("afterbegin",s),document.body.lastElementChild!==u&&document.body.insertAdjacentElement("beforeend",u),Ls++,()=>{Ls===1&&(Dt==null||Dt.start.remove(),Dt==null||Dt.end.remove(),Dt=null),Ls=Math.max(0,Ls-1)}},[])}function Od(){const s=document.createElement("span");return s.setAttribute("data-radix-focus-guard",""),s.tabIndex=0,s.style.outline="none",s.style.opacity="0",s.style.position="fixed",s.style.pointerEvents="none",s}var At=function(){return At=Object.assign||function(u){for(var a,c=1,f=arguments.length;c"u")return Tg;var u=Ig(s),a=document.documentElement.clientWidth,c=window.innerWidth;return{left:u[0],top:u[1],right:u[2],gap:Math.max(0,c-a+u[2]-u[0])}},$g=hf(),vn="data-scroll-locked",Ug=function(s,u,a,c){var f=s.left,g=s.top,p=s.right,x=s.gap;return a===void 0&&(a="margin"),` + .`.concat(kg,` { + overflow: hidden `).concat(c,`; + padding-right: `).concat(x,"px ").concat(c,`; + } + body[`).concat(vn,`] { + overflow: hidden `).concat(c,`; + overscroll-behavior: contain; + `).concat([u&&"position: relative ".concat(c,";"),a==="margin"&&` + padding-left: `.concat(f,`px; + padding-top: `).concat(g,`px; + padding-right: `).concat(p,`px; + margin-left:0; + margin-top:0; + margin-right: `).concat(x,"px ").concat(c,`; + `),a==="padding"&&"padding-right: ".concat(x,"px ").concat(c,";")].filter(Boolean).join(""),` + } + + .`).concat(Us,` { + right: `).concat(x,"px ").concat(c,`; + } + + .`).concat(Bs,` { + margin-right: `).concat(x,"px ").concat(c,`; + } + + .`).concat(Us," .").concat(Us,` { + right: 0 `).concat(c,`; + } + + .`).concat(Bs," .").concat(Bs,` { + margin-right: 0 `).concat(c,`; + } + + body[`).concat(vn,`] { + `).concat(jg,": ").concat(x,`px; + } +`)},Ad=function(){var s=parseInt(document.body.getAttribute(vn)||"0",10);return isFinite(s)?s:0},Bg=function(){m.useEffect(function(){return document.body.setAttribute(vn,(Ad()+1).toString()),function(){var s=Ad()-1;s<=0?document.body.removeAttribute(vn):document.body.setAttribute(vn,s.toString())}},[])},Wg=function(s){var u=s.noRelative,a=s.noImportant,c=s.gapMode,f=c===void 0?"margin":c;Bg();var g=m.useMemo(function(){return Fg(f)},[f]);return m.createElement($g,{styles:Ug(g,!u,f,a?"":"!important")})},di=!1;if(typeof window<"u")try{var Os=Object.defineProperty({},"passive",{get:function(){return di=!0,!0}});window.addEventListener("test",Os,Os),window.removeEventListener("test",Os,Os)}catch{di=!1}var cn=di?{passive:!1}:!1,Vg=function(s){return s.tagName==="TEXTAREA"},gf=function(s,u){if(!(s instanceof Element))return!1;var a=window.getComputedStyle(s);return a[u]!=="hidden"&&!(a.overflowY===a.overflowX&&!Vg(s)&&a[u]==="visible")},Hg=function(s){return gf(s,"overflowY")},Gg=function(s){return gf(s,"overflowX")},Td=function(s,u){var a=u.ownerDocument,c=u;do{typeof ShadowRoot<"u"&&c instanceof ShadowRoot&&(c=c.host);var f=xf(s,c);if(f){var g=vf(s,c),p=g[1],x=g[2];if(p>x)return!0}c=c.parentNode}while(c&&c!==a.body);return!1},Kg=function(s){var u=s.scrollTop,a=s.scrollHeight,c=s.clientHeight;return[u,a,c]},Qg=function(s){var u=s.scrollLeft,a=s.scrollWidth,c=s.clientWidth;return[u,a,c]},xf=function(s,u){return s==="v"?Hg(u):Gg(u)},vf=function(s,u){return s==="v"?Kg(u):Qg(u)},Yg=function(s,u){return s==="h"&&u==="rtl"?-1:1},Zg=function(s,u,a,c,f){var g=Yg(s,window.getComputedStyle(u).direction),p=g*c,x=a.target,N=u.contains(x),C=!1,j=p>0,_=0,P=0;do{if(!x)break;var L=vf(s,x),O=L[0],w=L[1],R=L[2],D=w-R-g*O;(O||D)&&xf(s,x)&&(_+=D,P+=O);var M=x.parentNode;x=M&&M.nodeType===Node.DOCUMENT_FRAGMENT_NODE?M.host:M}while(!N&&x!==document.body||N&&(u.contains(x)||u===x));return(j&&Math.abs(_)<1||!j&&Math.abs(P)<1)&&(C=!0),C},Ds=function(s){return"changedTouches"in s?[s.changedTouches[0].clientX,s.changedTouches[0].clientY]:[0,0]},Id=function(s){return[s.deltaX,s.deltaY]},Fd=function(s){return s&&"current"in s?s.current:s},qg=function(s,u){return s[0]===u[0]&&s[1]===u[1]},Xg=function(s){return` + .block-interactivity-`.concat(s,` {pointer-events: none;} + .allow-interactivity-`).concat(s,` {pointer-events: all;} +`)},Jg=0,dn=[];function ex(s){var u=m.useRef([]),a=m.useRef([0,0]),c=m.useRef(),f=m.useState(Jg++)[0],g=m.useState(hf)[0],p=m.useRef(s);m.useEffect(function(){p.current=s},[s]),m.useEffect(function(){if(s.inert){document.body.classList.add("block-interactivity-".concat(f));var w=wg([s.lockRef.current],(s.shards||[]).map(Fd),!0).filter(Boolean);return w.forEach(function(R){return R.classList.add("allow-interactivity-".concat(f))}),function(){document.body.classList.remove("block-interactivity-".concat(f)),w.forEach(function(R){return R.classList.remove("allow-interactivity-".concat(f))})}}},[s.inert,s.lockRef.current,s.shards]);var x=m.useCallback(function(w,R){if("touches"in w&&w.touches.length===2||w.type==="wheel"&&w.ctrlKey)return!p.current.allowPinchZoom;var D=Ds(w),M=a.current,F="deltaX"in w?w.deltaX:M[0]-D[0],K="deltaY"in w?w.deltaY:M[1]-D[1],Y,Q=w.target,se=Math.abs(F)>Math.abs(K)?"h":"v";if("touches"in w&&se==="h"&&Q.type==="range")return!1;var ge=window.getSelection(),de=ge&&ge.anchorNode,A=de?de===Q||de.contains(Q):!1;if(A)return!1;var ae=Td(se,Q);if(!ae)return!0;if(ae?Y=se:(Y=se==="v"?"h":"v",ae=Td(se,Q)),!ae)return!1;if(!c.current&&"changedTouches"in w&&(F||K)&&(c.current=Y),!Y)return!0;var ne=c.current||Y;return Zg(ne,R,w,ne==="h"?F:K)},[]),N=m.useCallback(function(w){var R=w;if(!(!dn.length||dn[dn.length-1]!==g)){var D="deltaY"in R?Id(R):Ds(R),M=u.current.filter(function(Y){return Y.name===R.type&&(Y.target===R.target||R.target===Y.shadowParent)&&qg(Y.delta,D)})[0];if(M&&M.should){R.cancelable&&R.preventDefault();return}if(!M){var F=(p.current.shards||[]).map(Fd).filter(Boolean).filter(function(Y){return Y.contains(R.target)}),K=F.length>0?x(R,F[0]):!p.current.noIsolation;K&&R.cancelable&&R.preventDefault()}}},[]),C=m.useCallback(function(w,R,D,M){var F={name:w,delta:R,target:D,should:M,shadowParent:tx(D)};u.current.push(F),setTimeout(function(){u.current=u.current.filter(function(K){return K!==F})},1)},[]),j=m.useCallback(function(w){a.current=Ds(w),c.current=void 0},[]),_=m.useCallback(function(w){C(w.type,Id(w),w.target,x(w,s.lockRef.current))},[]),P=m.useCallback(function(w){C(w.type,Ds(w),w.target,x(w,s.lockRef.current))},[]);m.useEffect(function(){return dn.push(g),s.setCallbacks({onScrollCapture:_,onWheelCapture:_,onTouchMoveCapture:P}),document.addEventListener("wheel",N,cn),document.addEventListener("touchmove",N,cn),document.addEventListener("touchstart",j,cn),function(){dn=dn.filter(function(w){return w!==g}),document.removeEventListener("wheel",N,cn),document.removeEventListener("touchmove",N,cn),document.removeEventListener("touchstart",j,cn)}},[]);var L=s.removeScrollBar,O=s.inert;return m.createElement(m.Fragment,null,O?m.createElement(g,{styles:Xg(f)}):null,L?m.createElement(Wg,{noRelative:s.noRelative,gapMode:s.gapMode}):null)}function tx(s){for(var u=null;s!==null;)s instanceof ShadowRoot&&(u=s.host,s=s.host),s=s.parentNode;return u}const rx=Mg(mf,ex);var yf=m.forwardRef(function(s,u){return m.createElement(qs,At({},s,{ref:u,sideCar:rx}))});yf.classNames=qs.classNames;var nx=function(s){if(typeof document>"u")return null;var u=Array.isArray(s)?s[0]:s;return u.ownerDocument.body},fn=new WeakMap,As=new WeakMap,Ts={},ti=0,bf=function(s){return s&&(s.host||bf(s.parentNode))},ox=function(s,u){return u.map(function(a){if(s.contains(a))return a;var c=bf(a);return c&&s.contains(c)?c:(console.error("aria-hidden",a,"in not contained inside",s,". Doing nothing"),null)}).filter(function(a){return!!a})},sx=function(s,u,a,c){var f=ox(u,Array.isArray(s)?s:[s]);Ts[a]||(Ts[a]=new WeakMap);var g=Ts[a],p=[],x=new Set,N=new Set(f),C=function(_){!_||x.has(_)||(x.add(_),C(_.parentNode))};f.forEach(C);var j=function(_){!_||N.has(_)||Array.prototype.forEach.call(_.children,function(P){if(x.has(P))j(P);else try{var L=P.getAttribute(c),O=L!==null&&L!=="false",w=(fn.get(P)||0)+1,R=(g.get(P)||0)+1;fn.set(P,w),g.set(P,R),p.push(P),w===1&&O&&As.set(P,!0),R===1&&P.setAttribute(a,"true"),O||P.setAttribute(c,"true")}catch(D){console.error("aria-hidden: cannot operate on ",P,D)}})};return j(u),x.clear(),ti++,function(){p.forEach(function(_){var P=fn.get(_)-1,L=g.get(_)-1;fn.set(_,P),g.set(_,L),P||(As.has(_)||_.removeAttribute(c),As.delete(_)),L||_.removeAttribute(a)}),ti--,ti||(fn=new WeakMap,fn=new WeakMap,As=new WeakMap,Ts={})}},lx=function(s,u,a){a===void 0&&(a="data-aria-hidden");var c=Array.from(Array.isArray(s)?s:[s]),f=nx(s);return f?(c.push.apply(c,Array.from(f.querySelectorAll("[aria-live], script"))),sx(c,f,a,"aria-hidden")):function(){return null}},Xs="Dialog",[wf]=Oh(Xs),[ax,Pt]=wf(Xs),kf=s=>{const{__scopeDialog:u,children:a,open:c,defaultOpen:f,onOpenChange:g,modal:p=!0}=s,x=m.useRef(null),N=m.useRef(null),[C,j]=Fh({prop:c,defaultProp:f??!1,onChange:g,caller:Xs});return n.jsx(ax,{scope:u,triggerRef:x,contentRef:N,contentId:Kt(),titleId:Kt(),descriptionId:Kt(),open:C,onOpenChange:j,onOpenToggle:m.useCallback(()=>j(_=>!_),[j]),modal:p,children:a})};kf.displayName=Xs;var jf="DialogTrigger",ix=m.forwardRef((s,u)=>{const{__scopeDialog:a,...c}=s,f=Pt(jf,a),g=Tr(u,f.triggerRef);return n.jsx(qe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":f.open,"aria-controls":f.open?f.contentId:void 0,"data-state":ji(f.open),...c,ref:g,onClick:xr(s.onClick,f.onOpenToggle)})});ix.displayName=jf;var ki="DialogPortal",[ux,Nf]=wf(ki,{forceMount:void 0}),Sf=s=>{const{__scopeDialog:u,forceMount:a,children:c,container:f}=s,g=Pt(ki,u);return n.jsx(ux,{scope:u,forceMount:a,children:m.Children.map(c,p=>n.jsx(Zs,{present:a||g.open,children:n.jsx(df,{asChild:!0,container:f,children:p})}))})};Sf.displayName=ki;var Hs="DialogOverlay",Cf=m.forwardRef((s,u)=>{const a=Nf(Hs,s.__scopeDialog),{forceMount:c=a.forceMount,...f}=s,g=Pt(Hs,s.__scopeDialog);return g.modal?n.jsx(Zs,{present:c||g.open,children:n.jsx(dx,{...f,ref:u})}):null});Cf.displayName=Hs;var cx=sf("DialogOverlay.RemoveScroll"),dx=m.forwardRef((s,u)=>{const{__scopeDialog:a,...c}=s,f=Pt(Hs,a),g=sg(),p=Tr(u,g);return n.jsx(yf,{as:cx,allowPinchZoom:!0,shards:[f.contentRef],children:n.jsx(qe.div,{"data-state":ji(f.open),...c,ref:p,style:{pointerEvents:"auto",...c.style}})})}),Nn="DialogContent",Ef=m.forwardRef((s,u)=>{const a=Nf(Nn,s.__scopeDialog),{forceMount:c=a.forceMount,...f}=s,g=Pt(Nn,s.__scopeDialog);return n.jsx(Zs,{present:c||g.open,children:g.modal?n.jsx(fx,{...f,ref:u}):n.jsx(px,{...f,ref:u})})});Ef.displayName=Nn;var fx=m.forwardRef((s,u)=>{const a=Pt(Nn,s.__scopeDialog),c=m.useRef(null),f=Tr(u,a.contentRef,c);return m.useEffect(()=>{const g=c.current;if(g)return lx(g)},[]),n.jsx(_f,{...s,ref:f,trapFocus:a.open,disableOutsidePointerEvents:a.open,onCloseAutoFocus:xr(s.onCloseAutoFocus,g=>{var p;g.preventDefault(),(p=a.triggerRef.current)==null||p.focus()}),onPointerDownOutside:xr(s.onPointerDownOutside,g=>{const p=g.detail.originalEvent,x=p.button===0&&p.ctrlKey===!0;(p.button===2||x)&&g.preventDefault()}),onFocusOutside:xr(s.onFocusOutside,g=>g.preventDefault())})}),px=m.forwardRef((s,u)=>{const a=Pt(Nn,s.__scopeDialog),c=m.useRef(!1),f=m.useRef(!1);return n.jsx(_f,{...s,ref:u,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:g=>{var p,x;(p=s.onCloseAutoFocus)==null||p.call(s,g),g.defaultPrevented||(c.current||(x=a.triggerRef.current)==null||x.focus(),g.preventDefault()),c.current=!1,f.current=!1},onInteractOutside:g=>{var N,C;(N=s.onInteractOutside)==null||N.call(s,g),g.defaultPrevented||(c.current=!0,g.detail.originalEvent.type==="pointerdown"&&(f.current=!0));const p=g.target;((C=a.triggerRef.current)==null?void 0:C.contains(p))&&g.preventDefault(),g.detail.originalEvent.type==="focusin"&&f.current&&g.preventDefault()}})}),_f=m.forwardRef((s,u)=>{const{__scopeDialog:a,trapFocus:c,onOpenAutoFocus:f,onCloseAutoFocus:g,...p}=s,x=Pt(Nn,a);return bg(),n.jsx(n.Fragment,{children:n.jsx(uf,{asChild:!0,loop:!0,trapped:c,onMountAutoFocus:f,onUnmountAutoFocus:g,children:n.jsx(lf,{role:"dialog",id:x.contentId,"aria-describedby":x.descriptionId,"aria-labelledby":x.titleId,"data-state":ji(x.open),...p,ref:u,deferPointerDownOutside:!0,onDismiss:()=>x.onOpenChange(!1)})})})}),Pf="DialogTitle",mx=m.forwardRef((s,u)=>{const{__scopeDialog:a,...c}=s,f=Pt(Pf,a);return n.jsx(qe.h2,{id:f.titleId,...c,ref:u})});mx.displayName=Pf;var Mf="DialogDescription",hx=m.forwardRef((s,u)=>{const{__scopeDialog:a,...c}=s,f=Pt(Mf,a);return n.jsx(qe.p,{id:f.descriptionId,...c,ref:u})});hx.displayName=Mf;var Rf="DialogClose",gx=m.forwardRef((s,u)=>{const{__scopeDialog:a,...c}=s,f=Pt(Rf,a);return n.jsx(qe.button,{type:"button",...c,ref:u,onClick:xr(s.onClick,()=>f.onOpenChange(!1))})});gx.displayName=Rf;function ji(s){return s?"open":"closed"}var mo='[cmdk-group=""]',ri='[cmdk-group-items=""]',xx='[cmdk-group-heading=""]',zf='[cmdk-item=""]',$d=`${zf}:not([aria-disabled="true"])`,fi="cmdk-item-select",gn="data-value",vx=(s,u,a)=>Lh(s,u,a),Lf=m.createContext(void 0),bo=()=>m.useContext(Lf),Of=m.createContext(void 0),Ni=()=>m.useContext(Of),Df=m.createContext(void 0),Af=m.forwardRef((s,u)=>{let a=xn(()=>{var h,T;return{search:"",value:(T=(h=s.value)!=null?h:s.defaultValue)!=null?T:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),c=xn(()=>new Set),f=xn(()=>new Map),g=xn(()=>new Map),p=xn(()=>new Set),x=Tf(s),{label:N,children:C,value:j,onValueChange:_,filter:P,shouldFilter:L,loop:O,disablePointerSelection:w=!1,vimBindings:R=!0,...D}=s,M=Kt(),F=Kt(),K=Kt(),Y=m.useRef(null),Q=Px();Ar(()=>{if(j!==void 0){let h=j.trim();a.current.value=h,se.emit()}},[j]),Ar(()=>{Q(6,_e)},[]);let se=m.useMemo(()=>({subscribe:h=>(p.current.add(h),()=>p.current.delete(h)),snapshot:()=>a.current,setState:(h,T,U)=>{var B,q,J,ce;if(!Object.is(a.current[h],T)){if(a.current[h]=T,h==="search")ne(),A(),Q(1,ae);else if(h==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let me=document.getElementById(K);me?me.focus():(B=document.getElementById(M))==null||B.focus()}if(Q(7,()=>{var me;a.current.selectedItemId=(me=ve())==null?void 0:me.id,se.emit()}),U||Q(5,_e),((q=x.current)==null?void 0:q.value)!==void 0){let me=T??"";(ce=(J=x.current).onValueChange)==null||ce.call(J,me);return}}se.emit()}},emit:()=>{p.current.forEach(h=>h())}}),[]),ge=m.useMemo(()=>({value:(h,T,U)=>{var B;T!==((B=g.current.get(h))==null?void 0:B.value)&&(g.current.set(h,{value:T,keywords:U}),a.current.filtered.items.set(h,de(T,U)),Q(2,()=>{A(),se.emit()}))},item:(h,T)=>(c.current.add(h),T&&(f.current.has(T)?f.current.get(T).add(h):f.current.set(T,new Set([h]))),Q(3,()=>{ne(),A(),a.current.value||ae(),se.emit()}),()=>{g.current.delete(h),c.current.delete(h),a.current.filtered.items.delete(h);let U=ve();Q(4,()=>{ne(),(U==null?void 0:U.getAttribute("id"))===h&&ae(),se.emit()})}),group:h=>(f.current.has(h)||f.current.set(h,new Set),()=>{g.current.delete(h),f.current.delete(h)}),filter:()=>x.current.shouldFilter,label:N||s["aria-label"],getDisablePointerSelection:()=>x.current.disablePointerSelection,listId:M,inputId:K,labelId:F,listInnerRef:Y}),[]);function de(h,T){var U,B;let q=(B=(U=x.current)==null?void 0:U.filter)!=null?B:vx;return h?q(h,a.current.search,T):0}function A(){if(!a.current.search||x.current.shouldFilter===!1)return;let h=a.current.filtered.items,T=[];a.current.filtered.groups.forEach(B=>{let q=f.current.get(B),J=0;q.forEach(ce=>{let me=h.get(ce);J=Math.max(me,J)}),T.push([B,J])});let U=Y.current;je().sort((B,q)=>{var J,ce;let me=B.getAttribute("id"),Re=q.getAttribute("id");return((J=h.get(Re))!=null?J:0)-((ce=h.get(me))!=null?ce:0)}).forEach(B=>{let q=B.closest(ri);q?q.appendChild(B.parentElement===q?B:B.closest(`${ri} > *`)):U.appendChild(B.parentElement===U?B:B.closest(`${ri} > *`))}),T.sort((B,q)=>q[1]-B[1]).forEach(B=>{var q;let J=(q=Y.current)==null?void 0:q.querySelector(`${mo}[${gn}="${encodeURIComponent(B[0])}"]`);J==null||J.parentElement.appendChild(J)})}function ae(){let h=je().find(U=>U.getAttribute("aria-disabled")!=="true"),T=h==null?void 0:h.getAttribute(gn);se.setState("value",T||void 0)}function ne(){var h,T,U,B;if(!a.current.search||x.current.shouldFilter===!1){a.current.filtered.count=c.current.size;return}a.current.filtered.groups=new Set;let q=0;for(let J of c.current){let ce=(T=(h=g.current.get(J))==null?void 0:h.value)!=null?T:"",me=(B=(U=g.current.get(J))==null?void 0:U.keywords)!=null?B:[],Re=de(ce,me);a.current.filtered.items.set(J,Re),Re>0&&q++}for(let[J,ce]of f.current)for(let me of ce)if(a.current.filtered.items.get(me)>0){a.current.filtered.groups.add(J);break}a.current.filtered.count=q}function _e(){var h,T,U;let B=ve();B&&(((h=B.parentElement)==null?void 0:h.firstChild)===B&&((U=(T=B.closest(mo))==null?void 0:T.querySelector(xx))==null||U.scrollIntoView({block:"nearest"})),B.scrollIntoView({block:"nearest"}))}function ve(){var h;return(h=Y.current)==null?void 0:h.querySelector(`${zf}[aria-selected="true"]`)}function je(){var h;return Array.from(((h=Y.current)==null?void 0:h.querySelectorAll($d))||[])}function Ne(h){let T=je()[h];T&&se.setState("value",T.getAttribute(gn))}function Se(h){var T;let U=ve(),B=je(),q=B.findIndex(ce=>ce===U),J=B[q+h];(T=x.current)!=null&&T.loop&&(J=q+h<0?B[B.length-1]:q+h===B.length?B[0]:B[q+h]),J&&se.setState("value",J.getAttribute(gn))}function G(h){let T=ve(),U=T==null?void 0:T.closest(mo),B;for(;U&&!B;)U=h>0?Ex(U,mo):_x(U,mo),B=U==null?void 0:U.querySelector($d);B?se.setState("value",B.getAttribute(gn)):Se(h)}let ee=()=>Ne(je().length-1),Z=h=>{h.preventDefault(),h.metaKey?ee():h.altKey?G(1):Se(1)},k=h=>{h.preventDefault(),h.metaKey?Ne(0):h.altKey?G(-1):Se(-1)};return m.createElement(qe.div,{ref:u,tabIndex:-1,...D,"cmdk-root":"",onKeyDown:h=>{var T;(T=D.onKeyDown)==null||T.call(D,h);let U=h.nativeEvent.isComposing||h.keyCode===229;if(!(h.defaultPrevented||U))switch(h.key){case"n":case"j":{R&&h.ctrlKey&&Z(h);break}case"ArrowDown":{Z(h);break}case"p":case"k":{R&&h.ctrlKey&&k(h);break}case"ArrowUp":{k(h);break}case"Home":{h.preventDefault(),Ne(0);break}case"End":{h.preventDefault(),ee();break}case"Enter":{h.preventDefault();let B=ve();if(B){let q=new Event(fi);B.dispatchEvent(q)}}}}},m.createElement("label",{"cmdk-label":"",htmlFor:ge.inputId,id:ge.labelId,style:Rx},N),Js(s,h=>m.createElement(Of.Provider,{value:se},m.createElement(Lf.Provider,{value:ge},h))))}),yx=m.forwardRef((s,u)=>{var a,c;let f=Kt(),g=m.useRef(null),p=m.useContext(Df),x=bo(),N=Tf(s),C=(c=(a=N.current)==null?void 0:a.forceMount)!=null?c:p==null?void 0:p.forceMount;Ar(()=>{if(!C)return x.item(f,p==null?void 0:p.id)},[C]);let j=If(f,g,[s.value,s.children,g],s.keywords),_=Ni(),P=vr(Q=>Q.value&&Q.value===j.current),L=vr(Q=>C||x.filter()===!1?!0:Q.search?Q.filtered.items.get(f)>0:!0);m.useEffect(()=>{let Q=g.current;if(!(!Q||s.disabled))return Q.addEventListener(fi,O),()=>Q.removeEventListener(fi,O)},[L,s.onSelect,s.disabled]);function O(){var Q,se;w(),(se=(Q=N.current).onSelect)==null||se.call(Q,j.current)}function w(){_.setState("value",j.current,!0)}if(!L)return null;let{disabled:R,value:D,onSelect:M,forceMount:F,keywords:K,...Y}=s;return m.createElement(qe.div,{ref:jn(g,u),...Y,id:f,"cmdk-item":"",role:"option","aria-disabled":!!R,"aria-selected":!!P,"data-disabled":!!R,"data-selected":!!P,onPointerMove:R||x.getDisablePointerSelection()?void 0:w,onClick:R?void 0:O},s.children)}),bx=m.forwardRef((s,u)=>{let{heading:a,children:c,forceMount:f,...g}=s,p=Kt(),x=m.useRef(null),N=m.useRef(null),C=Kt(),j=bo(),_=vr(L=>f||j.filter()===!1?!0:L.search?L.filtered.groups.has(p):!0);Ar(()=>j.group(p),[]),If(p,x,[s.value,s.heading,N]);let P=m.useMemo(()=>({id:p,forceMount:f}),[f]);return m.createElement(qe.div,{ref:jn(x,u),...g,"cmdk-group":"",role:"presentation",hidden:_?void 0:!0},a&&m.createElement("div",{ref:N,"cmdk-group-heading":"","aria-hidden":!0,id:C},a),Js(s,L=>m.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":a?C:void 0},m.createElement(Df.Provider,{value:P},L))))}),wx=m.forwardRef((s,u)=>{let{alwaysRender:a,...c}=s,f=m.useRef(null),g=vr(p=>!p.search);return!a&&!g?null:m.createElement(qe.div,{ref:jn(f,u),...c,"cmdk-separator":"",role:"separator"})}),kx=m.forwardRef((s,u)=>{let{onValueChange:a,...c}=s,f=s.value!=null,g=Ni(),p=vr(C=>C.search),x=vr(C=>C.selectedItemId),N=bo();return m.useEffect(()=>{s.value!=null&&g.setState("search",s.value)},[s.value]),m.createElement(qe.input,{ref:u,...c,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":N.listId,"aria-labelledby":N.labelId,"aria-activedescendant":x,id:N.inputId,type:"text",value:f?s.value:p,onChange:C=>{f||g.setState("search",C.target.value),a==null||a(C.target.value)}})}),jx=m.forwardRef((s,u)=>{let{children:a,label:c="Suggestions",...f}=s,g=m.useRef(null),p=m.useRef(null),x=vr(C=>C.selectedItemId),N=bo();return m.useEffect(()=>{if(p.current&&g.current){let C=p.current,j=g.current,_,P=new ResizeObserver(()=>{_=requestAnimationFrame(()=>{let L=C.offsetHeight;j.style.setProperty("--cmdk-list-height",L.toFixed(1)+"px")})});return P.observe(C),()=>{cancelAnimationFrame(_),P.unobserve(C)}}},[]),m.createElement(qe.div,{ref:jn(g,u),...f,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":x,"aria-label":c,id:N.listId},Js(s,C=>m.createElement("div",{ref:jn(p,N.listInnerRef),"cmdk-list-sizer":""},C)))}),Nx=m.forwardRef((s,u)=>{let{open:a,onOpenChange:c,overlayClassName:f,contentClassName:g,container:p,...x}=s;return m.createElement(kf,{open:a,onOpenChange:c},m.createElement(Sf,{container:p},m.createElement(Cf,{"cmdk-overlay":"",className:f}),m.createElement(Ef,{"aria-label":s.label,"cmdk-dialog":"",className:g},m.createElement(Af,{ref:u,...x}))))}),Sx=m.forwardRef((s,u)=>vr(a=>a.filtered.count===0)?m.createElement(qe.div,{ref:u,...s,"cmdk-empty":"",role:"presentation"}):null),Cx=m.forwardRef((s,u)=>{let{progress:a,children:c,label:f="Loading...",...g}=s;return m.createElement(qe.div,{ref:u,...g,"cmdk-loading":"",role:"progressbar","aria-valuenow":a,"aria-valuemin":0,"aria-valuemax":100,"aria-label":f},Js(s,p=>m.createElement("div",{"aria-hidden":!0},p)))}),pn=Object.assign(Af,{List:jx,Item:yx,Input:kx,Group:bx,Separator:wx,Dialog:Nx,Empty:Sx,Loading:Cx});function Ex(s,u){let a=s.nextElementSibling;for(;a;){if(a.matches(u))return a;a=a.nextElementSibling}}function _x(s,u){let a=s.previousElementSibling;for(;a;){if(a.matches(u))return a;a=a.previousElementSibling}}function Tf(s){let u=m.useRef(s);return Ar(()=>{u.current=s}),u}var Ar=typeof window>"u"?m.useEffect:m.useLayoutEffect;function xn(s){let u=m.useRef();return u.current===void 0&&(u.current=s()),u}function vr(s){let u=Ni(),a=()=>s(u.snapshot());return m.useSyncExternalStore(u.subscribe,a,a)}function If(s,u,a,c=[]){let f=m.useRef(),g=bo();return Ar(()=>{var p;let x=(()=>{var C;for(let j of a){if(typeof j=="string")return j.trim();if(typeof j=="object"&&"current"in j)return j.current?(C=j.current.textContent)==null?void 0:C.trim():f.current}})(),N=c.map(C=>C.trim());g.value(s,x,N),(p=u.current)==null||p.setAttribute(gn,x),f.current=x}),f}var Px=()=>{let[s,u]=m.useState(),a=xn(()=>new Map);return Ar(()=>{a.current.forEach(c=>c()),a.current=new Map},[s]),(c,f)=>{a.current.set(c,f),u({})}};function Mx(s){let u=s.type;return typeof u=="function"?u(s.props):"render"in u?u.render(s.props):s}function Js({asChild:s,children:u},a){return s&&m.isValidElement(u)?m.cloneElement(Mx(u),{ref:u.ref},a(u.props.children)):a(u)}var Rx={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function zx({onNavigate:s}){const[u,a]=m.useState(!1);return m.useEffect(()=>{const c=f=>{(f.metaKey||f.ctrlKey)&&f.key.toLowerCase()==="k"&&(f.preventDefault(),a(g=>!g))};return document.addEventListener("keydown",c),()=>document.removeEventListener("keydown",c)},[]),n.jsx(pn.Dialog,{open:u,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(pn.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(pn.List,{className:"max-h-80 overflow-y-auto p-2",children:[n.jsx(pn.Empty,{className:"px-3 py-6 text-center text-sm text-muted-foreground",children:"Nichts gefunden."}),n.jsx(pn.Group,{heading:"Bereiche",className:"px-1 py-1 text-xs text-muted-foreground",children:ii.map(c=>n.jsxs(pn.Item,{value:`${c.label} ${c.hint}`,onSelect:()=>{s(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 ue(s,u){const a=await fetch(s,{headers:{"Content-Type":"application/json"},...u});if(!a.ok)throw new Error(`${a.status} ${a.statusText}`);return a.json()}function Ff(s){var u,a,c="";if(typeof s=="string"||typeof s=="number")c+=s;else if(typeof s=="object")if(Array.isArray(s)){var f=s.length;for(u=0;u{const u=Ax(s),{conflictingClassGroups:a,conflictingClassGroupModifiers:c}=s;return{getClassGroupId:p=>{const x=p.split(Si);return x[0]===""&&x.length!==1&&x.shift(),$f(x,u)||Dx(p)},getConflictingClassGroupIds:(p,x)=>{const N=a[p]||[];return x&&c[p]?[...N,...c[p]]:N}}},$f=(s,u)=>{var p;if(s.length===0)return u.classGroupId;const a=s[0],c=u.nextPart.get(a),f=c?$f(s.slice(1),c):void 0;if(f)return f;if(u.validators.length===0)return;const g=s.join(Si);return(p=u.validators.find(({validator:x})=>x(g)))==null?void 0:p.classGroupId},Ud=/^\[(.+)\]$/,Dx=s=>{if(Ud.test(s)){const u=Ud.exec(s)[1],a=u==null?void 0:u.substring(0,u.indexOf(":"));if(a)return"arbitrary.."+a}},Ax=s=>{const{theme:u,prefix:a}=s,c={nextPart:new Map,validators:[]};return Ix(Object.entries(s.classGroups),a).forEach(([g,p])=>{pi(p,c,g,u)}),c},pi=(s,u,a,c)=>{s.forEach(f=>{if(typeof f=="string"){const g=f===""?u:Bd(u,f);g.classGroupId=a;return}if(typeof f=="function"){if(Tx(f)){pi(f(c),u,a,c);return}u.validators.push({validator:f,classGroupId:a});return}Object.entries(f).forEach(([g,p])=>{pi(p,Bd(u,g),a,c)})})},Bd=(s,u)=>{let a=s;return u.split(Si).forEach(c=>{a.nextPart.has(c)||a.nextPart.set(c,{nextPart:new Map,validators:[]}),a=a.nextPart.get(c)}),a},Tx=s=>s.isThemeGetter,Ix=(s,u)=>u?s.map(([a,c])=>{const f=c.map(g=>typeof g=="string"?u+g:typeof g=="object"?Object.fromEntries(Object.entries(g).map(([p,x])=>[u+p,x])):g);return[a,f]}):s,Fx=s=>{if(s<1)return{get:()=>{},set:()=>{}};let u=0,a=new Map,c=new Map;const f=(g,p)=>{a.set(g,p),u++,u>s&&(u=0,c=a,a=new Map)};return{get(g){let p=a.get(g);if(p!==void 0)return p;if((p=c.get(g))!==void 0)return f(g,p),p},set(g,p){a.has(g)?a.set(g,p):f(g,p)}}},Uf="!",$x=s=>{const{separator:u,experimentalParseClassName:a}=s,c=u.length===1,f=u[0],g=u.length,p=x=>{const N=[];let C=0,j=0,_;for(let R=0;Rj?_-j:void 0;return{modifiers:N,hasImportantModifier:L,baseClassName:O,maybePostfixModifierPosition:w}};return a?x=>a({className:x,parseClassName:p}):p},Ux=s=>{if(s.length<=1)return s;const u=[];let a=[];return s.forEach(c=>{c[0]==="["?(u.push(...a.sort(),c),a=[]):a.push(c)}),u.push(...a.sort()),u},Bx=s=>({cache:Fx(s.cacheSize),parseClassName:$x(s),...Ox(s)}),Wx=/\s+/,Vx=(s,u)=>{const{parseClassName:a,getClassGroupId:c,getConflictingClassGroupIds:f}=u,g=[],p=s.trim().split(Wx);let x="";for(let N=p.length-1;N>=0;N-=1){const C=p[N],{modifiers:j,hasImportantModifier:_,baseClassName:P,maybePostfixModifierPosition:L}=a(C);let O=!!L,w=c(O?P.substring(0,L):P);if(!w){if(!O){x=C+(x.length>0?" "+x:x);continue}if(w=c(P),!w){x=C+(x.length>0?" "+x:x);continue}O=!1}const R=Ux(j).join(":"),D=_?R+Uf:R,M=D+w;if(g.includes(M))continue;g.push(M);const F=f(w,O);for(let K=0;K0?" "+x:x)}return x};function Hx(){let s=0,u,a,c="";for(;s{if(typeof s=="string")return s;let u,a="";for(let c=0;c_(j),s());return a=Bx(C),c=a.cache.get,f=a.cache.set,g=x,x(N)}function x(N){const C=c(N);if(C)return C;const j=Vx(N,a);return f(N,j),j}return function(){return g(Hx.apply(null,arguments))}}const De=s=>{const u=a=>a[s]||[];return u.isThemeGetter=!0,u},Wf=/^\[(?:([a-z-]+):)?(.+)\]$/i,Kx=/^\d+\/\d+$/,Qx=new Set(["px","full","screen"]),Yx=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Zx=/\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$/,qx=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Xx=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Jx=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Gt=s=>yn(s)||Qx.has(s)||Kx.test(s),pr=s=>Sn(s,"length",a0),yn=s=>!!s&&!Number.isNaN(Number(s)),ni=s=>Sn(s,"number",yn),ho=s=>!!s&&Number.isInteger(Number(s)),e0=s=>s.endsWith("%")&&yn(s.slice(0,-1)),be=s=>Wf.test(s),mr=s=>Yx.test(s),t0=new Set(["length","size","percentage"]),r0=s=>Sn(s,t0,Vf),n0=s=>Sn(s,"position",Vf),o0=new Set(["image","url"]),s0=s=>Sn(s,o0,u0),l0=s=>Sn(s,"",i0),go=()=>!0,Sn=(s,u,a)=>{const c=Wf.exec(s);return c?c[1]?typeof u=="string"?c[1]===u:u.has(c[1]):a(c[2]):!1},a0=s=>Zx.test(s)&&!qx.test(s),Vf=()=>!1,i0=s=>Xx.test(s),u0=s=>Jx.test(s),c0=()=>{const s=De("colors"),u=De("spacing"),a=De("blur"),c=De("brightness"),f=De("borderColor"),g=De("borderRadius"),p=De("borderSpacing"),x=De("borderWidth"),N=De("contrast"),C=De("grayscale"),j=De("hueRotate"),_=De("invert"),P=De("gap"),L=De("gradientColorStops"),O=De("gradientColorStopPositions"),w=De("inset"),R=De("margin"),D=De("opacity"),M=De("padding"),F=De("saturate"),K=De("scale"),Y=De("sepia"),Q=De("skew"),se=De("space"),ge=De("translate"),de=()=>["auto","contain","none"],A=()=>["auto","hidden","clip","visible","scroll"],ae=()=>["auto",be,u],ne=()=>[be,u],_e=()=>["",Gt,pr],ve=()=>["auto",yn,be],je=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Ne=()=>["solid","dashed","dotted","double","none"],Se=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],G=()=>["start","end","center","between","around","evenly","stretch"],ee=()=>["","0",be],Z=()=>["auto","avoid","all","avoid-page","page","left","right","column"],k=()=>[yn,be];return{cacheSize:500,separator:":",theme:{colors:[go],spacing:[Gt,pr],blur:["none","",mr,be],brightness:k(),borderColor:[s],borderRadius:["none","","full",mr,be],borderSpacing:ne(),borderWidth:_e(),contrast:k(),grayscale:ee(),hueRotate:k(),invert:ee(),gap:ne(),gradientColorStops:[s],gradientColorStopPositions:[e0,pr],inset:ae(),margin:ae(),opacity:k(),padding:ne(),saturate:k(),scale:k(),sepia:ee(),skew:k(),space:ne(),translate:ne()},classGroups:{aspect:[{aspect:["auto","square","video",be]}],container:["container"],columns:[{columns:[mr]}],"break-after":[{"break-after":Z()}],"break-before":[{"break-before":Z()}],"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:[...je(),be]}],overflow:[{overflow:A()}],"overflow-x":[{"overflow-x":A()}],"overflow-y":[{"overflow-y":A()}],overscroll:[{overscroll:de()}],"overscroll-x":[{"overscroll-x":de()}],"overscroll-y":[{"overscroll-y":de()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[w]}],"inset-x":[{"inset-x":[w]}],"inset-y":[{"inset-y":[w]}],start:[{start:[w]}],end:[{end:[w]}],top:[{top:[w]}],right:[{right:[w]}],bottom:[{bottom:[w]}],left:[{left:[w]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ho,be]}],basis:[{basis:ae()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",be]}],grow:[{grow:ee()}],shrink:[{shrink:ee()}],order:[{order:["first","last","none",ho,be]}],"grid-cols":[{"grid-cols":[go]}],"col-start-end":[{col:["auto",{span:["full",ho,be]},be]}],"col-start":[{"col-start":ve()}],"col-end":[{"col-end":ve()}],"grid-rows":[{"grid-rows":[go]}],"row-start-end":[{row:["auto",{span:[ho,be]},be]}],"row-start":[{"row-start":ve()}],"row-end":[{"row-end":ve()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",be]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",be]}],gap:[{gap:[P]}],"gap-x":[{"gap-x":[P]}],"gap-y":[{"gap-y":[P]}],"justify-content":[{justify:["normal",...G()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...G(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...G(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[M]}],px:[{px:[M]}],py:[{py:[M]}],ps:[{ps:[M]}],pe:[{pe:[M]}],pt:[{pt:[M]}],pr:[{pr:[M]}],pb:[{pb:[M]}],pl:[{pl:[M]}],m:[{m:[R]}],mx:[{mx:[R]}],my:[{my:[R]}],ms:[{ms:[R]}],me:[{me:[R]}],mt:[{mt:[R]}],mr:[{mr:[R]}],mb:[{mb:[R]}],ml:[{ml:[R]}],"space-x":[{"space-x":[se]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[se]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",be,u]}],"min-w":[{"min-w":[be,u,"min","max","fit"]}],"max-w":[{"max-w":[be,u,"none","full","min","max","fit","prose",{screen:[mr]},mr]}],h:[{h:[be,u,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[be,u,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[be,u,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[be,u,"auto","min","max","fit"]}],"font-size":[{text:["base",mr,pr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",ni]}],"font-family":[{font:[go]}],"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",be]}],"line-clamp":[{"line-clamp":["none",yn,ni]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Gt,be]}],"list-image":[{"list-image":["none",be]}],"list-style-type":[{list:["none","disc","decimal",be]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[s]}],"placeholder-opacity":[{"placeholder-opacity":[D]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[s]}],"text-opacity":[{"text-opacity":[D]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Ne(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Gt,pr]}],"underline-offset":[{"underline-offset":["auto",Gt,be]}],"text-decoration-color":[{decoration:[s]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:ne()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",be]}],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",be]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[D]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...je(),n0]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",r0]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},s0]}],"bg-color":[{bg:[s]}],"gradient-from-pos":[{from:[O]}],"gradient-via-pos":[{via:[O]}],"gradient-to-pos":[{to:[O]}],"gradient-from":[{from:[L]}],"gradient-via":[{via:[L]}],"gradient-to":[{to:[L]}],rounded:[{rounded:[g]}],"rounded-s":[{"rounded-s":[g]}],"rounded-e":[{"rounded-e":[g]}],"rounded-t":[{"rounded-t":[g]}],"rounded-r":[{"rounded-r":[g]}],"rounded-b":[{"rounded-b":[g]}],"rounded-l":[{"rounded-l":[g]}],"rounded-ss":[{"rounded-ss":[g]}],"rounded-se":[{"rounded-se":[g]}],"rounded-ee":[{"rounded-ee":[g]}],"rounded-es":[{"rounded-es":[g]}],"rounded-tl":[{"rounded-tl":[g]}],"rounded-tr":[{"rounded-tr":[g]}],"rounded-br":[{"rounded-br":[g]}],"rounded-bl":[{"rounded-bl":[g]}],"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":[D]}],"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":[D]}],"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":[Gt,be]}],"outline-w":[{outline:[Gt,pr]}],"outline-color":[{outline:[s]}],"ring-w":[{ring:_e()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[s]}],"ring-opacity":[{"ring-opacity":[D]}],"ring-offset-w":[{"ring-offset":[Gt,pr]}],"ring-offset-color":[{"ring-offset":[s]}],shadow:[{shadow:["","inner","none",mr,l0]}],"shadow-color":[{shadow:[go]}],opacity:[{opacity:[D]}],"mix-blend":[{"mix-blend":[...Se(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Se()}],filter:[{filter:["","none"]}],blur:[{blur:[a]}],brightness:[{brightness:[c]}],contrast:[{contrast:[N]}],"drop-shadow":[{"drop-shadow":["","none",mr,be]}],grayscale:[{grayscale:[C]}],"hue-rotate":[{"hue-rotate":[j]}],invert:[{invert:[_]}],saturate:[{saturate:[F]}],sepia:[{sepia:[Y]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[a]}],"backdrop-brightness":[{"backdrop-brightness":[c]}],"backdrop-contrast":[{"backdrop-contrast":[N]}],"backdrop-grayscale":[{"backdrop-grayscale":[C]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[j]}],"backdrop-invert":[{"backdrop-invert":[_]}],"backdrop-opacity":[{"backdrop-opacity":[D]}],"backdrop-saturate":[{"backdrop-saturate":[F]}],"backdrop-sepia":[{"backdrop-sepia":[Y]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[p]}],"border-spacing-x":[{"border-spacing-x":[p]}],"border-spacing-y":[{"border-spacing-y":[p]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",be]}],duration:[{duration:k()}],ease:[{ease:["linear","in","out","in-out",be]}],delay:[{delay:k()}],animate:[{animate:["none","spin","ping","pulse","bounce",be]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[K]}],"scale-x":[{"scale-x":[K]}],"scale-y":[{"scale-y":[K]}],rotate:[{rotate:[ho,be]}],"translate-x":[{"translate-x":[ge]}],"translate-y":[{"translate-y":[ge]}],"skew-x":[{"skew-x":[Q]}],"skew-y":[{"skew-y":[Q]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",be]}],accent:[{accent:["auto",s]}],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",be]}],"caret-color":[{caret:[s]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":ne()}],"scroll-mx":[{"scroll-mx":ne()}],"scroll-my":[{"scroll-my":ne()}],"scroll-ms":[{"scroll-ms":ne()}],"scroll-me":[{"scroll-me":ne()}],"scroll-mt":[{"scroll-mt":ne()}],"scroll-mr":[{"scroll-mr":ne()}],"scroll-mb":[{"scroll-mb":ne()}],"scroll-ml":[{"scroll-ml":ne()}],"scroll-p":[{"scroll-p":ne()}],"scroll-px":[{"scroll-px":ne()}],"scroll-py":[{"scroll-py":ne()}],"scroll-ps":[{"scroll-ps":ne()}],"scroll-pe":[{"scroll-pe":ne()}],"scroll-pt":[{"scroll-pt":ne()}],"scroll-pr":[{"scroll-pr":ne()}],"scroll-pb":[{"scroll-pb":ne()}],"scroll-pl":[{"scroll-pl":ne()}],"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",be]}],fill:[{fill:[s,"none"]}],"stroke-w":[{stroke:[Gt,pr,ni]}],stroke:[{stroke:[s,"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"]}}},d0=Gx(c0);function ie(...s){return d0(Lx(s))}function Gs(s){return s?s.replace(/127\.0\.0\.1|localhost/g,"192.168.178.151"):""}function mn(s){return(s/1024**3).toFixed(1)}function Is({value:s,label:u,detail:a}){const f=2*Math.PI*24,g=f-Math.min(s,100)/100*f,p=s>90?"stroke-red-500":s>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:ie("fill-none transition-all duration-700 ease-out",p),strokeWidth:"4.5",strokeDasharray:f,strokeDashoffset:g,strokeLinecap:"round"})]}),n.jsxs("span",{className:"text-xs font-mono font-bold tracking-tight text-foreground",children:[Math.round(s),"%"]})]}),n.jsx("span",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wider",children:u}),a&&n.jsx("span",{className:"text-[10px] font-mono text-muted-foreground/80",children:a})]})}function f0(){const[s,u]=m.useState(null),[a,c]=m.useState(null),[f,g]=m.useState([]),[p,x]=m.useState([]),[N,C]=m.useState([]),[j,_]=m.useState(null),[P,L]=m.useState([]),[O,w]=m.useState(""),[R,D]=m.useState(!1),[M,F]=m.useState(""),[K,Y]=m.useState(!1),[Q,se]=m.useState({open:!1,actionPath:"",actionLabel:""}),[ge,de]=m.useState(""),[A,ae]=m.useState("stable"),[ne,_e]=m.useState(!1);function ve(){ue("/api/system/status").then(u).catch(()=>{}),ue("/api/agent/status").then(c).catch(()=>{}),ue("/api/models").then(h=>{g(h.models||[]),x(h.running||[])}).catch(()=>{}),ue("/api/memory?category=").then(h=>C(h.slice(0,3))).catch(()=>{}),ue("/api/maintenance/updates").then(_).catch(()=>{}),ue("/api/jobs").then(h=>L(h.jobs||[])).catch(()=>{})}m.useEffect(()=>{ve();const h=setInterval(ve,3e3);return()=>clearInterval(h)},[]);async function je(h,T,U,B){w(`${T} wird ausgeführt...`),D(!0);try{const q={...U},J=await ue(h,{method:"POST",body:JSON.stringify(q)});if(J.status==="password_required"||J.status==="incorrect_password"){se({open:!0,actionPath:h,actionLabel:T,payload:U,error:J.status==="incorrect_password"?"Falsches Sudo-Passwort. Bitte erneut versuchen.":void 0}),w("");return}J.job_id?w(`${T} gestartet (Job-ID: ${J.job_id})`):J.ok?w(`${T} erfolgreich ausgeführt.`):w(`Fehler: ${J.err||"Unbekannter Fehler"}`),ve()}catch(q){w(`Fehler bei ${T}: ${q.message}`)}finally{D(!1)}}async function Ne(){Y(!0);try{const h={...Q.payload,sudo_password:M},T=await ue(Q.actionPath,{method:"POST",body:JSON.stringify(h)});if(T.status==="password_required"||T.status==="incorrect_password"){se(U=>({...U,error:"Falsches Sudo-Passwort. Bitte erneut versuchen."}));return}T.job_id?w(`${Q.actionLabel} gestartet (Job-ID: ${T.job_id})`):T.ok?w(`${Q.actionLabel} erfolgreich ausgeführt.`):w(`Fehler: ${T.err||"Unbekannter Fehler"}`),se({open:!1,actionPath:"",actionLabel:""}),F(""),ve()}catch(h){w(`Fehler: ${h.message}`),se({open:!1,actionPath:"",actionLabel:""}),F("")}finally{Y(!1)}}async function Se(h,T){w(`Upgrade für ${h} wird gestartet...`);try{await ue("/api/models/install",{method:"POST",body:JSON.stringify({repo:h,role:T,quant:"Q4_K_M",jinja:!0})}),w("Upgrade-Download gestartet."),ve()}catch(U){w(`Upgrade fehlgeschlagen: ${U.message}`)}}async function G(){if(!(!ge.trim()||ne)){_e(!0);try{await ue("/api/memory",{method:"POST",body:JSON.stringify({content:ge,category:A,source:"dashboard"})}),de(""),ue("/api/memory?category=").then(h=>C(h.slice(0,3))).catch(()=>{})}catch(h){console.error(h)}finally{_e(!1)}}}const ee=f.filter(h=>h.role),Z=P.find(h=>h.label.includes("OS-Update")&&(h.state==="running"||h.state==="queued")),k=P.find(h=>h.label.includes("Engine-Update")&&(h.state==="running"||h.state==="queued"));return n.jsxs("div",{className:"space-y-6",children:[Q.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:""}),F("")},className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground cursor-pointer",children:n.jsx(Ys,{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:Q.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:M,onChange:h=>F(h.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:h=>h.key==="Enter"&&Ne(),autoFocus:!0}),Q.error&&n.jsx("div",{className:"text-[10px] font-semibold text-red-400",children:Q.error})]}),n.jsxs("div",{className:"flex gap-2 justify-end",children:[n.jsx("button",{onClick:()=>{se({open:!1,actionPath:"",actionLabel:""}),F("")},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:Ne,disabled:!M||K,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:K?"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(Dr,{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"})]}),s?n.jsxs("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-4",children:[n.jsx(Is,{value:s.cpu.percent,label:"CPU",detail:s.cpu.cores?`${s.cpu.cores} Cores`:void 0}),n.jsx(Is,{value:s.ram.percent,label:"RAM",detail:`${mn(s.ram.used)} / ${mn(s.ram.total)} GB`}),s.gpu&&s.gpu.busy_percent!=null&&s.gpu.gtt_used!=null&&s.gpu.gtt_total!=null&&n.jsx(Is,{value:s.gpu.busy_percent,label:"GPU",detail:`${mn(s.gpu.gtt_used)} / ${mn(s.gpu.gtt_total)} GB`}),s.disk&&n.jsx(Is,{value:s.disk.percent,label:"Disk",detail:`${mn(s.disk.used)} / ${mn(s.disk.total)} GB`})]}):n.jsx("div",{className:"h-28 flex items-center justify-center text-xs text-muted-foreground",children:"Lade Systemdaten…"})]}),(s==null?void 0:s.temp)&&(s.temp.cpu||s.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:[s.temp.cpu!=null&&n.jsxs("span",{children:["CPU Temp: ",s.temp.cpu," °C"]}),s.temp.gpu!=null&&n.jsxs("span",{children:["GPU Temp: ",s.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(bh,{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"})]}),(j==null?void 0:j.last_check)&&n.jsxs("span",{className:"text-[9px] text-muted-foreground/80 font-mono",children:["Zuletzt gesucht: ",new Date(j.last_check*1e3).toLocaleString("de-DE",{day:"2-digit",month:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit"})]})]}),j?n.jsxs("div",{className:"space-y-3",children:[n.jsxs("div",{className:"space-y-1.5",children:[n.jsxs("div",{className:ie("flex items-center justify-between px-3 py-1.5 rounded-lg border text-xs",j.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:j.os>0?`${j.os} verfügbar`:"aktuell"})]}),n.jsxs("div",{className:ie("flex items-center justify-between px-3 py-1.5 rounded-lg border text-xs",j.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:j.engine>0?"Update verfügbar":"aktuell"})]}),n.jsxs("div",{className:ie("flex items-center justify-between px-3 py-1.5 rounded-lg border text-xs",j.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:j.models>0?`${j.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:()=>je("/api/maintenance/os-update","OS-Update"),disabled:R||!!Z,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:Z?n.jsxs(n.Fragment,{children:[n.jsx(kn,{className:"h-3 w-3 animate-spin text-primary"}),n.jsxs("span",{children:["Aktiv (",Z.progress??0,"%)"]})]}):n.jsx("span",{children:"OS Update"})}),n.jsx("button",{onClick:()=>je("/api/maintenance/engine-update","Engine-Update"),disabled:R||!!k,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:k?n.jsxs(n.Fragment,{children:[n.jsx(kn,{className:"h-3 w-3 animate-spin text-primary"}),n.jsxs("span",{children:["Aktiv (",k.progress??0,"%)"]})]}):n.jsx("span",{children:"Engine Update"})})]}),n.jsxs("button",{onClick:()=>{confirm("Bist du sicher, dass du das Host-System neu starten willst?")&&je("/api/maintenance/reboot","Reboot")},disabled:R,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(tf,{className:"h-3.5 w-3.5"}),n.jsx("span",{children:"Host Reboot"})]}),j.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:j.model_list.map(h=>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:`${h.role}: ${h.repo}`,children:[n.jsx("span",{className:"text-primary font-bold uppercase",children:h.role}),": ",h.repo.split("/").pop()]}),n.jsxs("button",{onClick:()=>Se(h.repo,h.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(wn,{className:"h-2.5 w-2.5"})," Laden"]})]},h.repo))})]})]}):n.jsx("div",{className:"h-24 flex items-center justify-center text-xs text-muted-foreground",children:"Lade Updates..."}),O&&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:O}),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(xo,{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-3",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(Ks,{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:Gs(a.webui_url),target:"_blank",rel:"noopener",className:ie("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(Ws,{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:ie("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:ie("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",{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:"Aktives Gehirn"}),n.jsxs("div",{className:"text-xs font-medium mt-1 font-mono text-primary flex items-center gap-1.5",children:[n.jsx(Vs,{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(Vs,{className:"h-4.5 w-4.5 text-primary"}),n.jsx("h2",{className:"text-sm font-semibold tracking-wide uppercase text-foreground",children:"Aktive Rollen"})]}),n.jsx("div",{className:"space-y-2 max-h-48 overflow-y-auto pr-1 scrollbar-thin",children:ee.length===0?n.jsx("div",{className:"text-xs text-muted-foreground py-6 text-center",children:"Keine Modelle als Rollen zugewiesen."}):ee.map(h=>{const T=p.includes(h.name);return n.jsxs("div",{className:ie("flex items-center justify-between p-2.5 rounded-xl border transition-all duration-300",T?"border-primary/50 bg-primary/5 shadow-md shadow-primary/5":"border-border/40 bg-background/20"),children:[n.jsxs("div",{className:"min-w-0 flex-1 mr-2",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:ie("text-[9px] font-semibold uppercase px-1.5 py-0.5 rounded font-mono",h.role==="fast"?"bg-cyan-500/15 text-cyan-400":h.role==="heavy"?"bg-amber-500/15 text-amber-400":h.role==="coder"?"bg-violet-500/15 text-violet-400":h.role==="vision"?"bg-pink-500/15 text-pink-400":"bg-muted text-muted-foreground"),children:h.role}),T&&n.jsxs("span",{className:"flex h-2 w-2 relative",children:[n.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-emerald-400 opacity-75"}),n.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-emerald-500"})]})]}),n.jsx("div",{className:"text-[10px] font-medium mt-1 truncate",title:h.name,children:h.name})]}),n.jsx("div",{className:"text-[9px] font-mono text-muted-foreground shrink-0",children:T?"Warm":"Bereit"})]},h.name)})})]}),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(Qs,{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:ge,onChange:h=>de(h.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:A,onChange:h=>ae(h.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:G,disabled:!ge.trim()||ne,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(ef,{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:N.length===0?n.jsx("div",{className:"text-[10px] text-muted-foreground/75 py-1",children:"Keine Einträge vorhanden."}):N.map(h=>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:h.category}),n.jsx("span",{className:"truncate flex-1 text-muted-foreground hover:text-foreground transition-colors",title:h.content,children:h.content})]},h.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."})]})]})]})}function Or({children:s,tone:u="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[u]}`,children:s})}function Wd({caps:s}){return s?n.jsxs("span",{className:"inline-flex flex-wrap gap-1",children:[s.coder&&n.jsx(Or,{children:"💻 Code"}),s.vision&&n.jsx(Or,{children:"👁 Bild"}),s.reasoning&&n.jsx(Or,{children:"🧠 Reason"}),s.moe&&n.jsxs(Or,{tone:"primary",children:["🧩 MoE",s.active_b?`·${s.active_b}b`:""]}),s.tools==="yes"&&n.jsx(Or,{tone:"primary",children:"🛠 Tools"}),s.tools==="likely"&&n.jsx(Or,{tone:"warn",children:"🛠 Tools?"}),s.embedding&&n.jsx(Or,{children:"🔢 Embed"})]}):null}function mi(s){return s?s>1024**3?`${(s/1024**3).toFixed(1)} GB`:`${(s/1024**2).toFixed(0)} MB`:""}function p0(s){if(!s)return"";const u=Math.floor(s/60);return u>0?`${u} min`:`${s} s`}function m0(){const[s,u]=m.useState([]);function a(){ue("/api/jobs").then(p=>u(p.jobs||[])).catch(()=>{})}m.useEffect(()=>{a();const p=setInterval(a,2e3);return()=>clearInterval(p)},[]);async function c(p){try{await ue(`/api/jobs/${p}/cancel`,{method:"POST"}),a()}catch(x){alert(`Fehler: ${x.message}`)}}const f=s.filter(p=>p.state==="running"||p.state==="queued"),g=s.filter(p=>p.state!=="running"&&p.state!=="queued").slice(-3);return f.length===0&&g.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"}),f.map(p=>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:p.label}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsxs("span",{className:"text-muted-foreground font-mono",children:[p.progress??0,"% • ",mi(p.done_bytes),"/",mi(p.total_bytes),p.eta_s?` • ETA ${p0(p.eta_s)}`:""]}),n.jsx("button",{onClick:()=>c(p.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:`${p.progress??0}%`}})})]},p.id)),g.map(p=>n.jsxs("div",{className:"flex justify-between items-center text-xs text-muted-foreground px-1",children:[n.jsx("span",{className:"truncate",children:p.label}),n.jsx("span",{className:ie("font-semibold text-[10px] px-1.5 py-0.5 rounded uppercase font-mono",p.state==="done"?"bg-emerald-500/10 text-emerald-400":"bg-amber-500/10 text-amber-400"),children:p.state})]},p.id))]})}function hn(s){if(!s)return"—";const u=s/1024**3;return u>=1?`${u.toFixed(1)} GB`:`${(s/1024**2).toFixed(0)} MB`}function Vd(s){return s?`${Math.round(s/1024)}k`:"—"}function h0({fit:s}){const u={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"}[s.level];return n.jsxs("span",{className:ie("rounded px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wider font-mono",u),children:[s.text," • ",s.req_gb," GB RAM"]})}const g0=["fast","heavy","coder","reasoning","agent","vision","scout"];function Hd(s){const u=s.toLowerCase();return u.includes("qwen")?{name:"Qwen",color:"bg-purple-500/20 text-purple-300 border-purple-500/30",initial:"Q"}:u.includes("gemma")?{name:"Gemma",color:"bg-blue-500/20 text-blue-300 border-blue-500/30",initial:"G"}:u.includes("llama")?{name:"Llama",color:"bg-red-500/20 text-red-300 border-red-500/30",initial:"🦙"}:u.includes("mistral")||u.includes("mixtral")?{name:"Mistral",color:"bg-orange-500/20 text-orange-300 border-orange-500/30",initial:"M"}:u.includes("deepseek")?{name:"DeepSeek",color:"bg-cyan-500/20 text-cyan-300 border-cyan-500/30",initial:"D"}:u.includes("hermes")||u.includes("nous")?{name:"Hermes",color:"bg-amber-500/20 text-amber-300 border-amber-500/30",initial:"H"}:u.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 x0(){var yr,Cn,br,Ir,En;const[s,u]=m.useState([]),[a,c]=m.useState([]),[f,g]=m.useState(null),[p,x]=m.useState(null),[N,C]=m.useState(null),[j,_]=m.useState(!0),[P,L]=m.useState(""),[O,w]=m.useState(null),[R,D]=m.useState(null),[M,F]=m.useState(!1),[K,Y]=m.useState(null),[Q,se]=m.useState("grid"),[ge,de]=m.useState({width:800,height:360}),A=m.useRef(null),ae=m.useCallback(I=>{if(A.current&&(A.current.disconnect(),A.current=null),I){const he=new ResizeObserver(we=>{if(!we||we.length===0)return;const Me=we[0].contentRect;de({width:Me.width,height:Me.height})});he.observe(I),A.current=he}},[]),ne=ge.width,_e=ge.height,ve=I=>{const he=ne*.1,we=_e*I,Me=ne*.5,Te=_e*.5,ct=ne*.3,dt=we,Tt=ne*.3;return`M ${he} ${we} C ${ct} ${dt}, ${Tt} ${Te}, ${Me} ${Te}`},je=I=>{const he=ne*.5,we=_e*.5,Me=ne*.9,Te=_e*I,ct=ne*.7,dt=we,Tt=ne*.7;return`M ${he} ${we} C ${ct} ${dt}, ${Tt} ${Te}, ${Me} ${Te}`};function Ne(){Promise.all([ue("/api/models"),ue("/api/routing"),ue("/api/connect"),ue("/api/maintenance/updates")]).then(([I,he,we,Me])=>{u(I.models||[]),c(I.running||[]),g(he),x(we),C(Me)}).catch(I=>L(String(I))).finally(()=>_(!1))}m.useEffect(()=>{Ne();const I=setInterval(Ne,4e3);return()=>clearInterval(I)},[]);async function Se(I){try{await ue(`/api/models/${encodeURIComponent(I)}/load`,{method:"POST"}),Ne()}catch(he){alert(`Fehler beim Laden des Modells: ${he.message}`)}}async function G(I){try{await ue(`/api/models/${encodeURIComponent(I)}/unload`,{method:"POST"}),Ne()}catch(he){alert(`Fehler beim Entladen des Modells: ${he.message}`)}}async function ee(){try{await ue("/api/models/unload",{method:"POST"}),Ne()}catch(I){alert(`Fehler beim Entladen aller Modelle: ${I.message}`)}}async function Z(I,he){D(null);try{await ue(`/api/models/${encodeURIComponent(he)}/role`,{method:"POST",body:JSON.stringify({role:I||null})}),Ne()}catch(we){alert(`Fehler beim Zuweisen der Rolle: ${we}`)}}async function k(I,he){const we=prompt("Kontextlänge (Tokens):",String(he||32768));if(we)try{await ue(`/api/models/${encodeURIComponent(I)}/ctx`,{method:"POST",body:JSON.stringify({ctx:parseInt(we,10)})}),Ne()}catch(Me){alert(`Fehler beim Setzen des Kontexts: ${Me}`)}}async function h(I){if(confirm(`Modell '${I}' und alle zugehörigen GGUF-Dateien unwiderruflich von der Box löschen?`))try{await ue(`/api/models/${encodeURIComponent(I)}`,{method:"DELETE"}),Ne()}catch(he){alert(`Fehler beim Löschen: ${he}`)}}async function T(I,he,we,Me){try{await ue("/api/models/install",{method:"POST",body:JSON.stringify({repo:I,role:he,quant:we,jinja:Me})}),alert(`Download für '${I}' gestartet! Der Fortschritt wird oben angezeigt.`)}catch(Te){alert(`Fehler beim Starten des Upgrades: ${Te}`)}}async function U(I){I&&(await navigator.clipboard.writeText(I),F(!0),setTimeout(()=>F(!1),1500))}if(j)return n.jsx("div",{className:"text-xs text-muted-foreground py-12 text-center",children:"Initialisiere HUD Cockpit…"});if(P)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 (",P,")."]});const B=s.filter(I=>a.includes(I.name)),q=B.reduce((I,he)=>I+(he.size_bytes||0),0),J=16*1024**3,ce=q>J?q*1.2:J,me=I=>s.find(he=>he.role===I),Re=I=>{const he=me(I);return he?a.includes(he.name):!1};return n.jsxs("div",{className:"space-y-8",children:[n.jsx("style",{children:` + @keyframes flow-dash { + to { + stroke-dashoffset: -20; + } + } + .animate-flow-cyan { + stroke-dasharray: 4 6; + animation: flow-dash 1s linear infinite; + } + `}),n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10 space-y-3.5",children:[n.jsxs("div",{className:"flex justify-between items-center",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(li,{className:"h-4.5 w-4.5 text-primary"}),n.jsx("span",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"VRAM / Memory Belegung"})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsxs("span",{className:"text-[10px] font-mono text-muted-foreground",children:["Llama Swap VRAM-Pool: ",hn(q)," / ",hn(ce)," geladen"]}),a.length>0&&n.jsx("button",{onClick:ee,className:"h-6 px-2.5 rounded border border-amber-500/30 bg-amber-500/5 hover:bg-amber-500/10 text-amber-400 text-[9px] font-bold uppercase transition-all cursor-pointer",children:"Alle entladen"})]})]}),n.jsx("div",{className:"h-7 w-full rounded-xl bg-background/50 border border-border/40 overflow-hidden flex p-0.5 relative group",children:B.length===0?n.jsx("div",{className:"w-full h-full flex items-center justify-center text-[10px] text-muted-foreground/60 italic font-mono select-none",children:"VRAM Leer — Auto-Swap lädt Modelle bei Anfrage"}):B.map((I,he)=>{var Te;const we=(I.size_bytes||0)/ce*100,Me=["from-teal-500 to-emerald-500","from-indigo-500 to-blue-500","from-purple-500 to-pink-500","from-cyan-500 to-sky-500"][he%4];return n.jsxs("div",{style:{width:`${we}%`},className:ie("h-full rounded bg-gradient-to-r flex items-center justify-between px-2.5 transition-all text-white/95 shrink-0 shadow-inner select-none",Me),title:`${I.name} (${hn(I.size_bytes)})`,children:[n.jsxs("span",{className:"text-[9px] font-bold truncate max-w-[120px] font-space tracking-wide",children:[I.role?`[${I.role}] `:"",(Te=I.name.split("/").pop())==null?void 0:Te.replace(".gguf","")]}),n.jsx("span",{className:"text-[8px] font-mono opacity-80",children:hn(I.size_bytes)})]},I.name)})})]}),n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-6 shadow-lg shadow-black/10 space-y-4",children:[n.jsxs("div",{children:[n.jsx("span",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"Interactive Gateway Graph"}),n.jsx("p",{className:"text-[10px] text-muted-foreground mt-0.5 leading-relaxed",children:"Klicke links auf Editoren, um Configs zu kopieren. Klicke rechts auf Rollen, um GGUF-Zuweisungen live zu ändern."})]}),n.jsxs("div",{ref:ae,className:"relative w-full h-[360px] border border-border/30 rounded-xl bg-black/25 overflow-hidden flex",children:[n.jsxs("svg",{className:"absolute inset-0 pointer-events-none w-full h-full",children:[n.jsxs("defs",{children:[n.jsxs("linearGradient",{id:"cyan-to-teal",x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[n.jsx("stop",{offset:"0%",stopColor:"#06b6d4",stopOpacity:"0.45"}),n.jsx("stop",{offset:"100%",stopColor:"#0d9488",stopOpacity:"0.45"})]}),n.jsxs("linearGradient",{id:"active-glow",x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[n.jsx("stop",{offset:"0%",stopColor:"#3b82f6",stopOpacity:"0.8"}),n.jsx("stop",{offset:"100%",stopColor:"#10b981",stopOpacity:"0.8"})]})]}),n.jsx("path",{d:ve(.1),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),(K==="roocode"||O==="roocode")&&n.jsx("path",{d:ve(.1),stroke:"#06b6d4",strokeWidth:"2.5",fill:"none",className:"animate-flow-cyan"}),n.jsx("path",{d:ve(.3),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),(K==="cursor"||O==="cursor")&&n.jsx("path",{d:ve(.3),stroke:"#06b6d4",strokeWidth:"2.5",fill:"none",className:"animate-flow-cyan"}),n.jsx("path",{d:ve(.5),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),(K==="opencode"||O==="opencode")&&n.jsx("path",{d:ve(.5),stroke:"#06b6d4",strokeWidth:"2.5",fill:"none",className:"animate-flow-cyan"}),n.jsx("path",{d:ve(.7),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),(K==="zed"||O==="zed")&&n.jsx("path",{d:ve(.7),stroke:"#06b6d4",strokeWidth:"2.5",fill:"none",className:"animate-flow-cyan"}),n.jsx("path",{d:ve(.9),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),(K==="continue"||O==="continue")&&n.jsx("path",{d:ve(.9),stroke:"#06b6d4",strokeWidth:"2.5",fill:"none",className:"animate-flow-cyan"}),n.jsx("path",{d:je(.12),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),Re("fast")&&n.jsx("path",{d:je(.12),stroke:"url(#active-glow)",strokeWidth:"2.5",fill:"none",className:"animate-flow-cyan"}),n.jsx("path",{d:je(.31),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),Re("heavy")&&n.jsx("path",{d:je(.31),stroke:"url(#active-glow)",strokeWidth:"2.5",fill:"none",className:"animate-flow-cyan"}),n.jsx("path",{d:je(.5),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),Re("coder")&&n.jsx("path",{d:je(.5),stroke:"url(#active-glow)",strokeWidth:"2.5",fill:"none",className:"animate-flow-cyan"}),n.jsx("path",{d:je(.69),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),Re("vision")&&n.jsx("path",{d:je(.69),stroke:"url(#active-glow)",strokeWidth:"2.5",fill:"none",className:"animate-flow-cyan"}),n.jsx("path",{d:je(.88),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),Re("scout")&&n.jsx("path",{d:je(.88),stroke:"url(#active-glow)",strokeWidth:"2.5",fill:"none",className:"animate-flow-cyan"})]}),n.jsxs("div",{className:"absolute cursor-pointer select-none z-10 w-28 h-8 -translate-y-1/2 -translate-x-1/2 rounded-xl border border-border/60 bg-card/75 backdrop-blur-md flex items-center justify-center gap-1.5 px-2 hover:border-primary transition-all text-[10px] font-semibold text-foreground shadow shadow-black/20",style:{left:"10%",top:"10%"},onMouseEnter:()=>Y("roocode"),onMouseLeave:()=>Y(null),onClick:()=>w(I=>I==="roocode"?null:"roocode"),children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-cyan-400 animate-pulse"}),n.jsx("span",{children:"Roo Code"})]}),n.jsxs("div",{className:"absolute cursor-pointer select-none z-10 w-28 h-8 -translate-y-1/2 -translate-x-1/2 rounded-xl border border-border/60 bg-card/75 backdrop-blur-md flex items-center justify-center gap-1.5 px-2 hover:border-primary transition-all text-[10px] font-semibold text-foreground shadow shadow-black/20",style:{left:"10%",top:"30%"},onMouseEnter:()=>Y("cursor"),onMouseLeave:()=>Y(null),onClick:()=>w(I=>I==="cursor"?null:"cursor"),children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-cyan-400 animate-pulse"}),n.jsx("span",{children:"Cursor IDE"})]}),n.jsxs("div",{className:"absolute cursor-pointer select-none z-10 w-28 h-8 -translate-y-1/2 -translate-x-1/2 rounded-xl border border-border/60 bg-card/75 backdrop-blur-md flex items-center justify-center gap-1.5 px-2 hover:border-primary transition-all text-[10px] font-semibold text-foreground shadow shadow-black/20",style:{left:"10%",top:"50%"},onMouseEnter:()=>Y("opencode"),onMouseLeave:()=>Y(null),onClick:()=>w(I=>I==="opencode"?null:"opencode"),children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-cyan-400 animate-pulse"}),n.jsx("span",{children:"OpenCode"})]}),n.jsxs("div",{className:"absolute cursor-pointer select-none z-10 w-28 h-8 -translate-y-1/2 -translate-x-1/2 rounded-xl border border-border/60 bg-card/75 backdrop-blur-md flex items-center justify-center gap-1.5 px-2 hover:border-primary transition-all text-[10px] font-semibold text-foreground shadow shadow-black/20",style:{left:"10%",top:"70%"},onMouseEnter:()=>Y("zed"),onMouseLeave:()=>Y(null),onClick:()=>w(I=>I==="zed"?null:"zed"),children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-cyan-400 animate-pulse"}),n.jsx("span",{children:"Zed"})]}),n.jsxs("div",{className:"absolute cursor-pointer select-none z-10 w-28 h-8 -translate-y-1/2 -translate-x-1/2 rounded-xl border border-border/60 bg-card/75 backdrop-blur-md flex items-center justify-center gap-1.5 px-2 hover:border-primary transition-all text-[10px] font-semibold text-foreground shadow shadow-black/20",style:{left:"10%",top:"90%"},onMouseEnter:()=>Y("continue"),onMouseLeave:()=>Y(null),onClick:()=>w(I=>I==="continue"?null:"continue"),children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-cyan-400 animate-pulse"}),n.jsx("span",{children:"Continue"})]}),n.jsxs("div",{className:"absolute select-none z-10 w-36 py-3 px-4 -translate-y-1/2 -translate-x-1/2 rounded-2xl border border-primary/50 bg-card/90 backdrop-blur-md flex flex-col items-center justify-center text-center shadow-lg shadow-primary/5",style:{left:"50%",top:"50%"},children:[n.jsx("div",{className:"text-[10px] uppercase font-bold text-primary font-space tracking-wide",children:"Gateway Auto"}),n.jsxs("div",{className:"text-[10px] font-mono text-muted-foreground mt-0.5",children:["Schwelle: > ",f!=null&&f.heavy_threshold_chars?f.heavy_threshold_chars/1e3:"4","k Zeichen"]}),n.jsx("div",{className:"mt-1 px-1.5 py-0.5 rounded bg-primary/10 border border-primary/20 text-[9px] font-semibold text-primary uppercase font-mono",children:"Auto-Swap"})]}),g0.map(I=>{var ct;const he=["12%","31%","50%","69%","88%"],we=me(I),Me=we?a.includes(we.name):!1;if(I==="reasoning"||I==="agent")return null;const Te={fast:0,heavy:1,coder:2,vision:3,scout:4}[I];return n.jsxs("div",{className:ie("absolute z-10 w-44 py-1.5 px-3 -translate-y-1/2 -translate-x-1/2 rounded-xl border flex flex-col justify-center hover:border-primary/50 transition-all text-left shadow select-none cursor-pointer",Me?"border-emerald-500/50 bg-emerald-500/5 shadow-emerald-500/5":we?"border-border/60 bg-card/75":"border-dashed border-border/40 bg-background/20"),style:{left:"90%",top:he[Te]},onClick:()=>D(R===I?null:I),children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground",children:I}),Me&&n.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-400 animate-pulse"})]}),n.jsx("div",{className:"text-[10px] font-mono font-medium truncate mt-0.5 text-foreground max-w-[150px]",children:we?(ct=we.name.split("/").pop())==null?void 0:ct.replace(".gguf",""):"Keine Zuweisung"}),R===I&&n.jsxs("div",{className:"absolute right-0 top-full mt-1 z-35 w-52 rounded-xl border border-border/80 bg-popover/95 backdrop-blur-md p-1.5 shadow-2xl space-y-1",children:[n.jsx("div",{className:"text-[9px] uppercase font-bold text-muted-foreground/60 px-2 py-1 select-none",children:"Modell zuweisen:"}),n.jsx("button",{onClick:()=>Z(I,""),className:"w-full text-left px-2.5 py-1.5 rounded-lg text-[10px] hover:bg-accent text-red-400 font-semibold cursor-pointer",children:"Zuweisung entfernen"}),s.map(dt=>{var Tt;return n.jsxs("button",{onClick:()=>Z(I,dt.name),className:ie("w-full text-left px-2.5 py-1.5 rounded-lg text-[10px] hover:bg-accent flex items-center justify-between font-mono cursor-pointer",dt.role===I?"text-primary font-bold":"text-foreground"),children:[n.jsx("span",{className:"truncate max-w-[150px]",children:(Tt=dt.name.split("/").pop())==null?void 0:Tt.replace(".gguf","")}),dt.role===I&&n.jsx(bn,{className:"h-3 w-3 shrink-0"})]},dt.name)})]})]},I)}),O&&p&&n.jsxs("div",{className:"absolute z-30 md:w-96 w-[90%] rounded-2xl border border-border/80 bg-card/95 backdrop-blur-xl p-4 shadow-2xl space-y-3 flex flex-col justify-between",style:{left:"22%",top:O==="roocode"?"5%":O==="cursor"?"20%":O==="opencode"?"40%":O==="zed"?"55%":"65%"},children:[n.jsxs("div",{className:"flex items-center justify-between border-b border-border/20 pb-2",children:[n.jsxs("span",{className:"text-[11px] font-bold uppercase tracking-wider text-primary",children:[O==="roocode"&&"Roo Code Setup",O==="cursor"&&"Cursor Setup",O==="opencode"&&"OpenCode Setup",O==="zed"&&"Zed Setup",O==="continue"&&"Continue Setup"]}),n.jsx("button",{onClick:()=>w(null),className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground cursor-pointer",children:n.jsx(Ys,{className:"h-3.5 w-3.5"})})]}),n.jsxs("div",{className:"text-[10px] text-muted-foreground leading-relaxed space-y-2",children:[O==="roocode"&&n.jsxs("ul",{className:"list-decimal pl-4 space-y-1",children:[n.jsxs("li",{children:["Suche in VS Code nach der Erweiterung ",n.jsx("strong",{children:"Roo Code"})," und installiere sie."]}),n.jsxs("li",{children:["Wähle in den Roo Code Einstellungen: Provider: ",n.jsx("strong",{children:"OpenAI Compatible"}),"."]}),n.jsxs("li",{children:["Füge das untenstehende JSON-Snippet in die ",n.jsx("code",{children:"settings.json"})," ein."]})]}),O==="cursor"&&n.jsxs("ul",{className:"list-decimal pl-4 space-y-1",children:[n.jsxs("li",{children:["Öffne Cursor Settings ➔ ",n.jsx("strong",{children:"Models"}),"."]}),n.jsxs("li",{children:["Deaktiviere Cloud-Modelle, klappe ",n.jsx("strong",{children:"OpenAI API"})," auf."]}),n.jsxs("li",{children:["Trage die Base URL unten ein und aktiviere das Modell ",n.jsx("strong",{children:"auto"}),"."]})]}),O==="opencode"&&n.jsxs("ul",{className:"list-decimal pl-4 space-y-1",children:[n.jsxs("li",{children:["Öffne die ",n.jsx("code",{children:"opencode.jsonc"})," Konfigurationsdatei."]}),n.jsxs("li",{children:["Ersetze den Provider-Eintrag unter ",n.jsx("code",{children:"provider"})," mit dem Snippet unten."]})]}),O==="zed"&&n.jsxs("ul",{className:"list-decimal pl-4 space-y-1",children:[n.jsxs("li",{children:["Öffne die Zed Settings (",n.jsx("code",{children:"ctrl+,"}),")."]}),n.jsxs("li",{children:["Füge das untenstehende JSON-Segment unter ",n.jsx("code",{children:"language_models"})," ein."]})]}),O==="continue"&&n.jsxs("ul",{className:"list-decimal pl-4 space-y-1",children:[n.jsx("li",{children:"Klicke auf das Zahnrad-Symbol in der Continue-Erweiterung."}),n.jsxs("li",{children:["Füge den Gateway-Eintrag zum ",n.jsx("code",{children:"models"}),"-Array hinzu."]})]})]}),p.tools&&n.jsxs("div",{className:"relative rounded-xl border border-border/40 bg-black/40 overflow-hidden mt-1 shrink-0",children:[n.jsxs("div",{className:"flex items-center justify-between px-3 py-1.5 border-b border-border/20 bg-black/20",children:[n.jsx("span",{className:"text-[8px] font-mono text-muted-foreground",children:"JSON Config"}),n.jsxs("button",{onClick:()=>{var I,he,we,Me,Te;return U(O==="roocode"?(I=p.tools.cline)==null?void 0:I.snippet:O==="cursor"?(he=p.tools.cursor)==null?void 0:he.snippet:O==="opencode"?(we=p.tools.opencode)==null?void 0:we.snippet:O==="zed"?(Me=p.tools.zed)==null?void 0:Me.snippet:(Te=p.tools.continue)==null?void 0:Te.snippet)},className:"text-[9px] font-semibold text-primary hover:text-primary-foreground flex items-center gap-1 cursor-pointer",children:[M?n.jsx(bn,{className:"h-3 w-3 text-emerald-400"}):n.jsx(vi,{className:"h-3 w-3"}),n.jsx("span",{children:M?"Kopiert":"Kopieren"})]})]}),n.jsx("pre",{className:"p-3 max-h-36 overflow-y-auto text-[9px] font-mono text-cyan-200/90 whitespace-pre scrollbar-thin select-text",children:n.jsxs("code",{children:[O==="roocode"&&((yr=p.tools.cline)==null?void 0:yr.snippet),O==="cursor"&&((Cn=p.tools.cursor)==null?void 0:Cn.snippet),O==="opencode"&&((br=p.tools.opencode)==null?void 0:br.snippet),O==="zed"&&((Ir=p.tools.zed)==null?void 0:Ir.snippet),O==="continue"&&((En=p.tools.continue)==null?void 0:En.snippet)]})})]})]})]}),n.jsxs("div",{className:"flex flex-wrap items-center gap-6 mt-3 text-[10px] text-muted-foreground border-t border-border/20 pt-3",children:[n.jsxs("span",{className:"flex items-center gap-1.5",children:[n.jsx("span",{className:"h-2 w-2 rounded-full bg-cyan-400"}),n.jsx("span",{children:"Cyan-Fluss: Client-Anfrage an Gateway"})]}),n.jsxs("span",{className:"flex items-center gap-1.5",children:[n.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-500 animate-pulse"}),n.jsx("span",{children:"Grüner Puls: Aktive Verbindung / Warmes Modell geladen"})]}),n.jsxs("span",{className:"flex items-center gap-1.5",children:[n.jsx("span",{className:"h-2 w-2 rounded bg-gradient-to-r from-teal-500 to-emerald-500"}),n.jsx("span",{children:"VRAM-Verlauf: Modellspezifischer Speicheranteil"})]})]})]}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex items-center justify-between px-1",children:[n.jsx("div",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Installierte Modell-Bibliothek"}),n.jsxs("div",{className:"flex rounded-lg border border-border/40 bg-card/45 p-0.5",children:[n.jsx("button",{onClick:()=>se("grid"),className:ie("px-2.5 py-1 rounded-md text-[9px] font-bold uppercase transition-all cursor-pointer",Q==="grid"?"bg-primary text-primary-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:"Grid"}),n.jsx("button",{onClick:()=>se("list"),className:ie("px-2.5 py-1 rounded-md text-[9px] font-bold uppercase transition-all cursor-pointer",Q==="list"?"bg-primary text-primary-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:"List"})]})]}),Q==="grid"?n.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:s.length===0?n.jsx("div",{className:"col-span-full text-xs text-muted-foreground border border-dashed border-border/60 rounded-2xl p-12 text-center select-none",children:'Keine Modelle konfiguriert. Verwende den Tab "Modelle finden" zum Herunterladen.'}):s.map(I=>{const he=a.includes(I.name),we=N==null?void 0:N.model_list.find(Te=>Te.role===I.role),Me=Hd(I.name);return n.jsxs("div",{className:ie("rounded-2xl border bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10 flex flex-col justify-between gap-4 transition-all duration-300 hover:border-primary/40 group",he?"border-primary/45 shadow-primary/5":"border-border/60"),children:[n.jsxs("div",{className:"space-y-3",children:[n.jsx("div",{className:"flex items-start justify-between gap-3",children:n.jsxs("div",{className:"flex gap-2.5 min-w-0",children:[n.jsx("div",{className:ie("w-7 h-7 rounded-lg border flex items-center justify-center font-bold text-xs shrink-0 shadow-sm",Me.color),title:Me.name,children:Me.initial}),n.jsxs("div",{className:"min-w-0",children:[n.jsx("h3",{className:"text-xs font-bold tracking-tight text-foreground line-clamp-2 break-all font-mono",title:I.name,children:I.name.split("/").pop()}),n.jsxs("div",{className:"flex items-center gap-2 flex-wrap mt-1",children:[n.jsx("span",{className:"text-[9px] font-mono text-muted-foreground bg-background/40 px-1.5 py-0.5 rounded border border-border/30",children:I.quant||"GGUF"}),he&&n.jsxs("span",{className:"flex items-center gap-1 text-[9px] font-semibold text-emerald-400 uppercase tracking-wider",children:[n.jsx(xi,{className:"h-3 w-3 animate-pulse"})," Warm"]}),I.role&&n.jsx("span",{className:"px-1.5 py-0.5 rounded bg-primary/10 border border-primary/20 text-[9px] font-mono text-primary font-bold uppercase",children:I.role})]})]})]})}),n.jsx("div",{className:"border-t border-border/30 pt-3 flex flex-wrap gap-1",children:n.jsx(Wd,{caps:I.capabilities})})]}),n.jsxs("div",{className:"space-y-3 pt-1",children:[n.jsxs("div",{className:"grid grid-cols-2 gap-2 text-[10px] font-mono text-muted-foreground",children:[n.jsxs("div",{className:"flex items-center gap-1.5 p-2 bg-background/20 rounded-lg border border-border/20",children:[n.jsx(li,{className:"h-3.5 w-3.5 text-primary/80"}),n.jsxs("div",{children:[n.jsx("div",{className:"text-[8px] uppercase tracking-wider font-semibold text-muted-foreground/60",children:"Größe"}),n.jsx("div",{className:"text-foreground font-semibold",children:hn(I.size_bytes)})]})]}),n.jsxs("div",{className:"flex items-center gap-1.5 p-2 bg-background/20 rounded-lg border border-border/20",children:[n.jsx(hh,{className:"h-3.5 w-3.5 text-primary/80"}),n.jsxs("div",{children:[n.jsx("div",{className:"text-[8px] uppercase tracking-wider font-semibold text-muted-foreground/60",children:"Kontext"}),n.jsx("div",{className:"text-foreground font-semibold",children:Vd(I.ctx)})]})]})]}),we&&n.jsxs("div",{className:"p-3 bg-amber-500/5 border border-amber-500/30 rounded-xl space-y-2 flex flex-col justify-between shrink-0",children:[n.jsxs("div",{className:"text-[9px] font-semibold text-amber-400 flex items-center gap-1",children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-400 animate-ping"}),n.jsxs("span",{children:["Upgrade verfügbar: ",we.repo.split("/").pop()]})]}),n.jsxs("button",{onClick:()=>T(we.repo,I.role,I.quant||"Q4_K_M",I.capabilities.tools!=="no"),className:"h-7 w-full flex items-center justify-center gap-1 rounded-lg bg-amber-500 text-black text-[10px] font-bold hover:bg-amber-400 transition-colors cursor-pointer",children:[n.jsx(wn,{className:"h-3 w-3"})," Smart-Swap starten"]})]}),n.jsxs("div",{className:"flex items-center gap-1.5 border-t border-border/20 pt-3 mt-auto",children:[n.jsx("button",{onClick:()=>he?G(I.name):Se(I.name),className:ie("flex-1 h-7 rounded-lg text-[9px] font-bold uppercase transition-all cursor-pointer border flex items-center justify-center gap-1",he?"border-amber-500/30 bg-amber-500/5 hover:bg-amber-500/15 text-amber-400":"border-primary/30 bg-primary/5 hover:bg-primary/15 text-primary"),children:he?"Entladen":"Laden"}),n.jsx("button",{onClick:()=>k(I.name,I.ctx),className:"h-7 px-2.5 rounded-lg border border-border/40 text-[9px] font-bold uppercase hover:bg-accent text-muted-foreground transition-colors cursor-pointer",title:"Kontextlänge anpassen",children:"Ctx"}),n.jsx("button",{onClick:()=>h(I.name),className:"h-7 w-7 rounded-lg border border-border/40 text-muted-foreground hover:text-red-400 hover:bg-red-500/5 flex items-center justify-center transition-colors cursor-pointer",title:"Modell löschen",children:n.jsx(ai,{className:"h-3.5 w-3.5"})})]})]})]},I.name)})}):n.jsx("div",{className:"space-y-2",children:s.length===0?n.jsx("div",{className:"text-xs text-muted-foreground border border-dashed border-border/60 rounded-2xl p-12 text-center select-none",children:'Keine Modelle konfiguriert. Verwende den Tab "Modelle finden" zum Herunterladen.'}):s.map(I=>{const he=a.includes(I.name),we=Hd(I.name);return n.jsxs("div",{className:ie("rounded-xl border bg-card/45 backdrop-blur-md p-3.5 shadow-lg shadow-black/5 flex flex-col sm:flex-row sm:items-center justify-between gap-3 hover:border-primary/40 transition-all",he?"border-primary/45":"border-border/60"),children:[n.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[n.jsx("div",{className:ie("w-8 h-8 rounded-lg border border-border/40 flex items-center justify-center font-bold text-xs shrink-0 shadow-sm",we.color),title:we.name,children:we.initial}),n.jsxs("div",{className:"min-w-0 text-left",children:[n.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[n.jsx("h4",{className:"text-xs font-bold text-foreground truncate max-w-[250px] sm:max-w-[400px] break-all font-mono",title:I.name,children:I.name.split("/").pop()}),I.role&&n.jsx("span",{className:"px-1.5 py-0.5 rounded bg-primary/10 border border-primary/20 text-[8px] font-mono text-primary font-bold uppercase shrink-0",children:I.role}),he&&n.jsxs("span",{className:"flex items-center gap-0.5 text-[8px] font-semibold text-emerald-400 uppercase tracking-wider shrink-0",children:[n.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500 animate-pulse"})," warm"]})]}),n.jsxs("div",{className:"text-[10px] text-muted-foreground/80 flex items-center gap-2 mt-0.5",children:[n.jsxs("span",{children:["Größe: ",hn(I.size_bytes)]}),n.jsx("span",{children:"•"}),n.jsxs("span",{children:["Kontext: ",Vd(I.ctx)]}),n.jsx("span",{children:"•"}),n.jsx("span",{className:"font-mono text-[9px]",children:I.quant||"GGUF"})]})]})]}),n.jsxs("div",{className:"flex items-center gap-3 shrink-0 self-end sm:self-auto",children:[n.jsx("div",{className:"hidden lg:flex flex-wrap gap-1",children:n.jsx(Wd,{caps:I.capabilities})}),n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx("button",{onClick:()=>he?G(I.name):Se(I.name),className:ie("h-7 px-3 rounded-lg text-[9px] font-bold uppercase transition-all cursor-pointer border flex items-center gap-1",he?"border-amber-500/30 bg-amber-500/5 hover:bg-amber-500/15 text-amber-400":"border-primary/30 bg-primary/5 hover:bg-primary/15 text-primary"),children:he?"Entladen":"Laden"}),n.jsx("button",{onClick:()=>k(I.name,I.ctx),className:"h-7 px-2.5 rounded-lg border border-border/40 text-[9px] font-bold uppercase hover:bg-accent text-muted-foreground transition-all cursor-pointer",title:"Kontextlänge anpassen",children:"Ctx"}),n.jsx("button",{onClick:()=>h(I.name),className:"h-7 w-7 rounded-lg flex items-center justify-center border border-border/40 text-muted-foreground hover:text-red-400 hover:bg-red-500/5 transition-all cursor-pointer",title:"Modell löschen",children:n.jsx(ai,{className:"h-3.5 w-3.5"})})]})]})]},I.name)})})]})]})}function v0(){const[s,u]=m.useState(""),[a,c]=m.useState([]),[f,g]=m.useState("Q4_K_M"),[p,x]=m.useState(""),[N,C]=m.useState(""),[j,_]=m.useState([]);async function P(w){const R=w??s;if(R.trim()){x("Analysiere HuggingFace Repository...");try{const D=await ue(`/api/hf/quants?repo=${encodeURIComponent(R)}`);u(D.repo),c(D.quants),D.quants.length&&g(D.quants.includes("Q4_K_M")?"Q4_K_M":D.quants[0]),x(D.quants.length?"":"Keine GGUF-Dateien in diesem Repository gefunden.")}catch(D){x(`Fehler: ${D}`)}}}async function L(){if(N.trim()){x("Durchsuche HuggingFace...");try{const w=await ue(`/api/hf/search?q=${encodeURIComponent(N)}`);_(w.results),x(w.results.length?"":"Keine Ergebnisse gefunden.")}catch(w){x(`Suche fehlgeschlagen: ${w}`)}}}async function O(){if(s.trim()){x("Download-Job wird initiiert...");try{await ue("/api/models/install",{method:"POST",body:JSON.stringify({repo:s,quant:f,jinja:!0})}),x(`Download gestartet: ${s} (${f}). Fortschritt wird oben angezeigt.`)}catch(w){x(`Download-Fehler: ${w}`)}}}return n.jsxs("div",{className:"space-y-4 rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10",children:[n.jsx("div",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"HF Download & Suche"}),n.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[n.jsx("input",{value:s,onChange:w=>u(w.target.value),placeholder:"HF-URL oder org/repo (z.B. unsloth/Qwen2.5-Coder-7B-Instruct-GGUF)",className:"flex-1 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"}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx("button",{onClick:()=>P(),className:"h-9 px-4 rounded-lg border border-border/60 bg-background/20 text-xs font-semibold hover:border-primary/50 hover:bg-background/40 transition-all cursor-pointer whitespace-nowrap",children:"Quants laden"}),a.length>0&&n.jsxs(n.Fragment,{children:[n.jsx("select",{value:f,onChange:w=>g(w.target.value),className:"h-9 rounded-lg border border-border/60 bg-background/40 px-3 text-xs outline-none text-foreground font-semibold",children:a.map(w=>n.jsx("option",{value:w,className:"bg-popover text-foreground",children:w},w))}),n.jsxs("button",{onClick:O,className:"h-9 px-4 rounded-lg bg-primary text-primary-foreground text-xs font-semibold hover:opacity-90 transition-all cursor-pointer flex items-center gap-1.5",children:[n.jsx(wn,{className:"h-3.5 w-3.5"})," Herunterladen"]})]})]})]}),n.jsxs("div",{className:"flex gap-2 border-t border-border/20 pt-4",children:[n.jsxs("div",{className:"relative flex-1",children:[n.jsx("input",{value:N,onChange:w=>C(w.target.value),onKeyDown:w=>w.key==="Enter"&&L(),placeholder:"HuggingFace durchsuchen (z.B. Llama-3.1)...",className:"w-full h-9 pl-9 pr-3 rounded-lg border border-border/60 bg-background/40 text-xs outline-none focus:ring-1 focus:ring-primary/50 text-foreground"}),n.jsx(yi,{className:"absolute left-3 top-2.5 h-3.5 w-3.5 text-muted-foreground"})]}),n.jsx("button",{onClick:L,className:"h-9 px-4 rounded-lg border border-border/60 bg-background/20 text-xs font-semibold hover:border-primary/50 hover:bg-background/40 transition-all cursor-pointer",children:"Suchen"})]}),j.length>0&&n.jsx("div",{className:"max-h-48 space-y-1.5 overflow-y-auto border border-border/40 bg-background/20 p-2 rounded-xl scrollbar-thin",children:j.map(w=>n.jsxs("button",{onClick:()=>{u(w.repo),_([]),C(""),P(w.repo)},className:"flex w-full items-center justify-between rounded-lg px-3 py-2 text-left text-xs bg-background/10 border border-border/10 hover:border-primary/30 hover:bg-background/30 transition-all",children:[n.jsx("span",{className:"font-semibold truncate",children:w.repo}),n.jsxs("span",{className:"text-[10px] font-mono text-muted-foreground flex items-center gap-1 shrink-0",children:[n.jsx(wn,{className:"h-3 w-3"})," ",w.downloads.toLocaleString()]})]},w.repo))}),p&&n.jsx("div",{className:"text-[10px] font-medium text-primary font-mono",children:p})]})}const y0={vision:{title:"Bilder & Vision",desc:"Verarbeitet Bilder, Screenshots und visuelle Diagramme in multimodalen Chats.",icon:ch},coder:{title:"Coden & Entwicklung",desc:"Autovervollständigung, Refactoring und Codegenerierung direkt in deiner IDE.",icon:Jd},reasoning:{title:"Logik & Nachdenken",desc:"Komplexe logische Gedankengänge, Mathematik und tiefgründiges Planen (Reasoning).",icon:Qs},agent:{title:"Autonomer Agent (Hermes)",desc:"Führt selbstständig Terminalbefehle aus und interagiert mit deinem Homelab.",icon:Ks},scout:{title:"Allrounder & Chat",desc:"Schnelle Antworten, Zusammenfassungen, Übersetzungen und alltägliche Fragen.",icon:ih}};function b0(){const[s,u]=m.useState(null),[a,c]=m.useState([]),[f,g]=m.useState(null),[p,x]=m.useState(""),[N,C]=m.useState(!0),[j,_]=m.useState({}),[P,L]=m.useState({}),[O,w]=m.useState(!1);m.useEffect(()=>{Promise.all([ue("/api/discover"),ue("/api/models"),ue("/api/maintenance/updates").catch(()=>null)]).then(([D,M,F])=>{u(D),c(M.models||[]),F&&g(F)}).catch(D=>x(String(D))).finally(()=>C(!1))},[]);async function R(D,M,F,K){_(Y=>({...Y,[D]:"Starte..."}));try{await ue("/api/models/install",{method:"POST",body:JSON.stringify({repo:D,role:M,quant:F,jinja:K})}),_(Y=>({...Y,[D]:"Download läuft"}))}catch{_(Q=>({...Q,[D]:"Fehler"}))}}return N?n.jsx("div",{className:"text-xs text-muted-foreground py-12 text-center",children:"Analysiere Hardware und suche passende GGUF-Empfehlungen…"}):p||!s?n.jsxs("div",{className:"rounded-xl border border-red-500/20 bg-red-500/5 p-4 text-xs text-red-400",children:["Empfehlungsdienst temporär nicht erreichbar (",p,")."]}):n.jsxs("div",{className:"space-y-8",children:[n.jsxs("div",{className:"text-[10px] font-mono text-muted-foreground bg-background/25 border border-border/40 p-4 rounded-xl flex flex-col sm:flex-row sm:items-center justify-between gap-3 shadow-sm",children:[n.jsxs("div",{children:["Modell-Registry geladen für ",n.jsxs("span",{className:"text-foreground font-bold",children:[s.sys_ram_gb," GB"]})," System-RAM."]}),n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx(rf,{className:"h-3.5 w-3.5 text-primary fill-primary/20"}),n.jsx("span",{children:"Empfehlungen sind automatisch auf deine Box-Hardware optimiert."})]})]}),n.jsx("div",{className:"grid gap-6 md:grid-cols-2",children:s.categories.map(D=>{const M=y0[D.role]||{title:D.title||D.role,desc:"Spezifisches Modell für diese Systemrolle.",icon:Vs},F=M.icon,K=a.find(A=>A.role===D.role),Y=f==null?void 0:f.model_list.find(A=>A.role===D.role),Q=D.models.find(A=>A.repo===D.recommended)||D.models[0];if(!Q)return null;const se=j[Q.repo],ge=D.models.filter(A=>A.repo!==D.recommended),de=!!P[D.role];return n.jsxs("div",{className:ie("rounded-2xl border bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10 flex flex-col justify-between gap-5 transition-all duration-300 hover:border-primary/40",K?"border-border/60":"border-primary/20 shadow-primary/5"),children:[n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex items-start justify-between gap-3",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-10 h-10 rounded-xl bg-primary/10 border border-primary/20 flex items-center justify-center text-primary shadow-sm shrink-0",children:n.jsx(F,{className:"h-5.5 w-5.5"})}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-sm font-bold tracking-tight text-foreground",children:M.title}),n.jsxs("span",{className:"text-[9px] font-mono text-muted-foreground uppercase bg-background/50 px-1.5 py-0.5 rounded border border-border/30 inline-block mt-0.5",children:["Rolle: ",D.role]})]})]}),K?n.jsxs("span",{className:"flex items-center gap-1.5 text-[9px] font-bold text-emerald-400 uppercase tracking-wider bg-emerald-500/10 border border-emerald-500/20 px-2.5 py-1 rounded-lg",children:[n.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500 animate-pulse"}),"Aktiviert"]}):n.jsx("span",{className:"text-[9px] font-bold text-primary/70 uppercase tracking-wider bg-primary/10 border border-primary/20 px-2.5 py-1 rounded-lg",children:"Frei"})]}),n.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:M.desc}),n.jsx("div",{className:"p-3.5 rounded-xl bg-background/35 border border-border/30 space-y-2.5",children:K?n.jsxs("div",{className:"space-y-1.5",children:[n.jsx("div",{className:"text-[9px] font-bold uppercase tracking-wider text-muted-foreground/60",children:"Aktive GGUF-Belegung"}),n.jsx("div",{className:"text-xs font-mono font-bold text-foreground truncate",title:K.name,children:K.name.split("/").pop()}),n.jsxs("div",{className:"text-[10px] text-muted-foreground/80 flex items-center gap-2",children:[n.jsxs("span",{children:["Größe: ",mi(K.size_bytes||0)]}),n.jsx("span",{children:"•"}),n.jsxs("span",{children:["Quant: ",K.quant||"GGUF"]})]})]}):n.jsxs("div",{className:"space-y-1.5",children:[n.jsx("div",{className:"text-[9px] font-bold uppercase tracking-wider text-primary/80",children:"Empfohlenes Modell"}),n.jsx("div",{className:"text-xs font-mono font-bold text-foreground truncate",title:Q.name,children:Q.name}),n.jsxs("div",{className:"text-[10px] text-muted-foreground/80 flex items-center gap-2 flex-wrap",children:[n.jsxs("span",{children:["Ersteller: ",Q.author]}),n.jsx("span",{children:"•"}),n.jsxs("span",{children:["Quant: ",Q.quant]})]}),n.jsx("div",{className:"flex items-center gap-1.5 pt-0.5",children:n.jsx(h0,{fit:Q.fit})})]})}),n.jsx("div",{className:"pt-1",children:K?Y?n.jsxs("div",{className:"space-y-2",children:[n.jsxs("div",{className:"text-[9px] font-semibold text-amber-400 flex items-center gap-1.5",children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-400 animate-ping shrink-0"}),n.jsxs("span",{children:["Bessere Version in der Registry: ",Y.repo.split("/").pop()]})]}),n.jsxs("button",{onClick:()=>R(Y.repo,D.role,Q.quant||"Q4_K_M",Q.caps.tools!=="no"),disabled:!!j[Y.repo],className:"h-8 w-full flex items-center justify-center gap-1.5 rounded-lg bg-amber-500 text-black text-xs font-bold hover:bg-amber-400 disabled:opacity-50 transition-all cursor-pointer shadow-md shadow-amber-500/10",children:[n.jsx(wn,{className:"h-3.5 w-3.5"}),j[Y.repo]||"Auf neue Version aktualisieren"]})]}):n.jsxs("div",{className:"h-8 flex items-center justify-center gap-1.5 text-[10px] font-bold text-emerald-400 uppercase tracking-wide bg-emerald-500/5 border border-emerald-500/10 rounded-lg select-none",children:[n.jsx(bn,{className:"h-4 w-4"})," Auf neuestem Stand"]}):n.jsxs("button",{onClick:()=>R(Q.repo,D.role,Q.quant||"Q4_K_M",Q.caps.tools!=="no"),disabled:!!se,className:ie("h-8 w-full flex items-center justify-center gap-1.5 rounded-lg text-xs font-bold transition-all cursor-pointer border",se?"border-primary/40 bg-primary/5 text-primary":"bg-primary text-primary-foreground hover:opacity-90 shadow-md shadow-primary/10"),children:[n.jsx(wn,{className:"h-3.5 w-3.5"}),se||"Optimales Modell einsetzen"]})})]}),ge.length>0&&n.jsxs("div",{className:"border-t border-border/20 pt-3",children:[n.jsxs("button",{onClick:()=>L(A=>({...A,[D.role]:!de})),className:"flex items-center gap-1.5 text-[10px] text-muted-foreground/80 hover:text-foreground transition-colors cursor-pointer",children:[de?n.jsx(oh,{className:"h-3 w-3"}):n.jsx(th,{className:"h-3 w-3"}),n.jsxs("span",{children:["Alternative Empfehlungen anzeigen (",ge.length,")"]})]}),de&&n.jsx("div",{className:"mt-2.5 space-y-2 max-h-36 overflow-y-auto pr-1 scrollbar-thin",children:ge.map(A=>n.jsxs("div",{className:"p-2 rounded-lg bg-background/25 border border-border/20 flex items-center justify-between gap-3",children:[n.jsxs("div",{className:"min-w-0",children:[n.jsx("div",{className:"text-[10px] font-mono font-bold text-foreground truncate",title:A.name,children:A.name}),n.jsxs("div",{className:"text-[9px] text-muted-foreground flex items-center gap-1.5 mt-0.5",children:[n.jsxs("span",{children:["Quant: ",A.quant]}),n.jsx("span",{children:"•"}),n.jsx("span",{children:A.fit.text})]})]}),n.jsx("button",{onClick:()=>R(A.repo,D.role,A.quant||"Q4_K_M",A.caps.tools!=="no"),disabled:!!j[A.repo],className:"h-6 px-2.5 rounded bg-background/40 hover:bg-background/80 border border-border/40 text-[9px] font-bold text-foreground transition-all cursor-pointer shrink-0 disabled:opacity-50",children:j[A.repo]||"Installieren"})]},A.repo))})]})]},D.role)})}),n.jsxs("div",{className:"border border-border/50 bg-card/20 rounded-2xl overflow-hidden shadow-md mt-4",children:[n.jsxs("button",{onClick:()=>w(!O),className:"w-full px-5 py-4 flex items-center justify-between text-xs font-bold uppercase tracking-wider text-muted-foreground hover:bg-card/30 transition-colors cursor-pointer",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(yi,{className:"h-4 w-4 text-primary"}),n.jsx("span",{children:"Eigenes Modell von Hugging Face laden (Erweiterte Ansicht)"})]}),n.jsx("span",{className:"text-[10px] text-primary hover:underline",children:O?"Ausblenden ▲":"Anzeigen ▼"})]}),O&&n.jsx("div",{className:"p-5 border-t border-border/20 bg-card/10",children:n.jsx(v0,{})})]})]})}function w0(){const[s,u]=m.useState("cockpit");return n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:"flex flex-col sm:flex-row justify-between sm:items-center gap-4",children:[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:"Modell-Zentrale"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Verwalte deine Modelle und passe das Gateway-Routing live über das interaktive Cockpit an."})]}),n.jsx("div",{className:"flex rounded-xl border border-border/60 bg-card/45 backdrop-blur-md p-1 self-start",children:["cockpit","discover"].map(a=>n.jsx("button",{onClick:()=>u(a),className:ie("rounded-lg px-4 py-1.5 text-xs font-semibold tracking-wide uppercase transition-all cursor-pointer",s===a?"bg-primary text-primary-foreground shadow-md shadow-primary/10":"text-muted-foreground hover:text-foreground"),children:a==="cockpit"?"Cockpit":"Modelle finden"},a))})]}),n.jsx(m0,{}),n.jsx("div",{className:"transition-all duration-300",children:s==="cockpit"?n.jsx(x0,{}):n.jsx(b0,{})})]})}function hr(s){return(s/1024**3).toFixed(1)}function Fs({label:s,percent:u,detail:a,icon:c}){const f=u>90?"bg-red-500 shadow-md shadow-red-500/20":u>75?"bg-amber-500 shadow-md shadow-amber-500/20":"bg-primary shadow-md shadow-primary/20";return n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10 flex flex-col justify-between gap-3 hover:border-primary/30 transition-all duration-300",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(c,{className:"h-4.5 w-4.5 text-primary"}),n.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-foreground",children:s})]}),n.jsxs("span",{className:"text-xs font-mono font-bold text-foreground",children:[Math.round(u),"%"]})]}),n.jsx("div",{className:"w-full h-2 bg-background/40 rounded-full overflow-hidden border border-border/20",children:n.jsx("div",{className:ie("h-full transition-all duration-700 ease-out",f),style:{width:`${Math.min(u,100)}%`}})}),a&&n.jsx("div",{className:"text-[10px] font-mono text-muted-foreground/80",children:a})]})}function k0(){const[s,u]=m.useState(null),[a,c]=m.useState(null),[f,g]=m.useState(""),[p,x]=m.useState(""),[N,C]=m.useState({});function j(){ue("/api/system/status").then(u).catch(L=>g(String(L))),ue("/api/system/services").then(c).catch(()=>{})}m.useEffect(()=>{j();const L=setInterval(j,3e3);return()=>clearInterval(L)},[]);async function _(){x("Backup snapshotted...");try{const L=await ue("/api/system/backup",{method:"POST"});x(L.ok?`Snapshot erzeugt: ${L.snapshot} (${L.files.length} Dateien)`:"Keine Änderungen zu sichern.")}catch(L){x(`Fehler: ${L.message}`)}}async function P(L){C(O=>({...O,[L]:!0}));try{const O=await ue("/api/maintenance/restart",{method:"POST",body:JSON.stringify({service:L})});O.ok?alert(`Dienst ${L} wurde erfolgreich neu gestartet.`):alert(`Fehler beim Neustart: ${O.err||"Unbekannter Fehler"}`)}catch(O){alert(`Fehler: ${O.message}`)}finally{C(O=>({...O,[L]:!1}))}}return n.jsxs("div",{className:"space-y-6",children:[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:"System-Diagnose & Status"}),n.jsx("p",{className:"text-sm text-muted-foreground flex items-center gap-1",children:"Echtzeit-Ressourcen der Box, Dienst-Überwachung und Systempflege."})]}),f&&n.jsxs("div",{className:"rounded-xl border border-red-500/20 bg-red-500/5 p-4 text-xs text-red-400 font-mono",children:["System-Status nicht lesbar (",f,")."]}),s&&n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[n.jsx(Fs,{label:"CPU",percent:s.cpu.percent,detail:s.cpu.cores?`${s.cpu.cores} Cores`:void 0,icon:Dr}),n.jsx(Fs,{label:"RAM",percent:s.ram.percent,detail:`${hr(s.ram.used)} / ${hr(s.ram.total)} GB`,icon:xi}),s.gpu&&s.gpu.busy_percent!=null&&n.jsx(Fs,{label:"GPU",percent:s.gpu.busy_percent,detail:s.gpu.gtt_used!=null&&s.gpu.gtt_total?`${hr(s.gpu.gtt_used)} / ${hr(s.gpu.gtt_total)} GB (GTT/unified)`:s.gpu.vram_used!=null&&s.gpu.vram_total?`${hr(s.gpu.vram_used)} / ${hr(s.gpu.vram_total)} GB VRAM`:void 0,icon:Dr}),s.disk&&n.jsx(Fs,{label:"Disk",percent:s.disk.percent,detail:`${hr(s.disk.used)} / ${hr(s.disk.total)} GB`,icon:li})]}),s.temp&&(s.temp.cpu||s.temp.gpu)&&n.jsxs("div",{className:"flex gap-3 text-[10px] font-mono text-muted-foreground bg-background/25 border border-border/40 p-2.5 rounded-xl self-start w-fit",children:[s.temp.cpu!=null&&n.jsxs("span",{className:"flex items-center gap-1",children:["CPU-Temperatur: ",n.jsxs("span",{className:"text-foreground font-bold",children:[s.temp.cpu," °C"]})]}),s.temp.cpu!=null&&s.temp.gpu!=null&&n.jsx("span",{children:"|"}),s.temp.gpu!=null&&n.jsxs("span",{className:"flex items-center gap-1",children:["GPU-Temperatur: ",n.jsxs("span",{className:"text-foreground font-bold",children:[s.temp.gpu," °C"]})]})]})]}),a&&n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10 space-y-4",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("div",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Homelab-Dienste"}),n.jsx("button",{onClick:()=>window.dispatchEvent(new CustomEvent("open-system-drawer",{detail:{tab:"logs"}})),className:"h-7 px-3 rounded-lg border border-border/60 bg-background/25 text-[10px] font-bold uppercase hover:bg-accent text-muted-foreground transition-all cursor-pointer",children:"System-Logs anzeigen"})]}),n.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:a.services.map(L=>n.jsxs("div",{className:"flex items-center justify-between p-3.5 rounded-xl bg-background/20 border border-border/30 hover:border-primary/20 transition-all group",children:[n.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[n.jsx("span",{className:ie("h-2.5 w-2.5 rounded-full ring-2 ring-black/40",L.ok?"bg-emerald-500":"bg-amber-500")}),n.jsxs("div",{className:"truncate",children:[n.jsx("div",{className:"text-xs font-bold text-foreground truncate",children:L.name}),n.jsx("div",{className:"text-[9px] text-muted-foreground/60 font-mono mt-0.5 truncate",children:L.url})]})]}),n.jsx("button",{onClick:()=>P(L.name),disabled:N[L.name],className:"h-7 w-7 rounded-lg border border-border/40 text-muted-foreground hover:text-primary hover:bg-primary/5 flex items-center justify-center transition-all opacity-0 group-hover:opacity-100",title:"Dienst neu starten",children:n.jsx(kn,{className:ie("h-3.5 w-3.5",N[L.name]&&"animate-spin")})})]},L.name))}),n.jsxs("div",{className:"flex flex-wrap gap-4 border-t border-border/20 pt-4 text-[10px] font-semibold text-muted-foreground",children:[n.jsxs("a",{href:Gs(a.links.engine_ui),target:"_blank",rel:"noopener",className:"flex items-center gap-1 text-primary hover:text-primary-foreground hover:bg-primary/10 px-2 py-1 rounded transition-colors",children:[n.jsx(Ws,{className:"h-3 w-3"})," Engine Dashboard (llama-swap)"]}),n.jsxs("a",{href:Gs(a.links.gateway),target:"_blank",rel:"noopener",className:"flex items-center gap-1 text-primary hover:text-primary-foreground hover:bg-primary/10 px-2 py-1 rounded transition-colors",children:[n.jsx(Ws,{className:"h-3 w-3"})," OpenAI Gateway"]})]})]}),n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10 flex flex-col sm:flex-row justify-between sm:items-center gap-4",children:[n.jsxs("div",{className:"space-y-1",children:[n.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"System-Backup & Snapshot"}),n.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Erzeuge einen Git-Snapshot der aktuellen Konfigurationen und des System-Zustands."})]}),n.jsx("div",{className:"flex items-center gap-3 self-start sm:self-auto shrink-0",children:n.jsxs("button",{onClick:_,className:"h-9 px-4 rounded-lg bg-primary text-primary-foreground text-xs font-semibold hover:opacity-90 transition-all flex items-center gap-1.5 cursor-pointer shadow-md shadow-primary/10",children:[n.jsx(xh,{className:"h-4 w-4"})," Snapshot erstellen"]})})]}),p&&n.jsx("div",{className:"text-[10px] font-mono text-primary font-medium bg-primary/5 p-3 rounded-xl border border-primary/20",children:p})]})}function j0(){const[s,u]=m.useState(localStorage.getItem("mc_host")||"192.168.178.151"),[a,c]=m.useState(localStorage.getItem("mc_mcp_path")||""),[f,g]=m.useState(null),[p,x]=m.useState("cline"),[N,C]=m.useState(!1),[j,_]=m.useState("");m.useEffect(()=>{const R=new URLSearchParams;R.set("host",s),a&&R.set("mcp_path",a),ue(`/api/connect?${R}`).then(g).catch(D=>_(String(D)))},[s,a]);function P(R){u(R),R&&localStorage.setItem("mc_host",R)}function L(R){c(R),localStorage.setItem("mc_mcp_path",R)}const O=f==null?void 0:f.tools[p];async function w(){O&&(await navigator.clipboard.writeText(O.snippet),C(!0),setTimeout(()=>C(!1),1500))}return n.jsxs("div",{className:"space-y-6",children:[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:"Verbindung & Integration"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Kopiere vorgefertigte Konfigurationsdateien für deinen lokalen PC (IDEs, Cline, Roo Code, Cursor), um direkt auf das geteilte Gedächtnis und den Auto-Swap-Gateway der Box zuzugreifen."})]}),n.jsxs("div",{className:"grid gap-4 md:grid-cols-2 p-5 rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md shadow-lg shadow-black/10",children:[n.jsxs("div",{className:"space-y-1.5",children:[n.jsxs("label",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground flex items-center gap-1.5",children:[n.jsx(fh,{className:"h-3.5 w-3.5 text-primary"})," Box LAN IP-Adresse"]}),n.jsx("input",{value:s,onChange:R=>P(R.target.value),placeholder:"z.B. 192.168.178.151",className:"w-full h-9 rounded-lg border border-border/60 bg-background/40 px-3 font-mono text-xs outline-none focus:ring-1 focus:ring-primary/50 text-foreground"})]}),n.jsxs("div",{className:"space-y-1.5",children:[n.jsxs("label",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground flex items-center gap-1.5",children:[n.jsx(dh,{className:"h-3.5 w-3.5 text-primary"})," Lokaler MCP-Scriptpfad"]}),n.jsx("input",{value:a,onChange:R=>L(R.target.value),placeholder:"z.B. F:\\Coding Stuff\\mission-control-2\\mcp\\mcp_memory.py",className:"w-full h-9 rounded-lg border border-border/60 bg-background/40 px-3 font-mono text-xs outline-none focus:ring-1 focus:ring-primary/50 text-foreground"})]})]}),j&&n.jsxs("div",{className:"rounded-xl border border-red-500/20 bg-red-500/5 p-4 text-xs text-red-400",children:["Fehler beim Generieren der Snippets: ",j]}),f&&n.jsxs("div",{className:"space-y-4",children:[n.jsx("div",{className:"flex flex-wrap gap-1 bg-card/20 p-1 border border-border/40 rounded-xl max-w-fit",children:Object.entries(f.tools).map(([R,D])=>n.jsx("button",{onClick:()=>x(R),className:ie("rounded-lg px-4 py-1.5 text-xs font-semibold tracking-wide uppercase transition-all cursor-pointer",p===R?"bg-primary text-primary-foreground shadow-md shadow-primary/10":"text-muted-foreground hover:text-foreground"),children:D.label},R))}),O&&n.jsxs("div",{className:"space-y-3",children:[O.note&&n.jsxs("div",{className:"flex items-start gap-2.5 p-3 rounded-xl bg-primary/5 border border-primary/20 text-xs text-muted-foreground leading-relaxed",children:[n.jsx(ph,{className:"h-4.5 w-4.5 text-primary shrink-0 mt-0.5"}),n.jsx("span",{children:O.note})]}),n.jsxs("div",{className:"flex flex-col border border-border/60 bg-black/60 rounded-2xl overflow-hidden shadow-2xl",children:[n.jsxs("div",{className:"flex h-11 items-center justify-between px-4 border-b border-border/40 bg-black/40 shrink-0",children:[n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx("span",{className:"h-3 w-3 rounded-full bg-red-500/80 shadow-md shadow-red-500/10"}),n.jsx("span",{className:"h-3 w-3 rounded-full bg-amber-500/80 shadow-md shadow-amber-500/10"}),n.jsx("span",{className:"h-3 w-3 rounded-full bg-emerald-500/80 shadow-md shadow-emerald-500/10"})]}),n.jsxs("div",{className:"flex items-center gap-1.5 text-[10px] font-mono text-muted-foreground/75 bg-background/30 px-3 py-1 rounded-md border border-border/20",children:[n.jsx(bi,{className:"h-3.5 w-3.5 text-primary"}),n.jsx("span",{children:p==="cline"||p==="cursor"?"config.json":"settings.json"})]}),n.jsxs("button",{onClick:w,className:"flex h-7 px-2.5 items-center gap-1.5 rounded-lg border border-border/40 bg-background/30 text-[10px] font-semibold text-muted-foreground hover:text-foreground hover:bg-background/60 transition-all cursor-pointer",children:[N?n.jsx(bn,{className:"h-3.5 w-3.5 text-emerald-400"}):n.jsx(vi,{className:"h-3.5 w-3.5"}),n.jsx("span",{children:N?"Kopiert":"Kopieren"})]})]}),n.jsx("pre",{className:"p-5 overflow-x-auto text-xs font-mono text-cyan-200/90 whitespace-pre leading-relaxed scrollbar-thin select-text bg-black/10",children:n.jsx("code",{children:O.snippet})})]})]})]})]})}const Gd=["user","instruction","stable","versioned","ephemeral"],oi={user:{label:"User",icon:jh,color:"text-cyan-400",border:"border-cyan-500/30",bg:"bg-cyan-500/10",text:"text-cyan-400"},instruction:{label:"Regel",icon:vh,color:"text-violet-400",border:"border-violet-500/30",bg:"bg-violet-500/10",text:"text-violet-400"},stable:{label:"Fakt",icon:xo,color:"text-indigo-400",border:"border-indigo-500/30",bg:"bg-indigo-500/10",text:"text-indigo-400"},versioned:{label:"Version",icon:kh,color:"text-amber-400",border:"border-amber-500/30",bg:"bg-amber-500/10",text:"text-amber-400"},ephemeral:{label:"Temporär",icon:lh,color:"text-pink-400",border:"border-pink-500/30",bg:"bg-pink-500/10",text:"text-pink-400"}},Kd={label:"Gedächtnis",icon:Xd,bg:"bg-muted/10",text:"text-muted-foreground"},N0={user:"border-l-cyan-500/80",instruction:"border-l-violet-500/80",stable:"border-l-indigo-500/80",versioned:"border-l-amber-500/80",ephemeral:"border-l-pink-500/80"};function S0(){const[s,u]=m.useState([]),[a,c]=m.useState(""),[f,g]=m.useState(""),[p,x]=m.useState(""),[N,C]=m.useState("stable"),[j,_]=m.useState(""),[P,L]=m.useState(!1);function O(){const M=new URLSearchParams;f&&M.set("q",f),a&&M.set("category",a),ue(`/api/memory?${M}`).then(u).catch(F=>_(String(F)))}m.useEffect(O,[f,a]);async function w(){p.trim()&&(await ue("/api/memory",{method:"POST",body:JSON.stringify({content:p,category:N,source:"ui"})}),x(""),O())}async function R(M){await ue(`/api/memory/${M}`,{method:"DELETE"}),O()}async function D(){L(!0);try{const M=await ue("/api/memory/dedupe",{method:"POST",body:JSON.stringify({apply:!1})});if(M.duplicate_count===0){alert("Keine Dubletten gefunden — alles sauber.");return}confirm(`${M.duplicate_count} Dublette(n) in ${M.groups.length} Gruppe(n) gefunden. Entfernen?`)&&(await ue("/api/memory/dedupe",{method:"POST",body:JSON.stringify({apply:!0})}),O())}catch(M){alert(`Fehler: ${M.message}`)}finally{L(!1)}}return n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:"flex flex-col sm:flex-row justify-between sm:items-center gap-4",children:[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:"Gedächtnis-Pool (Memory)"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Die geteilte Konstitution des Systems. Alle Instanzen (Hermes, IDEs, Gateway) lesen und schreiben hierauf per MCP-Protokoll."})]}),n.jsxs("button",{onClick:D,disabled:P,className:"flex h-9 px-4 items-center gap-1.5 text-xs font-semibold rounded-lg border border-border/60 bg-card hover:border-primary/50 transition-all cursor-pointer shadow-md disabled:opacity-50 shrink-0 self-start",children:[n.jsx(wh,{className:"h-4 w-4 text-primary animate-pulse"}),n.jsx("span",{children:"Deduplizieren"})]})]}),n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10 space-y-4",children:[n.jsx("div",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Neuen Eintrag anlegen"}),n.jsx("textarea",{value:p,onChange:M=>x(M.target.value),placeholder:"Füge eine neue Regel, eine Vorliebe oder einen stabilen Fakt über das Projekt oder dich hinzu...",rows:3,className:"w-full resize-none rounded-xl border border-border/60 bg-background/30 p-3.5 text-xs outline-none focus:ring-1 focus:ring-primary/50 text-foreground transition-all leading-relaxed"}),n.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wider",children:"Kategorie"}),n.jsx("select",{value:N,onChange:M=>C(M.target.value),className:"h-8 rounded-lg border border-border/60 bg-background/50 px-2 py-1 text-xs outline-none font-semibold text-foreground cursor-pointer",children:Gd.map(M=>{var F;return n.jsx("option",{value:M,className:"bg-popover text-foreground",children:((F=oi[M])==null?void 0:F.label)||M},M)})})]}),n.jsxs("button",{onClick:w,className:"h-9 px-4 rounded-lg bg-primary text-primary-foreground text-xs font-semibold hover:opacity-90 transition-all flex items-center gap-1.5 cursor-pointer shadow-md shadow-primary/10",children:[n.jsx(ef,{className:"h-4 w-4"})," Speichern"]})]})]}),n.jsxs("div",{className:"flex flex-col md:flex-row items-stretch md:items-center gap-3",children:[n.jsxs("div",{className:"relative flex-1",children:[n.jsx("input",{value:f,onChange:M=>g(M.target.value),placeholder:"Gedächtnis durchsuchen...",className:"w-full h-9 pl-9 pr-3 rounded-lg border border-border/60 bg-card/45 text-xs outline-none focus:ring-1 focus:ring-primary/50 text-foreground"}),n.jsx(yi,{className:"absolute left-3 top-2.5 h-3.5 w-3.5 text-muted-foreground"})]}),n.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 p-1 bg-card/30 border border-border/40 rounded-xl overflow-x-auto max-w-full",children:[n.jsx("button",{onClick:()=>c(""),className:ie("h-7 px-3 rounded-lg text-[10px] font-semibold uppercase tracking-wider transition-all cursor-pointer whitespace-nowrap",a?"text-muted-foreground hover:text-foreground":"bg-primary text-primary-foreground"),children:"Alle"}),Gd.map(M=>{const F=oi[M]||Kd,K=F.icon;return n.jsxs("button",{onClick:()=>c(M),className:ie("h-7 px-2.5 rounded-lg text-[10px] font-semibold uppercase tracking-wider transition-all cursor-pointer flex items-center gap-1 whitespace-nowrap",a===M?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"),children:[n.jsx(K,{className:"h-3 w-3"}),n.jsx("span",{children:F.label})]},M)})]})]}),j&&n.jsxs("div",{className:"rounded-xl border border-red-500/20 bg-red-500/5 p-4 text-xs text-red-400",children:["Fehler beim Laden des Gedächtnisses: ",j]}),n.jsx("div",{className:"space-y-3",children:s.length===0?n.jsx("div",{className:"text-xs text-muted-foreground border border-dashed border-border/60 rounded-2xl p-12 text-center",children:"Keine Einträge für die aktuellen Filterkriterien gefunden."}):s.map(M=>{const F=oi[M.category]||Kd,K=F.icon;return n.jsxs("div",{className:ie("flex items-start justify-between gap-4 p-4 rounded-xl border border-l-4 bg-card/45 backdrop-blur-md border-border/60 shadow-md shadow-black/5 hover:border-primary/20 transition-all group",N0[M.category]||"border-l-muted"),children:[n.jsxs("div",{className:"flex items-start gap-3 flex-1 min-w-0",children:[n.jsxs("span",{className:ie("flex items-center gap-1 px-2 py-0.5 rounded text-[9px] font-bold uppercase tracking-wider font-mono shrink-0",F.bg,F.text),children:[n.jsx(K,{className:"h-3 w-3"}),n.jsx("span",{className:"hidden sm:inline",children:F.label})]}),n.jsx("span",{className:"text-xs text-foreground leading-relaxed break-words whitespace-pre-wrap flex-1",children:M.content})]}),n.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[n.jsx("span",{className:"text-[9px] font-mono text-muted-foreground/60 bg-background/20 px-1.5 py-0.5 rounded uppercase tracking-wider",children:M.source}),n.jsx("button",{onClick:()=>R(M.id),className:"h-7 w-7 rounded-lg flex items-center justify-center border border-border/40 text-muted-foreground hover:text-red-400 hover:bg-red-500/5 transition-all opacity-0 group-hover:opacity-100",title:"Eintrag löschen",children:n.jsx(ai,{className:"h-3.5 w-3.5"})})]})]},M.id)})})]})}function $s({label:s,ok:u,detail:a,icon:c}){return n.jsxs("div",{className:ie("rounded-2xl border bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10 flex flex-col justify-between gap-3 hover:border-primary/40 transition-all duration-300",u?"border-border/60":"border-amber-500/30"),children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground",children:s}),n.jsx(c,{className:ie("h-4.5 w-4.5",u?"text-primary":"text-amber-500")})]}),n.jsxs("div",{className:"space-y-1.5",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:ie("h-2 w-2 rounded-full ring-2 ring-black/40",u?"bg-emerald-500 animate-pulse":"bg-amber-500")}),n.jsx("span",{className:"text-xs font-semibold text-foreground",children:u?"Bereit / Online":"Offline / Inaktiv"})]}),a&&n.jsx("div",{className:"text-[10px] font-mono text-muted-foreground truncate max-w-[200px]",title:a,children:a})]})]})}const C0=["fast","heavy","coder","reasoning","agent","vision","scout"];function E0(){var Se,G,ee,Z,k;const[s,u]=m.useState(null),[a,c]=m.useState(""),[f,g]=m.useState([]),[p,x]=m.useState([]),[N,C]=m.useState(null),[j,_]=m.useState(null),[P,L]=m.useState(null),[O,w]=m.useState(null),[R,D]=m.useState(!1),[M,F]=m.useState(null),[K,Y]=m.useState({width:800,height:360}),Q=m.useRef(null),se=m.useCallback(h=>{if(Q.current&&(Q.current.disconnect(),Q.current=null),h){const T=new ResizeObserver(U=>{if(!U||U.length===0)return;const B=U[0].contentRect;Y({width:B.width,height:B.height})});T.observe(h),Q.current=T}},[]),ge=K.width,de=K.height,A=h=>{const T=ge*.1,U=de*h,B=ge*.5,q=de*.5,J=ge*.3,ce=U,me=ge*.3;return`M ${T} ${U} C ${J} ${ce}, ${me} ${q}, ${B} ${q}`},ae=h=>{const T=ge*.5,U=de*.5,B=ge*.9,q=de*h,J=ge*.7,ce=U,me=ge*.7;return`M ${T} ${U} C ${J} ${ce}, ${me} ${q}, ${B} ${q}`};function ne(){ue("/api/agent/status").then(u).catch(h=>c(String(h))),Promise.all([ue("/api/models"),ue("/api/routing"),ue("/api/connect")]).then(([h,T,U])=>{g(h.models||[]),x(h.running||[]),C(T),_(U)}).catch(h=>console.error("Error loading graph data in AgentView",h))}m.useEffect(()=>{ne();const h=setInterval(ne,5e3);return()=>clearInterval(h)},[]);const _e=h=>f.find(T=>T.role===h),ve=h=>{const T=_e(h);return T?p.includes(T.name):!1};async function je(h,T){w(null);try{await ue(`/api/models/${encodeURIComponent(T)}/role`,{method:"POST",body:JSON.stringify({role:h||null})}),ne()}catch(U){alert(`Fehler beim Zuweisen der Rolle: ${U}`)}}async function Ne(h){h&&(await navigator.clipboard.writeText(h),D(!0),setTimeout(()=>D(!1),1500))}return n.jsxs("div",{className:"space-y-6",children:[n.jsx("style",{children:` + @keyframes flow-dash { + to { + stroke-dashoffset: -20; + } + } + .animate-flow-cyan { + stroke-dasharray: 4 6; + animation: flow-dash 1s linear infinite; + } + `}),n.jsxs("div",{className:"flex flex-col sm:flex-row justify-between sm:items-center gap-4",children:[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:"Hermes Agenten-Cockpit"}),n.jsxs("p",{className:"text-sm text-muted-foreground",children:["Hermes ist ein autonomer Agent, der im Hintergrund der Box läuft (Port ",n.jsx("code",{children:":8642"}),") und seine eigene UI besitzt."]})]}),(s==null?void 0:s.webui_url)&&n.jsxs("a",{href:Gs(s.webui_url),target:"_blank",rel:"noopener",className:ie("flex h-9 px-4 items-center gap-1.5 text-xs font-semibold rounded-lg transition-all cursor-pointer shadow-md shrink-0 self-start",s.webui_reachable?"bg-primary text-primary-foreground hover:opacity-90 shadow-primary/10":"border border-border/60 text-muted-foreground bg-background/20"),children:[n.jsx(Ws,{className:"h-4 w-4"}),n.jsx("span",{children:"Hermes WebUI öffnen"})]})]}),a&&n.jsxs("div",{className:"rounded-xl border border-red-500/20 bg-red-500/5 p-4 text-xs text-red-400 font-mono",children:["Status nicht lesbar (",a,")."]}),s&&n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[n.jsx($s,{label:"Agent Gateway",ok:s.gateway_reachable,detail:"Port :8642 (REST API)",icon:Ks}),n.jsx($s,{label:"Agent WebUI",ok:s.webui_reachable,detail:"Port :8787 (Chat UI)",icon:xi}),n.jsx($s,{label:"Aktives Gehirn",ok:s.gateway_reachable,detail:s.brain_model?`Model: ${s.brain_model}`:"Model: auto",icon:Dr}),n.jsx($s,{label:"Verdrahtung",ok:s.has_config,detail:`Config: ${s.has_config?"✓":"—"} · Skills: ${s.has_skills?"✓":"—"} · Memory: ${s.has_memories?"✓":"—"}`,icon:Nh})]}),n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-6 shadow-lg shadow-black/10 space-y-4",children:[n.jsxs("div",{children:[n.jsx("span",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"Interactive Gateway Graph (Duplikat)"}),n.jsx("p",{className:"text-[10px] text-muted-foreground mt-0.5 leading-relaxed",children:"Visualisiert die Kopplung der Client-Editoren mit dem OpenAI-Gateway und den aktiven Modell-Rollen."})]}),n.jsxs("div",{ref:se,className:"relative w-full h-[360px] border border-border/30 rounded-xl bg-black/25 overflow-hidden flex",children:[n.jsxs("svg",{className:"absolute inset-0 pointer-events-none w-full h-full",children:[n.jsxs("defs",{children:[n.jsxs("linearGradient",{id:"cyan-to-teal",x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[n.jsx("stop",{offset:"0%",stopColor:"#06b6d4",stopOpacity:"0.45"}),n.jsx("stop",{offset:"100%",stopColor:"#0d9488",stopOpacity:"0.45"})]}),n.jsxs("linearGradient",{id:"active-glow",x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[n.jsx("stop",{offset:"0%",stopColor:"#3b82f6",stopOpacity:"0.8"}),n.jsx("stop",{offset:"100%",stopColor:"#10b981",stopOpacity:"0.8"})]})]}),n.jsx("path",{d:A(.1),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),(M==="roocode"||P==="roocode")&&n.jsx("path",{d:A(.1),stroke:"#06b6d4",strokeWidth:"2.5",fill:"none",className:"animate-flow-cyan"}),n.jsx("path",{d:A(.3),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),(M==="cursor"||P==="cursor")&&n.jsx("path",{d:A(.3),stroke:"#06b6d4",strokeWidth:"2.5",fill:"none",className:"animate-flow-cyan"}),n.jsx("path",{d:A(.5),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),(M==="opencode"||P==="opencode")&&n.jsx("path",{d:A(.5),stroke:"#06b6d4",strokeWidth:"2.5",fill:"none",className:"animate-flow-cyan"}),n.jsx("path",{d:A(.7),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),(M==="zed"||P==="zed")&&n.jsx("path",{d:A(.7),stroke:"#06b6d4",strokeWidth:"2.5",fill:"none",className:"animate-flow-cyan"}),n.jsx("path",{d:A(.9),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),(M==="continue"||P==="continue")&&n.jsx("path",{d:A(.9),stroke:"#06b6d4",strokeWidth:"2.5",fill:"none",className:"animate-flow-cyan"}),n.jsx("path",{d:ae(.12),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),ve("fast")&&n.jsx("path",{d:ae(.12),stroke:"url(#active-glow)",strokeWidth:"2.5",fill:"none",className:"animate-flow-cyan"}),n.jsx("path",{d:ae(.31),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),ve("heavy")&&n.jsx("path",{d:ae(.31),stroke:"url(#active-glow)",strokeWidth:"2.5",fill:"none",className:"animate-flow-cyan"}),n.jsx("path",{d:ae(.5),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),ve("coder")&&n.jsx("path",{d:ae(.5),stroke:"url(#active-glow)",strokeWidth:"2.5",fill:"none",className:"animate-flow-cyan"}),n.jsx("path",{d:ae(.69),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),ve("vision")&&n.jsx("path",{d:ae(.69),stroke:"url(#active-glow)",strokeWidth:"2.5",fill:"none",className:"animate-flow-cyan"}),n.jsx("path",{d:ae(.88),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),ve("scout")&&n.jsx("path",{d:ae(.88),stroke:"url(#active-glow)",strokeWidth:"2.5",fill:"none",className:"animate-flow-cyan"})]}),n.jsxs("div",{className:"absolute cursor-pointer select-none z-10 w-28 h-8 -translate-y-1/2 -translate-x-1/2 rounded-xl border border-border/60 bg-card/75 backdrop-blur-md flex items-center justify-center gap-1.5 px-2 hover:border-primary transition-all text-[10px] font-semibold text-foreground shadow shadow-black/20",style:{left:"10%",top:"10%"},onMouseEnter:()=>F("roocode"),onMouseLeave:()=>F(null),onClick:()=>L(h=>h==="roocode"?null:"roocode"),children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-cyan-400 animate-pulse"}),n.jsx("span",{children:"Roo Code"})]}),n.jsxs("div",{className:"absolute cursor-pointer select-none z-10 w-28 h-8 -translate-y-1/2 -translate-x-1/2 rounded-xl border border-border/60 bg-card/75 backdrop-blur-md flex items-center justify-center gap-1.5 px-2 hover:border-primary transition-all text-[10px] font-semibold text-foreground shadow shadow-black/20",style:{left:"10%",top:"30%"},onMouseEnter:()=>F("cursor"),onMouseLeave:()=>F(null),onClick:()=>L(h=>h==="cursor"?null:"cursor"),children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-cyan-400 animate-pulse"}),n.jsx("span",{children:"Cursor IDE"})]}),n.jsxs("div",{className:"absolute cursor-pointer select-none z-10 w-28 h-8 -translate-y-1/2 -translate-x-1/2 rounded-xl border border-border/60 bg-card/75 backdrop-blur-md flex items-center justify-center gap-1.5 px-2 hover:border-primary transition-all text-[10px] font-semibold text-foreground shadow shadow-black/20",style:{left:"10%",top:"50%"},onMouseEnter:()=>F("opencode"),onMouseLeave:()=>F(null),onClick:()=>L(h=>h==="opencode"?null:"opencode"),children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-cyan-400 animate-pulse"}),n.jsx("span",{children:"OpenCode"})]}),n.jsxs("div",{className:"absolute cursor-pointer select-none z-10 w-28 h-8 -translate-y-1/2 -translate-x-1/2 rounded-xl border border-border/60 bg-card/75 backdrop-blur-md flex items-center justify-center gap-1.5 px-2 hover:border-primary transition-all text-[10px] font-semibold text-foreground shadow shadow-black/20",style:{left:"10%",top:"70%"},onMouseEnter:()=>F("zed"),onMouseLeave:()=>F(null),onClick:()=>L(h=>h==="zed"?null:"zed"),children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-cyan-400 animate-pulse"}),n.jsx("span",{children:"Zed"})]}),n.jsxs("div",{className:"absolute cursor-pointer select-none z-10 w-28 h-8 -translate-y-1/2 -translate-x-1/2 rounded-xl border border-border/60 bg-card/75 backdrop-blur-md flex items-center justify-center gap-1.5 px-2 hover:border-primary transition-all text-[10px] font-semibold text-foreground shadow shadow-black/20",style:{left:"10%",top:"90%"},onMouseEnter:()=>F("continue"),onMouseLeave:()=>F(null),onClick:()=>L(h=>h==="continue"?null:"continue"),children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-cyan-400 animate-pulse"}),n.jsx("span",{children:"Continue"})]}),n.jsxs("div",{className:"absolute select-none z-10 w-36 py-3 px-4 -translate-y-1/2 -translate-x-1/2 rounded-2xl border border-primary/50 bg-card/90 backdrop-blur-md flex flex-col items-center justify-center text-center shadow-lg shadow-primary/5",style:{left:"50%",top:"50%"},children:[n.jsx("div",{className:"text-[10px] uppercase font-bold text-primary font-space tracking-wide",children:"Gateway Auto"}),n.jsxs("div",{className:"text-[10px] font-mono text-muted-foreground mt-0.5",children:["Schwelle: > ",N!=null&&N.heavy_threshold_chars?N.heavy_threshold_chars/1e3:"4","k Zeichen"]}),n.jsx("div",{className:"mt-1 px-1.5 py-0.5 rounded bg-primary/10 border border-primary/20 text-[9px] font-semibold text-primary uppercase font-mono",children:"Auto-Swap"})]}),C0.map(h=>{var J;const T=["12%","31%","50%","69%","88%"],U=_e(h),B=U?p.includes(U.name):!1;if(h==="reasoning"||h==="agent")return null;const q={fast:0,heavy:1,coder:2,vision:3,scout:4}[h];return n.jsxs("div",{className:ie("absolute z-10 w-44 py-1.5 px-3 -translate-y-1/2 -translate-x-1/2 rounded-xl border flex flex-col justify-center hover:border-primary/50 transition-all text-left shadow select-none cursor-pointer",B?"border-emerald-500/50 bg-emerald-500/5 shadow-emerald-500/5":U?"border-border/60 bg-card/75":"border-dashed border-border/40 bg-background/20"),style:{left:"90%",top:T[q]},onClick:()=>w(O===h?null:h),children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground",children:h}),B&&n.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-400 animate-pulse"})]}),n.jsx("div",{className:"text-[10px] font-mono font-medium truncate mt-0.5 text-foreground max-w-[150px]",children:U?(J=U.name.split("/").pop())==null?void 0:J.replace(".gguf",""):"Keine Zuweisung"}),O===h&&n.jsxs("div",{className:"absolute right-0 top-full mt-1 z-35 w-52 rounded-xl border border-border/80 bg-popover/95 backdrop-blur-md p-1.5 shadow-2xl space-y-1",children:[n.jsx("div",{className:"text-[9px] uppercase font-bold text-muted-foreground/60 px-2 py-1 select-none",children:"Modell zuweisen:"}),n.jsx("button",{onClick:()=>je(h,""),className:"w-full text-left px-2.5 py-1.5 rounded-lg text-[10px] hover:bg-accent text-red-400 font-semibold cursor-pointer",children:"Zuweisung entfernen"}),f.map(ce=>{var me;return n.jsxs("button",{onClick:()=>je(h,ce.name),className:ie("w-full text-left px-2.5 py-1.5 rounded-lg text-[10px] hover:bg-accent flex items-center justify-between font-mono cursor-pointer",ce.role===h?"text-primary font-bold":"text-foreground"),children:[n.jsx("span",{className:"truncate max-w-[150px]",children:(me=ce.name.split("/").pop())==null?void 0:me.replace(".gguf","")}),ce.role===h&&n.jsx(bn,{className:"h-3 w-3 shrink-0"})]},ce.name)})]})]},h)}),P&&j&&n.jsxs("div",{className:"absolute z-30 md:w-96 w-[90%] rounded-2xl border border-border/80 bg-card/95 backdrop-blur-xl p-4 shadow-2xl space-y-3 flex flex-col justify-between",style:{left:"22%",top:P==="roocode"?"5%":P==="cursor"?"20%":P==="opencode"?"40%":P==="zed"?"55%":"65%"},children:[n.jsxs("div",{className:"flex items-center justify-between border-b border-border/20 pb-2",children:[n.jsxs("span",{className:"text-[11px] font-bold uppercase tracking-wider text-primary",children:[P==="roocode"&&"Roo Code Setup",P==="cursor"&&"Cursor Setup",P==="opencode"&&"OpenCode Setup",P==="zed"&&"Zed Setup",P==="continue"&&"Continue Setup"]}),n.jsx("button",{onClick:()=>L(null),className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground cursor-pointer",children:n.jsx(Ys,{className:"h-3.5 w-3.5"})})]}),n.jsxs("div",{className:"text-[10px] text-muted-foreground leading-relaxed space-y-2",children:[P==="roocode"&&n.jsxs("ul",{className:"list-decimal pl-4 space-y-1",children:[n.jsxs("li",{children:["Suche in VS Code nach der Erweiterung ",n.jsx("strong",{children:"Roo Code"})," und installiere sie."]}),n.jsxs("li",{children:["Wähle in den Roo Code Einstellungen: Provider: ",n.jsx("strong",{children:"OpenAI Compatible"}),"."]}),n.jsxs("li",{children:["Füge das untenstehende JSON-Snippet in die ",n.jsx("code",{children:"settings.json"})," ein."]})]}),P==="cursor"&&n.jsxs("ul",{className:"list-decimal pl-4 space-y-1",children:[n.jsxs("li",{children:["Öffne Cursor Settings ➔ ",n.jsx("strong",{children:"Models"}),"."]}),n.jsxs("li",{children:["Deaktiviere Cloud-Modelle, klappe ",n.jsx("strong",{children:"OpenAI API"})," auf."]}),n.jsxs("li",{children:["Trage die Base URL unten ein und aktiviere das Modell ",n.jsx("strong",{children:"auto"}),"."]})]}),P==="opencode"&&n.jsxs("ul",{className:"list-decimal pl-4 space-y-1",children:[n.jsxs("li",{children:["Öffne die ",n.jsx("code",{children:"opencode.jsonc"})," Konfigurationsdatei."]}),n.jsxs("li",{children:["Ersetze den Provider-Eintrag unter ",n.jsx("code",{children:"provider"})," mit dem Snippet unten."]})]}),P==="zed"&&n.jsxs("ul",{className:"list-decimal pl-4 space-y-1",children:[n.jsxs("li",{children:["Öffne die Zed Settings (",n.jsx("code",{children:"ctrl+,"}),")."]}),n.jsxs("li",{children:["Füge das untenstehende JSON-Segment unter ",n.jsx("code",{children:"language_models"})," ein."]})]}),P==="continue"&&n.jsxs("ul",{className:"list-decimal pl-4 space-y-1",children:[n.jsx("li",{children:"Klicke auf das Zahnrad-Symbol in der Continue-Erweiterung."}),n.jsxs("li",{children:["Füge den Gateway-Eintrag zum ",n.jsx("code",{children:"models"}),"-Array hinzu."]})]})]}),j.tools&&n.jsxs("div",{className:"relative rounded-xl border border-border/40 bg-black/40 overflow-hidden mt-1 shrink-0",children:[n.jsxs("div",{className:"flex items-center justify-between px-3 py-1.5 border-b border-border/20 bg-black/20",children:[n.jsx("span",{className:"text-[8px] font-mono text-muted-foreground",children:"JSON Config"}),n.jsxs("button",{onClick:()=>{var h,T,U,B,q;return Ne(P==="roocode"?(h=j.tools.cline)==null?void 0:h.snippet:P==="cursor"?(T=j.tools.cursor)==null?void 0:T.snippet:P==="opencode"?(U=j.tools.opencode)==null?void 0:U.snippet:P==="zed"?(B=j.tools.zed)==null?void 0:B.snippet:(q=j.tools.continue)==null?void 0:q.snippet)},className:"text-[9px] font-semibold text-primary hover:text-primary-foreground flex items-center gap-1 cursor-pointer",children:[R?n.jsx(bn,{className:"h-3 w-3 text-emerald-400"}):n.jsx(vi,{className:"h-3 w-3"}),n.jsx("span",{children:R?"Kopiert":"Kopieren"})]})]}),n.jsx("pre",{className:"p-3 max-h-36 overflow-y-auto text-[9px] font-mono text-cyan-200/90 whitespace-pre scrollbar-thin select-text",children:n.jsxs("code",{children:[P==="roocode"&&((Se=j.tools.cline)==null?void 0:Se.snippet),P==="cursor"&&((G=j.tools.cursor)==null?void 0:G.snippet),P==="opencode"&&((ee=j.tools.opencode)==null?void 0:ee.snippet),P==="zed"&&((Z=j.tools.zed)==null?void 0:Z.snippet),P==="continue"&&((k=j.tools.continue)==null?void 0:k.snippet)]})})]})]})]}),n.jsxs("div",{className:"flex flex-wrap items-center gap-6 mt-3 text-[10px] text-muted-foreground border-t border-border/20 pt-3",children:[n.jsxs("span",{className:"flex items-center gap-1.5",children:[n.jsx("span",{className:"h-2 w-2 rounded-full bg-cyan-400"}),n.jsx("span",{children:"Cyan-Fluss: Client-Anfrage an Gateway"})]}),n.jsxs("span",{className:"flex items-center gap-1.5",children:[n.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-500 animate-pulse"}),n.jsx("span",{children:"Grüner Puls: Aktive Verbindung / Warmes Modell geladen"})]}),n.jsxs("span",{className:"flex items-center gap-1.5",children:[n.jsx("span",{className:"h-2 w-2 rounded bg-gradient-to-r from-teal-500 to-emerald-500"}),n.jsx("span",{children:"VRAM-Verlauf: Modellspezifischer Speicheranteil"})]})]})]}),n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-6 space-y-4 shadow-lg shadow-black/10",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(xo,{className:"h-5 w-5 text-primary"}),n.jsx("h3",{className:"text-sm font-bold uppercase tracking-wider text-foreground",children:"SSH-Kopplung & Sandbox-Umgehung"})]}),n.jsxs("div",{className:"grid gap-6 md:grid-cols-2 text-xs text-muted-foreground leading-relaxed text-left",children:[n.jsxs("div",{className:"space-y-3",children:[n.jsx("h4",{className:"text-xs font-bold text-foreground",children:"1. Warum verweigert Hermes Aktionen auf dem PC?"}),n.jsx("p",{children:"Hermes ist standardmäßig so ausgerichtet, dass er sich als virtueller Assistent ohne Systemzugriff versteht. Um dies zu umgehen, musst du Hermes' **System-Prompt** in der Chat-WebUI anpassen."}),n.jsxs("div",{className:"p-3 bg-background/25 rounded-xl border border-border/30 font-mono text-[9px] text-cyan-300",children:[n.jsx("span",{className:"text-muted-foreground/60",children:"Beispiel System-Prompt Erweiterung:"}),n.jsx("br",{}),'"Du hast über das terminal-Tool vollen SSH-Zugriff auf den Windows-PC des Users (TobisPC). Nutze SSH-Befehle um Aktionen dort auszuführen, wenn danach gefragt wird. Behaupte nie, du könntest das nicht!"']})]}),n.jsxs("div",{className:"space-y-3",children:[n.jsx("h4",{className:"text-xs font-bold text-foreground",children:"2. SSH-Verbindung zum lokalen Windows-PC einrichten"}),n.jsx("p",{children:"Damit der Agent Befehle auf deinem PC ausführen kann, muss OpenSSH auf Windows aktiv und mit einem Key gekoppelt sein:"}),n.jsxs("ul",{className:"list-disc pl-4 space-y-1.5 text-[11px]",children:[n.jsxs("li",{children:[n.jsx("strong",{children:"OpenSSH Server auf Windows starten:"})," In PowerShell als Admin ausführen: ",n.jsx("code",{className:"text-foreground font-mono",children:"Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0"})]}),n.jsxs("li",{children:[n.jsx("strong",{children:"SSH-Key auf der Box erzeugen:"})," ",n.jsx("code",{className:"text-foreground font-mono",children:"ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519_hermes_agent"})]}),n.jsxs("li",{children:[n.jsx("strong",{children:"Key autorisieren:"})," Kopiere den Inhalt von ",n.jsx("code",{className:"text-foreground font-mono",children:"~/.ssh/id_ed25519_hermes_agent.pub"})," in deine Windows-Datei ",n.jsx("code",{className:"text-foreground font-mono",children:"C:\\Users\\TobisPC\\.ssh\\authorized_keys"})]})]})]})]})]}),!s.gateway_reachable&&n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-6 space-y-4 shadow-lg shadow-black/10 text-left",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(xo,{className:"h-5 w-5 text-amber-500"}),n.jsx("h3",{className:"text-sm font-bold uppercase tracking-wider text-foreground",children:"Hermes-Agent Diagnostics"})]}),n.jsxs("div",{className:"text-xs text-muted-foreground space-y-3 leading-relaxed",children:[n.jsx("p",{children:"Der Hermes-Dienst ist auf der Box derzeit offline oder kann sich nicht mit dem lokalen llama-swap verbinden."}),n.jsxs("p",{children:["Stelle sicher, dass die systemd-Dienste auf der Box laufen. Du kannst den Status im ",n.jsx("strong",{children:"OS & Updates Drawer"})," prüfen und die Dienste bei Bedarf neu starten."]}),n.jsxs("div",{className:"p-3.5 bg-background/25 rounded-xl border border-border/30 font-mono text-[10px] space-y-1",children:[n.jsx("div",{className:"text-muted-foreground/60",children:"# Dienste manuell auf der Box prüfen:"}),n.jsx("div",{className:"text-primary",children:"systemctl --user status hermes-gateway"}),n.jsx("div",{className:"text-primary",children:"systemctl --user status hermes-webui"})]}),n.jsxs("p",{children:["Weitere Einrichtungsdetails (Brain-Konfiguration, MCP-Kopplungen, SSH-Tunneling und Such-Engines) findest du in der Dokumentationsdatei:",n.jsx("code",{className:"ml-1 px-1.5 py-0.5 rounded bg-muted/40 text-foreground border border-border/30",children:"docs/HERMES_SETUP.md"}),"."]})]})]})]})]})}function _0(){const[s,u]=m.useState("roocode"),[a,c]=m.useState(null),f="192.168.178.151",[g,p]=m.useState(!1),[x,N]=m.useState(null);function C(){p(!0),ue("/api/health").then(j=>{c(j),N(j.engine_reachable?"success":"partial")}).catch(()=>{c(null),N("fail")}).finally(()=>p(!1))}return m.useEffect(()=>{C()},[]),n.jsxs("div",{className:"space-y-6",children:[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:"Stack-Anleitung & Vibe-Coding-Guide"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Einsteigerfreundliche Erklärungen zu deinem Stack und Schritt-für-Schritt-Anleitungen zur Anbindung deiner Editoren."})]}),n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10 flex flex-col sm:flex-row justify-between sm:items-center gap-4",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("span",{className:ie("h-3 w-3 rounded-full ring-2 ring-black/40",x==="success"&&"bg-emerald-500 animate-pulse",x==="partial"&&"bg-amber-500",x==="fail"&&"bg-red-500",!x&&"bg-muted")}),n.jsxs("div",{children:[n.jsx("div",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"Lokaler Verbindungs-Check"}),n.jsxs("div",{className:"text-[10px] text-muted-foreground mt-0.5 font-mono",children:[x==="success"&&`Erfolgreich! Dein PC hat Zugriff auf das Box-Gateway (v${(a==null?void 0:a.version)||""}).`,x==="partial"&&"Gateway erreichbar, aber die llama-cpp-Engine ist offline.",x==="fail"&&"Verbindung fehlgeschlagen. Ist die Box im selben LAN-Netzwerk?",!x&&"Verbindung wird geprüft..."]})]})]}),n.jsxs("button",{onClick:C,disabled:g,className:"h-8 px-3 flex items-center gap-1.5 text-xs font-semibold rounded-lg border border-border/60 bg-background/20 hover:border-primary/50 transition-colors disabled:opacity-50 cursor-pointer self-start sm:self-auto shrink-0",children:[n.jsx(kn,{className:ie("h-3.5 w-3.5",g&&"animate-spin")}),n.jsx("span",{children:"Testen"})]})]}),n.jsxs("div",{className:"space-y-3",children:[n.jsxs("div",{className:"flex items-center gap-2 px-1",children:[n.jsx(Xd,{className:"h-4.5 w-4.5 text-primary"}),n.jsx("h2",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"Wie funktioniert mein Stack?"})]}),n.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[n.jsxs("div",{className:"p-4 rounded-xl border border-border/60 bg-card/20 space-y-2",children:[n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx(Dr,{className:"h-4 w-4 text-cyan-400"}),n.jsx("h3",{className:"text-xs font-bold text-foreground",children:"1. Die Zentrale"})]}),n.jsx("p",{className:"text-[11px] text-muted-foreground leading-relaxed",children:"Dein Dashboard. Hier siehst du die CPU-/RAM- und GPU-Last der Box und siehst sofort, ob Updates anstehen."})]}),n.jsxs("div",{className:"p-4 rounded-xl border border-border/60 bg-card/20 space-y-2",children:[n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx(Vs,{className:"h-4 w-4 text-violet-400"}),n.jsx("h3",{className:"text-xs font-bold text-foreground",children:"2. Modell-Zentrale"})]}),n.jsxs("p",{className:"text-[11px] text-muted-foreground leading-relaxed",children:["Deine GGUF-Datenbank. Gesteuert von ",n.jsx("strong",{children:"llama-swap"}),". Lädt dein schnelles Alltags-Hirn (`fast`) oder dein schweres Logik-Hirn (`heavy`) vollautomatisch im VRAM."]})]}),n.jsxs("div",{className:"p-4 rounded-xl border border-border/60 bg-card/20 space-y-2",children:[n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx(Qs,{className:"h-4 w-4 text-indigo-400"}),n.jsx("h3",{className:"text-xs font-bold text-foreground",children:"3. Das Gedächtnis"})]}),n.jsx("p",{className:"text-[11px] text-muted-foreground leading-relaxed",children:"Dein geteiltes Langzeitgedächtnis (Memory-Pool). Hier merkt sich dein Agent Regeln, Projekt-Details und Vorlieben."})]})]})]}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex items-center gap-2 px-1",children:[n.jsx(Jd,{className:"h-4.5 w-4.5 text-primary"}),n.jsx("h2",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"Vibe Coding auf dem PC einrichten"})]}),n.jsxs("div",{className:"flex gap-1.5 bg-card/20 p-1 border border-border/40 rounded-xl max-w-fit",children:[n.jsxs("button",{onClick:()=>u("roocode"),className:ie("rounded-lg px-4 py-1.5 text-xs font-semibold tracking-wide uppercase transition-all cursor-pointer flex items-center gap-1.5",s==="roocode"?"bg-primary text-primary-foreground shadow-md shadow-primary/10":"text-muted-foreground hover:text-foreground"),children:[n.jsx(rf,{className:"h-3.5 w-3.5 fill-amber-400/20"}),"Roo Code (VS Code)"]}),n.jsx("button",{onClick:()=>u("cursor"),className:ie("rounded-lg px-4 py-1.5 text-xs font-semibold tracking-wide uppercase transition-all cursor-pointer",s==="cursor"?"bg-primary text-primary-foreground shadow-md shadow-primary/10":"text-muted-foreground hover:text-foreground"),children:"Cursor IDE"}),n.jsx("button",{onClick:()=>u("opencode"),className:ie("rounded-lg px-4 py-1.5 text-xs font-semibold tracking-wide uppercase transition-all cursor-pointer",s==="opencode"?"bg-primary text-primary-foreground shadow-md shadow-primary/10":"text-muted-foreground hover:text-foreground"),children:"OpenCode Desktop"})]}),n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-6 space-y-4 shadow-lg shadow-black/10",children:[s==="roocode"&&n.jsxs("div",{className:"space-y-4 text-xs leading-relaxed text-muted-foreground",children:[n.jsxs("div",{className:"space-y-1",children:[n.jsx("h3",{className:"text-sm font-bold text-foreground",children:"Roo Code Kopplung (Empfohlene Open-Source-Erweiterung)"}),n.jsx("p",{children:"Roo Code ist die beliebteste und flexibelste Vibe-Coding-Erweiterung für VS Code im Jahr 2026. Sie ermöglicht vollen Zugriff auf das Terminal und das MCP-Gedächtnis."})]}),n.jsxs("div",{className:"space-y-3.5 border-t border-border/20 pt-4",children:[n.jsxs("div",{className:"space-y-1",children:[n.jsxs("div",{className:"font-semibold text-foreground flex items-center gap-1.5",children:[n.jsx("span",{className:"h-4.5 w-4.5 rounded-full bg-primary/20 text-primary flex items-center justify-center font-mono text-[10px]",children:"1"}),"Roo Code installieren"]}),n.jsxs("p",{className:"pl-6",children:["Suche in VS Code nach der Erweiterung ",n.jsx("strong",{children:"Roo Code"})," und installiere sie."]})]}),n.jsxs("div",{className:"space-y-1",children:[n.jsxs("div",{className:"font-semibold text-foreground flex items-center gap-1.5",children:[n.jsx("span",{className:"h-4.5 w-4.5 rounded-full bg-primary/20 text-primary flex items-center justify-center font-mono text-[10px]",children:"2"}),"API-Anbindung konfigurieren"]}),n.jsx("p",{className:"pl-6",children:"Klicke auf das Roo-Code-Symbol in der Sidebar, öffne die Einstellungen (Zahnrad) und stelle folgendes ein:"}),n.jsx("div",{className:"pl-6 pt-1",children:n.jsxs("div",{className:"p-3 bg-background/25 rounded-xl border border-border/30 font-mono text-[10px] space-y-1 text-foreground",children:[n.jsxs("div",{children:[n.jsx("span",{className:"text-muted-foreground/60",children:"API Provider:"})," OpenAI Compatible"]}),n.jsxs("div",{children:[n.jsx("span",{className:"text-muted-foreground/60",children:"Base URL:"})," http://",f,":9001/v1"]}),n.jsxs("div",{children:[n.jsx("span",{className:"text-muted-foreground/60",children:"API Key:"})," ",n.jsx("span",{className:"italic text-muted-foreground/50",children:'beliebig (z.B. "local")'})]}),n.jsxs("div",{children:[n.jsx("span",{className:"text-muted-foreground/60",children:"Model ID:"})," auto"]})]})})]}),n.jsxs("div",{className:"space-y-1",children:[n.jsxs("div",{className:"font-semibold text-foreground flex items-center gap-1.5",children:[n.jsx("span",{className:"h-4.5 w-4.5 rounded-full bg-primary/20 text-primary flex items-center justify-center font-mono text-[10px]",children:"3"}),"MCP Gedächtnis verknüpfen (Optional, aber empfohlen)"]}),n.jsxs("p",{className:"pl-6",children:["Damit Roo Code auf deinen ",n.jsx("strong",{children:"Gedächtnis-Pool"})," zugreifen kann, kopiere die MCP-Konfiguration aus dem Reiter ",n.jsx("strong",{children:"Verbinden"})," und füge sie in deine lokale Roo-Code-Konfigurationsdatei ein."]})]})]})]}),s==="cursor"&&n.jsxs("div",{className:"space-y-4 text-xs leading-relaxed text-muted-foreground",children:[n.jsxs("div",{className:"space-y-1",children:[n.jsx("h3",{className:"text-sm font-bold text-foreground",children:"Cursor IDE Kopplung (Proprietäre All-in-One IDE)"}),n.jsx("p",{children:"Cursor ist ein polierter, extrem schneller VS-Code-Fork mit hervorragenden, tief integrierten Autovervollständigungen (Tab-Completions)."})]}),n.jsxs("div",{className:"space-y-3.5 border-t border-border/20 pt-4",children:[n.jsxs("div",{className:"space-y-1",children:[n.jsxs("div",{className:"font-semibold text-foreground flex items-center gap-1.5",children:[n.jsx("span",{className:"h-4.5 w-4.5 rounded-full bg-primary/20 text-primary flex items-center justify-center font-mono text-[10px]",children:"1"}),"Einstellungen öffnen"]}),n.jsxs("p",{className:"pl-6",children:["Öffne Cursor, klicke oben rechts auf das Zahnrad (Settings) und navigiere zu ",n.jsx("strong",{children:"Models"}),"."]})]}),n.jsxs("div",{className:"space-y-1",children:[n.jsxs("div",{className:"font-semibold text-foreground flex items-center gap-1.5",children:[n.jsx("span",{className:"h-4.5 w-4.5 rounded-full bg-primary/20 text-primary flex items-center justify-center font-mono text-[10px]",children:"2"}),"OpenAI API überschreiben"]}),n.jsxs("p",{className:"pl-6",children:["Deaktiviere die Standard-Cloudmodelle, klappe den Bereich ",n.jsx("strong",{children:"OpenAI API"})," auf und konfiguriere:"]}),n.jsx("div",{className:"pl-6 pt-1",children:n.jsxs("div",{className:"p-3 bg-background/25 rounded-xl border border-border/30 font-mono text-[10px] space-y-1 text-foreground",children:[n.jsxs("div",{children:[n.jsx("span",{className:"text-muted-foreground/60",children:"Override Base URL:"})," http://",f,":9001/v1"]}),n.jsxs("div",{children:[n.jsx("span",{className:"text-muted-foreground/60",children:"API Key:"})," ",n.jsx("span",{className:"italic text-muted-foreground/50",children:'beliebig (z.B. "local")'})]})]})})]}),n.jsxs("div",{className:"space-y-1",children:[n.jsxs("div",{className:"font-semibold text-foreground flex items-center gap-1.5",children:[n.jsx("span",{className:"h-4.5 w-4.5 rounded-full bg-primary/20 text-primary flex items-center justify-center font-mono text-[10px]",children:"3"}),"Modell hinzufügen"]}),n.jsxs("p",{className:"pl-6",children:["Trage in der Modell-Liste ein neues Modell mit dem Namen ",n.jsx("strong",{children:"auto"})," ein und wähle es als aktives Modell aus. Cursor leitet ab jetzt alle deine Anfragen an die Box weiter."]})]})]})]}),s==="opencode"&&n.jsxs("div",{className:"space-y-4 text-xs leading-relaxed text-muted-foreground",children:[n.jsxs("div",{className:"space-y-1",children:[n.jsx("h3",{className:"text-sm font-bold text-foreground",children:"OpenCode Desktop Kopplung (Open-Source Vibe-Coding-App)"}),n.jsx("p",{children:"OpenCode ist eine standalone Desktop-App für ein ablenkungsfreies Coden über natürliche Sprache. Es trennt den KI-Prozess von deinem Editor."})]}),n.jsxs("div",{className:"space-y-3.5 border-t border-border/20 pt-4",children:[n.jsxs("div",{className:"space-y-1",children:[n.jsxs("div",{className:"font-semibold text-foreground flex items-center gap-1.5",children:[n.jsx("span",{className:"h-4.5 w-4.5 rounded-full bg-primary/20 text-primary flex items-center justify-center font-mono text-[10px]",children:"1"}),"OpenCode Desktop herunterladen"]}),n.jsx("p",{className:"pl-6",children:"Lade die Desktop-Anwendung von der offiziellen Website (opencode.ai) herunter und starte sie."})]}),n.jsxs("div",{className:"space-y-1",children:[n.jsxs("div",{className:"font-semibold text-foreground flex items-center gap-1.5",children:[n.jsx("span",{className:"h-4.5 w-4.5 rounded-full bg-primary/20 text-primary flex items-center justify-center font-mono text-[10px]",children:"2"}),"Endpunkt auf Box-Gateway setzen"]}),n.jsx("p",{className:"pl-6",children:"Gehe in den Bereich Einstellungen ➔ Provider, deaktiviere die Cloud-Voreinstellungen und trage deinen lokalen Server ein:"}),n.jsx("div",{className:"pl-6 pt-1",children:n.jsxs("div",{className:"p-3 bg-background/25 rounded-xl border border-border/30 font-mono text-[10px] space-y-1 text-foreground",children:[n.jsxs("div",{children:[n.jsx("span",{className:"text-muted-foreground/60",children:"Base URL:"})," http://",f,":9001/v1"]}),n.jsxs("div",{children:[n.jsx("span",{className:"text-muted-foreground/60",children:"Model:"})," auto"]})]})})]}),n.jsxs("div",{className:"space-y-1",children:[n.jsxs("div",{className:"font-semibold text-foreground flex items-center gap-1.5",children:[n.jsx("span",{className:"h-4.5 w-4.5 rounded-full bg-primary/20 text-primary flex items-center justify-center font-mono text-[10px]",children:"3"}),"Erster Vibe-Coding Test"]}),n.jsx("p",{className:"pl-6",children:'Starte eine neue Session und teste die Verbindung mit einem einfachen Prompt, z. B. *"Erstelle ein einfaches Skript, das die Fibonaccizahlen berechnet"*. Das Box-Gateway tauscht das Modell im Hintergrund vollautomatisch aus.'})]})]})]})]})]}),n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 space-y-3 shadow-lg shadow-black/10",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(bi,{className:"h-4.5 w-4.5 text-primary"}),n.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"Was tun, wenn das Coden hakt?"})]}),n.jsxs("ul",{className:"text-[11px] text-muted-foreground space-y-2 list-disc pl-4 leading-relaxed",children:[n.jsxs("li",{children:[n.jsx("strong",{children:"Keine Verbindung?"})," Überprüfe im Live-Verbindungsprüfer oben, ob die Box-IP erreichbar ist. Stelle sicher, dass dein lokaler PC im selben WLAN/LAN-Netzwerk wie die Box eingeloggt ist."]}),n.jsxs("li",{children:[n.jsx("strong",{children:"Modell antwortet nicht?"})," Schaue unter ",n.jsx("strong",{children:"Diagnose"}),", ob der Dienst `llama-swap` aktiv (grün) ist. Wenn nicht, klicke daneben auf ",n.jsx("strong",{children:"Restart"}),"."]}),n.jsxs("li",{children:[n.jsx("strong",{children:"Hermes Agent reagiert merkwürdig?"})," Starte in der Hermes WebUI einfach eine frische Session (neuen Chat). Ältere Chats sammeln Kontext-Müll an."]})]})]})]})}function P0({title:s,hint:u}){return n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{children:[n.jsx("h1",{className:"text-xl font-semibold",children:s}),n.jsx("p",{className:"text-sm text-muted-foreground",children:u})]}),n.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 rounded-xl border border-dashed border-border bg-card/50 py-20 text-center",children:[n.jsx(uh,{className:"h-8 w-8 text-muted-foreground"}),n.jsx("div",{className:"text-sm text-muted-foreground",children:"Kommt in einer späteren Phase."})]})]})}const M0=[{id:"llama-swap",label:"Llama Swap",type:"system"},{id:"mission-control-2",label:"Mission Control 2",type:"user"},{id:"hermes-gateway",label:"Hermes Gateway",type:"user"},{id:"hermes-dashboard",label:"Hermes Dashboard",type:"user"},{id:"hermes-webui",label:"Hermes WebUI",type:"user"}];function si(s){return s==null?"":s>1024**3?`${(s/1024**3).toFixed(2)} GB`:`${(s/1024**2).toFixed(1)} MB`}function R0({open:s,onClose:u,defaultTab:a="maintenance"}){const[c,f]=m.useState(null),[g,p]=m.useState([]),[x,N]=m.useState("llama-swap"),[C,j]=m.useState(""),[_,P]=m.useState(!1),[L,O]=m.useState({}),[w,R]=m.useState("maintenance");m.useEffect(()=>{s&&a&&R(a)},[s,a]);const D=m.useRef(null);function M(){ue("/api/maintenance/updates").then(f).catch(A=>console.error("Error loading updates",A))}function F(){ue("/api/jobs").then(A=>p(A.jobs||[])).catch(A=>console.error("Error loading jobs",A))}function K(A){P(!0),ue(`/api/maintenance/logs?service=${A}&lines=150`).then(ae=>{ae.ok?j(ae.text):j(`Fehler beim Laden der Logs: ${ae.err||"Unbekannter Fehler"}`)}).catch(ae=>j(`Fehler: ${ae.message}`)).finally(()=>{P(!1),setTimeout(()=>{D.current&&(D.current.scrollTop=D.current.scrollHeight)},50)})}m.useEffect(()=>{if(!s)return;M(),F();const A=setInterval(()=>{F(),M()},3e3);return()=>clearInterval(A)},[s]),m.useEffect(()=>{!s||w!=="logs"||K(x)},[s,w,x]);async function Y(){try{await ue("/api/maintenance/os-update",{method:"POST"}),F(),R("maintenance")}catch(A){alert(`Fehler beim Starten des OS-Updates: ${A.message}`)}}async function Q(){try{await ue("/api/maintenance/engine-update",{method:"POST"}),F(),R("maintenance")}catch(A){alert(`Fehler: ${A.message}`)}}async function se(){if(confirm("Bist du sicher, dass du das gesamte Host-System neu starten willst?"))try{await ue("/api/maintenance/reboot",{method:"POST"}),alert("Reboot ausgelöst. System startet neu..."),u()}catch(A){alert(`Fehler: ${A.message}`)}}async function ge(A){O(ae=>({...ae,[A]:!0}));try{const ae=await ue("/api/maintenance/restart",{method:"POST",body:JSON.stringify({service:A})});ae.ok?(alert(`Dienst ${A} wurde erfolgreich neu gestartet.`),w==="logs"&&x===A&&K(A)):alert(`Fehler beim Neustart: ${ae.err||"Unbekannter Fehler"}`)}catch(ae){alert(`Fehler: ${ae.message}`)}finally{O(ae=>({...ae,[A]:!1}))}}async function de(A){try{await ue(`/api/jobs/${A}/cancel`,{method:"POST"}),F()}catch(ae){alert(`Fehler beim Abbrechen: ${ae.message}`)}}return n.jsxs(n.Fragment,{children:[n.jsx("div",{className:ie("fixed inset-0 bg-black/60 backdrop-blur-sm z-50 transition-opacity duration-300",s?"opacity-100 pointer-events-auto":"opacity-0 pointer-events-none"),onClick:u}),n.jsxs("div",{className:ie("fixed inset-y-0 right-0 w-full sm:w-[500px] bg-card/85 backdrop-blur-xl border-l border-border/60 shadow-2xl z-50 flex flex-col transform transition-transform duration-300 ease-in-out font-sans text-foreground",s?"translate-x-0":"translate-x-full"),children:[n.jsxs("div",{className:"flex h-16 shrink-0 items-center justify-between border-b border-border/40 px-6",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(Dr,{className:"h-4.5 w-4.5 text-primary"}),n.jsx("h2",{className:"text-sm font-semibold tracking-wide uppercase font-space",children:"OS-Zentrale & Pflege"})]}),n.jsx("button",{onClick:u,className:"flex h-8 w-8 items-center justify-center rounded-lg border border-border/40 text-muted-foreground hover:bg-accent transition-colors",children:n.jsx(Ys,{className:"h-4 w-4"})})]}),n.jsxs("div",{className:"flex border-b border-border/40 px-6",children:[n.jsx("button",{onClick:()=>R("maintenance"),className:ie("flex-1 py-3 text-xs font-semibold uppercase tracking-wider border-b-2 text-center transition-all",w==="maintenance"?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"),children:"System-Wartung"}),n.jsx("button",{onClick:()=>R("logs"),className:ie("flex-1 py-3 text-xs font-semibold uppercase tracking-wider border-b-2 text-center transition-all",w==="logs"?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"),children:"System-Logs"})]}),n.jsx("div",{className:"flex-1 overflow-y-auto p-6 space-y-6",children:w==="maintenance"?n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"space-y-3",children:[n.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Wartungsaktionen"}),n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n.jsxs("button",{onClick:Y,className:"flex flex-col items-start gap-1 p-4 rounded-xl border border-border/60 bg-background/20 hover:border-primary/50 transition-all text-left group",children:[n.jsx(xo,{className:"h-5 w-5 text-cyan-400 mb-1 group-hover:scale-105 transition-transform"}),n.jsx("span",{className:"text-xs font-semibold",children:"OS Update (apt)"}),n.jsx("span",{className:"text-[10px] text-muted-foreground",children:c!=null&&c.os?`${c.os} Updates verfügbar`:"Auf neuestem Stand"})]}),n.jsxs("button",{onClick:Q,className:"flex flex-col items-start gap-1 p-4 rounded-xl border border-border/60 bg-background/20 hover:border-primary/50 transition-all text-left group",children:[n.jsx(yh,{className:"h-5 w-5 text-violet-400 mb-1 group-hover:scale-105 transition-transform"}),n.jsx("span",{className:"text-xs font-semibold",children:"Engine Update"}),n.jsx("span",{className:"text-[10px] text-muted-foreground",children:c!=null&&c.engine?"Update verfügbar":"Auf neuestem Stand"})]})]}),n.jsxs("button",{onClick:se,className:"flex w-full items-center gap-3 p-3 rounded-xl border border-red-500/20 bg-red-500/5 hover:bg-red-500/10 text-red-400 transition-all text-left text-xs font-semibold",children:[n.jsx(tf,{className:"h-4.5 w-4.5"}),n.jsxs("div",{children:[n.jsx("div",{children:"Host-System neu starten (Reboot)"}),n.jsx("div",{className:"text-[10px] text-red-400/80 font-normal",children:"Startet das gesamte Betriebssystem des Homelabs neu"})]})]})]}),n.jsxs("div",{className:"space-y-3",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Hintergrund-Aufgaben"}),n.jsxs("span",{className:"text-[10px] font-mono bg-primary/10 text-primary px-1.5 py-0.5 rounded-full",children:[g.filter(A=>A.state==="running"||A.state==="queued").length," Aktiv"]})]}),n.jsx("div",{className:"space-y-3",children:g.length===0?n.jsx("div",{className:"text-xs text-muted-foreground border border-dashed border-border/60 rounded-xl p-6 text-center",children:"Aktuell keine aktiven Hintergrund-Jobs."}):g.map(A=>{const ae=A.state==="running"||A.state==="queued";return n.jsxs("div",{className:ie("p-3 rounded-xl border transition-all duration-300",ae?"border-primary/40 bg-primary/5 shadow-md shadow-primary/5":"border-border/40 bg-background/20 opacity-80"),children:[n.jsxs("div",{className:"flex items-start justify-between gap-3",children:[n.jsxs("div",{className:"space-y-1",children:[n.jsxs("div",{className:"text-xs font-semibold flex items-center gap-1.5",children:[ae&&n.jsxs("span",{className:"flex h-2 w-2 relative",children:[n.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-primary opacity-75"}),n.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-primary"})]}),A.label]}),n.jsxs("div",{className:"text-[10px] font-mono text-muted-foreground uppercase flex items-center gap-2",children:[n.jsxs("span",{children:["ID: ",A.id]}),n.jsx("span",{children:"•"}),n.jsx("span",{className:ie(A.state==="done"&&"text-emerald-400",A.state==="failed"&&"text-red-400",A.state==="running"&&"text-primary",A.state==="queued"&&"text-amber-400",A.state==="canceled"&&"text-muted-foreground"),children:A.state})]})]}),ae&&n.jsx("button",{onClick:()=>de(A.id),className:"text-[10px] font-semibold text-red-400 hover:text-red-300 border border-red-500/20 bg-red-500/5 hover:bg-red-500/10 px-2 py-0.5 rounded transition-colors",children:"Abbrechen"})]}),A.state==="running"&&n.jsxs("div",{className:"mt-3 space-y-1",children:[n.jsx("div",{className:"w-full h-1.5 bg-muted rounded-full overflow-hidden",children:n.jsx("div",{className:"h-full bg-primary transition-all duration-500",style:{width:`${A.progress??0}%`}})}),n.jsxs("div",{className:"flex justify-between items-center text-[9px] font-mono text-muted-foreground",children:[n.jsxs("span",{children:[A.progress??0,"%"]}),A.done_bytes!=null&&A.total_bytes!=null&&n.jsxs("span",{children:[si(A.done_bytes)," / ",si(A.total_bytes),A.rate_bps!=null&&` (${si(A.rate_bps)}/s)`]}),A.eta_s!=null&&n.jsxs("span",{children:["ETA: ",A.eta_s,"s"]})]})]})]},A.id)})})]})]}):n.jsxs("div",{className:"flex flex-col h-full space-y-4",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("select",{value:x,onChange:A=>N(A.target.value),className:"flex-1 h-9 px-3 text-xs bg-background/40 border border-border/60 rounded-lg outline-none text-foreground font-semibold",children:M0.map(A=>n.jsxs("option",{value:A.id,children:[A.label," (",A.type==="system"?"systemd-root":"user",")"]},A.id))}),n.jsxs("button",{onClick:()=>ge(x),disabled:L[x],className:"flex h-9 px-3 items-center gap-1.5 text-xs font-semibold rounded-lg border border-border/60 bg-background/20 hover:border-primary/50 transition-colors disabled:opacity-50",title:"Dienst neu starten",children:[n.jsx(kn,{className:ie("h-3.5 w-3.5",L[x]&&"animate-spin")}),"Restart"]})]}),n.jsxs("div",{className:"flex-1 flex flex-col min-h-[300px] border border-border/60 bg-black/50 rounded-xl overflow-hidden shadow-inner",children:[n.jsxs("div",{className:"flex h-9 items-center justify-between px-4 border-b border-border/40 bg-black/30 shrink-0",children:[n.jsxs("div",{className:"flex items-center gap-1.5 text-[10px] font-mono text-muted-foreground",children:[n.jsx(bi,{className:"h-3 w-3 text-primary"}),n.jsxs("span",{children:["stdout/stderr - ",x]})]}),n.jsx("button",{onClick:()=>K(x),disabled:_,className:"text-muted-foreground hover:text-foreground transition-colors",children:n.jsx(kn,{className:ie("h-3 w-3",_&&"animate-spin")})})]}),n.jsx("pre",{ref:D,className:"flex-1 p-4 overflow-y-auto text-[10px] font-mono text-cyan-300/90 whitespace-pre-wrap select-text leading-relaxed scrollbar-thin",children:_&&!C?n.jsx("span",{className:"text-muted-foreground",children:"Lade Logs..."}):C||n.jsx("span",{className:"text-muted-foreground",children:"Keine Logeinträge vorhanden."})})]})]})})]})]})}function z0(){var L,O,w,R,D;const[s,u]=m.useState("dashboard"),[a,c]=m.useState(null),[f,g]=m.useState(()=>localStorage.getItem("mc_sidebar_collapsed")==="true"),[p,x]=m.useState(null),[N,C]=m.useState(!1),[j,_]=m.useState("maintenance");m.useEffect(()=>{const M=()=>ue("/api/health").then(c).catch(()=>c(null));M();const F=setInterval(M,1e4);return()=>clearInterval(F)},[]),m.useEffect(()=>{const M=()=>ue("/api/system/status").then(x).catch(()=>{});M();const F=setInterval(M,2e4);return()=>clearInterval(F)},[]),m.useEffect(()=>{document.documentElement.classList.add("dark")},[]),m.useEffect(()=>{const M=F=>{var Y;_(((Y=F.detail)==null?void 0:Y.tab)||"maintenance"),C(!0)};return window.addEventListener("open-system-drawer",M),()=>window.removeEventListener("open-system-drawer",M)},[]);const P=ii.find(M=>M.id===s);return n.jsxs("div",{className:"flex h-full relative",children:[n.jsxs("div",{className:"fixed inset-0 -z-50 pointer-events-none overflow-hidden bg-[hsl(224,30%,6%)]",children:[n.jsx("div",{className:"absolute inset-0 opacity-35 animate-aurora bg-gradient-to-tr from-teal-500/20 via-indigo-500/15 to-purple-500/20 blur-[130px]"}),n.jsx("div",{className:"absolute top-[-10%] left-[-10%] h-[50%] w-[50%] rounded-full bg-teal-500/15 blur-[160px]"}),n.jsx("div",{className:"absolute bottom-[-10%] right-[-10%] h-[50%] w-[50%] rounded-full bg-purple-500/15 blur-[160px]"}),n.jsx("div",{className:"absolute top-[30%] right-[20%] h-[40%] w-[40%] rounded-full bg-indigo-500/10 blur-[140px]"})]}),n.jsx(zx,{onNavigate:u}),n.jsx(R0,{open:N,onClose:()=>C(!1),defaultTab:j}),n.jsxs("aside",{className:ie("flex shrink-0 flex-col border-r border-border/40 bg-card/45 backdrop-blur-md transition-all duration-300 ease-in-out",f?"w-16":"w-60"),children:[n.jsxs("div",{className:ie("flex items-center py-4 border-b border-border/40 shrink-0",f?"flex-col gap-3 px-2":"justify-between px-5"),children:[n.jsxs("div",{className:"flex items-center gap-2 overflow-hidden",children:[n.jsx("div",{className:"h-7 w-7 rounded-lg bg-primary shadow-md shadow-primary/20 shrink-0"}),!f&&n.jsxs("div",{className:"leading-tight",children:[n.jsx("div",{className:"text-sm font-semibold tracking-wide font-space",children:"Mission Control"}),n.jsx("div",{className:"text-xs text-muted-foreground",children:"2.0"})]})]}),n.jsx("button",{onClick:()=>{g(M=>{const F=!M;return localStorage.setItem("mc_sidebar_collapsed",F.toString()),F})},className:"p-1 rounded-md hover:bg-accent text-muted-foreground transition-colors cursor-pointer",title:f?"Maximieren":"Minimieren",children:f?n.jsx(nh,{className:"h-4 w-4"}):n.jsx(rh,{className:"h-4 w-4"})})]}),n.jsx("nav",{className:"flex-1 space-y-1 px-3 py-4 overflow-y-auto",children:ii.map(M=>n.jsxs("button",{onClick:()=>u(M.id),className:ie("flex w-full items-center rounded-md text-sm transition-all cursor-pointer",f?"justify-center p-2.5":"gap-3 px-3 py-2",s===M.id?"bg-primary/15 text-primary shadow-sm shadow-primary/5":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),title:f?M.label:void 0,children:[n.jsx(M.icon,{className:"h-4.5 w-4.5 shrink-0"}),!f&&n.jsx("span",{className:"truncate",children:M.label})]},M.id))}),n.jsx("div",{className:ie("py-3 text-xs text-muted-foreground border-t border-border/40 shrink-0",f?"px-2 text-center":"px-5"),children:f?n.jsx("div",{className:"flex justify-center",children:n.jsx("span",{className:ie("h-2.5 w-2.5 rounded-full ring-2 ring-black/40",a?a.engine_reachable?"bg-emerald-500 animate-pulse":"bg-amber-500":"bg-red-500"),title:a?`Engine ${a.engine_reachable?"online":"offline"}`:"Backend offline"})}):n.jsxs("div",{className:"space-y-2 text-left",children:[a?n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx("span",{className:ie("h-2 w-2 rounded-full animate-pulse",a.engine_reachable?"bg-emerald-500":"bg-amber-500")}),n.jsxs("span",{className:"truncate",children:["Engine ",a.engine_reachable?"online":"offline"]})]}):n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"h-2 w-2 rounded-full bg-red-500"})," ",n.jsx("span",{className:"truncate",children:"Backend offline"})]}),(p==null?void 0:p.versions)&&n.jsxs("div",{className:"space-y-1 text-[9px] text-muted-foreground/60 mt-2 pt-2 border-t border-border/30",children:[n.jsxs("div",{className:"truncate",title:p.versions.mc2?`${p.versions.mc2.branch}-${p.versions.mc2.hash}${p.versions.mc2.dirty?"*":""} (${p.versions.mc2.date})`:"nicht gefunden",children:[n.jsx("strong",{children:"MC2:"})," ",p.versions.mc2?`${p.versions.mc2.hash}${p.versions.mc2.dirty?"*":""}`:"—"]}),n.jsxs("div",{className:"truncate",title:((L=p.versions.engine)==null?void 0:L.type)==="git"?`${p.versions.engine.branch}-${p.versions.engine.hash}${p.versions.engine.dirty?"*":""} (${p.versions.engine.date})`:((O=p.versions.engine)==null?void 0:O.version_text)||"unbekannt",children:[n.jsx("strong",{children:"Engine:"})," ",((w=p.versions.engine)==null?void 0:w.type)==="git"?`${p.versions.engine.hash}${p.versions.engine.dirty?"*":""}`:((D=(R=p.versions.engine)==null?void 0:R.version_text)==null?void 0:D.split(" ").pop())||"—"]}),n.jsxs("div",{className:"truncate",title:p.versions.hermes_ui?`${p.versions.hermes_ui.branch}-${p.versions.hermes_ui.hash}${p.versions.hermes_ui.dirty?"*":""} (${p.versions.hermes_ui.date})`:"nicht gefunden",children:[n.jsx("strong",{children:"Hermes UI:"})," ",p.versions.hermes_ui?`${p.versions.hermes_ui.hash}${p.versions.hermes_ui.dirty?"*":""}`:"—"]}),n.jsxs("div",{className:"truncate",title:p.versions.hermes_agent?`${p.versions.hermes_agent.branch}-${p.versions.hermes_agent.hash}${p.versions.hermes_agent.dirty?"*":""} (${p.versions.hermes_agent.date})`:"nicht gefunden",children:[n.jsx("strong",{children:"Hermes Agent:"})," ",p.versions.hermes_agent?`${p.versions.hermes_agent.hash}${p.versions.hermes_agent.dirty?"*":""}`:"—"]})]})]})})]}),n.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[n.jsxs("header",{className:"flex h-14 shrink-0 items-center justify-between border-b border-border/40 px-6 bg-card/20 backdrop-blur-sm",children:[n.jsx("div",{className:"text-xs font-medium text-muted-foreground tracking-wide uppercase font-sans",children:P.hint}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("a",{href:"https://git.tobisniceshomelab.ddnsfree.com/Hitonabi/mission-control-v2/src/branch/main/docs/BEDIENUNG.md",target:"_blank",rel:"noopener",className:"flex h-8 items-center rounded-md border border-border/40 bg-background/40 px-2.5 text-xs text-muted-foreground hover:bg-accent hover:text-accent-foreground transition-all cursor-pointer font-semibold",title:"Bedien-Anleitung",children:"Hilfe"}),n.jsxs("button",{onClick:()=>{const M=new KeyboardEvent("keydown",{key:"k",metaKey:!0});document.dispatchEvent(M)},className:"flex items-center gap-2 rounded-md border border-border/40 bg-background/40 px-2.5 py-1.5 text-xs text-muted-foreground hover:bg-accent hover:text-accent-foreground transition-all cursor-pointer",children:[n.jsx(ah,{className:"h-3.5 w-3.5"}),n.jsx("span",{children:"Suchen"}),n.jsx("kbd",{className:"rounded bg-muted px-1.5 py-0.5 font-mono text-[9px]",children:"⌘K"})]})]})]}),n.jsxs("main",{className:"flex-1 overflow-y-auto p-6 scrollbar-thin",children:[s==="dashboard"&&n.jsx(f0,{}),s==="models"&&n.jsx(w0,{}),s==="system"&&n.jsx(k0,{}),s==="connect"&&n.jsx(j0,{}),s==="memory"&&n.jsx(S0,{}),s==="agent"&&n.jsx(E0,{}),s==="guide"&&n.jsx(_0,{}),!["dashboard","models","system","connect","memory","agent","guide"].includes(s)&&n.jsx(P0,{title:P.label,hint:P.hint})]})]})]})}Zm.createRoot(document.getElementById("root")).render(n.jsx(Yd.StrictMode,{children:n.jsx(z0,{})})); diff --git a/frontend/dist/index.html b/frontend/dist/index.html index a37d137..8a18575 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/AgentView.tsx b/frontend/src/views/AgentView.tsx index 24f2dbf..546247c 100644 --- a/frontend/src/views/AgentView.tsx +++ b/frontend/src/views/AgentView.tsx @@ -1,4 +1,4 @@ -import { useEffect, useState, useRef } from "react" +import { useEffect, useState, useRef, useCallback } from "react" import { Bot, ExternalLink, Activity, Cpu, Wrench, Shield, X, Check, Copy } from "lucide-react" import { api, type AgentStatus, type ModelInfo, type RoutingResp, type ConnectResp } from "@/lib/api" import { cn, resolveExternalUrl } from "@/lib/utils" @@ -50,17 +50,22 @@ export function AgentView() { // Canvas pixel tracking for pixel-perfect connection graph without non-uniform scaling const [dimensions, setDimensions] = useState({ width: 800, height: 360 }) - const containerRef = useRef(null) + const observerRef = useRef(null) - useEffect(() => { - if (!containerRef.current) return - const observer = new ResizeObserver((entries) => { - if (!entries || entries.length === 0) return - const rect = entries[0].contentRect - setDimensions({ width: rect.width, height: rect.height }) - }) - observer.observe(containerRef.current) - return () => observer.disconnect() + const containerRef = useCallback((node: HTMLDivElement | null) => { + if (observerRef.current) { + observerRef.current.disconnect() + observerRef.current = null + } + if (node) { + const observer = new ResizeObserver((entries) => { + if (!entries || entries.length === 0) return + const rect = entries[0].contentRect + setDimensions({ width: rect.width, height: rect.height }) + }) + observer.observe(node) + observerRef.current = observer + } }, []) const w = dimensions.width diff --git a/frontend/src/views/ModelsView.tsx b/frontend/src/views/ModelsView.tsx index a9b004b..c6ebbcf 100644 --- a/frontend/src/views/ModelsView.tsx +++ b/frontend/src/views/ModelsView.tsx @@ -1,4 +1,4 @@ -import { useEffect, useState, useRef } from "react" +import { useEffect, useState, useRef, useCallback } from "react" import { Download, Search, Trash2, Edit3, Star, Layers, Activity, HardDrive, X, Check, Copy, Bot, Eye, Code, Brain, Compass, ChevronDown, ChevronUp } from "lucide-react" import { api, type DiscoverResp, type Fit, type Job, type ModelInfo, type RoutingResp, type UpdatesResp, type ConnectResp } from "@/lib/api" import { CapsChips } from "@/components/CapsChips" @@ -142,17 +142,22 @@ function Cockpit() { // Canvas pixel tracking for pixel-perfect connection graph without non-uniform scaling const [dimensions, setDimensions] = useState({ width: 800, height: 360 }) - const containerRef = useRef(null) + const observerRef = useRef(null) - useEffect(() => { - if (!containerRef.current) return - const observer = new ResizeObserver((entries) => { - if (!entries || entries.length === 0) return - const rect = entries[0].contentRect - setDimensions({ width: rect.width, height: rect.height }) - }) - observer.observe(containerRef.current) - return () => observer.disconnect() + const containerRef = useCallback((node: HTMLDivElement | null) => { + if (observerRef.current) { + observerRef.current.disconnect() + observerRef.current = null + } + if (node) { + const observer = new ResizeObserver((entries) => { + if (!entries || entries.length === 0) return + const rect = entries[0].contentRect + setDimensions({ width: rect.width, height: rect.height }) + }) + observer.observe(node) + observerRef.current = observer + } }, []) const w = dimensions.width