Files
mission-control-v2/frontend/dist/assets/index-CpG8j7ha.js
T
Hitonabi 7a11fd2846 Refactor: DashboardView in Karten zerlegen (Phase 4a)
DashboardView 849 -> ~40 Zeilen Orchestrator. Sechs eigenständige Karten unter
components/dashboard/, jede mit eigenem Daten-Hook (react-query, geteilte Keys):
- RadialGauge, SystemStatusCard (useSystemStatus)
- UpdatesCard (useUpdates+useJobs; OS/Engine-Update, Reboot, Modell-Upgrade,
  Sudo-Modal, invalidiert nach Aktionen)
- AgentStatusCard (useAgentStatus+useModels; Gehirn-Wechsel-Modal)
- RolesCard (useModels), MemoryInputCard (useMemory), TokenStatsCard (useTokenStats)

Kein manuelles useEffect+setInterval mehr; useDialog statt lokalem Dialog-State.
Verifiziert: tsc grün, Build grün, alle 6 Karten rendern, Live-Daten + Pricing-
Footer korrekt, keine Konsolenfehler.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-26 14:50:54 +02:00

381 lines
444 KiB
JavaScript

var lp=s=>{throw TypeError(s)};var mu=(s,o,i)=>o.has(s)||lp("Cannot "+i);var S=(s,o,i)=>(mu(s,o,"read from private field"),i?i.call(s):o.get(s)),ye=(s,o,i)=>o.has(s)?lp("Cannot add the same private member more than once"):o instanceof WeakSet?o.add(s):o.set(s,i),se=(s,o,i,u)=>(mu(s,o,"write to private field"),u?u.call(s,i):o.set(s,i),i),Ce=(s,o,i)=>(mu(s,o,"access private method"),i);var ei=(s,o,i,u)=>({set _(d){se(s,o,d,i)},get _(){return S(s,o,u)}});function hx(s,o){for(var i=0;i<o.length;i++){const u=o[i];if(typeof u!="string"&&!Array.isArray(u)){for(const d in u)if(d!=="default"&&!(d in s)){const f=Object.getOwnPropertyDescriptor(u,d);f&&Object.defineProperty(s,d,f.get?f:{enumerable:!0,get:()=>u[d]})}}}return Object.freeze(Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}))}(function(){const o=document.createElement("link").relList;if(o&&o.supports&&o.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))u(d);new MutationObserver(d=>{for(const f of d)if(f.type==="childList")for(const m of f.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&u(m)}).observe(document,{childList:!0,subtree:!0});function i(d){const f={};return d.integrity&&(f.integrity=d.integrity),d.referrerPolicy&&(f.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?f.credentials="include":d.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function u(d){if(d.ep)return;d.ep=!0;const f=i(d);fetch(d.href,f)}})();function uh(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var gu={exports:{}},No={},xu={exports:{}},Se={};/**
* @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 ip;function mx(){if(ip)return Se;ip=1;var s=Symbol.for("react.element"),o=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),f=Symbol.for("react.provider"),m=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),v=Symbol.for("react.suspense"),x=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),j=Symbol.iterator;function M(P){return P===null||typeof P!="object"?null:(P=j&&P[j]||P["@@iterator"],typeof P=="function"?P:null)}var D={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},I=Object.assign,w={};function C(P,N,G){this.props=P,this.context=N,this.refs=w,this.updater=G||D}C.prototype.isReactComponent={},C.prototype.setState=function(P,N){if(typeof P!="object"&&typeof P!="function"&&P!=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,P,N,"setState")},C.prototype.forceUpdate=function(P){this.updater.enqueueForceUpdate(this,P,"forceUpdate")};function _(){}_.prototype=C.prototype;function $(P,N,G){this.props=P,this.context=N,this.refs=w,this.updater=G||D}var H=$.prototype=new _;H.constructor=$,I(H,C.prototype),H.isPureReactComponent=!0;var z=Array.isArray,R=Object.prototype.hasOwnProperty,F={current:null},K={key:!0,ref:!0,__self:!0,__source:!0};function ne(P,N,G){var X,Y={},ie=null,pe=null;if(N!=null)for(X in N.ref!==void 0&&(pe=N.ref),N.key!==void 0&&(ie=""+N.key),N)R.call(N,X)&&!K.hasOwnProperty(X)&&(Y[X]=N[X]);var we=arguments.length-2;if(we===1)Y.children=G;else if(1<we){for(var U=Array(we),me=0;me<we;me++)U[me]=arguments[me+2];Y.children=U}if(P&&P.defaultProps)for(X in we=P.defaultProps,we)Y[X]===void 0&&(Y[X]=we[X]);return{$$typeof:s,type:P,key:ie,ref:pe,props:Y,_owner:F.current}}function ee(P,N){return{$$typeof:s,type:P.type,key:N,ref:P.ref,props:P.props,_owner:P._owner}}function J(P){return typeof P=="object"&&P!==null&&P.$$typeof===s}function ke(P){var N={"=":"=0",":":"=2"};return"$"+P.replace(/[=:]/g,function(G){return N[G]})}var ue=/\/+/g;function Le(P,N){return typeof P=="object"&&P!==null&&P.key!=null?ke(""+P.key):N.toString(36)}function _e(P,N,G,X,Y){var ie=typeof P;(ie==="undefined"||ie==="boolean")&&(P=null);var pe=!1;if(P===null)pe=!0;else switch(ie){case"string":case"number":pe=!0;break;case"object":switch(P.$$typeof){case s:case o:pe=!0}}if(pe)return pe=P,Y=Y(pe),P=X===""?"."+Le(pe,0):X,z(Y)?(G="",P!=null&&(G=P.replace(ue,"$&/")+"/"),_e(Y,N,G,"",function(me){return me})):Y!=null&&(J(Y)&&(Y=ee(Y,G+(!Y.key||pe&&pe.key===Y.key?"":(""+Y.key).replace(ue,"$&/")+"/")+P)),N.push(Y)),1;if(pe=0,X=X===""?".":X+":",z(P))for(var we=0;we<P.length;we++){ie=P[we];var U=X+Le(ie,we);pe+=_e(ie,N,G,U,Y)}else if(U=M(P),typeof U=="function")for(P=U.call(P),we=0;!(ie=P.next()).done;)ie=ie.value,U=X+Le(ie,we++),pe+=_e(ie,N,G,U,Y);else if(ie==="object")throw N=String(P),Error("Objects are not valid as a React child (found: "+(N==="[object Object]"?"object with keys {"+Object.keys(P).join(", ")+"}":N)+"). If you meant to render a collection of children, use an array instead.");return pe}function Oe(P,N,G){if(P==null)return P;var X=[],Y=0;return _e(P,X,"","",function(ie){return N.call(G,ie,Y++)}),X}function Te(P){if(P._status===-1){var N=P._result;N=N(),N.then(function(G){(P._status===0||P._status===-1)&&(P._status=1,P._result=G)},function(G){(P._status===0||P._status===-1)&&(P._status=2,P._result=G)}),P._status===-1&&(P._status=0,P._result=N)}if(P._status===1)return P._result.default;throw P._result}var Me={current:null},Q={transition:null},ce={ReactCurrentDispatcher:Me,ReactCurrentBatchConfig:Q,ReactCurrentOwner:F};function Z(){throw Error("act(...) is not supported in production builds of React.")}return Se.Children={map:Oe,forEach:function(P,N,G){Oe(P,function(){N.apply(this,arguments)},G)},count:function(P){var N=0;return Oe(P,function(){N++}),N},toArray:function(P){return Oe(P,function(N){return N})||[]},only:function(P){if(!J(P))throw Error("React.Children.only expected to receive a single React element child.");return P}},Se.Component=C,Se.Fragment=i,Se.Profiler=d,Se.PureComponent=$,Se.StrictMode=u,Se.Suspense=v,Se.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ce,Se.act=Z,Se.cloneElement=function(P,N,G){if(P==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+P+".");var X=I({},P.props),Y=P.key,ie=P.ref,pe=P._owner;if(N!=null){if(N.ref!==void 0&&(ie=N.ref,pe=F.current),N.key!==void 0&&(Y=""+N.key),P.type&&P.type.defaultProps)var we=P.type.defaultProps;for(U in N)R.call(N,U)&&!K.hasOwnProperty(U)&&(X[U]=N[U]===void 0&&we!==void 0?we[U]:N[U])}var U=arguments.length-2;if(U===1)X.children=G;else if(1<U){we=Array(U);for(var me=0;me<U;me++)we[me]=arguments[me+2];X.children=we}return{$$typeof:s,type:P.type,key:Y,ref:ie,props:X,_owner:pe}},Se.createContext=function(P){return P={$$typeof:m,_currentValue:P,_currentValue2:P,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},P.Provider={$$typeof:f,_context:P},P.Consumer=P},Se.createElement=ne,Se.createFactory=function(P){var N=ne.bind(null,P);return N.type=P,N},Se.createRef=function(){return{current:null}},Se.forwardRef=function(P){return{$$typeof:h,render:P}},Se.isValidElement=J,Se.lazy=function(P){return{$$typeof:b,_payload:{_status:-1,_result:P},_init:Te}},Se.memo=function(P,N){return{$$typeof:x,type:P,compare:N===void 0?null:N}},Se.startTransition=function(P){var N=Q.transition;Q.transition={};try{P()}finally{Q.transition=N}},Se.unstable_act=Z,Se.useCallback=function(P,N){return Me.current.useCallback(P,N)},Se.useContext=function(P){return Me.current.useContext(P)},Se.useDebugValue=function(){},Se.useDeferredValue=function(P){return Me.current.useDeferredValue(P)},Se.useEffect=function(P,N){return Me.current.useEffect(P,N)},Se.useId=function(){return Me.current.useId()},Se.useImperativeHandle=function(P,N,G){return Me.current.useImperativeHandle(P,N,G)},Se.useInsertionEffect=function(P,N){return Me.current.useInsertionEffect(P,N)},Se.useLayoutEffect=function(P,N){return Me.current.useLayoutEffect(P,N)},Se.useMemo=function(P,N){return Me.current.useMemo(P,N)},Se.useReducer=function(P,N,G){return Me.current.useReducer(P,N,G)},Se.useRef=function(P){return Me.current.useRef(P)},Se.useState=function(P){return Me.current.useState(P)},Se.useSyncExternalStore=function(P,N,G){return Me.current.useSyncExternalStore(P,N,G)},Se.useTransition=function(){return Me.current.useTransition()},Se.version="18.3.1",Se}var ap;function lc(){return ap||(ap=1,xu.exports=mx()),xu.exports}/**
* @license React
* react-jsx-runtime.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 up;function gx(){if(up)return No;up=1;var s=lc(),o=Symbol.for("react.element"),i=Symbol.for("react.fragment"),u=Object.prototype.hasOwnProperty,d=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,f={key:!0,ref:!0,__self:!0,__source:!0};function m(h,v,x){var b,j={},M=null,D=null;x!==void 0&&(M=""+x),v.key!==void 0&&(M=""+v.key),v.ref!==void 0&&(D=v.ref);for(b in v)u.call(v,b)&&!f.hasOwnProperty(b)&&(j[b]=v[b]);if(h&&h.defaultProps)for(b in v=h.defaultProps,v)j[b]===void 0&&(j[b]=v[b]);return{$$typeof:o,type:h,key:M,ref:D,props:j,_owner:d.current}}return No.Fragment=i,No.jsx=m,No.jsxs=m,No}var cp;function xx(){return cp||(cp=1,gu.exports=gx()),gu.exports}var n=xx(),g=lc();const ch=uh(g),ic=hx({__proto__:null,default:ch},[g]);var ti={},yu={exports:{}},wt={},vu={exports:{}},bu={};/**
* @license React
* scheduler.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 dp;function yx(){return dp||(dp=1,(function(s){function o(Q,ce){var Z=Q.length;Q.push(ce);e:for(;0<Z;){var P=Z-1>>>1,N=Q[P];if(0<d(N,ce))Q[P]=ce,Q[Z]=N,Z=P;else break e}}function i(Q){return Q.length===0?null:Q[0]}function u(Q){if(Q.length===0)return null;var ce=Q[0],Z=Q.pop();if(Z!==ce){Q[0]=Z;e:for(var P=0,N=Q.length,G=N>>>1;P<G;){var X=2*(P+1)-1,Y=Q[X],ie=X+1,pe=Q[ie];if(0>d(Y,Z))ie<N&&0>d(pe,Y)?(Q[P]=pe,Q[ie]=Z,P=ie):(Q[P]=Y,Q[X]=Z,P=X);else if(ie<N&&0>d(pe,Z))Q[P]=pe,Q[ie]=Z,P=ie;else break e}}return ce}function d(Q,ce){var Z=Q.sortIndex-ce.sortIndex;return Z!==0?Z:Q.id-ce.id}if(typeof performance=="object"&&typeof performance.now=="function"){var f=performance;s.unstable_now=function(){return f.now()}}else{var m=Date,h=m.now();s.unstable_now=function(){return m.now()-h}}var v=[],x=[],b=1,j=null,M=3,D=!1,I=!1,w=!1,C=typeof setTimeout=="function"?setTimeout:null,_=typeof clearTimeout=="function"?clearTimeout:null,$=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function H(Q){for(var ce=i(x);ce!==null;){if(ce.callback===null)u(x);else if(ce.startTime<=Q)u(x),ce.sortIndex=ce.expirationTime,o(v,ce);else break;ce=i(x)}}function z(Q){if(w=!1,H(Q),!I)if(i(v)!==null)I=!0,Te(R);else{var ce=i(x);ce!==null&&Me(z,ce.startTime-Q)}}function R(Q,ce){I=!1,w&&(w=!1,_(ne),ne=-1),D=!0;var Z=M;try{for(H(ce),j=i(v);j!==null&&(!(j.expirationTime>ce)||Q&&!ke());){var P=j.callback;if(typeof P=="function"){j.callback=null,M=j.priorityLevel;var N=P(j.expirationTime<=ce);ce=s.unstable_now(),typeof N=="function"?j.callback=N:j===i(v)&&u(v),H(ce)}else u(v);j=i(v)}if(j!==null)var G=!0;else{var X=i(x);X!==null&&Me(z,X.startTime-ce),G=!1}return G}finally{j=null,M=Z,D=!1}}var F=!1,K=null,ne=-1,ee=5,J=-1;function ke(){return!(s.unstable_now()-J<ee)}function ue(){if(K!==null){var Q=s.unstable_now();J=Q;var ce=!0;try{ce=K(!0,Q)}finally{ce?Le():(F=!1,K=null)}}else F=!1}var Le;if(typeof $=="function")Le=function(){$(ue)};else if(typeof MessageChannel<"u"){var _e=new MessageChannel,Oe=_e.port2;_e.port1.onmessage=ue,Le=function(){Oe.postMessage(null)}}else Le=function(){C(ue,0)};function Te(Q){K=Q,F||(F=!0,Le())}function Me(Q,ce){ne=C(function(){Q(s.unstable_now())},ce)}s.unstable_IdlePriority=5,s.unstable_ImmediatePriority=1,s.unstable_LowPriority=4,s.unstable_NormalPriority=3,s.unstable_Profiling=null,s.unstable_UserBlockingPriority=2,s.unstable_cancelCallback=function(Q){Q.callback=null},s.unstable_continueExecution=function(){I||D||(I=!0,Te(R))},s.unstable_forceFrameRate=function(Q){0>Q||125<Q?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):ee=0<Q?Math.floor(1e3/Q):5},s.unstable_getCurrentPriorityLevel=function(){return M},s.unstable_getFirstCallbackNode=function(){return i(v)},s.unstable_next=function(Q){switch(M){case 1:case 2:case 3:var ce=3;break;default:ce=M}var Z=M;M=ce;try{return Q()}finally{M=Z}},s.unstable_pauseExecution=function(){},s.unstable_requestPaint=function(){},s.unstable_runWithPriority=function(Q,ce){switch(Q){case 1:case 2:case 3:case 4:case 5:break;default:Q=3}var Z=M;M=Q;try{return ce()}finally{M=Z}},s.unstable_scheduleCallback=function(Q,ce,Z){var P=s.unstable_now();switch(typeof Z=="object"&&Z!==null?(Z=Z.delay,Z=typeof Z=="number"&&0<Z?P+Z:P):Z=P,Q){case 1:var N=-1;break;case 2:N=250;break;case 5:N=1073741823;break;case 4:N=1e4;break;default:N=5e3}return N=Z+N,Q={id:b++,callback:ce,priorityLevel:Q,startTime:Z,expirationTime:N,sortIndex:-1},Z>P?(Q.sortIndex=Z,o(x,Q),i(v)===null&&Q===i(x)&&(w?(_(ne),ne=-1):w=!0,Me(z,Z-P))):(Q.sortIndex=N,o(v,Q),I||D||(I=!0,Te(R))),Q},s.unstable_shouldYield=ke,s.unstable_wrapCallback=function(Q){var ce=M;return function(){var Z=M;M=ce;try{return Q.apply(this,arguments)}finally{M=Z}}}})(bu)),bu}var fp;function vx(){return fp||(fp=1,vu.exports=yx()),vu.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 pp;function bx(){if(pp)return wt;pp=1;var s=lc(),o=vx();function i(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var u=new Set,d={};function f(e,t){m(e,t),m(e+"Capture",t)}function m(e,t){for(d[e]=t,e=0;e<t.length;e++)u.add(t[e])}var h=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),v=Object.prototype.hasOwnProperty,x=/^[: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]*$/,b={},j={};function M(e){return v.call(j,e)?!0:v.call(b,e)?!1:x.test(e)?j[e]=!0:(b[e]=!0,!1)}function D(e,t,r,l){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return l?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function I(e,t,r,l){if(t===null||typeof t>"u"||D(e,t,r,l))return!0;if(l)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,l,a,c,p){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=l,this.attributeNamespace=a,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=c,this.removeEmptyString=p}var C={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){C[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];C[t]=new w(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){C[e]=new w(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){C[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){C[e]=new w(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){C[e]=new w(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){C[e]=new w(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){C[e]=new w(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){C[e]=new w(e,5,!1,e.toLowerCase(),null,!1,!1)});var _=/[\-:]([a-z])/g;function $(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(_,$);C[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(_,$);C[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(_,$);C[t]=new w(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){C[e]=new w(e,1,!1,e.toLowerCase(),null,!1,!1)}),C.xlinkHref=new w("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){C[e]=new w(e,1,!1,e.toLowerCase(),null,!0,!0)});function H(e,t,r,l){var a=C.hasOwnProperty(t)?C[t]:null;(a!==null?a.type!==0:l||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(I(t,r,a,l)&&(r=null),l||a===null?M(t)&&(r===null?e.removeAttribute(t):e.setAttribute(t,""+r)):a.mustUseProperty?e[a.propertyName]=r===null?a.type===3?!1:"":r:(t=a.attributeName,l=a.attributeNamespace,r===null?e.removeAttribute(t):(a=a.type,r=a===3||a===4&&r===!0?"":""+r,l?e.setAttributeNS(l,t,r):e.setAttribute(t,r))))}var z=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,R=Symbol.for("react.element"),F=Symbol.for("react.portal"),K=Symbol.for("react.fragment"),ne=Symbol.for("react.strict_mode"),ee=Symbol.for("react.profiler"),J=Symbol.for("react.provider"),ke=Symbol.for("react.context"),ue=Symbol.for("react.forward_ref"),Le=Symbol.for("react.suspense"),_e=Symbol.for("react.suspense_list"),Oe=Symbol.for("react.memo"),Te=Symbol.for("react.lazy"),Me=Symbol.for("react.offscreen"),Q=Symbol.iterator;function ce(e){return e===null||typeof e!="object"?null:(e=Q&&e[Q]||e["@@iterator"],typeof e=="function"?e:null)}var Z=Object.assign,P;function N(e){if(P===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);P=t&&t[1]||""}return`
`+P+e}var G=!1;function X(e,t){if(!e||G)return"";G=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(L){var l=L}Reflect.construct(e,[],t)}else{try{t.call()}catch(L){l=L}e.call(t.prototype)}else{try{throw Error()}catch(L){l=L}e()}}catch(L){if(L&&l&&typeof L.stack=="string"){for(var a=L.stack.split(`
`),c=l.stack.split(`
`),p=a.length-1,y=c.length-1;1<=p&&0<=y&&a[p]!==c[y];)y--;for(;1<=p&&0<=y;p--,y--)if(a[p]!==c[y]){if(p!==1||y!==1)do if(p--,y--,0>y||a[p]!==c[y]){var k=`
`+a[p].replace(" at new "," at ");return e.displayName&&k.includes("<anonymous>")&&(k=k.replace("<anonymous>",e.displayName)),k}while(1<=p&&0<=y);break}}}finally{G=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?N(e):""}function Y(e){switch(e.tag){case 5:return N(e.type);case 16:return N("Lazy");case 13:return N("Suspense");case 19:return N("SuspenseList");case 0:case 2:case 15:return e=X(e.type,!1),e;case 11:return e=X(e.type.render,!1),e;case 1:return e=X(e.type,!0),e;default:return""}}function ie(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 K:return"Fragment";case F:return"Portal";case ee:return"Profiler";case ne:return"StrictMode";case Le:return"Suspense";case _e:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case ke:return(e.displayName||"Context")+".Consumer";case J: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 Oe:return t=e.displayName||null,t!==null?t:ie(e.type)||"Memo";case Te:t=e._payload,e=e._init;try{return ie(e(t))}catch{}}return null}function pe(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 ie(t);case 8:return t===ne?"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 we(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function U(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function me(e){var t=U(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),l=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var a=r.get,c=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.call(this)},set:function(p){l=""+p,c.call(this,p)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return l},setValue:function(p){l=""+p},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function St(e){e._valueTracker||(e._valueTracker=me(e))}function Go(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),l="";return e&&(l=U(e)?e.checked?"true":"false":e.value),e=l,e!==r?(t.setValue(e),!0):!1}function kr(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 ln(e,t){var r=t.checked;return Z({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function Is(e,t){var r=t.defaultValue==null?"":t.defaultValue,l=t.checked!=null?t.checked:t.defaultChecked;r=we(t.value!=null?t.value:r),e._wrapperState={initialChecked:l,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Fs(e,t){t=t.checked,t!=null&&H(e,"checked",t,!1)}function Fn(e,t){Fs(e,t);var r=we(t.value),l=t.type;if(r!=null)l==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(l==="submit"||l==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Un(e,t.type,r):t.hasOwnProperty("defaultValue")&&Un(e,t.type,we(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Nr(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var l=t.type;if(!(l!=="submit"&&l!=="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 Un(e,t,r){(t!=="number"||kr(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var Sr=Array.isArray;function ir(e,t,r,l){if(e=e.options,t){t={};for(var a=0;a<r.length;a++)t["$"+r[a]]=!0;for(r=0;r<e.length;r++)a=t.hasOwnProperty("$"+e[r].value),e[r].selected!==a&&(e[r].selected=a),a&&l&&(e[r].defaultSelected=!0)}else{for(r=""+we(r),t=null,a=0;a<e.length;a++){if(e[a].value===r){e[a].selected=!0,l&&(e[a].defaultSelected=!0);return}t!==null||e[a].disabled||(t=e[a])}t!==null&&(t.selected=!0)}}function $n(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(i(91));return Z({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Us(e,t){var r=t.value;if(r==null){if(r=t.children,t=t.defaultValue,r!=null){if(t!=null)throw Error(i(92));if(Sr(r)){if(1<r.length)throw Error(i(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:we(r)}}function A(e,t){var r=we(t.value),l=we(t.defaultValue);r!=null&&(r=""+r,r!==e.value&&(e.value=r),t.defaultValue==null&&e.defaultValue!==r&&(e.defaultValue=r)),l!=null&&(e.defaultValue=""+l)}function oe(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function be(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Ee(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?be(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Ie,Ut=(function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,r,l,a){MSApp.execUnsafeLocalFunction(function(){return e(t,r,l,a)})}:e})(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Ie=Ie||document.createElement("div"),Ie.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Ie.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ar(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var ur={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},Ci=["Webkit","ms","Moz","O"];Object.keys(ur).forEach(function(e){Ci.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ur[t]=ur[e]})});function bc(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||ur.hasOwnProperty(e)&&ur[e]?(""+t).trim():t+"px"}function wc(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var l=r.indexOf("--")===0,a=bc(r,t[r],l);r==="float"&&(r="cssFloat"),l?e.setProperty(r,a):e[r]=a}}var vm=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 Ei(e,t){if(t){if(vm[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(i(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(i(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(i(61))}if(t.style!=null&&typeof t.style!="object")throw Error(i(62))}}function Pi(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 _i=null;function Mi(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ri=null,Bn=null,Hn=null;function jc(e){if(e=ao(e)){if(typeof Ri!="function")throw Error(i(280));var t=e.stateNode;t&&(t=ml(t),Ri(e.stateNode,e.type,t))}}function kc(e){Bn?Hn?Hn.push(e):Hn=[e]:Bn=e}function Nc(){if(Bn){var e=Bn,t=Hn;if(Hn=Bn=null,jc(e),t)for(e=0;e<t.length;e++)jc(t[e])}}function Sc(e,t){return e(t)}function Cc(){}var Oi=!1;function Ec(e,t,r){if(Oi)return e(t,r);Oi=!0;try{return Sc(e,t,r)}finally{Oi=!1,(Bn!==null||Hn!==null)&&(Cc(),Nc())}}function $s(e,t){var r=e.stateNode;if(r===null)return null;var l=ml(r);if(l===null)return null;r=l[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(e=e.type,l=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!l;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(i(231,t,typeof r));return r}var Di=!1;if(h)try{var Bs={};Object.defineProperty(Bs,"passive",{get:function(){Di=!0}}),window.addEventListener("test",Bs,Bs),window.removeEventListener("test",Bs,Bs)}catch{Di=!1}function bm(e,t,r,l,a,c,p,y,k){var L=Array.prototype.slice.call(arguments,3);try{t.apply(r,L)}catch(W){this.onError(W)}}var Hs=!1,Ko=null,Qo=!1,Ti=null,wm={onError:function(e){Hs=!0,Ko=e}};function jm(e,t,r,l,a,c,p,y,k){Hs=!1,Ko=null,bm.apply(wm,arguments)}function km(e,t,r,l,a,c,p,y,k){if(jm.apply(this,arguments),Hs){if(Hs){var L=Ko;Hs=!1,Ko=null}else throw Error(i(198));Qo||(Qo=!0,Ti=L)}}function an(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(r=t.return),e=t.return;while(e)}return t.tag===3?r:null}function Pc(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function _c(e){if(an(e)!==e)throw Error(i(188))}function Nm(e){var t=e.alternate;if(!t){if(t=an(e),t===null)throw Error(i(188));return t!==e?null:e}for(var r=e,l=t;;){var a=r.return;if(a===null)break;var c=a.alternate;if(c===null){if(l=a.return,l!==null){r=l;continue}break}if(a.child===c.child){for(c=a.child;c;){if(c===r)return _c(a),e;if(c===l)return _c(a),t;c=c.sibling}throw Error(i(188))}if(r.return!==l.return)r=a,l=c;else{for(var p=!1,y=a.child;y;){if(y===r){p=!0,r=a,l=c;break}if(y===l){p=!0,l=a,r=c;break}y=y.sibling}if(!p){for(y=c.child;y;){if(y===r){p=!0,r=c,l=a;break}if(y===l){p=!0,l=c,r=a;break}y=y.sibling}if(!p)throw Error(i(189))}}if(r.alternate!==l)throw Error(i(190))}if(r.tag!==3)throw Error(i(188));return r.stateNode.current===r?e:t}function Mc(e){return e=Nm(e),e!==null?Rc(e):null}function Rc(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Rc(e);if(t!==null)return t;e=e.sibling}return null}var Oc=o.unstable_scheduleCallback,Dc=o.unstable_cancelCallback,Sm=o.unstable_shouldYield,Cm=o.unstable_requestPaint,Qe=o.unstable_now,Em=o.unstable_getCurrentPriorityLevel,Ai=o.unstable_ImmediatePriority,Tc=o.unstable_UserBlockingPriority,qo=o.unstable_NormalPriority,Pm=o.unstable_LowPriority,Ac=o.unstable_IdlePriority,Zo=null,Zt=null;function _m(e){if(Zt&&typeof Zt.onCommitFiberRoot=="function")try{Zt.onCommitFiberRoot(Zo,e,void 0,(e.current.flags&128)===128)}catch{}}var $t=Math.clz32?Math.clz32:Om,Mm=Math.log,Rm=Math.LN2;function Om(e){return e>>>=0,e===0?32:31-(Mm(e)/Rm|0)|0}var Yo=64,Jo=4194304;function Ws(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 Xo(e,t){var r=e.pendingLanes;if(r===0)return 0;var l=0,a=e.suspendedLanes,c=e.pingedLanes,p=r&268435455;if(p!==0){var y=p&~a;y!==0?l=Ws(y):(c&=p,c!==0&&(l=Ws(c)))}else p=r&~a,p!==0?l=Ws(p):c!==0&&(l=Ws(c));if(l===0)return 0;if(t!==0&&t!==l&&(t&a)===0&&(a=l&-l,c=t&-t,a>=c||a===16&&(c&4194240)!==0))return t;if((l&4)!==0&&(l|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=l;0<t;)r=31-$t(t),a=1<<r,l|=e[r],t&=~a;return l}function Dm(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 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 t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Tm(e,t){for(var r=e.suspendedLanes,l=e.pingedLanes,a=e.expirationTimes,c=e.pendingLanes;0<c;){var p=31-$t(c),y=1<<p,k=a[p];k===-1?((y&r)===0||(y&l)!==0)&&(a[p]=Dm(y,t)):k<=t&&(e.expiredLanes|=y),c&=~y}}function zi(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function zc(){var e=Yo;return Yo<<=1,(Yo&4194240)===0&&(Yo=64),e}function Li(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function Vs(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-$t(t),e[t]=r}function Am(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 l=e.eventTimes;for(e=e.expirationTimes;0<r;){var a=31-$t(r),c=1<<a;t[a]=0,l[a]=-1,e[a]=-1,r&=~c}}function Ii(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var l=31-$t(r),a=1<<l;a&t|e[l]&t&&(e[l]|=t),r&=~a}}var ze=0;function Lc(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var Ic,Fi,Fc,Uc,$c,Ui=!1,el=[],Cr=null,Er=null,Pr=null,Gs=new Map,Ks=new Map,_r=[],zm="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Bc(e,t){switch(e){case"focusin":case"focusout":Cr=null;break;case"dragenter":case"dragleave":Er=null;break;case"mouseover":case"mouseout":Pr=null;break;case"pointerover":case"pointerout":Gs.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ks.delete(t.pointerId)}}function Qs(e,t,r,l,a,c){return e===null||e.nativeEvent!==c?(e={blockedOn:t,domEventName:r,eventSystemFlags:l,nativeEvent:c,targetContainers:[a]},t!==null&&(t=ao(t),t!==null&&Fi(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,a!==null&&t.indexOf(a)===-1&&t.push(a),e)}function Lm(e,t,r,l,a){switch(t){case"focusin":return Cr=Qs(Cr,e,t,r,l,a),!0;case"dragenter":return Er=Qs(Er,e,t,r,l,a),!0;case"mouseover":return Pr=Qs(Pr,e,t,r,l,a),!0;case"pointerover":var c=a.pointerId;return Gs.set(c,Qs(Gs.get(c)||null,e,t,r,l,a)),!0;case"gotpointercapture":return c=a.pointerId,Ks.set(c,Qs(Ks.get(c)||null,e,t,r,l,a)),!0}return!1}function Hc(e){var t=un(e.target);if(t!==null){var r=an(t);if(r!==null){if(t=r.tag,t===13){if(t=Pc(r),t!==null){e.blockedOn=t,$c(e.priority,function(){Fc(r)});return}}else if(t===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function tl(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=Bi(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var l=new r.constructor(r.type,r);_i=l,r.target.dispatchEvent(l),_i=null}else return t=ao(r),t!==null&&Fi(t),e.blockedOn=r,!1;t.shift()}return!0}function Wc(e,t,r){tl(e)&&r.delete(t)}function Im(){Ui=!1,Cr!==null&&tl(Cr)&&(Cr=null),Er!==null&&tl(Er)&&(Er=null),Pr!==null&&tl(Pr)&&(Pr=null),Gs.forEach(Wc),Ks.forEach(Wc)}function qs(e,t){e.blockedOn===t&&(e.blockedOn=null,Ui||(Ui=!0,o.unstable_scheduleCallback(o.unstable_NormalPriority,Im)))}function Zs(e){function t(a){return qs(a,e)}if(0<el.length){qs(el[0],e);for(var r=1;r<el.length;r++){var l=el[r];l.blockedOn===e&&(l.blockedOn=null)}}for(Cr!==null&&qs(Cr,e),Er!==null&&qs(Er,e),Pr!==null&&qs(Pr,e),Gs.forEach(t),Ks.forEach(t),r=0;r<_r.length;r++)l=_r[r],l.blockedOn===e&&(l.blockedOn=null);for(;0<_r.length&&(r=_r[0],r.blockedOn===null);)Hc(r),r.blockedOn===null&&_r.shift()}var Wn=z.ReactCurrentBatchConfig,rl=!0;function Fm(e,t,r,l){var a=ze,c=Wn.transition;Wn.transition=null;try{ze=1,$i(e,t,r,l)}finally{ze=a,Wn.transition=c}}function Um(e,t,r,l){var a=ze,c=Wn.transition;Wn.transition=null;try{ze=4,$i(e,t,r,l)}finally{ze=a,Wn.transition=c}}function $i(e,t,r,l){if(rl){var a=Bi(e,t,r,l);if(a===null)oa(e,t,l,nl,r),Bc(e,l);else if(Lm(a,e,t,r,l))l.stopPropagation();else if(Bc(e,l),t&4&&-1<zm.indexOf(e)){for(;a!==null;){var c=ao(a);if(c!==null&&Ic(c),c=Bi(e,t,r,l),c===null&&oa(e,t,l,nl,r),c===a)break;a=c}a!==null&&l.stopPropagation()}else oa(e,t,l,null,r)}}var nl=null;function Bi(e,t,r,l){if(nl=null,e=Mi(l),e=un(e),e!==null)if(t=an(e),t===null)e=null;else if(r=t.tag,r===13){if(e=Pc(t),e!==null)return e;e=null}else if(r===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return nl=e,null}function Vc(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Em()){case Ai:return 1;case Tc:return 4;case qo:case Pm:return 16;case Ac:return 536870912;default:return 16}default:return 16}}var Mr=null,Hi=null,sl=null;function Gc(){if(sl)return sl;var e,t=Hi,r=t.length,l,a="value"in Mr?Mr.value:Mr.textContent,c=a.length;for(e=0;e<r&&t[e]===a[e];e++);var p=r-e;for(l=1;l<=p&&t[r-l]===a[c-l];l++);return sl=a.slice(e,1<l?1-l:void 0)}function ol(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function ll(){return!0}function Kc(){return!1}function Ct(e){function t(r,l,a,c,p){this._reactName=r,this._targetInst=a,this.type=l,this.nativeEvent=c,this.target=p,this.currentTarget=null;for(var y in e)e.hasOwnProperty(y)&&(r=e[y],this[y]=r?r(c):c[y]);return this.isDefaultPrevented=(c.defaultPrevented!=null?c.defaultPrevented:c.returnValue===!1)?ll:Kc,this.isPropagationStopped=Kc,this}return Z(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=ll)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=ll)},persist:function(){},isPersistent:ll}),t}var Vn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Wi=Ct(Vn),Ys=Z({},Vn,{view:0,detail:0}),$m=Ct(Ys),Vi,Gi,Js,il=Z({},Ys,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Qi,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Js&&(Js&&e.type==="mousemove"?(Vi=e.screenX-Js.screenX,Gi=e.screenY-Js.screenY):Gi=Vi=0,Js=e),Vi)},movementY:function(e){return"movementY"in e?e.movementY:Gi}}),Qc=Ct(il),Bm=Z({},il,{dataTransfer:0}),Hm=Ct(Bm),Wm=Z({},Ys,{relatedTarget:0}),Ki=Ct(Wm),Vm=Z({},Vn,{animationName:0,elapsedTime:0,pseudoElement:0}),Gm=Ct(Vm),Km=Z({},Vn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Qm=Ct(Km),qm=Z({},Vn,{data:0}),qc=Ct(qm),Zm={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Ym={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Jm={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Xm(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Jm[e])?!!t[e]:!1}function Qi(){return Xm}var eg=Z({},Ys,{key:function(e){if(e.key){var t=Zm[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ol(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Ym[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Qi,charCode:function(e){return e.type==="keypress"?ol(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ol(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),tg=Ct(eg),rg=Z({},il,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Zc=Ct(rg),ng=Z({},Ys,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Qi}),sg=Ct(ng),og=Z({},Vn,{propertyName:0,elapsedTime:0,pseudoElement:0}),lg=Ct(og),ig=Z({},il,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),ag=Ct(ig),ug=[9,13,27,32],qi=h&&"CompositionEvent"in window,Xs=null;h&&"documentMode"in document&&(Xs=document.documentMode);var cg=h&&"TextEvent"in window&&!Xs,Yc=h&&(!qi||Xs&&8<Xs&&11>=Xs),Jc=" ",Xc=!1;function ed(e,t){switch(e){case"keyup":return ug.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function td(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Gn=!1;function dg(e,t){switch(e){case"compositionend":return td(t);case"keypress":return t.which!==32?null:(Xc=!0,Jc);case"textInput":return e=t.data,e===Jc&&Xc?null:e;default:return null}}function fg(e,t){if(Gn)return e==="compositionend"||!qi&&ed(e,t)?(e=Gc(),sl=Hi=Mr=null,Gn=!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.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Yc&&t.locale!=="ko"?null:t.data;default:return null}}var pg={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function rd(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!pg[e.type]:t==="textarea"}function nd(e,t,r,l){kc(l),t=fl(t,"onChange"),0<t.length&&(r=new Wi("onChange","change",null,r,l),e.push({event:r,listeners:t}))}var eo=null,to=null;function hg(e){wd(e,0)}function al(e){var t=Yn(e);if(Go(t))return e}function mg(e,t){if(e==="change")return t}var sd=!1;if(h){var Zi;if(h){var Yi="oninput"in document;if(!Yi){var od=document.createElement("div");od.setAttribute("oninput","return;"),Yi=typeof od.oninput=="function"}Zi=Yi}else Zi=!1;sd=Zi&&(!document.documentMode||9<document.documentMode)}function ld(){eo&&(eo.detachEvent("onpropertychange",id),to=eo=null)}function id(e){if(e.propertyName==="value"&&al(to)){var t=[];nd(t,to,e,Mi(e)),Ec(hg,t)}}function gg(e,t,r){e==="focusin"?(ld(),eo=t,to=r,eo.attachEvent("onpropertychange",id)):e==="focusout"&&ld()}function xg(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return al(to)}function yg(e,t){if(e==="click")return al(t)}function vg(e,t){if(e==="input"||e==="change")return al(t)}function bg(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Bt=typeof Object.is=="function"?Object.is:bg;function ro(e,t){if(Bt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),l=Object.keys(t);if(r.length!==l.length)return!1;for(l=0;l<r.length;l++){var a=r[l];if(!v.call(t,a)||!Bt(e[a],t[a]))return!1}return!0}function ad(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function ud(e,t){var r=ad(e);e=0;for(var l;r;){if(r.nodeType===3){if(l=e+r.textContent.length,e<=t&&l>=t)return{node:r,offset:t-e};e=l}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=ad(r)}}function cd(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?cd(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function dd(){for(var e=window,t=kr();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=kr(e.document)}return t}function Ji(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 wg(e){var t=dd(),r=e.focusedElem,l=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&cd(r.ownerDocument.documentElement,r)){if(l!==null&&Ji(r)){if(t=l.start,e=l.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 a=r.textContent.length,c=Math.min(l.start,a);l=l.end===void 0?c:Math.min(l.end,a),!e.extend&&c>l&&(a=l,l=c,c=a),a=ud(r,c);var p=ud(r,l);a&&p&&(e.rangeCount!==1||e.anchorNode!==a.node||e.anchorOffset!==a.offset||e.focusNode!==p.node||e.focusOffset!==p.offset)&&(t=t.createRange(),t.setStart(a.node,a.offset),e.removeAllRanges(),c>l?(e.addRange(t),e.extend(p.node,p.offset)):(t.setEnd(p.node,p.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<t.length;r++)e=t[r],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var jg=h&&"documentMode"in document&&11>=document.documentMode,Kn=null,Xi=null,no=null,ea=!1;function fd(e,t,r){var l=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;ea||Kn==null||Kn!==kr(l)||(l=Kn,"selectionStart"in l&&Ji(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),no&&ro(no,l)||(no=l,l=fl(Xi,"onSelect"),0<l.length&&(t=new Wi("onSelect","select",null,t,r),e.push({event:t,listeners:l}),t.target=Kn)))}function ul(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var Qn={animationend:ul("Animation","AnimationEnd"),animationiteration:ul("Animation","AnimationIteration"),animationstart:ul("Animation","AnimationStart"),transitionend:ul("Transition","TransitionEnd")},ta={},pd={};h&&(pd=document.createElement("div").style,"AnimationEvent"in window||(delete Qn.animationend.animation,delete Qn.animationiteration.animation,delete Qn.animationstart.animation),"TransitionEvent"in window||delete Qn.transitionend.transition);function cl(e){if(ta[e])return ta[e];if(!Qn[e])return e;var t=Qn[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in pd)return ta[e]=t[r];return e}var hd=cl("animationend"),md=cl("animationiteration"),gd=cl("animationstart"),xd=cl("transitionend"),yd=new Map,vd="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Rr(e,t){yd.set(e,t),f(t,[e])}for(var ra=0;ra<vd.length;ra++){var na=vd[ra],kg=na.toLowerCase(),Ng=na[0].toUpperCase()+na.slice(1);Rr(kg,"on"+Ng)}Rr(hd,"onAnimationEnd"),Rr(md,"onAnimationIteration"),Rr(gd,"onAnimationStart"),Rr("dblclick","onDoubleClick"),Rr("focusin","onFocus"),Rr("focusout","onBlur"),Rr(xd,"onTransitionEnd"),m("onMouseEnter",["mouseout","mouseover"]),m("onMouseLeave",["mouseout","mouseover"]),m("onPointerEnter",["pointerout","pointerover"]),m("onPointerLeave",["pointerout","pointerover"]),f("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),f("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),f("onBeforeInput",["compositionend","keypress","textInput","paste"]),f("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),f("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),f("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var so="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Sg=new Set("cancel close invalid load scroll toggle".split(" ").concat(so));function bd(e,t,r){var l=e.type||"unknown-event";e.currentTarget=r,km(l,t,void 0,e),e.currentTarget=null}function wd(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var l=e[r],a=l.event;l=l.listeners;e:{var c=void 0;if(t)for(var p=l.length-1;0<=p;p--){var y=l[p],k=y.instance,L=y.currentTarget;if(y=y.listener,k!==c&&a.isPropagationStopped())break e;bd(a,y,L),c=k}else for(p=0;p<l.length;p++){if(y=l[p],k=y.instance,L=y.currentTarget,y=y.listener,k!==c&&a.isPropagationStopped())break e;bd(a,y,L),c=k}}}if(Qo)throw e=Ti,Qo=!1,Ti=null,e}function Ue(e,t){var r=t[da];r===void 0&&(r=t[da]=new Set);var l=e+"__bubble";r.has(l)||(jd(t,e,2,!1),r.add(l))}function sa(e,t,r){var l=0;t&&(l|=4),jd(r,e,l,t)}var dl="_reactListening"+Math.random().toString(36).slice(2);function oo(e){if(!e[dl]){e[dl]=!0,u.forEach(function(r){r!=="selectionchange"&&(Sg.has(r)||sa(r,!1,e),sa(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[dl]||(t[dl]=!0,sa("selectionchange",!1,t))}}function jd(e,t,r,l){switch(Vc(t)){case 1:var a=Fm;break;case 4:a=Um;break;default:a=$i}r=a.bind(null,t,r,e),a=void 0,!Di||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(a=!0),l?a!==void 0?e.addEventListener(t,r,{capture:!0,passive:a}):e.addEventListener(t,r,!0):a!==void 0?e.addEventListener(t,r,{passive:a}):e.addEventListener(t,r,!1)}function oa(e,t,r,l,a){var c=l;if((t&1)===0&&(t&2)===0&&l!==null)e:for(;;){if(l===null)return;var p=l.tag;if(p===3||p===4){var y=l.stateNode.containerInfo;if(y===a||y.nodeType===8&&y.parentNode===a)break;if(p===4)for(p=l.return;p!==null;){var k=p.tag;if((k===3||k===4)&&(k=p.stateNode.containerInfo,k===a||k.nodeType===8&&k.parentNode===a))return;p=p.return}for(;y!==null;){if(p=un(y),p===null)return;if(k=p.tag,k===5||k===6){l=c=p;continue e}y=y.parentNode}}l=l.return}Ec(function(){var L=c,W=Mi(r),V=[];e:{var B=yd.get(e);if(B!==void 0){var re=Wi,ae=e;switch(e){case"keypress":if(ol(r)===0)break e;case"keydown":case"keyup":re=tg;break;case"focusin":ae="focus",re=Ki;break;case"focusout":ae="blur",re=Ki;break;case"beforeblur":case"afterblur":re=Ki;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":re=Qc;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":re=Hm;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":re=sg;break;case hd:case md:case gd:re=Gm;break;case xd:re=lg;break;case"scroll":re=$m;break;case"wheel":re=ag;break;case"copy":case"cut":case"paste":re=Qm;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":re=Zc}var de=(t&4)!==0,qe=!de&&e==="scroll",O=de?B!==null?B+"Capture":null:B;de=[];for(var E=L,T;E!==null;){T=E;var q=T.stateNode;if(T.tag===5&&q!==null&&(T=q,O!==null&&(q=$s(E,O),q!=null&&de.push(lo(E,q,T)))),qe)break;E=E.return}0<de.length&&(B=new re(B,ae,null,r,W),V.push({event:B,listeners:de}))}}if((t&7)===0){e:{if(B=e==="mouseover"||e==="pointerover",re=e==="mouseout"||e==="pointerout",B&&r!==_i&&(ae=r.relatedTarget||r.fromElement)&&(un(ae)||ae[cr]))break e;if((re||B)&&(B=W.window===W?W:(B=W.ownerDocument)?B.defaultView||B.parentWindow:window,re?(ae=r.relatedTarget||r.toElement,re=L,ae=ae?un(ae):null,ae!==null&&(qe=an(ae),ae!==qe||ae.tag!==5&&ae.tag!==6)&&(ae=null)):(re=null,ae=L),re!==ae)){if(de=Qc,q="onMouseLeave",O="onMouseEnter",E="mouse",(e==="pointerout"||e==="pointerover")&&(de=Zc,q="onPointerLeave",O="onPointerEnter",E="pointer"),qe=re==null?B:Yn(re),T=ae==null?B:Yn(ae),B=new de(q,E+"leave",re,r,W),B.target=qe,B.relatedTarget=T,q=null,un(W)===L&&(de=new de(O,E+"enter",ae,r,W),de.target=T,de.relatedTarget=qe,q=de),qe=q,re&&ae)t:{for(de=re,O=ae,E=0,T=de;T;T=qn(T))E++;for(T=0,q=O;q;q=qn(q))T++;for(;0<E-T;)de=qn(de),E--;for(;0<T-E;)O=qn(O),T--;for(;E--;){if(de===O||O!==null&&de===O.alternate)break t;de=qn(de),O=qn(O)}de=null}else de=null;re!==null&&kd(V,B,re,de,!1),ae!==null&&qe!==null&&kd(V,qe,ae,de,!0)}}e:{if(B=L?Yn(L):window,re=B.nodeName&&B.nodeName.toLowerCase(),re==="select"||re==="input"&&B.type==="file")var fe=mg;else if(rd(B))if(sd)fe=vg;else{fe=xg;var ge=gg}else(re=B.nodeName)&&re.toLowerCase()==="input"&&(B.type==="checkbox"||B.type==="radio")&&(fe=yg);if(fe&&(fe=fe(e,L))){nd(V,fe,r,W);break e}ge&&ge(e,B,L),e==="focusout"&&(ge=B._wrapperState)&&ge.controlled&&B.type==="number"&&Un(B,"number",B.value)}switch(ge=L?Yn(L):window,e){case"focusin":(rd(ge)||ge.contentEditable==="true")&&(Kn=ge,Xi=L,no=null);break;case"focusout":no=Xi=Kn=null;break;case"mousedown":ea=!0;break;case"contextmenu":case"mouseup":case"dragend":ea=!1,fd(V,r,W);break;case"selectionchange":if(jg)break;case"keydown":case"keyup":fd(V,r,W)}var xe;if(qi)e:{switch(e){case"compositionstart":var je="onCompositionStart";break e;case"compositionend":je="onCompositionEnd";break e;case"compositionupdate":je="onCompositionUpdate";break e}je=void 0}else Gn?ed(e,r)&&(je="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(je="onCompositionStart");je&&(Yc&&r.locale!=="ko"&&(Gn||je!=="onCompositionStart"?je==="onCompositionEnd"&&Gn&&(xe=Gc()):(Mr=W,Hi="value"in Mr?Mr.value:Mr.textContent,Gn=!0)),ge=fl(L,je),0<ge.length&&(je=new qc(je,e,null,r,W),V.push({event:je,listeners:ge}),xe?je.data=xe:(xe=td(r),xe!==null&&(je.data=xe)))),(xe=cg?dg(e,r):fg(e,r))&&(L=fl(L,"onBeforeInput"),0<L.length&&(W=new qc("onBeforeInput","beforeinput",null,r,W),V.push({event:W,listeners:L}),W.data=xe))}wd(V,t)})}function lo(e,t,r){return{instance:e,listener:t,currentTarget:r}}function fl(e,t){for(var r=t+"Capture",l=[];e!==null;){var a=e,c=a.stateNode;a.tag===5&&c!==null&&(a=c,c=$s(e,r),c!=null&&l.unshift(lo(e,c,a)),c=$s(e,t),c!=null&&l.push(lo(e,c,a))),e=e.return}return l}function qn(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function kd(e,t,r,l,a){for(var c=t._reactName,p=[];r!==null&&r!==l;){var y=r,k=y.alternate,L=y.stateNode;if(k!==null&&k===l)break;y.tag===5&&L!==null&&(y=L,a?(k=$s(r,c),k!=null&&p.unshift(lo(r,k,y))):a||(k=$s(r,c),k!=null&&p.push(lo(r,k,y)))),r=r.return}p.length!==0&&e.push({event:t,listeners:p})}var Cg=/\r\n?/g,Eg=/\u0000|\uFFFD/g;function Nd(e){return(typeof e=="string"?e:""+e).replace(Cg,`
`).replace(Eg,"")}function pl(e,t,r){if(t=Nd(t),Nd(e)!==t&&r)throw Error(i(425))}function hl(){}var la=null,ia=null;function aa(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var ua=typeof setTimeout=="function"?setTimeout:void 0,Pg=typeof clearTimeout=="function"?clearTimeout:void 0,Sd=typeof Promise=="function"?Promise:void 0,_g=typeof queueMicrotask=="function"?queueMicrotask:typeof Sd<"u"?function(e){return Sd.resolve(null).then(e).catch(Mg)}:ua;function Mg(e){setTimeout(function(){throw e})}function ca(e,t){var r=t,l=0;do{var a=r.nextSibling;if(e.removeChild(r),a&&a.nodeType===8)if(r=a.data,r==="/$"){if(l===0){e.removeChild(a),Zs(t);return}l--}else r!=="$"&&r!=="$?"&&r!=="$!"||l++;r=a}while(r);Zs(t)}function Or(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function Cd(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"){if(t===0)return e;t--}else r==="/$"&&t++}e=e.previousSibling}return null}var Zn=Math.random().toString(36).slice(2),Yt="__reactFiber$"+Zn,io="__reactProps$"+Zn,cr="__reactContainer$"+Zn,da="__reactEvents$"+Zn,Rg="__reactListeners$"+Zn,Og="__reactHandles$"+Zn;function un(e){var t=e[Yt];if(t)return t;for(var r=e.parentNode;r;){if(t=r[cr]||r[Yt]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=Cd(e);e!==null;){if(r=e[Yt])return r;e=Cd(e)}return t}e=r,r=e.parentNode}return null}function ao(e){return e=e[Yt]||e[cr],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Yn(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(i(33))}function ml(e){return e[io]||null}var fa=[],Jn=-1;function Dr(e){return{current:e}}function $e(e){0>Jn||(e.current=fa[Jn],fa[Jn]=null,Jn--)}function Fe(e,t){Jn++,fa[Jn]=e.current,e.current=t}var Tr={},it=Dr(Tr),gt=Dr(!1),cn=Tr;function Xn(e,t){var r=e.type.contextTypes;if(!r)return Tr;var l=e.stateNode;if(l&&l.__reactInternalMemoizedUnmaskedChildContext===t)return l.__reactInternalMemoizedMaskedChildContext;var a={},c;for(c in r)a[c]=t[c];return l&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=a),a}function xt(e){return e=e.childContextTypes,e!=null}function gl(){$e(gt),$e(it)}function Ed(e,t,r){if(it.current!==Tr)throw Error(i(168));Fe(it,t),Fe(gt,r)}function Pd(e,t,r){var l=e.stateNode;if(t=t.childContextTypes,typeof l.getChildContext!="function")return r;l=l.getChildContext();for(var a in l)if(!(a in t))throw Error(i(108,pe(e)||"Unknown",a));return Z({},r,l)}function xl(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Tr,cn=it.current,Fe(it,e),Fe(gt,gt.current),!0}function _d(e,t,r){var l=e.stateNode;if(!l)throw Error(i(169));r?(e=Pd(e,t,cn),l.__reactInternalMemoizedMergedChildContext=e,$e(gt),$e(it),Fe(it,e)):$e(gt),Fe(gt,r)}var dr=null,yl=!1,pa=!1;function Md(e){dr===null?dr=[e]:dr.push(e)}function Dg(e){yl=!0,Md(e)}function Ar(){if(!pa&&dr!==null){pa=!0;var e=0,t=ze;try{var r=dr;for(ze=1;e<r.length;e++){var l=r[e];do l=l(!0);while(l!==null)}dr=null,yl=!1}catch(a){throw dr!==null&&(dr=dr.slice(e+1)),Oc(Ai,Ar),a}finally{ze=t,pa=!1}}return null}var es=[],ts=0,vl=null,bl=0,Dt=[],Tt=0,dn=null,fr=1,pr="";function fn(e,t){es[ts++]=bl,es[ts++]=vl,vl=e,bl=t}function Rd(e,t,r){Dt[Tt++]=fr,Dt[Tt++]=pr,Dt[Tt++]=dn,dn=e;var l=fr;e=pr;var a=32-$t(l)-1;l&=~(1<<a),r+=1;var c=32-$t(t)+a;if(30<c){var p=a-a%5;c=(l&(1<<p)-1).toString(32),l>>=p,a-=p,fr=1<<32-$t(t)+a|r<<a|l,pr=c+e}else fr=1<<c|r<<a|l,pr=e}function ha(e){e.return!==null&&(fn(e,1),Rd(e,1,0))}function ma(e){for(;e===vl;)vl=es[--ts],es[ts]=null,bl=es[--ts],es[ts]=null;for(;e===dn;)dn=Dt[--Tt],Dt[Tt]=null,pr=Dt[--Tt],Dt[Tt]=null,fr=Dt[--Tt],Dt[Tt]=null}var Et=null,Pt=null,He=!1,Ht=null;function Od(e,t){var r=It(5,null,null,0);r.elementType="DELETED",r.stateNode=t,r.return=e,t=e.deletions,t===null?(e.deletions=[r],e.flags|=16):t.push(r)}function Dd(e,t){switch(e.tag){case 5:var r=e.type;return t=t.nodeType!==1||r.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Et=e,Pt=Or(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Et=e,Pt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=dn!==null?{id:fr,overflow:pr}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=It(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,Et=e,Pt=null,!0):!1;default:return!1}}function ga(e){return(e.mode&1)!==0&&(e.flags&128)===0}function xa(e){if(He){var t=Pt;if(t){var r=t;if(!Dd(e,t)){if(ga(e))throw Error(i(418));t=Or(r.nextSibling);var l=Et;t&&Dd(e,t)?Od(l,r):(e.flags=e.flags&-4097|2,He=!1,Et=e)}}else{if(ga(e))throw Error(i(418));e.flags=e.flags&-4097|2,He=!1,Et=e}}}function Td(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Et=e}function wl(e){if(e!==Et)return!1;if(!He)return Td(e),He=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!aa(e.type,e.memoizedProps)),t&&(t=Pt)){if(ga(e))throw Ad(),Error(i(418));for(;t;)Od(e,t),t=Or(t.nextSibling)}if(Td(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){Pt=Or(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}Pt=null}}else Pt=Et?Or(e.stateNode.nextSibling):null;return!0}function Ad(){for(var e=Pt;e;)e=Or(e.nextSibling)}function rs(){Pt=Et=null,He=!1}function ya(e){Ht===null?Ht=[e]:Ht.push(e)}var Tg=z.ReactCurrentBatchConfig;function uo(e,t,r){if(e=r.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(i(309));var l=r.stateNode}if(!l)throw Error(i(147,e));var a=l,c=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===c?t.ref:(t=function(p){var y=a.refs;p===null?delete y[c]:y[c]=p},t._stringRef=c,t)}if(typeof e!="string")throw Error(i(284));if(!r._owner)throw Error(i(290,e))}return e}function jl(e,t){throw e=Object.prototype.toString.call(t),Error(i(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function zd(e){var t=e._init;return t(e._payload)}function Ld(e){function t(O,E){if(e){var T=O.deletions;T===null?(O.deletions=[E],O.flags|=16):T.push(E)}}function r(O,E){if(!e)return null;for(;E!==null;)t(O,E),E=E.sibling;return null}function l(O,E){for(O=new Map;E!==null;)E.key!==null?O.set(E.key,E):O.set(E.index,E),E=E.sibling;return O}function a(O,E){return O=Hr(O,E),O.index=0,O.sibling=null,O}function c(O,E,T){return O.index=T,e?(T=O.alternate,T!==null?(T=T.index,T<E?(O.flags|=2,E):T):(O.flags|=2,E)):(O.flags|=1048576,E)}function p(O){return e&&O.alternate===null&&(O.flags|=2),O}function y(O,E,T,q){return E===null||E.tag!==6?(E=uu(T,O.mode,q),E.return=O,E):(E=a(E,T),E.return=O,E)}function k(O,E,T,q){var fe=T.type;return fe===K?W(O,E,T.props.children,q,T.key):E!==null&&(E.elementType===fe||typeof fe=="object"&&fe!==null&&fe.$$typeof===Te&&zd(fe)===E.type)?(q=a(E,T.props),q.ref=uo(O,E,T),q.return=O,q):(q=Gl(T.type,T.key,T.props,null,O.mode,q),q.ref=uo(O,E,T),q.return=O,q)}function L(O,E,T,q){return E===null||E.tag!==4||E.stateNode.containerInfo!==T.containerInfo||E.stateNode.implementation!==T.implementation?(E=cu(T,O.mode,q),E.return=O,E):(E=a(E,T.children||[]),E.return=O,E)}function W(O,E,T,q,fe){return E===null||E.tag!==7?(E=bn(T,O.mode,q,fe),E.return=O,E):(E=a(E,T),E.return=O,E)}function V(O,E,T){if(typeof E=="string"&&E!==""||typeof E=="number")return E=uu(""+E,O.mode,T),E.return=O,E;if(typeof E=="object"&&E!==null){switch(E.$$typeof){case R:return T=Gl(E.type,E.key,E.props,null,O.mode,T),T.ref=uo(O,null,E),T.return=O,T;case F:return E=cu(E,O.mode,T),E.return=O,E;case Te:var q=E._init;return V(O,q(E._payload),T)}if(Sr(E)||ce(E))return E=bn(E,O.mode,T,null),E.return=O,E;jl(O,E)}return null}function B(O,E,T,q){var fe=E!==null?E.key:null;if(typeof T=="string"&&T!==""||typeof T=="number")return fe!==null?null:y(O,E,""+T,q);if(typeof T=="object"&&T!==null){switch(T.$$typeof){case R:return T.key===fe?k(O,E,T,q):null;case F:return T.key===fe?L(O,E,T,q):null;case Te:return fe=T._init,B(O,E,fe(T._payload),q)}if(Sr(T)||ce(T))return fe!==null?null:W(O,E,T,q,null);jl(O,T)}return null}function re(O,E,T,q,fe){if(typeof q=="string"&&q!==""||typeof q=="number")return O=O.get(T)||null,y(E,O,""+q,fe);if(typeof q=="object"&&q!==null){switch(q.$$typeof){case R:return O=O.get(q.key===null?T:q.key)||null,k(E,O,q,fe);case F:return O=O.get(q.key===null?T:q.key)||null,L(E,O,q,fe);case Te:var ge=q._init;return re(O,E,T,ge(q._payload),fe)}if(Sr(q)||ce(q))return O=O.get(T)||null,W(E,O,q,fe,null);jl(E,q)}return null}function ae(O,E,T,q){for(var fe=null,ge=null,xe=E,je=E=0,tt=null;xe!==null&&je<T.length;je++){xe.index>je?(tt=xe,xe=null):tt=xe.sibling;var De=B(O,xe,T[je],q);if(De===null){xe===null&&(xe=tt);break}e&&xe&&De.alternate===null&&t(O,xe),E=c(De,E,je),ge===null?fe=De:ge.sibling=De,ge=De,xe=tt}if(je===T.length)return r(O,xe),He&&fn(O,je),fe;if(xe===null){for(;je<T.length;je++)xe=V(O,T[je],q),xe!==null&&(E=c(xe,E,je),ge===null?fe=xe:ge.sibling=xe,ge=xe);return He&&fn(O,je),fe}for(xe=l(O,xe);je<T.length;je++)tt=re(xe,O,je,T[je],q),tt!==null&&(e&&tt.alternate!==null&&xe.delete(tt.key===null?je:tt.key),E=c(tt,E,je),ge===null?fe=tt:ge.sibling=tt,ge=tt);return e&&xe.forEach(function(Wr){return t(O,Wr)}),He&&fn(O,je),fe}function de(O,E,T,q){var fe=ce(T);if(typeof fe!="function")throw Error(i(150));if(T=fe.call(T),T==null)throw Error(i(151));for(var ge=fe=null,xe=E,je=E=0,tt=null,De=T.next();xe!==null&&!De.done;je++,De=T.next()){xe.index>je?(tt=xe,xe=null):tt=xe.sibling;var Wr=B(O,xe,De.value,q);if(Wr===null){xe===null&&(xe=tt);break}e&&xe&&Wr.alternate===null&&t(O,xe),E=c(Wr,E,je),ge===null?fe=Wr:ge.sibling=Wr,ge=Wr,xe=tt}if(De.done)return r(O,xe),He&&fn(O,je),fe;if(xe===null){for(;!De.done;je++,De=T.next())De=V(O,De.value,q),De!==null&&(E=c(De,E,je),ge===null?fe=De:ge.sibling=De,ge=De);return He&&fn(O,je),fe}for(xe=l(O,xe);!De.done;je++,De=T.next())De=re(xe,O,je,De.value,q),De!==null&&(e&&De.alternate!==null&&xe.delete(De.key===null?je:De.key),E=c(De,E,je),ge===null?fe=De:ge.sibling=De,ge=De);return e&&xe.forEach(function(px){return t(O,px)}),He&&fn(O,je),fe}function qe(O,E,T,q){if(typeof T=="object"&&T!==null&&T.type===K&&T.key===null&&(T=T.props.children),typeof T=="object"&&T!==null){switch(T.$$typeof){case R:e:{for(var fe=T.key,ge=E;ge!==null;){if(ge.key===fe){if(fe=T.type,fe===K){if(ge.tag===7){r(O,ge.sibling),E=a(ge,T.props.children),E.return=O,O=E;break e}}else if(ge.elementType===fe||typeof fe=="object"&&fe!==null&&fe.$$typeof===Te&&zd(fe)===ge.type){r(O,ge.sibling),E=a(ge,T.props),E.ref=uo(O,ge,T),E.return=O,O=E;break e}r(O,ge);break}else t(O,ge);ge=ge.sibling}T.type===K?(E=bn(T.props.children,O.mode,q,T.key),E.return=O,O=E):(q=Gl(T.type,T.key,T.props,null,O.mode,q),q.ref=uo(O,E,T),q.return=O,O=q)}return p(O);case F:e:{for(ge=T.key;E!==null;){if(E.key===ge)if(E.tag===4&&E.stateNode.containerInfo===T.containerInfo&&E.stateNode.implementation===T.implementation){r(O,E.sibling),E=a(E,T.children||[]),E.return=O,O=E;break e}else{r(O,E);break}else t(O,E);E=E.sibling}E=cu(T,O.mode,q),E.return=O,O=E}return p(O);case Te:return ge=T._init,qe(O,E,ge(T._payload),q)}if(Sr(T))return ae(O,E,T,q);if(ce(T))return de(O,E,T,q);jl(O,T)}return typeof T=="string"&&T!==""||typeof T=="number"?(T=""+T,E!==null&&E.tag===6?(r(O,E.sibling),E=a(E,T),E.return=O,O=E):(r(O,E),E=uu(T,O.mode,q),E.return=O,O=E),p(O)):r(O,E)}return qe}var ns=Ld(!0),Id=Ld(!1),kl=Dr(null),Nl=null,ss=null,va=null;function ba(){va=ss=Nl=null}function wa(e){var t=kl.current;$e(kl),e._currentValue=t}function ja(e,t,r){for(;e!==null;){var l=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,l!==null&&(l.childLanes|=t)):l!==null&&(l.childLanes&t)!==t&&(l.childLanes|=t),e===r)break;e=e.return}}function os(e,t){Nl=e,va=ss=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(yt=!0),e.firstContext=null)}function At(e){var t=e._currentValue;if(va!==e)if(e={context:e,memoizedValue:t,next:null},ss===null){if(Nl===null)throw Error(i(308));ss=e,Nl.dependencies={lanes:0,firstContext:e}}else ss=ss.next=e;return t}var pn=null;function ka(e){pn===null?pn=[e]:pn.push(e)}function Fd(e,t,r,l){var a=t.interleaved;return a===null?(r.next=r,ka(t)):(r.next=a.next,a.next=r),t.interleaved=r,hr(e,l)}function hr(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 zr=!1;function Na(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Ud(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 mr(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Lr(e,t,r){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(Re&2)!==0){var a=l.pending;return a===null?t.next=t:(t.next=a.next,a.next=t),l.pending=t,hr(e,r)}return a=l.interleaved,a===null?(t.next=t,ka(l)):(t.next=a.next,a.next=t),l.interleaved=t,hr(e,r)}function Sl(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var l=t.lanes;l&=e.pendingLanes,r|=l,t.lanes=r,Ii(e,r)}}function $d(e,t){var r=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,r===l)){var a=null,c=null;if(r=r.firstBaseUpdate,r!==null){do{var p={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};c===null?a=c=p:c=c.next=p,r=r.next}while(r!==null);c===null?a=c=t:c=c.next=t}else a=c=t;r={baseState:l.baseState,firstBaseUpdate:a,lastBaseUpdate:c,shared:l.shared,effects:l.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function Cl(e,t,r,l){var a=e.updateQueue;zr=!1;var c=a.firstBaseUpdate,p=a.lastBaseUpdate,y=a.shared.pending;if(y!==null){a.shared.pending=null;var k=y,L=k.next;k.next=null,p===null?c=L:p.next=L,p=k;var W=e.alternate;W!==null&&(W=W.updateQueue,y=W.lastBaseUpdate,y!==p&&(y===null?W.firstBaseUpdate=L:y.next=L,W.lastBaseUpdate=k))}if(c!==null){var V=a.baseState;p=0,W=L=k=null,y=c;do{var B=y.lane,re=y.eventTime;if((l&B)===B){W!==null&&(W=W.next={eventTime:re,lane:0,tag:y.tag,payload:y.payload,callback:y.callback,next:null});e:{var ae=e,de=y;switch(B=t,re=r,de.tag){case 1:if(ae=de.payload,typeof ae=="function"){V=ae.call(re,V,B);break e}V=ae;break e;case 3:ae.flags=ae.flags&-65537|128;case 0:if(ae=de.payload,B=typeof ae=="function"?ae.call(re,V,B):ae,B==null)break e;V=Z({},V,B);break e;case 2:zr=!0}}y.callback!==null&&y.lane!==0&&(e.flags|=64,B=a.effects,B===null?a.effects=[y]:B.push(y))}else re={eventTime:re,lane:B,tag:y.tag,payload:y.payload,callback:y.callback,next:null},W===null?(L=W=re,k=V):W=W.next=re,p|=B;if(y=y.next,y===null){if(y=a.shared.pending,y===null)break;B=y,y=B.next,B.next=null,a.lastBaseUpdate=B,a.shared.pending=null}}while(!0);if(W===null&&(k=V),a.baseState=k,a.firstBaseUpdate=L,a.lastBaseUpdate=W,t=a.shared.interleaved,t!==null){a=t;do p|=a.lane,a=a.next;while(a!==t)}else c===null&&(a.shared.lanes=0);gn|=p,e.lanes=p,e.memoizedState=V}}function Bd(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var l=e[t],a=l.callback;if(a!==null){if(l.callback=null,l=r,typeof a!="function")throw Error(i(191,a));a.call(l)}}}var co={},Jt=Dr(co),fo=Dr(co),po=Dr(co);function hn(e){if(e===co)throw Error(i(174));return e}function Sa(e,t){switch(Fe(po,t),Fe(fo,e),Fe(Jt,co),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Ee(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Ee(t,e)}$e(Jt),Fe(Jt,t)}function ls(){$e(Jt),$e(fo),$e(po)}function Hd(e){hn(po.current);var t=hn(Jt.current),r=Ee(t,e.type);t!==r&&(Fe(fo,e),Fe(Jt,r))}function Ca(e){fo.current===e&&($e(Jt),$e(fo))}var We=Dr(0);function El(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Ea=[];function Pa(){for(var e=0;e<Ea.length;e++)Ea[e]._workInProgressVersionPrimary=null;Ea.length=0}var Pl=z.ReactCurrentDispatcher,_a=z.ReactCurrentBatchConfig,mn=0,Ve=null,Ye=null,Xe=null,_l=!1,ho=!1,mo=0,Ag=0;function at(){throw Error(i(321))}function Ma(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!Bt(e[r],t[r]))return!1;return!0}function Ra(e,t,r,l,a,c){if(mn=c,Ve=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Pl.current=e===null||e.memoizedState===null?Fg:Ug,e=r(l,a),ho){c=0;do{if(ho=!1,mo=0,25<=c)throw Error(i(301));c+=1,Xe=Ye=null,t.updateQueue=null,Pl.current=$g,e=r(l,a)}while(ho)}if(Pl.current=Ol,t=Ye!==null&&Ye.next!==null,mn=0,Xe=Ye=Ve=null,_l=!1,t)throw Error(i(300));return e}function Oa(){var e=mo!==0;return mo=0,e}function Xt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Xe===null?Ve.memoizedState=Xe=e:Xe=Xe.next=e,Xe}function zt(){if(Ye===null){var e=Ve.alternate;e=e!==null?e.memoizedState:null}else e=Ye.next;var t=Xe===null?Ve.memoizedState:Xe.next;if(t!==null)Xe=t,Ye=e;else{if(e===null)throw Error(i(310));Ye=e,e={memoizedState:Ye.memoizedState,baseState:Ye.baseState,baseQueue:Ye.baseQueue,queue:Ye.queue,next:null},Xe===null?Ve.memoizedState=Xe=e:Xe=Xe.next=e}return Xe}function go(e,t){return typeof t=="function"?t(e):t}function Da(e){var t=zt(),r=t.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=e;var l=Ye,a=l.baseQueue,c=r.pending;if(c!==null){if(a!==null){var p=a.next;a.next=c.next,c.next=p}l.baseQueue=a=c,r.pending=null}if(a!==null){c=a.next,l=l.baseState;var y=p=null,k=null,L=c;do{var W=L.lane;if((mn&W)===W)k!==null&&(k=k.next={lane:0,action:L.action,hasEagerState:L.hasEagerState,eagerState:L.eagerState,next:null}),l=L.hasEagerState?L.eagerState:e(l,L.action);else{var V={lane:W,action:L.action,hasEagerState:L.hasEagerState,eagerState:L.eagerState,next:null};k===null?(y=k=V,p=l):k=k.next=V,Ve.lanes|=W,gn|=W}L=L.next}while(L!==null&&L!==c);k===null?p=l:k.next=y,Bt(l,t.memoizedState)||(yt=!0),t.memoizedState=l,t.baseState=p,t.baseQueue=k,r.lastRenderedState=l}if(e=r.interleaved,e!==null){a=e;do c=a.lane,Ve.lanes|=c,gn|=c,a=a.next;while(a!==e)}else a===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function Ta(e){var t=zt(),r=t.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=e;var l=r.dispatch,a=r.pending,c=t.memoizedState;if(a!==null){r.pending=null;var p=a=a.next;do c=e(c,p.action),p=p.next;while(p!==a);Bt(c,t.memoizedState)||(yt=!0),t.memoizedState=c,t.baseQueue===null&&(t.baseState=c),r.lastRenderedState=c}return[c,l]}function Wd(){}function Vd(e,t){var r=Ve,l=zt(),a=t(),c=!Bt(l.memoizedState,a);if(c&&(l.memoizedState=a,yt=!0),l=l.queue,Aa(Qd.bind(null,r,l,e),[e]),l.getSnapshot!==t||c||Xe!==null&&Xe.memoizedState.tag&1){if(r.flags|=2048,xo(9,Kd.bind(null,r,l,a,t),void 0,null),et===null)throw Error(i(349));(mn&30)!==0||Gd(r,t,a)}return a}function Gd(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=Ve.updateQueue,t===null?(t={lastEffect:null,stores:null},Ve.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function Kd(e,t,r,l){t.value=r,t.getSnapshot=l,qd(t)&&Zd(e)}function Qd(e,t,r){return r(function(){qd(t)&&Zd(e)})}function qd(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!Bt(e,r)}catch{return!0}}function Zd(e){var t=hr(e,1);t!==null&&Kt(t,e,1,-1)}function Yd(e){var t=Xt();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:go,lastRenderedState:e},t.queue=e,e=e.dispatch=Ig.bind(null,Ve,e),[t.memoizedState,e]}function xo(e,t,r,l){return e={tag:e,create:t,destroy:r,deps:l,next:null},t=Ve.updateQueue,t===null?(t={lastEffect:null,stores:null},Ve.updateQueue=t,t.lastEffect=e.next=e):(r=t.lastEffect,r===null?t.lastEffect=e.next=e:(l=r.next,r.next=e,e.next=l,t.lastEffect=e)),e}function Jd(){return zt().memoizedState}function Ml(e,t,r,l){var a=Xt();Ve.flags|=e,a.memoizedState=xo(1|t,r,void 0,l===void 0?null:l)}function Rl(e,t,r,l){var a=zt();l=l===void 0?null:l;var c=void 0;if(Ye!==null){var p=Ye.memoizedState;if(c=p.destroy,l!==null&&Ma(l,p.deps)){a.memoizedState=xo(t,r,c,l);return}}Ve.flags|=e,a.memoizedState=xo(1|t,r,c,l)}function Xd(e,t){return Ml(8390656,8,e,t)}function Aa(e,t){return Rl(2048,8,e,t)}function ef(e,t){return Rl(4,2,e,t)}function tf(e,t){return Rl(4,4,e,t)}function rf(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function nf(e,t,r){return r=r!=null?r.concat([e]):null,Rl(4,4,rf.bind(null,t,e),r)}function za(){}function sf(e,t){var r=zt();t=t===void 0?null:t;var l=r.memoizedState;return l!==null&&t!==null&&Ma(t,l[1])?l[0]:(r.memoizedState=[e,t],e)}function of(e,t){var r=zt();t=t===void 0?null:t;var l=r.memoizedState;return l!==null&&t!==null&&Ma(t,l[1])?l[0]:(e=e(),r.memoizedState=[e,t],e)}function lf(e,t,r){return(mn&21)===0?(e.baseState&&(e.baseState=!1,yt=!0),e.memoizedState=r):(Bt(r,t)||(r=zc(),Ve.lanes|=r,gn|=r,e.baseState=!0),t)}function zg(e,t){var r=ze;ze=r!==0&&4>r?r:4,e(!0);var l=_a.transition;_a.transition={};try{e(!1),t()}finally{ze=r,_a.transition=l}}function af(){return zt().memoizedState}function Lg(e,t,r){var l=$r(e);if(r={lane:l,action:r,hasEagerState:!1,eagerState:null,next:null},uf(e))cf(t,r);else if(r=Fd(e,t,r,l),r!==null){var a=pt();Kt(r,e,l,a),df(r,t,l)}}function Ig(e,t,r){var l=$r(e),a={lane:l,action:r,hasEagerState:!1,eagerState:null,next:null};if(uf(e))cf(t,a);else{var c=e.alternate;if(e.lanes===0&&(c===null||c.lanes===0)&&(c=t.lastRenderedReducer,c!==null))try{var p=t.lastRenderedState,y=c(p,r);if(a.hasEagerState=!0,a.eagerState=y,Bt(y,p)){var k=t.interleaved;k===null?(a.next=a,ka(t)):(a.next=k.next,k.next=a),t.interleaved=a;return}}catch{}finally{}r=Fd(e,t,a,l),r!==null&&(a=pt(),Kt(r,e,l,a),df(r,t,l))}}function uf(e){var t=e.alternate;return e===Ve||t!==null&&t===Ve}function cf(e,t){ho=_l=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function df(e,t,r){if((r&4194240)!==0){var l=t.lanes;l&=e.pendingLanes,r|=l,t.lanes=r,Ii(e,r)}}var Ol={readContext:At,useCallback:at,useContext:at,useEffect:at,useImperativeHandle:at,useInsertionEffect:at,useLayoutEffect:at,useMemo:at,useReducer:at,useRef:at,useState:at,useDebugValue:at,useDeferredValue:at,useTransition:at,useMutableSource:at,useSyncExternalStore:at,useId:at,unstable_isNewReconciler:!1},Fg={readContext:At,useCallback:function(e,t){return Xt().memoizedState=[e,t===void 0?null:t],e},useContext:At,useEffect:Xd,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,Ml(4194308,4,rf.bind(null,t,e),r)},useLayoutEffect:function(e,t){return Ml(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ml(4,2,e,t)},useMemo:function(e,t){var r=Xt();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var l=Xt();return t=r!==void 0?r(t):t,l.memoizedState=l.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},l.queue=e,e=e.dispatch=Lg.bind(null,Ve,e),[l.memoizedState,e]},useRef:function(e){var t=Xt();return e={current:e},t.memoizedState=e},useState:Yd,useDebugValue:za,useDeferredValue:function(e){return Xt().memoizedState=e},useTransition:function(){var e=Yd(!1),t=e[0];return e=zg.bind(null,e[1]),Xt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var l=Ve,a=Xt();if(He){if(r===void 0)throw Error(i(407));r=r()}else{if(r=t(),et===null)throw Error(i(349));(mn&30)!==0||Gd(l,t,r)}a.memoizedState=r;var c={value:r,getSnapshot:t};return a.queue=c,Xd(Qd.bind(null,l,c,e),[e]),l.flags|=2048,xo(9,Kd.bind(null,l,c,r,t),void 0,null),r},useId:function(){var e=Xt(),t=et.identifierPrefix;if(He){var r=pr,l=fr;r=(l&~(1<<32-$t(l)-1)).toString(32)+r,t=":"+t+"R"+r,r=mo++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=Ag++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Ug={readContext:At,useCallback:sf,useContext:At,useEffect:Aa,useImperativeHandle:nf,useInsertionEffect:ef,useLayoutEffect:tf,useMemo:of,useReducer:Da,useRef:Jd,useState:function(){return Da(go)},useDebugValue:za,useDeferredValue:function(e){var t=zt();return lf(t,Ye.memoizedState,e)},useTransition:function(){var e=Da(go)[0],t=zt().memoizedState;return[e,t]},useMutableSource:Wd,useSyncExternalStore:Vd,useId:af,unstable_isNewReconciler:!1},$g={readContext:At,useCallback:sf,useContext:At,useEffect:Aa,useImperativeHandle:nf,useInsertionEffect:ef,useLayoutEffect:tf,useMemo:of,useReducer:Ta,useRef:Jd,useState:function(){return Ta(go)},useDebugValue:za,useDeferredValue:function(e){var t=zt();return Ye===null?t.memoizedState=e:lf(t,Ye.memoizedState,e)},useTransition:function(){var e=Ta(go)[0],t=zt().memoizedState;return[e,t]},useMutableSource:Wd,useSyncExternalStore:Vd,useId:af,unstable_isNewReconciler:!1};function Wt(e,t){if(e&&e.defaultProps){t=Z({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}function La(e,t,r,l){t=e.memoizedState,r=r(l,t),r=r==null?t:Z({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var Dl={isMounted:function(e){return(e=e._reactInternals)?an(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var l=pt(),a=$r(e),c=mr(l,a);c.payload=t,r!=null&&(c.callback=r),t=Lr(e,c,a),t!==null&&(Kt(t,e,a,l),Sl(t,e,a))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var l=pt(),a=$r(e),c=mr(l,a);c.tag=1,c.payload=t,r!=null&&(c.callback=r),t=Lr(e,c,a),t!==null&&(Kt(t,e,a,l),Sl(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=pt(),l=$r(e),a=mr(r,l);a.tag=2,t!=null&&(a.callback=t),t=Lr(e,a,l),t!==null&&(Kt(t,e,l,r),Sl(t,e,l))}};function ff(e,t,r,l,a,c,p){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,c,p):t.prototype&&t.prototype.isPureReactComponent?!ro(r,l)||!ro(a,c):!0}function pf(e,t,r){var l=!1,a=Tr,c=t.contextType;return typeof c=="object"&&c!==null?c=At(c):(a=xt(t)?cn:it.current,l=t.contextTypes,c=(l=l!=null)?Xn(e,a):Tr),t=new t(r,c),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Dl,e.stateNode=t,t._reactInternals=e,l&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=a,e.__reactInternalMemoizedMaskedChildContext=c),t}function hf(e,t,r,l){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,l),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,l),t.state!==e&&Dl.enqueueReplaceState(t,t.state,null)}function Ia(e,t,r,l){var a=e.stateNode;a.props=r,a.state=e.memoizedState,a.refs={},Na(e);var c=t.contextType;typeof c=="object"&&c!==null?a.context=At(c):(c=xt(t)?cn:it.current,a.context=Xn(e,c)),a.state=e.memoizedState,c=t.getDerivedStateFromProps,typeof c=="function"&&(La(e,t,c,r),a.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof a.getSnapshotBeforeUpdate=="function"||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(t=a.state,typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount(),t!==a.state&&Dl.enqueueReplaceState(a,a.state,null),Cl(e,r,a,l),a.state=e.memoizedState),typeof a.componentDidMount=="function"&&(e.flags|=4194308)}function is(e,t){try{var r="",l=t;do r+=Y(l),l=l.return;while(l);var a=r}catch(c){a=`
Error generating stack: `+c.message+`
`+c.stack}return{value:e,source:t,stack:a,digest:null}}function Fa(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function Ua(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var Bg=typeof WeakMap=="function"?WeakMap:Map;function mf(e,t,r){r=mr(-1,r),r.tag=3,r.payload={element:null};var l=t.value;return r.callback=function(){Ul||(Ul=!0,tu=l),Ua(e,t)},r}function gf(e,t,r){r=mr(-1,r),r.tag=3;var l=e.type.getDerivedStateFromError;if(typeof l=="function"){var a=t.value;r.payload=function(){return l(a)},r.callback=function(){Ua(e,t)}}var c=e.stateNode;return c!==null&&typeof c.componentDidCatch=="function"&&(r.callback=function(){Ua(e,t),typeof l!="function"&&(Fr===null?Fr=new Set([this]):Fr.add(this));var p=t.stack;this.componentDidCatch(t.value,{componentStack:p!==null?p:""})}),r}function xf(e,t,r){var l=e.pingCache;if(l===null){l=e.pingCache=new Bg;var a=new Set;l.set(t,a)}else a=l.get(t),a===void 0&&(a=new Set,l.set(t,a));a.has(r)||(a.add(r),e=rx.bind(null,e,t,r),t.then(e,e))}function yf(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function vf(e,t,r,l,a){return(e.mode&1)===0?(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(t=mr(-1,1),t.tag=2,Lr(r,t,1))),r.lanes|=1),e):(e.flags|=65536,e.lanes=a,e)}var Hg=z.ReactCurrentOwner,yt=!1;function ft(e,t,r,l){t.child=e===null?Id(t,null,r,l):ns(t,e.child,r,l)}function bf(e,t,r,l,a){r=r.render;var c=t.ref;return os(t,a),l=Ra(e,t,r,l,c,a),r=Oa(),e!==null&&!yt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,gr(e,t,a)):(He&&r&&ha(t),t.flags|=1,ft(e,t,l,a),t.child)}function wf(e,t,r,l,a){if(e===null){var c=r.type;return typeof c=="function"&&!au(c)&&c.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=c,jf(e,t,c,l,a)):(e=Gl(r.type,null,l,t,t.mode,a),e.ref=t.ref,e.return=t,t.child=e)}if(c=e.child,(e.lanes&a)===0){var p=c.memoizedProps;if(r=r.compare,r=r!==null?r:ro,r(p,l)&&e.ref===t.ref)return gr(e,t,a)}return t.flags|=1,e=Hr(c,l),e.ref=t.ref,e.return=t,t.child=e}function jf(e,t,r,l,a){if(e!==null){var c=e.memoizedProps;if(ro(c,l)&&e.ref===t.ref)if(yt=!1,t.pendingProps=l=c,(e.lanes&a)!==0)(e.flags&131072)!==0&&(yt=!0);else return t.lanes=e.lanes,gr(e,t,a)}return $a(e,t,r,l,a)}function kf(e,t,r){var l=t.pendingProps,a=l.children,c=e!==null?e.memoizedState:null;if(l.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Fe(us,_t),_t|=r;else{if((r&1073741824)===0)return e=c!==null?c.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Fe(us,_t),_t|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},l=c!==null?c.baseLanes:r,Fe(us,_t),_t|=l}else c!==null?(l=c.baseLanes|r,t.memoizedState=null):l=r,Fe(us,_t),_t|=l;return ft(e,t,a,r),t.child}function Nf(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function $a(e,t,r,l,a){var c=xt(r)?cn:it.current;return c=Xn(t,c),os(t,a),r=Ra(e,t,r,l,c,a),l=Oa(),e!==null&&!yt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,gr(e,t,a)):(He&&l&&ha(t),t.flags|=1,ft(e,t,r,a),t.child)}function Sf(e,t,r,l,a){if(xt(r)){var c=!0;xl(t)}else c=!1;if(os(t,a),t.stateNode===null)Al(e,t),pf(t,r,l),Ia(t,r,l,a),l=!0;else if(e===null){var p=t.stateNode,y=t.memoizedProps;p.props=y;var k=p.context,L=r.contextType;typeof L=="object"&&L!==null?L=At(L):(L=xt(r)?cn:it.current,L=Xn(t,L));var W=r.getDerivedStateFromProps,V=typeof W=="function"||typeof p.getSnapshotBeforeUpdate=="function";V||typeof p.UNSAFE_componentWillReceiveProps!="function"&&typeof p.componentWillReceiveProps!="function"||(y!==l||k!==L)&&hf(t,p,l,L),zr=!1;var B=t.memoizedState;p.state=B,Cl(t,l,p,a),k=t.memoizedState,y!==l||B!==k||gt.current||zr?(typeof W=="function"&&(La(t,r,W,l),k=t.memoizedState),(y=zr||ff(t,r,y,l,B,k,L))?(V||typeof p.UNSAFE_componentWillMount!="function"&&typeof p.componentWillMount!="function"||(typeof p.componentWillMount=="function"&&p.componentWillMount(),typeof p.UNSAFE_componentWillMount=="function"&&p.UNSAFE_componentWillMount()),typeof p.componentDidMount=="function"&&(t.flags|=4194308)):(typeof p.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=k),p.props=l,p.state=k,p.context=L,l=y):(typeof p.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{p=t.stateNode,Ud(e,t),y=t.memoizedProps,L=t.type===t.elementType?y:Wt(t.type,y),p.props=L,V=t.pendingProps,B=p.context,k=r.contextType,typeof k=="object"&&k!==null?k=At(k):(k=xt(r)?cn:it.current,k=Xn(t,k));var re=r.getDerivedStateFromProps;(W=typeof re=="function"||typeof p.getSnapshotBeforeUpdate=="function")||typeof p.UNSAFE_componentWillReceiveProps!="function"&&typeof p.componentWillReceiveProps!="function"||(y!==V||B!==k)&&hf(t,p,l,k),zr=!1,B=t.memoizedState,p.state=B,Cl(t,l,p,a);var ae=t.memoizedState;y!==V||B!==ae||gt.current||zr?(typeof re=="function"&&(La(t,r,re,l),ae=t.memoizedState),(L=zr||ff(t,r,L,l,B,ae,k)||!1)?(W||typeof p.UNSAFE_componentWillUpdate!="function"&&typeof p.componentWillUpdate!="function"||(typeof p.componentWillUpdate=="function"&&p.componentWillUpdate(l,ae,k),typeof p.UNSAFE_componentWillUpdate=="function"&&p.UNSAFE_componentWillUpdate(l,ae,k)),typeof p.componentDidUpdate=="function"&&(t.flags|=4),typeof p.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof p.componentDidUpdate!="function"||y===e.memoizedProps&&B===e.memoizedState||(t.flags|=4),typeof p.getSnapshotBeforeUpdate!="function"||y===e.memoizedProps&&B===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=ae),p.props=l,p.state=ae,p.context=k,l=L):(typeof p.componentDidUpdate!="function"||y===e.memoizedProps&&B===e.memoizedState||(t.flags|=4),typeof p.getSnapshotBeforeUpdate!="function"||y===e.memoizedProps&&B===e.memoizedState||(t.flags|=1024),l=!1)}return Ba(e,t,r,l,c,a)}function Ba(e,t,r,l,a,c){Nf(e,t);var p=(t.flags&128)!==0;if(!l&&!p)return a&&_d(t,r,!1),gr(e,t,c);l=t.stateNode,Hg.current=t;var y=p&&typeof r.getDerivedStateFromError!="function"?null:l.render();return t.flags|=1,e!==null&&p?(t.child=ns(t,e.child,null,c),t.child=ns(t,null,y,c)):ft(e,t,y,c),t.memoizedState=l.state,a&&_d(t,r,!0),t.child}function Cf(e){var t=e.stateNode;t.pendingContext?Ed(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Ed(e,t.context,!1),Sa(e,t.containerInfo)}function Ef(e,t,r,l,a){return rs(),ya(a),t.flags|=256,ft(e,t,r,l),t.child}var Ha={dehydrated:null,treeContext:null,retryLane:0};function Wa(e){return{baseLanes:e,cachePool:null,transitions:null}}function Pf(e,t,r){var l=t.pendingProps,a=We.current,c=!1,p=(t.flags&128)!==0,y;if((y=p)||(y=e!==null&&e.memoizedState===null?!1:(a&2)!==0),y?(c=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(a|=1),Fe(We,a&1),e===null)return xa(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?((t.mode&1)===0?t.lanes=1:e.data==="$!"?t.lanes=8:t.lanes=1073741824,null):(p=l.children,e=l.fallback,c?(l=t.mode,c=t.child,p={mode:"hidden",children:p},(l&1)===0&&c!==null?(c.childLanes=0,c.pendingProps=p):c=Kl(p,l,0,null),e=bn(e,l,r,null),c.return=t,e.return=t,c.sibling=e,t.child=c,t.child.memoizedState=Wa(r),t.memoizedState=Ha,e):Va(t,p));if(a=e.memoizedState,a!==null&&(y=a.dehydrated,y!==null))return Wg(e,t,p,l,y,a,r);if(c){c=l.fallback,p=t.mode,a=e.child,y=a.sibling;var k={mode:"hidden",children:l.children};return(p&1)===0&&t.child!==a?(l=t.child,l.childLanes=0,l.pendingProps=k,t.deletions=null):(l=Hr(a,k),l.subtreeFlags=a.subtreeFlags&14680064),y!==null?c=Hr(y,c):(c=bn(c,p,r,null),c.flags|=2),c.return=t,l.return=t,l.sibling=c,t.child=l,l=c,c=t.child,p=e.child.memoizedState,p=p===null?Wa(r):{baseLanes:p.baseLanes|r,cachePool:null,transitions:p.transitions},c.memoizedState=p,c.childLanes=e.childLanes&~r,t.memoizedState=Ha,l}return c=e.child,e=c.sibling,l=Hr(c,{mode:"visible",children:l.children}),(t.mode&1)===0&&(l.lanes=r),l.return=t,l.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=l,t.memoizedState=null,l}function Va(e,t){return t=Kl({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Tl(e,t,r,l){return l!==null&&ya(l),ns(t,e.child,null,r),e=Va(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Wg(e,t,r,l,a,c,p){if(r)return t.flags&256?(t.flags&=-257,l=Fa(Error(i(422))),Tl(e,t,p,l)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(c=l.fallback,a=t.mode,l=Kl({mode:"visible",children:l.children},a,0,null),c=bn(c,a,p,null),c.flags|=2,l.return=t,c.return=t,l.sibling=c,t.child=l,(t.mode&1)!==0&&ns(t,e.child,null,p),t.child.memoizedState=Wa(p),t.memoizedState=Ha,c);if((t.mode&1)===0)return Tl(e,t,p,null);if(a.data==="$!"){if(l=a.nextSibling&&a.nextSibling.dataset,l)var y=l.dgst;return l=y,c=Error(i(419)),l=Fa(c,l,void 0),Tl(e,t,p,l)}if(y=(p&e.childLanes)!==0,yt||y){if(l=et,l!==null){switch(p&-p){case 4:a=2;break;case 16:a=8;break;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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:a=32;break;case 536870912:a=268435456;break;default:a=0}a=(a&(l.suspendedLanes|p))!==0?0:a,a!==0&&a!==c.retryLane&&(c.retryLane=a,hr(e,a),Kt(l,e,a,-1))}return iu(),l=Fa(Error(i(421))),Tl(e,t,p,l)}return a.data==="$?"?(t.flags|=128,t.child=e.child,t=nx.bind(null,e),a._reactRetry=t,null):(e=c.treeContext,Pt=Or(a.nextSibling),Et=t,He=!0,Ht=null,e!==null&&(Dt[Tt++]=fr,Dt[Tt++]=pr,Dt[Tt++]=dn,fr=e.id,pr=e.overflow,dn=t),t=Va(t,l.children),t.flags|=4096,t)}function _f(e,t,r){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),ja(e.return,t,r)}function Ga(e,t,r,l,a){var c=e.memoizedState;c===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:r,tailMode:a}:(c.isBackwards=t,c.rendering=null,c.renderingStartTime=0,c.last=l,c.tail=r,c.tailMode=a)}function Mf(e,t,r){var l=t.pendingProps,a=l.revealOrder,c=l.tail;if(ft(e,t,l.children,r),l=We.current,(l&2)!==0)l=l&1|2,t.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&_f(e,r,t);else if(e.tag===19)_f(e,r,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}l&=1}if(Fe(We,l),(t.mode&1)===0)t.memoizedState=null;else switch(a){case"forwards":for(r=t.child,a=null;r!==null;)e=r.alternate,e!==null&&El(e)===null&&(a=r),r=r.sibling;r=a,r===null?(a=t.child,t.child=null):(a=r.sibling,r.sibling=null),Ga(t,!1,a,r,c);break;case"backwards":for(r=null,a=t.child,t.child=null;a!==null;){if(e=a.alternate,e!==null&&El(e)===null){t.child=a;break}e=a.sibling,a.sibling=r,r=a,a=e}Ga(t,!0,r,null,c);break;case"together":Ga(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Al(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function gr(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),gn|=t.lanes,(r&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,r=Hr(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=Hr(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function Vg(e,t,r){switch(t.tag){case 3:Cf(t),rs();break;case 5:Hd(t);break;case 1:xt(t.type)&&xl(t);break;case 4:Sa(t,t.stateNode.containerInfo);break;case 10:var l=t.type._context,a=t.memoizedProps.value;Fe(kl,l._currentValue),l._currentValue=a;break;case 13:if(l=t.memoizedState,l!==null)return l.dehydrated!==null?(Fe(We,We.current&1),t.flags|=128,null):(r&t.child.childLanes)!==0?Pf(e,t,r):(Fe(We,We.current&1),e=gr(e,t,r),e!==null?e.sibling:null);Fe(We,We.current&1);break;case 19:if(l=(r&t.childLanes)!==0,(e.flags&128)!==0){if(l)return Mf(e,t,r);t.flags|=128}if(a=t.memoizedState,a!==null&&(a.rendering=null,a.tail=null,a.lastEffect=null),Fe(We,We.current),l)break;return null;case 22:case 23:return t.lanes=0,kf(e,t,r)}return gr(e,t,r)}var Rf,Ka,Of,Df;Rf=function(e,t){for(var r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}},Ka=function(){},Of=function(e,t,r,l){var a=e.memoizedProps;if(a!==l){e=t.stateNode,hn(Jt.current);var c=null;switch(r){case"input":a=ln(e,a),l=ln(e,l),c=[];break;case"select":a=Z({},a,{value:void 0}),l=Z({},l,{value:void 0}),c=[];break;case"textarea":a=$n(e,a),l=$n(e,l),c=[];break;default:typeof a.onClick!="function"&&typeof l.onClick=="function"&&(e.onclick=hl)}Ei(r,l);var p;r=null;for(L in a)if(!l.hasOwnProperty(L)&&a.hasOwnProperty(L)&&a[L]!=null)if(L==="style"){var y=a[L];for(p in y)y.hasOwnProperty(p)&&(r||(r={}),r[p]="")}else L!=="dangerouslySetInnerHTML"&&L!=="children"&&L!=="suppressContentEditableWarning"&&L!=="suppressHydrationWarning"&&L!=="autoFocus"&&(d.hasOwnProperty(L)?c||(c=[]):(c=c||[]).push(L,null));for(L in l){var k=l[L];if(y=a!=null?a[L]:void 0,l.hasOwnProperty(L)&&k!==y&&(k!=null||y!=null))if(L==="style")if(y){for(p in y)!y.hasOwnProperty(p)||k&&k.hasOwnProperty(p)||(r||(r={}),r[p]="");for(p in k)k.hasOwnProperty(p)&&y[p]!==k[p]&&(r||(r={}),r[p]=k[p])}else r||(c||(c=[]),c.push(L,r)),r=k;else L==="dangerouslySetInnerHTML"?(k=k?k.__html:void 0,y=y?y.__html:void 0,k!=null&&y!==k&&(c=c||[]).push(L,k)):L==="children"?typeof k!="string"&&typeof k!="number"||(c=c||[]).push(L,""+k):L!=="suppressContentEditableWarning"&&L!=="suppressHydrationWarning"&&(d.hasOwnProperty(L)?(k!=null&&L==="onScroll"&&Ue("scroll",e),c||y===k||(c=[])):(c=c||[]).push(L,k))}r&&(c=c||[]).push("style",r);var L=c;(t.updateQueue=L)&&(t.flags|=4)}},Df=function(e,t,r,l){r!==l&&(t.flags|=4)};function yo(e,t){if(!He)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var l=null;r!==null;)r.alternate!==null&&(l=r),r=r.sibling;l===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function ut(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,l=0;if(t)for(var a=e.child;a!==null;)r|=a.lanes|a.childLanes,l|=a.subtreeFlags&14680064,l|=a.flags&14680064,a.return=e,a=a.sibling;else for(a=e.child;a!==null;)r|=a.lanes|a.childLanes,l|=a.subtreeFlags,l|=a.flags,a.return=e,a=a.sibling;return e.subtreeFlags|=l,e.childLanes=r,t}function Gg(e,t,r){var l=t.pendingProps;switch(ma(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ut(t),null;case 1:return xt(t.type)&&gl(),ut(t),null;case 3:return l=t.stateNode,ls(),$e(gt),$e(it),Pa(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(wl(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Ht!==null&&(su(Ht),Ht=null))),Ka(e,t),ut(t),null;case 5:Ca(t);var a=hn(po.current);if(r=t.type,e!==null&&t.stateNode!=null)Of(e,t,r,l,a),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!l){if(t.stateNode===null)throw Error(i(166));return ut(t),null}if(e=hn(Jt.current),wl(t)){l=t.stateNode,r=t.type;var c=t.memoizedProps;switch(l[Yt]=t,l[io]=c,e=(t.mode&1)!==0,r){case"dialog":Ue("cancel",l),Ue("close",l);break;case"iframe":case"object":case"embed":Ue("load",l);break;case"video":case"audio":for(a=0;a<so.length;a++)Ue(so[a],l);break;case"source":Ue("error",l);break;case"img":case"image":case"link":Ue("error",l),Ue("load",l);break;case"details":Ue("toggle",l);break;case"input":Is(l,c),Ue("invalid",l);break;case"select":l._wrapperState={wasMultiple:!!c.multiple},Ue("invalid",l);break;case"textarea":Us(l,c),Ue("invalid",l)}Ei(r,c),a=null;for(var p in c)if(c.hasOwnProperty(p)){var y=c[p];p==="children"?typeof y=="string"?l.textContent!==y&&(c.suppressHydrationWarning!==!0&&pl(l.textContent,y,e),a=["children",y]):typeof y=="number"&&l.textContent!==""+y&&(c.suppressHydrationWarning!==!0&&pl(l.textContent,y,e),a=["children",""+y]):d.hasOwnProperty(p)&&y!=null&&p==="onScroll"&&Ue("scroll",l)}switch(r){case"input":St(l),Nr(l,c,!0);break;case"textarea":St(l),oe(l);break;case"select":case"option":break;default:typeof c.onClick=="function"&&(l.onclick=hl)}l=a,t.updateQueue=l,l!==null&&(t.flags|=4)}else{p=a.nodeType===9?a:a.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=be(r)),e==="http://www.w3.org/1999/xhtml"?r==="script"?(e=p.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof l.is=="string"?e=p.createElement(r,{is:l.is}):(e=p.createElement(r),r==="select"&&(p=e,l.multiple?p.multiple=!0:l.size&&(p.size=l.size))):e=p.createElementNS(e,r),e[Yt]=t,e[io]=l,Rf(e,t,!1,!1),t.stateNode=e;e:{switch(p=Pi(r,l),r){case"dialog":Ue("cancel",e),Ue("close",e),a=l;break;case"iframe":case"object":case"embed":Ue("load",e),a=l;break;case"video":case"audio":for(a=0;a<so.length;a++)Ue(so[a],e);a=l;break;case"source":Ue("error",e),a=l;break;case"img":case"image":case"link":Ue("error",e),Ue("load",e),a=l;break;case"details":Ue("toggle",e),a=l;break;case"input":Is(e,l),a=ln(e,l),Ue("invalid",e);break;case"option":a=l;break;case"select":e._wrapperState={wasMultiple:!!l.multiple},a=Z({},l,{value:void 0}),Ue("invalid",e);break;case"textarea":Us(e,l),a=$n(e,l),Ue("invalid",e);break;default:a=l}Ei(r,a),y=a;for(c in y)if(y.hasOwnProperty(c)){var k=y[c];c==="style"?wc(e,k):c==="dangerouslySetInnerHTML"?(k=k?k.__html:void 0,k!=null&&Ut(e,k)):c==="children"?typeof k=="string"?(r!=="textarea"||k!=="")&&ar(e,k):typeof k=="number"&&ar(e,""+k):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(d.hasOwnProperty(c)?k!=null&&c==="onScroll"&&Ue("scroll",e):k!=null&&H(e,c,k,p))}switch(r){case"input":St(e),Nr(e,l,!1);break;case"textarea":St(e),oe(e);break;case"option":l.value!=null&&e.setAttribute("value",""+we(l.value));break;case"select":e.multiple=!!l.multiple,c=l.value,c!=null?ir(e,!!l.multiple,c,!1):l.defaultValue!=null&&ir(e,!!l.multiple,l.defaultValue,!0);break;default:typeof a.onClick=="function"&&(e.onclick=hl)}switch(r){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}}l&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return ut(t),null;case 6:if(e&&t.stateNode!=null)Df(e,t,e.memoizedProps,l);else{if(typeof l!="string"&&t.stateNode===null)throw Error(i(166));if(r=hn(po.current),hn(Jt.current),wl(t)){if(l=t.stateNode,r=t.memoizedProps,l[Yt]=t,(c=l.nodeValue!==r)&&(e=Et,e!==null))switch(e.tag){case 3:pl(l.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&pl(l.nodeValue,r,(e.mode&1)!==0)}c&&(t.flags|=4)}else l=(r.nodeType===9?r:r.ownerDocument).createTextNode(l),l[Yt]=t,t.stateNode=l}return ut(t),null;case 13:if($e(We),l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(He&&Pt!==null&&(t.mode&1)!==0&&(t.flags&128)===0)Ad(),rs(),t.flags|=98560,c=!1;else if(c=wl(t),l!==null&&l.dehydrated!==null){if(e===null){if(!c)throw Error(i(318));if(c=t.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(i(317));c[Yt]=t}else rs(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ut(t),c=!1}else Ht!==null&&(su(Ht),Ht=null),c=!0;if(!c)return t.flags&65536?t:null}return(t.flags&128)!==0?(t.lanes=r,t):(l=l!==null,l!==(e!==null&&e.memoizedState!==null)&&l&&(t.child.flags|=8192,(t.mode&1)!==0&&(e===null||(We.current&1)!==0?Je===0&&(Je=3):iu())),t.updateQueue!==null&&(t.flags|=4),ut(t),null);case 4:return ls(),Ka(e,t),e===null&&oo(t.stateNode.containerInfo),ut(t),null;case 10:return wa(t.type._context),ut(t),null;case 17:return xt(t.type)&&gl(),ut(t),null;case 19:if($e(We),c=t.memoizedState,c===null)return ut(t),null;if(l=(t.flags&128)!==0,p=c.rendering,p===null)if(l)yo(c,!1);else{if(Je!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(p=El(e),p!==null){for(t.flags|=128,yo(c,!1),l=p.updateQueue,l!==null&&(t.updateQueue=l,t.flags|=4),t.subtreeFlags=0,l=r,r=t.child;r!==null;)c=r,e=l,c.flags&=14680066,p=c.alternate,p===null?(c.childLanes=0,c.lanes=e,c.child=null,c.subtreeFlags=0,c.memoizedProps=null,c.memoizedState=null,c.updateQueue=null,c.dependencies=null,c.stateNode=null):(c.childLanes=p.childLanes,c.lanes=p.lanes,c.child=p.child,c.subtreeFlags=0,c.deletions=null,c.memoizedProps=p.memoizedProps,c.memoizedState=p.memoizedState,c.updateQueue=p.updateQueue,c.type=p.type,e=p.dependencies,c.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return Fe(We,We.current&1|2),t.child}e=e.sibling}c.tail!==null&&Qe()>cs&&(t.flags|=128,l=!0,yo(c,!1),t.lanes=4194304)}else{if(!l)if(e=El(p),e!==null){if(t.flags|=128,l=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),yo(c,!0),c.tail===null&&c.tailMode==="hidden"&&!p.alternate&&!He)return ut(t),null}else 2*Qe()-c.renderingStartTime>cs&&r!==1073741824&&(t.flags|=128,l=!0,yo(c,!1),t.lanes=4194304);c.isBackwards?(p.sibling=t.child,t.child=p):(r=c.last,r!==null?r.sibling=p:t.child=p,c.last=p)}return c.tail!==null?(t=c.tail,c.rendering=t,c.tail=t.sibling,c.renderingStartTime=Qe(),t.sibling=null,r=We.current,Fe(We,l?r&1|2:r&1),t):(ut(t),null);case 22:case 23:return lu(),l=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==l&&(t.flags|=8192),l&&(t.mode&1)!==0?(_t&1073741824)!==0&&(ut(t),t.subtreeFlags&6&&(t.flags|=8192)):ut(t),null;case 24:return null;case 25:return null}throw Error(i(156,t.tag))}function Kg(e,t){switch(ma(t),t.tag){case 1:return xt(t.type)&&gl(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ls(),$e(gt),$e(it),Pa(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return Ca(t),null;case 13:if($e(We),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));rs()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return $e(We),null;case 4:return ls(),null;case 10:return wa(t.type._context),null;case 22:case 23:return lu(),null;case 24:return null;default:return null}}var zl=!1,ct=!1,Qg=typeof WeakSet=="function"?WeakSet:Set,le=null;function as(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(l){Ge(e,t,l)}else r.current=null}function Qa(e,t,r){try{r()}catch(l){Ge(e,t,l)}}var Tf=!1;function qg(e,t){if(la=rl,e=dd(),Ji(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var l=r.getSelection&&r.getSelection();if(l&&l.rangeCount!==0){r=l.anchorNode;var a=l.anchorOffset,c=l.focusNode;l=l.focusOffset;try{r.nodeType,c.nodeType}catch{r=null;break e}var p=0,y=-1,k=-1,L=0,W=0,V=e,B=null;t:for(;;){for(var re;V!==r||a!==0&&V.nodeType!==3||(y=p+a),V!==c||l!==0&&V.nodeType!==3||(k=p+l),V.nodeType===3&&(p+=V.nodeValue.length),(re=V.firstChild)!==null;)B=V,V=re;for(;;){if(V===e)break t;if(B===r&&++L===a&&(y=p),B===c&&++W===l&&(k=p),(re=V.nextSibling)!==null)break;V=B,B=V.parentNode}V=re}r=y===-1||k===-1?null:{start:y,end:k}}else r=null}r=r||{start:0,end:0}}else r=null;for(ia={focusedElem:e,selectionRange:r},rl=!1,le=t;le!==null;)if(t=le,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,le=e;else for(;le!==null;){t=le;try{var ae=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(ae!==null){var de=ae.memoizedProps,qe=ae.memoizedState,O=t.stateNode,E=O.getSnapshotBeforeUpdate(t.elementType===t.type?de:Wt(t.type,de),qe);O.__reactInternalSnapshotBeforeUpdate=E}break;case 3:var T=t.stateNode.containerInfo;T.nodeType===1?T.textContent="":T.nodeType===9&&T.documentElement&&T.removeChild(T.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(i(163))}}catch(q){Ge(t,t.return,q)}if(e=t.sibling,e!==null){e.return=t.return,le=e;break}le=t.return}return ae=Tf,Tf=!1,ae}function vo(e,t,r){var l=t.updateQueue;if(l=l!==null?l.lastEffect:null,l!==null){var a=l=l.next;do{if((a.tag&e)===e){var c=a.destroy;a.destroy=void 0,c!==void 0&&Qa(t,r,c)}a=a.next}while(a!==l)}}function Ll(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 l=r.create;r.destroy=l()}r=r.next}while(r!==t)}}function qa(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 Af(e){var t=e.alternate;t!==null&&(e.alternate=null,Af(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Yt],delete t[io],delete t[da],delete t[Rg],delete t[Og])),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 zf(e){return e.tag===5||e.tag===3||e.tag===4}function Lf(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||zf(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 Za(e,t,r){var l=e.tag;if(l===5||l===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=hl));else if(l!==4&&(e=e.child,e!==null))for(Za(e,t,r),e=e.sibling;e!==null;)Za(e,t,r),e=e.sibling}function Ya(e,t,r){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(l!==4&&(e=e.child,e!==null))for(Ya(e,t,r),e=e.sibling;e!==null;)Ya(e,t,r),e=e.sibling}var nt=null,Vt=!1;function Ir(e,t,r){for(r=r.child;r!==null;)If(e,t,r),r=r.sibling}function If(e,t,r){if(Zt&&typeof Zt.onCommitFiberUnmount=="function")try{Zt.onCommitFiberUnmount(Zo,r)}catch{}switch(r.tag){case 5:ct||as(r,t);case 6:var l=nt,a=Vt;nt=null,Ir(e,t,r),nt=l,Vt=a,nt!==null&&(Vt?(e=nt,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):nt.removeChild(r.stateNode));break;case 18:nt!==null&&(Vt?(e=nt,r=r.stateNode,e.nodeType===8?ca(e.parentNode,r):e.nodeType===1&&ca(e,r),Zs(e)):ca(nt,r.stateNode));break;case 4:l=nt,a=Vt,nt=r.stateNode.containerInfo,Vt=!0,Ir(e,t,r),nt=l,Vt=a;break;case 0:case 11:case 14:case 15:if(!ct&&(l=r.updateQueue,l!==null&&(l=l.lastEffect,l!==null))){a=l=l.next;do{var c=a,p=c.destroy;c=c.tag,p!==void 0&&((c&2)!==0||(c&4)!==0)&&Qa(r,t,p),a=a.next}while(a!==l)}Ir(e,t,r);break;case 1:if(!ct&&(as(r,t),l=r.stateNode,typeof l.componentWillUnmount=="function"))try{l.props=r.memoizedProps,l.state=r.memoizedState,l.componentWillUnmount()}catch(y){Ge(r,t,y)}Ir(e,t,r);break;case 21:Ir(e,t,r);break;case 22:r.mode&1?(ct=(l=ct)||r.memoizedState!==null,Ir(e,t,r),ct=l):Ir(e,t,r);break;default:Ir(e,t,r)}}function Ff(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new Qg),t.forEach(function(l){var a=sx.bind(null,e,l);r.has(l)||(r.add(l),l.then(a,a))})}}function Gt(e,t){var r=t.deletions;if(r!==null)for(var l=0;l<r.length;l++){var a=r[l];try{var c=e,p=t,y=p;e:for(;y!==null;){switch(y.tag){case 5:nt=y.stateNode,Vt=!1;break e;case 3:nt=y.stateNode.containerInfo,Vt=!0;break e;case 4:nt=y.stateNode.containerInfo,Vt=!0;break e}y=y.return}if(nt===null)throw Error(i(160));If(c,p,a),nt=null,Vt=!1;var k=a.alternate;k!==null&&(k.return=null),a.return=null}catch(L){Ge(a,t,L)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Uf(t,e),t=t.sibling}function Uf(e,t){var r=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Gt(t,e),er(e),l&4){try{vo(3,e,e.return),Ll(3,e)}catch(de){Ge(e,e.return,de)}try{vo(5,e,e.return)}catch(de){Ge(e,e.return,de)}}break;case 1:Gt(t,e),er(e),l&512&&r!==null&&as(r,r.return);break;case 5:if(Gt(t,e),er(e),l&512&&r!==null&&as(r,r.return),e.flags&32){var a=e.stateNode;try{ar(a,"")}catch(de){Ge(e,e.return,de)}}if(l&4&&(a=e.stateNode,a!=null)){var c=e.memoizedProps,p=r!==null?r.memoizedProps:c,y=e.type,k=e.updateQueue;if(e.updateQueue=null,k!==null)try{y==="input"&&c.type==="radio"&&c.name!=null&&Fs(a,c),Pi(y,p);var L=Pi(y,c);for(p=0;p<k.length;p+=2){var W=k[p],V=k[p+1];W==="style"?wc(a,V):W==="dangerouslySetInnerHTML"?Ut(a,V):W==="children"?ar(a,V):H(a,W,V,L)}switch(y){case"input":Fn(a,c);break;case"textarea":A(a,c);break;case"select":var B=a._wrapperState.wasMultiple;a._wrapperState.wasMultiple=!!c.multiple;var re=c.value;re!=null?ir(a,!!c.multiple,re,!1):B!==!!c.multiple&&(c.defaultValue!=null?ir(a,!!c.multiple,c.defaultValue,!0):ir(a,!!c.multiple,c.multiple?[]:"",!1))}a[io]=c}catch(de){Ge(e,e.return,de)}}break;case 6:if(Gt(t,e),er(e),l&4){if(e.stateNode===null)throw Error(i(162));a=e.stateNode,c=e.memoizedProps;try{a.nodeValue=c}catch(de){Ge(e,e.return,de)}}break;case 3:if(Gt(t,e),er(e),l&4&&r!==null&&r.memoizedState.isDehydrated)try{Zs(t.containerInfo)}catch(de){Ge(e,e.return,de)}break;case 4:Gt(t,e),er(e);break;case 13:Gt(t,e),er(e),a=e.child,a.flags&8192&&(c=a.memoizedState!==null,a.stateNode.isHidden=c,!c||a.alternate!==null&&a.alternate.memoizedState!==null||(eu=Qe())),l&4&&Ff(e);break;case 22:if(W=r!==null&&r.memoizedState!==null,e.mode&1?(ct=(L=ct)||W,Gt(t,e),ct=L):Gt(t,e),er(e),l&8192){if(L=e.memoizedState!==null,(e.stateNode.isHidden=L)&&!W&&(e.mode&1)!==0)for(le=e,W=e.child;W!==null;){for(V=le=W;le!==null;){switch(B=le,re=B.child,B.tag){case 0:case 11:case 14:case 15:vo(4,B,B.return);break;case 1:as(B,B.return);var ae=B.stateNode;if(typeof ae.componentWillUnmount=="function"){l=B,r=B.return;try{t=l,ae.props=t.memoizedProps,ae.state=t.memoizedState,ae.componentWillUnmount()}catch(de){Ge(l,r,de)}}break;case 5:as(B,B.return);break;case 22:if(B.memoizedState!==null){Hf(V);continue}}re!==null?(re.return=B,le=re):Hf(V)}W=W.sibling}e:for(W=null,V=e;;){if(V.tag===5){if(W===null){W=V;try{a=V.stateNode,L?(c=a.style,typeof c.setProperty=="function"?c.setProperty("display","none","important"):c.display="none"):(y=V.stateNode,k=V.memoizedProps.style,p=k!=null&&k.hasOwnProperty("display")?k.display:null,y.style.display=bc("display",p))}catch(de){Ge(e,e.return,de)}}}else if(V.tag===6){if(W===null)try{V.stateNode.nodeValue=L?"":V.memoizedProps}catch(de){Ge(e,e.return,de)}}else if((V.tag!==22&&V.tag!==23||V.memoizedState===null||V===e)&&V.child!==null){V.child.return=V,V=V.child;continue}if(V===e)break e;for(;V.sibling===null;){if(V.return===null||V.return===e)break e;W===V&&(W=null),V=V.return}W===V&&(W=null),V.sibling.return=V.return,V=V.sibling}}break;case 19:Gt(t,e),er(e),l&4&&Ff(e);break;case 21:break;default:Gt(t,e),er(e)}}function er(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(zf(r)){var l=r;break e}r=r.return}throw Error(i(160))}switch(l.tag){case 5:var a=l.stateNode;l.flags&32&&(ar(a,""),l.flags&=-33);var c=Lf(e);Ya(e,c,a);break;case 3:case 4:var p=l.stateNode.containerInfo,y=Lf(e);Za(e,y,p);break;default:throw Error(i(161))}}catch(k){Ge(e,e.return,k)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Zg(e,t,r){le=e,$f(e)}function $f(e,t,r){for(var l=(e.mode&1)!==0;le!==null;){var a=le,c=a.child;if(a.tag===22&&l){var p=a.memoizedState!==null||zl;if(!p){var y=a.alternate,k=y!==null&&y.memoizedState!==null||ct;y=zl;var L=ct;if(zl=p,(ct=k)&&!L)for(le=a;le!==null;)p=le,k=p.child,p.tag===22&&p.memoizedState!==null?Wf(a):k!==null?(k.return=p,le=k):Wf(a);for(;c!==null;)le=c,$f(c),c=c.sibling;le=a,zl=y,ct=L}Bf(e)}else(a.subtreeFlags&8772)!==0&&c!==null?(c.return=a,le=c):Bf(e)}}function Bf(e){for(;le!==null;){var t=le;if((t.flags&8772)!==0){var r=t.alternate;try{if((t.flags&8772)!==0)switch(t.tag){case 0:case 11:case 15:ct||Ll(5,t);break;case 1:var l=t.stateNode;if(t.flags&4&&!ct)if(r===null)l.componentDidMount();else{var a=t.elementType===t.type?r.memoizedProps:Wt(t.type,r.memoizedProps);l.componentDidUpdate(a,r.memoizedState,l.__reactInternalSnapshotBeforeUpdate)}var c=t.updateQueue;c!==null&&Bd(t,c,l);break;case 3:var p=t.updateQueue;if(p!==null){if(r=null,t.child!==null)switch(t.child.tag){case 5:r=t.child.stateNode;break;case 1:r=t.child.stateNode}Bd(t,p,r)}break;case 5:var y=t.stateNode;if(r===null&&t.flags&4){r=y;var k=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":k.autoFocus&&r.focus();break;case"img":k.src&&(r.src=k.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var L=t.alternate;if(L!==null){var W=L.memoizedState;if(W!==null){var V=W.dehydrated;V!==null&&Zs(V)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(i(163))}ct||t.flags&512&&qa(t)}catch(B){Ge(t,t.return,B)}}if(t===e){le=null;break}if(r=t.sibling,r!==null){r.return=t.return,le=r;break}le=t.return}}function Hf(e){for(;le!==null;){var t=le;if(t===e){le=null;break}var r=t.sibling;if(r!==null){r.return=t.return,le=r;break}le=t.return}}function Wf(e){for(;le!==null;){var t=le;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{Ll(4,t)}catch(k){Ge(t,r,k)}break;case 1:var l=t.stateNode;if(typeof l.componentDidMount=="function"){var a=t.return;try{l.componentDidMount()}catch(k){Ge(t,a,k)}}var c=t.return;try{qa(t)}catch(k){Ge(t,c,k)}break;case 5:var p=t.return;try{qa(t)}catch(k){Ge(t,p,k)}}}catch(k){Ge(t,t.return,k)}if(t===e){le=null;break}var y=t.sibling;if(y!==null){y.return=t.return,le=y;break}le=t.return}}var Yg=Math.ceil,Il=z.ReactCurrentDispatcher,Ja=z.ReactCurrentOwner,Lt=z.ReactCurrentBatchConfig,Re=0,et=null,Ze=null,st=0,_t=0,us=Dr(0),Je=0,bo=null,gn=0,Fl=0,Xa=0,wo=null,vt=null,eu=0,cs=1/0,xr=null,Ul=!1,tu=null,Fr=null,$l=!1,Ur=null,Bl=0,jo=0,ru=null,Hl=-1,Wl=0;function pt(){return(Re&6)!==0?Qe():Hl!==-1?Hl:Hl=Qe()}function $r(e){return(e.mode&1)===0?1:(Re&2)!==0&&st!==0?st&-st:Tg.transition!==null?(Wl===0&&(Wl=zc()),Wl):(e=ze,e!==0||(e=window.event,e=e===void 0?16:Vc(e.type)),e)}function Kt(e,t,r,l){if(50<jo)throw jo=0,ru=null,Error(i(185));Vs(e,r,l),((Re&2)===0||e!==et)&&(e===et&&((Re&2)===0&&(Fl|=r),Je===4&&Br(e,st)),bt(e,l),r===1&&Re===0&&(t.mode&1)===0&&(cs=Qe()+500,yl&&Ar()))}function bt(e,t){var r=e.callbackNode;Tm(e,t);var l=Xo(e,e===et?st:0);if(l===0)r!==null&&Dc(r),e.callbackNode=null,e.callbackPriority=0;else if(t=l&-l,e.callbackPriority!==t){if(r!=null&&Dc(r),t===1)e.tag===0?Dg(Gf.bind(null,e)):Md(Gf.bind(null,e)),_g(function(){(Re&6)===0&&Ar()}),r=null;else{switch(Lc(l)){case 1:r=Ai;break;case 4:r=Tc;break;case 16:r=qo;break;case 536870912:r=Ac;break;default:r=qo}r=ep(r,Vf.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function Vf(e,t){if(Hl=-1,Wl=0,(Re&6)!==0)throw Error(i(327));var r=e.callbackNode;if(ds()&&e.callbackNode!==r)return null;var l=Xo(e,e===et?st:0);if(l===0)return null;if((l&30)!==0||(l&e.expiredLanes)!==0||t)t=Vl(e,l);else{t=l;var a=Re;Re|=2;var c=Qf();(et!==e||st!==t)&&(xr=null,cs=Qe()+500,yn(e,t));do try{ex();break}catch(y){Kf(e,y)}while(!0);ba(),Il.current=c,Re=a,Ze!==null?t=0:(et=null,st=0,t=Je)}if(t!==0){if(t===2&&(a=zi(e),a!==0&&(l=a,t=nu(e,a))),t===1)throw r=bo,yn(e,0),Br(e,l),bt(e,Qe()),r;if(t===6)Br(e,l);else{if(a=e.current.alternate,(l&30)===0&&!Jg(a)&&(t=Vl(e,l),t===2&&(c=zi(e),c!==0&&(l=c,t=nu(e,c))),t===1))throw r=bo,yn(e,0),Br(e,l),bt(e,Qe()),r;switch(e.finishedWork=a,e.finishedLanes=l,t){case 0:case 1:throw Error(i(345));case 2:vn(e,vt,xr);break;case 3:if(Br(e,l),(l&130023424)===l&&(t=eu+500-Qe(),10<t)){if(Xo(e,0)!==0)break;if(a=e.suspendedLanes,(a&l)!==l){pt(),e.pingedLanes|=e.suspendedLanes&a;break}e.timeoutHandle=ua(vn.bind(null,e,vt,xr),t);break}vn(e,vt,xr);break;case 4:if(Br(e,l),(l&4194240)===l)break;for(t=e.eventTimes,a=-1;0<l;){var p=31-$t(l);c=1<<p,p=t[p],p>a&&(a=p),l&=~c}if(l=a,l=Qe()-l,l=(120>l?120:480>l?480:1080>l?1080:1920>l?1920:3e3>l?3e3:4320>l?4320:1960*Yg(l/1960))-l,10<l){e.timeoutHandle=ua(vn.bind(null,e,vt,xr),l);break}vn(e,vt,xr);break;case 5:vn(e,vt,xr);break;default:throw Error(i(329))}}}return bt(e,Qe()),e.callbackNode===r?Vf.bind(null,e):null}function nu(e,t){var r=wo;return e.current.memoizedState.isDehydrated&&(yn(e,t).flags|=256),e=Vl(e,t),e!==2&&(t=vt,vt=r,t!==null&&su(t)),e}function su(e){vt===null?vt=e:vt.push.apply(vt,e)}function Jg(e){for(var t=e;;){if(t.flags&16384){var r=t.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var l=0;l<r.length;l++){var a=r[l],c=a.getSnapshot;a=a.value;try{if(!Bt(c(),a))return!1}catch{return!1}}}if(r=t.child,t.subtreeFlags&16384&&r!==null)r.return=t,t=r;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Br(e,t){for(t&=~Xa,t&=~Fl,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-$t(t),l=1<<r;e[r]=-1,t&=~l}}function Gf(e){if((Re&6)!==0)throw Error(i(327));ds();var t=Xo(e,0);if((t&1)===0)return bt(e,Qe()),null;var r=Vl(e,t);if(e.tag!==0&&r===2){var l=zi(e);l!==0&&(t=l,r=nu(e,l))}if(r===1)throw r=bo,yn(e,0),Br(e,t),bt(e,Qe()),r;if(r===6)throw Error(i(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,vn(e,vt,xr),bt(e,Qe()),null}function ou(e,t){var r=Re;Re|=1;try{return e(t)}finally{Re=r,Re===0&&(cs=Qe()+500,yl&&Ar())}}function xn(e){Ur!==null&&Ur.tag===0&&(Re&6)===0&&ds();var t=Re;Re|=1;var r=Lt.transition,l=ze;try{if(Lt.transition=null,ze=1,e)return e()}finally{ze=l,Lt.transition=r,Re=t,(Re&6)===0&&Ar()}}function lu(){_t=us.current,$e(us)}function yn(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,Pg(r)),Ze!==null)for(r=Ze.return;r!==null;){var l=r;switch(ma(l),l.tag){case 1:l=l.type.childContextTypes,l!=null&&gl();break;case 3:ls(),$e(gt),$e(it),Pa();break;case 5:Ca(l);break;case 4:ls();break;case 13:$e(We);break;case 19:$e(We);break;case 10:wa(l.type._context);break;case 22:case 23:lu()}r=r.return}if(et=e,Ze=e=Hr(e.current,null),st=_t=t,Je=0,bo=null,Xa=Fl=gn=0,vt=wo=null,pn!==null){for(t=0;t<pn.length;t++)if(r=pn[t],l=r.interleaved,l!==null){r.interleaved=null;var a=l.next,c=r.pending;if(c!==null){var p=c.next;c.next=a,l.next=p}r.pending=l}pn=null}return e}function Kf(e,t){do{var r=Ze;try{if(ba(),Pl.current=Ol,_l){for(var l=Ve.memoizedState;l!==null;){var a=l.queue;a!==null&&(a.pending=null),l=l.next}_l=!1}if(mn=0,Xe=Ye=Ve=null,ho=!1,mo=0,Ja.current=null,r===null||r.return===null){Je=1,bo=t,Ze=null;break}e:{var c=e,p=r.return,y=r,k=t;if(t=st,y.flags|=32768,k!==null&&typeof k=="object"&&typeof k.then=="function"){var L=k,W=y,V=W.tag;if((W.mode&1)===0&&(V===0||V===11||V===15)){var B=W.alternate;B?(W.updateQueue=B.updateQueue,W.memoizedState=B.memoizedState,W.lanes=B.lanes):(W.updateQueue=null,W.memoizedState=null)}var re=yf(p);if(re!==null){re.flags&=-257,vf(re,p,y,c,t),re.mode&1&&xf(c,L,t),t=re,k=L;var ae=t.updateQueue;if(ae===null){var de=new Set;de.add(k),t.updateQueue=de}else ae.add(k);break e}else{if((t&1)===0){xf(c,L,t),iu();break e}k=Error(i(426))}}else if(He&&y.mode&1){var qe=yf(p);if(qe!==null){(qe.flags&65536)===0&&(qe.flags|=256),vf(qe,p,y,c,t),ya(is(k,y));break e}}c=k=is(k,y),Je!==4&&(Je=2),wo===null?wo=[c]:wo.push(c),c=p;do{switch(c.tag){case 3:c.flags|=65536,t&=-t,c.lanes|=t;var O=mf(c,k,t);$d(c,O);break e;case 1:y=k;var E=c.type,T=c.stateNode;if((c.flags&128)===0&&(typeof E.getDerivedStateFromError=="function"||T!==null&&typeof T.componentDidCatch=="function"&&(Fr===null||!Fr.has(T)))){c.flags|=65536,t&=-t,c.lanes|=t;var q=gf(c,y,t);$d(c,q);break e}}c=c.return}while(c!==null)}Zf(r)}catch(fe){t=fe,Ze===r&&r!==null&&(Ze=r=r.return);continue}break}while(!0)}function Qf(){var e=Il.current;return Il.current=Ol,e===null?Ol:e}function iu(){(Je===0||Je===3||Je===2)&&(Je=4),et===null||(gn&268435455)===0&&(Fl&268435455)===0||Br(et,st)}function Vl(e,t){var r=Re;Re|=2;var l=Qf();(et!==e||st!==t)&&(xr=null,yn(e,t));do try{Xg();break}catch(a){Kf(e,a)}while(!0);if(ba(),Re=r,Il.current=l,Ze!==null)throw Error(i(261));return et=null,st=0,Je}function Xg(){for(;Ze!==null;)qf(Ze)}function ex(){for(;Ze!==null&&!Sm();)qf(Ze)}function qf(e){var t=Xf(e.alternate,e,_t);e.memoizedProps=e.pendingProps,t===null?Zf(e):Ze=t,Ja.current=null}function Zf(e){var t=e;do{var r=t.alternate;if(e=t.return,(t.flags&32768)===0){if(r=Gg(r,t,_t),r!==null){Ze=r;return}}else{if(r=Kg(r,t),r!==null){r.flags&=32767,Ze=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Je=6,Ze=null;return}}if(t=t.sibling,t!==null){Ze=t;return}Ze=t=e}while(t!==null);Je===0&&(Je=5)}function vn(e,t,r){var l=ze,a=Lt.transition;try{Lt.transition=null,ze=1,tx(e,t,r,l)}finally{Lt.transition=a,ze=l}return null}function tx(e,t,r,l){do ds();while(Ur!==null);if((Re&6)!==0)throw Error(i(327));r=e.finishedWork;var a=e.finishedLanes;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(i(177));e.callbackNode=null,e.callbackPriority=0;var c=r.lanes|r.childLanes;if(Am(e,c),e===et&&(Ze=et=null,st=0),(r.subtreeFlags&2064)===0&&(r.flags&2064)===0||$l||($l=!0,ep(qo,function(){return ds(),null})),c=(r.flags&15990)!==0,(r.subtreeFlags&15990)!==0||c){c=Lt.transition,Lt.transition=null;var p=ze;ze=1;var y=Re;Re|=4,Ja.current=null,qg(e,r),Uf(r,e),wg(ia),rl=!!la,ia=la=null,e.current=r,Zg(r),Cm(),Re=y,ze=p,Lt.transition=c}else e.current=r;if($l&&($l=!1,Ur=e,Bl=a),c=e.pendingLanes,c===0&&(Fr=null),_m(r.stateNode),bt(e,Qe()),t!==null)for(l=e.onRecoverableError,r=0;r<t.length;r++)a=t[r],l(a.value,{componentStack:a.stack,digest:a.digest});if(Ul)throw Ul=!1,e=tu,tu=null,e;return(Bl&1)!==0&&e.tag!==0&&ds(),c=e.pendingLanes,(c&1)!==0?e===ru?jo++:(jo=0,ru=e):jo=0,Ar(),null}function ds(){if(Ur!==null){var e=Lc(Bl),t=Lt.transition,r=ze;try{if(Lt.transition=null,ze=16>e?16:e,Ur===null)var l=!1;else{if(e=Ur,Ur=null,Bl=0,(Re&6)!==0)throw Error(i(331));var a=Re;for(Re|=4,le=e.current;le!==null;){var c=le,p=c.child;if((le.flags&16)!==0){var y=c.deletions;if(y!==null){for(var k=0;k<y.length;k++){var L=y[k];for(le=L;le!==null;){var W=le;switch(W.tag){case 0:case 11:case 15:vo(8,W,c)}var V=W.child;if(V!==null)V.return=W,le=V;else for(;le!==null;){W=le;var B=W.sibling,re=W.return;if(Af(W),W===L){le=null;break}if(B!==null){B.return=re,le=B;break}le=re}}}var ae=c.alternate;if(ae!==null){var de=ae.child;if(de!==null){ae.child=null;do{var qe=de.sibling;de.sibling=null,de=qe}while(de!==null)}}le=c}}if((c.subtreeFlags&2064)!==0&&p!==null)p.return=c,le=p;else e:for(;le!==null;){if(c=le,(c.flags&2048)!==0)switch(c.tag){case 0:case 11:case 15:vo(9,c,c.return)}var O=c.sibling;if(O!==null){O.return=c.return,le=O;break e}le=c.return}}var E=e.current;for(le=E;le!==null;){p=le;var T=p.child;if((p.subtreeFlags&2064)!==0&&T!==null)T.return=p,le=T;else e:for(p=E;le!==null;){if(y=le,(y.flags&2048)!==0)try{switch(y.tag){case 0:case 11:case 15:Ll(9,y)}}catch(fe){Ge(y,y.return,fe)}if(y===p){le=null;break e}var q=y.sibling;if(q!==null){q.return=y.return,le=q;break e}le=y.return}}if(Re=a,Ar(),Zt&&typeof Zt.onPostCommitFiberRoot=="function")try{Zt.onPostCommitFiberRoot(Zo,e)}catch{}l=!0}return l}finally{ze=r,Lt.transition=t}}return!1}function Yf(e,t,r){t=is(r,t),t=mf(e,t,1),e=Lr(e,t,1),t=pt(),e!==null&&(Vs(e,1,t),bt(e,t))}function Ge(e,t,r){if(e.tag===3)Yf(e,e,r);else for(;t!==null;){if(t.tag===3){Yf(t,e,r);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(Fr===null||!Fr.has(l))){e=is(r,e),e=gf(t,e,1),t=Lr(t,e,1),e=pt(),t!==null&&(Vs(t,1,e),bt(t,e));break}}t=t.return}}function rx(e,t,r){var l=e.pingCache;l!==null&&l.delete(t),t=pt(),e.pingedLanes|=e.suspendedLanes&r,et===e&&(st&r)===r&&(Je===4||Je===3&&(st&130023424)===st&&500>Qe()-eu?yn(e,0):Xa|=r),bt(e,t)}function Jf(e,t){t===0&&((e.mode&1)===0?t=1:(t=Jo,Jo<<=1,(Jo&130023424)===0&&(Jo=4194304)));var r=pt();e=hr(e,t),e!==null&&(Vs(e,t,r),bt(e,r))}function nx(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),Jf(e,r)}function sx(e,t){var r=0;switch(e.tag){case 13:var l=e.stateNode,a=e.memoizedState;a!==null&&(r=a.retryLane);break;case 19:l=e.stateNode;break;default:throw Error(i(314))}l!==null&&l.delete(t),Jf(e,r)}var Xf;Xf=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||gt.current)yt=!0;else{if((e.lanes&r)===0&&(t.flags&128)===0)return yt=!1,Vg(e,t,r);yt=(e.flags&131072)!==0}else yt=!1,He&&(t.flags&1048576)!==0&&Rd(t,bl,t.index);switch(t.lanes=0,t.tag){case 2:var l=t.type;Al(e,t),e=t.pendingProps;var a=Xn(t,it.current);os(t,r),a=Ra(null,t,l,e,a,r);var c=Oa();return t.flags|=1,typeof a=="object"&&a!==null&&typeof a.render=="function"&&a.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,xt(l)?(c=!0,xl(t)):c=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,Na(t),a.updater=Dl,t.stateNode=a,a._reactInternals=t,Ia(t,l,e,r),t=Ba(null,t,l,!0,c,r)):(t.tag=0,He&&c&&ha(t),ft(null,t,a,r),t=t.child),t;case 16:l=t.elementType;e:{switch(Al(e,t),e=t.pendingProps,a=l._init,l=a(l._payload),t.type=l,a=t.tag=lx(l),e=Wt(l,e),a){case 0:t=$a(null,t,l,e,r);break e;case 1:t=Sf(null,t,l,e,r);break e;case 11:t=bf(null,t,l,e,r);break e;case 14:t=wf(null,t,l,Wt(l.type,e),r);break e}throw Error(i(306,l,""))}return t;case 0:return l=t.type,a=t.pendingProps,a=t.elementType===l?a:Wt(l,a),$a(e,t,l,a,r);case 1:return l=t.type,a=t.pendingProps,a=t.elementType===l?a:Wt(l,a),Sf(e,t,l,a,r);case 3:e:{if(Cf(t),e===null)throw Error(i(387));l=t.pendingProps,c=t.memoizedState,a=c.element,Ud(e,t),Cl(t,l,null,r);var p=t.memoizedState;if(l=p.element,c.isDehydrated)if(c={element:l,isDehydrated:!1,cache:p.cache,pendingSuspenseBoundaries:p.pendingSuspenseBoundaries,transitions:p.transitions},t.updateQueue.baseState=c,t.memoizedState=c,t.flags&256){a=is(Error(i(423)),t),t=Ef(e,t,l,r,a);break e}else if(l!==a){a=is(Error(i(424)),t),t=Ef(e,t,l,r,a);break e}else for(Pt=Or(t.stateNode.containerInfo.firstChild),Et=t,He=!0,Ht=null,r=Id(t,null,l,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(rs(),l===a){t=gr(e,t,r);break e}ft(e,t,l,r)}t=t.child}return t;case 5:return Hd(t),e===null&&xa(t),l=t.type,a=t.pendingProps,c=e!==null?e.memoizedProps:null,p=a.children,aa(l,a)?p=null:c!==null&&aa(l,c)&&(t.flags|=32),Nf(e,t),ft(e,t,p,r),t.child;case 6:return e===null&&xa(t),null;case 13:return Pf(e,t,r);case 4:return Sa(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=ns(t,null,l,r):ft(e,t,l,r),t.child;case 11:return l=t.type,a=t.pendingProps,a=t.elementType===l?a:Wt(l,a),bf(e,t,l,a,r);case 7:return ft(e,t,t.pendingProps,r),t.child;case 8:return ft(e,t,t.pendingProps.children,r),t.child;case 12:return ft(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(l=t.type._context,a=t.pendingProps,c=t.memoizedProps,p=a.value,Fe(kl,l._currentValue),l._currentValue=p,c!==null)if(Bt(c.value,p)){if(c.children===a.children&&!gt.current){t=gr(e,t,r);break e}}else for(c=t.child,c!==null&&(c.return=t);c!==null;){var y=c.dependencies;if(y!==null){p=c.child;for(var k=y.firstContext;k!==null;){if(k.context===l){if(c.tag===1){k=mr(-1,r&-r),k.tag=2;var L=c.updateQueue;if(L!==null){L=L.shared;var W=L.pending;W===null?k.next=k:(k.next=W.next,W.next=k),L.pending=k}}c.lanes|=r,k=c.alternate,k!==null&&(k.lanes|=r),ja(c.return,r,t),y.lanes|=r;break}k=k.next}}else if(c.tag===10)p=c.type===t.type?null:c.child;else if(c.tag===18){if(p=c.return,p===null)throw Error(i(341));p.lanes|=r,y=p.alternate,y!==null&&(y.lanes|=r),ja(p,r,t),p=c.sibling}else p=c.child;if(p!==null)p.return=c;else for(p=c;p!==null;){if(p===t){p=null;break}if(c=p.sibling,c!==null){c.return=p.return,p=c;break}p=p.return}c=p}ft(e,t,a.children,r),t=t.child}return t;case 9:return a=t.type,l=t.pendingProps.children,os(t,r),a=At(a),l=l(a),t.flags|=1,ft(e,t,l,r),t.child;case 14:return l=t.type,a=Wt(l,t.pendingProps),a=Wt(l.type,a),wf(e,t,l,a,r);case 15:return jf(e,t,t.type,t.pendingProps,r);case 17:return l=t.type,a=t.pendingProps,a=t.elementType===l?a:Wt(l,a),Al(e,t),t.tag=1,xt(l)?(e=!0,xl(t)):e=!1,os(t,r),pf(t,l,a),Ia(t,l,a,r),Ba(null,t,l,!0,e,r);case 19:return Mf(e,t,r);case 22:return kf(e,t,r)}throw Error(i(156,t.tag))};function ep(e,t){return Oc(e,t)}function ox(e,t,r,l){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=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function It(e,t,r,l){return new ox(e,t,r,l)}function au(e){return e=e.prototype,!(!e||!e.isReactComponent)}function lx(e){if(typeof e=="function")return au(e)?1:0;if(e!=null){if(e=e.$$typeof,e===ue)return 11;if(e===Oe)return 14}return 2}function Hr(e,t){var r=e.alternate;return r===null?(r=It(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 Gl(e,t,r,l,a,c){var p=2;if(l=e,typeof e=="function")au(e)&&(p=1);else if(typeof e=="string")p=5;else e:switch(e){case K:return bn(r.children,a,c,t);case ne:p=8,a|=8;break;case ee:return e=It(12,r,t,a|2),e.elementType=ee,e.lanes=c,e;case Le:return e=It(13,r,t,a),e.elementType=Le,e.lanes=c,e;case _e:return e=It(19,r,t,a),e.elementType=_e,e.lanes=c,e;case Me:return Kl(r,a,c,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case J:p=10;break e;case ke:p=9;break e;case ue:p=11;break e;case Oe:p=14;break e;case Te:p=16,l=null;break e}throw Error(i(130,e==null?e:typeof e,""))}return t=It(p,r,t,a),t.elementType=e,t.type=l,t.lanes=c,t}function bn(e,t,r,l){return e=It(7,e,l,t),e.lanes=r,e}function Kl(e,t,r,l){return e=It(22,e,l,t),e.elementType=Me,e.lanes=r,e.stateNode={isHidden:!1},e}function uu(e,t,r){return e=It(6,e,null,t),e.lanes=r,e}function cu(e,t,r){return t=It(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function ix(e,t,r,l,a){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=Li(0),this.expirationTimes=Li(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Li(0),this.identifierPrefix=l,this.onRecoverableError=a,this.mutableSourceEagerHydrationData=null}function du(e,t,r,l,a,c,p,y,k){return e=new ix(e,t,r,y,k),t===1?(t=1,c===!0&&(t|=8)):t=0,c=It(3,null,null,t),e.current=c,c.stateNode=e,c.memoizedState={element:l,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Na(c),e}function ax(e,t,r){var l=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:F,key:l==null?null:""+l,children:e,containerInfo:t,implementation:r}}function tp(e){if(!e)return Tr;e=e._reactInternals;e:{if(an(e)!==e||e.tag!==1)throw Error(i(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(xt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(i(171))}if(e.tag===1){var r=e.type;if(xt(r))return Pd(e,r,t)}return t}function rp(e,t,r,l,a,c,p,y,k){return e=du(r,l,!0,e,a,c,p,y,k),e.context=tp(null),r=e.current,l=pt(),a=$r(r),c=mr(l,a),c.callback=t??null,Lr(r,c,a),e.current.lanes=a,Vs(e,a,l),bt(e,l),e}function Ql(e,t,r,l){var a=t.current,c=pt(),p=$r(a);return r=tp(r),t.context===null?t.context=r:t.pendingContext=r,t=mr(c,p),t.payload={element:e},l=l===void 0?null:l,l!==null&&(t.callback=l),e=Lr(a,t,p),e!==null&&(Kt(e,a,p,c),Sl(e,a,p)),p}function ql(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function np(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function fu(e,t){np(e,t),(e=e.alternate)&&np(e,t)}function ux(){return null}var sp=typeof reportError=="function"?reportError:function(e){console.error(e)};function pu(e){this._internalRoot=e}Zl.prototype.render=pu.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));Ql(e,t,null,null)},Zl.prototype.unmount=pu.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;xn(function(){Ql(null,e,null,null)}),t[cr]=null}};function Zl(e){this._internalRoot=e}Zl.prototype.unstable_scheduleHydration=function(e){if(e){var t=Uc();e={blockedOn:null,target:e,priority:t};for(var r=0;r<_r.length&&t!==0&&t<_r[r].priority;r++);_r.splice(r,0,e),r===0&&Hc(e)}};function hu(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Yl(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function op(){}function cx(e,t,r,l,a){if(a){if(typeof l=="function"){var c=l;l=function(){var L=ql(p);c.call(L)}}var p=rp(t,l,e,0,null,!1,!1,"",op);return e._reactRootContainer=p,e[cr]=p.current,oo(e.nodeType===8?e.parentNode:e),xn(),p}for(;a=e.lastChild;)e.removeChild(a);if(typeof l=="function"){var y=l;l=function(){var L=ql(k);y.call(L)}}var k=du(e,0,!1,null,null,!1,!1,"",op);return e._reactRootContainer=k,e[cr]=k.current,oo(e.nodeType===8?e.parentNode:e),xn(function(){Ql(t,k,r,l)}),k}function Jl(e,t,r,l,a){var c=r._reactRootContainer;if(c){var p=c;if(typeof a=="function"){var y=a;a=function(){var k=ql(p);y.call(k)}}Ql(t,p,e,a)}else p=cx(r,t,e,a,l);return ql(p)}Ic=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=Ws(t.pendingLanes);r!==0&&(Ii(t,r|1),bt(t,Qe()),(Re&6)===0&&(cs=Qe()+500,Ar()))}break;case 13:xn(function(){var l=hr(e,1);if(l!==null){var a=pt();Kt(l,e,1,a)}}),fu(e,1)}},Fi=function(e){if(e.tag===13){var t=hr(e,134217728);if(t!==null){var r=pt();Kt(t,e,134217728,r)}fu(e,134217728)}},Fc=function(e){if(e.tag===13){var t=$r(e),r=hr(e,t);if(r!==null){var l=pt();Kt(r,e,t,l)}fu(e,t)}},Uc=function(){return ze},$c=function(e,t){var r=ze;try{return ze=e,t()}finally{ze=r}},Ri=function(e,t,r){switch(t){case"input":if(Fn(e,r),t=r.name,r.type==="radio"&&t!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var l=r[t];if(l!==e&&l.form===e.form){var a=ml(l);if(!a)throw Error(i(90));Go(l),Fn(l,a)}}}break;case"textarea":A(e,r);break;case"select":t=r.value,t!=null&&ir(e,!!r.multiple,t,!1)}},Sc=ou,Cc=xn;var dx={usingClientEntryPoint:!1,Events:[ao,Yn,ml,kc,Nc,ou]},ko={findFiberByHostInstance:un,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},fx={bundleType:ko.bundleType,version:ko.version,rendererPackageName:ko.rendererPackageName,rendererConfig:ko.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:z.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Mc(e),e===null?null:e.stateNode},findFiberByHostInstance:ko.findFiberByHostInstance||ux,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Xl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Xl.isDisabled&&Xl.supportsFiber)try{Zo=Xl.inject(fx),Zt=Xl}catch{}}return wt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=dx,wt.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!hu(t))throw Error(i(200));return ax(e,t,null,r)},wt.createRoot=function(e,t){if(!hu(e))throw Error(i(299));var r=!1,l="",a=sp;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onRecoverableError!==void 0&&(a=t.onRecoverableError)),t=du(e,1,!1,null,null,r,!1,l,a),e[cr]=t.current,oo(e.nodeType===8?e.parentNode:e),new pu(t)},wt.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(i(188)):(e=Object.keys(e).join(","),Error(i(268,e)));return e=Mc(t),e=e===null?null:e.stateNode,e},wt.flushSync=function(e){return xn(e)},wt.hydrate=function(e,t,r){if(!Yl(t))throw Error(i(200));return Jl(null,e,t,!0,r)},wt.hydrateRoot=function(e,t,r){if(!hu(e))throw Error(i(405));var l=r!=null&&r.hydratedSources||null,a=!1,c="",p=sp;if(r!=null&&(r.unstable_strictMode===!0&&(a=!0),r.identifierPrefix!==void 0&&(c=r.identifierPrefix),r.onRecoverableError!==void 0&&(p=r.onRecoverableError)),t=rp(t,null,e,1,r??null,a,!1,c,p),e[cr]=t.current,oo(e),l)for(e=0;e<l.length;e++)r=l[e],a=r._getVersion,a=a(r._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[r,a]:t.mutableSourceEagerHydrationData.push(r,a);return new Zl(t)},wt.render=function(e,t,r){if(!Yl(t))throw Error(i(200));return Jl(null,e,t,!1,r)},wt.unmountComponentAtNode=function(e){if(!Yl(e))throw Error(i(40));return e._reactRootContainer?(xn(function(){Jl(null,null,e,!1,function(){e._reactRootContainer=null,e[cr]=null})}),!0):!1},wt.unstable_batchedUpdates=ou,wt.unstable_renderSubtreeIntoContainer=function(e,t,r,l){if(!Yl(r))throw Error(i(200));if(e==null||e._reactInternals===void 0)throw Error(i(38));return Jl(e,t,r,!1,l)},wt.version="18.3.1-next-f1338f8080-20240426",wt}var hp;function dh(){if(hp)return yu.exports;hp=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(o){console.error(o)}}return s(),yu.exports=bx(),yu.exports}var mp;function wx(){if(mp)return ti;mp=1;var s=dh();return ti.createRoot=s.createRoot,ti.hydrateRoot=s.hydrateRoot,ti}var jx=wx();const kx=uh(jx);var Ho=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(s){return this.listeners.add(s),this.onSubscribe(),()=>{this.listeners.delete(s),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Nn,qr,bs,Xp,Nx=(Xp=class extends Ho{constructor(){super();ye(this,Nn);ye(this,qr);ye(this,bs);se(this,bs,o=>{if(typeof window<"u"&&window.addEventListener){const i=()=>o();return window.addEventListener("visibilitychange",i,!1),()=>{window.removeEventListener("visibilitychange",i)}}})}onSubscribe(){S(this,qr)||this.setEventListener(S(this,bs))}onUnsubscribe(){var o;this.hasListeners()||((o=S(this,qr))==null||o.call(this),se(this,qr,void 0))}setEventListener(o){var i;se(this,bs,o),(i=S(this,qr))==null||i.call(this),se(this,qr,o(u=>{typeof u=="boolean"?this.setFocused(u):this.onFocus()}))}setFocused(o){S(this,Nn)!==o&&(se(this,Nn,o),this.onFocus())}onFocus(){const o=this.isFocused();this.listeners.forEach(i=>{i(o)})}isFocused(){var o;return typeof S(this,Nn)=="boolean"?S(this,Nn):((o=globalThis.document)==null?void 0:o.visibilityState)!=="hidden"}},Nn=new WeakMap,qr=new WeakMap,bs=new WeakMap,Xp),ac=new Nx,Sx={setTimeout:(s,o)=>setTimeout(s,o),clearTimeout:s=>clearTimeout(s),setInterval:(s,o)=>setInterval(s,o),clearInterval:s=>clearInterval(s)},Zr,oc,eh,Cx=(eh=class{constructor(){ye(this,Zr,Sx);ye(this,oc,!1)}setTimeoutProvider(s){se(this,Zr,s)}setTimeout(s,o){return S(this,Zr).setTimeout(s,o)}clearTimeout(s){S(this,Zr).clearTimeout(s)}setInterval(s,o){return S(this,Zr).setInterval(s,o)}clearInterval(s){S(this,Zr).clearInterval(s)}},Zr=new WeakMap,oc=new WeakMap,eh),kn=new Cx;function Ex(s){setTimeout(s,0)}var Px=typeof window>"u"||"Deno"in globalThis;function kt(){}function _x(s,o){return typeof s=="function"?s(o):s}function Du(s){return typeof s=="number"&&s>=0&&s!==1/0}function fh(s,o){return Math.max(s+(o||0)-Date.now(),0)}function nn(s,o){return typeof s=="function"?s(o):s}function Rt(s,o){return typeof s=="function"?s(o):s}function gp(s,o){const{type:i="all",exact:u,fetchStatus:d,predicate:f,queryKey:m,stale:h}=s;if(m){if(u){if(o.queryHash!==uc(m,o.options))return!1}else if(!Mo(o.queryKey,m))return!1}if(i!=="all"){const v=o.isActive();if(i==="active"&&!v||i==="inactive"&&v)return!1}return!(typeof h=="boolean"&&o.isStale()!==h||d&&d!==o.state.fetchStatus||f&&!f(o))}function xp(s,o){const{exact:i,status:u,predicate:d,mutationKey:f}=s;if(f){if(!o.options.mutationKey)return!1;if(i){if(_o(o.options.mutationKey)!==_o(f))return!1}else if(!Mo(o.options.mutationKey,f))return!1}return!(u&&o.state.status!==u||d&&!d(o))}function uc(s,o){return((o==null?void 0:o.queryKeyHashFn)||_o)(s)}function _o(s){return JSON.stringify(s,(o,i)=>Au(i)?Object.keys(i).sort().reduce((u,d)=>(u[d]=i[d],u),{}):i)}function Mo(s,o){return s===o?!0:typeof s!=typeof o?!1:s&&o&&typeof s=="object"&&typeof o=="object"?Object.keys(o).every(i=>Mo(s[i],o[i])):!1}var Mx=Object.prototype.hasOwnProperty;function ph(s,o,i=0){if(s===o)return s;if(i>500)return o;const u=yp(s)&&yp(o);if(!u&&!(Au(s)&&Au(o)))return o;const f=(u?s:Object.keys(s)).length,m=u?o:Object.keys(o),h=m.length,v=u?new Array(h):{};let x=0;for(let b=0;b<h;b++){const j=u?b:m[b],M=s[j],D=o[j];if(M===D){v[j]=M,(u?b<f:Mx.call(s,j))&&x++;continue}if(M===null||D===null||typeof M!="object"||typeof D!="object"){v[j]=D;continue}const I=ph(M,D,i+1);v[j]=I,I===M&&x++}return f===h&&x===f?s:v}function Tu(s,o){if(!o||Object.keys(s).length!==Object.keys(o).length)return!1;for(const i in s)if(s[i]!==o[i])return!1;return!0}function yp(s){return Array.isArray(s)&&s.length===Object.keys(s).length}function Au(s){if(!vp(s))return!1;const o=s.constructor;if(o===void 0)return!0;const i=o.prototype;return!(!vp(i)||!i.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(s)!==Object.prototype)}function vp(s){return Object.prototype.toString.call(s)==="[object Object]"}function Rx(s){return new Promise(o=>{kn.setTimeout(o,s)})}function zu(s,o,i){return typeof i.structuralSharing=="function"?i.structuralSharing(s,o):i.structuralSharing!==!1?ph(s,o):o}function Ox(s,o,i=0){const u=[...s,o];return i&&u.length>i?u.slice(1):u}function Dx(s,o,i=0){const u=[o,...s];return i&&u.length>i?u.slice(0,-1):u}var cc=Symbol();function hh(s,o){return!s.queryFn&&(o!=null&&o.initialPromise)?()=>o.initialPromise:!s.queryFn||s.queryFn===cc?()=>Promise.reject(new Error(`Missing queryFn: '${s.queryHash}'`)):s.queryFn}function mh(s,o){return typeof s=="function"?s(...o):!!s}function Tx(s,o,i){let u=!1,d;return Object.defineProperty(s,"signal",{enumerable:!0,get:()=>(d??(d=o()),u||(u=!0,d.aborted?i():d.addEventListener("abort",i,{once:!0})),d)}),s}var Ro=(()=>{let s=()=>Px;return{isServer(){return s()},setIsServer(o){s=o}}})();function Lu(){let s,o;const i=new Promise((d,f)=>{s=d,o=f});i.status="pending",i.catch(()=>{});function u(d){Object.assign(i,d),delete i.resolve,delete i.reject}return i.resolve=d=>{u({status:"fulfilled",value:d}),s(d)},i.reject=d=>{u({status:"rejected",reason:d}),o(d)},i}var Ax=Ex;function zx(){let s=[],o=0,i=h=>{h()},u=h=>{h()},d=Ax;const f=h=>{o?s.push(h):d(()=>{i(h)})},m=()=>{const h=s;s=[],h.length&&d(()=>{u(()=>{h.forEach(v=>{i(v)})})})};return{batch:h=>{let v;o++;try{v=h()}finally{o--,o||m()}return v},batchCalls:h=>(...v)=>{f(()=>{h(...v)})},schedule:f,setNotifyFunction:h=>{i=h},setBatchNotifyFunction:h=>{u=h},setScheduler:h=>{d=h}}}var ot=zx(),ws,Yr,js,th,Lx=(th=class extends Ho{constructor(){super();ye(this,ws,!0);ye(this,Yr);ye(this,js);se(this,js,o=>{if(typeof window<"u"&&window.addEventListener){const i=()=>o(!0),u=()=>o(!1);return window.addEventListener("online",i,!1),window.addEventListener("offline",u,!1),()=>{window.removeEventListener("online",i),window.removeEventListener("offline",u)}}})}onSubscribe(){S(this,Yr)||this.setEventListener(S(this,js))}onUnsubscribe(){var o;this.hasListeners()||((o=S(this,Yr))==null||o.call(this),se(this,Yr,void 0))}setEventListener(o){var i;se(this,js,o),(i=S(this,Yr))==null||i.call(this),se(this,Yr,o(this.setOnline.bind(this)))}setOnline(o){S(this,ws)!==o&&(se(this,ws,o),this.listeners.forEach(u=>{u(o)}))}isOnline(){return S(this,ws)}},ws=new WeakMap,Yr=new WeakMap,js=new WeakMap,th),mi=new Lx;function Ix(s){return Math.min(1e3*2**s,3e4)}function gh(s){return(s??"online")==="online"?mi.isOnline():!0}var Iu=class extends Error{constructor(s){super("CancelledError"),this.revert=s==null?void 0:s.revert,this.silent=s==null?void 0:s.silent}};function xh(s){let o=!1,i=0,u;const d=Lu(),f=()=>d.status!=="pending",m=w=>{var C;if(!f()){const _=new Iu(w);M(_),(C=s.onCancel)==null||C.call(s,_)}},h=()=>{o=!0},v=()=>{o=!1},x=()=>ac.isFocused()&&(s.networkMode==="always"||mi.isOnline())&&s.canRun(),b=()=>gh(s.networkMode)&&s.canRun(),j=w=>{f()||(u==null||u(),d.resolve(w))},M=w=>{f()||(u==null||u(),d.reject(w))},D=()=>new Promise(w=>{var C;u=_=>{(f()||x())&&w(_)},(C=s.onPause)==null||C.call(s)}).then(()=>{var w;u=void 0,f()||(w=s.onContinue)==null||w.call(s)}),I=()=>{if(f())return;let w;const C=i===0?s.initialPromise:void 0;try{w=C??s.fn()}catch(_){w=Promise.reject(_)}Promise.resolve(w).then(j).catch(_=>{var F;if(f())return;const $=s.retry??(Ro.isServer()?0:3),H=s.retryDelay??Ix,z=typeof H=="function"?H(i,_):H,R=$===!0||typeof $=="number"&&i<$||typeof $=="function"&&$(i,_);if(o||!R){M(_);return}i++,(F=s.onFail)==null||F.call(s,i,_),Rx(z).then(()=>x()?void 0:D()).then(()=>{o?M(_):I()})})};return{promise:d,status:()=>d.status,cancel:m,continue:()=>(u==null||u(),d),cancelRetry:h,continueRetry:v,canStart:b,start:()=>(b()?I():D().then(I),d)}}var Sn,rh,yh=(rh=class{constructor(){ye(this,Sn)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Du(this.gcTime)&&se(this,Sn,kn.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(s){this.gcTime=Math.max(this.gcTime||0,s??(Ro.isServer()?1/0:300*1e3))}clearGcTimeout(){S(this,Sn)!==void 0&&(kn.clearTimeout(S(this,Sn)),se(this,Sn,void 0))}},Sn=new WeakMap,rh);function Fx(s){return{onFetch:(o,i)=>{var b,j,M,D,I;const u=o.options,d=(M=(j=(b=o.fetchOptions)==null?void 0:b.meta)==null?void 0:j.fetchMore)==null?void 0:M.direction,f=((D=o.state.data)==null?void 0:D.pages)||[],m=((I=o.state.data)==null?void 0:I.pageParams)||[];let h={pages:[],pageParams:[]},v=0;const x=async()=>{let w=!1;const C=H=>{Tx(H,()=>o.signal,()=>w=!0)},_=hh(o.options,o.fetchOptions),$=async(H,z,R)=>{if(w)return Promise.reject(o.signal.reason);if(z==null&&H.pages.length)return Promise.resolve(H);const K=(()=>{const ke={client:o.client,queryKey:o.queryKey,pageParam:z,direction:R?"backward":"forward",meta:o.options.meta};return C(ke),ke})(),ne=await _(K),{maxPages:ee}=o.options,J=R?Dx:Ox;return{pages:J(H.pages,ne,ee),pageParams:J(H.pageParams,z,ee)}};if(d&&f.length){const H=d==="backward",z=H?Ux:bp,R={pages:f,pageParams:m},F=z(u,R);h=await $(R,F,H)}else{const H=s??f.length;do{const z=v===0?m[0]??u.initialPageParam:bp(u,h);if(v>0&&z==null)break;h=await $(h,z),v++}while(v<H)}return h};o.options.persister?o.fetchFn=()=>{var w,C;return(C=(w=o.options).persister)==null?void 0:C.call(w,x,{client:o.client,queryKey:o.queryKey,meta:o.options.meta,signal:o.signal},i)}:o.fetchFn=x}}}function bp(s,{pages:o,pageParams:i}){const u=o.length-1;return o.length>0?s.getNextPageParam(o[u],o,i[u],i):void 0}function Ux(s,{pages:o,pageParams:i}){var u;return o.length>0?(u=s.getPreviousPageParam)==null?void 0:u.call(s,o[0],o,i[0],i):void 0}var ks,Cn,Ns,Ft,En,rt,Io,Pn,Mt,vh,vr,nh,$x=(nh=class extends yh{constructor(o){super();ye(this,Mt);ye(this,ks);ye(this,Cn);ye(this,Ns);ye(this,Ft);ye(this,En);ye(this,rt);ye(this,Io);ye(this,Pn);se(this,Pn,!1),se(this,Io,o.defaultOptions),this.setOptions(o.options),this.observers=[],se(this,En,o.client),se(this,Ft,S(this,En).getQueryCache()),this.queryKey=o.queryKey,this.queryHash=o.queryHash,se(this,Cn,jp(this.options)),this.state=o.state??S(this,Cn),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return S(this,ks)}get promise(){var o;return(o=S(this,rt))==null?void 0:o.promise}setOptions(o){if(this.options={...S(this,Io),...o},o!=null&&o._type&&se(this,ks,o._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const i=jp(this.options);i.data!==void 0&&(this.setState(wp(i.data,i.dataUpdatedAt)),se(this,Cn,i))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&S(this,Ft).remove(this)}setData(o,i){const u=zu(this.state.data,o,this.options);return Ce(this,Mt,vr).call(this,{data:u,type:"success",dataUpdatedAt:i==null?void 0:i.updatedAt,manual:i==null?void 0:i.manual}),u}setState(o){Ce(this,Mt,vr).call(this,{type:"setState",state:o})}cancel(o){var u,d;const i=(u=S(this,rt))==null?void 0:u.promise;return(d=S(this,rt))==null||d.cancel(o),i?i.then(kt).catch(kt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return S(this,Cn)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(o=>Rt(o.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===cc||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(o=>nn(o.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(o=>o.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(o=0){return this.state.data===void 0?!0:o==="static"?!1:this.state.isInvalidated?!0:!fh(this.state.dataUpdatedAt,o)}onFocus(){var i;const o=this.observers.find(u=>u.shouldFetchOnWindowFocus());o==null||o.refetch({cancelRefetch:!1}),(i=S(this,rt))==null||i.continue()}onOnline(){var i;const o=this.observers.find(u=>u.shouldFetchOnReconnect());o==null||o.refetch({cancelRefetch:!1}),(i=S(this,rt))==null||i.continue()}addObserver(o){this.observers.includes(o)||(this.observers.push(o),this.clearGcTimeout(),S(this,Ft).notify({type:"observerAdded",query:this,observer:o}))}removeObserver(o){this.observers.includes(o)&&(this.observers=this.observers.filter(i=>i!==o),this.observers.length||(S(this,rt)&&(S(this,Pn)||Ce(this,Mt,vh).call(this)?S(this,rt).cancel({revert:!0}):S(this,rt).cancelRetry()),this.scheduleGc()),S(this,Ft).notify({type:"observerRemoved",query:this,observer:o}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Ce(this,Mt,vr).call(this,{type:"invalidate"})}async fetch(o,i){var x,b,j,M,D,I,w,C,_,$,H;if(this.state.fetchStatus!=="idle"&&((x=S(this,rt))==null?void 0:x.status())!=="rejected"){if(this.state.data!==void 0&&(i!=null&&i.cancelRefetch))this.cancel({silent:!0});else if(S(this,rt))return S(this,rt).continueRetry(),S(this,rt).promise}if(o&&this.setOptions(o),!this.options.queryFn){const z=this.observers.find(R=>R.options.queryFn);z&&this.setOptions(z.options)}const u=new AbortController,d=z=>{Object.defineProperty(z,"signal",{enumerable:!0,get:()=>(se(this,Pn,!0),u.signal)})},f=()=>{const z=hh(this.options,i),F=(()=>{const K={client:S(this,En),queryKey:this.queryKey,meta:this.meta};return d(K),K})();return se(this,Pn,!1),this.options.persister?this.options.persister(z,F,this):z(F)},h=(()=>{const z={fetchOptions:i,options:this.options,queryKey:this.queryKey,client:S(this,En),state:this.state,fetchFn:f};return d(z),z})(),v=S(this,ks)==="infinite"?Fx(this.options.pages):this.options.behavior;v==null||v.onFetch(h,this),se(this,Ns,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((b=h.fetchOptions)==null?void 0:b.meta))&&Ce(this,Mt,vr).call(this,{type:"fetch",meta:(j=h.fetchOptions)==null?void 0:j.meta}),se(this,rt,xh({initialPromise:i==null?void 0:i.initialPromise,fn:h.fetchFn,onCancel:z=>{z instanceof Iu&&z.revert&&this.setState({...S(this,Ns),fetchStatus:"idle"}),u.abort()},onFail:(z,R)=>{Ce(this,Mt,vr).call(this,{type:"failed",failureCount:z,error:R})},onPause:()=>{Ce(this,Mt,vr).call(this,{type:"pause"})},onContinue:()=>{Ce(this,Mt,vr).call(this,{type:"continue"})},retry:h.options.retry,retryDelay:h.options.retryDelay,networkMode:h.options.networkMode,canRun:()=>!0}));try{const z=await S(this,rt).start();if(z===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(z),(D=(M=S(this,Ft).config).onSuccess)==null||D.call(M,z,this),(w=(I=S(this,Ft).config).onSettled)==null||w.call(I,z,this.state.error,this),z}catch(z){if(z instanceof Iu){if(z.silent)return S(this,rt).promise;if(z.revert){if(this.state.data===void 0)throw z;return this.state.data}}throw Ce(this,Mt,vr).call(this,{type:"error",error:z}),(_=(C=S(this,Ft).config).onError)==null||_.call(C,z,this),(H=($=S(this,Ft).config).onSettled)==null||H.call($,this.state.data,z,this),z}finally{this.scheduleGc()}}},ks=new WeakMap,Cn=new WeakMap,Ns=new WeakMap,Ft=new WeakMap,En=new WeakMap,rt=new WeakMap,Io=new WeakMap,Pn=new WeakMap,Mt=new WeakSet,vh=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},vr=function(o){const i=u=>{switch(o.type){case"failed":return{...u,fetchFailureCount:o.failureCount,fetchFailureReason:o.error};case"pause":return{...u,fetchStatus:"paused"};case"continue":return{...u,fetchStatus:"fetching"};case"fetch":return{...u,...bh(u.data,this.options),fetchMeta:o.meta??null};case"success":const d={...u,...wp(o.data,o.dataUpdatedAt),dataUpdateCount:u.dataUpdateCount+1,...!o.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return se(this,Ns,o.manual?d:void 0),d;case"error":const f=o.error;return{...u,error:f,errorUpdateCount:u.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:u.fetchFailureCount+1,fetchFailureReason:f,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...u,isInvalidated:!0};case"setState":return{...u,...o.state}}};this.state=i(this.state),ot.batch(()=>{this.observers.forEach(u=>{u.onQueryUpdate()}),S(this,Ft).notify({query:this,type:"updated",action:o})})},nh);function bh(s,o){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:gh(o.networkMode)?"fetching":"paused",...s===void 0&&{error:null,status:"pending"}}}function wp(s,o){return{data:s,dataUpdatedAt:o??Date.now(),error:null,isInvalidated:!1,status:"success"}}function jp(s){const o=typeof s.initialData=="function"?s.initialData():s.initialData,i=o!==void 0,u=i?typeof s.initialDataUpdatedAt=="function"?s.initialDataUpdatedAt():s.initialDataUpdatedAt:0;return{data:o,dataUpdateCount:0,dataUpdatedAt:i?u??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:i?"success":"pending",fetchStatus:"idle"}}var jt,Pe,Fo,ht,_n,Ss,br,Jr,Uo,Cs,Es,Mn,Rn,Xr,Ps,Ae,Po,Fu,Uu,$u,Bu,Hu,Wu,Vu,wh,sh,Bx=(sh=class extends Ho{constructor(o,i){super();ye(this,Ae);ye(this,jt);ye(this,Pe);ye(this,Fo);ye(this,ht);ye(this,_n);ye(this,Ss);ye(this,br);ye(this,Jr);ye(this,Uo);ye(this,Cs);ye(this,Es);ye(this,Mn);ye(this,Rn);ye(this,Xr);ye(this,Ps,new Set);this.options=i,se(this,jt,o),se(this,Jr,null),se(this,br,Lu()),this.bindMethods(),this.setOptions(i)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(S(this,Pe).addObserver(this),kp(S(this,Pe),this.options)?Ce(this,Ae,Po).call(this):this.updateResult(),Ce(this,Ae,Bu).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Gu(S(this,Pe),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Gu(S(this,Pe),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Ce(this,Ae,Hu).call(this),Ce(this,Ae,Wu).call(this),S(this,Pe).removeObserver(this)}setOptions(o){const i=this.options,u=S(this,Pe);if(this.options=S(this,jt).defaultQueryOptions(o),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Rt(this.options.enabled,S(this,Pe))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Ce(this,Ae,Vu).call(this),S(this,Pe).setOptions(this.options),i._defaulted&&!Tu(this.options,i)&&S(this,jt).getQueryCache().notify({type:"observerOptionsUpdated",query:S(this,Pe),observer:this});const d=this.hasListeners();d&&Np(S(this,Pe),u,this.options,i)&&Ce(this,Ae,Po).call(this),this.updateResult(),d&&(S(this,Pe)!==u||Rt(this.options.enabled,S(this,Pe))!==Rt(i.enabled,S(this,Pe))||nn(this.options.staleTime,S(this,Pe))!==nn(i.staleTime,S(this,Pe)))&&Ce(this,Ae,Fu).call(this);const f=Ce(this,Ae,Uu).call(this);d&&(S(this,Pe)!==u||Rt(this.options.enabled,S(this,Pe))!==Rt(i.enabled,S(this,Pe))||f!==S(this,Xr))&&Ce(this,Ae,$u).call(this,f)}getOptimisticResult(o){const i=S(this,jt).getQueryCache().build(S(this,jt),o),u=this.createResult(i,o);return Wx(this,u)&&(se(this,ht,u),se(this,Ss,this.options),se(this,_n,S(this,Pe).state)),u}getCurrentResult(){return S(this,ht)}trackResult(o,i){return new Proxy(o,{get:(u,d)=>(this.trackProp(d),i==null||i(d),d==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&S(this,br).status==="pending"&&S(this,br).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(u,d))})}trackProp(o){S(this,Ps).add(o)}getCurrentQuery(){return S(this,Pe)}refetch({...o}={}){return this.fetch({...o})}fetchOptimistic(o){const i=S(this,jt).defaultQueryOptions(o),u=S(this,jt).getQueryCache().build(S(this,jt),i);return u.fetch().then(()=>this.createResult(u,i))}fetch(o){return Ce(this,Ae,Po).call(this,{...o,cancelRefetch:o.cancelRefetch??!0}).then(()=>(this.updateResult(),S(this,ht)))}createResult(o,i){var ee;const u=S(this,Pe),d=this.options,f=S(this,ht),m=S(this,_n),h=S(this,Ss),x=o!==u?o.state:S(this,Fo),{state:b}=o;let j={...b},M=!1,D;if(i._optimisticResults){const J=this.hasListeners(),ke=!J&&kp(o,i),ue=J&&Np(o,u,i,d);(ke||ue)&&(j={...j,...bh(b.data,o.options)}),i._optimisticResults==="isRestoring"&&(j.fetchStatus="idle")}let{error:I,errorUpdatedAt:w,status:C}=j;D=j.data;let _=!1;if(i.placeholderData!==void 0&&D===void 0&&C==="pending"){let J;f!=null&&f.isPlaceholderData&&i.placeholderData===(h==null?void 0:h.placeholderData)?(J=f.data,_=!0):J=typeof i.placeholderData=="function"?i.placeholderData((ee=S(this,Es))==null?void 0:ee.state.data,S(this,Es)):i.placeholderData,J!==void 0&&(C="success",D=zu(f==null?void 0:f.data,J,i),M=!0)}if(i.select&&D!==void 0&&!_)if(f&&D===(m==null?void 0:m.data)&&i.select===S(this,Uo))D=S(this,Cs);else try{se(this,Uo,i.select),D=i.select(D),D=zu(f==null?void 0:f.data,D,i),se(this,Cs,D),se(this,Jr,null)}catch(J){se(this,Jr,J)}S(this,Jr)&&(I=S(this,Jr),D=S(this,Cs),w=Date.now(),C="error");const $=j.fetchStatus==="fetching",H=C==="pending",z=C==="error",R=H&&$,F=D!==void 0,ne={status:C,fetchStatus:j.fetchStatus,isPending:H,isSuccess:C==="success",isError:z,isInitialLoading:R,isLoading:R,data:D,dataUpdatedAt:j.dataUpdatedAt,error:I,errorUpdatedAt:w,failureCount:j.fetchFailureCount,failureReason:j.fetchFailureReason,errorUpdateCount:j.errorUpdateCount,isFetched:o.isFetched(),isFetchedAfterMount:j.dataUpdateCount>x.dataUpdateCount||j.errorUpdateCount>x.errorUpdateCount,isFetching:$,isRefetching:$&&!H,isLoadingError:z&&!F,isPaused:j.fetchStatus==="paused",isPlaceholderData:M,isRefetchError:z&&F,isStale:dc(o,i),refetch:this.refetch,promise:S(this,br),isEnabled:Rt(i.enabled,o)!==!1};if(this.options.experimental_prefetchInRender){const J=ne.data!==void 0,ke=ne.status==="error"&&!J,ue=Oe=>{ke?Oe.reject(ne.error):J&&Oe.resolve(ne.data)},Le=()=>{const Oe=se(this,br,ne.promise=Lu());ue(Oe)},_e=S(this,br);switch(_e.status){case"pending":o.queryHash===u.queryHash&&ue(_e);break;case"fulfilled":(ke||ne.data!==_e.value)&&Le();break;case"rejected":(!ke||ne.error!==_e.reason)&&Le();break}}return ne}updateResult(){const o=S(this,ht),i=this.createResult(S(this,Pe),this.options);if(se(this,_n,S(this,Pe).state),se(this,Ss,this.options),S(this,_n).data!==void 0&&se(this,Es,S(this,Pe)),Tu(i,o))return;se(this,ht,i);const u=()=>{if(!o)return!0;const{notifyOnChangeProps:d}=this.options,f=typeof d=="function"?d():d;if(f==="all"||!f&&!S(this,Ps).size)return!0;const m=new Set(f??S(this,Ps));return this.options.throwOnError&&m.add("error"),Object.keys(S(this,ht)).some(h=>{const v=h;return S(this,ht)[v]!==o[v]&&m.has(v)})};Ce(this,Ae,wh).call(this,{listeners:u()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Ce(this,Ae,Bu).call(this)}},jt=new WeakMap,Pe=new WeakMap,Fo=new WeakMap,ht=new WeakMap,_n=new WeakMap,Ss=new WeakMap,br=new WeakMap,Jr=new WeakMap,Uo=new WeakMap,Cs=new WeakMap,Es=new WeakMap,Mn=new WeakMap,Rn=new WeakMap,Xr=new WeakMap,Ps=new WeakMap,Ae=new WeakSet,Po=function(o){Ce(this,Ae,Vu).call(this);let i=S(this,Pe).fetch(this.options,o);return o!=null&&o.throwOnError||(i=i.catch(kt)),i},Fu=function(){Ce(this,Ae,Hu).call(this);const o=nn(this.options.staleTime,S(this,Pe));if(Ro.isServer()||S(this,ht).isStale||!Du(o))return;const u=fh(S(this,ht).dataUpdatedAt,o)+1;se(this,Mn,kn.setTimeout(()=>{S(this,ht).isStale||this.updateResult()},u))},Uu=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(S(this,Pe)):this.options.refetchInterval)??!1},$u=function(o){Ce(this,Ae,Wu).call(this),se(this,Xr,o),!(Ro.isServer()||Rt(this.options.enabled,S(this,Pe))===!1||!Du(S(this,Xr))||S(this,Xr)===0)&&se(this,Rn,kn.setInterval(()=>{(this.options.refetchIntervalInBackground||ac.isFocused())&&Ce(this,Ae,Po).call(this)},S(this,Xr)))},Bu=function(){Ce(this,Ae,Fu).call(this),Ce(this,Ae,$u).call(this,Ce(this,Ae,Uu).call(this))},Hu=function(){S(this,Mn)!==void 0&&(kn.clearTimeout(S(this,Mn)),se(this,Mn,void 0))},Wu=function(){S(this,Rn)!==void 0&&(kn.clearInterval(S(this,Rn)),se(this,Rn,void 0))},Vu=function(){const o=S(this,jt).getQueryCache().build(S(this,jt),this.options);if(o===S(this,Pe))return;const i=S(this,Pe);se(this,Pe,o),se(this,Fo,o.state),this.hasListeners()&&(i==null||i.removeObserver(this),o.addObserver(this))},wh=function(o){ot.batch(()=>{o.listeners&&this.listeners.forEach(i=>{i(S(this,ht))}),S(this,jt).getQueryCache().notify({query:S(this,Pe),type:"observerResultsUpdated"})})},sh);function Hx(s,o){return Rt(o.enabled,s)!==!1&&s.state.data===void 0&&!(s.state.status==="error"&&Rt(o.retryOnMount,s)===!1)}function kp(s,o){return Hx(s,o)||s.state.data!==void 0&&Gu(s,o,o.refetchOnMount)}function Gu(s,o,i){if(Rt(o.enabled,s)!==!1&&nn(o.staleTime,s)!=="static"){const u=typeof i=="function"?i(s):i;return u==="always"||u!==!1&&dc(s,o)}return!1}function Np(s,o,i,u){return(s!==o||Rt(u.enabled,s)===!1)&&(!i.suspense||s.state.status!=="error")&&dc(s,i)}function dc(s,o){return Rt(o.enabled,s)!==!1&&s.isStaleByTime(nn(o.staleTime,s))}function Wx(s,o){return!Tu(s.getCurrentResult(),o)}var $o,rr,dt,On,nr,Kr,oh,Vx=(oh=class extends yh{constructor(o){super();ye(this,nr);ye(this,$o);ye(this,rr);ye(this,dt);ye(this,On);se(this,$o,o.client),this.mutationId=o.mutationId,se(this,dt,o.mutationCache),se(this,rr,[]),this.state=o.state||Gx(),this.setOptions(o.options),this.scheduleGc()}setOptions(o){this.options=o,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(o){S(this,rr).includes(o)||(S(this,rr).push(o),this.clearGcTimeout(),S(this,dt).notify({type:"observerAdded",mutation:this,observer:o}))}removeObserver(o){se(this,rr,S(this,rr).filter(i=>i!==o)),this.scheduleGc(),S(this,dt).notify({type:"observerRemoved",mutation:this,observer:o})}optionalRemove(){S(this,rr).length||(this.state.status==="pending"?this.scheduleGc():S(this,dt).remove(this))}continue(){var o;return((o=S(this,On))==null?void 0:o.continue())??this.execute(this.state.variables)}async execute(o){var m,h,v,x,b,j,M,D,I,w,C,_,$,H,z,R,F,K;const i=()=>{Ce(this,nr,Kr).call(this,{type:"continue"})},u={client:S(this,$o),meta:this.options.meta,mutationKey:this.options.mutationKey};se(this,On,xh({fn:()=>this.options.mutationFn?this.options.mutationFn(o,u):Promise.reject(new Error("No mutationFn found")),onFail:(ne,ee)=>{Ce(this,nr,Kr).call(this,{type:"failed",failureCount:ne,error:ee})},onPause:()=>{Ce(this,nr,Kr).call(this,{type:"pause"})},onContinue:i,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>S(this,dt).canRun(this)}));const d=this.state.status==="pending",f=!S(this,On).canStart();try{if(d)i();else{Ce(this,nr,Kr).call(this,{type:"pending",variables:o,isPaused:f}),S(this,dt).config.onMutate&&await S(this,dt).config.onMutate(o,this,u);const ee=await((h=(m=this.options).onMutate)==null?void 0:h.call(m,o,u));ee!==this.state.context&&Ce(this,nr,Kr).call(this,{type:"pending",context:ee,variables:o,isPaused:f})}const ne=await S(this,On).start();return await((x=(v=S(this,dt).config).onSuccess)==null?void 0:x.call(v,ne,o,this.state.context,this,u)),await((j=(b=this.options).onSuccess)==null?void 0:j.call(b,ne,o,this.state.context,u)),await((D=(M=S(this,dt).config).onSettled)==null?void 0:D.call(M,ne,null,this.state.variables,this.state.context,this,u)),await((w=(I=this.options).onSettled)==null?void 0:w.call(I,ne,null,o,this.state.context,u)),Ce(this,nr,Kr).call(this,{type:"success",data:ne}),ne}catch(ne){try{await((_=(C=S(this,dt).config).onError)==null?void 0:_.call(C,ne,o,this.state.context,this,u))}catch(ee){Promise.reject(ee)}try{await((H=($=this.options).onError)==null?void 0:H.call($,ne,o,this.state.context,u))}catch(ee){Promise.reject(ee)}try{await((R=(z=S(this,dt).config).onSettled)==null?void 0:R.call(z,void 0,ne,this.state.variables,this.state.context,this,u))}catch(ee){Promise.reject(ee)}try{await((K=(F=this.options).onSettled)==null?void 0:K.call(F,void 0,ne,o,this.state.context,u))}catch(ee){Promise.reject(ee)}throw Ce(this,nr,Kr).call(this,{type:"error",error:ne}),ne}finally{S(this,dt).runNext(this)}}},$o=new WeakMap,rr=new WeakMap,dt=new WeakMap,On=new WeakMap,nr=new WeakSet,Kr=function(o){const i=u=>{switch(o.type){case"failed":return{...u,failureCount:o.failureCount,failureReason:o.error};case"pause":return{...u,isPaused:!0};case"continue":return{...u,isPaused:!1};case"pending":return{...u,context:o.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:o.isPaused,status:"pending",variables:o.variables,submittedAt:Date.now()};case"success":return{...u,data:o.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...u,data:void 0,error:o.error,failureCount:u.failureCount+1,failureReason:o.error,isPaused:!1,status:"error"}}};this.state=i(this.state),ot.batch(()=>{S(this,rr).forEach(u=>{u.onMutationUpdate(o)}),S(this,dt).notify({mutation:this,type:"updated",action:o})})},oh);function Gx(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var wr,Qt,Bo,lh,Kx=(lh=class extends Ho{constructor(o={}){super();ye(this,wr);ye(this,Qt);ye(this,Bo);this.config=o,se(this,wr,new Set),se(this,Qt,new Map),se(this,Bo,0)}build(o,i,u){const d=new Vx({client:o,mutationCache:this,mutationId:++ei(this,Bo)._,options:o.defaultMutationOptions(i),state:u});return this.add(d),d}add(o){S(this,wr).add(o);const i=ri(o);if(typeof i=="string"){const u=S(this,Qt).get(i);u?u.push(o):S(this,Qt).set(i,[o])}this.notify({type:"added",mutation:o})}remove(o){if(S(this,wr).delete(o)){const i=ri(o);if(typeof i=="string"){const u=S(this,Qt).get(i);if(u)if(u.length>1){const d=u.indexOf(o);d!==-1&&u.splice(d,1)}else u[0]===o&&S(this,Qt).delete(i)}}this.notify({type:"removed",mutation:o})}canRun(o){const i=ri(o);if(typeof i=="string"){const u=S(this,Qt).get(i),d=u==null?void 0:u.find(f=>f.state.status==="pending");return!d||d===o}else return!0}runNext(o){var u;const i=ri(o);if(typeof i=="string"){const d=(u=S(this,Qt).get(i))==null?void 0:u.find(f=>f!==o&&f.state.isPaused);return(d==null?void 0:d.continue())??Promise.resolve()}else return Promise.resolve()}clear(){ot.batch(()=>{S(this,wr).forEach(o=>{this.notify({type:"removed",mutation:o})}),S(this,wr).clear(),S(this,Qt).clear()})}getAll(){return Array.from(S(this,wr))}find(o){const i={exact:!0,...o};return this.getAll().find(u=>xp(i,u))}findAll(o={}){return this.getAll().filter(i=>xp(o,i))}notify(o){ot.batch(()=>{this.listeners.forEach(i=>{i(o)})})}resumePausedMutations(){const o=this.getAll().filter(i=>i.state.isPaused);return ot.batch(()=>Promise.all(o.map(i=>i.continue().catch(kt))))}},wr=new WeakMap,Qt=new WeakMap,Bo=new WeakMap,lh);function ri(s){var o;return(o=s.options.scope)==null?void 0:o.id}var sr,ih,Qx=(ih=class extends Ho{constructor(o={}){super();ye(this,sr);this.config=o,se(this,sr,new Map)}build(o,i,u){const d=i.queryKey,f=i.queryHash??uc(d,i);let m=this.get(f);return m||(m=new $x({client:o,queryKey:d,queryHash:f,options:o.defaultQueryOptions(i),state:u,defaultOptions:o.getQueryDefaults(d)}),this.add(m)),m}add(o){S(this,sr).has(o.queryHash)||(S(this,sr).set(o.queryHash,o),this.notify({type:"added",query:o}))}remove(o){const i=S(this,sr).get(o.queryHash);i&&(o.destroy(),i===o&&S(this,sr).delete(o.queryHash),this.notify({type:"removed",query:o}))}clear(){ot.batch(()=>{this.getAll().forEach(o=>{this.remove(o)})})}get(o){return S(this,sr).get(o)}getAll(){return[...S(this,sr).values()]}find(o){const i={exact:!0,...o};return this.getAll().find(u=>gp(i,u))}findAll(o={}){const i=this.getAll();return Object.keys(o).length>0?i.filter(u=>gp(o,u)):i}notify(o){ot.batch(()=>{this.listeners.forEach(i=>{i(o)})})}onFocus(){ot.batch(()=>{this.getAll().forEach(o=>{o.onFocus()})})}onOnline(){ot.batch(()=>{this.getAll().forEach(o=>{o.onOnline()})})}},sr=new WeakMap,ih),Ke,en,tn,_s,Ms,rn,Rs,Os,ah,qx=(ah=class{constructor(s={}){ye(this,Ke);ye(this,en);ye(this,tn);ye(this,_s);ye(this,Ms);ye(this,rn);ye(this,Rs);ye(this,Os);se(this,Ke,s.queryCache||new Qx),se(this,en,s.mutationCache||new Kx),se(this,tn,s.defaultOptions||{}),se(this,_s,new Map),se(this,Ms,new Map),se(this,rn,0)}mount(){ei(this,rn)._++,S(this,rn)===1&&(se(this,Rs,ac.subscribe(async s=>{s&&(await this.resumePausedMutations(),S(this,Ke).onFocus())})),se(this,Os,mi.subscribe(async s=>{s&&(await this.resumePausedMutations(),S(this,Ke).onOnline())})))}unmount(){var s,o;ei(this,rn)._--,S(this,rn)===0&&((s=S(this,Rs))==null||s.call(this),se(this,Rs,void 0),(o=S(this,Os))==null||o.call(this),se(this,Os,void 0))}isFetching(s){return S(this,Ke).findAll({...s,fetchStatus:"fetching"}).length}isMutating(s){return S(this,en).findAll({...s,status:"pending"}).length}getQueryData(s){var i;const o=this.defaultQueryOptions({queryKey:s});return(i=S(this,Ke).get(o.queryHash))==null?void 0:i.state.data}ensureQueryData(s){const o=this.defaultQueryOptions(s),i=S(this,Ke).build(this,o),u=i.state.data;return u===void 0?this.fetchQuery(s):(s.revalidateIfStale&&i.isStaleByTime(nn(o.staleTime,i))&&this.prefetchQuery(o),Promise.resolve(u))}getQueriesData(s){return S(this,Ke).findAll(s).map(({queryKey:o,state:i})=>{const u=i.data;return[o,u]})}setQueryData(s,o,i){const u=this.defaultQueryOptions({queryKey:s}),d=S(this,Ke).get(u.queryHash),f=d==null?void 0:d.state.data,m=_x(o,f);if(m!==void 0)return S(this,Ke).build(this,u).setData(m,{...i,manual:!0})}setQueriesData(s,o,i){return ot.batch(()=>S(this,Ke).findAll(s).map(({queryKey:u})=>[u,this.setQueryData(u,o,i)]))}getQueryState(s){var i;const o=this.defaultQueryOptions({queryKey:s});return(i=S(this,Ke).get(o.queryHash))==null?void 0:i.state}removeQueries(s){const o=S(this,Ke);ot.batch(()=>{o.findAll(s).forEach(i=>{o.remove(i)})})}resetQueries(s,o){const i=S(this,Ke);return ot.batch(()=>(i.findAll(s).forEach(u=>{u.reset()}),this.refetchQueries({type:"active",...s},o)))}cancelQueries(s,o={}){const i={revert:!0,...o},u=ot.batch(()=>S(this,Ke).findAll(s).map(d=>d.cancel(i)));return Promise.all(u).then(kt).catch(kt)}invalidateQueries(s,o={}){return ot.batch(()=>(S(this,Ke).findAll(s).forEach(i=>{i.invalidate()}),(s==null?void 0:s.refetchType)==="none"?Promise.resolve():this.refetchQueries({...s,type:(s==null?void 0:s.refetchType)??(s==null?void 0:s.type)??"active"},o)))}refetchQueries(s,o={}){const i={...o,cancelRefetch:o.cancelRefetch??!0},u=ot.batch(()=>S(this,Ke).findAll(s).filter(d=>!d.isDisabled()&&!d.isStatic()).map(d=>{let f=d.fetch(void 0,i);return i.throwOnError||(f=f.catch(kt)),d.state.fetchStatus==="paused"?Promise.resolve():f}));return Promise.all(u).then(kt)}fetchQuery(s){const o=this.defaultQueryOptions(s);o.retry===void 0&&(o.retry=!1);const i=S(this,Ke).build(this,o);return i.isStaleByTime(nn(o.staleTime,i))?i.fetch(o):Promise.resolve(i.state.data)}prefetchQuery(s){return this.fetchQuery(s).then(kt).catch(kt)}fetchInfiniteQuery(s){return s._type="infinite",this.fetchQuery(s)}prefetchInfiniteQuery(s){return this.fetchInfiniteQuery(s).then(kt).catch(kt)}ensureInfiniteQueryData(s){return s._type="infinite",this.ensureQueryData(s)}resumePausedMutations(){return mi.isOnline()?S(this,en).resumePausedMutations():Promise.resolve()}getQueryCache(){return S(this,Ke)}getMutationCache(){return S(this,en)}getDefaultOptions(){return S(this,tn)}setDefaultOptions(s){se(this,tn,s)}setQueryDefaults(s,o){S(this,_s).set(_o(s),{queryKey:s,defaultOptions:o})}getQueryDefaults(s){const o=[...S(this,_s).values()],i={};return o.forEach(u=>{Mo(s,u.queryKey)&&Object.assign(i,u.defaultOptions)}),i}setMutationDefaults(s,o){S(this,Ms).set(_o(s),{mutationKey:s,defaultOptions:o})}getMutationDefaults(s){const o=[...S(this,Ms).values()],i={};return o.forEach(u=>{Mo(s,u.mutationKey)&&Object.assign(i,u.defaultOptions)}),i}defaultQueryOptions(s){if(s._defaulted)return s;const o={...S(this,tn).queries,...this.getQueryDefaults(s.queryKey),...s,_defaulted:!0};return o.queryHash||(o.queryHash=uc(o.queryKey,o)),o.refetchOnReconnect===void 0&&(o.refetchOnReconnect=o.networkMode!=="always"),o.throwOnError===void 0&&(o.throwOnError=!!o.suspense),!o.networkMode&&o.persister&&(o.networkMode="offlineFirst"),o.queryFn===cc&&(o.enabled=!1),o}defaultMutationOptions(s){return s!=null&&s._defaulted?s:{...S(this,tn).mutations,...(s==null?void 0:s.mutationKey)&&this.getMutationDefaults(s.mutationKey),...s,_defaulted:!0}}clear(){S(this,Ke).clear(),S(this,en).clear()}},Ke=new WeakMap,en=new WeakMap,tn=new WeakMap,_s=new WeakMap,Ms=new WeakMap,rn=new WeakMap,Rs=new WeakMap,Os=new WeakMap,ah),jh=g.createContext(void 0),zs=s=>{const o=g.useContext(jh);if(!o)throw new Error("No QueryClient set, use QueryClientProvider to set one");return o},Zx=({client:s,children:o})=>(g.useEffect(()=>(s.mount(),()=>{s.unmount()}),[s]),n.jsx(jh.Provider,{value:s,children:o})),kh=g.createContext(!1),Yx=()=>g.useContext(kh);kh.Provider;function Jx(){let s=!1;return{clearReset:()=>{s=!1},reset:()=>{s=!0},isReset:()=>s}}var Xx=g.createContext(Jx()),e0=()=>g.useContext(Xx),t0=(s,o,i)=>{const u=i!=null&&i.state.error&&typeof s.throwOnError=="function"?mh(s.throwOnError,[i.state.error,i]):s.throwOnError;(s.suspense||s.experimental_prefetchInRender||u)&&(o.isReset()||(s.retryOnMount=!1))},r0=s=>{g.useEffect(()=>{s.clearReset()},[s])},n0=({result:s,errorResetBoundary:o,throwOnError:i,query:u,suspense:d})=>s.isError&&!o.isReset()&&!s.isFetching&&u&&(d&&s.data===void 0||mh(i,[s.error,u])),s0=s=>{if(s.suspense){const i=d=>d==="static"?d:Math.max(d??1e3,1e3),u=s.staleTime;s.staleTime=typeof u=="function"?(...d)=>i(u(...d)):i(u),typeof s.gcTime=="number"&&(s.gcTime=Math.max(s.gcTime,1e3))}},o0=(s,o)=>s.isLoading&&s.isFetching&&!o,l0=(s,o)=>(s==null?void 0:s.suspense)&&o.isPending,Sp=(s,o,i)=>o.fetchOptimistic(s).catch(()=>{i.clearReset()});function i0(s,o,i){var D,I,w,C;const u=Yx(),d=e0(),f=zs(),m=f.defaultQueryOptions(s);(I=(D=f.getDefaultOptions().queries)==null?void 0:D._experimental_beforeQuery)==null||I.call(D,m);const h=f.getQueryCache().get(m.queryHash),v=s.subscribed!==!1;m._optimisticResults=u?"isRestoring":v?"optimistic":void 0,s0(m),t0(m,d,h),r0(d);const x=!f.getQueryCache().get(m.queryHash),[b]=g.useState(()=>new o(f,m)),j=b.getOptimisticResult(m),M=!u&&v;if(g.useSyncExternalStore(g.useCallback(_=>{const $=M?b.subscribe(ot.batchCalls(_)):kt;return b.updateResult(),$},[b,M]),()=>b.getCurrentResult(),()=>b.getCurrentResult()),g.useEffect(()=>{b.setOptions(m)},[m,b]),l0(m,j))throw Sp(m,b,d);if(n0({result:j,errorResetBoundary:d,throwOnError:m.throwOnError,query:h,suspense:m.suspense}))throw j.error;if((C=(w=f.getDefaultOptions().queries)==null?void 0:w._experimental_afterQuery)==null||C.call(w,m,j),m.experimental_prefetchInRender&&!Ro.isServer()&&o0(j,u)){const _=x?Sp(m,b,d):h==null?void 0:h.promise;_==null||_.catch(kt).finally(()=>{b.updateResult()})}return m.notifyOnChangeProps?j:b.trackResult(j)}function lr(s,o){return i0(s,Bx)}/**
* @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 a0=s=>s.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Nh=(...s)=>s.filter((o,i,u)=>!!o&&o.trim()!==""&&u.indexOf(o)===i).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 u0={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 c0=g.forwardRef(({color:s="currentColor",size:o=24,strokeWidth:i=2,absoluteStrokeWidth:u,className:d="",children:f,iconNode:m,...h},v)=>g.createElement("svg",{ref:v,...u0,width:o,height:o,stroke:s,strokeWidth:u?Number(i)*24/Number(o):i,className:Nh("lucide",d),...h},[...m.map(([x,b])=>g.createElement(x,b)),...Array.isArray(f)?f:[f]]));/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ve=(s,o)=>{const i=g.forwardRef(({className:u,...d},f)=>g.createElement(c0,{ref:f,iconNode:o,className:Nh(`lucide-${a0(s)}`,u),...d}));return i.displayName=`${s}`,i};/**
* @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=ve("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 Cp=ve("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
* @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=ve("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 Oo=ve("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 d0=ve("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 Do=ve("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 Ds=ve("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 f0=ve("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 p0=ve("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 h0=ve("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 m0=ve("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 g0=ve("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 x0=ve("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 Ku=ve("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 y0=ve("Coins",[["circle",{cx:"8",cy:"8",r:"6",key:"3yglwk"}],["path",{d:"M18.09 10.37A6 6 0 1 1 10.34 18",key:"t5s6rm"}],["path",{d:"M7 6h1v4",key:"1obek4"}],["path",{d:"m16.71 13.88.7.71-2.82 2.82",key:"1rbuyh"}]]);/**
* @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 v0=ve("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 Qu=ve("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 b0=ve("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 Ch=ve("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 Ot=ve("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 Tn=ve("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 xi=ve("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 Ep=ve("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
* @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 qu=ve("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 w0=ve("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 j0=ve("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 Zu=ve("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 k0=ve("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 N0=ve("Key",[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]]);/**
* @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 To=ve("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 S0=ve("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 C0=ve("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 E0=ve("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 Eh=ve("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 Ph=ve("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 Dn=ve("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 P0=ve("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 _0=ve("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 fc=ve("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 M0=ve("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 R0=ve("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 An=ve("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 O0=ve("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 _h=ve("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 D0=ve("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=ve("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 Yu=ve("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 T0=ve("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["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 A0=ve("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 vi=ve("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 zn=ve("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Ju=[{id:"dashboard",label:"Zentrale",hint:"System- & Stack-Status",icon:S0},{id:"models",label:"Modell-Manager",hint:"Verwalten, laden & Gateway-Routing",icon:d0},{id:"system",label:"Diagnose",hint:"Metriken, Dienste, Logs",icon:Ot},{id:"memory",label:"Gedächtnis",hint:"Geteiltes Memory verwalten",icon:Do},{id:"connect",label:"Verbinden",hint:"IDE-/Agent-Configs erzeugen",icon:E0},{id:"agent",label:"Hermes",hint:"Agent-Status & WebUI öffnen",icon:Oo},{id:"guide",label:"Anleitung",hint:"Einrichten & Vibe-Coding",icon:g0}];var Pp=1,z0=.9,L0=.8,I0=.17,wu=.1,ju=.999,F0=.9999,U0=.99,$0=/[\\\/_+.#"@\[\(\{&]/,B0=/[\\\/_+.#"@\[\(\{&]/g,H0=/[\s-]/,Mh=/[\s-]/g;function Xu(s,o,i,u,d,f,m){if(f===o.length)return d===s.length?Pp:U0;var h=`${d},${f}`;if(m[h]!==void 0)return m[h];for(var v=u.charAt(f),x=i.indexOf(v,d),b=0,j,M,D,I;x>=0;)j=Xu(s,o,i,u,x+1,f+1,m),j>b&&(x===d?j*=Pp:$0.test(s.charAt(x-1))?(j*=L0,D=s.slice(d,x-1).match(B0),D&&d>0&&(j*=Math.pow(ju,D.length))):H0.test(s.charAt(x-1))?(j*=z0,I=s.slice(d,x-1).match(Mh),I&&d>0&&(j*=Math.pow(ju,I.length))):(j*=I0,d>0&&(j*=Math.pow(ju,x-d))),s.charAt(x)!==o.charAt(f)&&(j*=F0)),(j<wu&&i.charAt(x-1)===u.charAt(f+1)||u.charAt(f+1)===u.charAt(f)&&i.charAt(x-1)!==u.charAt(f))&&(M=Xu(s,o,i,u,x+1,f+2,m),M*wu>j&&(j=M*wu)),j>b&&(b=j),x=i.indexOf(v,x+1);return m[h]=b,b}function _p(s){return s.toLowerCase().replace(Mh," ")}function W0(s,o,i){return s=i&&i.length>0?`${s+" "+i.join(" ")}`:s,Xu(s,o,_p(s),_p(o),0,0,{})}function sn(s,o,{checkForDefaultPrevented:i=!0}={}){return function(d){if(s==null||s(d),i===!1||!d.defaultPrevented)return o==null?void 0:o(d)}}function Mp(s,o){if(typeof s=="function")return s(o);s!=null&&(s.current=o)}function Ts(...s){return o=>{let i=!1;const u=s.map(d=>{const f=Mp(d,o);return!i&&typeof f=="function"&&(i=!0),f});if(i)return()=>{for(let d=0;d<u.length;d++){const f=u[d];typeof f=="function"?f():Mp(s[d],null)}}}}function In(...s){return g.useCallback(Ts(...s),s)}function V0(s,o=[]){let i=[];function u(f,m){const h=g.createContext(m);h.displayName=f+"Context";const v=i.length;i=[...i,m];const x=j=>{var _;const{scope:M,children:D,...I}=j,w=((_=M==null?void 0:M[s])==null?void 0:_[v])||h,C=g.useMemo(()=>I,Object.values(I));return n.jsx(w.Provider,{value:C,children:D})};x.displayName=f+"Provider";function b(j,M){var w;const D=((w=M==null?void 0:M[s])==null?void 0:w[v])||h,I=g.useContext(D);if(I)return I;if(m!==void 0)return m;throw new Error(`\`${j}\` must be used within \`${f}\``)}return[x,b]}const d=()=>{const f=i.map(m=>g.createContext(m));return function(h){const v=(h==null?void 0:h[s])||f;return g.useMemo(()=>({[`__scope${s}`]:{...h,[s]:v}}),[h,v])}};return d.scopeName=s,[u,G0(d,...o)]}function G0(...s){const o=s[0];if(s.length===1)return o;const i=()=>{const u=s.map(d=>({useScope:d(),scopeName:d.scopeName}));return function(f){const m=u.reduce((h,{useScope:v,scopeName:x})=>{const j=v(f)[`__scope${x}`];return{...h,...j}},{});return g.useMemo(()=>({[`__scope${o.scopeName}`]:m}),[m])}};return i.scopeName=o.scopeName,i}var Ao=globalThis!=null&&globalThis.document?g.useLayoutEffect:()=>{},K0=ic[" useId ".trim().toString()]||(()=>{}),Q0=0;function jr(s){const[o,i]=g.useState(K0());return Ao(()=>{i(u=>u??String(Q0++))},[s]),o?`radix-${o}`:""}var q0=ic[" useInsertionEffect ".trim().toString()]||Ao;function Z0({prop:s,defaultProp:o,onChange:i=()=>{},caller:u}){const[d,f,m]=Y0({defaultProp:o,onChange:i}),h=s!==void 0,v=h?s:d;{const b=g.useRef(s!==void 0);g.useEffect(()=>{const j=b.current;j!==h&&console.warn(`${u} is changing from ${j?"controlled":"uncontrolled"} to ${h?"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.`),b.current=h},[h,u])}const x=g.useCallback(b=>{var j;if(h){const M=J0(b)?b(s):b;M!==s&&((j=m.current)==null||j.call(m,M))}else f(b)},[h,s,f,m]);return[v,x]}function Y0({defaultProp:s,onChange:o}){const[i,u]=g.useState(s),d=g.useRef(i),f=g.useRef(o);return q0(()=>{f.current=o},[o]),g.useEffect(()=>{var m;d.current!==i&&((m=f.current)==null||m.call(f,i),d.current=i)},[i,d]),[i,u,f]}function J0(s){return typeof s=="function"}var Rh=dh();function Oh(s){const o=g.forwardRef((i,u)=>{let{children:d,...f}=i,m=null,h=!1;const v=[];Rp(d)&&typeof ni=="function"&&(d=ni(d._payload)),g.Children.forEach(d,M=>{var D;if(ny(M)){h=!0;const I=M;let w="child"in I.props?I.props.child:I.props.children;Rp(w)&&typeof ni=="function"&&(w=ni(w._payload)),m=ey(I,w),v.push((D=m==null?void 0:m.props)==null?void 0:D.children)}else v.push(M)}),m?m=g.cloneElement(m,void 0,v):!h&&g.Children.count(d)===1&&g.isValidElement(d)&&(m=d);const x=m?ry(m):void 0,b=In(u,x);if(!m){if(d||d===0)throw new Error(h?iy(s):ly(s));return d}const j=ty(f,m.props??{});return m.type!==g.Fragment&&(j.ref=u?b:x),g.cloneElement(m,j)});return o.displayName=`${s}.Slot`,o}var X0=Symbol.for("radix.slottable"),ey=(s,o)=>{if("child"in s.props){const i=s.props.child;return g.isValidElement(i)?g.cloneElement(i,void 0,s.props.children(i.props.children)):null}return g.isValidElement(o)?o:null};function ty(s,o){const i={...o};for(const u in o){const d=s[u],f=o[u];/^on[A-Z]/.test(u)?d&&f?i[u]=(...h)=>{const v=f(...h);return d(...h),v}:d&&(i[u]=d):u==="style"?i[u]={...d,...f}:u==="className"&&(i[u]=[d,f].filter(Boolean).join(" "))}return{...s,...i}}function ry(s){var u,d;let o=(u=Object.getOwnPropertyDescriptor(s.props,"ref"))==null?void 0:u.get,i=o&&"isReactWarning"in o&&o.isReactWarning;return i?s.ref:(o=(d=Object.getOwnPropertyDescriptor(s,"ref"))==null?void 0:d.get,i=o&&"isReactWarning"in o&&o.isReactWarning,i?s.props.ref:s.props.ref||s.ref)}function ny(s){return g.isValidElement(s)&&typeof s.type=="function"&&"__radixId"in s.type&&s.type.__radixId===X0}var sy=Symbol.for("react.lazy");function Rp(s){return s!=null&&typeof s=="object"&&"$$typeof"in s&&s.$$typeof===sy&&"_payload"in s&&oy(s._payload)}function oy(s){return typeof s=="object"&&s!==null&&"then"in s}var ly=s=>`${s} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,iy=s=>`${s} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,ni=ic[" use ".trim().toString()],ay=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],lt=ay.reduce((s,o)=>{const i=Oh(`Primitive.${o}`),u=g.forwardRef((d,f)=>{const{asChild:m,...h}=d,v=m?i:o;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),n.jsx(v,{...h,ref:f})});return u.displayName=`Primitive.${o}`,{...s,[o]:u}},{});function uy(s,o){s&&Rh.flushSync(()=>s.dispatchEvent(o))}function zo(s){const o=g.useRef(s);return g.useEffect(()=>{o.current=s}),g.useMemo(()=>((...i)=>{var u;return(u=o.current)==null?void 0:u.call(o,...i)}),[])}function cy(s,o=globalThis==null?void 0:globalThis.document){const i=zo(s);g.useEffect(()=>{const u=d=>{d.key==="Escape"&&i(d)};return o.addEventListener("keydown",u,{capture:!0}),()=>o.removeEventListener("keydown",u,{capture:!0})},[i,o])}var dy="DismissableLayer",ec="dismissableLayer.update",fy="dismissableLayer.pointerDownOutside",py="dismissableLayer.focusOutside",Op,pc=g.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Dh=g.forwardRef((s,o)=>{const{disableOutsidePointerEvents:i=!1,deferPointerDownOutside:u=!1,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:m,onInteractOutside:h,onDismiss:v,...x}=s,b=g.useContext(pc),[j,M]=g.useState(null),D=(j==null?void 0:j.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,I]=g.useState({}),w=In(o,ee=>M(ee)),C=Array.from(b.layers),[_]=[...b.layersWithOutsidePointerEventsDisabled].slice(-1),$=C.indexOf(_),H=j?C.indexOf(j):-1,z=b.layersWithOutsidePointerEventsDisabled.size>0,R=H>=$,F=g.useRef(!1),K=xy(ee=>{const J=ee.target;if(!(J instanceof Node))return;const ke=[...b.branches].some(ue=>ue.contains(J));!R||ke||(f==null||f(ee),h==null||h(ee),ee.defaultPrevented||v==null||v())},{ownerDocument:D,deferPointerDownOutside:u,isDeferredPointerDownOutsideRef:F,dismissableSurfaces:b.dismissableSurfaces}),ne=yy(ee=>{if(u&&F.current)return;const J=ee.target;[...b.branches].some(ue=>ue.contains(J))||(m==null||m(ee),h==null||h(ee),ee.defaultPrevented||v==null||v())},D);return cy(ee=>{H===b.layers.size-1&&(d==null||d(ee),!ee.defaultPrevented&&v&&(ee.preventDefault(),v()))},D),g.useEffect(()=>{if(j)return i&&(b.layersWithOutsidePointerEventsDisabled.size===0&&(Op=D.body.style.pointerEvents,D.body.style.pointerEvents="none"),b.layersWithOutsidePointerEventsDisabled.add(j)),b.layers.add(j),Dp(),()=>{i&&(b.layersWithOutsidePointerEventsDisabled.delete(j),b.layersWithOutsidePointerEventsDisabled.size===0&&(D.body.style.pointerEvents=Op))}},[j,D,i,b]),g.useEffect(()=>()=>{j&&(b.layers.delete(j),b.layersWithOutsidePointerEventsDisabled.delete(j),Dp())},[j,b]),g.useEffect(()=>{const ee=()=>I({});return document.addEventListener(ec,ee),()=>document.removeEventListener(ec,ee)},[]),n.jsx(lt.div,{...x,ref:w,style:{pointerEvents:z?R?"auto":"none":void 0,...s.style},onFocusCapture:sn(s.onFocusCapture,ne.onFocusCapture),onBlurCapture:sn(s.onBlurCapture,ne.onBlurCapture),onPointerDownCapture:sn(s.onPointerDownCapture,K.onPointerDownCapture)})});Dh.displayName=dy;var hy="DismissableLayerBranch",my=g.forwardRef((s,o)=>{const i=g.useContext(pc),u=g.useRef(null),d=In(o,u);return g.useEffect(()=>{const f=u.current;if(f)return i.branches.add(f),()=>{i.branches.delete(f)}},[i.branches]),n.jsx(lt.div,{...s,ref:d})});my.displayName=hy;function gy(){const s=g.useContext(pc),[o,i]=g.useState(null);return g.useEffect(()=>{if(o)return s.dismissableSurfaces.add(o),()=>{s.dismissableSurfaces.delete(o)}},[o,s.dismissableSurfaces]),i}function xy(s,o){const{ownerDocument:i=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:u=!1,isDeferredPointerDownOutsideRef:d,dismissableSurfaces:f}=o,m=zo(s),h=g.useRef(!1),v=g.useRef(!1),x=g.useRef(new Map),b=g.useRef(()=>{});return g.useEffect(()=>{function j(){v.current=!1,d.current=!1,x.current.clear()}function M(){return Array.from(x.current.values()).some(Boolean)}function D($){if(!v.current)return;const H=$.target;H instanceof Node&&[...f].some(R=>R.contains(H))||x.current.set($.type,!0),$.type==="click"&&window.setTimeout(()=>{v.current&&b.current()},0)}function I($){v.current&&x.current.set($.type,!1)}const w=$=>{if($.target&&!h.current){let H=function(){i.removeEventListener("click",b.current);const R=M();j(),R||Th(fy,m,z,{discrete:!0})};const z={originalEvent:$};v.current=!0,d.current=u&&$.button===0,x.current.clear(),!u||$.button!==0?H():(i.removeEventListener("click",b.current),b.current=H,i.addEventListener("click",b.current,{once:!0}))}else i.removeEventListener("click",b.current),j();h.current=!1},C=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const $ of C)i.addEventListener($,D,!0),i.addEventListener($,I);const _=window.setTimeout(()=>{i.addEventListener("pointerdown",w)},0);return()=>{window.clearTimeout(_),i.removeEventListener("pointerdown",w),i.removeEventListener("click",b.current);for(const $ of C)i.removeEventListener($,D,!0),i.removeEventListener($,I)}},[i,m,u,d,f]),{onPointerDownCapture:()=>h.current=!0}}function yy(s,o=globalThis==null?void 0:globalThis.document){const i=zo(s),u=g.useRef(!1);return g.useEffect(()=>{const d=f=>{f.target&&!u.current&&Th(py,i,{originalEvent:f},{discrete:!1})};return o.addEventListener("focusin",d),()=>o.removeEventListener("focusin",d)},[o,i]),{onFocusCapture:()=>u.current=!0,onBlurCapture:()=>u.current=!1}}function Dp(){const s=new CustomEvent(ec);document.dispatchEvent(s)}function Th(s,o,i,{discrete:u}){const d=i.originalEvent.target,f=new CustomEvent(s,{bubbles:!1,cancelable:!0,detail:i});o&&d.addEventListener(s,o,{once:!0}),u?uy(d,f):d.dispatchEvent(f)}var ku="focusScope.autoFocusOnMount",Nu="focusScope.autoFocusOnUnmount",Tp={bubbles:!1,cancelable:!0},vy="FocusScope",Ah=g.forwardRef((s,o)=>{const{loop:i=!1,trapped:u=!1,onMountAutoFocus:d,onUnmountAutoFocus:f,...m}=s,[h,v]=g.useState(null),x=zo(d),b=zo(f),j=g.useRef(null),M=In(o,w=>v(w)),D=g.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;g.useEffect(()=>{if(u){let w=function(H){if(D.paused||!h)return;const z=H.target;h.contains(z)?j.current=z:Qr(j.current,{select:!0})},C=function(H){if(D.paused||!h)return;const z=H.relatedTarget;z!==null&&(h.contains(z)||Qr(j.current,{select:!0}))},_=function(H){if(document.activeElement===document.body)for(const R of H)R.removedNodes.length>0&&Qr(h)};document.addEventListener("focusin",w),document.addEventListener("focusout",C);const $=new MutationObserver(_);return h&&$.observe(h,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",C),$.disconnect()}}},[u,h,D.paused]),g.useEffect(()=>{if(h){zp.add(D);const w=document.activeElement;if(!h.contains(w)){const _=new CustomEvent(ku,Tp);h.addEventListener(ku,x),h.dispatchEvent(_),_.defaultPrevented||(by(Sy(zh(h)),{select:!0}),document.activeElement===w&&Qr(h))}return()=>{h.removeEventListener(ku,x),setTimeout(()=>{const _=new CustomEvent(Nu,Tp);h.addEventListener(Nu,b),h.dispatchEvent(_),_.defaultPrevented||Qr(w??document.body,{select:!0}),h.removeEventListener(Nu,b),zp.remove(D)},0)}}},[h,x,b,D]);const I=g.useCallback(w=>{if(!i&&!u||D.paused)return;const C=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,_=document.activeElement;if(C&&_){const $=w.currentTarget,[H,z]=wy($);H&&z?!w.shiftKey&&_===z?(w.preventDefault(),i&&Qr(H,{select:!0})):w.shiftKey&&_===H&&(w.preventDefault(),i&&Qr(z,{select:!0})):_===$&&w.preventDefault()}},[i,u,D.paused]);return n.jsx(lt.div,{tabIndex:-1,...m,ref:M,onKeyDown:I})});Ah.displayName=vy;function by(s,{select:o=!1}={}){const i=document.activeElement;for(const u of s)if(Qr(u,{select:o}),document.activeElement!==i)return}function wy(s){const o=zh(s),i=Ap(o,s),u=Ap(o.reverse(),s);return[i,u]}function zh(s){const o=[],i=document.createTreeWalker(s,NodeFilter.SHOW_ELEMENT,{acceptNode:u=>{const d=u.tagName==="INPUT"&&u.type==="hidden";return u.disabled||u.hidden||d?NodeFilter.FILTER_SKIP:u.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;i.nextNode();)o.push(i.currentNode);return o}function Ap(s,o){for(const i of s)if(!jy(i,{upTo:o}))return i}function jy(s,{upTo:o}){if(getComputedStyle(s).visibility==="hidden")return!0;for(;s;){if(o!==void 0&&s===o)return!1;if(getComputedStyle(s).display==="none")return!0;s=s.parentElement}return!1}function ky(s){return s instanceof HTMLInputElement&&"select"in s}function Qr(s,{select:o=!1}={}){if(s&&s.focus){const i=document.activeElement;s.focus({preventScroll:!0}),s!==i&&ky(s)&&o&&s.select()}}var zp=Ny();function Ny(){let s=[];return{add(o){const i=s[0];o!==i&&(i==null||i.pause()),s=Lp(s,o),s.unshift(o)},remove(o){var i;s=Lp(s,o),(i=s[0])==null||i.resume()}}}function Lp(s,o){const i=[...s],u=i.indexOf(o);return u!==-1&&i.splice(u,1),i}function Sy(s){return s.filter(o=>o.tagName!=="A")}var Cy="Portal",Lh=g.forwardRef((s,o)=>{var h;const{container:i,...u}=s,[d,f]=g.useState(!1);Ao(()=>f(!0),[]);const m=i||d&&((h=globalThis==null?void 0:globalThis.document)==null?void 0:h.body);return m?Rh.createPortal(n.jsx(lt.div,{...u,ref:o}),m):null});Lh.displayName=Cy;function Ey(s,o){return g.useReducer((i,u)=>o[i][u]??i,s)}var wi=s=>{const{present:o,children:i}=s,u=Py(o),d=typeof i=="function"?i({present:u.isPresent}):g.Children.only(i),f=_y(u.ref,My(d));return typeof i=="function"||u.isPresent?g.cloneElement(d,{ref:f}):null};wi.displayName="Presence";function Py(s){const[o,i]=g.useState(),u=g.useRef(null),d=g.useRef(s),f=g.useRef("none"),m=s?"mounted":"unmounted",[h,v]=Ey(m,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return g.useEffect(()=>{const x=si(u.current);f.current=h==="mounted"?x:"none"},[h]),Ao(()=>{const x=u.current,b=d.current;if(b!==s){const M=f.current,D=si(x);s?v("MOUNT"):D==="none"||(x==null?void 0:x.display)==="none"?v("UNMOUNT"):v(b&&M!==D?"ANIMATION_OUT":"UNMOUNT"),d.current=s}},[s,v]),Ao(()=>{if(o){let x;const b=o.ownerDocument.defaultView??window,j=D=>{const w=si(u.current).includes(CSS.escape(D.animationName));if(D.target===o&&w&&(v("ANIMATION_END"),!d.current)){const C=o.style.animationFillMode;o.style.animationFillMode="forwards",x=b.setTimeout(()=>{o.style.animationFillMode==="forwards"&&(o.style.animationFillMode=C)})}},M=D=>{D.target===o&&(f.current=si(u.current))};return o.addEventListener("animationstart",M),o.addEventListener("animationcancel",j),o.addEventListener("animationend",j),()=>{b.clearTimeout(x),o.removeEventListener("animationstart",M),o.removeEventListener("animationcancel",j),o.removeEventListener("animationend",j)}}else v("ANIMATION_END")},[o,v]),{isPresent:["mounted","unmountSuspended"].includes(h),ref:g.useCallback(x=>{u.current=x?getComputedStyle(x):null,i(x)},[])}}function Ip(s,o){if(typeof s=="function")return s(o);s!=null&&(s.current=o)}function _y(...s){const o=g.useRef(s);return o.current=s,g.useCallback(i=>{const u=o.current;let d=!1;const f=u.map(m=>{const h=Ip(m,i);return!d&&typeof h=="function"&&(d=!0),h});if(d)return()=>{for(let m=0;m<f.length;m++){const h=f[m];typeof h=="function"?h():Ip(u[m],null)}}},[])}function si(s){return(s==null?void 0:s.animationName)||"none"}function My(s){var u,d;let o=(u=Object.getOwnPropertyDescriptor(s.props,"ref"))==null?void 0:u.get,i=o&&"isReactWarning"in o&&o.isReactWarning;return i?s.ref:(o=(d=Object.getOwnPropertyDescriptor(s,"ref"))==null?void 0:d.get,i=o&&"isReactWarning"in o&&o.isReactWarning,i?s.props.ref:s.props.ref||s.ref)}var oi=0,tr=null;function Ry(){g.useEffect(()=>{tr||(tr={start:Fp(),end:Fp()});const{start:s,end:o}=tr;return document.body.firstElementChild!==s&&document.body.insertAdjacentElement("afterbegin",s),document.body.lastElementChild!==o&&document.body.insertAdjacentElement("beforeend",o),oi++,()=>{oi===1&&(tr==null||tr.start.remove(),tr==null||tr.end.remove(),tr=null),oi=Math.max(0,oi-1)}},[])}function Fp(){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 or=function(){return or=Object.assign||function(o){for(var i,u=1,d=arguments.length;u<d;u++){i=arguments[u];for(var f in i)Object.prototype.hasOwnProperty.call(i,f)&&(o[f]=i[f])}return o},or.apply(this,arguments)};function Ih(s,o){var i={};for(var u in s)Object.prototype.hasOwnProperty.call(s,u)&&o.indexOf(u)<0&&(i[u]=s[u]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function")for(var d=0,u=Object.getOwnPropertySymbols(s);d<u.length;d++)o.indexOf(u[d])<0&&Object.prototype.propertyIsEnumerable.call(s,u[d])&&(i[u[d]]=s[u[d]]);return i}function Oy(s,o,i){if(i||arguments.length===2)for(var u=0,d=o.length,f;u<d;u++)(f||!(u in o))&&(f||(f=Array.prototype.slice.call(o,0,u)),f[u]=o[u]);return s.concat(f||Array.prototype.slice.call(o))}var pi="right-scroll-bar-position",hi="width-before-scroll-bar",Dy="with-scroll-bars-hidden",Ty="--removed-body-scroll-bar-size";function Su(s,o){return typeof s=="function"?s(o):s&&(s.current=o),s}function Ay(s,o){var i=g.useState(function(){return{value:s,callback:o,facade:{get current(){return i.value},set current(u){var d=i.value;d!==u&&(i.value=u,i.callback(u,d))}}}})[0];return i.callback=o,i.facade}var zy=typeof window<"u"?g.useLayoutEffect:g.useEffect,Up=new WeakMap;function Ly(s,o){var i=Ay(null,function(u){return s.forEach(function(d){return Su(d,u)})});return zy(function(){var u=Up.get(i);if(u){var d=new Set(u),f=new Set(s),m=i.current;d.forEach(function(h){f.has(h)||Su(h,null)}),f.forEach(function(h){d.has(h)||Su(h,m)})}Up.set(i,s)},[s]),i}function Iy(s){return s}function Fy(s,o){o===void 0&&(o=Iy);var i=[],u=!1,d={read:function(){if(u)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return i.length?i[i.length-1]:s},useMedium:function(f){var m=o(f,u);return i.push(m),function(){i=i.filter(function(h){return h!==m})}},assignSyncMedium:function(f){for(u=!0;i.length;){var m=i;i=[],m.forEach(f)}i={push:function(h){return f(h)},filter:function(){return i}}},assignMedium:function(f){u=!0;var m=[];if(i.length){var h=i;i=[],h.forEach(f),m=i}var v=function(){var b=m;m=[],b.forEach(f)},x=function(){return Promise.resolve().then(v)};x(),i={push:function(b){m.push(b),x()},filter:function(b){return m=m.filter(b),i}}}};return d}function Uy(s){s===void 0&&(s={});var o=Fy(null);return o.options=or({async:!0,ssr:!1},s),o}var Fh=function(s){var o=s.sideCar,i=Ih(s,["sideCar"]);if(!o)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var u=o.read();if(!u)throw new Error("Sidecar medium not found");return g.createElement(u,or({},i))};Fh.isSideCarExport=!0;function $y(s,o){return s.useMedium(o),Fh}var Uh=Uy(),Cu=function(){},ji=g.forwardRef(function(s,o){var i=g.useRef(null),u=g.useState({onScrollCapture:Cu,onWheelCapture:Cu,onTouchMoveCapture:Cu}),d=u[0],f=u[1],m=s.forwardProps,h=s.children,v=s.className,x=s.removeScrollBar,b=s.enabled,j=s.shards,M=s.sideCar,D=s.noRelative,I=s.noIsolation,w=s.inert,C=s.allowPinchZoom,_=s.as,$=_===void 0?"div":_,H=s.gapMode,z=Ih(s,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),R=M,F=Ly([i,o]),K=or(or({},z),d);return g.createElement(g.Fragment,null,b&&g.createElement(R,{sideCar:Uh,removeScrollBar:x,shards:j,noRelative:D,noIsolation:I,inert:w,setCallbacks:f,allowPinchZoom:!!C,lockRef:i,gapMode:H}),m?g.cloneElement(g.Children.only(h),or(or({},K),{ref:F})):g.createElement($,or({},K,{className:v,ref:F}),h))});ji.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};ji.classNames={fullWidth:hi,zeroRight:pi};var By=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Hy(){if(!document)return null;var s=document.createElement("style");s.type="text/css";var o=By();return o&&s.setAttribute("nonce",o),s}function Wy(s,o){s.styleSheet?s.styleSheet.cssText=o:s.appendChild(document.createTextNode(o))}function Vy(s){var o=document.head||document.getElementsByTagName("head")[0];o.appendChild(s)}var Gy=function(){var s=0,o=null;return{add:function(i){s==0&&(o=Hy())&&(Wy(o,i),Vy(o)),s++},remove:function(){s--,!s&&o&&(o.parentNode&&o.parentNode.removeChild(o),o=null)}}},Ky=function(){var s=Gy();return function(o,i){g.useEffect(function(){return s.add(o),function(){s.remove()}},[o&&i])}},$h=function(){var s=Ky(),o=function(i){var u=i.styles,d=i.dynamic;return s(u,d),null};return o},Qy={left:0,top:0,right:0,gap:0},Eu=function(s){return parseInt(s||"",10)||0},qy=function(s){var o=window.getComputedStyle(document.body),i=o[s==="padding"?"paddingLeft":"marginLeft"],u=o[s==="padding"?"paddingTop":"marginTop"],d=o[s==="padding"?"paddingRight":"marginRight"];return[Eu(i),Eu(u),Eu(d)]},Zy=function(s){if(s===void 0&&(s="margin"),typeof window>"u")return Qy;var o=qy(s),i=document.documentElement.clientWidth,u=window.innerWidth;return{left:o[0],top:o[1],right:o[2],gap:Math.max(0,u-i+o[2]-o[0])}},Yy=$h(),ys="data-scroll-locked",Jy=function(s,o,i,u){var d=s.left,f=s.top,m=s.right,h=s.gap;return i===void 0&&(i="margin"),`
.`.concat(Dy,` {
overflow: hidden `).concat(u,`;
padding-right: `).concat(h,"px ").concat(u,`;
}
body[`).concat(ys,`] {
overflow: hidden `).concat(u,`;
overscroll-behavior: contain;
`).concat([o&&"position: relative ".concat(u,";"),i==="margin"&&`
padding-left: `.concat(d,`px;
padding-top: `).concat(f,`px;
padding-right: `).concat(m,`px;
margin-left:0;
margin-top:0;
margin-right: `).concat(h,"px ").concat(u,`;
`),i==="padding"&&"padding-right: ".concat(h,"px ").concat(u,";")].filter(Boolean).join(""),`
}
.`).concat(pi,` {
right: `).concat(h,"px ").concat(u,`;
}
.`).concat(hi,` {
margin-right: `).concat(h,"px ").concat(u,`;
}
.`).concat(pi," .").concat(pi,` {
right: 0 `).concat(u,`;
}
.`).concat(hi," .").concat(hi,` {
margin-right: 0 `).concat(u,`;
}
body[`).concat(ys,`] {
`).concat(Ty,": ").concat(h,`px;
}
`)},$p=function(){var s=parseInt(document.body.getAttribute(ys)||"0",10);return isFinite(s)?s:0},Xy=function(){g.useEffect(function(){return document.body.setAttribute(ys,($p()+1).toString()),function(){var s=$p()-1;s<=0?document.body.removeAttribute(ys):document.body.setAttribute(ys,s.toString())}},[])},ev=function(s){var o=s.noRelative,i=s.noImportant,u=s.gapMode,d=u===void 0?"margin":u;Xy();var f=g.useMemo(function(){return Zy(d)},[d]);return g.createElement(Yy,{styles:Jy(f,!o,d,i?"":"!important")})},tc=!1;if(typeof window<"u")try{var li=Object.defineProperty({},"passive",{get:function(){return tc=!0,!0}});window.addEventListener("test",li,li),window.removeEventListener("test",li,li)}catch{tc=!1}var fs=tc?{passive:!1}:!1,tv=function(s){return s.tagName==="TEXTAREA"},Bh=function(s,o){if(!(s instanceof Element))return!1;var i=window.getComputedStyle(s);return i[o]!=="hidden"&&!(i.overflowY===i.overflowX&&!tv(s)&&i[o]==="visible")},rv=function(s){return Bh(s,"overflowY")},nv=function(s){return Bh(s,"overflowX")},Bp=function(s,o){var i=o.ownerDocument,u=o;do{typeof ShadowRoot<"u"&&u instanceof ShadowRoot&&(u=u.host);var d=Hh(s,u);if(d){var f=Wh(s,u),m=f[1],h=f[2];if(m>h)return!0}u=u.parentNode}while(u&&u!==i.body);return!1},sv=function(s){var o=s.scrollTop,i=s.scrollHeight,u=s.clientHeight;return[o,i,u]},ov=function(s){var o=s.scrollLeft,i=s.scrollWidth,u=s.clientWidth;return[o,i,u]},Hh=function(s,o){return s==="v"?rv(o):nv(o)},Wh=function(s,o){return s==="v"?sv(o):ov(o)},lv=function(s,o){return s==="h"&&o==="rtl"?-1:1},iv=function(s,o,i,u,d){var f=lv(s,window.getComputedStyle(o).direction),m=f*u,h=i.target,v=o.contains(h),x=!1,b=m>0,j=0,M=0;do{if(!h)break;var D=Wh(s,h),I=D[0],w=D[1],C=D[2],_=w-C-f*I;(I||_)&&Hh(s,h)&&(j+=_,M+=I);var $=h.parentNode;h=$&&$.nodeType===Node.DOCUMENT_FRAGMENT_NODE?$.host:$}while(!v&&h!==document.body||v&&(o.contains(h)||o===h));return(b&&Math.abs(j)<1||!b&&Math.abs(M)<1)&&(x=!0),x},ii=function(s){return"changedTouches"in s?[s.changedTouches[0].clientX,s.changedTouches[0].clientY]:[0,0]},Hp=function(s){return[s.deltaX,s.deltaY]},Wp=function(s){return s&&"current"in s?s.current:s},av=function(s,o){return s[0]===o[0]&&s[1]===o[1]},uv=function(s){return`
.block-interactivity-`.concat(s,` {pointer-events: none;}
.allow-interactivity-`).concat(s,` {pointer-events: all;}
`)},cv=0,ps=[];function dv(s){var o=g.useRef([]),i=g.useRef([0,0]),u=g.useRef(),d=g.useState(cv++)[0],f=g.useState($h)[0],m=g.useRef(s);g.useEffect(function(){m.current=s},[s]),g.useEffect(function(){if(s.inert){document.body.classList.add("block-interactivity-".concat(d));var w=Oy([s.lockRef.current],(s.shards||[]).map(Wp),!0).filter(Boolean);return w.forEach(function(C){return C.classList.add("allow-interactivity-".concat(d))}),function(){document.body.classList.remove("block-interactivity-".concat(d)),w.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(d))})}}},[s.inert,s.lockRef.current,s.shards]);var h=g.useCallback(function(w,C){if("touches"in w&&w.touches.length===2||w.type==="wheel"&&w.ctrlKey)return!m.current.allowPinchZoom;var _=ii(w),$=i.current,H="deltaX"in w?w.deltaX:$[0]-_[0],z="deltaY"in w?w.deltaY:$[1]-_[1],R,F=w.target,K=Math.abs(H)>Math.abs(z)?"h":"v";if("touches"in w&&K==="h"&&F.type==="range")return!1;var ne=window.getSelection(),ee=ne&&ne.anchorNode,J=ee?ee===F||ee.contains(F):!1;if(J)return!1;var ke=Bp(K,F);if(!ke)return!0;if(ke?R=K:(R=K==="v"?"h":"v",ke=Bp(K,F)),!ke)return!1;if(!u.current&&"changedTouches"in w&&(H||z)&&(u.current=R),!R)return!0;var ue=u.current||R;return iv(ue,C,w,ue==="h"?H:z)},[]),v=g.useCallback(function(w){var C=w;if(!(!ps.length||ps[ps.length-1]!==f)){var _="deltaY"in C?Hp(C):ii(C),$=o.current.filter(function(R){return R.name===C.type&&(R.target===C.target||C.target===R.shadowParent)&&av(R.delta,_)})[0];if($&&$.should){C.cancelable&&C.preventDefault();return}if(!$){var H=(m.current.shards||[]).map(Wp).filter(Boolean).filter(function(R){return R.contains(C.target)}),z=H.length>0?h(C,H[0]):!m.current.noIsolation;z&&C.cancelable&&C.preventDefault()}}},[]),x=g.useCallback(function(w,C,_,$){var H={name:w,delta:C,target:_,should:$,shadowParent:fv(_)};o.current.push(H),setTimeout(function(){o.current=o.current.filter(function(z){return z!==H})},1)},[]),b=g.useCallback(function(w){i.current=ii(w),u.current=void 0},[]),j=g.useCallback(function(w){x(w.type,Hp(w),w.target,h(w,s.lockRef.current))},[]),M=g.useCallback(function(w){x(w.type,ii(w),w.target,h(w,s.lockRef.current))},[]);g.useEffect(function(){return ps.push(f),s.setCallbacks({onScrollCapture:j,onWheelCapture:j,onTouchMoveCapture:M}),document.addEventListener("wheel",v,fs),document.addEventListener("touchmove",v,fs),document.addEventListener("touchstart",b,fs),function(){ps=ps.filter(function(w){return w!==f}),document.removeEventListener("wheel",v,fs),document.removeEventListener("touchmove",v,fs),document.removeEventListener("touchstart",b,fs)}},[]);var D=s.removeScrollBar,I=s.inert;return g.createElement(g.Fragment,null,I?g.createElement(f,{styles:uv(d)}):null,D?g.createElement(ev,{noRelative:s.noRelative,gapMode:s.gapMode}):null)}function fv(s){for(var o=null;s!==null;)s instanceof ShadowRoot&&(o=s.host,s=s.host),s=s.parentNode;return o}const pv=$y(Uh,dv);var Vh=g.forwardRef(function(s,o){return g.createElement(ji,or({},s,{ref:o,sideCar:pv}))});Vh.classNames=ji.classNames;var hv=function(s){if(typeof document>"u")return null;var o=Array.isArray(s)?s[0]:s;return o.ownerDocument.body},hs=new WeakMap,ai=new WeakMap,ui={},Pu=0,Gh=function(s){return s&&(s.host||Gh(s.parentNode))},mv=function(s,o){return o.map(function(i){if(s.contains(i))return i;var u=Gh(i);return u&&s.contains(u)?u:(console.error("aria-hidden",i,"in not contained inside",s,". Doing nothing"),null)}).filter(function(i){return!!i})},gv=function(s,o,i,u){var d=mv(o,Array.isArray(s)?s:[s]);ui[i]||(ui[i]=new WeakMap);var f=ui[i],m=[],h=new Set,v=new Set(d),x=function(j){!j||h.has(j)||(h.add(j),x(j.parentNode))};d.forEach(x);var b=function(j){!j||v.has(j)||Array.prototype.forEach.call(j.children,function(M){if(h.has(M))b(M);else try{var D=M.getAttribute(u),I=D!==null&&D!=="false",w=(hs.get(M)||0)+1,C=(f.get(M)||0)+1;hs.set(M,w),f.set(M,C),m.push(M),w===1&&I&&ai.set(M,!0),C===1&&M.setAttribute(i,"true"),I||M.setAttribute(u,"true")}catch(_){console.error("aria-hidden: cannot operate on ",M,_)}})};return b(o),h.clear(),Pu++,function(){m.forEach(function(j){var M=hs.get(j)-1,D=f.get(j)-1;hs.set(j,M),f.set(j,D),M||(ai.has(j)||j.removeAttribute(u),ai.delete(j)),D||j.removeAttribute(i)}),Pu--,Pu||(hs=new WeakMap,hs=new WeakMap,ai=new WeakMap,ui={})}},xv=function(s,o,i){i===void 0&&(i="data-aria-hidden");var u=Array.from(Array.isArray(s)?s:[s]),d=hv(s);return d?(u.push.apply(u,Array.from(d.querySelectorAll("[aria-live], script"))),gv(u,d,i,"aria-hidden")):function(){return null}},ki="Dialog",[Kh]=V0(ki),[yv,qt]=Kh(ki),Qh=s=>{const{__scopeDialog:o,children:i,open:u,defaultOpen:d,onOpenChange:f,modal:m=!0}=s,h=g.useRef(null),v=g.useRef(null),[x,b]=Z0({prop:u,defaultProp:d??!1,onChange:f,caller:ki});return n.jsx(yv,{scope:o,triggerRef:h,contentRef:v,contentId:jr(),titleId:jr(),descriptionId:jr(),open:x,onOpenChange:b,onOpenToggle:g.useCallback(()=>b(j=>!j),[b]),modal:m,children:i})};Qh.displayName=ki;var qh="DialogTrigger",vv=g.forwardRef((s,o)=>{const{__scopeDialog:i,...u}=s,d=qt(qh,i),f=In(o,d.triggerRef);return n.jsx(lt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":d.open,"aria-controls":d.open?d.contentId:void 0,"data-state":mc(d.open),...u,ref:f,onClick:sn(s.onClick,d.onOpenToggle)})});vv.displayName=qh;var hc="DialogPortal",[bv,Zh]=Kh(hc,{forceMount:void 0}),Yh=s=>{const{__scopeDialog:o,forceMount:i,children:u,container:d}=s,f=qt(hc,o);return n.jsx(bv,{scope:o,forceMount:i,children:g.Children.map(u,m=>n.jsx(wi,{present:i||f.open,children:n.jsx(Lh,{asChild:!0,container:d,children:m})}))})};Yh.displayName=hc;var bi="DialogOverlay",Jh=g.forwardRef((s,o)=>{const i=Zh(bi,s.__scopeDialog),{forceMount:u=i.forceMount,...d}=s,f=qt(bi,s.__scopeDialog);return f.modal?n.jsx(wi,{present:u||f.open,children:n.jsx(jv,{...d,ref:o})}):null});Jh.displayName=bi;var wv=Oh("DialogOverlay.RemoveScroll"),jv=g.forwardRef((s,o)=>{const{__scopeDialog:i,...u}=s,d=qt(bi,i),f=gy(),m=In(o,f);return n.jsx(Vh,{as:wv,allowPinchZoom:!0,shards:[d.contentRef],children:n.jsx(lt.div,{"data-state":mc(d.open),...u,ref:m,style:{pointerEvents:"auto",...u.style}})})}),As="DialogContent",Xh=g.forwardRef((s,o)=>{const i=Zh(As,s.__scopeDialog),{forceMount:u=i.forceMount,...d}=s,f=qt(As,s.__scopeDialog);return n.jsx(wi,{present:u||f.open,children:f.modal?n.jsx(kv,{...d,ref:o}):n.jsx(Nv,{...d,ref:o})})});Xh.displayName=As;var kv=g.forwardRef((s,o)=>{const i=qt(As,s.__scopeDialog),u=g.useRef(null),d=In(o,i.contentRef,u);return g.useEffect(()=>{const f=u.current;if(f)return xv(f)},[]),n.jsx(em,{...s,ref:d,trapFocus:i.open,disableOutsidePointerEvents:i.open,onCloseAutoFocus:sn(s.onCloseAutoFocus,f=>{var m;f.preventDefault(),(m=i.triggerRef.current)==null||m.focus()}),onPointerDownOutside:sn(s.onPointerDownOutside,f=>{const m=f.detail.originalEvent,h=m.button===0&&m.ctrlKey===!0;(m.button===2||h)&&f.preventDefault()}),onFocusOutside:sn(s.onFocusOutside,f=>f.preventDefault())})}),Nv=g.forwardRef((s,o)=>{const i=qt(As,s.__scopeDialog),u=g.useRef(!1),d=g.useRef(!1);return n.jsx(em,{...s,ref:o,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:f=>{var m,h;(m=s.onCloseAutoFocus)==null||m.call(s,f),f.defaultPrevented||(u.current||(h=i.triggerRef.current)==null||h.focus(),f.preventDefault()),u.current=!1,d.current=!1},onInteractOutside:f=>{var v,x;(v=s.onInteractOutside)==null||v.call(s,f),f.defaultPrevented||(u.current=!0,f.detail.originalEvent.type==="pointerdown"&&(d.current=!0));const m=f.target;((x=i.triggerRef.current)==null?void 0:x.contains(m))&&f.preventDefault(),f.detail.originalEvent.type==="focusin"&&d.current&&f.preventDefault()}})}),em=g.forwardRef((s,o)=>{const{__scopeDialog:i,trapFocus:u,onOpenAutoFocus:d,onCloseAutoFocus:f,...m}=s,h=qt(As,i);return Ry(),n.jsx(n.Fragment,{children:n.jsx(Ah,{asChild:!0,loop:!0,trapped:u,onMountAutoFocus:d,onUnmountAutoFocus:f,children:n.jsx(Dh,{role:"dialog",id:h.contentId,"aria-describedby":h.descriptionId,"aria-labelledby":h.titleId,"data-state":mc(h.open),...m,ref:o,deferPointerDownOutside:!0,onDismiss:()=>h.onOpenChange(!1)})})})}),tm="DialogTitle",Sv=g.forwardRef((s,o)=>{const{__scopeDialog:i,...u}=s,d=qt(tm,i);return n.jsx(lt.h2,{id:d.titleId,...u,ref:o})});Sv.displayName=tm;var rm="DialogDescription",Cv=g.forwardRef((s,o)=>{const{__scopeDialog:i,...u}=s,d=qt(rm,i);return n.jsx(lt.p,{id:d.descriptionId,...u,ref:o})});Cv.displayName=rm;var nm="DialogClose",Ev=g.forwardRef((s,o)=>{const{__scopeDialog:i,...u}=s,d=qt(nm,i);return n.jsx(lt.button,{type:"button",...u,ref:o,onClick:sn(s.onClick,()=>d.onOpenChange(!1))})});Ev.displayName=nm;function mc(s){return s?"open":"closed"}var So='[cmdk-group=""]',_u='[cmdk-group-items=""]',Pv='[cmdk-group-heading=""]',sm='[cmdk-item=""]',Vp=`${sm}:not([aria-disabled="true"])`,rc="cmdk-item-select",gs="data-value",_v=(s,o,i)=>W0(s,o,i),om=g.createContext(void 0),Wo=()=>g.useContext(om),lm=g.createContext(void 0),gc=()=>g.useContext(lm),im=g.createContext(void 0),am=g.forwardRef((s,o)=>{let i=xs(()=>{var N,G;return{search:"",value:(G=(N=s.value)!=null?N:s.defaultValue)!=null?G:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),u=xs(()=>new Set),d=xs(()=>new Map),f=xs(()=>new Map),m=xs(()=>new Set),h=um(s),{label:v,children:x,value:b,onValueChange:j,filter:M,shouldFilter:D,loop:I,disablePointerSelection:w=!1,vimBindings:C=!0,..._}=s,$=jr(),H=jr(),z=jr(),R=g.useRef(null),F=Uv();Ln(()=>{if(b!==void 0){let N=b.trim();i.current.value=N,K.emit()}},[b]),Ln(()=>{F(6,Le)},[]);let K=g.useMemo(()=>({subscribe:N=>(m.current.add(N),()=>m.current.delete(N)),snapshot:()=>i.current,setState:(N,G,X)=>{var Y,ie,pe,we;if(!Object.is(i.current[N],G)){if(i.current[N]=G,N==="search")ue(),J(),F(1,ke);else if(N==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let U=document.getElementById(z);U?U.focus():(Y=document.getElementById($))==null||Y.focus()}if(F(7,()=>{var U;i.current.selectedItemId=(U=_e())==null?void 0:U.id,K.emit()}),X||F(5,Le),((ie=h.current)==null?void 0:ie.value)!==void 0){let U=G??"";(we=(pe=h.current).onValueChange)==null||we.call(pe,U);return}}K.emit()}},emit:()=>{m.current.forEach(N=>N())}}),[]),ne=g.useMemo(()=>({value:(N,G,X)=>{var Y;G!==((Y=f.current.get(N))==null?void 0:Y.value)&&(f.current.set(N,{value:G,keywords:X}),i.current.filtered.items.set(N,ee(G,X)),F(2,()=>{J(),K.emit()}))},item:(N,G)=>(u.current.add(N),G&&(d.current.has(G)?d.current.get(G).add(N):d.current.set(G,new Set([N]))),F(3,()=>{ue(),J(),i.current.value||ke(),K.emit()}),()=>{f.current.delete(N),u.current.delete(N),i.current.filtered.items.delete(N);let X=_e();F(4,()=>{ue(),(X==null?void 0:X.getAttribute("id"))===N&&ke(),K.emit()})}),group:N=>(d.current.has(N)||d.current.set(N,new Set),()=>{f.current.delete(N),d.current.delete(N)}),filter:()=>h.current.shouldFilter,label:v||s["aria-label"],getDisablePointerSelection:()=>h.current.disablePointerSelection,listId:$,inputId:z,labelId:H,listInnerRef:R}),[]);function ee(N,G){var X,Y;let ie=(Y=(X=h.current)==null?void 0:X.filter)!=null?Y:_v;return N?ie(N,i.current.search,G):0}function J(){if(!i.current.search||h.current.shouldFilter===!1)return;let N=i.current.filtered.items,G=[];i.current.filtered.groups.forEach(Y=>{let ie=d.current.get(Y),pe=0;ie.forEach(we=>{let U=N.get(we);pe=Math.max(U,pe)}),G.push([Y,pe])});let X=R.current;Oe().sort((Y,ie)=>{var pe,we;let U=Y.getAttribute("id"),me=ie.getAttribute("id");return((pe=N.get(me))!=null?pe:0)-((we=N.get(U))!=null?we:0)}).forEach(Y=>{let ie=Y.closest(_u);ie?ie.appendChild(Y.parentElement===ie?Y:Y.closest(`${_u} > *`)):X.appendChild(Y.parentElement===X?Y:Y.closest(`${_u} > *`))}),G.sort((Y,ie)=>ie[1]-Y[1]).forEach(Y=>{var ie;let pe=(ie=R.current)==null?void 0:ie.querySelector(`${So}[${gs}="${encodeURIComponent(Y[0])}"]`);pe==null||pe.parentElement.appendChild(pe)})}function ke(){let N=Oe().find(X=>X.getAttribute("aria-disabled")!=="true"),G=N==null?void 0:N.getAttribute(gs);K.setState("value",G||void 0)}function ue(){var N,G,X,Y;if(!i.current.search||h.current.shouldFilter===!1){i.current.filtered.count=u.current.size;return}i.current.filtered.groups=new Set;let ie=0;for(let pe of u.current){let we=(G=(N=f.current.get(pe))==null?void 0:N.value)!=null?G:"",U=(Y=(X=f.current.get(pe))==null?void 0:X.keywords)!=null?Y:[],me=ee(we,U);i.current.filtered.items.set(pe,me),me>0&&ie++}for(let[pe,we]of d.current)for(let U of we)if(i.current.filtered.items.get(U)>0){i.current.filtered.groups.add(pe);break}i.current.filtered.count=ie}function Le(){var N,G,X;let Y=_e();Y&&(((N=Y.parentElement)==null?void 0:N.firstChild)===Y&&((X=(G=Y.closest(So))==null?void 0:G.querySelector(Pv))==null||X.scrollIntoView({block:"nearest"})),Y.scrollIntoView({block:"nearest"}))}function _e(){var N;return(N=R.current)==null?void 0:N.querySelector(`${sm}[aria-selected="true"]`)}function Oe(){var N;return Array.from(((N=R.current)==null?void 0:N.querySelectorAll(Vp))||[])}function Te(N){let G=Oe()[N];G&&K.setState("value",G.getAttribute(gs))}function Me(N){var G;let X=_e(),Y=Oe(),ie=Y.findIndex(we=>we===X),pe=Y[ie+N];(G=h.current)!=null&&G.loop&&(pe=ie+N<0?Y[Y.length-1]:ie+N===Y.length?Y[0]:Y[ie+N]),pe&&K.setState("value",pe.getAttribute(gs))}function Q(N){let G=_e(),X=G==null?void 0:G.closest(So),Y;for(;X&&!Y;)X=N>0?Iv(X,So):Fv(X,So),Y=X==null?void 0:X.querySelector(Vp);Y?K.setState("value",Y.getAttribute(gs)):Me(N)}let ce=()=>Te(Oe().length-1),Z=N=>{N.preventDefault(),N.metaKey?ce():N.altKey?Q(1):Me(1)},P=N=>{N.preventDefault(),N.metaKey?Te(0):N.altKey?Q(-1):Me(-1)};return g.createElement(lt.div,{ref:o,tabIndex:-1,..._,"cmdk-root":"",onKeyDown:N=>{var G;(G=_.onKeyDown)==null||G.call(_,N);let X=N.nativeEvent.isComposing||N.keyCode===229;if(!(N.defaultPrevented||X))switch(N.key){case"n":case"j":{C&&N.ctrlKey&&Z(N);break}case"ArrowDown":{Z(N);break}case"p":case"k":{C&&N.ctrlKey&&P(N);break}case"ArrowUp":{P(N);break}case"Home":{N.preventDefault(),Te(0);break}case"End":{N.preventDefault(),ce();break}case"Enter":{N.preventDefault();let Y=_e();if(Y){let ie=new Event(rc);Y.dispatchEvent(ie)}}}}},g.createElement("label",{"cmdk-label":"",htmlFor:ne.inputId,id:ne.labelId,style:Bv},v),Ni(s,N=>g.createElement(lm.Provider,{value:K},g.createElement(om.Provider,{value:ne},N))))}),Mv=g.forwardRef((s,o)=>{var i,u;let d=jr(),f=g.useRef(null),m=g.useContext(im),h=Wo(),v=um(s),x=(u=(i=v.current)==null?void 0:i.forceMount)!=null?u:m==null?void 0:m.forceMount;Ln(()=>{if(!x)return h.item(d,m==null?void 0:m.id)},[x]);let b=cm(d,f,[s.value,s.children,f],s.keywords),j=gc(),M=on(F=>F.value&&F.value===b.current),D=on(F=>x||h.filter()===!1?!0:F.search?F.filtered.items.get(d)>0:!0);g.useEffect(()=>{let F=f.current;if(!(!F||s.disabled))return F.addEventListener(rc,I),()=>F.removeEventListener(rc,I)},[D,s.onSelect,s.disabled]);function I(){var F,K;w(),(K=(F=v.current).onSelect)==null||K.call(F,b.current)}function w(){j.setState("value",b.current,!0)}if(!D)return null;let{disabled:C,value:_,onSelect:$,forceMount:H,keywords:z,...R}=s;return g.createElement(lt.div,{ref:Ts(f,o),...R,id:d,"cmdk-item":"",role:"option","aria-disabled":!!C,"aria-selected":!!M,"data-disabled":!!C,"data-selected":!!M,onPointerMove:C||h.getDisablePointerSelection()?void 0:w,onClick:C?void 0:I},s.children)}),Rv=g.forwardRef((s,o)=>{let{heading:i,children:u,forceMount:d,...f}=s,m=jr(),h=g.useRef(null),v=g.useRef(null),x=jr(),b=Wo(),j=on(D=>d||b.filter()===!1?!0:D.search?D.filtered.groups.has(m):!0);Ln(()=>b.group(m),[]),cm(m,h,[s.value,s.heading,v]);let M=g.useMemo(()=>({id:m,forceMount:d}),[d]);return g.createElement(lt.div,{ref:Ts(h,o),...f,"cmdk-group":"",role:"presentation",hidden:j?void 0:!0},i&&g.createElement("div",{ref:v,"cmdk-group-heading":"","aria-hidden":!0,id:x},i),Ni(s,D=>g.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":i?x:void 0},g.createElement(im.Provider,{value:M},D))))}),Ov=g.forwardRef((s,o)=>{let{alwaysRender:i,...u}=s,d=g.useRef(null),f=on(m=>!m.search);return!i&&!f?null:g.createElement(lt.div,{ref:Ts(d,o),...u,"cmdk-separator":"",role:"separator"})}),Dv=g.forwardRef((s,o)=>{let{onValueChange:i,...u}=s,d=s.value!=null,f=gc(),m=on(x=>x.search),h=on(x=>x.selectedItemId),v=Wo();return g.useEffect(()=>{s.value!=null&&f.setState("search",s.value)},[s.value]),g.createElement(lt.input,{ref:o,...u,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":v.listId,"aria-labelledby":v.labelId,"aria-activedescendant":h,id:v.inputId,type:"text",value:d?s.value:m,onChange:x=>{d||f.setState("search",x.target.value),i==null||i(x.target.value)}})}),Tv=g.forwardRef((s,o)=>{let{children:i,label:u="Suggestions",...d}=s,f=g.useRef(null),m=g.useRef(null),h=on(x=>x.selectedItemId),v=Wo();return g.useEffect(()=>{if(m.current&&f.current){let x=m.current,b=f.current,j,M=new ResizeObserver(()=>{j=requestAnimationFrame(()=>{let D=x.offsetHeight;b.style.setProperty("--cmdk-list-height",D.toFixed(1)+"px")})});return M.observe(x),()=>{cancelAnimationFrame(j),M.unobserve(x)}}},[]),g.createElement(lt.div,{ref:Ts(f,o),...d,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":h,"aria-label":u,id:v.listId},Ni(s,x=>g.createElement("div",{ref:Ts(m,v.listInnerRef),"cmdk-list-sizer":""},x)))}),Av=g.forwardRef((s,o)=>{let{open:i,onOpenChange:u,overlayClassName:d,contentClassName:f,container:m,...h}=s;return g.createElement(Qh,{open:i,onOpenChange:u},g.createElement(Yh,{container:m},g.createElement(Jh,{"cmdk-overlay":"",className:d}),g.createElement(Xh,{"aria-label":s.label,"cmdk-dialog":"",className:f},g.createElement(am,{ref:o,...h}))))}),zv=g.forwardRef((s,o)=>on(i=>i.filtered.count===0)?g.createElement(lt.div,{ref:o,...s,"cmdk-empty":"",role:"presentation"}):null),Lv=g.forwardRef((s,o)=>{let{progress:i,children:u,label:d="Loading...",...f}=s;return g.createElement(lt.div,{ref:o,...f,"cmdk-loading":"",role:"progressbar","aria-valuenow":i,"aria-valuemin":0,"aria-valuemax":100,"aria-label":d},Ni(s,m=>g.createElement("div",{"aria-hidden":!0},m)))}),ms=Object.assign(am,{List:Tv,Item:Mv,Input:Dv,Group:Rv,Separator:Ov,Dialog:Av,Empty:zv,Loading:Lv});function Iv(s,o){let i=s.nextElementSibling;for(;i;){if(i.matches(o))return i;i=i.nextElementSibling}}function Fv(s,o){let i=s.previousElementSibling;for(;i;){if(i.matches(o))return i;i=i.previousElementSibling}}function um(s){let o=g.useRef(s);return Ln(()=>{o.current=s}),o}var Ln=typeof window>"u"?g.useEffect:g.useLayoutEffect;function xs(s){let o=g.useRef();return o.current===void 0&&(o.current=s()),o}function on(s){let o=gc(),i=()=>s(o.snapshot());return g.useSyncExternalStore(o.subscribe,i,i)}function cm(s,o,i,u=[]){let d=g.useRef(),f=Wo();return Ln(()=>{var m;let h=(()=>{var x;for(let b of i){if(typeof b=="string")return b.trim();if(typeof b=="object"&&"current"in b)return b.current?(x=b.current.textContent)==null?void 0:x.trim():d.current}})(),v=u.map(x=>x.trim());f.value(s,h,v),(m=o.current)==null||m.setAttribute(gs,h),d.current=h}),d}var Uv=()=>{let[s,o]=g.useState(),i=xs(()=>new Map);return Ln(()=>{i.current.forEach(u=>u()),i.current=new Map},[s]),(u,d)=>{i.current.set(u,d),o({})}};function $v(s){let o=s.type;return typeof o=="function"?o(s.props):"render"in o?o.render(s.props):s}function Ni({asChild:s,children:o},i){return s&&g.isValidElement(o)?g.cloneElement($v(o),{ref:o.ref},i(o.props.children)):i(o)}var Bv={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function Hv({onNavigate:s}){const[o,i]=g.useState(!1);return g.useEffect(()=>{const u=d=>{(d.metaKey||d.ctrlKey)&&d.key.toLowerCase()==="k"&&(d.preventDefault(),i(f=>!f))};return document.addEventListener("keydown",u),()=>document.removeEventListener("keydown",u)},[]),n.jsx(ms.Dialog,{open:o,onOpenChange:i,label:"Befehlspalette",className:"fixed inset-0 z-50 flex items-start justify-center bg-black/50 p-4 pt-[12vh]",onClick:()=>i(!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:u=>u.stopPropagation(),children:[n.jsx(ms.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(ms.List,{className:"max-h-80 overflow-y-auto p-2",children:[n.jsx(ms.Empty,{className:"px-3 py-6 text-center text-sm text-muted-foreground",children:"Nichts gefunden."}),n.jsx(ms.Group,{heading:"Bereiche",className:"px-1 py-1 text-xs text-muted-foreground",children:Ju.map(u=>n.jsxs(ms.Item,{value:`${u.label} ${u.hint}`,onSelect:()=>{s(u.id),i(!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(u.icon,{className:"h-4 w-4 text-primary"}),n.jsx("span",{children:u.label}),n.jsx("span",{className:"ml-auto truncate text-xs text-muted-foreground",children:u.hint})]},u.id))})]})]})})}async function he(s,o){var v;const i={"Content-Type":"application/json",...o==null?void 0:o.headers},u=localStorage.getItem("mc_sudo_password"),d=localStorage.getItem("mc_hf_token");u&&(i["X-Sudo-Password"]=u);let f=o==null?void 0:o.body;if((((v=o==null?void 0:o.method)==null?void 0:v.toUpperCase())||"GET")==="POST"){if(typeof f=="string")try{const x=JSON.parse(f);let b=!1;u&&!("sudo_password"in x)&&(x.sudo_password=u,b=!0),d&&!("hf_token"in x)&&(x.hf_token=d,b=!0),b&&(f=JSON.stringify(x))}catch{}else if(!f){const x={};u&&(x.sudo_password=u),d&&(x.hf_token=d),Object.keys(x).length>0&&(f=JSON.stringify(x))}}const h=await fetch(s,{...o,headers:i,body:f});if(!h.ok)throw new Error(`${h.status} ${h.statusText}`);return h.json()}const mt={health:["health"],systemStatus:["system-status"],services:["services"],models:["models"],routing:["routing"],jobs:["jobs"],tokenStats:["token-stats"],agentStatus:["agent-status"],updates:["updates"],discover:["discover"],connect:s=>["connect",s??""],memory:(s,o)=>["memory",s??"",o??""]},Wv=()=>lr({queryKey:mt.health,queryFn:()=>he("/api/health"),refetchInterval:1e4}),xc=(s=5e3)=>lr({queryKey:mt.systemStatus,queryFn:()=>he("/api/system/status"),refetchInterval:s}),Vv=(s=3e3)=>lr({queryKey:mt.services,queryFn:()=>he("/api/system/services"),refetchInterval:s}),yc=(s=4e3)=>lr({queryKey:mt.models,queryFn:()=>he("/api/models"),refetchInterval:s}),Gv=(s=2e3)=>lr({queryKey:mt.jobs,queryFn:()=>he("/api/jobs"),refetchInterval:s,select:o=>o.jobs??[]}),Kv=(s=3e3)=>lr({queryKey:mt.tokenStats,queryFn:()=>he("/api/system/token-stats"),refetchInterval:s}),dm=(s=5e3)=>lr({queryKey:mt.agentStatus,queryFn:()=>he("/api/agent/status"),refetchInterval:s}),Qv=s=>lr({queryKey:mt.updates,queryFn:()=>he("/api/maintenance/updates"),refetchInterval:s}),qv=s=>lr({queryKey:mt.connect(s),queryFn:()=>he(s?`/api/connect?${s}`:"/api/connect")}),fm=s=>lr({queryKey:mt.memory(s==null?void 0:s.q,s==null?void 0:s.category),queryFn:()=>{const o=new URLSearchParams;return s!=null&&s.q&&o.set("q",s.q),s!=null&&s.category&&o.set("category",s.category),he(`/api/memory?${o}`)},select:o=>s!=null&&s.limit?o.slice(0,s.limit):o});function Nt(s){return(s/1024**3).toFixed(1)}function nc(s){return s?s>1024**3?`${(s/1024**3).toFixed(1)} GB`:`${(s/1024**2).toFixed(0)} MB`:""}function wn(s){if(!s)return"—";const o=s/1024**3;return o>=1?`${o.toFixed(1)} GB`:`${(s/1024**2).toFixed(0)} MB`}function Zv(s){if(!s)return"";const o=Math.floor(s/60);return o>0?`${o} min`:`${s} s`}function Gp(s){return s?`${Math.round(s/1024)}k`:"—"}function pm(s){var o,i,u="";if(typeof s=="string"||typeof s=="number")u+=s;else if(typeof s=="object")if(Array.isArray(s)){var d=s.length;for(o=0;o<d;o++)s[o]&&(i=pm(s[o]))&&(u&&(u+=" "),u+=i)}else for(i in s)s[i]&&(u&&(u+=" "),u+=i);return u}function Yv(){for(var s,o,i=0,u="",d=arguments.length;i<d;i++)(s=arguments[i])&&(o=pm(s))&&(u&&(u+=" "),u+=o);return u}const vc="-",Jv=s=>{const o=eb(s),{conflictingClassGroups:i,conflictingClassGroupModifiers:u}=s;return{getClassGroupId:m=>{const h=m.split(vc);return h[0]===""&&h.length!==1&&h.shift(),hm(h,o)||Xv(m)},getConflictingClassGroupIds:(m,h)=>{const v=i[m]||[];return h&&u[m]?[...v,...u[m]]:v}}},hm=(s,o)=>{var m;if(s.length===0)return o.classGroupId;const i=s[0],u=o.nextPart.get(i),d=u?hm(s.slice(1),u):void 0;if(d)return d;if(o.validators.length===0)return;const f=s.join(vc);return(m=o.validators.find(({validator:h})=>h(f)))==null?void 0:m.classGroupId},Kp=/^\[(.+)\]$/,Xv=s=>{if(Kp.test(s)){const o=Kp.exec(s)[1],i=o==null?void 0:o.substring(0,o.indexOf(":"));if(i)return"arbitrary.."+i}},eb=s=>{const{theme:o,prefix:i}=s,u={nextPart:new Map,validators:[]};return rb(Object.entries(s.classGroups),i).forEach(([f,m])=>{sc(m,u,f,o)}),u},sc=(s,o,i,u)=>{s.forEach(d=>{if(typeof d=="string"){const f=d===""?o:Qp(o,d);f.classGroupId=i;return}if(typeof d=="function"){if(tb(d)){sc(d(u),o,i,u);return}o.validators.push({validator:d,classGroupId:i});return}Object.entries(d).forEach(([f,m])=>{sc(m,Qp(o,f),i,u)})})},Qp=(s,o)=>{let i=s;return o.split(vc).forEach(u=>{i.nextPart.has(u)||i.nextPart.set(u,{nextPart:new Map,validators:[]}),i=i.nextPart.get(u)}),i},tb=s=>s.isThemeGetter,rb=(s,o)=>o?s.map(([i,u])=>{const d=u.map(f=>typeof f=="string"?o+f:typeof f=="object"?Object.fromEntries(Object.entries(f).map(([m,h])=>[o+m,h])):f);return[i,d]}):s,nb=s=>{if(s<1)return{get:()=>{},set:()=>{}};let o=0,i=new Map,u=new Map;const d=(f,m)=>{i.set(f,m),o++,o>s&&(o=0,u=i,i=new Map)};return{get(f){let m=i.get(f);if(m!==void 0)return m;if((m=u.get(f))!==void 0)return d(f,m),m},set(f,m){i.has(f)?i.set(f,m):d(f,m)}}},mm="!",sb=s=>{const{separator:o,experimentalParseClassName:i}=s,u=o.length===1,d=o[0],f=o.length,m=h=>{const v=[];let x=0,b=0,j;for(let C=0;C<h.length;C++){let _=h[C];if(x===0){if(_===d&&(u||h.slice(C,C+f)===o)){v.push(h.slice(b,C)),b=C+f;continue}if(_==="/"){j=C;continue}}_==="["?x++:_==="]"&&x--}const M=v.length===0?h:h.substring(b),D=M.startsWith(mm),I=D?M.substring(1):M,w=j&&j>b?j-b:void 0;return{modifiers:v,hasImportantModifier:D,baseClassName:I,maybePostfixModifierPosition:w}};return i?h=>i({className:h,parseClassName:m}):m},ob=s=>{if(s.length<=1)return s;const o=[];let i=[];return s.forEach(u=>{u[0]==="["?(o.push(...i.sort(),u),i=[]):i.push(u)}),o.push(...i.sort()),o},lb=s=>({cache:nb(s.cacheSize),parseClassName:sb(s),...Jv(s)}),ib=/\s+/,ab=(s,o)=>{const{parseClassName:i,getClassGroupId:u,getConflictingClassGroupIds:d}=o,f=[],m=s.trim().split(ib);let h="";for(let v=m.length-1;v>=0;v-=1){const x=m[v],{modifiers:b,hasImportantModifier:j,baseClassName:M,maybePostfixModifierPosition:D}=i(x);let I=!!D,w=u(I?M.substring(0,D):M);if(!w){if(!I){h=x+(h.length>0?" "+h:h);continue}if(w=u(M),!w){h=x+(h.length>0?" "+h:h);continue}I=!1}const C=ob(b).join(":"),_=j?C+mm:C,$=_+w;if(f.includes($))continue;f.push($);const H=d(w,I);for(let z=0;z<H.length;++z){const R=H[z];f.push(_+R)}h=x+(h.length>0?" "+h:h)}return h};function ub(){let s=0,o,i,u="";for(;s<arguments.length;)(o=arguments[s++])&&(i=gm(o))&&(u&&(u+=" "),u+=i);return u}const gm=s=>{if(typeof s=="string")return s;let o,i="";for(let u=0;u<s.length;u++)s[u]&&(o=gm(s[u]))&&(i&&(i+=" "),i+=o);return i};function cb(s,...o){let i,u,d,f=m;function m(v){const x=o.reduce((b,j)=>j(b),s());return i=lb(x),u=i.cache.get,d=i.cache.set,f=h,h(v)}function h(v){const x=u(v);if(x)return x;const b=ab(v,i);return d(v,b),b}return function(){return f(ub.apply(null,arguments))}}const Be=s=>{const o=i=>i[s]||[];return o.isThemeGetter=!0,o},xm=/^\[(?:([a-z-]+):)?(.+)\]$/i,db=/^\d+\/\d+$/,fb=new Set(["px","full","screen"]),pb=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,hb=/\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$/,mb=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,gb=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,xb=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,yr=s=>vs(s)||fb.has(s)||db.test(s),Vr=s=>Ls(s,"length",Sb),vs=s=>!!s&&!Number.isNaN(Number(s)),Mu=s=>Ls(s,"number",vs),Co=s=>!!s&&Number.isInteger(Number(s)),yb=s=>s.endsWith("%")&&vs(s.slice(0,-1)),Ne=s=>xm.test(s),Gr=s=>pb.test(s),vb=new Set(["length","size","percentage"]),bb=s=>Ls(s,vb,ym),wb=s=>Ls(s,"position",ym),jb=new Set(["image","url"]),kb=s=>Ls(s,jb,Eb),Nb=s=>Ls(s,"",Cb),Eo=()=>!0,Ls=(s,o,i)=>{const u=xm.exec(s);return u?u[1]?typeof o=="string"?u[1]===o:o.has(u[1]):i(u[2]):!1},Sb=s=>hb.test(s)&&!mb.test(s),ym=()=>!1,Cb=s=>gb.test(s),Eb=s=>xb.test(s),Pb=()=>{const s=Be("colors"),o=Be("spacing"),i=Be("blur"),u=Be("brightness"),d=Be("borderColor"),f=Be("borderRadius"),m=Be("borderSpacing"),h=Be("borderWidth"),v=Be("contrast"),x=Be("grayscale"),b=Be("hueRotate"),j=Be("invert"),M=Be("gap"),D=Be("gradientColorStops"),I=Be("gradientColorStopPositions"),w=Be("inset"),C=Be("margin"),_=Be("opacity"),$=Be("padding"),H=Be("saturate"),z=Be("scale"),R=Be("sepia"),F=Be("skew"),K=Be("space"),ne=Be("translate"),ee=()=>["auto","contain","none"],J=()=>["auto","hidden","clip","visible","scroll"],ke=()=>["auto",Ne,o],ue=()=>[Ne,o],Le=()=>["",yr,Vr],_e=()=>["auto",vs,Ne],Oe=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Te=()=>["solid","dashed","dotted","double","none"],Me=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Q=()=>["start","end","center","between","around","evenly","stretch"],ce=()=>["","0",Ne],Z=()=>["auto","avoid","all","avoid-page","page","left","right","column"],P=()=>[vs,Ne];return{cacheSize:500,separator:":",theme:{colors:[Eo],spacing:[yr,Vr],blur:["none","",Gr,Ne],brightness:P(),borderColor:[s],borderRadius:["none","","full",Gr,Ne],borderSpacing:ue(),borderWidth:Le(),contrast:P(),grayscale:ce(),hueRotate:P(),invert:ce(),gap:ue(),gradientColorStops:[s],gradientColorStopPositions:[yb,Vr],inset:ke(),margin:ke(),opacity:P(),padding:ue(),saturate:P(),scale:P(),sepia:ce(),skew:P(),space:ue(),translate:ue()},classGroups:{aspect:[{aspect:["auto","square","video",Ne]}],container:["container"],columns:[{columns:[Gr]}],"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:[...Oe(),Ne]}],overflow:[{overflow:J()}],"overflow-x":[{"overflow-x":J()}],"overflow-y":[{"overflow-y":J()}],overscroll:[{overscroll:ee()}],"overscroll-x":[{"overscroll-x":ee()}],"overscroll-y":[{"overscroll-y":ee()}],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",Co,Ne]}],basis:[{basis:ke()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Ne]}],grow:[{grow:ce()}],shrink:[{shrink:ce()}],order:[{order:["first","last","none",Co,Ne]}],"grid-cols":[{"grid-cols":[Eo]}],"col-start-end":[{col:["auto",{span:["full",Co,Ne]},Ne]}],"col-start":[{"col-start":_e()}],"col-end":[{"col-end":_e()}],"grid-rows":[{"grid-rows":[Eo]}],"row-start-end":[{row:["auto",{span:[Co,Ne]},Ne]}],"row-start":[{"row-start":_e()}],"row-end":[{"row-end":_e()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Ne]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Ne]}],gap:[{gap:[M]}],"gap-x":[{"gap-x":[M]}],"gap-y":[{"gap-y":[M]}],"justify-content":[{justify:["normal",...Q()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Q(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Q(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[$]}],px:[{px:[$]}],py:[{py:[$]}],ps:[{ps:[$]}],pe:[{pe:[$]}],pt:[{pt:[$]}],pr:[{pr:[$]}],pb:[{pb:[$]}],pl:[{pl:[$]}],m:[{m:[C]}],mx:[{mx:[C]}],my:[{my:[C]}],ms:[{ms:[C]}],me:[{me:[C]}],mt:[{mt:[C]}],mr:[{mr:[C]}],mb:[{mb:[C]}],ml:[{ml:[C]}],"space-x":[{"space-x":[K]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[K]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Ne,o]}],"min-w":[{"min-w":[Ne,o,"min","max","fit"]}],"max-w":[{"max-w":[Ne,o,"none","full","min","max","fit","prose",{screen:[Gr]},Gr]}],h:[{h:[Ne,o,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Ne,o,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Ne,o,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Ne,o,"auto","min","max","fit"]}],"font-size":[{text:["base",Gr,Vr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Mu]}],"font-family":[{font:[Eo]}],"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",Ne]}],"line-clamp":[{"line-clamp":["none",vs,Mu]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",yr,Ne]}],"list-image":[{"list-image":["none",Ne]}],"list-style-type":[{list:["none","disc","decimal",Ne]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[s]}],"placeholder-opacity":[{"placeholder-opacity":[_]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[s]}],"text-opacity":[{"text-opacity":[_]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Te(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",yr,Vr]}],"underline-offset":[{"underline-offset":["auto",yr,Ne]}],"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",Ne]}],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",Ne]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[_]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...Oe(),wb]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",bb]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},kb]}],"bg-color":[{bg:[s]}],"gradient-from-pos":[{from:[I]}],"gradient-via-pos":[{via:[I]}],"gradient-to-pos":[{to:[I]}],"gradient-from":[{from:[D]}],"gradient-via":[{via:[D]}],"gradient-to":[{to:[D]}],rounded:[{rounded:[f]}],"rounded-s":[{"rounded-s":[f]}],"rounded-e":[{"rounded-e":[f]}],"rounded-t":[{"rounded-t":[f]}],"rounded-r":[{"rounded-r":[f]}],"rounded-b":[{"rounded-b":[f]}],"rounded-l":[{"rounded-l":[f]}],"rounded-ss":[{"rounded-ss":[f]}],"rounded-se":[{"rounded-se":[f]}],"rounded-ee":[{"rounded-ee":[f]}],"rounded-es":[{"rounded-es":[f]}],"rounded-tl":[{"rounded-tl":[f]}],"rounded-tr":[{"rounded-tr":[f]}],"rounded-br":[{"rounded-br":[f]}],"rounded-bl":[{"rounded-bl":[f]}],"border-w":[{border:[h]}],"border-w-x":[{"border-x":[h]}],"border-w-y":[{"border-y":[h]}],"border-w-s":[{"border-s":[h]}],"border-w-e":[{"border-e":[h]}],"border-w-t":[{"border-t":[h]}],"border-w-r":[{"border-r":[h]}],"border-w-b":[{"border-b":[h]}],"border-w-l":[{"border-l":[h]}],"border-opacity":[{"border-opacity":[_]}],"border-style":[{border:[...Te(),"hidden"]}],"divide-x":[{"divide-x":[h]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[h]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[_]}],"divide-style":[{divide:Te()}],"border-color":[{border:[d]}],"border-color-x":[{"border-x":[d]}],"border-color-y":[{"border-y":[d]}],"border-color-s":[{"border-s":[d]}],"border-color-e":[{"border-e":[d]}],"border-color-t":[{"border-t":[d]}],"border-color-r":[{"border-r":[d]}],"border-color-b":[{"border-b":[d]}],"border-color-l":[{"border-l":[d]}],"divide-color":[{divide:[d]}],"outline-style":[{outline:["",...Te()]}],"outline-offset":[{"outline-offset":[yr,Ne]}],"outline-w":[{outline:[yr,Vr]}],"outline-color":[{outline:[s]}],"ring-w":[{ring:Le()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[s]}],"ring-opacity":[{"ring-opacity":[_]}],"ring-offset-w":[{"ring-offset":[yr,Vr]}],"ring-offset-color":[{"ring-offset":[s]}],shadow:[{shadow:["","inner","none",Gr,Nb]}],"shadow-color":[{shadow:[Eo]}],opacity:[{opacity:[_]}],"mix-blend":[{"mix-blend":[...Me(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Me()}],filter:[{filter:["","none"]}],blur:[{blur:[i]}],brightness:[{brightness:[u]}],contrast:[{contrast:[v]}],"drop-shadow":[{"drop-shadow":["","none",Gr,Ne]}],grayscale:[{grayscale:[x]}],"hue-rotate":[{"hue-rotate":[b]}],invert:[{invert:[j]}],saturate:[{saturate:[H]}],sepia:[{sepia:[R]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[i]}],"backdrop-brightness":[{"backdrop-brightness":[u]}],"backdrop-contrast":[{"backdrop-contrast":[v]}],"backdrop-grayscale":[{"backdrop-grayscale":[x]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[b]}],"backdrop-invert":[{"backdrop-invert":[j]}],"backdrop-opacity":[{"backdrop-opacity":[_]}],"backdrop-saturate":[{"backdrop-saturate":[H]}],"backdrop-sepia":[{"backdrop-sepia":[R]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[m]}],"border-spacing-x":[{"border-spacing-x":[m]}],"border-spacing-y":[{"border-spacing-y":[m]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Ne]}],duration:[{duration:P()}],ease:[{ease:["linear","in","out","in-out",Ne]}],delay:[{delay:P()}],animate:[{animate:["none","spin","ping","pulse","bounce",Ne]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[z]}],"scale-x":[{"scale-x":[z]}],"scale-y":[{"scale-y":[z]}],rotate:[{rotate:[Co,Ne]}],"translate-x":[{"translate-x":[ne]}],"translate-y":[{"translate-y":[ne]}],"skew-x":[{"skew-x":[F]}],"skew-y":[{"skew-y":[F]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Ne]}],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",Ne]}],"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",Ne]}],fill:[{fill:[s,"none"]}],"stroke-w":[{stroke:[yr,Vr,Mu]}],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"]}}},_b=cb(Pb);function te(...s){return _b(Yv(s))}function Lo(s){return s?s.replace(/127\.0\.0\.1|localhost/g,"192.168.178.151"):""}function ci({value:s,label:o,detail:i}){const d=2*Math.PI*24,f=d-Math.min(s,100)/100*d,m=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:te("fill-none transition-all duration-700 ease-out",m),strokeWidth:"4.5",strokeDasharray:d,strokeDashoffset:f,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:o}),i&&n.jsx("span",{className:"text-[10px] font-mono text-muted-foreground/80",children:i})]})}function Mb(){const{data:s}=xc(3e3);return 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(Ot,{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(ci,{value:s.cpu.percent,label:"CPU",detail:s.cpu.cores?`${s.cpu.cores} Cores`:void 0}),n.jsx(ci,{value:s.ram.percent,label:"RAM",detail:`${Nt(s.ram.used)} / ${Nt(s.ram.total)} GB`}),s.gpu&&s.gpu.busy_percent!=null&&s.gpu.gtt_used!=null&&s.gpu.gtt_total!=null&&n.jsx(ci,{value:s.gpu.busy_percent,label:"GPU",detail:`${Nt(s.gpu.gtt_used)} / ${Nt(s.gpu.gtt_total)} GB`}),s.disk&&n.jsx(ci,{value:s.disk.percent,label:"Disk",detail:`${Nt(s.disk.used)} / ${Nt(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"]})]})]})}function Si({type:s,title:o,message:i,defaultValue:u,onConfirm:d,onCancel:f}){const m=g.useRef(null);return n.jsx("div",{className:"fixed inset-0 z-[99] bg-black/60 backdrop-blur-sm flex items-center justify-center p-4",children:n.jsxs("div",{className:"w-full max-w-sm rounded-2xl border border-border/80 bg-card p-6 shadow-2xl space-y-4 animate-in fade-in zoom-in-95 duration-200",children:[n.jsxs("div",{className:"flex items-center justify-between border-b border-border/20 pb-2",children:[n.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-primary",children:o}),n.jsx("button",{onClick:f||(()=>d()),className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground cursor-pointer",children:n.jsx(zn,{className:"h-4 w-4"})})]}),n.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:i}),s==="prompt"&&n.jsx("input",{ref:m,type:"text",defaultValue:u,className:"w-full h-9 px-3 text-xs bg-background/40 border border-border/60 rounded-lg outline-none focus:border-primary transition-colors text-foreground",autoFocus:!0,onKeyDown:h=>{var v;h.key==="Enter"&&d((v=m.current)==null?void 0:v.value)}}),n.jsxs("div",{className:"flex justify-end gap-3 pt-2",children:[(s==="confirm"||s==="prompt")&&n.jsx("button",{onClick:f,className:"h-8 px-4 flex items-center justify-center text-xs font-semibold text-muted-foreground border border-border/60 bg-background/20 hover:bg-accent rounded-lg transition-colors cursor-pointer",children:"Abbrechen"}),n.jsx("button",{onClick:()=>{var v;const h=s==="prompt"?(v=m.current)==null?void 0:v.value:void 0;d(h)},className:"h-8 px-4 flex items-center justify-center text-xs font-semibold text-primary-foreground bg-primary hover:bg-primary/95 rounded-lg transition-colors cursor-pointer",children:s==="confirm"?"Ja, fortfahren":s==="prompt"?"Übernehmen":"OK"})]})]})})}function Vo(){const[s,o]=g.useState(null),i=g.useCallback(()=>o(null),[]),u=g.useCallback((h,v,x)=>{o({type:"alert",title:h,message:v,onConfirm:()=>{o(null),x==null||x()}})},[]),d=g.useCallback((h,v,x,b)=>{o({type:"confirm",title:h,message:v,onConfirm:()=>{o(null),x()},onCancel:()=>{o(null),b==null||b()}})},[]),f=g.useCallback((h,v,x,b,j)=>{o({type:"prompt",title:h,message:v,defaultValue:x,onConfirm:M=>{o(null),b(M)},onCancel:()=>{o(null),j==null||j()}})},[]),m=s?n.jsx(Si,{...s}):null;return{showAlert:u,showConfirm:d,showPrompt:f,close:i,dialogElement:m}}function Rb(){const s=zs(),{data:o}=Qv(3e3),{data:i=[]}=Gv(3e3),{showConfirm:u,dialogElement:d}=Vo(),[f,m]=g.useState(""),[h,v]=g.useState(!1),[x,b]=g.useState(""),[j,M]=g.useState(!1),[D,I]=g.useState({open:!1,actionPath:"",actionLabel:""}),w=()=>{s.invalidateQueries({queryKey:mt.updates}),s.invalidateQueries({queryKey:mt.jobs}),s.invalidateQueries({queryKey:mt.models})};async function C(R,F,K,ne){m(`${F} wird ausgeführt...`),v(!0);try{const ee={...K},J=await he(R,{method:"POST",body:JSON.stringify(ee)});if(J.status==="password_required"||J.status==="incorrect_password"){I({open:!0,actionPath:R,actionLabel:F,payload:K,error:J.status==="incorrect_password"?"Falsches Sudo-Passwort. Bitte erneut versuchen.":void 0}),m("");return}J.job_id?m(`${F} gestartet (Job-ID: ${J.job_id})`):J.ok?m(`${F} erfolgreich ausgeführt.`):m(`Fehler: ${J.err||"Unbekannter Fehler"}`),w()}catch(ee){m(`Fehler bei ${F}: ${ee.message}`)}finally{v(!1)}}async function _(){M(!0);try{const R={...D.payload,sudo_password:x},F=await he(D.actionPath,{method:"POST",body:JSON.stringify(R)});if(F.status==="password_required"||F.status==="incorrect_password"){I(K=>({...K,error:"Falsches Sudo-Passwort. Bitte erneut versuchen."}));return}F.job_id?m(`${D.actionLabel} gestartet (Job-ID: ${F.job_id})`):F.ok?m(`${D.actionLabel} erfolgreich ausgeführt.`):m(`Fehler: ${F.err||"Unbekannter Fehler"}`),I({open:!1,actionPath:"",actionLabel:""}),b(""),w()}catch(R){m(`Fehler: ${R.message}`),I({open:!1,actionPath:"",actionLabel:""}),b("")}finally{M(!1)}}async function $(R,F){m(`Upgrade für ${R} wird gestartet...`);try{await he("/api/models/install",{method:"POST",body:JSON.stringify({repo:R,role:F,quant:"Q4_K_M",jinja:!0})}),m("Upgrade-Download gestartet."),w()}catch(K){m(`Upgrade fehlgeschlagen: ${K.message}`)}}const H=i.find(R=>R.label.includes("OS-Update")&&(R.state==="running"||R.state==="queued")),z=i.find(R=>R.label.includes("Engine-Update")&&(R.state==="running"||R.state==="queued"));return 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:[D.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:()=>{I({open:!1,actionPath:"",actionLabel:""}),b("")},className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground cursor-pointer",children:n.jsx(zn,{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:D.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:x,onChange:R=>b(R.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:R=>R.key==="Enter"&&_(),autoFocus:!0}),D.error&&n.jsx("div",{className:"text-[10px] font-semibold text-red-400",children:D.error})]}),n.jsxs("div",{className:"flex gap-2 justify-end",children:[n.jsx("button",{onClick:()=>{I({open:!1,actionPath:"",actionLabel:""}),b("")},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:_,disabled:!x||j,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:j?"Prüfe...":"Ausführen"})]})]})}),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(R0,{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"})]}),(o==null?void 0:o.last_check)&&n.jsxs("span",{className:"text-[9px] text-muted-foreground/80 font-mono",children:["Zuletzt gesucht: ",new Date(o.last_check*1e3).toLocaleString("de-DE",{day:"2-digit",month:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit"})]})]}),o?n.jsxs("div",{className:"space-y-3",children:[n.jsxs("div",{className:"space-y-1.5",children:[n.jsxs("div",{className:te("flex items-center justify-between px-3 py-1.5 rounded-lg border text-xs",o.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:o.os>0?`${o.os} verfügbar`:"aktuell"})]}),n.jsxs("div",{className:te("flex items-center justify-between px-3 py-1.5 rounded-lg border text-xs",o.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:o.engine>0?"Update verfügbar":"aktuell"})]}),n.jsxs("div",{className:te("flex items-center justify-between px-3 py-1.5 rounded-lg border text-xs",o.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:o.models>0?`${o.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:()=>C("/api/maintenance/os-update","OS-Update"),disabled:h||!!H,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:H?n.jsxs(n.Fragment,{children:[n.jsx(Dn,{className:"h-3 w-3 animate-spin text-primary"}),n.jsxs("span",{children:["Aktiv (",H.progress??0,"%)"]})]}):n.jsx("span",{children:"OS Update"})}),n.jsx("button",{onClick:()=>C("/api/maintenance/engine-update","Engine-Update"),disabled:h||!!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(Dn,{className:"h-3 w-3 animate-spin text-primary"}),n.jsxs("span",{children:["Aktiv (",z.progress??0,"%)"]})]}):n.jsx("span",{children:"Engine Update"})})]}),n.jsxs("button",{onClick:()=>{u("Host-System neu starten?","Bist du sicher, dass du das Host-System neu starten willst?",()=>C("/api/maintenance/reboot","Reboot"))},disabled:h,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(Ph,{className:"h-3.5 w-3.5"}),n.jsx("span",{children:"Host Reboot"})]}),o.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:o.model_list.map(R=>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:`${R.role}: ${R.repo}`,children:[n.jsx("span",{className:"text-primary font-bold uppercase",children:R.role}),": ",R.repo.split("/").pop()]}),n.jsxs("button",{onClick:()=>$(R.repo,R.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(Tn,{className:"h-2.5 w-2.5"})," Laden"]})]},R.repo))})]})]}):n.jsx("div",{className:"h-24 flex items-center justify-center text-xs text-muted-foreground",children:"Lade Updates..."}),f&&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:f}),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(An,{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"})}),d]})}function Ob(){const s=zs(),{data:o}=dm(3e3),{data:i}=yc(),{showAlert:u,dialogElement:d}=Vo(),[f,m]=g.useState(!1),h=(i==null?void 0:i.models)??[];async function v(x){try{await he("/api/agent/brain",{method:"POST",body:JSON.stringify({model:x})}),u("Erfolgreich",`Hermes-Gehirn wurde auf '${x}' geändert. Der Gateway-Dienst wurde neu gestartet.`),s.invalidateQueries({queryKey:mt.agentStatus}),m(!1)}catch(b){u("Fehler",`Fehler beim Wechseln des Gehirns: ${b.message}`)}}return 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(Oo,{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"})]}),(o==null?void 0:o.webui_url)&&n.jsxs("a",{href:Lo(o.webui_url),target:"_blank",rel:"noopener",className:te("flex items-center gap-1 px-3 py-1 rounded-lg text-xs font-medium transition-all",o.webui_reachable?"bg-primary text-primary-foreground hover:opacity-90 shadow-md shadow-primary/20":"border border-border text-muted-foreground"),children:[n.jsx(xi,{className:"h-3 w-3"})," Hermes öffnen"]})]}),o?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:te("h-2 w-2 rounded-full",o.gateway_reachable?"bg-emerald-500 animate-pulse":"bg-amber-500")}),n.jsx("span",{className:"text-xs font-medium",children:o.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:te("h-2 w-2 rounded-full",o.webui_reachable?"bg-emerald-500 animate-pulse":"bg-amber-500")}),n.jsx("span",{className:"text-xs font-medium",children:o.webui_reachable?"Online":"Offline"})]})]})]}),n.jsxs("div",{onClick:()=>m(!0),className:"p-3 bg-background/20 rounded-xl border border-border/40 hover:border-primary/45 hover:bg-background/30 transition-all duration-300 cursor-pointer group",children:[n.jsxs("div",{className:"flex justify-between items-center",children:[n.jsx("span",{className:"text-[10px] text-muted-foreground uppercase font-semibold",children:"Aktives Gehirn"}),n.jsxs("button",{className:"flex items-center gap-1 text-[9px] font-bold uppercase tracking-wider text-primary border border-primary/20 bg-primary/10 hover:bg-primary/20 px-1.5 py-0.5 rounded transition-all cursor-pointer font-space",children:[n.jsx(Ot,{className:"h-3 w-3"})," Ändern"]})]}),n.jsxs("div",{className:"text-xs font-medium mt-1 font-mono text-primary flex items-center gap-1.5",children:[n.jsx(To,{className:"h-3.5 w-3.5"}),o.brain_model?`model: ${o.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."}),o&&f&&n.jsx("div",{className:"fixed inset-0 z-50 bg-black/60 backdrop-blur-sm flex items-center justify-center p-4",children:n.jsxs("div",{className:"w-full max-w-md rounded-2xl border border-border/80 bg-card p-6 shadow-2xl space-y-4 animate-in fade-in zoom-in-95 duration-200",children:[n.jsxs("div",{className:"flex items-center justify-between border-b border-border/20 pb-2",children:[n.jsxs("h3",{className:"text-xs font-bold uppercase tracking-wider text-primary flex items-center gap-1.5",children:[n.jsx(Ot,{className:"h-4 w-4"}),n.jsx("span",{children:"Hermes-Gehirn konfigurieren"})]}),n.jsx("button",{onClick:()=>m(!1),className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground cursor-pointer",children:n.jsx(zn,{className:"h-4 w-4"})})]}),n.jsxs("p",{className:"text-xs text-muted-foreground leading-relaxed",children:['Das „Gehirn" ist das primäre LLM für Hermes. Wähle ein Modell aus deiner Bibliothek oder nutze ein Gateway-Alias (',n.jsx("code",{className:"text-primary font-semibold",children:"auto"})," / ",n.jsx("code",{className:"text-primary font-semibold",children:"fast"})," / ",n.jsx("code",{className:"text-primary font-semibold",children:"heavy"}),"):"]}),n.jsx("div",{className:"space-y-1.5 max-h-60 overflow-y-auto pr-1",children:["auto","fast","heavy",...h.map(x=>{var b;return((b=x.name.split("/").pop())==null?void 0:b.replace(".gguf",""))||x.name})].map(x=>{const b=["auto","fast","heavy"].includes(x);return n.jsxs("button",{onClick:()=>v(x),className:te("w-full text-left px-3 py-2.5 rounded-lg text-xs hover:bg-accent flex items-center justify-between font-mono cursor-pointer border border-border/30",o.brain_model===x||!o.brain_model&&x==="auto"?"text-primary font-bold bg-primary/10 border-primary/30":"text-foreground bg-background/20"),children:[n.jsxs("div",{className:"flex flex-col text-left",children:[n.jsx("span",{className:"font-semibold truncate max-w-[280px]",children:x}),n.jsx("span",{className:"text-[9px] text-muted-foreground mt-0.5",children:b?"Gateway Routing Alias":"Installiertes GGUF Modell"})]}),(o.brain_model===x||!o.brain_model&&x==="auto")&&n.jsx(Ds,{className:"h-4 w-4 shrink-0 text-primary"})]},x)})})]})}),d]})}const Db=["fast","heavy","coder","reasoning","vision","scout"];function Tb(){const{data:s}=yc(3e3),o=(s==null?void 0:s.models)??[],i=(s==null?void 0:s.running)??[];return 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(To,{className:"h-4.5 w-4.5 text-primary"}),n.jsx("h2",{className:"text-sm font-semibold tracking-wide uppercase text-foreground",children:"Rollen-Belegung"})]}),n.jsx("div",{className:"space-y-2 max-h-48 overflow-y-auto pr-1 scrollbar-thin",children:Db.map(u=>{var m;const d=o.find(h=>h.role===u),f=d?i.includes(d.name):!1;return n.jsxs("div",{className:te("flex items-center justify-between p-2 rounded-xl border transition-all duration-300",f?"border-emerald-500/30 bg-emerald-500/5 shadow-sm shadow-emerald-500/5":d?"border-primary/20 bg-primary/5":"border-border/30 bg-background/10 opacity-60"),children:[n.jsx("div",{className:"min-w-0 flex-1 mr-2",children:n.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[n.jsx("span",{className:te("text-[9px] font-semibold uppercase px-1.5 py-0.5 rounded font-mono border tracking-wider shrink-0",u==="fast"?"bg-cyan-500/15 text-cyan-400 border-cyan-500/25":u==="heavy"?"bg-amber-500/15 text-amber-400 border-amber-500/25":u==="coder"?"bg-violet-500/15 text-violet-400 border-violet-500/25":u==="reasoning"?"bg-emerald-500/15 text-emerald-400 border-emerald-500/25":u==="vision"?"bg-pink-500/15 text-pink-400 border-pink-500/25":"bg-teal-500/15 text-teal-400 border-teal-500/25"),children:u}),n.jsxs("div",{className:"flex flex-col min-w-0",children:[n.jsx("span",{className:"text-xs font-semibold truncate font-mono text-foreground",children:d?(m=d.name.split("/").pop())==null?void 0:m.replace(/\.gguf$/i,""):"nicht zugewiesen"}),d&&n.jsxs("div",{className:"flex gap-1 items-center mt-0.5 flex-wrap",children:[d.prompt_cache&&n.jsx("span",{className:"text-[7px] leading-none font-mono font-bold bg-cyan-500/10 text-cyan-400 border border-cyan-500/20 px-1 py-0.5 rounded",title:"Prompt Caching aktiv",children:"PC"}),d.spec_draft_model&&n.jsx("span",{className:"text-[7px] leading-none font-mono font-bold bg-emerald-500/10 text-emerald-400 border border-emerald-500/20 px-1 py-0.5 rounded",title:`Speculative Decoding aktiv (Draft: ${d.spec_draft_model})`,children:"SPEC"}),d.parallel_slots>1&&n.jsxs("span",{className:"text-[7px] leading-none font-mono font-bold bg-violet-500/10 text-violet-400 border border-violet-500/20 px-1 py-0.5 rounded",title:`${d.parallel_slots} parallele Slots aktiv`,children:["SLOTS: ",d.parallel_slots]})]})]})]})}),n.jsx("div",{className:"flex items-center gap-1.5 shrink-0",children:d?f?n.jsxs("span",{className:"flex items-center gap-1 text-[8px] font-semibold text-emerald-400 uppercase tracking-wider font-mono",children:[n.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500 animate-pulse"})," warm"]}):n.jsx("span",{className:"text-[8px] font-semibold text-muted-foreground uppercase tracking-wider font-mono",children:"bereit"}):n.jsx("span",{className:"text-[8px] font-semibold text-muted-foreground/60 uppercase tracking-wider font-mono",children:"—"})})]},u)})})]}),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."})]})}function Ab(){const s=zs(),{data:o=[]}=fm({limit:3}),[i,u]=g.useState(""),[d,f]=g.useState("stable"),[m,h]=g.useState(!1);async function v(){if(!(!i.trim()||m)){h(!0);try{await he("/api/memory",{method:"POST",body:JSON.stringify({content:i,category:d,source:"dashboard"})}),u(""),s.invalidateQueries({queryKey:["memory"]})}catch(x){console.error(x)}finally{h(!1)}}}return 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(Do,{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:i,onChange:x=>u(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:d,onChange:x=>f(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:v,disabled:!i.trim()||m,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(Eh,{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:o.length===0?n.jsx("div",{className:"text-[10px] text-muted-foreground/75 py-1",children:"Keine Einträge vorhanden."}):o.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 zb(){var o;const{data:s}=Kv(3e3);return 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(y0,{className:"h-4.5 w-4.5 text-primary animate-pulse"}),n.jsx("h2",{className:"text-sm font-semibold tracking-wide uppercase text-foreground",children:"Effizienz & Ersparnis"})]}),s?n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"grid grid-cols-2 gap-2.5",children:[n.jsxs("div",{className:"p-3 bg-background/20 rounded-xl border border-border/40 text-left",children:[n.jsx("div",{className:"text-[8px] uppercase tracking-wider font-semibold text-muted-foreground/60",children:"Geld gespart"}),n.jsxs("div",{className:"text-base font-bold text-emerald-400 mt-0.5 tracking-tight font-space",children:[s.saved_eur.toLocaleString("de-DE",{minimumFractionDigits:2})," €"]}),n.jsxs("div",{className:"text-[8px] text-muted-foreground/80 mt-0.5 font-mono",children:["(",s.saved_usd.toLocaleString("en-US",{minimumFractionDigits:2})," $)"]})]}),n.jsxs("div",{className:"p-3 bg-background/20 rounded-xl border border-border/40 text-left",children:[n.jsx("div",{className:"text-[8px] uppercase tracking-wider font-semibold text-muted-foreground/60",children:"Gesamt-Tokens"}),n.jsx("div",{className:"text-base font-bold text-primary mt-0.5 tracking-tight font-space",children:s.total_tokens.toLocaleString("de-DE")}),n.jsx("div",{className:"text-[8px] text-muted-foreground/80 mt-0.5 font-mono",children:"(Lokale Inferenz)"})]})]}),n.jsxs("div",{className:"space-y-2 border-t border-border/20 pt-3 text-[10px] text-muted-foreground",children:[n.jsxs("div",{className:"flex justify-between items-center font-mono",children:[n.jsx("span",{children:"Input (Prompts):"}),n.jsxs("span",{className:"font-semibold text-foreground",children:[s.prompt_tokens.toLocaleString("de-DE")," tkn"]})]}),n.jsxs("div",{className:"flex justify-between items-center font-mono",children:[n.jsx("span",{children:"Output (Antworten):"}),n.jsxs("span",{className:"font-semibold text-foreground",children:[s.completion_tokens.toLocaleString("de-DE")," tkn"]})]})]})]}):n.jsx("div",{className:"h-28 flex items-center justify-center text-xs text-muted-foreground",children:"Lade Statistiken…"})]}),n.jsxs("div",{className:"mt-4 text-[9px] text-muted-foreground/70 border-t border-border/30 pt-2.5 leading-normal",children:["Berechnet im Vergleich zu Cloud-APIs von Juni 2026",(o=s==null?void 0:s.pricing)!=null&&o.heavy?`${s.pricing.heavy.in.toFixed(2).replace(".",",")} $ / ${s.pricing.heavy.out.toFixed(2).replace(".",",")} $ pro 1M tkn).`:"."]})]})}function Lb(){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:"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.jsx(Mb,{}),n.jsx(Rb,{})]}),n.jsxs("div",{className:"grid gap-6 md:grid-cols-2 xl:grid-cols-4",children:[n.jsx(Ob,{}),n.jsx(Tb,{}),n.jsx(Ab,{}),n.jsx(zb,{})]})]})}function jn({children:s,tone:o="muted"}){const i={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 ${i[o]}`,children:s})}function qp({caps:s}){return s?n.jsxs("span",{className:"inline-flex flex-wrap gap-1",children:[s.coder&&n.jsx(jn,{children:"💻 Code"}),s.vision&&n.jsx(jn,{children:"👁 Bild"}),s.reasoning&&n.jsx(jn,{children:"🧠 Reason"}),s.moe&&n.jsxs(jn,{tone:"primary",children:["🧩 MoE",s.active_b?`·${s.active_b}b`:""]}),s.tools==="yes"&&n.jsx(jn,{tone:"primary",children:"🛠 Tools"}),s.tools==="likely"&&n.jsx(jn,{tone:"warn",children:"🛠 Tools?"}),s.embedding&&n.jsx(jn,{children:"🔢 Embed"})]}):null}function Ib({onError:s}){const[o,i]=g.useState([]),[u,d]=g.useState(null);function f(){he("/api/jobs").then(x=>i(x.jobs||[])).catch(()=>{})}g.useEffect(()=>{f();const x=setInterval(f,2e3);return()=>clearInterval(x)},[]);async function m(x){try{await he(`/api/jobs/${x}/cancel`,{method:"POST"}),f()}catch(b){s?s(b.message):d(b.message)}}const h=o.filter(x=>x.state==="running"||x.state==="queued"),v=o.filter(x=>x.state!=="running"&&x.state!=="queued").slice(-3);return h.length===0&&v.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"}),h.map(x=>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:x.label}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsxs("span",{className:"text-muted-foreground font-mono",children:[x.progress??0,"% • ",nc(x.done_bytes),"/",nc(x.total_bytes),x.eta_s?` • ETA ${Zv(x.eta_s)}`:""]}),n.jsx("button",{onClick:()=>m(x.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:`${x.progress??0}%`}})})]},x.id)),v.map(x=>n.jsxs("div",{className:"flex justify-between items-center text-xs text-muted-foreground px-1",children:[n.jsx("span",{className:"truncate",children:x.label}),n.jsx("span",{className:te("font-semibold text-[10px] px-1.5 py-0.5 rounded uppercase font-mono",x.state==="done"?"bg-emerald-500/10 text-emerald-400":"bg-amber-500/10 text-amber-400"),children:x.state})]},x.id)),u&&n.jsx(Si,{type:"alert",title:"Fehler",message:u,onConfirm:()=>d(null)})]})}function Fb({fit:s}){const o={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:te("rounded px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wider font-mono",o),children:[s.text," • ",s.req_gb," GB RAM"]})}const Ub=["fast","heavy","coder","reasoning","agent","vision","scout"];function Zp(s){const o=s.toLowerCase();return o.includes("qwen")?{name:"Qwen",color:"bg-purple-500/20 text-purple-300 border-purple-500/30",initial:"Q"}:o.includes("gemma")?{name:"Gemma",color:"bg-blue-500/20 text-blue-300 border-blue-500/30",initial:"G"}:o.includes("llama")?{name:"Llama",color:"bg-red-500/20 text-red-300 border-red-500/30",initial:"🦙"}:o.includes("mistral")||o.includes("mixtral")?{name:"Mistral",color:"bg-orange-500/20 text-orange-300 border-orange-500/30",initial:"M"}:o.includes("deepseek")?{name:"DeepSeek",color:"bg-cyan-500/20 text-cyan-300 border-cyan-500/30",initial:"D"}:o.includes("hermes")||o.includes("nous")?{name:"Hermes",color:"bg-amber-500/20 text-amber-300 border-amber-500/30",initial:"H"}:o.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 $b(){var Un,Sr,ir,$n,Us;const[s,o]=g.useState([]),[i,u]=g.useState([]),[d,f]=g.useState(null),[m,h]=g.useState(null),[v,x]=g.useState(null),[b,j]=g.useState(!0),[M,D]=g.useState(""),[I,w]=g.useState(null),[C,_]=g.useState(null),[$,H]=g.useState(!1),[z,R]=g.useState(null),[F,K]=g.useState("grid"),[ne,ee]=g.useState("all"),[J,ke]=g.useState(null);function ue(A,oe,be){ke({type:"alert",title:A,message:oe,onConfirm:()=>{ke(null)}})}function Le(A,oe,be,Ee){ke({type:"confirm",title:A,message:oe,onConfirm:()=>{ke(null),be()},onCancel:()=>{ke(null)}})}function _e(A,oe,be,Ee,Ie){ke({type:"prompt",title:A,message:oe,defaultValue:be,onConfirm:Ut=>{ke(null),Ee(Ut)},onCancel:()=>{ke(null)}})}const Oe=s.filter(A=>ne==="in_use"?!!A.role||i.includes(A.name):!0),[Te,Me]=g.useState({width:800,height:360}),Q=g.useRef(null),ce=g.useCallback(A=>{if(Q.current&&(Q.current.disconnect(),Q.current=null),A){const oe=new ResizeObserver(be=>{if(!be||be.length===0)return;const Ee=be[0].contentRect;Me({width:Ee.width,height:Ee.height})});oe.observe(A),Q.current=oe}},[]),Z=Te.width,P=Te.height,N=A=>{const oe=Z*.1,be=P*A,Ee=Z*.5,Ie=P*.5,Ut=Z*.3,ar=be,ur=Z*.3;return`M ${oe} ${be} C ${Ut} ${ar}, ${ur} ${Ie}, ${Ee} ${Ie}`},G=A=>{const oe=Z*.5,be=P*.5,Ee=Z*.9,Ie=P*A,Ut=Z*.7,ar=be,ur=Z*.7;return`M ${oe} ${be} C ${Ut} ${ar}, ${ur} ${Ie}, ${Ee} ${Ie}`};function X(){Promise.all([he("/api/models"),he("/api/routing"),he("/api/connect"),he("/api/maintenance/updates")]).then(([A,oe,be,Ee])=>{o(A.models||[]),u(A.running||[]),f(oe),h(be),x(Ee)}).catch(A=>D(String(A))).finally(()=>j(!1))}g.useEffect(()=>{X();const A=setInterval(X,4e3);return()=>clearInterval(A)},[]);async function Y(A){try{await he(`/api/models/${encodeURIComponent(A)}/load`,{method:"POST"}),X()}catch(oe){ue("Fehler",`Fehler beim Laden des Modells: ${oe.message}`)}}async function ie(A){try{await he(`/api/models/${encodeURIComponent(A)}/unload`,{method:"POST"}),X()}catch(oe){ue("Fehler",`Fehler beim Entladen des Modells: ${oe.message}`)}}async function pe(){try{await he("/api/models/unload",{method:"POST"}),X()}catch(A){ue("Fehler",`Fehler beim Entladen aller Modelle: ${A.message}`)}}async function we(A,oe){try{await he(`/api/models/${encodeURIComponent(oe)}/role`,{method:"POST",body:JSON.stringify({role:A||null})}),X()}catch(be){ue("Fehler",`Fehler beim Zuweisen der Rolle: ${be.message||be}`)}}async function U(A,oe){_e("Kontextlänge anpassen","Gib die gewünschte Kontextlänge in Tokens an:",String(oe||32768),async be=>{if(be)try{await he(`/api/models/${encodeURIComponent(A)}/ctx`,{method:"POST",body:JSON.stringify({ctx:parseInt(be,10)})}),X()}catch(Ee){ue("Fehler",`Fehler beim Setzen des Kontexts: ${Ee.message||Ee}`)}})}async function me(A){Le("Modell löschen?",`Modell '${A}' und alle zugehörigen GGUF-Dateien unwiderruflich von der Box löschen?`,async()=>{try{await he(`/api/models/${encodeURIComponent(A)}`,{method:"DELETE"}),X()}catch(oe){ue("Fehler",`Fehler beim Löschen: ${oe.message||oe}`)}})}async function St(A,oe,be,Ee){try{await he("/api/models/install",{method:"POST",body:JSON.stringify({repo:A,role:oe,quant:be,jinja:Ee})}),ue("Herunterladen gestartet",`Download für '${A}' gestartet! Der Fortschritt wird oben angezeigt.`)}catch(Ie){ue("Fehler",`Fehler beim Starten des Upgrades: ${Ie.message||Ie}`)}}async function Go(A){A&&(await navigator.clipboard.writeText(A),H(!0),setTimeout(()=>H(!1),1500))}if(b)return n.jsx("div",{className:"text-xs text-muted-foreground py-12 text-center",children:"Initialisiere HUD Cockpit…"});if(M)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 (",M,")."]});const kr=s.filter(A=>i.includes(A.name)),ln=kr.reduce((A,oe)=>A+(oe.size_bytes||0),0),Is=16*1024**3,Fs=ln>Is?ln*1.2:Is,Fn=A=>s.find(oe=>oe.role===A),Nr=A=>{const oe=Fn(A);return oe?i.includes(oe.name):!1};return n.jsxs("div",{className:"space-y-8",children:[n.jsx("style",{children:`
@keyframes flow-dash {
to {
stroke-dashoffset: -20;
}
}
.svg-flow-path {
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(Zu,{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: ",wn(ln)," / ",wn(Fs)," geladen"]}),i.length>0&&n.jsx("button",{onClick:pe,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:kr.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"}):kr.map((A,oe)=>{var Ie;const be=(A.size_bytes||0)/Fs*100,Ee=["from-teal-500 to-emerald-500","from-indigo-500 to-blue-500","from-purple-500 to-pink-500","from-cyan-500 to-sky-500"][oe%4];return n.jsxs("div",{style:{width:`${be}%`},className:te("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",Ee),title:`${A.name} (${wn(A.size_bytes)})`,children:[n.jsxs("span",{className:"text-[9px] font-bold truncate max-w-[120px] font-space tracking-wide",children:[A.role?`[${A.role}] `:"",(Ie=A.name.split("/").pop())==null?void 0:Ie.replace(".gguf","")]}),n.jsx("span",{className:"text-[8px] font-mono opacity-80",children:wn(A.size_bytes)})]},A.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:ce,className:"relative w-full h-96 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:N(.1),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),(z==="roocode"||I==="roocode")&&n.jsx("path",{d:N(.1),stroke:"#06b6d4",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"}),n.jsx("path",{d:N(.3),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),(z==="cursor"||I==="cursor")&&n.jsx("path",{d:N(.3),stroke:"#06b6d4",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"}),n.jsx("path",{d:N(.5),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),(z==="opencode"||I==="opencode")&&n.jsx("path",{d:N(.5),stroke:"#06b6d4",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"}),n.jsx("path",{d:N(.7),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),(z==="zed"||I==="zed")&&n.jsx("path",{d:N(.7),stroke:"#06b6d4",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"}),n.jsx("path",{d:N(.9),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),(z==="continue"||I==="continue")&&n.jsx("path",{d:N(.9),stroke:"#06b6d4",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"}),n.jsx("path",{d:G(.12),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),Nr("fast")&&n.jsx("path",{d:G(.12),stroke:"url(#active-glow)",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"}),n.jsx("path",{d:G(.31),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),Nr("heavy")&&n.jsx("path",{d:G(.31),stroke:"url(#active-glow)",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"}),n.jsx("path",{d:G(.5),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),Nr("coder")&&n.jsx("path",{d:G(.5),stroke:"url(#active-glow)",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"}),n.jsx("path",{d:G(.69),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),Nr("vision")&&n.jsx("path",{d:G(.69),stroke:"url(#active-glow)",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"}),n.jsx("path",{d:G(.88),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),Nr("scout")&&n.jsx("path",{d:G(.88),stroke:"url(#active-glow)",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"})]}),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:()=>R("roocode"),onMouseLeave:()=>R(null),onClick:()=>w(A=>A==="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:()=>R("cursor"),onMouseLeave:()=>R(null),onClick:()=>w(A=>A==="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:()=>R("opencode"),onMouseLeave:()=>R(null),onClick:()=>w(A=>A==="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:()=>R("zed"),onMouseLeave:()=>R(null),onClick:()=>w(A=>A==="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:()=>R("continue"),onMouseLeave:()=>R(null),onClick:()=>w(A=>A==="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: > ",d!=null&&d.heavy_threshold_chars?d.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"})]}),Ub.map(A=>{var Ut;const oe=["12%","31%","50%","69%","88%"],be=Fn(A),Ee=be?i.includes(be.name):!1;if(A==="reasoning"||A==="agent")return null;const Ie={fast:0,heavy:1,coder:2,vision:3,scout:4}[A];return n.jsxs("div",{className:te("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",Ee?"border-emerald-500/50 bg-emerald-500/5 shadow-emerald-500/5":be?"border-border/60 bg-card/75":"border-dashed border-border/40 bg-background/20"),style:{left:"90%",top:oe[Ie]},onClick:()=>_(A),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:A}),Ee&&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:be?(Ut=be.name.split("/").pop())==null?void 0:Ut.replace(".gguf",""):"Keine Zuweisung"})]},A)}),I&&m&&n.jsx("div",{className:"fixed inset-0 z-50 bg-black/60 backdrop-blur-sm flex items-center justify-center p-4",children:n.jsxs("div",{className:"w-full max-w-md rounded-2xl border border-border/80 bg-card p-6 shadow-2xl space-y-4 animate-in fade-in zoom-in-95 duration-200 flex flex-col justify-between",children:[n.jsxs("div",{className:"flex items-center justify-between border-b border-border/20 pb-2",children:[n.jsxs("span",{className:"text-xs font-bold uppercase tracking-wider text-primary",children:[I==="roocode"&&"Roo Code Setup",I==="cursor"&&"Cursor Setup",I==="opencode"&&"OpenCode Setup",I==="zed"&&"Zed Setup",I==="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(zn,{className:"h-4 w-4"})})]}),n.jsxs("div",{className:"text-xs text-muted-foreground leading-relaxed space-y-2",children:[I==="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."]})]}),I==="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"}),"."]})]}),I==="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."]})]}),I==="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."]})]}),I==="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."]})]})]}),m.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-[10px] font-mono text-muted-foreground",children:"JSON Config"}),n.jsxs("button",{onClick:()=>{var A,oe,be,Ee,Ie;return Go(I==="roocode"?(A=m.tools.cline)==null?void 0:A.snippet:I==="cursor"?(oe=m.tools.cursor)==null?void 0:oe.snippet:I==="opencode"?(be=m.tools.opencode)==null?void 0:be.snippet:I==="zed"?(Ee=m.tools.zed)==null?void 0:Ee.snippet:(Ie=m.tools.continue)==null?void 0:Ie.snippet)},className:"text-xs font-semibold text-primary hover:text-primary-foreground flex items-center gap-1 cursor-pointer",children:[$?n.jsx(Ds,{className:"h-3.5 w-3.5 text-emerald-400"}):n.jsx(Ch,{className:"h-3.5 w-3.5"}),n.jsx("span",{children:$?"Kopiert":"Kopieren"})]})]}),n.jsx("pre",{className:"p-3 max-h-48 overflow-y-auto text-xs font-mono text-cyan-200/90 whitespace-pre scrollbar-thin select-text",children:n.jsxs("code",{children:[I==="roocode"&&((Un=m.tools.cline)==null?void 0:Un.snippet),I==="cursor"&&((Sr=m.tools.cursor)==null?void 0:Sr.snippet),I==="opencode"&&((ir=m.tools.opencode)==null?void 0:ir.snippet),I==="zed"&&(($n=m.tools.zed)==null?void 0:$n.snippet),I==="continue"&&((Us=m.tools.continue)==null?void 0:Us.snippet)]})})]}),n.jsx("button",{onClick:()=>w(null),className:"w-full h-9 rounded-lg bg-primary text-primary-foreground hover:opacity-90 font-semibold text-xs transition-opacity cursor-pointer mt-2",children:"Schließen"})]})})]}),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-5 shadow-lg shadow-black/10 space-y-3.5",children:[n.jsx("div",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground px-1",children:"Gateway Steckplatz-Belegung (Slot-Zuweisung)"}),n.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-6 gap-3",children:["fast","heavy","coder","reasoning","vision","scout"].map(A=>{var Ee;const oe=s.find(Ie=>Ie.role===A),be=oe?i.includes(oe.name):!1;return n.jsxs("div",{onClick:()=>_(A),className:te("rounded-xl border p-3 flex flex-col justify-between gap-2.5 transition-all cursor-pointer select-none text-left bg-background/25 hover:border-primary/45 hover:bg-background/40 group min-h-[90px]",be?"border-emerald-500/40 shadow-sm shadow-emerald-500/5":oe?"border-primary/20 bg-primary/5":"border-border/30 border-dashed opacity-75"),children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:te("text-[9px] font-bold uppercase tracking-wider font-mono px-1.5 py-0.5 rounded border",A==="fast"?"bg-cyan-500/10 text-cyan-400 border-cyan-500/20":A==="heavy"?"bg-amber-500/10 text-amber-400 border-amber-500/20":A==="coder"?"bg-violet-500/10 text-violet-400 border-violet-500/20":A==="reasoning"?"bg-emerald-500/10 text-emerald-400 border-emerald-500/20":A==="vision"?"bg-pink-500/10 text-pink-400 border-pink-500/20":"bg-teal-500/10 text-teal-400 border-teal-500/20"),children:A}),be&&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 text-foreground/90 pr-1 font-space",title:oe==null?void 0:oe.name,children:oe?(Ee=oe.name.split("/").pop())==null?void 0:Ee.replace(/\.gguf$/i,""):"nicht zugewiesen"}),n.jsx("div",{className:"text-[8px] text-primary/70 group-hover:text-primary font-bold uppercase tracking-wider transition-colors font-space",children:"Ändern ➔"})]},A)})})]}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3 px-1",children:[n.jsxs("div",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:["Installierte Modell-Bibliothek (",Oe.length," von ",s.length,")"]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsxs("div",{className:"flex rounded-lg border border-border/40 bg-card/45 p-0.5",children:[n.jsx("button",{onClick:()=>ee("all"),className:te("px-2.5 py-1 rounded-md text-[9px] font-bold uppercase transition-all cursor-pointer",ne==="all"?"bg-primary text-primary-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:"Vorhanden"}),n.jsx("button",{onClick:()=>ee("in_use"),className:te("px-2.5 py-1 rounded-md text-[9px] font-bold uppercase transition-all cursor-pointer",ne==="in_use"?"bg-primary text-primary-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:"In Benutzung"})]}),n.jsxs("div",{className:"flex rounded-lg border border-border/40 bg-card/45 p-0.5",children:[n.jsx("button",{onClick:()=>K("grid"),className:te("px-2.5 py-1 rounded-md text-[9px] font-bold uppercase transition-all cursor-pointer",F==="grid"?"bg-primary text-primary-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:"Grid"}),n.jsx("button",{onClick:()=>K("list"),className:te("px-2.5 py-1 rounded-md text-[9px] font-bold uppercase transition-all cursor-pointer",F==="list"?"bg-primary text-primary-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:"List"})]})]})]}),F==="grid"?n.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:Oe.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:ne==="in_use"?"Keine Modelle in Benutzung (keine Zuweisung oder warm geladene Modelle).":'Keine Modelle konfiguriert. Verwende den Tab "Modelle finden" zum Herunterladen.'}):Oe.map(A=>{const oe=i.includes(A.name),be=v==null?void 0:v.model_list.find(Ie=>Ie.role===A.role),Ee=Zp(A.name);return n.jsxs("div",{className:te("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 relative overflow-hidden",oe?"border-primary/45 shadow-primary/5":A.role?"border-primary/30 bg-primary/5 shadow-inner":"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:te("w-7 h-7 rounded-lg border flex items-center justify-center font-bold text-xs shrink-0 shadow-sm",Ee.color),title:Ee.name,children:Ee.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:A.name,children:A.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:A.quant||"GGUF"}),oe&&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"]}),A.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:A.role}),A.prompt_cache&&n.jsx("span",{className:"px-1.5 py-0.5 rounded bg-cyan-500/10 border border-cyan-500/20 text-[9px] font-mono text-cyan-400 font-bold uppercase",title:"Prompt Caching aktiv",children:"PC"}),A.spec_draft_model&&n.jsx("span",{className:"px-1.5 py-0.5 rounded bg-emerald-500/10 border border-emerald-500/20 text-[9px] font-mono text-emerald-400 font-bold uppercase",title:`Speculative Decoding aktiv (Draft: ${A.spec_draft_model})`,children:"SPEC"}),A.parallel_slots>1&&n.jsxs("span",{className:"px-1.5 py-0.5 rounded bg-violet-500/10 border border-violet-500/20 text-[9px] font-mono text-violet-400 font-bold uppercase",title:`${A.parallel_slots} parallele Slots aktiv`,children:["SLOTS: ",A.parallel_slots]})]})]})]})}),n.jsx("div",{className:"border-t border-border/30 pt-3 flex flex-wrap gap-1",children:n.jsx(qp,{caps:A.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(Zu,{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:wn(A.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(C0,{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:Gp(A.ctx)})]})]})]}),be&&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: ",be.repo.split("/").pop()]})]}),n.jsxs("button",{onClick:()=>St(be.repo,A.role,A.quant||"Q4_K_M",A.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(Tn,{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:()=>oe?ie(A.name):Y(A.name),className:te("flex-1 h-7 rounded-lg text-[9px] font-bold uppercase transition-all cursor-pointer border flex items-center justify-center gap-1",oe?"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:oe?"Entladen":"Laden"}),n.jsx("button",{onClick:()=>U(A.name,A.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:()=>me(A.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(Yu,{className:"h-3.5 w-3.5"})})]})]})]},A.name)})}):n.jsx("div",{className:"space-y-2",children:Oe.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:ne==="in_use"?"Keine Modelle in Benutzung (keine Zuweisung oder warm geladene Modelle).":'Keine Modelle konfiguriert. Verwende den Tab "Modelle finden" zum Herunterladen.'}):Oe.map(A=>{const oe=i.includes(A.name),be=Zp(A.name);return n.jsxs("div",{className:te("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",oe?"border-primary/45":A.role?"border-primary/30 bg-primary/5":"border-border/60"),children:[n.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[n.jsx("div",{className:te("w-8 h-8 rounded-lg border border-border/40 flex items-center justify-center font-bold text-xs shrink-0 shadow-sm",be.color),title:be.name,children:be.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:A.name,children:A.name.split("/").pop()}),A.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:A.role}),A.prompt_cache&&n.jsx("span",{className:"px-1.5 py-0.5 rounded bg-cyan-500/10 border border-cyan-500/20 text-[8px] font-mono text-cyan-400 font-bold uppercase shrink-0",title:"Prompt Caching aktiv",children:"PC"}),A.spec_draft_model&&n.jsx("span",{className:"px-1.5 py-0.5 rounded bg-emerald-500/10 border border-emerald-500/20 text-[8px] font-mono text-emerald-400 font-bold uppercase shrink-0",title:`Speculative Decoding aktiv (Draft: ${A.spec_draft_model})`,children:"SPEC"}),A.parallel_slots>1&&n.jsxs("span",{className:"px-1.5 py-0.5 rounded bg-violet-500/10 border border-violet-500/20 text-[8px] font-mono text-violet-400 font-bold uppercase shrink-0",title:`${A.parallel_slots} parallele Slots aktiv`,children:["SLOTS: ",A.parallel_slots]}),oe&&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: ",wn(A.size_bytes)]}),n.jsx("span",{children:"•"}),n.jsxs("span",{children:["Kontext: ",Gp(A.ctx)]}),n.jsx("span",{children:"•"}),n.jsx("span",{className:"font-mono text-[9px]",children:A.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(qp,{caps:A.capabilities})}),n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx("button",{onClick:()=>oe?ie(A.name):Y(A.name),className:te("h-7 px-3 rounded-lg text-[9px] font-bold uppercase transition-all cursor-pointer border flex items-center gap-1",oe?"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:oe?"Entladen":"Laden"}),n.jsx("button",{onClick:()=>U(A.name,A.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:()=>me(A.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(Yu,{className:"h-3.5 w-3.5"})})]})]})]},A.name)})})]}),C&&n.jsx("div",{className:"fixed inset-0 z-50 bg-black/60 backdrop-blur-sm flex items-center justify-center p-4",children:n.jsxs("div",{className:"w-full max-w-md rounded-2xl border border-border/80 bg-card p-6 shadow-2xl space-y-4 animate-in fade-in zoom-in-95 duration-200",children:[n.jsxs("div",{className:"flex items-center justify-between border-b border-border/20 pb-2",children:[n.jsxs("h3",{className:"text-xs font-bold uppercase tracking-wider text-primary",children:["Rolle '",C,"' konfigurieren"]}),n.jsx("button",{onClick:()=>_(null),className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground cursor-pointer",children:n.jsx(zn,{className:"h-4 w-4"})})]}),n.jsxs("p",{className:"text-xs text-muted-foreground",children:["Wähle ein Modell aus deiner Bibliothek für die Rolle ",n.jsx("strong",{className:"text-foreground",children:C}),":"]}),n.jsxs("div",{className:"space-y-1.5 max-h-60 overflow-y-auto pr-1",children:[n.jsx("button",{onClick:()=>{we(C,""),_(null)},className:"w-full text-left px-3 py-2 rounded-lg text-xs hover:bg-accent text-red-400 font-semibold cursor-pointer border border-red-500/20 bg-red-500/5 flex items-center justify-between",children:n.jsx("span",{children:"Zuweisung entfernen"})}),s.map(A=>{var oe;return n.jsxs("button",{onClick:()=>{we(C,A.name),_(null)},className:te("w-full text-left px-3 py-2.5 rounded-lg text-xs hover:bg-accent flex items-center justify-between font-mono cursor-pointer border border-border/30",A.role===C?"text-primary font-bold bg-primary/10 border-primary/30":"text-foreground bg-background/20"),children:[n.jsxs("div",{className:"flex flex-col text-left",children:[n.jsx("span",{className:"truncate max-w-[280px] font-semibold",children:(oe=A.name.split("/").pop())==null?void 0:oe.replace(".gguf","")}),n.jsxs("span",{className:"text-[9px] text-muted-foreground mt-0.5",children:[wn(A.size_bytes)," · ",A.quant]})]}),A.role===C&&n.jsx(Ds,{className:"h-4 w-4 shrink-0 text-primary"})]},A.name)})]})]})}),J&&n.jsx(Si,{type:J.type,title:J.title,message:J.message,defaultValue:J.defaultValue,onConfirm:J.onConfirm,onCancel:J.onCancel})]})}function Bb(){const[s,o]=g.useState(""),[i,u]=g.useState([]),[d,f]=g.useState("Q4_K_M"),[m,h]=g.useState(""),[v,x]=g.useState(""),[b,j]=g.useState([]);async function M(w){const C=w??s;if(C.trim()){h("Analysiere HuggingFace Repository...");try{const _=await he(`/api/hf/quants?repo=${encodeURIComponent(C)}`);o(_.repo),u(_.quants),_.quants.length&&f(_.quants.includes("Q4_K_M")?"Q4_K_M":_.quants[0]),h(_.quants.length?"":"Keine GGUF-Dateien in diesem Repository gefunden.")}catch(_){h(`Fehler: ${_}`)}}}async function D(){if(v.trim()){h("Durchsuche HuggingFace...");try{const w=await he(`/api/hf/search?q=${encodeURIComponent(v)}`);j(w.results),h(w.results.length?"":"Keine Ergebnisse gefunden.")}catch(w){h(`Suche fehlgeschlagen: ${w}`)}}}async function I(){if(s.trim()){h("Download-Job wird initiiert...");try{await he("/api/models/install",{method:"POST",body:JSON.stringify({repo:s,quant:d,jinja:!0})}),h(`Download gestartet: ${s} (${d}). Fortschritt wird oben angezeigt.`)}catch(w){h(`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=>o(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:()=>M(),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"}),i.length>0&&n.jsxs(n.Fragment,{children:[n.jsx("select",{value:d,onChange:w=>f(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:i.map(w=>n.jsx("option",{value:w,className:"bg-popover text-foreground",children:w},w))}),n.jsxs("button",{onClick:I,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(Tn,{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:v,onChange:w=>x(w.target.value),onKeyDown:w=>w.key==="Enter"&&D(),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(fc,{className:"absolute left-3 top-2.5 h-3.5 w-3.5 text-muted-foreground"})]}),n.jsx("button",{onClick:D,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"})]}),b.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:b.map(w=>n.jsxs("button",{onClick:()=>{o(w.repo),j([]),x(""),M(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(Tn,{className:"h-3 w-3"})," ",w.downloads.toLocaleString()]})]},w.repo))}),m&&n.jsx("div",{className:"text-[10px] font-medium text-primary font-mono",children:m})]})}const Hb={vision:{title:"Bilder & Vision",desc:"Verarbeitet Bilder, Screenshots und visuelle Diagramme in multimodalen Chats.",icon:qu},coder:{title:"Coden & Entwicklung",desc:"Autovervollständigung, Refactoring und Codegenerierung direkt in deiner IDE.",icon:Ku},reasoning:{title:"Logik & Nachdenken",desc:"Komplexe logische Gedankengänge, Mathematik und tiefgründiges Planen (Reasoning).",icon:Do},agent:{title:"Autonomer Agent (Hermes)",desc:"Führt selbstständig Terminalbefehle aus und interagiert mit deinem Homelab.",icon:Oo},scout:{title:"Allrounder & Chat",desc:"Schnelle Antworten, Zusammenfassungen, Übersetzungen und alltägliche Fragen.",icon:Qu}};function Wb(){const[s,o]=g.useState(null),[i,u]=g.useState([]),[d,f]=g.useState(null),[m,h]=g.useState(""),[v,x]=g.useState(!0),[b,j]=g.useState({}),[M,D]=g.useState({}),[I,w]=g.useState(!1);g.useEffect(()=>{Promise.all([he("/api/discover"),he("/api/models"),he("/api/maintenance/updates").catch(()=>null)]).then(([_,$,H])=>{o(_),u($.models||[]),H&&f(H)}).catch(_=>h(String(_))).finally(()=>x(!1))},[]);async function C(_,$,H,z){j(R=>({...R,[_]:"Starte..."}));try{await he("/api/models/install",{method:"POST",body:JSON.stringify({repo:_,role:$,quant:H,jinja:z})}),j(R=>({...R,[_]:"Download läuft"}))}catch{j(F=>({...F,[_]:"Fehler"}))}}return v?n.jsx("div",{className:"text-xs text-muted-foreground py-12 text-center",children:"Analysiere Hardware und suche passende GGUF-Empfehlungen…"}):m||!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 (",m,")."]}):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(_h,{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(_=>{const $=Hb[_.role]||{title:_.title||_.role,desc:"Spezifisches Modell für diese Systemrolle.",icon:To},H=$.icon,z=i.find(J=>J.role===_.role),R=d==null?void 0:d.model_list.find(J=>J.role===_.role),F=_.models.find(J=>J.repo===_.recommended)||_.models[0];if(!F)return null;const K=b[F.repo],ne=_.models.filter(J=>J.repo!==_.recommended),ee=!!M[_.role];return n.jsxs("div",{className:te("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",z?"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(H,{className:"h-5.5 w-5.5"})}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-sm font-bold tracking-tight text-foreground",children:$.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: ",_.role]})]})]}),z?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:$.desc}),n.jsx("div",{className:"p-3.5 rounded-xl bg-background/35 border border-border/30 space-y-2.5",children:z?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:z.name,children:z.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: ",nc(z.size_bytes||0)]}),n.jsx("span",{children:"•"}),n.jsxs("span",{children:["Quant: ",z.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:F.name,children:F.name}),n.jsxs("div",{className:"text-[10px] text-muted-foreground/80 flex items-center gap-2 flex-wrap",children:[n.jsxs("span",{children:["Ersteller: ",F.author]}),n.jsx("span",{children:"•"}),n.jsxs("span",{children:["Quant: ",F.quant]})]}),n.jsx("div",{className:"flex items-center gap-1.5 pt-0.5",children:n.jsx(Fb,{fit:F.fit})})]})}),n.jsx("div",{className:"pt-1",children:z?R?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: ",R.repo.split("/").pop()]})]}),n.jsxs("button",{onClick:()=>C(R.repo,_.role,F.quant||"Q4_K_M",F.caps.tools!=="no"),disabled:!!b[R.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(Tn,{className:"h-3.5 w-3.5"}),b[R.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(Ds,{className:"h-4 w-4"})," Auf neuestem Stand"]}):n.jsxs("button",{onClick:()=>C(F.repo,_.role,F.quant||"Q4_K_M",F.caps.tools!=="no"),disabled:!!K,className:te("h-8 w-full flex items-center justify-center gap-1.5 rounded-lg text-xs font-bold transition-all cursor-pointer border",K?"border-primary/40 bg-primary/5 text-primary":"bg-primary text-primary-foreground hover:opacity-90 shadow-md shadow-primary/10"),children:[n.jsx(Tn,{className:"h-3.5 w-3.5"}),K||"Optimales Modell einsetzen"]})})]}),ne.length>0&&n.jsxs("div",{className:"border-t border-border/20 pt-3",children:[n.jsxs("button",{onClick:()=>D(J=>({...J,[_.role]:!ee})),className:"flex items-center gap-1.5 text-[10px] text-muted-foreground/80 hover:text-foreground transition-colors cursor-pointer",children:[ee?n.jsx(m0,{className:"h-3 w-3"}):n.jsx(f0,{className:"h-3 w-3"}),n.jsxs("span",{children:["Alternative Empfehlungen anzeigen (",ne.length,")"]})]}),ee&&n.jsx("div",{className:"mt-2.5 space-y-2 max-h-36 overflow-y-auto pr-1 scrollbar-thin",children:ne.map(J=>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:J.name,children:J.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: ",J.quant]}),n.jsx("span",{children:"•"}),n.jsx("span",{children:J.fit.text})]})]}),n.jsx("button",{onClick:()=>C(J.repo,_.role,J.quant||"Q4_K_M",J.caps.tools!=="no"),disabled:!!b[J.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:b[J.repo]||"Installieren"})]},J.repo))})]})]},_.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(!I),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(fc,{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:I?"Ausblenden ▲":"Anzeigen ▼"})]}),I&&n.jsx("div",{className:"p-5 border-t border-border/20 bg-card/10",children:n.jsx(Bb,{})})]})]})}function Vb(){const[s,o]=g.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-Manager"}),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(i=>n.jsx("button",{onClick:()=>o(i),className:te("rounded-lg px-4 py-1.5 text-xs font-semibold tracking-wide uppercase transition-all cursor-pointer",s===i?"bg-primary text-primary-foreground shadow-md shadow-primary/10":"text-muted-foreground hover:text-foreground"),children:i==="cockpit"?"Cockpit":"Modelle finden"},i))})]}),n.jsx(Ib,{}),n.jsx("div",{className:"transition-all duration-300",children:s==="cockpit"?n.jsx($b,{}):n.jsx(Wb,{})})]})}function di({label:s,percent:o,detail:i,icon:u}){const d=o>90?"bg-red-500 shadow-md shadow-red-500/20":o>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(u,{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(o),"%"]})]}),n.jsx("div",{className:"w-full h-2 bg-background/40 rounded-full overflow-hidden border border-border/20",children:n.jsx("div",{className:te("h-full transition-all duration-700 ease-out",d),style:{width:`${Math.min(o,100)}%`}})}),i&&n.jsx("div",{className:"text-[10px] font-mono text-muted-foreground/80",children:i})]})}function Gb(){const{data:s,error:o}=xc(3e3),{data:i}=Vv(3e3),{showAlert:u,dialogElement:d}=Vo(),f=o?String(o):"",[m,h]=g.useState(""),[v,x]=g.useState({});async function b(){h("Backup snapshotted...");try{const M=await he("/api/system/backup",{method:"POST"});h(M.ok?`Snapshot erzeugt: ${M.snapshot} (${M.files.length} Dateien)`:"Keine Änderungen zu sichern.")}catch(M){h(`Fehler: ${M.message}`)}}async function j(M){x(D=>({...D,[M]:!0}));try{const D=await he("/api/maintenance/restart",{method:"POST",body:JSON.stringify({service:M})});D.ok?u("Erfolgreich",`Dienst ${M} wurde erfolgreich neu gestartet.`):u("Fehler beim Neustart",`Fehler beim Neustart: ${D.err||"Unbekannter Fehler"}`)}catch(D){u("Fehler",`Fehler: ${D.message}`)}finally{x(D=>({...D,[M]:!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(di,{label:"CPU",percent:s.cpu.percent,detail:s.cpu.cores?`${s.cpu.cores} Cores`:void 0,icon:Ot}),n.jsx(di,{label:"RAM",percent:s.ram.percent,detail:`${Nt(s.ram.used)} / ${Nt(s.ram.total)} GB`,icon:gi}),s.gpu&&s.gpu.busy_percent!=null&&n.jsx(di,{label:"GPU",percent:s.gpu.busy_percent,detail:s.gpu.gtt_used!=null&&s.gpu.gtt_total?`${Nt(s.gpu.gtt_used)} / ${Nt(s.gpu.gtt_total)} GB (GTT/unified)`:s.gpu.vram_used!=null&&s.gpu.vram_total?`${Nt(s.gpu.vram_used)} / ${Nt(s.gpu.vram_total)} GB VRAM`:void 0,icon:Ot}),s.disk&&n.jsx(di,{label:"Disk",percent:s.disk.percent,detail:`${Nt(s.disk.used)} / ${Nt(s.disk.total)} GB`,icon:Zu})]}),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"]})]})]})]}),i&&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:i.services.map(M=>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:te("h-2.5 w-2.5 rounded-full ring-2 ring-black/40",M.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:M.name}),n.jsx("div",{className:"text-[9px] text-muted-foreground/60 font-mono mt-0.5 truncate",children:M.url})]})]}),n.jsx("button",{onClick:()=>j(M.name),disabled:v[M.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(Dn,{className:te("h-3.5 w-3.5",v[M.name]&&"animate-spin")})})]},M.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:Lo(i.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(xi,{className:"h-3 w-3"})," Engine Dashboard (llama-swap)"]}),n.jsxs("a",{href:Lo(i.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(xi,{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:b,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(P0,{className:"h-4 w-4"})," Snapshot erstellen"]})})]}),m&&n.jsx("div",{className:"text-[10px] font-mono text-primary font-medium bg-primary/5 p-3 rounded-xl border border-primary/20",children:m}),d]})}function Kb(){const[s,o]=g.useState(localStorage.getItem("mc_host")||"192.168.178.151"),[i,u]=g.useState(localStorage.getItem("mc_mcp_path")||""),[d,f]=g.useState("cline"),[m,h]=g.useState(!1),v=new URLSearchParams({host:s});i&&v.set("mcp_path",i);const{data:x,error:b}=qv(v.toString()),j=b?String(b):"";function M(C){o(C),C&&localStorage.setItem("mc_host",C)}function D(C){u(C),localStorage.setItem("mc_mcp_path",C)}const I=x==null?void 0:x.tools[d];async function w(){I&&(await navigator.clipboard.writeText(I.snippet),h(!0),setTimeout(()=>h(!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(j0,{className:"h-3.5 w-3.5 text-primary"})," Box LAN IP-Adresse"]}),n.jsx("input",{value:s,onChange:C=>M(C.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(w0,{className:"h-3.5 w-3.5 text-primary"})," Lokaler MCP-Scriptpfad"]}),n.jsx("input",{value:i,onChange:C=>D(C.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]}),x&&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(x.tools).map(([C,_])=>n.jsx("button",{onClick:()=>f(C),className:te("rounded-lg px-4 py-1.5 text-xs font-semibold tracking-wide uppercase transition-all cursor-pointer",d===C?"bg-primary text-primary-foreground shadow-md shadow-primary/10":"text-muted-foreground hover:text-foreground"),children:_.label},C))}),I&&n.jsxs("div",{className:"space-y-3",children:[I.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(k0,{className:"h-4.5 w-4.5 text-primary shrink-0 mt-0.5"}),n.jsx("span",{children:I.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:d==="cline"||d==="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:[m?n.jsx(Ds,{className:"h-3.5 w-3.5 text-emerald-400"}):n.jsx(Ch,{className:"h-3.5 w-3.5"}),n.jsx("span",{children:m?"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:I.snippet})})]})]})]})]})}const Yp=["user","instruction","stable","versioned","ephemeral"],Ru={user:{label:"User",icon:A0,color:"text-cyan-400",border:"border-cyan-500/30",bg:"bg-cyan-500/10",text:"text-cyan-400"},instruction:{label:"Regel",icon:_0,color:"text-violet-400",border:"border-violet-500/30",bg:"bg-violet-500/10",text:"text-violet-400"},stable:{label:"Fakt",icon:An,color:"text-indigo-400",border:"border-indigo-500/30",bg:"bg-indigo-500/10",text:"text-indigo-400"},versioned:{label:"Version",icon:D0,color:"text-amber-400",border:"border-amber-500/30",bg:"bg-amber-500/10",text:"text-amber-400"},ephemeral:{label:"Temporär",icon:x0,color:"text-pink-400",border:"border-pink-500/30",bg:"bg-pink-500/10",text:"text-pink-400"}},Jp={label:"Gedächtnis",icon:Sh,bg:"bg-muted/10",text:"text-muted-foreground"},Qb={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 qb(){const[s,o]=g.useState(""),[i,u]=g.useState(""),[d,f]=g.useState(""),[m,h]=g.useState("stable"),[v,x]=g.useState(!1),b=zs(),{showAlert:j,showConfirm:M,dialogElement:D}=Vo(),{data:I=[],error:w}=fm({q:i,category:s}),C=w?String(w):"",_=()=>b.invalidateQueries({queryKey:["memory"]});async function $(){d.trim()&&(await he("/api/memory",{method:"POST",body:JSON.stringify({content:d,category:m,source:"ui"})}),f(""),_())}async function H(R){await he(`/api/memory/${R}`,{method:"DELETE"}),_()}async function z(){x(!0);try{const R=await he("/api/memory/dedupe",{method:"POST",body:JSON.stringify({apply:!1})});if(R.duplicate_count===0){j("Ergebnis","Keine Dubletten gefunden — alles sauber.");return}M("Deduplizierung bestätigen",`${R.duplicate_count} Dublette(n) in ${R.groups.length} Gruppe(n) gefunden. Entfernen?`,async()=>{try{await he("/api/memory/dedupe",{method:"POST",body:JSON.stringify({apply:!0})}),_()}catch(F){j("Fehler",`Fehler beim Löschen: ${F.message}`)}})}catch(R){j("Fehler",`Fehler bei der Deduplizierung: ${R.message}`)}finally{x(!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:z,disabled:v,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(O0,{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:d,onChange:R=>f(R.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:m,onChange:R=>h(R.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:Yp.map(R=>{var F;return n.jsx("option",{value:R,className:"bg-popover text-foreground",children:((F=Ru[R])==null?void 0:F.label)||R},R)})})]}),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(Eh,{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:i,onChange:R=>u(R.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(fc,{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:()=>o(""),className:te("h-7 px-3 rounded-lg text-[10px] font-semibold uppercase tracking-wider transition-all cursor-pointer whitespace-nowrap",s?"text-muted-foreground hover:text-foreground":"bg-primary text-primary-foreground"),children:"Alle"}),Yp.map(R=>{const F=Ru[R]||Jp,K=F.icon;return n.jsxs("button",{onClick:()=>o(R),className:te("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",s===R?"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})]},R)})]})]}),C&&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: ",C]}),n.jsx("div",{className:"space-y-3",children:I.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."}):I.map(R=>{const F=Ru[R.category]||Jp,K=F.icon;return n.jsxs("div",{className:te("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",Qb[R.category]||"border-l-muted"),children:[n.jsxs("div",{className:"flex items-start gap-3 flex-1 min-w-0",children:[n.jsxs("span",{className:te("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:R.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:R.source}),n.jsx("button",{onClick:()=>H(R.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(Yu,{className:"h-3.5 w-3.5"})})]})]},R.id)})}),D]})}function fi({label:s,ok:o,detail:i,icon:u,onClick:d}){return n.jsxs("div",{onClick:d,className:te("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",o?"border-border/60":"border-amber-500/30",d&&"cursor-pointer hover:bg-card/70"),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(u,{className:te("h-4.5 w-4.5",o?"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:te("h-2 w-2 rounded-full ring-2 ring-black/40",o?"bg-emerald-500 animate-pulse":"bg-amber-500")}),n.jsx("span",{className:"text-xs font-semibold text-foreground",children:o?"Bereit / Online":"Offline / Inaktiv"})]}),i&&n.jsx("div",{className:"text-[10px] font-mono text-muted-foreground truncate max-w-[200px]",title:i,children:i})]}),d&&n.jsxs("button",{onClick:f=>{f.stopPropagation(),d()},className:"mt-2 flex items-center justify-center gap-1.5 w-full py-1.5 px-3 rounded-lg border border-primary/30 bg-primary/10 hover:bg-primary/20 text-primary text-[10px] font-bold uppercase tracking-wider transition-all cursor-pointer font-space",children:[n.jsx(Ot,{className:"h-3.5 w-3.5"}),n.jsx("span",{children:"Gehirn wechseln"})]})]})}function Zb(){const{data:s,error:o}=dm(5e3),{data:i}=yc(),{showAlert:u,dialogElement:d}=Vo(),f=zs(),m=o?String(o):"",h=g.useMemo(()=>["auto","fast","heavy",...((i==null?void 0:i.models)??[]).map(R=>{var F;return((F=R.name.split("/").pop())==null?void 0:F.replace(".gguf",""))||R.name})],[i]),[v,x]=g.useState(null),[b,j]=g.useState(!1),[M,D]=g.useState({width:800,height:360}),I=g.useRef(null),w=g.useCallback(z=>{if(I.current&&(I.current.disconnect(),I.current=null),z){const R=new ResizeObserver(F=>{if(!F||F.length===0)return;const K=F[0].contentRect;D({width:K.width,height:K.height})});R.observe(z),I.current=R}},[]),C=M.width,_=M.height,$=(z,R,F,K)=>{const ne=(z+F)/2;return`M ${z} ${R} C ${ne} ${R}, ${ne} ${K}, ${F} ${K}`};async function H(z){try{await he("/api/agent/brain",{method:"POST",body:JSON.stringify({model:z})}),u("Erfolgreich",`Hermes-Gehirn wurde auf '${z}' geändert. Der Gateway-Dienst wurde neu gestartet.`),f.invalidateQueries({queryKey:mt.agentStatus}),j(!1)}catch(R){u("Fehler",`Fehler beim Wechseln des Gehirns: ${R.message}`)}}return n.jsxs("div",{className:"space-y-6",children:[n.jsx("style",{children:`
@keyframes flow-dash {
to {
stroke-dashoffset: -20;
}
}
.svg-flow-path {
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:Lo(s.webui_url),target:"_blank",rel:"noopener",className:te("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(xi,{className:"h-4 w-4"}),n.jsx("span",{children:"Hermes WebUI öffnen"})]})]}),m&&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 (",m,")."]}),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(fi,{label:"Agent Gateway",ok:s.gateway_reachable,detail:"Port :8642 (REST API)",icon:Oo}),n.jsx(fi,{label:"Agent WebUI",ok:s.webui_reachable,detail:"Port :8787 (Chat UI)",icon:gi}),n.jsx(fi,{label:"Aktives Gehirn",ok:s.gateway_reachable,detail:s.brain_model?`Model: ${s.brain_model}`:"Model: auto",icon:Ot,onClick:()=>j(!0)}),n.jsx(fi,{label:"Verdrahtung",ok:s.has_config,detail:`Config: ${s.has_config?"✓":"—"} · Skills: ${s.has_skills?"✓":"—"} · Memory: ${s.has_memories?"✓":"—"}`,icon:vi})]}),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 Agent Flow Graph"}),n.jsx("p",{className:"text-[10px] text-muted-foreground mt-0.5 leading-relaxed",children:"Visualisiert das Zusammenspiel und die Verbindungspfade zwischen den Hermes-Systemkomponenten."})]}),n.jsxs("div",{ref:w,className:"relative w-full h-96 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:$(C*.15,_*.5,C*.5,_*.5),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),(v==="webui"||s.webui_reachable)&&n.jsx("path",{d:$(C*.15,_*.5,C*.5,_*.5),stroke:"#06b6d4",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"}),n.jsx("path",{d:$(C*.5,_*.5,C*.85,_*.3),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),(v==="gateway"||v==="brain"||s.gateway_reachable)&&n.jsx("path",{d:$(C*.5,_*.5,C*.85,_*.3),stroke:"url(#active-glow)",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"}),n.jsx("path",{d:$(C*.5,_*.5,C*.85,_*.7),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),(v==="gateway"||v==="wiring"||s.gateway_reachable)&&n.jsx("path",{d:$(C*.5,_*.5,C*.85,_*.7),stroke:"url(#active-glow)",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"})]}),n.jsxs("div",{className:"absolute cursor-pointer select-none z-10 w-36 h-9 -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.5 hover:border-primary transition-all text-[10px] font-semibold text-foreground shadow shadow-black/20",style:{left:"15%",top:"50%"},onMouseEnter:()=>x("webui"),onMouseLeave:()=>x(null),onClick:()=>s.webui_reachable&&window.open(Lo(s.webui_url),"_blank"),title:s.webui_reachable?"Klicken um Chat-WebUI zu öffnen":"WebUI Offline",children:[n.jsx(gi,{className:te("h-3.5 w-3.5",s.webui_reachable?"text-emerald-400":"text-amber-500")}),n.jsx("span",{children:"Agent WebUI"}),n.jsx("span",{className:te("w-1.5 h-1.5 rounded-full animate-pulse ml-auto",s.webui_reachable?"bg-emerald-500":"bg-amber-500")})]}),n.jsxs("div",{className:"absolute select-none z-10 w-40 py-2.5 px-3 -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 cursor-pointer",style:{left:"50%",top:"50%"},onMouseEnter:()=>x("gateway"),onMouseLeave:()=>x(null),children:[n.jsxs("div",{className:"flex items-center gap-1",children:[n.jsx(Oo,{className:"h-3.5 w-3.5 text-primary"}),n.jsx("span",{className:"text-[10px] uppercase font-bold text-primary font-space tracking-wide",children:"Agent Gateway"})]}),n.jsx("div",{className:"text-[9px] font-mono text-muted-foreground mt-0.5",children:"Port :8642"}),n.jsx("div",{className:te("mt-1 px-1.5 py-0.5 rounded text-[8px] font-semibold uppercase font-mono border",s.gateway_reachable?"bg-emerald-500/10 border-emerald-500/20 text-emerald-400":"bg-red-500/10 border-red-500/20 text-red-400"),children:s.gateway_reachable?"Online":"Offline"})]}),n.jsxs("div",{className:te("absolute z-20 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",s.gateway_reachable?"border-emerald-500/50 bg-emerald-500/5 shadow-emerald-500/5":"border-border/60 bg-card/75"),style:{left:"85%",top:"30%"},onMouseEnter:()=>x("brain"),onMouseLeave:()=>x(null),onClick:()=>j(!0),children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-1 text-muted-foreground",children:[n.jsx(Ot,{className:"h-3 w-3 text-primary"}),n.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider",children:"Aktives Gehirn"})]}),s.gateway_reachable&&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 font-space",title:s.brain_model,children:s.brain_model||"auto"})]}),n.jsxs("div",{className:te("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",s.has_config?"border-emerald-500/50 bg-emerald-500/5 shadow-emerald-500/5":"border-border/60 bg-card/75"),style:{left:"85%",top:"70%"},onMouseEnter:()=>x("wiring"),onMouseLeave:()=>x(null),children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-1 text-muted-foreground",children:[n.jsx(vi,{className:"h-3 w-3 text-primary"}),n.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider",children:"Verdrahtung"})]}),s.has_config&&n.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-400 animate-pulse"})]}),n.jsxs("div",{className:"text-[9px] font-mono mt-0.5 text-muted-foreground flex gap-1 justify-between",children:[n.jsxs("span",{children:["Config: ",s.has_config?"✓":"—"]}),n.jsxs("span",{children:["Skills: ",s.has_skills?"✓":"—"]}),n.jsxs("span",{children:["Memory: ",s.has_memories?"✓":"—"]})]})]})]}),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 Agenten"})]}),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: Verbindung hergestellt / Modul online"})]})]})]}),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(An,{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(An,{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"}),"."]})]})]})]}),s&&b&&n.jsx("div",{className:"fixed inset-0 z-50 bg-black/60 backdrop-blur-sm flex items-center justify-center p-4",children:n.jsxs("div",{className:"w-full max-w-md rounded-2xl border border-border/80 bg-card p-6 shadow-2xl space-y-4 animate-in fade-in zoom-in-95 duration-200",children:[n.jsxs("div",{className:"flex items-center justify-between border-b border-border/20 pb-2",children:[n.jsxs("h3",{className:"text-xs font-bold uppercase tracking-wider text-primary flex items-center gap-1.5",children:[n.jsx(Ot,{className:"h-4 w-4"}),n.jsx("span",{children:"Hermes-Gehirn konfigurieren"})]}),n.jsx("button",{onClick:()=>j(!1),className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground cursor-pointer",children:n.jsx(zn,{className:"h-4 w-4"})})]}),n.jsxs("p",{className:"text-xs text-muted-foreground leading-relaxed",children:['Das „Gehirn" ist das primäre LLM für Hermes. Wähle ein Modell aus deiner Bibliothek oder nutze ein Gateway-Alias (',n.jsx("code",{className:"text-primary font-semibold",children:"auto"})," / ",n.jsx("code",{className:"text-primary font-semibold",children:"fast"})," / ",n.jsx("code",{className:"text-primary font-semibold",children:"heavy"}),"):"]}),n.jsx("div",{className:"space-y-1.5 max-h-60 overflow-y-auto pr-1",children:h.map(z=>{const R=["auto","fast","heavy"].includes(z);return n.jsxs("button",{onClick:()=>H(z),className:te("w-full text-left px-3 py-2.5 rounded-lg text-xs hover:bg-accent flex items-center justify-between font-mono cursor-pointer border border-border/30",s.brain_model===z||!s.brain_model&&z==="auto"?"text-primary font-bold bg-primary/10 border-primary/30":"text-foreground bg-background/20"),children:[n.jsxs("div",{className:"flex flex-col text-left",children:[n.jsx("span",{className:"font-semibold truncate max-w-[280px]",children:z}),n.jsx("span",{className:"text-[9px] text-muted-foreground mt-0.5",children:R?"Gateway Routing Alias":"Installiertes GGUF Modell"})]}),(s.brain_model===z||!s.brain_model&&z==="auto")&&n.jsx(Ds,{className:"h-4 w-4 shrink-0 text-primary"})]},z)})})]})}),d]})}function Yb(){const[s,o]=g.useState("connect"),[i,u]=g.useState("roocode"),[d,f]=g.useState(null),m="192.168.178.151",[h,v]=g.useState(!1),[x,b]=g.useState(null);function j(){v(!0),he("/api/health").then(M=>{f(M),b(M.engine_reachable?"success":"partial")}).catch(()=>{f(null),b("fail")}).finally(()=>v(!1))}return g.useEffect(()=>{j()},[]),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:"flex gap-4 border-b border-border/40 pb-px",children:[n.jsx("button",{onClick:()=>o("connect"),className:te("pb-3 text-xs font-bold uppercase tracking-wider border-b-2 px-1 transition-all",s==="connect"?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"),children:"Editor-Anbindung"}),n.jsx("button",{onClick:()=>o("concepts"),className:te("pb-3 text-xs font-bold uppercase tracking-wider border-b-2 px-1 transition-all",s==="concepts"?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"),children:"KI-Wissensdatenbank (Juni 2026)"})]}),s==="connect"?n.jsxs(n.Fragment,{children:[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:te("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${(d==null?void 0:d.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:j,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(Dn,{className:te("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(Sh,{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(Ot,{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(To,{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(Do,{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(Ku,{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:te("rounded-lg px-4 py-1.5 text-xs font-semibold tracking-wide uppercase transition-all cursor-pointer flex items-center gap-1.5",i==="roocode"?"bg-primary text-primary-foreground shadow-md shadow-primary/10":"text-muted-foreground hover:text-foreground"),children:[n.jsx(_h,{className:"h-3.5 w-3.5 fill-amber-400/20"}),"Roo Code (VS Code)"]}),n.jsx("button",{onClick:()=>u("cursor"),className:te("rounded-lg px-4 py-1.5 text-xs font-semibold tracking-wide uppercase transition-all cursor-pointer",i==="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:te("rounded-lg px-4 py-1.5 text-xs font-semibold tracking-wide uppercase transition-all cursor-pointer",i==="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:[i==="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://",m,":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."]})]})]})]}),i==="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://",m,":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."]})]})]})]}),i==="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://",m,":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) is. 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."]})]})]})]}):n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10 flex items-start gap-4",children:[n.jsx(Qu,{className:"h-8 w-8 text-primary shrink-0 mt-0.5"}),n.jsxs("div",{className:"space-y-1",children:[n.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"Entwickler-Guide: Modernes Agentic Coding (2026)"}),n.jsx("p",{className:"text-xs text-muted-foreground leading-normal",children:"Willkommen im Wissenszentrum für dein Mission Control 2 Setup. Hier erfährst du, wie die verschiedenen Technologien (MoE, MCP, Skills, Hermes) zusammenarbeiten und wie du das Maximum aus deinen AI-Prozessabläufen herausholst."})]})]}),n.jsxs("div",{className:"grid gap-6 md:grid-cols-2",children:[n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 p-6 shadow-lg shadow-black/10 space-y-4",children:[n.jsxs("div",{className:"flex items-center gap-2 border-b border-border/20 pb-3",children:[n.jsx(To,{className:"h-5 w-5 text-cyan-400"}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"1. Mixture of Experts (MoE)"}),n.jsx("span",{className:"text-[9px] text-cyan-400 font-mono",children:"Effizienz durch Spezialisierung"})]})]}),n.jsxs("div",{className:"text-xs text-muted-foreground space-y-2 leading-normal",children:[n.jsxs("p",{children:[n.jsx("strong",{children:"Was ist das?"})," Bei traditionellen LLMs wird für jedes Wort das gesamte neuronale Netz aktiviert. Bei MoE besteht das Modell aus mehreren spezialisierten Teilnetzwerken (den ",n.jsx("em",{children:"Experts"}),"). Ein intelligenter ",n.jsx("em",{children:"Router"})," entscheidet pro Token (Wortteil), welche Experten zur Berechnung herangezogen werden."]}),n.jsxs("p",{children:[n.jsx("strong",{children:"Warum in MC2?"})," So können extrem leistungsstarke Modelle (wie DeepSeek-V3, Mixtral oder Command R+) mit wesentlich geringeren Hardwarekosten ausgeführt werden. Es wird nur ein Bruchteil der Parameter geladen und aktiv berechnet, was Speicherplatz spart und die Inferenz beschleunigt."]}),n.jsxs("div",{className:"p-3 bg-background/25 rounded-xl border border-border/30 font-mono text-[10px] text-foreground",children:[n.jsx("span",{className:"text-cyan-400",children:"Vorteil:"})," GPT-4-Klasse Performance bei einem Bruchteil der aktiven VRAM-Last auf deinem Homelab!"]})]})]}),n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 p-6 shadow-lg shadow-black/10 space-y-4",children:[n.jsxs("div",{className:"flex items-center gap-2 border-b border-border/20 pb-3",children:[n.jsx(Qu,{className:"h-5 w-5 text-violet-400"}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"2. Model Context Protocol (MCP)"}),n.jsx("span",{className:"text-[9px] text-violet-400 font-mono",children:"Standardisierte Agenten-Tools"})]})]}),n.jsxs("div",{className:"text-xs text-muted-foreground space-y-2 leading-normal",children:[n.jsxs("p",{children:[n.jsx("strong",{children:"Was ist das?"})," MCP ist ein offenes Protokoll (initiiert von Anthropic), das festlegt, wie ein KI-Client (z.B. Roo Code auf deinem PC) mit externen Datenquellen und Tools kommuniziert. Es funktioniert wie ein USB-Standard für KI."]}),n.jsxs("p",{children:[n.jsx("strong",{children:"Warum in MC2?"})," MCP trennt den AI-Kern von der Umgebung. Statt für jeden Editor eigene Tools zu schreiben, binden deine Agenten (Roo Code, Hermes) einfach MCP-Server an. Diese Server können Dateien lesen, Websuchen durchführen, Git bedienen oder mit deiner App interagieren."]}),n.jsxs("div",{className:"space-y-1.5 p-3 bg-background/25 rounded-xl border border-border/30 text-[10px]",children:[n.jsx("div",{className:"font-bold text-foreground",children:"Gute Quellen für MCP Server:"}),n.jsxs("ul",{className:"list-disc pl-4 space-y-1 text-muted-foreground",children:[n.jsxs("li",{children:[n.jsx("a",{href:"https://smithery.ai/",target:"_blank",rel:"noopener",className:"text-primary hover:underline font-semibold",children:"Smithery Registry"})," — Ein Portal zum Suchen und automatischen Installieren von MCP Servern."]}),n.jsxs("li",{children:[n.jsx("a",{href:"https://glama.ai/mcp/servers",target:"_blank",rel:"noopener",className:"text-primary hover:underline font-semibold",children:"Glama MCP Registry"})," — Eine kuratierte, umfangreiche Community-Datenbank von MCP Servern."]}),n.jsxs("li",{children:[n.jsx("a",{href:"https://github.com/modelcontextprotocol/servers",target:"_blank",rel:"noopener",className:"text-primary hover:underline font-semibold",children:"Offizielles Anthropic Repo"})," — Das offizielle Repository mit Standards wie filesystem, postgres, sqlite, brave-search und puppeteer."]})]})]})]})]}),n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 p-6 shadow-lg shadow-black/10 space-y-4",children:[n.jsxs("div",{className:"flex items-center gap-2 border-b border-border/20 pb-3",children:[n.jsx(Do,{className:"h-5 w-5 text-emerald-400"}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"3. Agent Skills"}),n.jsx("span",{className:"text-[9px] text-emerald-400 font-mono",children:"Modulbasierte Fähigkeiten"})]})]}),n.jsxs("div",{className:"text-xs text-muted-foreground space-y-2 leading-normal",children:[n.jsxs("p",{children:[n.jsx("strong",{children:"Was ist das?"})," Ein Skill ist ein Verzeichnis mit standardisierten Anweisungen, Scripten und Beispielen, das deine Agenten für spezifische Aufgaben trainiert (z.B. Test-Driven Development, Code-Vereinfachung, API-Design)."]}),n.jsxs("p",{children:[n.jsx("strong",{children:"Wie benutzt man sie?"})," Lege einen Skill-Ordner unter ",n.jsx("code",{children:".agents/skills/<name>"})," in deinem Projekt an. Das Herzstück ist die Datei ",n.jsx("code",{children:"SKILL.md"})," mit folgendem Aufbau:"]}),n.jsx("pre",{className:"p-2.5 bg-background/25 rounded-lg border border-border/30 font-mono text-[9px] text-foreground overflow-x-auto whitespace-pre",children:`---
name: tdd-pro
description: Drive development with strict TDD practices
---
# Instructions
...`}),n.jsxs("div",{className:"space-y-1.5 p-3 bg-background/25 rounded-xl border border-border/30 text-[10px]",children:[n.jsx("div",{className:"font-bold text-foreground",children:"Wo gibt es Skills & wo liegen sie?"}),n.jsxs("ul",{className:"list-disc pl-4 space-y-2.5 text-muted-foreground",children:[n.jsxs("li",{children:[n.jsx("strong",{children:"skills.sh Registry & CLI:"})," Das offizielle offene Portal für Agent-Skills (",n.jsx("a",{href:"https://skills.sh/",target:"_blank",rel:"noopener",className:"text-primary hover:underline font-semibold",children:"skills.sh"}),"). Du kannst Skills direkt über das Terminal suchen und in deinem Projekt installieren:",n.jsxs("div",{className:"mt-1 font-mono text-[9px] bg-background/40 p-2 rounded border border-border/30 text-cyan-300",children:["# Nach Skills suchen:",n.jsx("br",{}),n.jsx("span",{className:"text-foreground",children:"npx skills find"}),n.jsx("br",{}),"# Skill zum aktuellen Projekt hinzufügen:",n.jsx("br",{}),n.jsx("span",{className:"text-foreground",children:"npx skills add [owner/repo]"})]})]}),n.jsxs("li",{children:[n.jsx("strong",{children:"Globaler Pfad:"})," ",n.jsx("code",{className:"text-foreground select-all",children:"C:\\Users\\TobisPC\\.gemini\\config\\plugins\\agent-skills\\skills\\"}),". Hier sind deine vorinstallierten, global verfügbaren Skills (wie ",n.jsx("i",{children:"code-simplification"}),", ",n.jsx("i",{children:"api-and-interface-design"}),", etc.) abgelegt."]}),n.jsxs("li",{children:[n.jsx("strong",{children:"Projekt-Pfad:"})," ",n.jsx("code",{className:"text-foreground select-all",children:".agents/skills/"}),". Lege diesen Ordner im Root eines beliebigen Projekts an. Dein lokaler Editor-Agent (z.B. Roo Code) liest ihn beim Starten automatisch ein."]}),n.jsxs("li",{children:[n.jsx("strong",{children:"Vorlagen / Beispiele:"})," Kopiere einfach bestehende Skills aus dem globalen Verzeichnis oder erstelle deine eigenen, indem du eine ",n.jsx("code",{children:"SKILL.md"})," mit YAML-Header (name, description) anlegst."]})]})]})]})]}),n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 p-6 shadow-lg shadow-black/10 space-y-4",children:[n.jsxs("div",{className:"flex items-center gap-2 border-b border-border/20 pb-3",children:[n.jsx(Ot,{className:"h-5 w-5 text-indigo-400"}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"4. Arbeiten mit Hermes"}),n.jsx("span",{className:"text-[9px] text-indigo-400 font-mono",children:"Autonomer Box-Agent"})]})]}),n.jsxs("div",{className:"text-xs text-muted-foreground space-y-2 leading-normal",children:[n.jsxs("p",{children:[n.jsx("strong",{children:"Was ist das?"})," Hermes ist der auf der Box installierte, autonome Hintergrund-Agent. Er verwaltet das Dateisystem und kann über REST (Port 8642) oder eine interaktive ChatUI (Port 8787) gesteuert werden."]}),n.jsx("p",{children:n.jsx("strong",{children:"Best Practices für Hermes:"})}),n.jsxs("ul",{className:"list-disc pl-4 space-y-1",children:[n.jsxs("li",{children:[n.jsx("strong",{children:"Chat-Kontext sauber halten:"})," Starte regelmäßig neue Chats. Zu große Historien verlangsamen den Agenten und führen zu Halluzinationen."]}),n.jsxs("li",{children:[n.jsx("strong",{children:"Gehirn festlegen:"})," Konfiguriere im Gateway die Modell-Rolle ",n.jsx("code",{children:"brain"})," für Hermes, damit er automatisch das passende Modell per Llama Swap lädt."]}),n.jsxs("li",{children:[n.jsx("strong",{children:"Sandbox umgehen:"})," Erweitere Hermes' System-Prompt (WebUI-Einstellungen), um Befehle über SSH an deinen Windows-PC zu leiten."]})]})]})]}),n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 p-6 shadow-lg shadow-black/10 space-y-4 md:col-span-2",children:[n.jsxs("div",{className:"flex items-center gap-2 border-b border-border/20 pb-3",children:[n.jsx(vi,{className:"h-5 w-5 text-amber-400"}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"5. Richtiges Arbeiten mit Tools (Dateien, Terminal, DevTools)"}),n.jsx("span",{className:"text-[9px] text-amber-400 font-mono",children:"Fehler vermeiden & Kosten senken"})]})]}),n.jsxs("div",{className:"grid md:grid-cols-3 gap-4 text-xs text-muted-foreground leading-normal",children:[n.jsxs("div",{className:"space-y-1.5 p-3 bg-background/10 rounded-xl border border-border/30",children:[n.jsxs("h4",{className:"font-bold text-foreground flex items-center gap-1",children:[n.jsx(yi,{className:"h-3.5 w-3.5 text-primary"})," Terminal"]}),n.jsxs("p",{className:"text-[11px]",children:["Verwende nur non-interaktive Befehle. Hänge bei langen Tasks (wie dev-Servern) ein ",n.jsx("code",{children:"&"})," an oder nutze die integrierte Job-Verwaltung. Verwende niemals interaktive Eingabeaufforderungen."]})]}),n.jsxs("div",{className:"space-y-1.5 p-3 bg-background/10 rounded-xl border border-border/30",children:[n.jsxs("h4",{className:"font-bold text-foreground flex items-center gap-1",children:[n.jsx(Ku,{className:"h-3.5 w-3.5 text-cyan-400"})," Dateimanager"]}),n.jsxs("p",{className:"text-[11px]",children:["Überschreibe keine ganzen Dateien, wenn du nur eine Zeile ändern willst. Verwende gezielte Ersetzungs-Tools (wie ",n.jsx("code",{children:"replace_file_content"}),"). Das spart massiv Token-Kosten und beugt Fehlern vor."]})]}),n.jsxs("div",{className:"space-y-1.5 p-3 bg-background/10 rounded-xl border border-border/30",children:[n.jsxs("h4",{className:"font-bold text-foreground flex items-center gap-1",children:[n.jsx(vi,{className:"h-3.5 w-3.5 text-violet-400"})," Browser DevTools"]}),n.jsx("p",{className:"text-[11px]",children:"Koppele deine Debug-Dienste mit dem Chrome-DevTools-Plugin. So kann der Agent Fehler in der Konsole live analysieren und das DOM verifizieren, anstatt blind zu raten."})]})]})]}),n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 p-6 shadow-lg shadow-black/10 space-y-4 md:col-span-2",children:[n.jsxs("div",{className:"flex items-center gap-2 border-b border-border/20 pb-3",children:[n.jsx(An,{className:"h-5 w-5 text-emerald-400"}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"Wie autonom ist Mission Control 2 wirklich?"}),n.jsx("span",{className:"text-[9px] text-emerald-400 font-mono",children:"Die Grenze zwischen Automatisierung und Kontrolle"})]})]}),n.jsxs("div",{className:"text-xs text-muted-foreground space-y-3 leading-normal",children:[n.jsxs("p",{children:["Mission Control 2 ist als ",n.jsx("strong",{children:"semi-autonomes Gateway"})," konzipiert. Es besitzt die Fähigkeit, komplexe Workflows komplett selbstständig durchzuführen, unterliegt jedoch strikten Sicherheitsplanken:"]}),n.jsxs("div",{className:"grid sm:grid-cols-2 gap-4 pt-1",children:[n.jsxs("div",{className:"space-y-1.5",children:[n.jsxs("h4",{className:"font-bold text-foreground flex items-center gap-1 text-[11px]",children:[n.jsx(Cp,{className:"h-3 w-3 text-emerald-400"})," Was läuft vollautomatisch?"]}),n.jsxs("ul",{className:"list-disc pl-4 space-y-1 text-[11px]",children:[n.jsx("li",{children:"Modellaustausch (Routing) per llama-swap je nach Anfragetyp (z.B. Code vs. Reasoning)."}),n.jsx("li",{children:"Hintergrund-Synchronisation und Speicherung von Gedächtniseinträgen (Memory)."}),n.jsx("li",{children:"Modell-Installation und API-Key-Injektionen in Gateway-Verbindungen."})]})]}),n.jsxs("div",{className:"space-y-1.5",children:[n.jsxs("h4",{className:"font-bold text-foreground flex items-center gap-1 text-[11px]",children:[n.jsx(Cp,{className:"h-3 w-3 text-amber-400"})," Wo ist menschliche Freigabe nötig?"]}),n.jsxs("ul",{className:"list-disc pl-4 space-y-1 text-[11px]",children:[n.jsxs("li",{children:[n.jsx("strong",{children:"Systembefehle:"})," Das Ausführen von Terminal-Kommandos auf deinem PC erfordert standardmäßig deine Bestätigung."]}),n.jsxs("li",{children:[n.jsx("strong",{children:"Kritische Systemeingriffe:"})," OS-Updates, Engine-Rebuilds und Host-Reboots müssen manuell über das Dashboard ausgelöst werden."]}),n.jsxs("li",{children:[n.jsx("strong",{children:"Gedächtnis-Löschung:"})," Permanentes Verwerfen von gesammelten Memorys wird von dir freigegeben."]})]})]})]}),n.jsxs("p",{className:"text-[11px] bg-background/25 p-3 rounded-xl border border-border/30 mt-2",children:[n.jsx("strong",{children:"Fazit:"})," Der Stack erledigt die Kärrnerarbeit (Modelle tauschen, API-Adapter bereitstellen, Sandbox-Verbindungen herstellen) komplett im Hintergrund. Er agiert als dein persönlicher, treuer Copilot, ohne jemals ungefragt schädliche Operationen auf deinem Hauptsystem auszuführen."]})]})]})]})]})]})}function Jb({title:s,hint:o}){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:o})]}),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(b0,{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 Xb=[{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 Ou(s){return s==null?"":s>1024**3?`${(s/1024**3).toFixed(2)} GB`:`${(s/1024**2).toFixed(1)} MB`}function e1({open:s,onClose:o,defaultTab:i="maintenance"}){const[u,d]=g.useState(null),[f,m]=g.useState([]),[h,v]=g.useState("llama-swap"),[x,b]=g.useState(""),[j,M]=g.useState(!1),[D,I]=g.useState(null),[w,C]=g.useState({}),[_,$]=g.useState("maintenance"),[H,z]=g.useState(!1),[R,F]=g.useState(null);function K(U,me,St){F({type:"alert",title:U,message:me,onConfirm:()=>{F(null),St&&St()}})}function ne(U,me,St){F({type:"confirm",title:U,message:me,onConfirm:()=>{F(null),St()},onCancel:()=>F(null)})}function ee(U){return U?new Date(U*1e3).toLocaleString("de-DE",{day:"2-digit",month:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):"Nie"}const[J,ke]=g.useState(""),[ue,Le]=g.useState(""),[_e,Oe]=g.useState(!1),[Te,Me]=g.useState(!1);g.useEffect(()=>{s&&(ke(localStorage.getItem("mc_sudo_password")||""),Le(localStorage.getItem("mc_hf_token")||""))},[s]),g.useEffect(()=>{s&&i&&$(i)},[s,i]);const Q=g.useRef(null);function ce(){he("/api/maintenance/updates").then(d).catch(U=>console.error("Error loading updates",U))}function Z(){he("/api/jobs").then(U=>m(U.jobs||[])).catch(U=>console.error("Error loading jobs",U))}function P(U){M(!0),I(null),he(`/api/maintenance/logs?service=${U}&lines=150`).then(me=>{me.ok?b(me.text):(b(`Fehler beim Laden der Logs: ${me.err||"Unbekannter Fehler"}`),(me.status==="incorrect_password"||me.status==="password_required")&&I(me.status))}).catch(me=>b(`Fehler: ${me.message}`)).finally(()=>{M(!1),setTimeout(()=>{Q.current&&(Q.current.scrollTop=Q.current.scrollHeight)},50)})}g.useEffect(()=>{if(!s)return;ce(),Z();const U=setInterval(()=>{Z(),ce()},3e3);return()=>clearInterval(U)},[s]),g.useEffect(()=>{!s||_!=="logs"||P(h)},[s,_,h]);async function N(){try{await he("/api/maintenance/os-update",{method:"POST"}),Z(),$("maintenance")}catch(U){K("Fehler",`Fehler beim Starten des OS-Updates: ${U.message}`)}}async function G(){try{await he("/api/maintenance/engine-update",{method:"POST"}),Z(),$("maintenance")}catch(U){K("Fehler",`Fehler beim Engine-Update: ${U.message}`)}}async function X(){z(!0);try{await he("/api/maintenance/check-updates",{method:"POST"}),Z(),$("maintenance")}catch(U){K("Fehler",`Fehler bei der Update-Suche: ${U.message}`)}finally{z(!1)}}async function Y(U,me){try{await he("/api/models/install",{method:"POST",body:JSON.stringify({repo:U,role:me})}),K("Gestartet",`Modell-Upgrade für '${me}' (${U}) gestartet.`),Z(),$("maintenance")}catch(St){K("Fehler",`Fehler beim Starten des Modell-Upgrades: ${St.message}`)}}async function ie(){ne("Reboot bestätigen","Bist du sicher, dass du das gesamte Host-System neu starten willst?",async()=>{try{await he("/api/maintenance/reboot",{method:"POST"}),K("Reboot","Reboot ausgelöst. System startet neu...",()=>{o()})}catch(U){K("Fehler",`Fehler beim Reboot: ${U.message}`)}})}async function pe(U){C(me=>({...me,[U]:!0}));try{const me=await he("/api/maintenance/restart",{method:"POST",body:JSON.stringify({service:U})});me.ok?K("Dienst neu gestartet",`Dienst ${U} wurde erfolgreich neu gestartet.`,()=>{_==="logs"&&h===U&&P(U)}):K("Fehler",`Fehler beim Neustart: ${me.err||"Unbekannter Fehler"}`)}catch(me){K("Fehler",`Fehler beim Neustart: ${me.message}`)}finally{C(me=>({...me,[U]:!1}))}}async function we(U){try{await he(`/api/jobs/${U}/cancel`,{method:"POST"}),Z()}catch(me){K("Fehler",`Fehler beim Abbrechen: ${me.message}`)}}return n.jsxs(n.Fragment,{children:[n.jsx("div",{className:te("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:o}),n.jsxs("div",{className:te("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(Ot,{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:o,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(zn,{className:"h-4 w-4"})})]}),n.jsxs("div",{className:"flex border-b border-border/40 px-6",children:[n.jsx("button",{onClick:()=>$("maintenance"),className:te("flex-1 py-3 text-xs font-semibold uppercase tracking-wider border-b-2 text-center transition-all",_==="maintenance"?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"),children:"System-Wartung"}),n.jsx("button",{onClick:()=>$("logs"),className:te("flex-1 py-3 text-xs font-semibold uppercase tracking-wider border-b-2 text-center transition-all",_==="logs"?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"),children:"System-Logs"}),n.jsx("button",{onClick:()=>$("settings"),className:te("flex-1 py-3 text-xs font-semibold uppercase tracking-wider border-b-2 text-center transition-all",_==="settings"?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"),children:"Einstellungen"})]}),n.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-6",children:[_==="maintenance"&&n.jsxs(n.Fragment,{children:[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:"Wartungsaktionen"}),n.jsxs("div",{className:"flex items-center gap-2",children:[(u==null?void 0:u.last_check)&&n.jsxs("span",{className:"text-[9px] text-muted-foreground",children:["Zuletzt gesucht: ",ee(u.last_check)]}),n.jsxs("button",{onClick:X,disabled:H,className:"flex items-center gap-1 text-[10px] font-semibold text-primary hover:text-primary/80 transition-colors disabled:opacity-50",children:[n.jsx(Dn,{className:te("h-3 w-3",H&&"animate-spin")}),"Nach Updates suchen"]})]})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n.jsxs("button",{onClick:N,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(An,{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:u!=null&&u.os?`${u.os} Updates verfügbar`:"Auf neuestem Stand"})]}),n.jsxs("button",{onClick:G,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(M0,{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:u!=null&&u.engine?"Update verfügbar":"Auf neuestem Stand"})]})]}),n.jsxs("button",{onClick:ie,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(Ph,{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"})]})]})]}),(u==null?void 0:u.model_list)&&u.model_list.length>0&&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:"Verfügbare Modell-Upgrades"}),(u==null?void 0:u.last_check)&&n.jsxs("span",{className:"text-[9px] text-muted-foreground",children:["Gesucht: ",ee(u.last_check)]})]}),n.jsx("div",{className:"space-y-2",children:u.model_list.map(U=>n.jsx("div",{className:"p-3 rounded-xl border border-border/60 bg-background/20 flex flex-col gap-2",children:n.jsxs("div",{className:"flex items-start justify-between gap-3",children:[n.jsxs("div",{children:[n.jsx("div",{className:"text-xs font-semibold",children:U.title}),n.jsx("div",{className:"text-[10px] font-mono text-muted-foreground",children:U.repo}),n.jsxs("div",{className:"text-[10px] text-primary font-semibold uppercase mt-0.5",children:["Rolle: ",U.role]})]}),n.jsxs("button",{onClick:()=>Y(U.repo,U.role),className:"flex items-center gap-1.5 text-[10px] font-semibold text-emerald-400 hover:text-emerald-300 border border-emerald-500/20 bg-emerald-500/5 hover:bg-emerald-500/10 px-2 py-1 rounded-lg transition-colors shrink-0",children:[n.jsx(Tn,{className:"h-3.5 w-3.5"}),"Upgrade"]})]})},U.role))})]}),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:[f.filter(U=>U.state==="running"||U.state==="queued").length," Aktiv"]})]}),n.jsx("div",{className:"space-y-3",children:f.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."}):f.map(U=>{const me=U.state==="running"||U.state==="queued";return n.jsxs("div",{className:te("p-3 rounded-xl border transition-all duration-300",me?"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:[me&&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"})]}),U.label]}),n.jsxs("div",{className:"text-[10px] font-mono text-muted-foreground uppercase flex items-center gap-2",children:[n.jsxs("span",{children:["ID: ",U.id]}),n.jsx("span",{children:"•"}),n.jsx("span",{className:te(U.state==="done"&&"text-emerald-400",U.state==="failed"&&"text-red-400",U.state==="running"&&"text-primary",U.state==="queued"&&"text-amber-400",U.state==="canceled"&&"text-muted-foreground"),children:U.state})]})]}),me&&n.jsx("button",{onClick:()=>we(U.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"})]}),U.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:`${U.progress??0}%`}})}),n.jsxs("div",{className:"flex justify-between items-center text-[9px] font-mono text-muted-foreground",children:[n.jsxs("span",{children:[U.progress??0,"%"]}),U.done_bytes!=null&&U.total_bytes!=null&&n.jsxs("span",{children:[Ou(U.done_bytes)," / ",Ou(U.total_bytes),U.rate_bps!=null&&` (${Ou(U.rate_bps)}/s)`]}),U.eta_s!=null&&n.jsxs("span",{children:["ETA: ",U.eta_s,"s"]})]})]})]},U.id)})})]})]}),_==="logs"&&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:h,onChange:U=>v(U.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:Xb.map(U=>n.jsxs("option",{value:U.id,children:[U.label," (",U.type==="system"?"systemd-root":"user",")"]},U.id))}),n.jsxs("button",{onClick:()=>pe(h),disabled:w[h],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(Dn,{className:te("h-3.5 w-3.5",w[h]&&"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 - ",h]})]}),n.jsx("button",{onClick:()=>P(h),disabled:j,className:"text-muted-foreground hover:text-foreground transition-colors",children:n.jsx(Dn,{className:te("h-3 w-3",j&&"animate-spin")})})]}),n.jsx("pre",{ref:Q,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:D==="password_required"||D==="incorrect_password"?n.jsxs("div",{className:"flex flex-col items-center justify-center p-6 text-center h-full space-y-3",children:[n.jsx(T0,{className:"h-8 w-8 text-amber-400 animate-pulse animate-duration-1000"}),n.jsx("div",{className:"text-xs font-semibold text-amber-300",children:D==="incorrect_password"?"Falsches Sudo-Passwort hinterlegt.":"Sudo-Passwort für systemd-Dienste erforderlich."}),n.jsxs("p",{className:"text-[10px] text-muted-foreground max-w-xs leading-normal",children:["Für das Auslesen der systemd-Logs von ",h," werden Root-Rechte benötigt. Hinterlege dein Passwort in den Einstellungen."]}),n.jsx("button",{onClick:()=>$("settings"),className:"px-3 py-1.5 text-[10px] font-semibold text-primary-foreground bg-primary hover:bg-primary/95 rounded-md transition-colors mt-2",children:"Sudo-Passwort eintragen"})]}):j&&!x?n.jsx("span",{className:"text-muted-foreground",children:"Lade Logs..."}):x||n.jsx("span",{className:"text-muted-foreground",children:"Keine Logeinträge vorhanden."})})]})]}),_==="settings"&&n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Zugangsdaten & Schlüssel"}),n.jsx("p",{className:"text-[10px] text-muted-foreground leading-normal",children:"Diese Daten werden ausschließlich lokal in deinem Browser (localStorage) gespeichert und bei Bedarf an das Backend übertragen."})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsxs("label",{className:"text-xs font-semibold flex items-center gap-1.5",children:[n.jsx(An,{className:"h-4 w-4 text-amber-400"}),"Host Sudo-Passwort"]}),n.jsxs("div",{className:"relative",children:[n.jsx("input",{type:_e?"text":"password",value:J,onChange:U=>ke(U.target.value),placeholder:"Sudo-Passwort für System-Operationen",className:"w-full h-10 pl-3 pr-10 text-xs bg-background/40 border border-border/60 rounded-lg outline-none focus:border-primary transition-colors text-foreground"}),n.jsx("button",{type:"button",onClick:()=>Oe(!_e),className:"absolute inset-y-0 right-0 flex items-center pr-3 text-muted-foreground hover:text-foreground transition-colors",children:_e?n.jsx(Ep,{className:"h-4 w-4"}):n.jsx(qu,{className:"h-4 w-4"})})]}),n.jsx("p",{className:"text-[9px] text-muted-foreground leading-normal",children:"Wird benötigt für systemd-Dienste (Llama Swap logs/restart), OS-Update (apt) und Reboot."})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsxs("label",{className:"text-xs font-semibold flex items-center gap-1.5",children:[n.jsx(N0,{className:"h-4 w-4 text-violet-400"}),"HuggingFace API Token"]}),n.jsxs("div",{className:"relative",children:[n.jsx("input",{type:Te?"text":"password",value:ue,onChange:U=>Le(U.target.value),placeholder:"hf_...",className:"w-full h-10 pl-3 pr-10 text-xs bg-background/40 border border-border/60 rounded-lg outline-none focus:border-primary transition-colors text-foreground"}),n.jsx("button",{type:"button",onClick:()=>Me(!Te),className:"absolute inset-y-0 right-0 flex items-center pr-3 text-muted-foreground hover:text-foreground transition-colors",children:Te?n.jsx(Ep,{className:"h-4 w-4"}):n.jsx(qu,{className:"h-4 w-4"})})]}),n.jsx("p",{className:"text-[9px] text-muted-foreground leading-normal",children:"Erlaubt das Herunterladen von geschützten oder Gate-restricted Modellen direkt über Mission Control."})]}),n.jsxs("div",{className:"flex gap-3 pt-2",children:[n.jsx("button",{onClick:()=>{localStorage.setItem("mc_sudo_password",J),localStorage.setItem("mc_hf_token",ue),K("Erfolgreich","Einstellungen erfolgreich lokal gespeichert.")},className:"flex-1 h-9 flex items-center justify-center text-xs font-semibold text-primary-foreground bg-primary hover:bg-primary/90 rounded-lg transition-colors shadow shadow-primary/10 cursor-pointer",children:"Speichern"}),n.jsx("button",{onClick:()=>{ke(""),Le(""),localStorage.removeItem("mc_sudo_password"),localStorage.removeItem("mc_hf_token"),K("Gelöscht","Zugangsdaten gelöscht.")},className:"h-9 px-4 flex items-center justify-center text-xs font-semibold text-muted-foreground border border-border/60 bg-background/20 hover:bg-accent rounded-lg transition-colors cursor-pointer",children:"Zurücksetzen"})]})]})]})]}),R&&n.jsx(Si,{type:R.type,title:R.title,message:R.message,onConfirm:R.onConfirm,onCancel:R.onCancel})]})}function t1(){var j,M,D,I,w;const[s,o]=g.useState("dashboard"),[i,u]=g.useState(()=>localStorage.getItem("mc_sidebar_collapsed")==="true"),[d,f]=g.useState(!1),[m,h]=g.useState("maintenance"),{data:v}=Wv(),{data:x}=xc(2e4);g.useEffect(()=>{document.documentElement.classList.add("dark")},[]),g.useEffect(()=>{const C=_=>{var H;h(((H=_.detail)==null?void 0:H.tab)||"maintenance"),f(!0)};return window.addEventListener("open-system-drawer",C),()=>window.removeEventListener("open-system-drawer",C)},[]);const b=Ju.find(C=>C.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(Hv,{onNavigate:o}),n.jsx(e1,{open:d,onClose:()=>f(!1),defaultTab:m}),n.jsxs("aside",{className:te("flex shrink-0 flex-col border-r border-border/40 bg-card/45 backdrop-blur-md transition-all duration-300 ease-in-out",i?"w-16":"w-60"),children:[n.jsxs("div",{className:te("flex items-center py-4 border-b border-border/40 shrink-0",i?"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"}),!i&&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:()=>{u(C=>{const _=!C;return localStorage.setItem("mc_sidebar_collapsed",_.toString()),_})},className:"p-1 rounded-md hover:bg-accent text-muted-foreground transition-colors cursor-pointer",title:i?"Maximieren":"Minimieren",children:i?n.jsx(h0,{className:"h-4 w-4"}):n.jsx(p0,{className:"h-4 w-4"})})]}),n.jsx("nav",{className:"flex-1 space-y-1 px-3 py-4 overflow-y-auto",children:Ju.map(C=>n.jsxs("button",{onClick:()=>o(C.id),className:te("flex w-full items-center rounded-md text-sm transition-all cursor-pointer",i?"justify-center p-2.5":"gap-3 px-3 py-2",s===C.id?"bg-primary/15 text-primary shadow-sm shadow-primary/5":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),title:i?C.label:void 0,children:[n.jsx(C.icon,{className:"h-4.5 w-4.5 shrink-0"}),!i&&n.jsx("span",{className:"truncate",children:C.label})]},C.id))}),n.jsx("div",{className:te("py-3 text-xs text-muted-foreground border-t border-border/40 shrink-0",i?"px-2 text-center":"px-5"),children:i?n.jsx("div",{className:"flex justify-center",children:n.jsx("span",{className:te("h-2.5 w-2.5 rounded-full ring-2 ring-black/40",v?v.engine_reachable?"bg-emerald-500 animate-pulse":"bg-amber-500":"bg-red-500"),title:v?`Engine ${v.engine_reachable?"online":"offline"}`:"Backend offline"})}):n.jsxs("div",{className:"space-y-2 text-left",children:[v?n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx("span",{className:te("h-2 w-2 rounded-full animate-pulse",v.engine_reachable?"bg-emerald-500":"bg-amber-500")}),n.jsxs("span",{className:"truncate",children:["Engine ",v.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"})]}),(x==null?void 0:x.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:x.versions.mc2?`${x.versions.mc2.branch}-${x.versions.mc2.hash}${x.versions.mc2.dirty?"*":""} (${x.versions.mc2.date})`:"nicht gefunden",children:[n.jsx("strong",{children:"MC2:"})," ",x.versions.mc2?`${x.versions.mc2.hash}${x.versions.mc2.dirty?"*":""}`:"—"]}),n.jsxs("div",{className:"truncate",title:((j=x.versions.engine)==null?void 0:j.type)==="git"?`${x.versions.engine.branch}-${x.versions.engine.hash}${x.versions.engine.dirty?"*":""} (${x.versions.engine.date})`:((M=x.versions.engine)==null?void 0:M.version_text)||"unbekannt",children:[n.jsx("strong",{children:"Engine:"})," ",((D=x.versions.engine)==null?void 0:D.type)==="git"?`${x.versions.engine.hash}${x.versions.engine.dirty?"*":""}`:((w=(I=x.versions.engine)==null?void 0:I.version_text)==null?void 0:w.split(" ").pop())||"—"]}),n.jsxs("div",{className:"truncate",title:x.versions.hermes_ui?`${x.versions.hermes_ui.branch}-${x.versions.hermes_ui.hash}${x.versions.hermes_ui.dirty?"*":""} (${x.versions.hermes_ui.date})`:"nicht gefunden",children:[n.jsx("strong",{children:"Hermes UI:"})," ",x.versions.hermes_ui?`${x.versions.hermes_ui.hash}${x.versions.hermes_ui.dirty?"*":""}`:"—"]}),n.jsxs("div",{className:"truncate",title:x.versions.hermes_agent?`${x.versions.hermes_agent.branch}-${x.versions.hermes_agent.hash}${x.versions.hermes_agent.dirty?"*":""} (${x.versions.hermes_agent.date})`:"nicht gefunden",children:[n.jsx("strong",{children:"Hermes Agent:"})," ",x.versions.hermes_agent?`${x.versions.hermes_agent.hash}${x.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:b.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 C=new KeyboardEvent("keydown",{key:"k",metaKey:!0});document.dispatchEvent(C)},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(v0,{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(Lb,{}),s==="models"&&n.jsx(Vb,{}),s==="system"&&n.jsx(Gb,{}),s==="connect"&&n.jsx(Kb,{}),s==="memory"&&n.jsx(qb,{}),s==="agent"&&n.jsx(Zb,{}),s==="guide"&&n.jsx(Yb,{}),!["dashboard","models","system","connect","memory","agent","guide"].includes(s)&&n.jsx(Jb,{title:b.label,hint:b.hint})]})]})]})}const r1=new qx({defaultOptions:{queries:{retry:1,refetchOnWindowFocus:!1,staleTime:5e3}}});kx.createRoot(document.getElementById("root")).render(n.jsx(ch.StrictMode,{children:n.jsx(Zx,{client:r1,children:n.jsx(t1,{})})}));