Files
mission-control-v2/frontend/dist/assets/index-DPqptZjm.js
T
Hitonabi c48e583790 Feat: Vulkan/RADV-Engine + vocab-gepruefte Spec-Drafts + Provisioning/Sync
Engine-Cutover ROCm/HIP -> Vulkan/RADV (gfx1151): +12-22% tg auf MoE (llama-bench
verifiziert, fast 53->65 t/s). ROCm-Build bleibt als Rollback unter /opt/llamacpp.

- Backend: vocab-aware Speculative Decoding. services/gguf_meta.py liest den
  Tokenizer-Fingerprint (model/pre/n_vocab) direkt aus dem GGUF-Header (ohne Modell-Load);
  register_model + migrate_config haengen nur VOCAB-KOMPATIBLE Drafts an (inkl. --spec-type,
  das in dieser llama.cpp-Generation noetig ist). Neue Endpoints /api/models/drafts + /{id}/draft.
- Frontend: idiotensichere Spec-Draft-UI (SpecDraftModal) - nur kompatible Drafts waehlbar,
  inkompatible gesperrt mit Begruendung; SPEC/SPEC?-Badge nach echtem Aktiv-Status; Rolle in AddModel.
- maintenance.py: Engine-Update-Quelle -> ggml-org/llama.cpp (Build-Nummer-Vergleich),
  ENGINE_PATH=/opt/llamacpp-vulkan.
- Startup-Warmup der brains (deploy/warmup.sh, self-detaching ExecStartPost) + deploy/provision-engine.sh.
- Cleanup: tote LiteLLM gateway/config.yaml + alle Referenzen (config.py/backup.py/backup.sh) entfernt;
  README + docs/memory aktualisiert.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-27 01:54:29 +02:00

396 lines
457 KiB
JavaScript

var ip=s=>{throw TypeError(s)};var mc=(s,o,i)=>o.has(s)||ip("Cannot "+i);var S=(s,o,i)=>(mc(s,o,"read from private field"),i?i.call(s):o.get(s)),ve=(s,o,i)=>o.has(s)?ip("Cannot add the same private member more than once"):o instanceof WeakSet?o.add(s):o.set(s,i),re=(s,o,i,c)=>(mc(s,o,"write to private field"),c?c.call(s,i):o.set(s,i),i),Ce=(s,o,i)=>(mc(s,o,"access private method"),i);var ni=(s,o,i,c)=>({set _(u){re(s,o,u,i)},get _(){return S(s,o,c)}});function bg(s,o){for(var i=0;i<o.length;i++){const c=o[i];if(typeof c!="string"&&!Array.isArray(c)){for(const u in c)if(u!=="default"&&!(u in s)){const f=Object.getOwnPropertyDescriptor(c,u);f&&Object.defineProperty(s,u,f.get?f:{enumerable:!0,get:()=>c[u]})}}}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 u of document.querySelectorAll('link[rel="modulepreload"]'))c(u);new MutationObserver(u=>{for(const f of u)if(f.type==="childList")for(const m of f.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&c(m)}).observe(document,{childList:!0,subtree:!0});function i(u){const f={};return u.integrity&&(f.integrity=u.integrity),u.referrerPolicy&&(f.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?f.credentials="include":u.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function c(u){if(u.ep)return;u.ep=!0;const f=i(u);fetch(u.href,f)}})();function dh(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var xc={exports:{}},Co={},gc={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 ap;function wg(){if(ap)return Se;ap=1;var s=Symbol.for("react.element"),o=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),c=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),f=Symbol.for("react.provider"),m=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),v=Symbol.for("react.suspense"),x=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),w=Symbol.iterator;function P(C){return C===null||typeof C!="object"?null:(C=w&&C[w]||C["@@iterator"],typeof C=="function"?C:null)}var O={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},I=Object.assign,j={};function N(C,E,Y){this.props=C,this.context=E,this.refs=j,this.updater=Y||O}N.prototype.isReactComponent={},N.prototype.setState=function(C,E){if(typeof C!="object"&&typeof C!="function"&&C!=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,C,E,"setState")},N.prototype.forceUpdate=function(C){this.updater.enqueueForceUpdate(this,C,"forceUpdate")};function M(){}M.prototype=N.prototype;function R(C,E,Y){this.props=C,this.context=E,this.refs=j,this.updater=Y||O}var B=R.prototype=new M;B.constructor=R,I(B,N.prototype),B.isPureReactComponent=!0;var L=Array.isArray,T=Object.prototype.hasOwnProperty,$={current:null},V={key:!0,ref:!0,__self:!0,__source:!0};function ee(C,E,Y){var X,Z={},le=null,pe=null;if(E!=null)for(X in E.ref!==void 0&&(pe=E.ref),E.key!==void 0&&(le=""+E.key),E)T.call(E,X)&&!V.hasOwnProperty(X)&&(Z[X]=E[X]);var be=arguments.length-2;if(be===1)Z.children=Y;else if(1<be){for(var U=Array(be),me=0;me<be;me++)U[me]=arguments[me+2];Z.children=U}if(C&&C.defaultProps)for(X in be=C.defaultProps,be)Z[X]===void 0&&(Z[X]=be[X]);return{$$typeof:s,type:C,key:le,ref:pe,props:Z,_owner:$.current}}function ne(C,E){return{$$typeof:s,type:C.type,key:E,ref:C.ref,props:C.props,_owner:C._owner}}function fe(C){return typeof C=="object"&&C!==null&&C.$$typeof===s}function je(C){var E={"=":"=0",":":"=2"};return"$"+C.replace(/[=:]/g,function(Y){return E[Y]})}var ue=/\/+/g;function Re(C,E){return typeof C=="object"&&C!==null&&C.key!=null?je(""+C.key):E.toString(36)}function Ee(C,E,Y,X,Z){var le=typeof C;(le==="undefined"||le==="boolean")&&(C=null);var pe=!1;if(C===null)pe=!0;else switch(le){case"string":case"number":pe=!0;break;case"object":switch(C.$$typeof){case s:case o:pe=!0}}if(pe)return pe=C,Z=Z(pe),C=X===""?"."+Re(pe,0):X,L(Z)?(Y="",C!=null&&(Y=C.replace(ue,"$&/")+"/"),Ee(Z,E,Y,"",function(me){return me})):Z!=null&&(fe(Z)&&(Z=ne(Z,Y+(!Z.key||pe&&pe.key===Z.key?"":(""+Z.key).replace(ue,"$&/")+"/")+C)),E.push(Z)),1;if(pe=0,X=X===""?".":X+":",L(C))for(var be=0;be<C.length;be++){le=C[be];var U=X+Re(le,be);pe+=Ee(le,E,Y,U,Z)}else if(U=P(C),typeof U=="function")for(C=U.call(C),be=0;!(le=C.next()).done;)le=le.value,U=X+Re(le,be++),pe+=Ee(le,E,Y,U,Z);else if(le==="object")throw E=String(C),Error("Objects are not valid as a React child (found: "+(E==="[object Object]"?"object with keys {"+Object.keys(C).join(", ")+"}":E)+"). If you meant to render a collection of children, use an array instead.");return pe}function Le(C,E,Y){if(C==null)return C;var X=[],Z=0;return Ee(C,X,"","",function(le){return E.call(Y,le,Z++)}),X}function Oe(C){if(C._status===-1){var E=C._result;E=E(),E.then(function(Y){(C._status===0||C._status===-1)&&(C._status=1,C._result=Y)},function(Y){(C._status===0||C._status===-1)&&(C._status=2,C._result=Y)}),C._status===-1&&(C._status=0,C._result=E)}if(C._status===1)return C._result.default;throw C._result}var Pe={current:null},K={transition:null},se={ReactCurrentDispatcher:Pe,ReactCurrentBatchConfig:K,ReactCurrentOwner:$};function Q(){throw Error("act(...) is not supported in production builds of React.")}return Se.Children={map:Le,forEach:function(C,E,Y){Le(C,function(){E.apply(this,arguments)},Y)},count:function(C){var E=0;return Le(C,function(){E++}),E},toArray:function(C){return Le(C,function(E){return E})||[]},only:function(C){if(!fe(C))throw Error("React.Children.only expected to receive a single React element child.");return C}},Se.Component=N,Se.Fragment=i,Se.Profiler=u,Se.PureComponent=R,Se.StrictMode=c,Se.Suspense=v,Se.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=se,Se.act=Q,Se.cloneElement=function(C,E,Y){if(C==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+C+".");var X=I({},C.props),Z=C.key,le=C.ref,pe=C._owner;if(E!=null){if(E.ref!==void 0&&(le=E.ref,pe=$.current),E.key!==void 0&&(Z=""+E.key),C.type&&C.type.defaultProps)var be=C.type.defaultProps;for(U in E)T.call(E,U)&&!V.hasOwnProperty(U)&&(X[U]=E[U]===void 0&&be!==void 0?be[U]:E[U])}var U=arguments.length-2;if(U===1)X.children=Y;else if(1<U){be=Array(U);for(var me=0;me<U;me++)be[me]=arguments[me+2];X.children=be}return{$$typeof:s,type:C.type,key:Z,ref:le,props:X,_owner:pe}},Se.createContext=function(C){return C={$$typeof:m,_currentValue:C,_currentValue2:C,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},C.Provider={$$typeof:f,_context:C},C.Consumer=C},Se.createElement=ee,Se.createFactory=function(C){var E=ee.bind(null,C);return E.type=C,E},Se.createRef=function(){return{current:null}},Se.forwardRef=function(C){return{$$typeof:p,render:C}},Se.isValidElement=fe,Se.lazy=function(C){return{$$typeof:b,_payload:{_status:-1,_result:C},_init:Oe}},Se.memo=function(C,E){return{$$typeof:x,type:C,compare:E===void 0?null:E}},Se.startTransition=function(C){var E=K.transition;K.transition={};try{C()}finally{K.transition=E}},Se.unstable_act=Q,Se.useCallback=function(C,E){return Pe.current.useCallback(C,E)},Se.useContext=function(C){return Pe.current.useContext(C)},Se.useDebugValue=function(){},Se.useDeferredValue=function(C){return Pe.current.useDeferredValue(C)},Se.useEffect=function(C,E){return Pe.current.useEffect(C,E)},Se.useId=function(){return Pe.current.useId()},Se.useImperativeHandle=function(C,E,Y){return Pe.current.useImperativeHandle(C,E,Y)},Se.useInsertionEffect=function(C,E){return Pe.current.useInsertionEffect(C,E)},Se.useLayoutEffect=function(C,E){return Pe.current.useLayoutEffect(C,E)},Se.useMemo=function(C,E){return Pe.current.useMemo(C,E)},Se.useReducer=function(C,E,Y){return Pe.current.useReducer(C,E,Y)},Se.useRef=function(C){return Pe.current.useRef(C)},Se.useState=function(C){return Pe.current.useState(C)},Se.useSyncExternalStore=function(C,E,Y){return Pe.current.useSyncExternalStore(C,E,Y)},Se.useTransition=function(){return Pe.current.useTransition()},Se.version="18.3.1",Se}var cp;function id(){return cp||(cp=1,gc.exports=wg()),gc.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 dp;function jg(){if(dp)return Co;dp=1;var s=id(),o=Symbol.for("react.element"),i=Symbol.for("react.fragment"),c=Object.prototype.hasOwnProperty,u=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,f={key:!0,ref:!0,__self:!0,__source:!0};function m(p,v,x){var b,w={},P=null,O=null;x!==void 0&&(P=""+x),v.key!==void 0&&(P=""+v.key),v.ref!==void 0&&(O=v.ref);for(b in v)c.call(v,b)&&!f.hasOwnProperty(b)&&(w[b]=v[b]);if(p&&p.defaultProps)for(b in v=p.defaultProps,v)w[b]===void 0&&(w[b]=v[b]);return{$$typeof:o,type:p,key:P,ref:O,props:w,_owner:u.current}}return Co.Fragment=i,Co.jsx=m,Co.jsxs=m,Co}var up;function kg(){return up||(up=1,xc.exports=jg()),xc.exports}var r=kg(),g=id();const uh=dh(g),ad=bg({__proto__:null,default:uh},[g]);var si={},vc={exports:{}},jt={},yc={exports:{}},bc={};/**
* @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 fp;function Ng(){return fp||(fp=1,(function(s){function o(K,se){var Q=K.length;K.push(se);e:for(;0<Q;){var C=Q-1>>>1,E=K[C];if(0<u(E,se))K[C]=se,K[Q]=E,Q=C;else break e}}function i(K){return K.length===0?null:K[0]}function c(K){if(K.length===0)return null;var se=K[0],Q=K.pop();if(Q!==se){K[0]=Q;e:for(var C=0,E=K.length,Y=E>>>1;C<Y;){var X=2*(C+1)-1,Z=K[X],le=X+1,pe=K[le];if(0>u(Z,Q))le<E&&0>u(pe,Z)?(K[C]=pe,K[le]=Q,C=le):(K[C]=Z,K[X]=Q,C=X);else if(le<E&&0>u(pe,Q))K[C]=pe,K[le]=Q,C=le;else break e}}return se}function u(K,se){var Q=K.sortIndex-se.sortIndex;return Q!==0?Q:K.id-se.id}if(typeof performance=="object"&&typeof performance.now=="function"){var f=performance;s.unstable_now=function(){return f.now()}}else{var m=Date,p=m.now();s.unstable_now=function(){return m.now()-p}}var v=[],x=[],b=1,w=null,P=3,O=!1,I=!1,j=!1,N=typeof setTimeout=="function"?setTimeout:null,M=typeof clearTimeout=="function"?clearTimeout:null,R=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function B(K){for(var se=i(x);se!==null;){if(se.callback===null)c(x);else if(se.startTime<=K)c(x),se.sortIndex=se.expirationTime,o(v,se);else break;se=i(x)}}function L(K){if(j=!1,B(K),!I)if(i(v)!==null)I=!0,Oe(T);else{var se=i(x);se!==null&&Pe(L,se.startTime-K)}}function T(K,se){I=!1,j&&(j=!1,M(ee),ee=-1),O=!0;var Q=P;try{for(B(se),w=i(v);w!==null&&(!(w.expirationTime>se)||K&&!je());){var C=w.callback;if(typeof C=="function"){w.callback=null,P=w.priorityLevel;var E=C(w.expirationTime<=se);se=s.unstable_now(),typeof E=="function"?w.callback=E:w===i(v)&&c(v),B(se)}else c(v);w=i(v)}if(w!==null)var Y=!0;else{var X=i(x);X!==null&&Pe(L,X.startTime-se),Y=!1}return Y}finally{w=null,P=Q,O=!1}}var $=!1,V=null,ee=-1,ne=5,fe=-1;function je(){return!(s.unstable_now()-fe<ne)}function ue(){if(V!==null){var K=s.unstable_now();fe=K;var se=!0;try{se=V(!0,K)}finally{se?Re():($=!1,V=null)}}else $=!1}var Re;if(typeof R=="function")Re=function(){R(ue)};else if(typeof MessageChannel<"u"){var Ee=new MessageChannel,Le=Ee.port2;Ee.port1.onmessage=ue,Re=function(){Le.postMessage(null)}}else Re=function(){N(ue,0)};function Oe(K){V=K,$||($=!0,Re())}function Pe(K,se){ee=N(function(){K(s.unstable_now())},se)}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(K){K.callback=null},s.unstable_continueExecution=function(){I||O||(I=!0,Oe(T))},s.unstable_forceFrameRate=function(K){0>K||125<K?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):ne=0<K?Math.floor(1e3/K):5},s.unstable_getCurrentPriorityLevel=function(){return P},s.unstable_getFirstCallbackNode=function(){return i(v)},s.unstable_next=function(K){switch(P){case 1:case 2:case 3:var se=3;break;default:se=P}var Q=P;P=se;try{return K()}finally{P=Q}},s.unstable_pauseExecution=function(){},s.unstable_requestPaint=function(){},s.unstable_runWithPriority=function(K,se){switch(K){case 1:case 2:case 3:case 4:case 5:break;default:K=3}var Q=P;P=K;try{return se()}finally{P=Q}},s.unstable_scheduleCallback=function(K,se,Q){var C=s.unstable_now();switch(typeof Q=="object"&&Q!==null?(Q=Q.delay,Q=typeof Q=="number"&&0<Q?C+Q:C):Q=C,K){case 1:var E=-1;break;case 2:E=250;break;case 5:E=1073741823;break;case 4:E=1e4;break;default:E=5e3}return E=Q+E,K={id:b++,callback:se,priorityLevel:K,startTime:Q,expirationTime:E,sortIndex:-1},Q>C?(K.sortIndex=Q,o(x,K),i(v)===null&&K===i(x)&&(j?(M(ee),ee=-1):j=!0,Pe(L,Q-C))):(K.sortIndex=E,o(v,K),I||O||(I=!0,Oe(T))),K},s.unstable_shouldYield=je,s.unstable_wrapCallback=function(K){var se=P;return function(){var Q=P;P=se;try{return K.apply(this,arguments)}finally{P=Q}}}})(bc)),bc}var pp;function Sg(){return pp||(pp=1,yc.exports=Ng()),yc.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 hp;function Cg(){if(hp)return jt;hp=1;var s=id(),o=Sg();function i(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);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 c=new Set,u={};function f(e,t){m(e,t),m(e+"Capture",t)}function m(e,t){for(u[e]=t,e=0;e<t.length;e++)c.add(t[e])}var p=!(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={},w={};function P(e){return v.call(w,e)?!0:v.call(b,e)?!1:x.test(e)?w[e]=!0:(b[e]=!0,!1)}function O(e,t,n,l){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return l?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function I(e,t,n,l){if(t===null||typeof t>"u"||O(e,t,n,l))return!0;if(l)return!1;if(n!==null)switch(n.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 j(e,t,n,l,a,d,h){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=l,this.attributeNamespace=a,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=d,this.removeEmptyString=h}var N={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){N[e]=new j(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];N[t]=new j(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){N[e]=new j(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){N[e]=new j(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){N[e]=new j(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){N[e]=new j(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){N[e]=new j(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){N[e]=new j(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){N[e]=new j(e,5,!1,e.toLowerCase(),null,!1,!1)});var M=/[\-:]([a-z])/g;function R(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(M,R);N[t]=new j(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(M,R);N[t]=new j(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(M,R);N[t]=new j(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){N[e]=new j(e,1,!1,e.toLowerCase(),null,!1,!1)}),N.xlinkHref=new j("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){N[e]=new j(e,1,!1,e.toLowerCase(),null,!0,!0)});function B(e,t,n,l){var a=N.hasOwnProperty(t)?N[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,n,a,l)&&(n=null),l||a===null?P(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):a.mustUseProperty?e[a.propertyName]=n===null?a.type===3?!1:"":n:(t=a.attributeName,l=a.attributeNamespace,n===null?e.removeAttribute(t):(a=a.type,n=a===3||a===4&&n===!0?"":""+n,l?e.setAttributeNS(l,t,n):e.setAttribute(t,n))))}var L=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,T=Symbol.for("react.element"),$=Symbol.for("react.portal"),V=Symbol.for("react.fragment"),ee=Symbol.for("react.strict_mode"),ne=Symbol.for("react.profiler"),fe=Symbol.for("react.provider"),je=Symbol.for("react.context"),ue=Symbol.for("react.forward_ref"),Re=Symbol.for("react.suspense"),Ee=Symbol.for("react.suspense_list"),Le=Symbol.for("react.memo"),Oe=Symbol.for("react.lazy"),Pe=Symbol.for("react.offscreen"),K=Symbol.iterator;function se(e){return e===null||typeof e!="object"?null:(e=K&&e[K]||e["@@iterator"],typeof e=="function"?e:null)}var Q=Object.assign,C;function E(e){if(C===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);C=t&&t[1]||""}return`
`+C+e}var Y=!1;function X(e,t){if(!e||Y)return"";Y=!0;var n=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(F){var l=F}Reflect.construct(e,[],t)}else{try{t.call()}catch(F){l=F}e.call(t.prototype)}else{try{throw Error()}catch(F){l=F}e()}}catch(F){if(F&&l&&typeof F.stack=="string"){for(var a=F.stack.split(`
`),d=l.stack.split(`
`),h=a.length-1,y=d.length-1;1<=h&&0<=y&&a[h]!==d[y];)y--;for(;1<=h&&0<=y;h--,y--)if(a[h]!==d[y]){if(h!==1||y!==1)do if(h--,y--,0>y||a[h]!==d[y]){var k=`
`+a[h].replace(" at new "," at ");return e.displayName&&k.includes("<anonymous>")&&(k=k.replace("<anonymous>",e.displayName)),k}while(1<=h&&0<=y);break}}}finally{Y=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?E(e):""}function Z(e){switch(e.tag){case 5:return E(e.type);case 16:return E("Lazy");case 13:return E("Suspense");case 19:return E("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 le(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 V:return"Fragment";case $:return"Portal";case ne:return"Profiler";case ee:return"StrictMode";case Re:return"Suspense";case Ee:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case je:return(e.displayName||"Context")+".Consumer";case fe: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 Le:return t=e.displayName||null,t!==null?t:le(e.type)||"Memo";case Oe:t=e._payload,e=e._init;try{return le(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 le(t);case 8:return t===ee?"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 be(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",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),l=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var a=n.get,d=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.call(this)},set:function(h){l=""+h,d.call(this,h)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return l},setValue:function(h){l=""+h},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function pt(e){e._valueTracker||(e._valueTracker=me(e))}function Is(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),l="";return e&&(l=U(e)?e.checked?"true":"false":e.value),e=l,e!==n?(t.setValue(e),!0):!1}function an(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 Fn(e,t){var n=t.checked;return Q({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function wr(e,t){var n=t.defaultValue==null?"":t.defaultValue,l=t.checked!=null?t.checked:t.defaultChecked;n=be(t.value!=null?t.value:n),e._wrapperState={initialChecked:l,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Fs(e,t){t=t.checked,t!=null&&B(e,"checked",t,!1)}function Un(e,t){Fs(e,t);var n=be(t.value),l=t.type;if(n!=null)l==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(l==="submit"||l==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?$n(e,t.type,n):t.hasOwnProperty("defaultValue")&&$n(e,t.type,be(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Us(e,t,n){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,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function $n(e,t,n){(t!=="number"||an(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var jr=Array.isArray;function A(e,t,n,l){if(e=e.options,t){t={};for(var a=0;a<n.length;a++)t["$"+n[a]]=!0;for(n=0;n<e.length;n++)a=t.hasOwnProperty("$"+e[n].value),e[n].selected!==a&&(e[n].selected=a),a&&l&&(e[n].defaultSelected=!0)}else{for(n=""+be(n),t=null,a=0;a<e.length;a++){if(e[a].value===n){e[a].selected=!0,l&&(e[a].defaultSelected=!0);return}t!==null||e[a].disabled||(t=e[a])}t!==null&&(t.selected=!0)}}function ie(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(i(91));return Q({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function ke(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(i(92));if(jr(n)){if(1<n.length)throw Error(i(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:be(n)}}function Ae(e,t){var n=be(t.value),l=be(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),l!=null&&(e.defaultValue=""+l)}function Ve(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function lr(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 cn(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?lr(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var kr,qo=(function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,l,a){MSApp.execUnsafeLocalFunction(function(){return e(t,n,l,a)})}:e})(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(kr=kr||document.createElement("div"),kr.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=kr.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function $s(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Bs={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},Nm=["Webkit","ms","Moz","O"];Object.keys(Bs).forEach(function(e){Nm.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Bs[t]=Bs[e]})});function wd(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Bs.hasOwnProperty(e)&&Bs[e]?(""+t).trim():t+"px"}function jd(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var l=n.indexOf("--")===0,a=wd(n,t[n],l);n==="float"&&(n="cssFloat"),l?e.setProperty(n,a):e[n]=a}}var Sm=Q({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(Sm[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 _i(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 Pi=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,Vn=null;function kd(e){if(e=uo(e)){if(typeof Ri!="function")throw Error(i(280));var t=e.stateNode;t&&(t=vl(t),Ri(e.stateNode,e.type,t))}}function Nd(e){Bn?Vn?Vn.push(e):Vn=[e]:Bn=e}function Sd(){if(Bn){var e=Bn,t=Vn;if(Vn=Bn=null,kd(e),t)for(e=0;e<t.length;e++)kd(t[e])}}function Cd(e,t){return e(t)}function Ed(){}var Oi=!1;function _d(e,t,n){if(Oi)return e(t,n);Oi=!0;try{return Cd(e,t,n)}finally{Oi=!1,(Bn!==null||Vn!==null)&&(Ed(),Sd())}}function Vs(e,t){var n=e.stateNode;if(n===null)return null;var l=vl(n);if(l===null)return null;n=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(n&&typeof n!="function")throw Error(i(231,t,typeof n));return n}var Di=!1;if(p)try{var Hs={};Object.defineProperty(Hs,"passive",{get:function(){Di=!0}}),window.addEventListener("test",Hs,Hs),window.removeEventListener("test",Hs,Hs)}catch{Di=!1}function Cm(e,t,n,l,a,d,h,y,k){var F=Array.prototype.slice.call(arguments,3);try{t.apply(n,F)}catch(W){this.onError(W)}}var Ws=!1,Zo=null,Yo=!1,Ti=null,Em={onError:function(e){Ws=!0,Zo=e}};function _m(e,t,n,l,a,d,h,y,k){Ws=!1,Zo=null,Cm.apply(Em,arguments)}function Pm(e,t,n,l,a,d,h,y,k){if(_m.apply(this,arguments),Ws){if(Ws){var F=Zo;Ws=!1,Zo=null}else throw Error(i(198));Yo||(Yo=!0,Ti=F)}}function dn(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function Pd(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 Md(e){if(dn(e)!==e)throw Error(i(188))}function Mm(e){var t=e.alternate;if(!t){if(t=dn(e),t===null)throw Error(i(188));return t!==e?null:e}for(var n=e,l=t;;){var a=n.return;if(a===null)break;var d=a.alternate;if(d===null){if(l=a.return,l!==null){n=l;continue}break}if(a.child===d.child){for(d=a.child;d;){if(d===n)return Md(a),e;if(d===l)return Md(a),t;d=d.sibling}throw Error(i(188))}if(n.return!==l.return)n=a,l=d;else{for(var h=!1,y=a.child;y;){if(y===n){h=!0,n=a,l=d;break}if(y===l){h=!0,l=a,n=d;break}y=y.sibling}if(!h){for(y=d.child;y;){if(y===n){h=!0,n=d,l=a;break}if(y===l){h=!0,l=d,n=a;break}y=y.sibling}if(!h)throw Error(i(189))}}if(n.alternate!==l)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function Rd(e){return e=Mm(e),e!==null?Od(e):null}function Od(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Od(e);if(t!==null)return t;e=e.sibling}return null}var Dd=o.unstable_scheduleCallback,Td=o.unstable_cancelCallback,Rm=o.unstable_shouldYield,Om=o.unstable_requestPaint,Qe=o.unstable_now,Dm=o.unstable_getCurrentPriorityLevel,Ai=o.unstable_ImmediatePriority,Ad=o.unstable_UserBlockingPriority,Jo=o.unstable_NormalPriority,Tm=o.unstable_LowPriority,zd=o.unstable_IdlePriority,Xo=null,Zt=null;function Am(e){if(Zt&&typeof Zt.onCommitFiberRoot=="function")try{Zt.onCommitFiberRoot(Xo,e,void 0,(e.current.flags&128)===128)}catch{}}var $t=Math.clz32?Math.clz32:Im,zm=Math.log,Lm=Math.LN2;function Im(e){return e>>>=0,e===0?32:31-(zm(e)/Lm|0)|0}var el=64,tl=4194304;function Gs(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 rl(e,t){var n=e.pendingLanes;if(n===0)return 0;var l=0,a=e.suspendedLanes,d=e.pingedLanes,h=n&268435455;if(h!==0){var y=h&~a;y!==0?l=Gs(y):(d&=h,d!==0&&(l=Gs(d)))}else h=n&~a,h!==0?l=Gs(h):d!==0&&(l=Gs(d));if(l===0)return 0;if(t!==0&&t!==l&&(t&a)===0&&(a=l&-l,d=t&-t,a>=d||a===16&&(d&4194240)!==0))return t;if((l&4)!==0&&(l|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=l;0<t;)n=31-$t(t),a=1<<n,l|=e[n],t&=~a;return l}function Fm(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 Um(e,t){for(var n=e.suspendedLanes,l=e.pingedLanes,a=e.expirationTimes,d=e.pendingLanes;0<d;){var h=31-$t(d),y=1<<h,k=a[h];k===-1?((y&n)===0||(y&l)!==0)&&(a[h]=Fm(y,t)):k<=t&&(e.expiredLanes|=y),d&=~y}}function zi(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Ld(){var e=el;return el<<=1,(el&4194240)===0&&(el=64),e}function Li(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ks(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-$t(t),e[t]=n}function $m(e,t){var n=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<n;){var a=31-$t(n),d=1<<a;t[a]=0,l[a]=-1,e[a]=-1,n&=~d}}function Ii(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var l=31-$t(n),a=1<<l;a&t|e[l]&t&&(e[l]|=t),n&=~a}}var ze=0;function Id(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var Fd,Fi,Ud,$d,Bd,Ui=!1,nl=[],Nr=null,Sr=null,Cr=null,Qs=new Map,qs=new Map,Er=[],Bm="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 Vd(e,t){switch(e){case"focusin":case"focusout":Nr=null;break;case"dragenter":case"dragleave":Sr=null;break;case"mouseover":case"mouseout":Cr=null;break;case"pointerover":case"pointerout":Qs.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":qs.delete(t.pointerId)}}function Zs(e,t,n,l,a,d){return e===null||e.nativeEvent!==d?(e={blockedOn:t,domEventName:n,eventSystemFlags:l,nativeEvent:d,targetContainers:[a]},t!==null&&(t=uo(t),t!==null&&Fi(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,a!==null&&t.indexOf(a)===-1&&t.push(a),e)}function Vm(e,t,n,l,a){switch(t){case"focusin":return Nr=Zs(Nr,e,t,n,l,a),!0;case"dragenter":return Sr=Zs(Sr,e,t,n,l,a),!0;case"mouseover":return Cr=Zs(Cr,e,t,n,l,a),!0;case"pointerover":var d=a.pointerId;return Qs.set(d,Zs(Qs.get(d)||null,e,t,n,l,a)),!0;case"gotpointercapture":return d=a.pointerId,qs.set(d,Zs(qs.get(d)||null,e,t,n,l,a)),!0}return!1}function Hd(e){var t=un(e.target);if(t!==null){var n=dn(t);if(n!==null){if(t=n.tag,t===13){if(t=Pd(n),t!==null){e.blockedOn=t,Bd(e.priority,function(){Ud(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function sl(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Bi(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var l=new n.constructor(n.type,n);Pi=l,n.target.dispatchEvent(l),Pi=null}else return t=uo(n),t!==null&&Fi(t),e.blockedOn=n,!1;t.shift()}return!0}function Wd(e,t,n){sl(e)&&n.delete(t)}function Hm(){Ui=!1,Nr!==null&&sl(Nr)&&(Nr=null),Sr!==null&&sl(Sr)&&(Sr=null),Cr!==null&&sl(Cr)&&(Cr=null),Qs.forEach(Wd),qs.forEach(Wd)}function Ys(e,t){e.blockedOn===t&&(e.blockedOn=null,Ui||(Ui=!0,o.unstable_scheduleCallback(o.unstable_NormalPriority,Hm)))}function Js(e){function t(a){return Ys(a,e)}if(0<nl.length){Ys(nl[0],e);for(var n=1;n<nl.length;n++){var l=nl[n];l.blockedOn===e&&(l.blockedOn=null)}}for(Nr!==null&&Ys(Nr,e),Sr!==null&&Ys(Sr,e),Cr!==null&&Ys(Cr,e),Qs.forEach(t),qs.forEach(t),n=0;n<Er.length;n++)l=Er[n],l.blockedOn===e&&(l.blockedOn=null);for(;0<Er.length&&(n=Er[0],n.blockedOn===null);)Hd(n),n.blockedOn===null&&Er.shift()}var Hn=L.ReactCurrentBatchConfig,ol=!0;function Wm(e,t,n,l){var a=ze,d=Hn.transition;Hn.transition=null;try{ze=1,$i(e,t,n,l)}finally{ze=a,Hn.transition=d}}function Gm(e,t,n,l){var a=ze,d=Hn.transition;Hn.transition=null;try{ze=4,$i(e,t,n,l)}finally{ze=a,Hn.transition=d}}function $i(e,t,n,l){if(ol){var a=Bi(e,t,n,l);if(a===null)oa(e,t,l,ll,n),Vd(e,l);else if(Vm(a,e,t,n,l))l.stopPropagation();else if(Vd(e,l),t&4&&-1<Bm.indexOf(e)){for(;a!==null;){var d=uo(a);if(d!==null&&Fd(d),d=Bi(e,t,n,l),d===null&&oa(e,t,l,ll,n),d===a)break;a=d}a!==null&&l.stopPropagation()}else oa(e,t,l,null,n)}}var ll=null;function Bi(e,t,n,l){if(ll=null,e=Mi(l),e=un(e),e!==null)if(t=dn(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Pd(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return ll=e,null}function Gd(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(Dm()){case Ai:return 1;case Ad:return 4;case Jo:case Tm:return 16;case zd:return 536870912;default:return 16}default:return 16}}var _r=null,Vi=null,il=null;function Kd(){if(il)return il;var e,t=Vi,n=t.length,l,a="value"in _r?_r.value:_r.textContent,d=a.length;for(e=0;e<n&&t[e]===a[e];e++);var h=n-e;for(l=1;l<=h&&t[n-l]===a[d-l];l++);return il=a.slice(e,1<l?1-l:void 0)}function al(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 cl(){return!0}function Qd(){return!1}function Ct(e){function t(n,l,a,d,h){this._reactName=n,this._targetInst=a,this.type=l,this.nativeEvent=d,this.target=h,this.currentTarget=null;for(var y in e)e.hasOwnProperty(y)&&(n=e[y],this[y]=n?n(d):d[y]);return this.isDefaultPrevented=(d.defaultPrevented!=null?d.defaultPrevented:d.returnValue===!1)?cl:Qd,this.isPropagationStopped=Qd,this}return Q(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=cl)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=cl)},persist:function(){},isPersistent:cl}),t}var Wn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Hi=Ct(Wn),Xs=Q({},Wn,{view:0,detail:0}),Km=Ct(Xs),Wi,Gi,eo,dl=Q({},Xs,{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!==eo&&(eo&&e.type==="mousemove"?(Wi=e.screenX-eo.screenX,Gi=e.screenY-eo.screenY):Gi=Wi=0,eo=e),Wi)},movementY:function(e){return"movementY"in e?e.movementY:Gi}}),qd=Ct(dl),Qm=Q({},dl,{dataTransfer:0}),qm=Ct(Qm),Zm=Q({},Xs,{relatedTarget:0}),Ki=Ct(Zm),Ym=Q({},Wn,{animationName:0,elapsedTime:0,pseudoElement:0}),Jm=Ct(Ym),Xm=Q({},Wn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),ex=Ct(Xm),tx=Q({},Wn,{data:0}),Zd=Ct(tx),rx={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},nx={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"},sx={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ox(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=sx[e])?!!t[e]:!1}function Qi(){return ox}var lx=Q({},Xs,{key:function(e){if(e.key){var t=rx[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=al(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?nx[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"?al(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?al(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),ix=Ct(lx),ax=Q({},dl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Yd=Ct(ax),cx=Q({},Xs,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Qi}),dx=Ct(cx),ux=Q({},Wn,{propertyName:0,elapsedTime:0,pseudoElement:0}),fx=Ct(ux),px=Q({},dl,{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}),hx=Ct(px),mx=[9,13,27,32],qi=p&&"CompositionEvent"in window,to=null;p&&"documentMode"in document&&(to=document.documentMode);var xx=p&&"TextEvent"in window&&!to,Jd=p&&(!qi||to&&8<to&&11>=to),Xd=" ",eu=!1;function tu(e,t){switch(e){case"keyup":return mx.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ru(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Gn=!1;function gx(e,t){switch(e){case"compositionend":return ru(t);case"keypress":return t.which!==32?null:(eu=!0,Xd);case"textInput":return e=t.data,e===Xd&&eu?null:e;default:return null}}function vx(e,t){if(Gn)return e==="compositionend"||!qi&&tu(e,t)?(e=Kd(),il=Vi=_r=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 Jd&&t.locale!=="ko"?null:t.data;default:return null}}var yx={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 nu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!yx[e.type]:t==="textarea"}function su(e,t,n,l){Nd(l),t=ml(t,"onChange"),0<t.length&&(n=new Hi("onChange","change",null,n,l),e.push({event:n,listeners:t}))}var ro=null,no=null;function bx(e){ju(e,0)}function ul(e){var t=Yn(e);if(Is(t))return e}function wx(e,t){if(e==="change")return t}var ou=!1;if(p){var Zi;if(p){var Yi="oninput"in document;if(!Yi){var lu=document.createElement("div");lu.setAttribute("oninput","return;"),Yi=typeof lu.oninput=="function"}Zi=Yi}else Zi=!1;ou=Zi&&(!document.documentMode||9<document.documentMode)}function iu(){ro&&(ro.detachEvent("onpropertychange",au),no=ro=null)}function au(e){if(e.propertyName==="value"&&ul(no)){var t=[];su(t,no,e,Mi(e)),_d(bx,t)}}function jx(e,t,n){e==="focusin"?(iu(),ro=t,no=n,ro.attachEvent("onpropertychange",au)):e==="focusout"&&iu()}function kx(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ul(no)}function Nx(e,t){if(e==="click")return ul(t)}function Sx(e,t){if(e==="input"||e==="change")return ul(t)}function Cx(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Bt=typeof Object.is=="function"?Object.is:Cx;function so(e,t){if(Bt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),l=Object.keys(t);if(n.length!==l.length)return!1;for(l=0;l<n.length;l++){var a=n[l];if(!v.call(t,a)||!Bt(e[a],t[a]))return!1}return!0}function cu(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function du(e,t){var n=cu(e);e=0;for(var l;n;){if(n.nodeType===3){if(l=e+n.textContent.length,e<=t&&l>=t)return{node:n,offset:t-e};e=l}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=cu(n)}}function uu(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?uu(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function fu(){for(var e=window,t=an();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=an(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 Ex(e){var t=fu(),n=e.focusedElem,l=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&uu(n.ownerDocument.documentElement,n)){if(l!==null&&Ji(n)){if(t=l.start,e=l.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var a=n.textContent.length,d=Math.min(l.start,a);l=l.end===void 0?d:Math.min(l.end,a),!e.extend&&d>l&&(a=l,l=d,d=a),a=du(n,d);var h=du(n,l);a&&h&&(e.rangeCount!==1||e.anchorNode!==a.node||e.anchorOffset!==a.offset||e.focusNode!==h.node||e.focusOffset!==h.offset)&&(t=t.createRange(),t.setStart(a.node,a.offset),e.removeAllRanges(),d>l?(e.addRange(t),e.extend(h.node,h.offset)):(t.setEnd(h.node,h.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var _x=p&&"documentMode"in document&&11>=document.documentMode,Kn=null,Xi=null,oo=null,ea=!1;function pu(e,t,n){var l=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ea||Kn==null||Kn!==an(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}),oo&&so(oo,l)||(oo=l,l=ml(Xi,"onSelect"),0<l.length&&(t=new Hi("onSelect","select",null,t,n),e.push({event:t,listeners:l}),t.target=Kn)))}function fl(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Qn={animationend:fl("Animation","AnimationEnd"),animationiteration:fl("Animation","AnimationIteration"),animationstart:fl("Animation","AnimationStart"),transitionend:fl("Transition","TransitionEnd")},ta={},hu={};p&&(hu=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 pl(e){if(ta[e])return ta[e];if(!Qn[e])return e;var t=Qn[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in hu)return ta[e]=t[n];return e}var mu=pl("animationend"),xu=pl("animationiteration"),gu=pl("animationstart"),vu=pl("transitionend"),yu=new Map,bu="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 Pr(e,t){yu.set(e,t),f(t,[e])}for(var ra=0;ra<bu.length;ra++){var na=bu[ra],Px=na.toLowerCase(),Mx=na[0].toUpperCase()+na.slice(1);Pr(Px,"on"+Mx)}Pr(mu,"onAnimationEnd"),Pr(xu,"onAnimationIteration"),Pr(gu,"onAnimationStart"),Pr("dblclick","onDoubleClick"),Pr("focusin","onFocus"),Pr("focusout","onBlur"),Pr(vu,"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 lo="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(" "),Rx=new Set("cancel close invalid load scroll toggle".split(" ").concat(lo));function wu(e,t,n){var l=e.type||"unknown-event";e.currentTarget=n,Pm(l,t,void 0,e),e.currentTarget=null}function ju(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var l=e[n],a=l.event;l=l.listeners;e:{var d=void 0;if(t)for(var h=l.length-1;0<=h;h--){var y=l[h],k=y.instance,F=y.currentTarget;if(y=y.listener,k!==d&&a.isPropagationStopped())break e;wu(a,y,F),d=k}else for(h=0;h<l.length;h++){if(y=l[h],k=y.instance,F=y.currentTarget,y=y.listener,k!==d&&a.isPropagationStopped())break e;wu(a,y,F),d=k}}}if(Yo)throw e=Ti,Yo=!1,Ti=null,e}function Fe(e,t){var n=t[ua];n===void 0&&(n=t[ua]=new Set);var l=e+"__bubble";n.has(l)||(ku(t,e,2,!1),n.add(l))}function sa(e,t,n){var l=0;t&&(l|=4),ku(n,e,l,t)}var hl="_reactListening"+Math.random().toString(36).slice(2);function io(e){if(!e[hl]){e[hl]=!0,c.forEach(function(n){n!=="selectionchange"&&(Rx.has(n)||sa(n,!1,e),sa(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[hl]||(t[hl]=!0,sa("selectionchange",!1,t))}}function ku(e,t,n,l){switch(Gd(t)){case 1:var a=Wm;break;case 4:a=Gm;break;default:a=$i}n=a.bind(null,t,n,e),a=void 0,!Di||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(a=!0),l?a!==void 0?e.addEventListener(t,n,{capture:!0,passive:a}):e.addEventListener(t,n,!0):a!==void 0?e.addEventListener(t,n,{passive:a}):e.addEventListener(t,n,!1)}function oa(e,t,n,l,a){var d=l;if((t&1)===0&&(t&2)===0&&l!==null)e:for(;;){if(l===null)return;var h=l.tag;if(h===3||h===4){var y=l.stateNode.containerInfo;if(y===a||y.nodeType===8&&y.parentNode===a)break;if(h===4)for(h=l.return;h!==null;){var k=h.tag;if((k===3||k===4)&&(k=h.stateNode.containerInfo,k===a||k.nodeType===8&&k.parentNode===a))return;h=h.return}for(;y!==null;){if(h=un(y),h===null)return;if(k=h.tag,k===5||k===6){l=d=h;continue e}y=y.parentNode}}l=l.return}_d(function(){var F=d,W=Mi(n),G=[];e:{var H=yu.get(e);if(H!==void 0){var te=Hi,ae=e;switch(e){case"keypress":if(al(n)===0)break e;case"keydown":case"keyup":te=ix;break;case"focusin":ae="focus",te=Ki;break;case"focusout":ae="blur",te=Ki;break;case"beforeblur":case"afterblur":te=Ki;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":te=qd;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":te=qm;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":te=dx;break;case mu:case xu:case gu:te=Jm;break;case vu:te=fx;break;case"scroll":te=Km;break;case"wheel":te=hx;break;case"copy":case"cut":case"paste":te=ex;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":te=Yd}var ce=(t&4)!==0,qe=!ce&&e==="scroll",D=ce?H!==null?H+"Capture":null:H;ce=[];for(var _=F,z;_!==null;){z=_;var q=z.stateNode;if(z.tag===5&&q!==null&&(z=q,D!==null&&(q=Vs(_,D),q!=null&&ce.push(ao(_,q,z)))),qe)break;_=_.return}0<ce.length&&(H=new te(H,ae,null,n,W),G.push({event:H,listeners:ce}))}}if((t&7)===0){e:{if(H=e==="mouseover"||e==="pointerover",te=e==="mouseout"||e==="pointerout",H&&n!==Pi&&(ae=n.relatedTarget||n.fromElement)&&(un(ae)||ae[ir]))break e;if((te||H)&&(H=W.window===W?W:(H=W.ownerDocument)?H.defaultView||H.parentWindow:window,te?(ae=n.relatedTarget||n.toElement,te=F,ae=ae?un(ae):null,ae!==null&&(qe=dn(ae),ae!==qe||ae.tag!==5&&ae.tag!==6)&&(ae=null)):(te=null,ae=F),te!==ae)){if(ce=qd,q="onMouseLeave",D="onMouseEnter",_="mouse",(e==="pointerout"||e==="pointerover")&&(ce=Yd,q="onPointerLeave",D="onPointerEnter",_="pointer"),qe=te==null?H:Yn(te),z=ae==null?H:Yn(ae),H=new ce(q,_+"leave",te,n,W),H.target=qe,H.relatedTarget=z,q=null,un(W)===F&&(ce=new ce(D,_+"enter",ae,n,W),ce.target=z,ce.relatedTarget=qe,q=ce),qe=q,te&&ae)t:{for(ce=te,D=ae,_=0,z=ce;z;z=qn(z))_++;for(z=0,q=D;q;q=qn(q))z++;for(;0<_-z;)ce=qn(ce),_--;for(;0<z-_;)D=qn(D),z--;for(;_--;){if(ce===D||D!==null&&ce===D.alternate)break t;ce=qn(ce),D=qn(D)}ce=null}else ce=null;te!==null&&Nu(G,H,te,ce,!1),ae!==null&&qe!==null&&Nu(G,qe,ae,ce,!0)}}e:{if(H=F?Yn(F):window,te=H.nodeName&&H.nodeName.toLowerCase(),te==="select"||te==="input"&&H.type==="file")var de=wx;else if(nu(H))if(ou)de=Sx;else{de=kx;var xe=jx}else(te=H.nodeName)&&te.toLowerCase()==="input"&&(H.type==="checkbox"||H.type==="radio")&&(de=Nx);if(de&&(de=de(e,F))){su(G,de,n,W);break e}xe&&xe(e,H,F),e==="focusout"&&(xe=H._wrapperState)&&xe.controlled&&H.type==="number"&&$n(H,"number",H.value)}switch(xe=F?Yn(F):window,e){case"focusin":(nu(xe)||xe.contentEditable==="true")&&(Kn=xe,Xi=F,oo=null);break;case"focusout":oo=Xi=Kn=null;break;case"mousedown":ea=!0;break;case"contextmenu":case"mouseup":case"dragend":ea=!1,pu(G,n,W);break;case"selectionchange":if(_x)break;case"keydown":case"keyup":pu(G,n,W)}var ge;if(qi)e:{switch(e){case"compositionstart":var we="onCompositionStart";break e;case"compositionend":we="onCompositionEnd";break e;case"compositionupdate":we="onCompositionUpdate";break e}we=void 0}else Gn?tu(e,n)&&(we="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(we="onCompositionStart");we&&(Jd&&n.locale!=="ko"&&(Gn||we!=="onCompositionStart"?we==="onCompositionEnd"&&Gn&&(ge=Kd()):(_r=W,Vi="value"in _r?_r.value:_r.textContent,Gn=!0)),xe=ml(F,we),0<xe.length&&(we=new Zd(we,e,null,n,W),G.push({event:we,listeners:xe}),ge?we.data=ge:(ge=ru(n),ge!==null&&(we.data=ge)))),(ge=xx?gx(e,n):vx(e,n))&&(F=ml(F,"onBeforeInput"),0<F.length&&(W=new Zd("onBeforeInput","beforeinput",null,n,W),G.push({event:W,listeners:F}),W.data=ge))}ju(G,t)})}function ao(e,t,n){return{instance:e,listener:t,currentTarget:n}}function ml(e,t){for(var n=t+"Capture",l=[];e!==null;){var a=e,d=a.stateNode;a.tag===5&&d!==null&&(a=d,d=Vs(e,n),d!=null&&l.unshift(ao(e,d,a)),d=Vs(e,t),d!=null&&l.push(ao(e,d,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 Nu(e,t,n,l,a){for(var d=t._reactName,h=[];n!==null&&n!==l;){var y=n,k=y.alternate,F=y.stateNode;if(k!==null&&k===l)break;y.tag===5&&F!==null&&(y=F,a?(k=Vs(n,d),k!=null&&h.unshift(ao(n,k,y))):a||(k=Vs(n,d),k!=null&&h.push(ao(n,k,y)))),n=n.return}h.length!==0&&e.push({event:t,listeners:h})}var Ox=/\r\n?/g,Dx=/\u0000|\uFFFD/g;function Su(e){return(typeof e=="string"?e:""+e).replace(Ox,`
`).replace(Dx,"")}function xl(e,t,n){if(t=Su(t),Su(e)!==t&&n)throw Error(i(425))}function gl(){}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 ca=typeof setTimeout=="function"?setTimeout:void 0,Tx=typeof clearTimeout=="function"?clearTimeout:void 0,Cu=typeof Promise=="function"?Promise:void 0,Ax=typeof queueMicrotask=="function"?queueMicrotask:typeof Cu<"u"?function(e){return Cu.resolve(null).then(e).catch(zx)}:ca;function zx(e){setTimeout(function(){throw e})}function da(e,t){var n=t,l=0;do{var a=n.nextSibling;if(e.removeChild(n),a&&a.nodeType===8)if(n=a.data,n==="/$"){if(l===0){e.removeChild(a),Js(t);return}l--}else n!=="$"&&n!=="$?"&&n!=="$!"||l++;n=a}while(n);Js(t)}function Mr(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 Eu(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Zn=Math.random().toString(36).slice(2),Yt="__reactFiber$"+Zn,co="__reactProps$"+Zn,ir="__reactContainer$"+Zn,ua="__reactEvents$"+Zn,Lx="__reactListeners$"+Zn,Ix="__reactHandles$"+Zn;function un(e){var t=e[Yt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ir]||n[Yt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Eu(e);e!==null;){if(n=e[Yt])return n;e=Eu(e)}return t}e=n,n=e.parentNode}return null}function uo(e){return e=e[Yt]||e[ir],!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 vl(e){return e[co]||null}var fa=[],Jn=-1;function Rr(e){return{current:e}}function Ue(e){0>Jn||(e.current=fa[Jn],fa[Jn]=null,Jn--)}function Ie(e,t){Jn++,fa[Jn]=e.current,e.current=t}var Or={},at=Rr(Or),gt=Rr(!1),fn=Or;function Xn(e,t){var n=e.type.contextTypes;if(!n)return Or;var l=e.stateNode;if(l&&l.__reactInternalMemoizedUnmaskedChildContext===t)return l.__reactInternalMemoizedMaskedChildContext;var a={},d;for(d in n)a[d]=t[d];return l&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=a),a}function vt(e){return e=e.childContextTypes,e!=null}function yl(){Ue(gt),Ue(at)}function _u(e,t,n){if(at.current!==Or)throw Error(i(168));Ie(at,t),Ie(gt,n)}function Pu(e,t,n){var l=e.stateNode;if(t=t.childContextTypes,typeof l.getChildContext!="function")return n;l=l.getChildContext();for(var a in l)if(!(a in t))throw Error(i(108,pe(e)||"Unknown",a));return Q({},n,l)}function bl(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Or,fn=at.current,Ie(at,e),Ie(gt,gt.current),!0}function Mu(e,t,n){var l=e.stateNode;if(!l)throw Error(i(169));n?(e=Pu(e,t,fn),l.__reactInternalMemoizedMergedChildContext=e,Ue(gt),Ue(at),Ie(at,e)):Ue(gt),Ie(gt,n)}var ar=null,wl=!1,pa=!1;function Ru(e){ar===null?ar=[e]:ar.push(e)}function Fx(e){wl=!0,Ru(e)}function Dr(){if(!pa&&ar!==null){pa=!0;var e=0,t=ze;try{var n=ar;for(ze=1;e<n.length;e++){var l=n[e];do l=l(!0);while(l!==null)}ar=null,wl=!1}catch(a){throw ar!==null&&(ar=ar.slice(e+1)),Dd(Ai,Dr),a}finally{ze=t,pa=!1}}return null}var es=[],ts=0,jl=null,kl=0,Tt=[],At=0,pn=null,cr=1,dr="";function hn(e,t){es[ts++]=kl,es[ts++]=jl,jl=e,kl=t}function Ou(e,t,n){Tt[At++]=cr,Tt[At++]=dr,Tt[At++]=pn,pn=e;var l=cr;e=dr;var a=32-$t(l)-1;l&=~(1<<a),n+=1;var d=32-$t(t)+a;if(30<d){var h=a-a%5;d=(l&(1<<h)-1).toString(32),l>>=h,a-=h,cr=1<<32-$t(t)+a|n<<a|l,dr=d+e}else cr=1<<d|n<<a|l,dr=e}function ha(e){e.return!==null&&(hn(e,1),Ou(e,1,0))}function ma(e){for(;e===jl;)jl=es[--ts],es[ts]=null,kl=es[--ts],es[ts]=null;for(;e===pn;)pn=Tt[--At],Tt[At]=null,dr=Tt[--At],Tt[At]=null,cr=Tt[--At],Tt[At]=null}var Et=null,_t=null,Be=!1,Vt=null;function Du(e,t){var n=Ft(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function Tu(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Et=e,_t=Mr(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Et=e,_t=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=pn!==null?{id:cr,overflow:dr}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Ft(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Et=e,_t=null,!0):!1;default:return!1}}function xa(e){return(e.mode&1)!==0&&(e.flags&128)===0}function ga(e){if(Be){var t=_t;if(t){var n=t;if(!Tu(e,t)){if(xa(e))throw Error(i(418));t=Mr(n.nextSibling);var l=Et;t&&Tu(e,t)?Du(l,n):(e.flags=e.flags&-4097|2,Be=!1,Et=e)}}else{if(xa(e))throw Error(i(418));e.flags=e.flags&-4097|2,Be=!1,Et=e}}}function Au(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Et=e}function Nl(e){if(e!==Et)return!1;if(!Be)return Au(e),Be=!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=_t)){if(xa(e))throw zu(),Error(i(418));for(;t;)Du(e,t),t=Mr(t.nextSibling)}if(Au(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 n=e.data;if(n==="/$"){if(t===0){_t=Mr(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}_t=null}}else _t=Et?Mr(e.stateNode.nextSibling):null;return!0}function zu(){for(var e=_t;e;)e=Mr(e.nextSibling)}function rs(){_t=Et=null,Be=!1}function va(e){Vt===null?Vt=[e]:Vt.push(e)}var Ux=L.ReactCurrentBatchConfig;function fo(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(i(309));var l=n.stateNode}if(!l)throw Error(i(147,e));var a=l,d=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===d?t.ref:(t=function(h){var y=a.refs;h===null?delete y[d]:y[d]=h},t._stringRef=d,t)}if(typeof e!="string")throw Error(i(284));if(!n._owner)throw Error(i(290,e))}return e}function Sl(e,t){throw e=Object.prototype.toString.call(t),Error(i(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Lu(e){var t=e._init;return t(e._payload)}function Iu(e){function t(D,_){if(e){var z=D.deletions;z===null?(D.deletions=[_],D.flags|=16):z.push(_)}}function n(D,_){if(!e)return null;for(;_!==null;)t(D,_),_=_.sibling;return null}function l(D,_){for(D=new Map;_!==null;)_.key!==null?D.set(_.key,_):D.set(_.index,_),_=_.sibling;return D}function a(D,_){return D=$r(D,_),D.index=0,D.sibling=null,D}function d(D,_,z){return D.index=z,e?(z=D.alternate,z!==null?(z=z.index,z<_?(D.flags|=2,_):z):(D.flags|=2,_)):(D.flags|=1048576,_)}function h(D){return e&&D.alternate===null&&(D.flags|=2),D}function y(D,_,z,q){return _===null||_.tag!==6?(_=cc(z,D.mode,q),_.return=D,_):(_=a(_,z),_.return=D,_)}function k(D,_,z,q){var de=z.type;return de===V?W(D,_,z.props.children,q,z.key):_!==null&&(_.elementType===de||typeof de=="object"&&de!==null&&de.$$typeof===Oe&&Lu(de)===_.type)?(q=a(_,z.props),q.ref=fo(D,_,z),q.return=D,q):(q=ql(z.type,z.key,z.props,null,D.mode,q),q.ref=fo(D,_,z),q.return=D,q)}function F(D,_,z,q){return _===null||_.tag!==4||_.stateNode.containerInfo!==z.containerInfo||_.stateNode.implementation!==z.implementation?(_=dc(z,D.mode,q),_.return=D,_):(_=a(_,z.children||[]),_.return=D,_)}function W(D,_,z,q,de){return _===null||_.tag!==7?(_=jn(z,D.mode,q,de),_.return=D,_):(_=a(_,z),_.return=D,_)}function G(D,_,z){if(typeof _=="string"&&_!==""||typeof _=="number")return _=cc(""+_,D.mode,z),_.return=D,_;if(typeof _=="object"&&_!==null){switch(_.$$typeof){case T:return z=ql(_.type,_.key,_.props,null,D.mode,z),z.ref=fo(D,null,_),z.return=D,z;case $:return _=dc(_,D.mode,z),_.return=D,_;case Oe:var q=_._init;return G(D,q(_._payload),z)}if(jr(_)||se(_))return _=jn(_,D.mode,z,null),_.return=D,_;Sl(D,_)}return null}function H(D,_,z,q){var de=_!==null?_.key:null;if(typeof z=="string"&&z!==""||typeof z=="number")return de!==null?null:y(D,_,""+z,q);if(typeof z=="object"&&z!==null){switch(z.$$typeof){case T:return z.key===de?k(D,_,z,q):null;case $:return z.key===de?F(D,_,z,q):null;case Oe:return de=z._init,H(D,_,de(z._payload),q)}if(jr(z)||se(z))return de!==null?null:W(D,_,z,q,null);Sl(D,z)}return null}function te(D,_,z,q,de){if(typeof q=="string"&&q!==""||typeof q=="number")return D=D.get(z)||null,y(_,D,""+q,de);if(typeof q=="object"&&q!==null){switch(q.$$typeof){case T:return D=D.get(q.key===null?z:q.key)||null,k(_,D,q,de);case $:return D=D.get(q.key===null?z:q.key)||null,F(_,D,q,de);case Oe:var xe=q._init;return te(D,_,z,xe(q._payload),de)}if(jr(q)||se(q))return D=D.get(z)||null,W(_,D,q,de,null);Sl(_,q)}return null}function ae(D,_,z,q){for(var de=null,xe=null,ge=_,we=_=0,rt=null;ge!==null&&we<z.length;we++){ge.index>we?(rt=ge,ge=null):rt=ge.sibling;var De=H(D,ge,z[we],q);if(De===null){ge===null&&(ge=rt);break}e&&ge&&De.alternate===null&&t(D,ge),_=d(De,_,we),xe===null?de=De:xe.sibling=De,xe=De,ge=rt}if(we===z.length)return n(D,ge),Be&&hn(D,we),de;if(ge===null){for(;we<z.length;we++)ge=G(D,z[we],q),ge!==null&&(_=d(ge,_,we),xe===null?de=ge:xe.sibling=ge,xe=ge);return Be&&hn(D,we),de}for(ge=l(D,ge);we<z.length;we++)rt=te(ge,D,we,z[we],q),rt!==null&&(e&&rt.alternate!==null&&ge.delete(rt.key===null?we:rt.key),_=d(rt,_,we),xe===null?de=rt:xe.sibling=rt,xe=rt);return e&&ge.forEach(function(Br){return t(D,Br)}),Be&&hn(D,we),de}function ce(D,_,z,q){var de=se(z);if(typeof de!="function")throw Error(i(150));if(z=de.call(z),z==null)throw Error(i(151));for(var xe=de=null,ge=_,we=_=0,rt=null,De=z.next();ge!==null&&!De.done;we++,De=z.next()){ge.index>we?(rt=ge,ge=null):rt=ge.sibling;var Br=H(D,ge,De.value,q);if(Br===null){ge===null&&(ge=rt);break}e&&ge&&Br.alternate===null&&t(D,ge),_=d(Br,_,we),xe===null?de=Br:xe.sibling=Br,xe=Br,ge=rt}if(De.done)return n(D,ge),Be&&hn(D,we),de;if(ge===null){for(;!De.done;we++,De=z.next())De=G(D,De.value,q),De!==null&&(_=d(De,_,we),xe===null?de=De:xe.sibling=De,xe=De);return Be&&hn(D,we),de}for(ge=l(D,ge);!De.done;we++,De=z.next())De=te(ge,D,we,De.value,q),De!==null&&(e&&De.alternate!==null&&ge.delete(De.key===null?we:De.key),_=d(De,_,we),xe===null?de=De:xe.sibling=De,xe=De);return e&&ge.forEach(function(yg){return t(D,yg)}),Be&&hn(D,we),de}function qe(D,_,z,q){if(typeof z=="object"&&z!==null&&z.type===V&&z.key===null&&(z=z.props.children),typeof z=="object"&&z!==null){switch(z.$$typeof){case T:e:{for(var de=z.key,xe=_;xe!==null;){if(xe.key===de){if(de=z.type,de===V){if(xe.tag===7){n(D,xe.sibling),_=a(xe,z.props.children),_.return=D,D=_;break e}}else if(xe.elementType===de||typeof de=="object"&&de!==null&&de.$$typeof===Oe&&Lu(de)===xe.type){n(D,xe.sibling),_=a(xe,z.props),_.ref=fo(D,xe,z),_.return=D,D=_;break e}n(D,xe);break}else t(D,xe);xe=xe.sibling}z.type===V?(_=jn(z.props.children,D.mode,q,z.key),_.return=D,D=_):(q=ql(z.type,z.key,z.props,null,D.mode,q),q.ref=fo(D,_,z),q.return=D,D=q)}return h(D);case $:e:{for(xe=z.key;_!==null;){if(_.key===xe)if(_.tag===4&&_.stateNode.containerInfo===z.containerInfo&&_.stateNode.implementation===z.implementation){n(D,_.sibling),_=a(_,z.children||[]),_.return=D,D=_;break e}else{n(D,_);break}else t(D,_);_=_.sibling}_=dc(z,D.mode,q),_.return=D,D=_}return h(D);case Oe:return xe=z._init,qe(D,_,xe(z._payload),q)}if(jr(z))return ae(D,_,z,q);if(se(z))return ce(D,_,z,q);Sl(D,z)}return typeof z=="string"&&z!==""||typeof z=="number"?(z=""+z,_!==null&&_.tag===6?(n(D,_.sibling),_=a(_,z),_.return=D,D=_):(n(D,_),_=cc(z,D.mode,q),_.return=D,D=_),h(D)):n(D,_)}return qe}var ns=Iu(!0),Fu=Iu(!1),Cl=Rr(null),El=null,ss=null,ya=null;function ba(){ya=ss=El=null}function wa(e){var t=Cl.current;Ue(Cl),e._currentValue=t}function ja(e,t,n){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===n)break;e=e.return}}function os(e,t){El=e,ya=ss=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(yt=!0),e.firstContext=null)}function zt(e){var t=e._currentValue;if(ya!==e)if(e={context:e,memoizedValue:t,next:null},ss===null){if(El===null)throw Error(i(308));ss=e,El.dependencies={lanes:0,firstContext:e}}else ss=ss.next=e;return t}var mn=null;function ka(e){mn===null?mn=[e]:mn.push(e)}function Uu(e,t,n,l){var a=t.interleaved;return a===null?(n.next=n,ka(t)):(n.next=a.next,a.next=n),t.interleaved=n,ur(e,l)}function ur(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Tr=!1;function Na(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function $u(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 fr(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Ar(e,t,n){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(Me&2)!==0){var a=l.pending;return a===null?t.next=t:(t.next=a.next,a.next=t),l.pending=t,ur(e,n)}return a=l.interleaved,a===null?(t.next=t,ka(l)):(t.next=a.next,a.next=t),l.interleaved=t,ur(e,n)}function _l(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var l=t.lanes;l&=e.pendingLanes,n|=l,t.lanes=n,Ii(e,n)}}function Bu(e,t){var n=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,n===l)){var a=null,d=null;if(n=n.firstBaseUpdate,n!==null){do{var h={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};d===null?a=d=h:d=d.next=h,n=n.next}while(n!==null);d===null?a=d=t:d=d.next=t}else a=d=t;n={baseState:l.baseState,firstBaseUpdate:a,lastBaseUpdate:d,shared:l.shared,effects:l.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Pl(e,t,n,l){var a=e.updateQueue;Tr=!1;var d=a.firstBaseUpdate,h=a.lastBaseUpdate,y=a.shared.pending;if(y!==null){a.shared.pending=null;var k=y,F=k.next;k.next=null,h===null?d=F:h.next=F,h=k;var W=e.alternate;W!==null&&(W=W.updateQueue,y=W.lastBaseUpdate,y!==h&&(y===null?W.firstBaseUpdate=F:y.next=F,W.lastBaseUpdate=k))}if(d!==null){var G=a.baseState;h=0,W=F=k=null,y=d;do{var H=y.lane,te=y.eventTime;if((l&H)===H){W!==null&&(W=W.next={eventTime:te,lane:0,tag:y.tag,payload:y.payload,callback:y.callback,next:null});e:{var ae=e,ce=y;switch(H=t,te=n,ce.tag){case 1:if(ae=ce.payload,typeof ae=="function"){G=ae.call(te,G,H);break e}G=ae;break e;case 3:ae.flags=ae.flags&-65537|128;case 0:if(ae=ce.payload,H=typeof ae=="function"?ae.call(te,G,H):ae,H==null)break e;G=Q({},G,H);break e;case 2:Tr=!0}}y.callback!==null&&y.lane!==0&&(e.flags|=64,H=a.effects,H===null?a.effects=[y]:H.push(y))}else te={eventTime:te,lane:H,tag:y.tag,payload:y.payload,callback:y.callback,next:null},W===null?(F=W=te,k=G):W=W.next=te,h|=H;if(y=y.next,y===null){if(y=a.shared.pending,y===null)break;H=y,y=H.next,H.next=null,a.lastBaseUpdate=H,a.shared.pending=null}}while(!0);if(W===null&&(k=G),a.baseState=k,a.firstBaseUpdate=F,a.lastBaseUpdate=W,t=a.shared.interleaved,t!==null){a=t;do h|=a.lane,a=a.next;while(a!==t)}else d===null&&(a.shared.lanes=0);vn|=h,e.lanes=h,e.memoizedState=G}}function Vu(e,t,n){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=n,typeof a!="function")throw Error(i(191,a));a.call(l)}}}var po={},Jt=Rr(po),ho=Rr(po),mo=Rr(po);function xn(e){if(e===po)throw Error(i(174));return e}function Sa(e,t){switch(Ie(mo,t),Ie(ho,e),Ie(Jt,po),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:cn(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=cn(t,e)}Ue(Jt),Ie(Jt,t)}function ls(){Ue(Jt),Ue(ho),Ue(mo)}function Hu(e){xn(mo.current);var t=xn(Jt.current),n=cn(t,e.type);t!==n&&(Ie(ho,e),Ie(Jt,n))}function Ca(e){ho.current===e&&(Ue(Jt),Ue(ho))}var He=Rr(0);function Ml(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.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 _a(){for(var e=0;e<Ea.length;e++)Ea[e]._workInProgressVersionPrimary=null;Ea.length=0}var Rl=L.ReactCurrentDispatcher,Pa=L.ReactCurrentBatchConfig,gn=0,We=null,Je=null,et=null,Ol=!1,xo=!1,go=0,$x=0;function ct(){throw Error(i(321))}function Ma(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Bt(e[n],t[n]))return!1;return!0}function Ra(e,t,n,l,a,d){if(gn=d,We=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Rl.current=e===null||e.memoizedState===null?Wx:Gx,e=n(l,a),xo){d=0;do{if(xo=!1,go=0,25<=d)throw Error(i(301));d+=1,et=Je=null,t.updateQueue=null,Rl.current=Kx,e=n(l,a)}while(xo)}if(Rl.current=Al,t=Je!==null&&Je.next!==null,gn=0,et=Je=We=null,Ol=!1,t)throw Error(i(300));return e}function Oa(){var e=go!==0;return go=0,e}function Xt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return et===null?We.memoizedState=et=e:et=et.next=e,et}function Lt(){if(Je===null){var e=We.alternate;e=e!==null?e.memoizedState:null}else e=Je.next;var t=et===null?We.memoizedState:et.next;if(t!==null)et=t,Je=e;else{if(e===null)throw Error(i(310));Je=e,e={memoizedState:Je.memoizedState,baseState:Je.baseState,baseQueue:Je.baseQueue,queue:Je.queue,next:null},et===null?We.memoizedState=et=e:et=et.next=e}return et}function vo(e,t){return typeof t=="function"?t(e):t}function Da(e){var t=Lt(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var l=Je,a=l.baseQueue,d=n.pending;if(d!==null){if(a!==null){var h=a.next;a.next=d.next,d.next=h}l.baseQueue=a=d,n.pending=null}if(a!==null){d=a.next,l=l.baseState;var y=h=null,k=null,F=d;do{var W=F.lane;if((gn&W)===W)k!==null&&(k=k.next={lane:0,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null}),l=F.hasEagerState?F.eagerState:e(l,F.action);else{var G={lane:W,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null};k===null?(y=k=G,h=l):k=k.next=G,We.lanes|=W,vn|=W}F=F.next}while(F!==null&&F!==d);k===null?h=l:k.next=y,Bt(l,t.memoizedState)||(yt=!0),t.memoizedState=l,t.baseState=h,t.baseQueue=k,n.lastRenderedState=l}if(e=n.interleaved,e!==null){a=e;do d=a.lane,We.lanes|=d,vn|=d,a=a.next;while(a!==e)}else a===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Ta(e){var t=Lt(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var l=n.dispatch,a=n.pending,d=t.memoizedState;if(a!==null){n.pending=null;var h=a=a.next;do d=e(d,h.action),h=h.next;while(h!==a);Bt(d,t.memoizedState)||(yt=!0),t.memoizedState=d,t.baseQueue===null&&(t.baseState=d),n.lastRenderedState=d}return[d,l]}function Wu(){}function Gu(e,t){var n=We,l=Lt(),a=t(),d=!Bt(l.memoizedState,a);if(d&&(l.memoizedState=a,yt=!0),l=l.queue,Aa(qu.bind(null,n,l,e),[e]),l.getSnapshot!==t||d||et!==null&&et.memoizedState.tag&1){if(n.flags|=2048,yo(9,Qu.bind(null,n,l,a,t),void 0,null),tt===null)throw Error(i(349));(gn&30)!==0||Ku(n,t,a)}return a}function Ku(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=We.updateQueue,t===null?(t={lastEffect:null,stores:null},We.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Qu(e,t,n,l){t.value=n,t.getSnapshot=l,Zu(t)&&Yu(e)}function qu(e,t,n){return n(function(){Zu(t)&&Yu(e)})}function Zu(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Bt(e,n)}catch{return!0}}function Yu(e){var t=ur(e,1);t!==null&&Kt(t,e,1,-1)}function Ju(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:vo,lastRenderedState:e},t.queue=e,e=e.dispatch=Hx.bind(null,We,e),[t.memoizedState,e]}function yo(e,t,n,l){return e={tag:e,create:t,destroy:n,deps:l,next:null},t=We.updateQueue,t===null?(t={lastEffect:null,stores:null},We.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(l=n.next,n.next=e,e.next=l,t.lastEffect=e)),e}function Xu(){return Lt().memoizedState}function Dl(e,t,n,l){var a=Xt();We.flags|=e,a.memoizedState=yo(1|t,n,void 0,l===void 0?null:l)}function Tl(e,t,n,l){var a=Lt();l=l===void 0?null:l;var d=void 0;if(Je!==null){var h=Je.memoizedState;if(d=h.destroy,l!==null&&Ma(l,h.deps)){a.memoizedState=yo(t,n,d,l);return}}We.flags|=e,a.memoizedState=yo(1|t,n,d,l)}function ef(e,t){return Dl(8390656,8,e,t)}function Aa(e,t){return Tl(2048,8,e,t)}function tf(e,t){return Tl(4,2,e,t)}function rf(e,t){return Tl(4,4,e,t)}function nf(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 sf(e,t,n){return n=n!=null?n.concat([e]):null,Tl(4,4,nf.bind(null,t,e),n)}function za(){}function of(e,t){var n=Lt();t=t===void 0?null:t;var l=n.memoizedState;return l!==null&&t!==null&&Ma(t,l[1])?l[0]:(n.memoizedState=[e,t],e)}function lf(e,t){var n=Lt();t=t===void 0?null:t;var l=n.memoizedState;return l!==null&&t!==null&&Ma(t,l[1])?l[0]:(e=e(),n.memoizedState=[e,t],e)}function af(e,t,n){return(gn&21)===0?(e.baseState&&(e.baseState=!1,yt=!0),e.memoizedState=n):(Bt(n,t)||(n=Ld(),We.lanes|=n,vn|=n,e.baseState=!0),t)}function Bx(e,t){var n=ze;ze=n!==0&&4>n?n:4,e(!0);var l=Pa.transition;Pa.transition={};try{e(!1),t()}finally{ze=n,Pa.transition=l}}function cf(){return Lt().memoizedState}function Vx(e,t,n){var l=Fr(e);if(n={lane:l,action:n,hasEagerState:!1,eagerState:null,next:null},df(e))uf(t,n);else if(n=Uu(e,t,n,l),n!==null){var a=mt();Kt(n,e,l,a),ff(n,t,l)}}function Hx(e,t,n){var l=Fr(e),a={lane:l,action:n,hasEagerState:!1,eagerState:null,next:null};if(df(e))uf(t,a);else{var d=e.alternate;if(e.lanes===0&&(d===null||d.lanes===0)&&(d=t.lastRenderedReducer,d!==null))try{var h=t.lastRenderedState,y=d(h,n);if(a.hasEagerState=!0,a.eagerState=y,Bt(y,h)){var k=t.interleaved;k===null?(a.next=a,ka(t)):(a.next=k.next,k.next=a),t.interleaved=a;return}}catch{}finally{}n=Uu(e,t,a,l),n!==null&&(a=mt(),Kt(n,e,l,a),ff(n,t,l))}}function df(e){var t=e.alternate;return e===We||t!==null&&t===We}function uf(e,t){xo=Ol=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function ff(e,t,n){if((n&4194240)!==0){var l=t.lanes;l&=e.pendingLanes,n|=l,t.lanes=n,Ii(e,n)}}var Al={readContext:zt,useCallback:ct,useContext:ct,useEffect:ct,useImperativeHandle:ct,useInsertionEffect:ct,useLayoutEffect:ct,useMemo:ct,useReducer:ct,useRef:ct,useState:ct,useDebugValue:ct,useDeferredValue:ct,useTransition:ct,useMutableSource:ct,useSyncExternalStore:ct,useId:ct,unstable_isNewReconciler:!1},Wx={readContext:zt,useCallback:function(e,t){return Xt().memoizedState=[e,t===void 0?null:t],e},useContext:zt,useEffect:ef,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Dl(4194308,4,nf.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Dl(4194308,4,e,t)},useInsertionEffect:function(e,t){return Dl(4,2,e,t)},useMemo:function(e,t){var n=Xt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var l=Xt();return t=n!==void 0?n(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=Vx.bind(null,We,e),[l.memoizedState,e]},useRef:function(e){var t=Xt();return e={current:e},t.memoizedState=e},useState:Ju,useDebugValue:za,useDeferredValue:function(e){return Xt().memoizedState=e},useTransition:function(){var e=Ju(!1),t=e[0];return e=Bx.bind(null,e[1]),Xt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var l=We,a=Xt();if(Be){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),tt===null)throw Error(i(349));(gn&30)!==0||Ku(l,t,n)}a.memoizedState=n;var d={value:n,getSnapshot:t};return a.queue=d,ef(qu.bind(null,l,d,e),[e]),l.flags|=2048,yo(9,Qu.bind(null,l,d,n,t),void 0,null),n},useId:function(){var e=Xt(),t=tt.identifierPrefix;if(Be){var n=dr,l=cr;n=(l&~(1<<32-$t(l)-1)).toString(32)+n,t=":"+t+"R"+n,n=go++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=$x++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Gx={readContext:zt,useCallback:of,useContext:zt,useEffect:Aa,useImperativeHandle:sf,useInsertionEffect:tf,useLayoutEffect:rf,useMemo:lf,useReducer:Da,useRef:Xu,useState:function(){return Da(vo)},useDebugValue:za,useDeferredValue:function(e){var t=Lt();return af(t,Je.memoizedState,e)},useTransition:function(){var e=Da(vo)[0],t=Lt().memoizedState;return[e,t]},useMutableSource:Wu,useSyncExternalStore:Gu,useId:cf,unstable_isNewReconciler:!1},Kx={readContext:zt,useCallback:of,useContext:zt,useEffect:Aa,useImperativeHandle:sf,useInsertionEffect:tf,useLayoutEffect:rf,useMemo:lf,useReducer:Ta,useRef:Xu,useState:function(){return Ta(vo)},useDebugValue:za,useDeferredValue:function(e){var t=Lt();return Je===null?t.memoizedState=e:af(t,Je.memoizedState,e)},useTransition:function(){var e=Ta(vo)[0],t=Lt().memoizedState;return[e,t]},useMutableSource:Wu,useSyncExternalStore:Gu,useId:cf,unstable_isNewReconciler:!1};function Ht(e,t){if(e&&e.defaultProps){t=Q({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function La(e,t,n,l){t=e.memoizedState,n=n(l,t),n=n==null?t:Q({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var zl={isMounted:function(e){return(e=e._reactInternals)?dn(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var l=mt(),a=Fr(e),d=fr(l,a);d.payload=t,n!=null&&(d.callback=n),t=Ar(e,d,a),t!==null&&(Kt(t,e,a,l),_l(t,e,a))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var l=mt(),a=Fr(e),d=fr(l,a);d.tag=1,d.payload=t,n!=null&&(d.callback=n),t=Ar(e,d,a),t!==null&&(Kt(t,e,a,l),_l(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=mt(),l=Fr(e),a=fr(n,l);a.tag=2,t!=null&&(a.callback=t),t=Ar(e,a,l),t!==null&&(Kt(t,e,l,n),_l(t,e,l))}};function pf(e,t,n,l,a,d,h){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,d,h):t.prototype&&t.prototype.isPureReactComponent?!so(n,l)||!so(a,d):!0}function hf(e,t,n){var l=!1,a=Or,d=t.contextType;return typeof d=="object"&&d!==null?d=zt(d):(a=vt(t)?fn:at.current,l=t.contextTypes,d=(l=l!=null)?Xn(e,a):Or),t=new t(n,d),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=zl,e.stateNode=t,t._reactInternals=e,l&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=a,e.__reactInternalMemoizedMaskedChildContext=d),t}function mf(e,t,n,l){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,l),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,l),t.state!==e&&zl.enqueueReplaceState(t,t.state,null)}function Ia(e,t,n,l){var a=e.stateNode;a.props=n,a.state=e.memoizedState,a.refs={},Na(e);var d=t.contextType;typeof d=="object"&&d!==null?a.context=zt(d):(d=vt(t)?fn:at.current,a.context=Xn(e,d)),a.state=e.memoizedState,d=t.getDerivedStateFromProps,typeof d=="function"&&(La(e,t,d,n),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&&zl.enqueueReplaceState(a,a.state,null),Pl(e,n,a,l),a.state=e.memoizedState),typeof a.componentDidMount=="function"&&(e.flags|=4194308)}function is(e,t){try{var n="",l=t;do n+=Z(l),l=l.return;while(l);var a=n}catch(d){a=`
Error generating stack: `+d.message+`
`+d.stack}return{value:e,source:t,stack:a,digest:null}}function Fa(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Ua(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var Qx=typeof WeakMap=="function"?WeakMap:Map;function xf(e,t,n){n=fr(-1,n),n.tag=3,n.payload={element:null};var l=t.value;return n.callback=function(){Vl||(Vl=!0,tc=l),Ua(e,t)},n}function gf(e,t,n){n=fr(-1,n),n.tag=3;var l=e.type.getDerivedStateFromError;if(typeof l=="function"){var a=t.value;n.payload=function(){return l(a)},n.callback=function(){Ua(e,t)}}var d=e.stateNode;return d!==null&&typeof d.componentDidCatch=="function"&&(n.callback=function(){Ua(e,t),typeof l!="function"&&(Lr===null?Lr=new Set([this]):Lr.add(this));var h=t.stack;this.componentDidCatch(t.value,{componentStack:h!==null?h:""})}),n}function vf(e,t,n){var l=e.pingCache;if(l===null){l=e.pingCache=new Qx;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(n)||(a.add(n),e=ag.bind(null,e,t,n),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 bf(e,t,n,l,a){return(e.mode&1)===0?(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=fr(-1,1),t.tag=2,Ar(n,t,1))),n.lanes|=1),e):(e.flags|=65536,e.lanes=a,e)}var qx=L.ReactCurrentOwner,yt=!1;function ht(e,t,n,l){t.child=e===null?Fu(t,null,n,l):ns(t,e.child,n,l)}function wf(e,t,n,l,a){n=n.render;var d=t.ref;return os(t,a),l=Ra(e,t,n,l,d,a),n=Oa(),e!==null&&!yt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,pr(e,t,a)):(Be&&n&&ha(t),t.flags|=1,ht(e,t,l,a),t.child)}function jf(e,t,n,l,a){if(e===null){var d=n.type;return typeof d=="function"&&!ac(d)&&d.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=d,kf(e,t,d,l,a)):(e=ql(n.type,null,l,t,t.mode,a),e.ref=t.ref,e.return=t,t.child=e)}if(d=e.child,(e.lanes&a)===0){var h=d.memoizedProps;if(n=n.compare,n=n!==null?n:so,n(h,l)&&e.ref===t.ref)return pr(e,t,a)}return t.flags|=1,e=$r(d,l),e.ref=t.ref,e.return=t,t.child=e}function kf(e,t,n,l,a){if(e!==null){var d=e.memoizedProps;if(so(d,l)&&e.ref===t.ref)if(yt=!1,t.pendingProps=l=d,(e.lanes&a)!==0)(e.flags&131072)!==0&&(yt=!0);else return t.lanes=e.lanes,pr(e,t,a)}return $a(e,t,n,l,a)}function Nf(e,t,n){var l=t.pendingProps,a=l.children,d=e!==null?e.memoizedState:null;if(l.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ie(cs,Pt),Pt|=n;else{if((n&1073741824)===0)return e=d!==null?d.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Ie(cs,Pt),Pt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},l=d!==null?d.baseLanes:n,Ie(cs,Pt),Pt|=l}else d!==null?(l=d.baseLanes|n,t.memoizedState=null):l=n,Ie(cs,Pt),Pt|=l;return ht(e,t,a,n),t.child}function Sf(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function $a(e,t,n,l,a){var d=vt(n)?fn:at.current;return d=Xn(t,d),os(t,a),n=Ra(e,t,n,l,d,a),l=Oa(),e!==null&&!yt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,pr(e,t,a)):(Be&&l&&ha(t),t.flags|=1,ht(e,t,n,a),t.child)}function Cf(e,t,n,l,a){if(vt(n)){var d=!0;bl(t)}else d=!1;if(os(t,a),t.stateNode===null)Il(e,t),hf(t,n,l),Ia(t,n,l,a),l=!0;else if(e===null){var h=t.stateNode,y=t.memoizedProps;h.props=y;var k=h.context,F=n.contextType;typeof F=="object"&&F!==null?F=zt(F):(F=vt(n)?fn:at.current,F=Xn(t,F));var W=n.getDerivedStateFromProps,G=typeof W=="function"||typeof h.getSnapshotBeforeUpdate=="function";G||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(y!==l||k!==F)&&mf(t,h,l,F),Tr=!1;var H=t.memoizedState;h.state=H,Pl(t,l,h,a),k=t.memoizedState,y!==l||H!==k||gt.current||Tr?(typeof W=="function"&&(La(t,n,W,l),k=t.memoizedState),(y=Tr||pf(t,n,y,l,H,k,F))?(G||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount()),typeof h.componentDidMount=="function"&&(t.flags|=4194308)):(typeof h.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=k),h.props=l,h.state=k,h.context=F,l=y):(typeof h.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{h=t.stateNode,$u(e,t),y=t.memoizedProps,F=t.type===t.elementType?y:Ht(t.type,y),h.props=F,G=t.pendingProps,H=h.context,k=n.contextType,typeof k=="object"&&k!==null?k=zt(k):(k=vt(n)?fn:at.current,k=Xn(t,k));var te=n.getDerivedStateFromProps;(W=typeof te=="function"||typeof h.getSnapshotBeforeUpdate=="function")||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(y!==G||H!==k)&&mf(t,h,l,k),Tr=!1,H=t.memoizedState,h.state=H,Pl(t,l,h,a);var ae=t.memoizedState;y!==G||H!==ae||gt.current||Tr?(typeof te=="function"&&(La(t,n,te,l),ae=t.memoizedState),(F=Tr||pf(t,n,F,l,H,ae,k)||!1)?(W||typeof h.UNSAFE_componentWillUpdate!="function"&&typeof h.componentWillUpdate!="function"||(typeof h.componentWillUpdate=="function"&&h.componentWillUpdate(l,ae,k),typeof h.UNSAFE_componentWillUpdate=="function"&&h.UNSAFE_componentWillUpdate(l,ae,k)),typeof h.componentDidUpdate=="function"&&(t.flags|=4),typeof h.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof h.componentDidUpdate!="function"||y===e.memoizedProps&&H===e.memoizedState||(t.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||y===e.memoizedProps&&H===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=ae),h.props=l,h.state=ae,h.context=k,l=F):(typeof h.componentDidUpdate!="function"||y===e.memoizedProps&&H===e.memoizedState||(t.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||y===e.memoizedProps&&H===e.memoizedState||(t.flags|=1024),l=!1)}return Ba(e,t,n,l,d,a)}function Ba(e,t,n,l,a,d){Sf(e,t);var h=(t.flags&128)!==0;if(!l&&!h)return a&&Mu(t,n,!1),pr(e,t,d);l=t.stateNode,qx.current=t;var y=h&&typeof n.getDerivedStateFromError!="function"?null:l.render();return t.flags|=1,e!==null&&h?(t.child=ns(t,e.child,null,d),t.child=ns(t,null,y,d)):ht(e,t,y,d),t.memoizedState=l.state,a&&Mu(t,n,!0),t.child}function Ef(e){var t=e.stateNode;t.pendingContext?_u(e,t.pendingContext,t.pendingContext!==t.context):t.context&&_u(e,t.context,!1),Sa(e,t.containerInfo)}function _f(e,t,n,l,a){return rs(),va(a),t.flags|=256,ht(e,t,n,l),t.child}var Va={dehydrated:null,treeContext:null,retryLane:0};function Ha(e){return{baseLanes:e,cachePool:null,transitions:null}}function Pf(e,t,n){var l=t.pendingProps,a=He.current,d=!1,h=(t.flags&128)!==0,y;if((y=h)||(y=e!==null&&e.memoizedState===null?!1:(a&2)!==0),y?(d=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(a|=1),Ie(He,a&1),e===null)return ga(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):(h=l.children,e=l.fallback,d?(l=t.mode,d=t.child,h={mode:"hidden",children:h},(l&1)===0&&d!==null?(d.childLanes=0,d.pendingProps=h):d=Zl(h,l,0,null),e=jn(e,l,n,null),d.return=t,e.return=t,d.sibling=e,t.child=d,t.child.memoizedState=Ha(n),t.memoizedState=Va,e):Wa(t,h));if(a=e.memoizedState,a!==null&&(y=a.dehydrated,y!==null))return Zx(e,t,h,l,y,a,n);if(d){d=l.fallback,h=t.mode,a=e.child,y=a.sibling;var k={mode:"hidden",children:l.children};return(h&1)===0&&t.child!==a?(l=t.child,l.childLanes=0,l.pendingProps=k,t.deletions=null):(l=$r(a,k),l.subtreeFlags=a.subtreeFlags&14680064),y!==null?d=$r(y,d):(d=jn(d,h,n,null),d.flags|=2),d.return=t,l.return=t,l.sibling=d,t.child=l,l=d,d=t.child,h=e.child.memoizedState,h=h===null?Ha(n):{baseLanes:h.baseLanes|n,cachePool:null,transitions:h.transitions},d.memoizedState=h,d.childLanes=e.childLanes&~n,t.memoizedState=Va,l}return d=e.child,e=d.sibling,l=$r(d,{mode:"visible",children:l.children}),(t.mode&1)===0&&(l.lanes=n),l.return=t,l.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=l,t.memoizedState=null,l}function Wa(e,t){return t=Zl({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Ll(e,t,n,l){return l!==null&&va(l),ns(t,e.child,null,n),e=Wa(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Zx(e,t,n,l,a,d,h){if(n)return t.flags&256?(t.flags&=-257,l=Fa(Error(i(422))),Ll(e,t,h,l)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(d=l.fallback,a=t.mode,l=Zl({mode:"visible",children:l.children},a,0,null),d=jn(d,a,h,null),d.flags|=2,l.return=t,d.return=t,l.sibling=d,t.child=l,(t.mode&1)!==0&&ns(t,e.child,null,h),t.child.memoizedState=Ha(h),t.memoizedState=Va,d);if((t.mode&1)===0)return Ll(e,t,h,null);if(a.data==="$!"){if(l=a.nextSibling&&a.nextSibling.dataset,l)var y=l.dgst;return l=y,d=Error(i(419)),l=Fa(d,l,void 0),Ll(e,t,h,l)}if(y=(h&e.childLanes)!==0,yt||y){if(l=tt,l!==null){switch(h&-h){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|h))!==0?0:a,a!==0&&a!==d.retryLane&&(d.retryLane=a,ur(e,a),Kt(l,e,a,-1))}return ic(),l=Fa(Error(i(421))),Ll(e,t,h,l)}return a.data==="$?"?(t.flags|=128,t.child=e.child,t=cg.bind(null,e),a._reactRetry=t,null):(e=d.treeContext,_t=Mr(a.nextSibling),Et=t,Be=!0,Vt=null,e!==null&&(Tt[At++]=cr,Tt[At++]=dr,Tt[At++]=pn,cr=e.id,dr=e.overflow,pn=t),t=Wa(t,l.children),t.flags|=4096,t)}function Mf(e,t,n){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),ja(e.return,t,n)}function Ga(e,t,n,l,a){var d=e.memoizedState;d===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:n,tailMode:a}:(d.isBackwards=t,d.rendering=null,d.renderingStartTime=0,d.last=l,d.tail=n,d.tailMode=a)}function Rf(e,t,n){var l=t.pendingProps,a=l.revealOrder,d=l.tail;if(ht(e,t,l.children,n),l=He.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&&Mf(e,n,t);else if(e.tag===19)Mf(e,n,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(Ie(He,l),(t.mode&1)===0)t.memoizedState=null;else switch(a){case"forwards":for(n=t.child,a=null;n!==null;)e=n.alternate,e!==null&&Ml(e)===null&&(a=n),n=n.sibling;n=a,n===null?(a=t.child,t.child=null):(a=n.sibling,n.sibling=null),Ga(t,!1,a,n,d);break;case"backwards":for(n=null,a=t.child,t.child=null;a!==null;){if(e=a.alternate,e!==null&&Ml(e)===null){t.child=a;break}e=a.sibling,a.sibling=n,n=a,a=e}Ga(t,!0,n,null,d);break;case"together":Ga(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Il(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function pr(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),vn|=t.lanes,(n&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=$r(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=$r(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Yx(e,t,n){switch(t.tag){case 3:Ef(t),rs();break;case 5:Hu(t);break;case 1:vt(t.type)&&bl(t);break;case 4:Sa(t,t.stateNode.containerInfo);break;case 10:var l=t.type._context,a=t.memoizedProps.value;Ie(Cl,l._currentValue),l._currentValue=a;break;case 13:if(l=t.memoizedState,l!==null)return l.dehydrated!==null?(Ie(He,He.current&1),t.flags|=128,null):(n&t.child.childLanes)!==0?Pf(e,t,n):(Ie(He,He.current&1),e=pr(e,t,n),e!==null?e.sibling:null);Ie(He,He.current&1);break;case 19:if(l=(n&t.childLanes)!==0,(e.flags&128)!==0){if(l)return Rf(e,t,n);t.flags|=128}if(a=t.memoizedState,a!==null&&(a.rendering=null,a.tail=null,a.lastEffect=null),Ie(He,He.current),l)break;return null;case 22:case 23:return t.lanes=0,Nf(e,t,n)}return pr(e,t,n)}var Of,Ka,Df,Tf;Of=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},Ka=function(){},Df=function(e,t,n,l){var a=e.memoizedProps;if(a!==l){e=t.stateNode,xn(Jt.current);var d=null;switch(n){case"input":a=Fn(e,a),l=Fn(e,l),d=[];break;case"select":a=Q({},a,{value:void 0}),l=Q({},l,{value:void 0}),d=[];break;case"textarea":a=ie(e,a),l=ie(e,l),d=[];break;default:typeof a.onClick!="function"&&typeof l.onClick=="function"&&(e.onclick=gl)}Ei(n,l);var h;n=null;for(F in a)if(!l.hasOwnProperty(F)&&a.hasOwnProperty(F)&&a[F]!=null)if(F==="style"){var y=a[F];for(h in y)y.hasOwnProperty(h)&&(n||(n={}),n[h]="")}else F!=="dangerouslySetInnerHTML"&&F!=="children"&&F!=="suppressContentEditableWarning"&&F!=="suppressHydrationWarning"&&F!=="autoFocus"&&(u.hasOwnProperty(F)?d||(d=[]):(d=d||[]).push(F,null));for(F in l){var k=l[F];if(y=a!=null?a[F]:void 0,l.hasOwnProperty(F)&&k!==y&&(k!=null||y!=null))if(F==="style")if(y){for(h in y)!y.hasOwnProperty(h)||k&&k.hasOwnProperty(h)||(n||(n={}),n[h]="");for(h in k)k.hasOwnProperty(h)&&y[h]!==k[h]&&(n||(n={}),n[h]=k[h])}else n||(d||(d=[]),d.push(F,n)),n=k;else F==="dangerouslySetInnerHTML"?(k=k?k.__html:void 0,y=y?y.__html:void 0,k!=null&&y!==k&&(d=d||[]).push(F,k)):F==="children"?typeof k!="string"&&typeof k!="number"||(d=d||[]).push(F,""+k):F!=="suppressContentEditableWarning"&&F!=="suppressHydrationWarning"&&(u.hasOwnProperty(F)?(k!=null&&F==="onScroll"&&Fe("scroll",e),d||y===k||(d=[])):(d=d||[]).push(F,k))}n&&(d=d||[]).push("style",n);var F=d;(t.updateQueue=F)&&(t.flags|=4)}},Tf=function(e,t,n,l){n!==l&&(t.flags|=4)};function bo(e,t){if(!Be)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var l=null;n!==null;)n.alternate!==null&&(l=n),n=n.sibling;l===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function dt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,l=0;if(t)for(var a=e.child;a!==null;)n|=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;)n|=a.lanes|a.childLanes,l|=a.subtreeFlags,l|=a.flags,a.return=e,a=a.sibling;return e.subtreeFlags|=l,e.childLanes=n,t}function Jx(e,t,n){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 dt(t),null;case 1:return vt(t.type)&&yl(),dt(t),null;case 3:return l=t.stateNode,ls(),Ue(gt),Ue(at),_a(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(Nl(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Vt!==null&&(sc(Vt),Vt=null))),Ka(e,t),dt(t),null;case 5:Ca(t);var a=xn(mo.current);if(n=t.type,e!==null&&t.stateNode!=null)Df(e,t,n,l,a),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!l){if(t.stateNode===null)throw Error(i(166));return dt(t),null}if(e=xn(Jt.current),Nl(t)){l=t.stateNode,n=t.type;var d=t.memoizedProps;switch(l[Yt]=t,l[co]=d,e=(t.mode&1)!==0,n){case"dialog":Fe("cancel",l),Fe("close",l);break;case"iframe":case"object":case"embed":Fe("load",l);break;case"video":case"audio":for(a=0;a<lo.length;a++)Fe(lo[a],l);break;case"source":Fe("error",l);break;case"img":case"image":case"link":Fe("error",l),Fe("load",l);break;case"details":Fe("toggle",l);break;case"input":wr(l,d),Fe("invalid",l);break;case"select":l._wrapperState={wasMultiple:!!d.multiple},Fe("invalid",l);break;case"textarea":ke(l,d),Fe("invalid",l)}Ei(n,d),a=null;for(var h in d)if(d.hasOwnProperty(h)){var y=d[h];h==="children"?typeof y=="string"?l.textContent!==y&&(d.suppressHydrationWarning!==!0&&xl(l.textContent,y,e),a=["children",y]):typeof y=="number"&&l.textContent!==""+y&&(d.suppressHydrationWarning!==!0&&xl(l.textContent,y,e),a=["children",""+y]):u.hasOwnProperty(h)&&y!=null&&h==="onScroll"&&Fe("scroll",l)}switch(n){case"input":pt(l),Us(l,d,!0);break;case"textarea":pt(l),Ve(l);break;case"select":case"option":break;default:typeof d.onClick=="function"&&(l.onclick=gl)}l=a,t.updateQueue=l,l!==null&&(t.flags|=4)}else{h=a.nodeType===9?a:a.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=lr(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=h.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof l.is=="string"?e=h.createElement(n,{is:l.is}):(e=h.createElement(n),n==="select"&&(h=e,l.multiple?h.multiple=!0:l.size&&(h.size=l.size))):e=h.createElementNS(e,n),e[Yt]=t,e[co]=l,Of(e,t,!1,!1),t.stateNode=e;e:{switch(h=_i(n,l),n){case"dialog":Fe("cancel",e),Fe("close",e),a=l;break;case"iframe":case"object":case"embed":Fe("load",e),a=l;break;case"video":case"audio":for(a=0;a<lo.length;a++)Fe(lo[a],e);a=l;break;case"source":Fe("error",e),a=l;break;case"img":case"image":case"link":Fe("error",e),Fe("load",e),a=l;break;case"details":Fe("toggle",e),a=l;break;case"input":wr(e,l),a=Fn(e,l),Fe("invalid",e);break;case"option":a=l;break;case"select":e._wrapperState={wasMultiple:!!l.multiple},a=Q({},l,{value:void 0}),Fe("invalid",e);break;case"textarea":ke(e,l),a=ie(e,l),Fe("invalid",e);break;default:a=l}Ei(n,a),y=a;for(d in y)if(y.hasOwnProperty(d)){var k=y[d];d==="style"?jd(e,k):d==="dangerouslySetInnerHTML"?(k=k?k.__html:void 0,k!=null&&qo(e,k)):d==="children"?typeof k=="string"?(n!=="textarea"||k!=="")&&$s(e,k):typeof k=="number"&&$s(e,""+k):d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&d!=="autoFocus"&&(u.hasOwnProperty(d)?k!=null&&d==="onScroll"&&Fe("scroll",e):k!=null&&B(e,d,k,h))}switch(n){case"input":pt(e),Us(e,l,!1);break;case"textarea":pt(e),Ve(e);break;case"option":l.value!=null&&e.setAttribute("value",""+be(l.value));break;case"select":e.multiple=!!l.multiple,d=l.value,d!=null?A(e,!!l.multiple,d,!1):l.defaultValue!=null&&A(e,!!l.multiple,l.defaultValue,!0);break;default:typeof a.onClick=="function"&&(e.onclick=gl)}switch(n){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 dt(t),null;case 6:if(e&&t.stateNode!=null)Tf(e,t,e.memoizedProps,l);else{if(typeof l!="string"&&t.stateNode===null)throw Error(i(166));if(n=xn(mo.current),xn(Jt.current),Nl(t)){if(l=t.stateNode,n=t.memoizedProps,l[Yt]=t,(d=l.nodeValue!==n)&&(e=Et,e!==null))switch(e.tag){case 3:xl(l.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&xl(l.nodeValue,n,(e.mode&1)!==0)}d&&(t.flags|=4)}else l=(n.nodeType===9?n:n.ownerDocument).createTextNode(l),l[Yt]=t,t.stateNode=l}return dt(t),null;case 13:if(Ue(He),l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Be&&_t!==null&&(t.mode&1)!==0&&(t.flags&128)===0)zu(),rs(),t.flags|=98560,d=!1;else if(d=Nl(t),l!==null&&l.dehydrated!==null){if(e===null){if(!d)throw Error(i(318));if(d=t.memoizedState,d=d!==null?d.dehydrated:null,!d)throw Error(i(317));d[Yt]=t}else rs(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;dt(t),d=!1}else Vt!==null&&(sc(Vt),Vt=null),d=!0;if(!d)return t.flags&65536?t:null}return(t.flags&128)!==0?(t.lanes=n,t):(l=l!==null,l!==(e!==null&&e.memoizedState!==null)&&l&&(t.child.flags|=8192,(t.mode&1)!==0&&(e===null||(He.current&1)!==0?Xe===0&&(Xe=3):ic())),t.updateQueue!==null&&(t.flags|=4),dt(t),null);case 4:return ls(),Ka(e,t),e===null&&io(t.stateNode.containerInfo),dt(t),null;case 10:return wa(t.type._context),dt(t),null;case 17:return vt(t.type)&&yl(),dt(t),null;case 19:if(Ue(He),d=t.memoizedState,d===null)return dt(t),null;if(l=(t.flags&128)!==0,h=d.rendering,h===null)if(l)bo(d,!1);else{if(Xe!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(h=Ml(e),h!==null){for(t.flags|=128,bo(d,!1),l=h.updateQueue,l!==null&&(t.updateQueue=l,t.flags|=4),t.subtreeFlags=0,l=n,n=t.child;n!==null;)d=n,e=l,d.flags&=14680066,h=d.alternate,h===null?(d.childLanes=0,d.lanes=e,d.child=null,d.subtreeFlags=0,d.memoizedProps=null,d.memoizedState=null,d.updateQueue=null,d.dependencies=null,d.stateNode=null):(d.childLanes=h.childLanes,d.lanes=h.lanes,d.child=h.child,d.subtreeFlags=0,d.deletions=null,d.memoizedProps=h.memoizedProps,d.memoizedState=h.memoizedState,d.updateQueue=h.updateQueue,d.type=h.type,e=h.dependencies,d.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Ie(He,He.current&1|2),t.child}e=e.sibling}d.tail!==null&&Qe()>ds&&(t.flags|=128,l=!0,bo(d,!1),t.lanes=4194304)}else{if(!l)if(e=Ml(h),e!==null){if(t.flags|=128,l=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),bo(d,!0),d.tail===null&&d.tailMode==="hidden"&&!h.alternate&&!Be)return dt(t),null}else 2*Qe()-d.renderingStartTime>ds&&n!==1073741824&&(t.flags|=128,l=!0,bo(d,!1),t.lanes=4194304);d.isBackwards?(h.sibling=t.child,t.child=h):(n=d.last,n!==null?n.sibling=h:t.child=h,d.last=h)}return d.tail!==null?(t=d.tail,d.rendering=t,d.tail=t.sibling,d.renderingStartTime=Qe(),t.sibling=null,n=He.current,Ie(He,l?n&1|2:n&1),t):(dt(t),null);case 22:case 23:return lc(),l=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==l&&(t.flags|=8192),l&&(t.mode&1)!==0?(Pt&1073741824)!==0&&(dt(t),t.subtreeFlags&6&&(t.flags|=8192)):dt(t),null;case 24:return null;case 25:return null}throw Error(i(156,t.tag))}function Xx(e,t){switch(ma(t),t.tag){case 1:return vt(t.type)&&yl(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ls(),Ue(gt),Ue(at),_a(),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(Ue(He),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 Ue(He),null;case 4:return ls(),null;case 10:return wa(t.type._context),null;case 22:case 23:return lc(),null;case 24:return null;default:return null}}var Fl=!1,ut=!1,eg=typeof WeakSet=="function"?WeakSet:Set,oe=null;function as(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(l){Ge(e,t,l)}else n.current=null}function Qa(e,t,n){try{n()}catch(l){Ge(e,t,l)}}var Af=!1;function tg(e,t){if(la=ol,e=fu(),Ji(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var l=n.getSelection&&n.getSelection();if(l&&l.rangeCount!==0){n=l.anchorNode;var a=l.anchorOffset,d=l.focusNode;l=l.focusOffset;try{n.nodeType,d.nodeType}catch{n=null;break e}var h=0,y=-1,k=-1,F=0,W=0,G=e,H=null;t:for(;;){for(var te;G!==n||a!==0&&G.nodeType!==3||(y=h+a),G!==d||l!==0&&G.nodeType!==3||(k=h+l),G.nodeType===3&&(h+=G.nodeValue.length),(te=G.firstChild)!==null;)H=G,G=te;for(;;){if(G===e)break t;if(H===n&&++F===a&&(y=h),H===d&&++W===l&&(k=h),(te=G.nextSibling)!==null)break;G=H,H=G.parentNode}G=te}n=y===-1||k===-1?null:{start:y,end:k}}else n=null}n=n||{start:0,end:0}}else n=null;for(ia={focusedElem:e,selectionRange:n},ol=!1,oe=t;oe!==null;)if(t=oe,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,oe=e;else for(;oe!==null;){t=oe;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 ce=ae.memoizedProps,qe=ae.memoizedState,D=t.stateNode,_=D.getSnapshotBeforeUpdate(t.elementType===t.type?ce:Ht(t.type,ce),qe);D.__reactInternalSnapshotBeforeUpdate=_}break;case 3:var z=t.stateNode.containerInfo;z.nodeType===1?z.textContent="":z.nodeType===9&&z.documentElement&&z.removeChild(z.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,oe=e;break}oe=t.return}return ae=Af,Af=!1,ae}function wo(e,t,n){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 d=a.destroy;a.destroy=void 0,d!==void 0&&Qa(t,n,d)}a=a.next}while(a!==l)}}function Ul(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var l=n.create;n.destroy=l()}n=n.next}while(n!==t)}}function qa(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function zf(e){var t=e.alternate;t!==null&&(e.alternate=null,zf(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Yt],delete t[co],delete t[ua],delete t[Lx],delete t[Ix])),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 Lf(e){return e.tag===5||e.tag===3||e.tag===4}function If(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Lf(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,n){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=gl));else if(l!==4&&(e=e.child,e!==null))for(Za(e,t,n),e=e.sibling;e!==null;)Za(e,t,n),e=e.sibling}function Ya(e,t,n){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(l!==4&&(e=e.child,e!==null))for(Ya(e,t,n),e=e.sibling;e!==null;)Ya(e,t,n),e=e.sibling}var st=null,Wt=!1;function zr(e,t,n){for(n=n.child;n!==null;)Ff(e,t,n),n=n.sibling}function Ff(e,t,n){if(Zt&&typeof Zt.onCommitFiberUnmount=="function")try{Zt.onCommitFiberUnmount(Xo,n)}catch{}switch(n.tag){case 5:ut||as(n,t);case 6:var l=st,a=Wt;st=null,zr(e,t,n),st=l,Wt=a,st!==null&&(Wt?(e=st,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):st.removeChild(n.stateNode));break;case 18:st!==null&&(Wt?(e=st,n=n.stateNode,e.nodeType===8?da(e.parentNode,n):e.nodeType===1&&da(e,n),Js(e)):da(st,n.stateNode));break;case 4:l=st,a=Wt,st=n.stateNode.containerInfo,Wt=!0,zr(e,t,n),st=l,Wt=a;break;case 0:case 11:case 14:case 15:if(!ut&&(l=n.updateQueue,l!==null&&(l=l.lastEffect,l!==null))){a=l=l.next;do{var d=a,h=d.destroy;d=d.tag,h!==void 0&&((d&2)!==0||(d&4)!==0)&&Qa(n,t,h),a=a.next}while(a!==l)}zr(e,t,n);break;case 1:if(!ut&&(as(n,t),l=n.stateNode,typeof l.componentWillUnmount=="function"))try{l.props=n.memoizedProps,l.state=n.memoizedState,l.componentWillUnmount()}catch(y){Ge(n,t,y)}zr(e,t,n);break;case 21:zr(e,t,n);break;case 22:n.mode&1?(ut=(l=ut)||n.memoizedState!==null,zr(e,t,n),ut=l):zr(e,t,n);break;default:zr(e,t,n)}}function Uf(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new eg),t.forEach(function(l){var a=dg.bind(null,e,l);n.has(l)||(n.add(l),l.then(a,a))})}}function Gt(e,t){var n=t.deletions;if(n!==null)for(var l=0;l<n.length;l++){var a=n[l];try{var d=e,h=t,y=h;e:for(;y!==null;){switch(y.tag){case 5:st=y.stateNode,Wt=!1;break e;case 3:st=y.stateNode.containerInfo,Wt=!0;break e;case 4:st=y.stateNode.containerInfo,Wt=!0;break e}y=y.return}if(st===null)throw Error(i(160));Ff(d,h,a),st=null,Wt=!1;var k=a.alternate;k!==null&&(k.return=null),a.return=null}catch(F){Ge(a,t,F)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)$f(t,e),t=t.sibling}function $f(e,t){var n=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{wo(3,e,e.return),Ul(3,e)}catch(ce){Ge(e,e.return,ce)}try{wo(5,e,e.return)}catch(ce){Ge(e,e.return,ce)}}break;case 1:Gt(t,e),er(e),l&512&&n!==null&&as(n,n.return);break;case 5:if(Gt(t,e),er(e),l&512&&n!==null&&as(n,n.return),e.flags&32){var a=e.stateNode;try{$s(a,"")}catch(ce){Ge(e,e.return,ce)}}if(l&4&&(a=e.stateNode,a!=null)){var d=e.memoizedProps,h=n!==null?n.memoizedProps:d,y=e.type,k=e.updateQueue;if(e.updateQueue=null,k!==null)try{y==="input"&&d.type==="radio"&&d.name!=null&&Fs(a,d),_i(y,h);var F=_i(y,d);for(h=0;h<k.length;h+=2){var W=k[h],G=k[h+1];W==="style"?jd(a,G):W==="dangerouslySetInnerHTML"?qo(a,G):W==="children"?$s(a,G):B(a,W,G,F)}switch(y){case"input":Un(a,d);break;case"textarea":Ae(a,d);break;case"select":var H=a._wrapperState.wasMultiple;a._wrapperState.wasMultiple=!!d.multiple;var te=d.value;te!=null?A(a,!!d.multiple,te,!1):H!==!!d.multiple&&(d.defaultValue!=null?A(a,!!d.multiple,d.defaultValue,!0):A(a,!!d.multiple,d.multiple?[]:"",!1))}a[co]=d}catch(ce){Ge(e,e.return,ce)}}break;case 6:if(Gt(t,e),er(e),l&4){if(e.stateNode===null)throw Error(i(162));a=e.stateNode,d=e.memoizedProps;try{a.nodeValue=d}catch(ce){Ge(e,e.return,ce)}}break;case 3:if(Gt(t,e),er(e),l&4&&n!==null&&n.memoizedState.isDehydrated)try{Js(t.containerInfo)}catch(ce){Ge(e,e.return,ce)}break;case 4:Gt(t,e),er(e);break;case 13:Gt(t,e),er(e),a=e.child,a.flags&8192&&(d=a.memoizedState!==null,a.stateNode.isHidden=d,!d||a.alternate!==null&&a.alternate.memoizedState!==null||(ec=Qe())),l&4&&Uf(e);break;case 22:if(W=n!==null&&n.memoizedState!==null,e.mode&1?(ut=(F=ut)||W,Gt(t,e),ut=F):Gt(t,e),er(e),l&8192){if(F=e.memoizedState!==null,(e.stateNode.isHidden=F)&&!W&&(e.mode&1)!==0)for(oe=e,W=e.child;W!==null;){for(G=oe=W;oe!==null;){switch(H=oe,te=H.child,H.tag){case 0:case 11:case 14:case 15:wo(4,H,H.return);break;case 1:as(H,H.return);var ae=H.stateNode;if(typeof ae.componentWillUnmount=="function"){l=H,n=H.return;try{t=l,ae.props=t.memoizedProps,ae.state=t.memoizedState,ae.componentWillUnmount()}catch(ce){Ge(l,n,ce)}}break;case 5:as(H,H.return);break;case 22:if(H.memoizedState!==null){Hf(G);continue}}te!==null?(te.return=H,oe=te):Hf(G)}W=W.sibling}e:for(W=null,G=e;;){if(G.tag===5){if(W===null){W=G;try{a=G.stateNode,F?(d=a.style,typeof d.setProperty=="function"?d.setProperty("display","none","important"):d.display="none"):(y=G.stateNode,k=G.memoizedProps.style,h=k!=null&&k.hasOwnProperty("display")?k.display:null,y.style.display=wd("display",h))}catch(ce){Ge(e,e.return,ce)}}}else if(G.tag===6){if(W===null)try{G.stateNode.nodeValue=F?"":G.memoizedProps}catch(ce){Ge(e,e.return,ce)}}else if((G.tag!==22&&G.tag!==23||G.memoizedState===null||G===e)&&G.child!==null){G.child.return=G,G=G.child;continue}if(G===e)break e;for(;G.sibling===null;){if(G.return===null||G.return===e)break e;W===G&&(W=null),G=G.return}W===G&&(W=null),G.sibling.return=G.return,G=G.sibling}}break;case 19:Gt(t,e),er(e),l&4&&Uf(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 n=e.return;n!==null;){if(Lf(n)){var l=n;break e}n=n.return}throw Error(i(160))}switch(l.tag){case 5:var a=l.stateNode;l.flags&32&&($s(a,""),l.flags&=-33);var d=If(e);Ya(e,d,a);break;case 3:case 4:var h=l.stateNode.containerInfo,y=If(e);Za(e,y,h);break;default:throw Error(i(161))}}catch(k){Ge(e,e.return,k)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function rg(e,t,n){oe=e,Bf(e)}function Bf(e,t,n){for(var l=(e.mode&1)!==0;oe!==null;){var a=oe,d=a.child;if(a.tag===22&&l){var h=a.memoizedState!==null||Fl;if(!h){var y=a.alternate,k=y!==null&&y.memoizedState!==null||ut;y=Fl;var F=ut;if(Fl=h,(ut=k)&&!F)for(oe=a;oe!==null;)h=oe,k=h.child,h.tag===22&&h.memoizedState!==null?Wf(a):k!==null?(k.return=h,oe=k):Wf(a);for(;d!==null;)oe=d,Bf(d),d=d.sibling;oe=a,Fl=y,ut=F}Vf(e)}else(a.subtreeFlags&8772)!==0&&d!==null?(d.return=a,oe=d):Vf(e)}}function Vf(e){for(;oe!==null;){var t=oe;if((t.flags&8772)!==0){var n=t.alternate;try{if((t.flags&8772)!==0)switch(t.tag){case 0:case 11:case 15:ut||Ul(5,t);break;case 1:var l=t.stateNode;if(t.flags&4&&!ut)if(n===null)l.componentDidMount();else{var a=t.elementType===t.type?n.memoizedProps:Ht(t.type,n.memoizedProps);l.componentDidUpdate(a,n.memoizedState,l.__reactInternalSnapshotBeforeUpdate)}var d=t.updateQueue;d!==null&&Vu(t,d,l);break;case 3:var h=t.updateQueue;if(h!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}Vu(t,h,n)}break;case 5:var y=t.stateNode;if(n===null&&t.flags&4){n=y;var k=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":k.autoFocus&&n.focus();break;case"img":k.src&&(n.src=k.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var F=t.alternate;if(F!==null){var W=F.memoizedState;if(W!==null){var G=W.dehydrated;G!==null&&Js(G)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(i(163))}ut||t.flags&512&&qa(t)}catch(H){Ge(t,t.return,H)}}if(t===e){oe=null;break}if(n=t.sibling,n!==null){n.return=t.return,oe=n;break}oe=t.return}}function Hf(e){for(;oe!==null;){var t=oe;if(t===e){oe=null;break}var n=t.sibling;if(n!==null){n.return=t.return,oe=n;break}oe=t.return}}function Wf(e){for(;oe!==null;){var t=oe;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Ul(4,t)}catch(k){Ge(t,n,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 d=t.return;try{qa(t)}catch(k){Ge(t,d,k)}break;case 5:var h=t.return;try{qa(t)}catch(k){Ge(t,h,k)}}}catch(k){Ge(t,t.return,k)}if(t===e){oe=null;break}var y=t.sibling;if(y!==null){y.return=t.return,oe=y;break}oe=t.return}}var ng=Math.ceil,$l=L.ReactCurrentDispatcher,Ja=L.ReactCurrentOwner,It=L.ReactCurrentBatchConfig,Me=0,tt=null,Ye=null,ot=0,Pt=0,cs=Rr(0),Xe=0,jo=null,vn=0,Bl=0,Xa=0,ko=null,bt=null,ec=0,ds=1/0,hr=null,Vl=!1,tc=null,Lr=null,Hl=!1,Ir=null,Wl=0,No=0,rc=null,Gl=-1,Kl=0;function mt(){return(Me&6)!==0?Qe():Gl!==-1?Gl:Gl=Qe()}function Fr(e){return(e.mode&1)===0?1:(Me&2)!==0&&ot!==0?ot&-ot:Ux.transition!==null?(Kl===0&&(Kl=Ld()),Kl):(e=ze,e!==0||(e=window.event,e=e===void 0?16:Gd(e.type)),e)}function Kt(e,t,n,l){if(50<No)throw No=0,rc=null,Error(i(185));Ks(e,n,l),((Me&2)===0||e!==tt)&&(e===tt&&((Me&2)===0&&(Bl|=n),Xe===4&&Ur(e,ot)),wt(e,l),n===1&&Me===0&&(t.mode&1)===0&&(ds=Qe()+500,wl&&Dr()))}function wt(e,t){var n=e.callbackNode;Um(e,t);var l=rl(e,e===tt?ot:0);if(l===0)n!==null&&Td(n),e.callbackNode=null,e.callbackPriority=0;else if(t=l&-l,e.callbackPriority!==t){if(n!=null&&Td(n),t===1)e.tag===0?Fx(Kf.bind(null,e)):Ru(Kf.bind(null,e)),Ax(function(){(Me&6)===0&&Dr()}),n=null;else{switch(Id(l)){case 1:n=Ai;break;case 4:n=Ad;break;case 16:n=Jo;break;case 536870912:n=zd;break;default:n=Jo}n=tp(n,Gf.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Gf(e,t){if(Gl=-1,Kl=0,(Me&6)!==0)throw Error(i(327));var n=e.callbackNode;if(us()&&e.callbackNode!==n)return null;var l=rl(e,e===tt?ot:0);if(l===0)return null;if((l&30)!==0||(l&e.expiredLanes)!==0||t)t=Ql(e,l);else{t=l;var a=Me;Me|=2;var d=qf();(tt!==e||ot!==t)&&(hr=null,ds=Qe()+500,bn(e,t));do try{lg();break}catch(y){Qf(e,y)}while(!0);ba(),$l.current=d,Me=a,Ye!==null?t=0:(tt=null,ot=0,t=Xe)}if(t!==0){if(t===2&&(a=zi(e),a!==0&&(l=a,t=nc(e,a))),t===1)throw n=jo,bn(e,0),Ur(e,l),wt(e,Qe()),n;if(t===6)Ur(e,l);else{if(a=e.current.alternate,(l&30)===0&&!sg(a)&&(t=Ql(e,l),t===2&&(d=zi(e),d!==0&&(l=d,t=nc(e,d))),t===1))throw n=jo,bn(e,0),Ur(e,l),wt(e,Qe()),n;switch(e.finishedWork=a,e.finishedLanes=l,t){case 0:case 1:throw Error(i(345));case 2:wn(e,bt,hr);break;case 3:if(Ur(e,l),(l&130023424)===l&&(t=ec+500-Qe(),10<t)){if(rl(e,0)!==0)break;if(a=e.suspendedLanes,(a&l)!==l){mt(),e.pingedLanes|=e.suspendedLanes&a;break}e.timeoutHandle=ca(wn.bind(null,e,bt,hr),t);break}wn(e,bt,hr);break;case 4:if(Ur(e,l),(l&4194240)===l)break;for(t=e.eventTimes,a=-1;0<l;){var h=31-$t(l);d=1<<h,h=t[h],h>a&&(a=h),l&=~d}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*ng(l/1960))-l,10<l){e.timeoutHandle=ca(wn.bind(null,e,bt,hr),l);break}wn(e,bt,hr);break;case 5:wn(e,bt,hr);break;default:throw Error(i(329))}}}return wt(e,Qe()),e.callbackNode===n?Gf.bind(null,e):null}function nc(e,t){var n=ko;return e.current.memoizedState.isDehydrated&&(bn(e,t).flags|=256),e=Ql(e,t),e!==2&&(t=bt,bt=n,t!==null&&sc(t)),e}function sc(e){bt===null?bt=e:bt.push.apply(bt,e)}function sg(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var l=0;l<n.length;l++){var a=n[l],d=a.getSnapshot;a=a.value;try{if(!Bt(d(),a))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;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 Ur(e,t){for(t&=~Xa,t&=~Bl,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-$t(t),l=1<<n;e[n]=-1,t&=~l}}function Kf(e){if((Me&6)!==0)throw Error(i(327));us();var t=rl(e,0);if((t&1)===0)return wt(e,Qe()),null;var n=Ql(e,t);if(e.tag!==0&&n===2){var l=zi(e);l!==0&&(t=l,n=nc(e,l))}if(n===1)throw n=jo,bn(e,0),Ur(e,t),wt(e,Qe()),n;if(n===6)throw Error(i(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,wn(e,bt,hr),wt(e,Qe()),null}function oc(e,t){var n=Me;Me|=1;try{return e(t)}finally{Me=n,Me===0&&(ds=Qe()+500,wl&&Dr())}}function yn(e){Ir!==null&&Ir.tag===0&&(Me&6)===0&&us();var t=Me;Me|=1;var n=It.transition,l=ze;try{if(It.transition=null,ze=1,e)return e()}finally{ze=l,It.transition=n,Me=t,(Me&6)===0&&Dr()}}function lc(){Pt=cs.current,Ue(cs)}function bn(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,Tx(n)),Ye!==null)for(n=Ye.return;n!==null;){var l=n;switch(ma(l),l.tag){case 1:l=l.type.childContextTypes,l!=null&&yl();break;case 3:ls(),Ue(gt),Ue(at),_a();break;case 5:Ca(l);break;case 4:ls();break;case 13:Ue(He);break;case 19:Ue(He);break;case 10:wa(l.type._context);break;case 22:case 23:lc()}n=n.return}if(tt=e,Ye=e=$r(e.current,null),ot=Pt=t,Xe=0,jo=null,Xa=Bl=vn=0,bt=ko=null,mn!==null){for(t=0;t<mn.length;t++)if(n=mn[t],l=n.interleaved,l!==null){n.interleaved=null;var a=l.next,d=n.pending;if(d!==null){var h=d.next;d.next=a,l.next=h}n.pending=l}mn=null}return e}function Qf(e,t){do{var n=Ye;try{if(ba(),Rl.current=Al,Ol){for(var l=We.memoizedState;l!==null;){var a=l.queue;a!==null&&(a.pending=null),l=l.next}Ol=!1}if(gn=0,et=Je=We=null,xo=!1,go=0,Ja.current=null,n===null||n.return===null){Xe=1,jo=t,Ye=null;break}e:{var d=e,h=n.return,y=n,k=t;if(t=ot,y.flags|=32768,k!==null&&typeof k=="object"&&typeof k.then=="function"){var F=k,W=y,G=W.tag;if((W.mode&1)===0&&(G===0||G===11||G===15)){var H=W.alternate;H?(W.updateQueue=H.updateQueue,W.memoizedState=H.memoizedState,W.lanes=H.lanes):(W.updateQueue=null,W.memoizedState=null)}var te=yf(h);if(te!==null){te.flags&=-257,bf(te,h,y,d,t),te.mode&1&&vf(d,F,t),t=te,k=F;var ae=t.updateQueue;if(ae===null){var ce=new Set;ce.add(k),t.updateQueue=ce}else ae.add(k);break e}else{if((t&1)===0){vf(d,F,t),ic();break e}k=Error(i(426))}}else if(Be&&y.mode&1){var qe=yf(h);if(qe!==null){(qe.flags&65536)===0&&(qe.flags|=256),bf(qe,h,y,d,t),va(is(k,y));break e}}d=k=is(k,y),Xe!==4&&(Xe=2),ko===null?ko=[d]:ko.push(d),d=h;do{switch(d.tag){case 3:d.flags|=65536,t&=-t,d.lanes|=t;var D=xf(d,k,t);Bu(d,D);break e;case 1:y=k;var _=d.type,z=d.stateNode;if((d.flags&128)===0&&(typeof _.getDerivedStateFromError=="function"||z!==null&&typeof z.componentDidCatch=="function"&&(Lr===null||!Lr.has(z)))){d.flags|=65536,t&=-t,d.lanes|=t;var q=gf(d,y,t);Bu(d,q);break e}}d=d.return}while(d!==null)}Yf(n)}catch(de){t=de,Ye===n&&n!==null&&(Ye=n=n.return);continue}break}while(!0)}function qf(){var e=$l.current;return $l.current=Al,e===null?Al:e}function ic(){(Xe===0||Xe===3||Xe===2)&&(Xe=4),tt===null||(vn&268435455)===0&&(Bl&268435455)===0||Ur(tt,ot)}function Ql(e,t){var n=Me;Me|=2;var l=qf();(tt!==e||ot!==t)&&(hr=null,bn(e,t));do try{og();break}catch(a){Qf(e,a)}while(!0);if(ba(),Me=n,$l.current=l,Ye!==null)throw Error(i(261));return tt=null,ot=0,Xe}function og(){for(;Ye!==null;)Zf(Ye)}function lg(){for(;Ye!==null&&!Rm();)Zf(Ye)}function Zf(e){var t=ep(e.alternate,e,Pt);e.memoizedProps=e.pendingProps,t===null?Yf(e):Ye=t,Ja.current=null}function Yf(e){var t=e;do{var n=t.alternate;if(e=t.return,(t.flags&32768)===0){if(n=Jx(n,t,Pt),n!==null){Ye=n;return}}else{if(n=Xx(n,t),n!==null){n.flags&=32767,Ye=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Xe=6,Ye=null;return}}if(t=t.sibling,t!==null){Ye=t;return}Ye=t=e}while(t!==null);Xe===0&&(Xe=5)}function wn(e,t,n){var l=ze,a=It.transition;try{It.transition=null,ze=1,ig(e,t,n,l)}finally{It.transition=a,ze=l}return null}function ig(e,t,n,l){do us();while(Ir!==null);if((Me&6)!==0)throw Error(i(327));n=e.finishedWork;var a=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(i(177));e.callbackNode=null,e.callbackPriority=0;var d=n.lanes|n.childLanes;if($m(e,d),e===tt&&(Ye=tt=null,ot=0),(n.subtreeFlags&2064)===0&&(n.flags&2064)===0||Hl||(Hl=!0,tp(Jo,function(){return us(),null})),d=(n.flags&15990)!==0,(n.subtreeFlags&15990)!==0||d){d=It.transition,It.transition=null;var h=ze;ze=1;var y=Me;Me|=4,Ja.current=null,tg(e,n),$f(n,e),Ex(ia),ol=!!la,ia=la=null,e.current=n,rg(n),Om(),Me=y,ze=h,It.transition=d}else e.current=n;if(Hl&&(Hl=!1,Ir=e,Wl=a),d=e.pendingLanes,d===0&&(Lr=null),Am(n.stateNode),wt(e,Qe()),t!==null)for(l=e.onRecoverableError,n=0;n<t.length;n++)a=t[n],l(a.value,{componentStack:a.stack,digest:a.digest});if(Vl)throw Vl=!1,e=tc,tc=null,e;return(Wl&1)!==0&&e.tag!==0&&us(),d=e.pendingLanes,(d&1)!==0?e===rc?No++:(No=0,rc=e):No=0,Dr(),null}function us(){if(Ir!==null){var e=Id(Wl),t=It.transition,n=ze;try{if(It.transition=null,ze=16>e?16:e,Ir===null)var l=!1;else{if(e=Ir,Ir=null,Wl=0,(Me&6)!==0)throw Error(i(331));var a=Me;for(Me|=4,oe=e.current;oe!==null;){var d=oe,h=d.child;if((oe.flags&16)!==0){var y=d.deletions;if(y!==null){for(var k=0;k<y.length;k++){var F=y[k];for(oe=F;oe!==null;){var W=oe;switch(W.tag){case 0:case 11:case 15:wo(8,W,d)}var G=W.child;if(G!==null)G.return=W,oe=G;else for(;oe!==null;){W=oe;var H=W.sibling,te=W.return;if(zf(W),W===F){oe=null;break}if(H!==null){H.return=te,oe=H;break}oe=te}}}var ae=d.alternate;if(ae!==null){var ce=ae.child;if(ce!==null){ae.child=null;do{var qe=ce.sibling;ce.sibling=null,ce=qe}while(ce!==null)}}oe=d}}if((d.subtreeFlags&2064)!==0&&h!==null)h.return=d,oe=h;else e:for(;oe!==null;){if(d=oe,(d.flags&2048)!==0)switch(d.tag){case 0:case 11:case 15:wo(9,d,d.return)}var D=d.sibling;if(D!==null){D.return=d.return,oe=D;break e}oe=d.return}}var _=e.current;for(oe=_;oe!==null;){h=oe;var z=h.child;if((h.subtreeFlags&2064)!==0&&z!==null)z.return=h,oe=z;else e:for(h=_;oe!==null;){if(y=oe,(y.flags&2048)!==0)try{switch(y.tag){case 0:case 11:case 15:Ul(9,y)}}catch(de){Ge(y,y.return,de)}if(y===h){oe=null;break e}var q=y.sibling;if(q!==null){q.return=y.return,oe=q;break e}oe=y.return}}if(Me=a,Dr(),Zt&&typeof Zt.onPostCommitFiberRoot=="function")try{Zt.onPostCommitFiberRoot(Xo,e)}catch{}l=!0}return l}finally{ze=n,It.transition=t}}return!1}function Jf(e,t,n){t=is(n,t),t=xf(e,t,1),e=Ar(e,t,1),t=mt(),e!==null&&(Ks(e,1,t),wt(e,t))}function Ge(e,t,n){if(e.tag===3)Jf(e,e,n);else for(;t!==null;){if(t.tag===3){Jf(t,e,n);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(Lr===null||!Lr.has(l))){e=is(n,e),e=gf(t,e,1),t=Ar(t,e,1),e=mt(),t!==null&&(Ks(t,1,e),wt(t,e));break}}t=t.return}}function ag(e,t,n){var l=e.pingCache;l!==null&&l.delete(t),t=mt(),e.pingedLanes|=e.suspendedLanes&n,tt===e&&(ot&n)===n&&(Xe===4||Xe===3&&(ot&130023424)===ot&&500>Qe()-ec?bn(e,0):Xa|=n),wt(e,t)}function Xf(e,t){t===0&&((e.mode&1)===0?t=1:(t=tl,tl<<=1,(tl&130023424)===0&&(tl=4194304)));var n=mt();e=ur(e,t),e!==null&&(Ks(e,t,n),wt(e,n))}function cg(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Xf(e,n)}function dg(e,t){var n=0;switch(e.tag){case 13:var l=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:l=e.stateNode;break;default:throw Error(i(314))}l!==null&&l.delete(t),Xf(e,n)}var ep;ep=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||gt.current)yt=!0;else{if((e.lanes&n)===0&&(t.flags&128)===0)return yt=!1,Yx(e,t,n);yt=(e.flags&131072)!==0}else yt=!1,Be&&(t.flags&1048576)!==0&&Ou(t,kl,t.index);switch(t.lanes=0,t.tag){case 2:var l=t.type;Il(e,t),e=t.pendingProps;var a=Xn(t,at.current);os(t,n),a=Ra(null,t,l,e,a,n);var d=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,vt(l)?(d=!0,bl(t)):d=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,Na(t),a.updater=zl,t.stateNode=a,a._reactInternals=t,Ia(t,l,e,n),t=Ba(null,t,l,!0,d,n)):(t.tag=0,Be&&d&&ha(t),ht(null,t,a,n),t=t.child),t;case 16:l=t.elementType;e:{switch(Il(e,t),e=t.pendingProps,a=l._init,l=a(l._payload),t.type=l,a=t.tag=fg(l),e=Ht(l,e),a){case 0:t=$a(null,t,l,e,n);break e;case 1:t=Cf(null,t,l,e,n);break e;case 11:t=wf(null,t,l,e,n);break e;case 14:t=jf(null,t,l,Ht(l.type,e),n);break e}throw Error(i(306,l,""))}return t;case 0:return l=t.type,a=t.pendingProps,a=t.elementType===l?a:Ht(l,a),$a(e,t,l,a,n);case 1:return l=t.type,a=t.pendingProps,a=t.elementType===l?a:Ht(l,a),Cf(e,t,l,a,n);case 3:e:{if(Ef(t),e===null)throw Error(i(387));l=t.pendingProps,d=t.memoizedState,a=d.element,$u(e,t),Pl(t,l,null,n);var h=t.memoizedState;if(l=h.element,d.isDehydrated)if(d={element:l,isDehydrated:!1,cache:h.cache,pendingSuspenseBoundaries:h.pendingSuspenseBoundaries,transitions:h.transitions},t.updateQueue.baseState=d,t.memoizedState=d,t.flags&256){a=is(Error(i(423)),t),t=_f(e,t,l,n,a);break e}else if(l!==a){a=is(Error(i(424)),t),t=_f(e,t,l,n,a);break e}else for(_t=Mr(t.stateNode.containerInfo.firstChild),Et=t,Be=!0,Vt=null,n=Fu(t,null,l,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(rs(),l===a){t=pr(e,t,n);break e}ht(e,t,l,n)}t=t.child}return t;case 5:return Hu(t),e===null&&ga(t),l=t.type,a=t.pendingProps,d=e!==null?e.memoizedProps:null,h=a.children,aa(l,a)?h=null:d!==null&&aa(l,d)&&(t.flags|=32),Sf(e,t),ht(e,t,h,n),t.child;case 6:return e===null&&ga(t),null;case 13:return Pf(e,t,n);case 4:return Sa(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=ns(t,null,l,n):ht(e,t,l,n),t.child;case 11:return l=t.type,a=t.pendingProps,a=t.elementType===l?a:Ht(l,a),wf(e,t,l,a,n);case 7:return ht(e,t,t.pendingProps,n),t.child;case 8:return ht(e,t,t.pendingProps.children,n),t.child;case 12:return ht(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(l=t.type._context,a=t.pendingProps,d=t.memoizedProps,h=a.value,Ie(Cl,l._currentValue),l._currentValue=h,d!==null)if(Bt(d.value,h)){if(d.children===a.children&&!gt.current){t=pr(e,t,n);break e}}else for(d=t.child,d!==null&&(d.return=t);d!==null;){var y=d.dependencies;if(y!==null){h=d.child;for(var k=y.firstContext;k!==null;){if(k.context===l){if(d.tag===1){k=fr(-1,n&-n),k.tag=2;var F=d.updateQueue;if(F!==null){F=F.shared;var W=F.pending;W===null?k.next=k:(k.next=W.next,W.next=k),F.pending=k}}d.lanes|=n,k=d.alternate,k!==null&&(k.lanes|=n),ja(d.return,n,t),y.lanes|=n;break}k=k.next}}else if(d.tag===10)h=d.type===t.type?null:d.child;else if(d.tag===18){if(h=d.return,h===null)throw Error(i(341));h.lanes|=n,y=h.alternate,y!==null&&(y.lanes|=n),ja(h,n,t),h=d.sibling}else h=d.child;if(h!==null)h.return=d;else for(h=d;h!==null;){if(h===t){h=null;break}if(d=h.sibling,d!==null){d.return=h.return,h=d;break}h=h.return}d=h}ht(e,t,a.children,n),t=t.child}return t;case 9:return a=t.type,l=t.pendingProps.children,os(t,n),a=zt(a),l=l(a),t.flags|=1,ht(e,t,l,n),t.child;case 14:return l=t.type,a=Ht(l,t.pendingProps),a=Ht(l.type,a),jf(e,t,l,a,n);case 15:return kf(e,t,t.type,t.pendingProps,n);case 17:return l=t.type,a=t.pendingProps,a=t.elementType===l?a:Ht(l,a),Il(e,t),t.tag=1,vt(l)?(e=!0,bl(t)):e=!1,os(t,n),hf(t,l,a),Ia(t,l,a,n),Ba(null,t,l,!0,e,n);case 19:return Rf(e,t,n);case 22:return Nf(e,t,n)}throw Error(i(156,t.tag))};function tp(e,t){return Dd(e,t)}function ug(e,t,n,l){this.tag=e,this.key=n,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 Ft(e,t,n,l){return new ug(e,t,n,l)}function ac(e){return e=e.prototype,!(!e||!e.isReactComponent)}function fg(e){if(typeof e=="function")return ac(e)?1:0;if(e!=null){if(e=e.$$typeof,e===ue)return 11;if(e===Le)return 14}return 2}function $r(e,t){var n=e.alternate;return n===null?(n=Ft(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function ql(e,t,n,l,a,d){var h=2;if(l=e,typeof e=="function")ac(e)&&(h=1);else if(typeof e=="string")h=5;else e:switch(e){case V:return jn(n.children,a,d,t);case ee:h=8,a|=8;break;case ne:return e=Ft(12,n,t,a|2),e.elementType=ne,e.lanes=d,e;case Re:return e=Ft(13,n,t,a),e.elementType=Re,e.lanes=d,e;case Ee:return e=Ft(19,n,t,a),e.elementType=Ee,e.lanes=d,e;case Pe:return Zl(n,a,d,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case fe:h=10;break e;case je:h=9;break e;case ue:h=11;break e;case Le:h=14;break e;case Oe:h=16,l=null;break e}throw Error(i(130,e==null?e:typeof e,""))}return t=Ft(h,n,t,a),t.elementType=e,t.type=l,t.lanes=d,t}function jn(e,t,n,l){return e=Ft(7,e,l,t),e.lanes=n,e}function Zl(e,t,n,l){return e=Ft(22,e,l,t),e.elementType=Pe,e.lanes=n,e.stateNode={isHidden:!1},e}function cc(e,t,n){return e=Ft(6,e,null,t),e.lanes=n,e}function dc(e,t,n){return t=Ft(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function pg(e,t,n,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 uc(e,t,n,l,a,d,h,y,k){return e=new pg(e,t,n,y,k),t===1?(t=1,d===!0&&(t|=8)):t=0,d=Ft(3,null,null,t),e.current=d,d.stateNode=e,d.memoizedState={element:l,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Na(d),e}function hg(e,t,n){var l=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:$,key:l==null?null:""+l,children:e,containerInfo:t,implementation:n}}function rp(e){if(!e)return Or;e=e._reactInternals;e:{if(dn(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(vt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(i(171))}if(e.tag===1){var n=e.type;if(vt(n))return Pu(e,n,t)}return t}function np(e,t,n,l,a,d,h,y,k){return e=uc(n,l,!0,e,a,d,h,y,k),e.context=rp(null),n=e.current,l=mt(),a=Fr(n),d=fr(l,a),d.callback=t??null,Ar(n,d,a),e.current.lanes=a,Ks(e,a,l),wt(e,l),e}function Yl(e,t,n,l){var a=t.current,d=mt(),h=Fr(a);return n=rp(n),t.context===null?t.context=n:t.pendingContext=n,t=fr(d,h),t.payload={element:e},l=l===void 0?null:l,l!==null&&(t.callback=l),e=Ar(a,t,h),e!==null&&(Kt(e,a,h,d),_l(e,a,h)),h}function Jl(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 sp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function fc(e,t){sp(e,t),(e=e.alternate)&&sp(e,t)}function mg(){return null}var op=typeof reportError=="function"?reportError:function(e){console.error(e)};function pc(e){this._internalRoot=e}Xl.prototype.render=pc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));Yl(e,t,null,null)},Xl.prototype.unmount=pc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;yn(function(){Yl(null,e,null,null)}),t[ir]=null}};function Xl(e){this._internalRoot=e}Xl.prototype.unstable_scheduleHydration=function(e){if(e){var t=$d();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Er.length&&t!==0&&t<Er[n].priority;n++);Er.splice(n,0,e),n===0&&Hd(e)}};function hc(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function ei(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function lp(){}function xg(e,t,n,l,a){if(a){if(typeof l=="function"){var d=l;l=function(){var F=Jl(h);d.call(F)}}var h=np(t,l,e,0,null,!1,!1,"",lp);return e._reactRootContainer=h,e[ir]=h.current,io(e.nodeType===8?e.parentNode:e),yn(),h}for(;a=e.lastChild;)e.removeChild(a);if(typeof l=="function"){var y=l;l=function(){var F=Jl(k);y.call(F)}}var k=uc(e,0,!1,null,null,!1,!1,"",lp);return e._reactRootContainer=k,e[ir]=k.current,io(e.nodeType===8?e.parentNode:e),yn(function(){Yl(t,k,n,l)}),k}function ti(e,t,n,l,a){var d=n._reactRootContainer;if(d){var h=d;if(typeof a=="function"){var y=a;a=function(){var k=Jl(h);y.call(k)}}Yl(t,h,e,a)}else h=xg(n,t,e,a,l);return Jl(h)}Fd=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Gs(t.pendingLanes);n!==0&&(Ii(t,n|1),wt(t,Qe()),(Me&6)===0&&(ds=Qe()+500,Dr()))}break;case 13:yn(function(){var l=ur(e,1);if(l!==null){var a=mt();Kt(l,e,1,a)}}),fc(e,1)}},Fi=function(e){if(e.tag===13){var t=ur(e,134217728);if(t!==null){var n=mt();Kt(t,e,134217728,n)}fc(e,134217728)}},Ud=function(e){if(e.tag===13){var t=Fr(e),n=ur(e,t);if(n!==null){var l=mt();Kt(n,e,t,l)}fc(e,t)}},$d=function(){return ze},Bd=function(e,t){var n=ze;try{return ze=e,t()}finally{ze=n}},Ri=function(e,t,n){switch(t){case"input":if(Un(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var l=n[t];if(l!==e&&l.form===e.form){var a=vl(l);if(!a)throw Error(i(90));Is(l),Un(l,a)}}}break;case"textarea":Ae(e,n);break;case"select":t=n.value,t!=null&&A(e,!!n.multiple,t,!1)}},Cd=oc,Ed=yn;var gg={usingClientEntryPoint:!1,Events:[uo,Yn,vl,Nd,Sd,oc]},So={findFiberByHostInstance:un,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},vg={bundleType:So.bundleType,version:So.version,rendererPackageName:So.rendererPackageName,rendererConfig:So.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:L.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Rd(e),e===null?null:e.stateNode},findFiberByHostInstance:So.findFiberByHostInstance||mg,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 ri=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ri.isDisabled&&ri.supportsFiber)try{Xo=ri.inject(vg),Zt=ri}catch{}}return jt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=gg,jt.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!hc(t))throw Error(i(200));return hg(e,t,null,n)},jt.createRoot=function(e,t){if(!hc(e))throw Error(i(299));var n=!1,l="",a=op;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onRecoverableError!==void 0&&(a=t.onRecoverableError)),t=uc(e,1,!1,null,null,n,!1,l,a),e[ir]=t.current,io(e.nodeType===8?e.parentNode:e),new pc(t)},jt.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=Rd(t),e=e===null?null:e.stateNode,e},jt.flushSync=function(e){return yn(e)},jt.hydrate=function(e,t,n){if(!ei(t))throw Error(i(200));return ti(null,e,t,!0,n)},jt.hydrateRoot=function(e,t,n){if(!hc(e))throw Error(i(405));var l=n!=null&&n.hydratedSources||null,a=!1,d="",h=op;if(n!=null&&(n.unstable_strictMode===!0&&(a=!0),n.identifierPrefix!==void 0&&(d=n.identifierPrefix),n.onRecoverableError!==void 0&&(h=n.onRecoverableError)),t=np(t,null,e,1,n??null,a,!1,d,h),e[ir]=t.current,io(e),l)for(e=0;e<l.length;e++)n=l[e],a=n._getVersion,a=a(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,a]:t.mutableSourceEagerHydrationData.push(n,a);return new Xl(t)},jt.render=function(e,t,n){if(!ei(t))throw Error(i(200));return ti(null,e,t,!1,n)},jt.unmountComponentAtNode=function(e){if(!ei(e))throw Error(i(40));return e._reactRootContainer?(yn(function(){ti(null,null,e,!1,function(){e._reactRootContainer=null,e[ir]=null})}),!0):!1},jt.unstable_batchedUpdates=oc,jt.unstable_renderSubtreeIntoContainer=function(e,t,n,l){if(!ei(n))throw Error(i(200));if(e==null||e._reactInternals===void 0)throw Error(i(38));return ti(e,t,n,!1,l)},jt.version="18.3.1-next-f1338f8080-20240426",jt}var mp;function fh(){if(mp)return vc.exports;mp=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(),vc.exports=Cg(),vc.exports}var xp;function Eg(){if(xp)return si;xp=1;var s=fh();return si.createRoot=s.createRoot,si.hydrateRoot=s.hydrateRoot,si}var _g=Eg();const Pg=dh(_g);var Ko=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(){}},Sn,Kr,bs,eh,Mg=(eh=class extends Ko{constructor(){super();ve(this,Sn);ve(this,Kr);ve(this,bs);re(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,Kr)||this.setEventListener(S(this,bs))}onUnsubscribe(){var o;this.hasListeners()||((o=S(this,Kr))==null||o.call(this),re(this,Kr,void 0))}setEventListener(o){var i;re(this,bs,o),(i=S(this,Kr))==null||i.call(this),re(this,Kr,o(c=>{typeof c=="boolean"?this.setFocused(c):this.onFocus()}))}setFocused(o){S(this,Sn)!==o&&(re(this,Sn,o),this.onFocus())}onFocus(){const o=this.isFocused();this.listeners.forEach(i=>{i(o)})}isFocused(){var o;return typeof S(this,Sn)=="boolean"?S(this,Sn):((o=globalThis.document)==null?void 0:o.visibilityState)!=="hidden"}},Sn=new WeakMap,Kr=new WeakMap,bs=new WeakMap,eh),cd=new Mg,Rg={setTimeout:(s,o)=>setTimeout(s,o),clearTimeout:s=>clearTimeout(s),setInterval:(s,o)=>setInterval(s,o),clearInterval:s=>clearInterval(s)},Qr,ld,th,Og=(th=class{constructor(){ve(this,Qr,Rg);ve(this,ld,!1)}setTimeoutProvider(s){re(this,Qr,s)}setTimeout(s,o){return S(this,Qr).setTimeout(s,o)}clearTimeout(s){S(this,Qr).clearTimeout(s)}setInterval(s,o){return S(this,Qr).setInterval(s,o)}clearInterval(s){S(this,Qr).clearInterval(s)}},Qr=new WeakMap,ld=new WeakMap,th),Nn=new Og;function Dg(s){setTimeout(s,0)}var Tg=typeof window>"u"||"Deno"in globalThis;function Nt(){}function Ag(s,o){return typeof s=="function"?s(o):s}function Dc(s){return typeof s=="number"&&s>=0&&s!==1/0}function ph(s,o){return Math.max(s+(o||0)-Date.now(),0)}function tn(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:c,fetchStatus:u,predicate:f,queryKey:m,stale:p}=s;if(m){if(c){if(o.queryHash!==dd(m,o.options))return!1}else if(!Oo(o.queryKey,m))return!1}if(i!=="all"){const v=o.isActive();if(i==="active"&&!v||i==="inactive"&&v)return!1}return!(typeof p=="boolean"&&o.isStale()!==p||u&&u!==o.state.fetchStatus||f&&!f(o))}function vp(s,o){const{exact:i,status:c,predicate:u,mutationKey:f}=s;if(f){if(!o.options.mutationKey)return!1;if(i){if(Ro(o.options.mutationKey)!==Ro(f))return!1}else if(!Oo(o.options.mutationKey,f))return!1}return!(c&&o.state.status!==c||u&&!u(o))}function dd(s,o){return((o==null?void 0:o.queryKeyHashFn)||Ro)(s)}function Ro(s){return JSON.stringify(s,(o,i)=>Ac(i)?Object.keys(i).sort().reduce((c,u)=>(c[u]=i[u],c),{}):i)}function Oo(s,o){return s===o?!0:typeof s!=typeof o?!1:s&&o&&typeof s=="object"&&typeof o=="object"?Object.keys(o).every(i=>Oo(s[i],o[i])):!1}var zg=Object.prototype.hasOwnProperty;function hh(s,o,i=0){if(s===o)return s;if(i>500)return o;const c=yp(s)&&yp(o);if(!c&&!(Ac(s)&&Ac(o)))return o;const f=(c?s:Object.keys(s)).length,m=c?o:Object.keys(o),p=m.length,v=c?new Array(p):{};let x=0;for(let b=0;b<p;b++){const w=c?b:m[b],P=s[w],O=o[w];if(P===O){v[w]=P,(c?b<f:zg.call(s,w))&&x++;continue}if(P===null||O===null||typeof P!="object"||typeof O!="object"){v[w]=O;continue}const I=hh(P,O,i+1);v[w]=I,I===P&&x++}return f===p&&x===f?s:v}function Tc(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 Ac(s){if(!bp(s))return!1;const o=s.constructor;if(o===void 0)return!0;const i=o.prototype;return!(!bp(i)||!i.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(s)!==Object.prototype)}function bp(s){return Object.prototype.toString.call(s)==="[object Object]"}function Lg(s){return new Promise(o=>{Nn.setTimeout(o,s)})}function zc(s,o,i){return typeof i.structuralSharing=="function"?i.structuralSharing(s,o):i.structuralSharing!==!1?hh(s,o):o}function Ig(s,o,i=0){const c=[...s,o];return i&&c.length>i?c.slice(1):c}function Fg(s,o,i=0){const c=[o,...s];return i&&c.length>i?c.slice(0,-1):c}var ud=Symbol();function mh(s,o){return!s.queryFn&&(o!=null&&o.initialPromise)?()=>o.initialPromise:!s.queryFn||s.queryFn===ud?()=>Promise.reject(new Error(`Missing queryFn: '${s.queryHash}'`)):s.queryFn}function xh(s,o){return typeof s=="function"?s(...o):!!s}function Ug(s,o,i){let c=!1,u;return Object.defineProperty(s,"signal",{enumerable:!0,get:()=>(u??(u=o()),c||(c=!0,u.aborted?i():u.addEventListener("abort",i,{once:!0})),u)}),s}var Do=(()=>{let s=()=>Tg;return{isServer(){return s()},setIsServer(o){s=o}}})();function Lc(){let s,o;const i=new Promise((u,f)=>{s=u,o=f});i.status="pending",i.catch(()=>{});function c(u){Object.assign(i,u),delete i.resolve,delete i.reject}return i.resolve=u=>{c({status:"fulfilled",value:u}),s(u)},i.reject=u=>{c({status:"rejected",reason:u}),o(u)},i}var $g=Dg;function Bg(){let s=[],o=0,i=p=>{p()},c=p=>{p()},u=$g;const f=p=>{o?s.push(p):u(()=>{i(p)})},m=()=>{const p=s;s=[],p.length&&u(()=>{c(()=>{p.forEach(v=>{i(v)})})})};return{batch:p=>{let v;o++;try{v=p()}finally{o--,o||m()}return v},batchCalls:p=>(...v)=>{f(()=>{p(...v)})},schedule:f,setNotifyFunction:p=>{i=p},setBatchNotifyFunction:p=>{c=p},setScheduler:p=>{u=p}}}var lt=Bg(),ws,qr,js,rh,Vg=(rh=class extends Ko{constructor(){super();ve(this,ws,!0);ve(this,qr);ve(this,js);re(this,js,o=>{if(typeof window<"u"&&window.addEventListener){const i=()=>o(!0),c=()=>o(!1);return window.addEventListener("online",i,!1),window.addEventListener("offline",c,!1),()=>{window.removeEventListener("online",i),window.removeEventListener("offline",c)}}})}onSubscribe(){S(this,qr)||this.setEventListener(S(this,js))}onUnsubscribe(){var o;this.hasListeners()||((o=S(this,qr))==null||o.call(this),re(this,qr,void 0))}setEventListener(o){var i;re(this,js,o),(i=S(this,qr))==null||i.call(this),re(this,qr,o(this.setOnline.bind(this)))}setOnline(o){S(this,ws)!==o&&(re(this,ws,o),this.listeners.forEach(c=>{c(o)}))}isOnline(){return S(this,ws)}},ws=new WeakMap,qr=new WeakMap,js=new WeakMap,rh),vi=new Vg;function Hg(s){return Math.min(1e3*2**s,3e4)}function gh(s){return(s??"online")==="online"?vi.isOnline():!0}var Ic=class extends Error{constructor(s){super("CancelledError"),this.revert=s==null?void 0:s.revert,this.silent=s==null?void 0:s.silent}};function vh(s){let o=!1,i=0,c;const u=Lc(),f=()=>u.status!=="pending",m=j=>{var N;if(!f()){const M=new Ic(j);P(M),(N=s.onCancel)==null||N.call(s,M)}},p=()=>{o=!0},v=()=>{o=!1},x=()=>cd.isFocused()&&(s.networkMode==="always"||vi.isOnline())&&s.canRun(),b=()=>gh(s.networkMode)&&s.canRun(),w=j=>{f()||(c==null||c(),u.resolve(j))},P=j=>{f()||(c==null||c(),u.reject(j))},O=()=>new Promise(j=>{var N;c=M=>{(f()||x())&&j(M)},(N=s.onPause)==null||N.call(s)}).then(()=>{var j;c=void 0,f()||(j=s.onContinue)==null||j.call(s)}),I=()=>{if(f())return;let j;const N=i===0?s.initialPromise:void 0;try{j=N??s.fn()}catch(M){j=Promise.reject(M)}Promise.resolve(j).then(w).catch(M=>{var $;if(f())return;const R=s.retry??(Do.isServer()?0:3),B=s.retryDelay??Hg,L=typeof B=="function"?B(i,M):B,T=R===!0||typeof R=="number"&&i<R||typeof R=="function"&&R(i,M);if(o||!T){P(M);return}i++,($=s.onFail)==null||$.call(s,i,M),Lg(L).then(()=>x()?void 0:O()).then(()=>{o?P(M):I()})})};return{promise:u,status:()=>u.status,cancel:m,continue:()=>(c==null||c(),u),cancelRetry:p,continueRetry:v,canStart:b,start:()=>(b()?I():O().then(I),u)}}var Cn,nh,yh=(nh=class{constructor(){ve(this,Cn)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Dc(this.gcTime)&&re(this,Cn,Nn.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(s){this.gcTime=Math.max(this.gcTime||0,s??(Do.isServer()?1/0:300*1e3))}clearGcTimeout(){S(this,Cn)!==void 0&&(Nn.clearTimeout(S(this,Cn)),re(this,Cn,void 0))}},Cn=new WeakMap,nh);function Wg(s){return{onFetch:(o,i)=>{var b,w,P,O,I;const c=o.options,u=(P=(w=(b=o.fetchOptions)==null?void 0:b.meta)==null?void 0:w.fetchMore)==null?void 0:P.direction,f=((O=o.state.data)==null?void 0:O.pages)||[],m=((I=o.state.data)==null?void 0:I.pageParams)||[];let p={pages:[],pageParams:[]},v=0;const x=async()=>{let j=!1;const N=B=>{Ug(B,()=>o.signal,()=>j=!0)},M=mh(o.options,o.fetchOptions),R=async(B,L,T)=>{if(j)return Promise.reject(o.signal.reason);if(L==null&&B.pages.length)return Promise.resolve(B);const V=(()=>{const je={client:o.client,queryKey:o.queryKey,pageParam:L,direction:T?"backward":"forward",meta:o.options.meta};return N(je),je})(),ee=await M(V),{maxPages:ne}=o.options,fe=T?Fg:Ig;return{pages:fe(B.pages,ee,ne),pageParams:fe(B.pageParams,L,ne)}};if(u&&f.length){const B=u==="backward",L=B?Gg:wp,T={pages:f,pageParams:m},$=L(c,T);p=await R(T,$,B)}else{const B=s??f.length;do{const L=v===0?m[0]??c.initialPageParam:wp(c,p);if(v>0&&L==null)break;p=await R(p,L),v++}while(v<B)}return p};o.options.persister?o.fetchFn=()=>{var j,N;return(N=(j=o.options).persister)==null?void 0:N.call(j,x,{client:o.client,queryKey:o.queryKey,meta:o.options.meta,signal:o.signal},i)}:o.fetchFn=x}}}function wp(s,{pages:o,pageParams:i}){const c=o.length-1;return o.length>0?s.getNextPageParam(o[c],o,i[c],i):void 0}function Gg(s,{pages:o,pageParams:i}){var c;return o.length>0?(c=s.getPreviousPageParam)==null?void 0:c.call(s,o[0],o,i[0],i):void 0}var ks,En,Ns,Ut,_n,nt,Bo,Pn,Mt,bh,xr,sh,Kg=(sh=class extends yh{constructor(o){super();ve(this,Mt);ve(this,ks);ve(this,En);ve(this,Ns);ve(this,Ut);ve(this,_n);ve(this,nt);ve(this,Bo);ve(this,Pn);re(this,Pn,!1),re(this,Bo,o.defaultOptions),this.setOptions(o.options),this.observers=[],re(this,_n,o.client),re(this,Ut,S(this,_n).getQueryCache()),this.queryKey=o.queryKey,this.queryHash=o.queryHash,re(this,En,kp(this.options)),this.state=o.state??S(this,En),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return S(this,ks)}get promise(){var o;return(o=S(this,nt))==null?void 0:o.promise}setOptions(o){if(this.options={...S(this,Bo),...o},o!=null&&o._type&&re(this,ks,o._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const i=kp(this.options);i.data!==void 0&&(this.setState(jp(i.data,i.dataUpdatedAt)),re(this,En,i))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&S(this,Ut).remove(this)}setData(o,i){const c=zc(this.state.data,o,this.options);return Ce(this,Mt,xr).call(this,{data:c,type:"success",dataUpdatedAt:i==null?void 0:i.updatedAt,manual:i==null?void 0:i.manual}),c}setState(o){Ce(this,Mt,xr).call(this,{type:"setState",state:o})}cancel(o){var c,u;const i=(c=S(this,nt))==null?void 0:c.promise;return(u=S(this,nt))==null||u.cancel(o),i?i.then(Nt).catch(Nt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return S(this,En)}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===ud||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(o=>tn(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:!ph(this.state.dataUpdatedAt,o)}onFocus(){var i;const o=this.observers.find(c=>c.shouldFetchOnWindowFocus());o==null||o.refetch({cancelRefetch:!1}),(i=S(this,nt))==null||i.continue()}onOnline(){var i;const o=this.observers.find(c=>c.shouldFetchOnReconnect());o==null||o.refetch({cancelRefetch:!1}),(i=S(this,nt))==null||i.continue()}addObserver(o){this.observers.includes(o)||(this.observers.push(o),this.clearGcTimeout(),S(this,Ut).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,nt)&&(S(this,Pn)||Ce(this,Mt,bh).call(this)?S(this,nt).cancel({revert:!0}):S(this,nt).cancelRetry()),this.scheduleGc()),S(this,Ut).notify({type:"observerRemoved",query:this,observer:o}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Ce(this,Mt,xr).call(this,{type:"invalidate"})}async fetch(o,i){var x,b,w,P,O,I,j,N,M,R,B;if(this.state.fetchStatus!=="idle"&&((x=S(this,nt))==null?void 0:x.status())!=="rejected"){if(this.state.data!==void 0&&(i!=null&&i.cancelRefetch))this.cancel({silent:!0});else if(S(this,nt))return S(this,nt).continueRetry(),S(this,nt).promise}if(o&&this.setOptions(o),!this.options.queryFn){const L=this.observers.find(T=>T.options.queryFn);L&&this.setOptions(L.options)}const c=new AbortController,u=L=>{Object.defineProperty(L,"signal",{enumerable:!0,get:()=>(re(this,Pn,!0),c.signal)})},f=()=>{const L=mh(this.options,i),$=(()=>{const V={client:S(this,_n),queryKey:this.queryKey,meta:this.meta};return u(V),V})();return re(this,Pn,!1),this.options.persister?this.options.persister(L,$,this):L($)},p=(()=>{const L={fetchOptions:i,options:this.options,queryKey:this.queryKey,client:S(this,_n),state:this.state,fetchFn:f};return u(L),L})(),v=S(this,ks)==="infinite"?Wg(this.options.pages):this.options.behavior;v==null||v.onFetch(p,this),re(this,Ns,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((b=p.fetchOptions)==null?void 0:b.meta))&&Ce(this,Mt,xr).call(this,{type:"fetch",meta:(w=p.fetchOptions)==null?void 0:w.meta}),re(this,nt,vh({initialPromise:i==null?void 0:i.initialPromise,fn:p.fetchFn,onCancel:L=>{L instanceof Ic&&L.revert&&this.setState({...S(this,Ns),fetchStatus:"idle"}),c.abort()},onFail:(L,T)=>{Ce(this,Mt,xr).call(this,{type:"failed",failureCount:L,error:T})},onPause:()=>{Ce(this,Mt,xr).call(this,{type:"pause"})},onContinue:()=>{Ce(this,Mt,xr).call(this,{type:"continue"})},retry:p.options.retry,retryDelay:p.options.retryDelay,networkMode:p.options.networkMode,canRun:()=>!0}));try{const L=await S(this,nt).start();if(L===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(L),(O=(P=S(this,Ut).config).onSuccess)==null||O.call(P,L,this),(j=(I=S(this,Ut).config).onSettled)==null||j.call(I,L,this.state.error,this),L}catch(L){if(L instanceof Ic){if(L.silent)return S(this,nt).promise;if(L.revert){if(this.state.data===void 0)throw L;return this.state.data}}throw Ce(this,Mt,xr).call(this,{type:"error",error:L}),(M=(N=S(this,Ut).config).onError)==null||M.call(N,L,this),(B=(R=S(this,Ut).config).onSettled)==null||B.call(R,this.state.data,L,this),L}finally{this.scheduleGc()}}},ks=new WeakMap,En=new WeakMap,Ns=new WeakMap,Ut=new WeakMap,_n=new WeakMap,nt=new WeakMap,Bo=new WeakMap,Pn=new WeakMap,Mt=new WeakSet,bh=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},xr=function(o){const i=c=>{switch(o.type){case"failed":return{...c,fetchFailureCount:o.failureCount,fetchFailureReason:o.error};case"pause":return{...c,fetchStatus:"paused"};case"continue":return{...c,fetchStatus:"fetching"};case"fetch":return{...c,...wh(c.data,this.options),fetchMeta:o.meta??null};case"success":const u={...c,...jp(o.data,o.dataUpdatedAt),dataUpdateCount:c.dataUpdateCount+1,...!o.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return re(this,Ns,o.manual?u:void 0),u;case"error":const f=o.error;return{...c,error:f,errorUpdateCount:c.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:c.fetchFailureCount+1,fetchFailureReason:f,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...c,isInvalidated:!0};case"setState":return{...c,...o.state}}};this.state=i(this.state),lt.batch(()=>{this.observers.forEach(c=>{c.onQueryUpdate()}),S(this,Ut).notify({query:this,type:"updated",action:o})})},sh);function wh(s,o){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:gh(o.networkMode)?"fetching":"paused",...s===void 0&&{error:null,status:"pending"}}}function jp(s,o){return{data:s,dataUpdatedAt:o??Date.now(),error:null,isInvalidated:!1,status:"success"}}function kp(s){const o=typeof s.initialData=="function"?s.initialData():s.initialData,i=o!==void 0,c=i?typeof s.initialDataUpdatedAt=="function"?s.initialDataUpdatedAt():s.initialDataUpdatedAt:0;return{data:o,dataUpdateCount:0,dataUpdatedAt:i?c??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:i?"success":"pending",fetchStatus:"idle"}}var kt,_e,Vo,xt,Mn,Ss,vr,Zr,Ho,Cs,Es,Rn,On,Yr,_s,Te,Mo,Fc,Uc,$c,Bc,Vc,Hc,Wc,jh,oh,Qg=(oh=class extends Ko{constructor(o,i){super();ve(this,Te);ve(this,kt);ve(this,_e);ve(this,Vo);ve(this,xt);ve(this,Mn);ve(this,Ss);ve(this,vr);ve(this,Zr);ve(this,Ho);ve(this,Cs);ve(this,Es);ve(this,Rn);ve(this,On);ve(this,Yr);ve(this,_s,new Set);this.options=i,re(this,kt,o),re(this,Zr,null),re(this,vr,Lc()),this.bindMethods(),this.setOptions(i)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(S(this,_e).addObserver(this),Np(S(this,_e),this.options)?Ce(this,Te,Mo).call(this):this.updateResult(),Ce(this,Te,Bc).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Gc(S(this,_e),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Gc(S(this,_e),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Ce(this,Te,Vc).call(this),Ce(this,Te,Hc).call(this),S(this,_e).removeObserver(this)}setOptions(o){const i=this.options,c=S(this,_e);if(this.options=S(this,kt).defaultQueryOptions(o),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Rt(this.options.enabled,S(this,_e))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Ce(this,Te,Wc).call(this),S(this,_e).setOptions(this.options),i._defaulted&&!Tc(this.options,i)&&S(this,kt).getQueryCache().notify({type:"observerOptionsUpdated",query:S(this,_e),observer:this});const u=this.hasListeners();u&&Sp(S(this,_e),c,this.options,i)&&Ce(this,Te,Mo).call(this),this.updateResult(),u&&(S(this,_e)!==c||Rt(this.options.enabled,S(this,_e))!==Rt(i.enabled,S(this,_e))||tn(this.options.staleTime,S(this,_e))!==tn(i.staleTime,S(this,_e)))&&Ce(this,Te,Fc).call(this);const f=Ce(this,Te,Uc).call(this);u&&(S(this,_e)!==c||Rt(this.options.enabled,S(this,_e))!==Rt(i.enabled,S(this,_e))||f!==S(this,Yr))&&Ce(this,Te,$c).call(this,f)}getOptimisticResult(o){const i=S(this,kt).getQueryCache().build(S(this,kt),o),c=this.createResult(i,o);return Zg(this,c)&&(re(this,xt,c),re(this,Ss,this.options),re(this,Mn,S(this,_e).state)),c}getCurrentResult(){return S(this,xt)}trackResult(o,i){return new Proxy(o,{get:(c,u)=>(this.trackProp(u),i==null||i(u),u==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&S(this,vr).status==="pending"&&S(this,vr).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(c,u))})}trackProp(o){S(this,_s).add(o)}getCurrentQuery(){return S(this,_e)}refetch({...o}={}){return this.fetch({...o})}fetchOptimistic(o){const i=S(this,kt).defaultQueryOptions(o),c=S(this,kt).getQueryCache().build(S(this,kt),i);return c.fetch().then(()=>this.createResult(c,i))}fetch(o){return Ce(this,Te,Mo).call(this,{...o,cancelRefetch:o.cancelRefetch??!0}).then(()=>(this.updateResult(),S(this,xt)))}createResult(o,i){var ne;const c=S(this,_e),u=this.options,f=S(this,xt),m=S(this,Mn),p=S(this,Ss),x=o!==c?o.state:S(this,Vo),{state:b}=o;let w={...b},P=!1,O;if(i._optimisticResults){const fe=this.hasListeners(),je=!fe&&Np(o,i),ue=fe&&Sp(o,c,i,u);(je||ue)&&(w={...w,...wh(b.data,o.options)}),i._optimisticResults==="isRestoring"&&(w.fetchStatus="idle")}let{error:I,errorUpdatedAt:j,status:N}=w;O=w.data;let M=!1;if(i.placeholderData!==void 0&&O===void 0&&N==="pending"){let fe;f!=null&&f.isPlaceholderData&&i.placeholderData===(p==null?void 0:p.placeholderData)?(fe=f.data,M=!0):fe=typeof i.placeholderData=="function"?i.placeholderData((ne=S(this,Es))==null?void 0:ne.state.data,S(this,Es)):i.placeholderData,fe!==void 0&&(N="success",O=zc(f==null?void 0:f.data,fe,i),P=!0)}if(i.select&&O!==void 0&&!M)if(f&&O===(m==null?void 0:m.data)&&i.select===S(this,Ho))O=S(this,Cs);else try{re(this,Ho,i.select),O=i.select(O),O=zc(f==null?void 0:f.data,O,i),re(this,Cs,O),re(this,Zr,null)}catch(fe){re(this,Zr,fe)}S(this,Zr)&&(I=S(this,Zr),O=S(this,Cs),j=Date.now(),N="error");const R=w.fetchStatus==="fetching",B=N==="pending",L=N==="error",T=B&&R,$=O!==void 0,ee={status:N,fetchStatus:w.fetchStatus,isPending:B,isSuccess:N==="success",isError:L,isInitialLoading:T,isLoading:T,data:O,dataUpdatedAt:w.dataUpdatedAt,error:I,errorUpdatedAt:j,failureCount:w.fetchFailureCount,failureReason:w.fetchFailureReason,errorUpdateCount:w.errorUpdateCount,isFetched:o.isFetched(),isFetchedAfterMount:w.dataUpdateCount>x.dataUpdateCount||w.errorUpdateCount>x.errorUpdateCount,isFetching:R,isRefetching:R&&!B,isLoadingError:L&&!$,isPaused:w.fetchStatus==="paused",isPlaceholderData:P,isRefetchError:L&&$,isStale:fd(o,i),refetch:this.refetch,promise:S(this,vr),isEnabled:Rt(i.enabled,o)!==!1};if(this.options.experimental_prefetchInRender){const fe=ee.data!==void 0,je=ee.status==="error"&&!fe,ue=Le=>{je?Le.reject(ee.error):fe&&Le.resolve(ee.data)},Re=()=>{const Le=re(this,vr,ee.promise=Lc());ue(Le)},Ee=S(this,vr);switch(Ee.status){case"pending":o.queryHash===c.queryHash&&ue(Ee);break;case"fulfilled":(je||ee.data!==Ee.value)&&Re();break;case"rejected":(!je||ee.error!==Ee.reason)&&Re();break}}return ee}updateResult(){const o=S(this,xt),i=this.createResult(S(this,_e),this.options);if(re(this,Mn,S(this,_e).state),re(this,Ss,this.options),S(this,Mn).data!==void 0&&re(this,Es,S(this,_e)),Tc(i,o))return;re(this,xt,i);const c=()=>{if(!o)return!0;const{notifyOnChangeProps:u}=this.options,f=typeof u=="function"?u():u;if(f==="all"||!f&&!S(this,_s).size)return!0;const m=new Set(f??S(this,_s));return this.options.throwOnError&&m.add("error"),Object.keys(S(this,xt)).some(p=>{const v=p;return S(this,xt)[v]!==o[v]&&m.has(v)})};Ce(this,Te,jh).call(this,{listeners:c()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Ce(this,Te,Bc).call(this)}},kt=new WeakMap,_e=new WeakMap,Vo=new WeakMap,xt=new WeakMap,Mn=new WeakMap,Ss=new WeakMap,vr=new WeakMap,Zr=new WeakMap,Ho=new WeakMap,Cs=new WeakMap,Es=new WeakMap,Rn=new WeakMap,On=new WeakMap,Yr=new WeakMap,_s=new WeakMap,Te=new WeakSet,Mo=function(o){Ce(this,Te,Wc).call(this);let i=S(this,_e).fetch(this.options,o);return o!=null&&o.throwOnError||(i=i.catch(Nt)),i},Fc=function(){Ce(this,Te,Vc).call(this);const o=tn(this.options.staleTime,S(this,_e));if(Do.isServer()||S(this,xt).isStale||!Dc(o))return;const c=ph(S(this,xt).dataUpdatedAt,o)+1;re(this,Rn,Nn.setTimeout(()=>{S(this,xt).isStale||this.updateResult()},c))},Uc=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(S(this,_e)):this.options.refetchInterval)??!1},$c=function(o){Ce(this,Te,Hc).call(this),re(this,Yr,o),!(Do.isServer()||Rt(this.options.enabled,S(this,_e))===!1||!Dc(S(this,Yr))||S(this,Yr)===0)&&re(this,On,Nn.setInterval(()=>{(this.options.refetchIntervalInBackground||cd.isFocused())&&Ce(this,Te,Mo).call(this)},S(this,Yr)))},Bc=function(){Ce(this,Te,Fc).call(this),Ce(this,Te,$c).call(this,Ce(this,Te,Uc).call(this))},Vc=function(){S(this,Rn)!==void 0&&(Nn.clearTimeout(S(this,Rn)),re(this,Rn,void 0))},Hc=function(){S(this,On)!==void 0&&(Nn.clearInterval(S(this,On)),re(this,On,void 0))},Wc=function(){const o=S(this,kt).getQueryCache().build(S(this,kt),this.options);if(o===S(this,_e))return;const i=S(this,_e);re(this,_e,o),re(this,Vo,o.state),this.hasListeners()&&(i==null||i.removeObserver(this),o.addObserver(this))},jh=function(o){lt.batch(()=>{o.listeners&&this.listeners.forEach(i=>{i(S(this,xt))}),S(this,kt).getQueryCache().notify({query:S(this,_e),type:"observerResultsUpdated"})})},oh);function qg(s,o){return Rt(o.enabled,s)!==!1&&s.state.data===void 0&&!(s.state.status==="error"&&Rt(o.retryOnMount,s)===!1)}function Np(s,o){return qg(s,o)||s.state.data!==void 0&&Gc(s,o,o.refetchOnMount)}function Gc(s,o,i){if(Rt(o.enabled,s)!==!1&&tn(o.staleTime,s)!=="static"){const c=typeof i=="function"?i(s):i;return c==="always"||c!==!1&&fd(s,o)}return!1}function Sp(s,o,i,c){return(s!==o||Rt(c.enabled,s)===!1)&&(!i.suspense||s.state.status!=="error")&&fd(s,i)}function fd(s,o){return Rt(o.enabled,s)!==!1&&s.isStaleByTime(tn(o.staleTime,s))}function Zg(s,o){return!Tc(s.getCurrentResult(),o)}var Wo,rr,ft,Dn,nr,Wr,lh,Yg=(lh=class extends yh{constructor(o){super();ve(this,nr);ve(this,Wo);ve(this,rr);ve(this,ft);ve(this,Dn);re(this,Wo,o.client),this.mutationId=o.mutationId,re(this,ft,o.mutationCache),re(this,rr,[]),this.state=o.state||Jg(),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,ft).notify({type:"observerAdded",mutation:this,observer:o}))}removeObserver(o){re(this,rr,S(this,rr).filter(i=>i!==o)),this.scheduleGc(),S(this,ft).notify({type:"observerRemoved",mutation:this,observer:o})}optionalRemove(){S(this,rr).length||(this.state.status==="pending"?this.scheduleGc():S(this,ft).remove(this))}continue(){var o;return((o=S(this,Dn))==null?void 0:o.continue())??this.execute(this.state.variables)}async execute(o){var m,p,v,x,b,w,P,O,I,j,N,M,R,B,L,T,$,V;const i=()=>{Ce(this,nr,Wr).call(this,{type:"continue"})},c={client:S(this,Wo),meta:this.options.meta,mutationKey:this.options.mutationKey};re(this,Dn,vh({fn:()=>this.options.mutationFn?this.options.mutationFn(o,c):Promise.reject(new Error("No mutationFn found")),onFail:(ee,ne)=>{Ce(this,nr,Wr).call(this,{type:"failed",failureCount:ee,error:ne})},onPause:()=>{Ce(this,nr,Wr).call(this,{type:"pause"})},onContinue:i,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>S(this,ft).canRun(this)}));const u=this.state.status==="pending",f=!S(this,Dn).canStart();try{if(u)i();else{Ce(this,nr,Wr).call(this,{type:"pending",variables:o,isPaused:f}),S(this,ft).config.onMutate&&await S(this,ft).config.onMutate(o,this,c);const ne=await((p=(m=this.options).onMutate)==null?void 0:p.call(m,o,c));ne!==this.state.context&&Ce(this,nr,Wr).call(this,{type:"pending",context:ne,variables:o,isPaused:f})}const ee=await S(this,Dn).start();return await((x=(v=S(this,ft).config).onSuccess)==null?void 0:x.call(v,ee,o,this.state.context,this,c)),await((w=(b=this.options).onSuccess)==null?void 0:w.call(b,ee,o,this.state.context,c)),await((O=(P=S(this,ft).config).onSettled)==null?void 0:O.call(P,ee,null,this.state.variables,this.state.context,this,c)),await((j=(I=this.options).onSettled)==null?void 0:j.call(I,ee,null,o,this.state.context,c)),Ce(this,nr,Wr).call(this,{type:"success",data:ee}),ee}catch(ee){try{await((M=(N=S(this,ft).config).onError)==null?void 0:M.call(N,ee,o,this.state.context,this,c))}catch(ne){Promise.reject(ne)}try{await((B=(R=this.options).onError)==null?void 0:B.call(R,ee,o,this.state.context,c))}catch(ne){Promise.reject(ne)}try{await((T=(L=S(this,ft).config).onSettled)==null?void 0:T.call(L,void 0,ee,this.state.variables,this.state.context,this,c))}catch(ne){Promise.reject(ne)}try{await((V=($=this.options).onSettled)==null?void 0:V.call($,void 0,ee,o,this.state.context,c))}catch(ne){Promise.reject(ne)}throw Ce(this,nr,Wr).call(this,{type:"error",error:ee}),ee}finally{S(this,ft).runNext(this)}}},Wo=new WeakMap,rr=new WeakMap,ft=new WeakMap,Dn=new WeakMap,nr=new WeakSet,Wr=function(o){const i=c=>{switch(o.type){case"failed":return{...c,failureCount:o.failureCount,failureReason:o.error};case"pause":return{...c,isPaused:!0};case"continue":return{...c,isPaused:!1};case"pending":return{...c,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{...c,data:o.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...c,data:void 0,error:o.error,failureCount:c.failureCount+1,failureReason:o.error,isPaused:!1,status:"error"}}};this.state=i(this.state),lt.batch(()=>{S(this,rr).forEach(c=>{c.onMutationUpdate(o)}),S(this,ft).notify({mutation:this,type:"updated",action:o})})},lh);function Jg(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var yr,Qt,Go,ih,Xg=(ih=class extends Ko{constructor(o={}){super();ve(this,yr);ve(this,Qt);ve(this,Go);this.config=o,re(this,yr,new Set),re(this,Qt,new Map),re(this,Go,0)}build(o,i,c){const u=new Yg({client:o,mutationCache:this,mutationId:++ni(this,Go)._,options:o.defaultMutationOptions(i),state:c});return this.add(u),u}add(o){S(this,yr).add(o);const i=oi(o);if(typeof i=="string"){const c=S(this,Qt).get(i);c?c.push(o):S(this,Qt).set(i,[o])}this.notify({type:"added",mutation:o})}remove(o){if(S(this,yr).delete(o)){const i=oi(o);if(typeof i=="string"){const c=S(this,Qt).get(i);if(c)if(c.length>1){const u=c.indexOf(o);u!==-1&&c.splice(u,1)}else c[0]===o&&S(this,Qt).delete(i)}}this.notify({type:"removed",mutation:o})}canRun(o){const i=oi(o);if(typeof i=="string"){const c=S(this,Qt).get(i),u=c==null?void 0:c.find(f=>f.state.status==="pending");return!u||u===o}else return!0}runNext(o){var c;const i=oi(o);if(typeof i=="string"){const u=(c=S(this,Qt).get(i))==null?void 0:c.find(f=>f!==o&&f.state.isPaused);return(u==null?void 0:u.continue())??Promise.resolve()}else return Promise.resolve()}clear(){lt.batch(()=>{S(this,yr).forEach(o=>{this.notify({type:"removed",mutation:o})}),S(this,yr).clear(),S(this,Qt).clear()})}getAll(){return Array.from(S(this,yr))}find(o){const i={exact:!0,...o};return this.getAll().find(c=>vp(i,c))}findAll(o={}){return this.getAll().filter(i=>vp(o,i))}notify(o){lt.batch(()=>{this.listeners.forEach(i=>{i(o)})})}resumePausedMutations(){const o=this.getAll().filter(i=>i.state.isPaused);return lt.batch(()=>Promise.all(o.map(i=>i.continue().catch(Nt))))}},yr=new WeakMap,Qt=new WeakMap,Go=new WeakMap,ih);function oi(s){var o;return(o=s.options.scope)==null?void 0:o.id}var sr,ah,e0=(ah=class extends Ko{constructor(o={}){super();ve(this,sr);this.config=o,re(this,sr,new Map)}build(o,i,c){const u=i.queryKey,f=i.queryHash??dd(u,i);let m=this.get(f);return m||(m=new Kg({client:o,queryKey:u,queryHash:f,options:o.defaultQueryOptions(i),state:c,defaultOptions:o.getQueryDefaults(u)}),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(){lt.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(c=>gp(i,c))}findAll(o={}){const i=this.getAll();return Object.keys(o).length>0?i.filter(c=>gp(o,c)):i}notify(o){lt.batch(()=>{this.listeners.forEach(i=>{i(o)})})}onFocus(){lt.batch(()=>{this.getAll().forEach(o=>{o.onFocus()})})}onOnline(){lt.batch(()=>{this.getAll().forEach(o=>{o.onOnline()})})}},sr=new WeakMap,ah),Ke,Jr,Xr,Ps,Ms,en,Rs,Os,ch,t0=(ch=class{constructor(s={}){ve(this,Ke);ve(this,Jr);ve(this,Xr);ve(this,Ps);ve(this,Ms);ve(this,en);ve(this,Rs);ve(this,Os);re(this,Ke,s.queryCache||new e0),re(this,Jr,s.mutationCache||new Xg),re(this,Xr,s.defaultOptions||{}),re(this,Ps,new Map),re(this,Ms,new Map),re(this,en,0)}mount(){ni(this,en)._++,S(this,en)===1&&(re(this,Rs,cd.subscribe(async s=>{s&&(await this.resumePausedMutations(),S(this,Ke).onFocus())})),re(this,Os,vi.subscribe(async s=>{s&&(await this.resumePausedMutations(),S(this,Ke).onOnline())})))}unmount(){var s,o;ni(this,en)._--,S(this,en)===0&&((s=S(this,Rs))==null||s.call(this),re(this,Rs,void 0),(o=S(this,Os))==null||o.call(this),re(this,Os,void 0))}isFetching(s){return S(this,Ke).findAll({...s,fetchStatus:"fetching"}).length}isMutating(s){return S(this,Jr).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),c=i.state.data;return c===void 0?this.fetchQuery(s):(s.revalidateIfStale&&i.isStaleByTime(tn(o.staleTime,i))&&this.prefetchQuery(o),Promise.resolve(c))}getQueriesData(s){return S(this,Ke).findAll(s).map(({queryKey:o,state:i})=>{const c=i.data;return[o,c]})}setQueryData(s,o,i){const c=this.defaultQueryOptions({queryKey:s}),u=S(this,Ke).get(c.queryHash),f=u==null?void 0:u.state.data,m=Ag(o,f);if(m!==void 0)return S(this,Ke).build(this,c).setData(m,{...i,manual:!0})}setQueriesData(s,o,i){return lt.batch(()=>S(this,Ke).findAll(s).map(({queryKey:c})=>[c,this.setQueryData(c,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);lt.batch(()=>{o.findAll(s).forEach(i=>{o.remove(i)})})}resetQueries(s,o){const i=S(this,Ke);return lt.batch(()=>(i.findAll(s).forEach(c=>{c.reset()}),this.refetchQueries({type:"active",...s},o)))}cancelQueries(s,o={}){const i={revert:!0,...o},c=lt.batch(()=>S(this,Ke).findAll(s).map(u=>u.cancel(i)));return Promise.all(c).then(Nt).catch(Nt)}invalidateQueries(s,o={}){return lt.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},c=lt.batch(()=>S(this,Ke).findAll(s).filter(u=>!u.isDisabled()&&!u.isStatic()).map(u=>{let f=u.fetch(void 0,i);return i.throwOnError||(f=f.catch(Nt)),u.state.fetchStatus==="paused"?Promise.resolve():f}));return Promise.all(c).then(Nt)}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(tn(o.staleTime,i))?i.fetch(o):Promise.resolve(i.state.data)}prefetchQuery(s){return this.fetchQuery(s).then(Nt).catch(Nt)}fetchInfiniteQuery(s){return s._type="infinite",this.fetchQuery(s)}prefetchInfiniteQuery(s){return this.fetchInfiniteQuery(s).then(Nt).catch(Nt)}ensureInfiniteQueryData(s){return s._type="infinite",this.ensureQueryData(s)}resumePausedMutations(){return vi.isOnline()?S(this,Jr).resumePausedMutations():Promise.resolve()}getQueryCache(){return S(this,Ke)}getMutationCache(){return S(this,Jr)}getDefaultOptions(){return S(this,Xr)}setDefaultOptions(s){re(this,Xr,s)}setQueryDefaults(s,o){S(this,Ps).set(Ro(s),{queryKey:s,defaultOptions:o})}getQueryDefaults(s){const o=[...S(this,Ps).values()],i={};return o.forEach(c=>{Oo(s,c.queryKey)&&Object.assign(i,c.defaultOptions)}),i}setMutationDefaults(s,o){S(this,Ms).set(Ro(s),{mutationKey:s,defaultOptions:o})}getMutationDefaults(s){const o=[...S(this,Ms).values()],i={};return o.forEach(c=>{Oo(s,c.mutationKey)&&Object.assign(i,c.defaultOptions)}),i}defaultQueryOptions(s){if(s._defaulted)return s;const o={...S(this,Xr).queries,...this.getQueryDefaults(s.queryKey),...s,_defaulted:!0};return o.queryHash||(o.queryHash=dd(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===ud&&(o.enabled=!1),o}defaultMutationOptions(s){return s!=null&&s._defaulted?s:{...S(this,Xr).mutations,...(s==null?void 0:s.mutationKey)&&this.getMutationDefaults(s.mutationKey),...s,_defaulted:!0}}clear(){S(this,Ke).clear(),S(this,Jr).clear()}},Ke=new WeakMap,Jr=new WeakMap,Xr=new WeakMap,Ps=new WeakMap,Ms=new WeakMap,en=new WeakMap,Rs=new WeakMap,Os=new WeakMap,ch),kh=g.createContext(void 0),ln=s=>{const o=g.useContext(kh);if(!o)throw new Error("No QueryClient set, use QueryClientProvider to set one");return o},r0=({client:s,children:o})=>(g.useEffect(()=>(s.mount(),()=>{s.unmount()}),[s]),r.jsx(kh.Provider,{value:s,children:o})),Nh=g.createContext(!1),n0=()=>g.useContext(Nh);Nh.Provider;function s0(){let s=!1;return{clearReset:()=>{s=!1},reset:()=>{s=!0},isReset:()=>s}}var o0=g.createContext(s0()),l0=()=>g.useContext(o0),i0=(s,o,i)=>{const c=i!=null&&i.state.error&&typeof s.throwOnError=="function"?xh(s.throwOnError,[i.state.error,i]):s.throwOnError;(s.suspense||s.experimental_prefetchInRender||c)&&(o.isReset()||(s.retryOnMount=!1))},a0=s=>{g.useEffect(()=>{s.clearReset()},[s])},c0=({result:s,errorResetBoundary:o,throwOnError:i,query:c,suspense:u})=>s.isError&&!o.isReset()&&!s.isFetching&&c&&(u&&s.data===void 0||xh(i,[s.error,c])),d0=s=>{if(s.suspense){const i=u=>u==="static"?u:Math.max(u??1e3,1e3),c=s.staleTime;s.staleTime=typeof c=="function"?(...u)=>i(c(...u)):i(c),typeof s.gcTime=="number"&&(s.gcTime=Math.max(s.gcTime,1e3))}},u0=(s,o)=>s.isLoading&&s.isFetching&&!o,f0=(s,o)=>(s==null?void 0:s.suspense)&&o.isPending,Cp=(s,o,i)=>o.fetchOptimistic(s).catch(()=>{i.clearReset()});function p0(s,o,i){var O,I,j,N;const c=n0(),u=l0(),f=ln(),m=f.defaultQueryOptions(s);(I=(O=f.getDefaultOptions().queries)==null?void 0:O._experimental_beforeQuery)==null||I.call(O,m);const p=f.getQueryCache().get(m.queryHash),v=s.subscribed!==!1;m._optimisticResults=c?"isRestoring":v?"optimistic":void 0,d0(m),i0(m,u,p),a0(u);const x=!f.getQueryCache().get(m.queryHash),[b]=g.useState(()=>new o(f,m)),w=b.getOptimisticResult(m),P=!c&&v;if(g.useSyncExternalStore(g.useCallback(M=>{const R=P?b.subscribe(lt.batchCalls(M)):Nt;return b.updateResult(),R},[b,P]),()=>b.getCurrentResult(),()=>b.getCurrentResult()),g.useEffect(()=>{b.setOptions(m)},[m,b]),f0(m,w))throw Cp(m,b,u);if(c0({result:w,errorResetBoundary:u,throwOnError:m.throwOnError,query:p,suspense:m.suspense}))throw w.error;if((N=(j=f.getDefaultOptions().queries)==null?void 0:j._experimental_afterQuery)==null||N.call(j,m,w),m.experimental_prefetchInRender&&!Do.isServer()&&u0(w,c)){const M=x?Cp(m,b,u):p==null?void 0:p.promise;M==null||M.catch(Nt).finally(()=>{b.updateResult()})}return m.notifyOnChangeProps?w:b.trackResult(w)}function Dt(s,o){return p0(s,Qg)}/**
* @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=s=>s.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Sh=(...s)=>s.filter((o,i,c)=>!!o&&o.trim()!==""&&c.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 m0={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 x0=g.forwardRef(({color:s="currentColor",size:o=24,strokeWidth:i=2,absoluteStrokeWidth:c,className:u="",children:f,iconNode:m,...p},v)=>g.createElement("svg",{ref:v,...m0,width:o,height:o,stroke:s,strokeWidth:c?Number(i)*24/Number(o):i,className:Sh("lucide",u),...p},[...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 he=(s,o)=>{const i=g.forwardRef(({className:c,...u},f)=>g.createElement(x0,{ref:f,iconNode:o,className:Sh(`lucide-${h0(s)}`,c),...u}));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 To=he("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 Ep=he("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 Ch=he("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 Ao=he("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 g0=he("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 zo=he("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 nn=he("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 v0=he("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 y0=he("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 b0=he("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 w0=he("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 j0=he("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 k0=he("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 Kc=he("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 N0=he("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 S0=he("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 Qc=he("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 C0=he("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 Eh=he("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=he("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 An=he("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 yi=he("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 _p=he("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 qc=he("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 E0=he("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 _0=he("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 Zc=he("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 P0=he("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 M0=he("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 Lo=he("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 R0=he("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 O0=he("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/**
* @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=he("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
* @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=he("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 A0=he("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 _h=he("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=he("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 Tn=he("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 z0=he("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 L0=he("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 pd=he("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 I0=he("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 F0=he("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 Ds=he("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 U0=he("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 Mh=he("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 $0=he("Tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const bi=he("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 Yc=he("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 Jc=he("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 B0=he("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 Io=he("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 sn=he("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
* @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 wi=he("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),Xc=[{id:"dashboard",label:"Zentrale",hint:"System- & Stack-Status",icon:R0},{id:"models",label:"Modell-Manager",hint:"Verwalten, laden & Gateway-Routing",icon:g0},{id:"system",label:"Diagnose",hint:"Metriken, Dienste, Logs",icon:Ot},{id:"memory",label:"Gedächtnis",hint:"Geteiltes Memory verwalten",icon:zo},{id:"connect",label:"Verbinden",hint:"IDE-/Agent-Configs erzeugen",icon:A0},{id:"agent",label:"Hermes",hint:"Agent-Status & WebUI öffnen",icon:Ao},{id:"guide",label:"Anleitung",hint:"Einrichten & Vibe-Coding",icon:j0}];var Pp=1,V0=.9,H0=.8,W0=.17,wc=.1,jc=.999,G0=.9999,K0=.99,Q0=/[\\\/_+.#"@\[\(\{&]/,q0=/[\\\/_+.#"@\[\(\{&]/g,Z0=/[\s-]/,Rh=/[\s-]/g;function ed(s,o,i,c,u,f,m){if(f===o.length)return u===s.length?Pp:K0;var p=`${u},${f}`;if(m[p]!==void 0)return m[p];for(var v=c.charAt(f),x=i.indexOf(v,u),b=0,w,P,O,I;x>=0;)w=ed(s,o,i,c,x+1,f+1,m),w>b&&(x===u?w*=Pp:Q0.test(s.charAt(x-1))?(w*=H0,O=s.slice(u,x-1).match(q0),O&&u>0&&(w*=Math.pow(jc,O.length))):Z0.test(s.charAt(x-1))?(w*=V0,I=s.slice(u,x-1).match(Rh),I&&u>0&&(w*=Math.pow(jc,I.length))):(w*=W0,u>0&&(w*=Math.pow(jc,x-u))),s.charAt(x)!==o.charAt(f)&&(w*=G0)),(w<wc&&i.charAt(x-1)===c.charAt(f+1)||c.charAt(f+1)===c.charAt(f)&&i.charAt(x-1)!==c.charAt(f))&&(P=ed(s,o,i,c,x+1,f+2,m),P*wc>w&&(w=P*wc)),w>b&&(b=w),x=i.indexOf(v,x+1);return m[p]=b,b}function Mp(s){return s.toLowerCase().replace(Rh," ")}function Y0(s,o,i){return s=i&&i.length>0?`${s+" "+i.join(" ")}`:s,ed(s,o,Mp(s),Mp(o),0,0,{})}function rn(s,o,{checkForDefaultPrevented:i=!0}={}){return function(u){if(s==null||s(u),i===!1||!u.defaultPrevented)return o==null?void 0:o(u)}}function Rp(s,o){if(typeof s=="function")return s(o);s!=null&&(s.current=o)}function Ts(...s){return o=>{let i=!1;const c=s.map(u=>{const f=Rp(u,o);return!i&&typeof f=="function"&&(i=!0),f});if(i)return()=>{for(let u=0;u<c.length;u++){const f=c[u];typeof f=="function"?f():Rp(s[u],null)}}}}function Ln(...s){return g.useCallback(Ts(...s),s)}function J0(s,o=[]){let i=[];function c(f,m){const p=g.createContext(m);p.displayName=f+"Context";const v=i.length;i=[...i,m];const x=w=>{var M;const{scope:P,children:O,...I}=w,j=((M=P==null?void 0:P[s])==null?void 0:M[v])||p,N=g.useMemo(()=>I,Object.values(I));return r.jsx(j.Provider,{value:N,children:O})};x.displayName=f+"Provider";function b(w,P){var j;const O=((j=P==null?void 0:P[s])==null?void 0:j[v])||p,I=g.useContext(O);if(I)return I;if(m!==void 0)return m;throw new Error(`\`${w}\` must be used within \`${f}\``)}return[x,b]}const u=()=>{const f=i.map(m=>g.createContext(m));return function(p){const v=(p==null?void 0:p[s])||f;return g.useMemo(()=>({[`__scope${s}`]:{...p,[s]:v}}),[p,v])}};return u.scopeName=s,[c,X0(u,...o)]}function X0(...s){const o=s[0];if(s.length===1)return o;const i=()=>{const c=s.map(u=>({useScope:u(),scopeName:u.scopeName}));return function(f){const m=c.reduce((p,{useScope:v,scopeName:x})=>{const w=v(f)[`__scope${x}`];return{...p,...w}},{});return g.useMemo(()=>({[`__scope${o.scopeName}`]:m}),[m])}};return i.scopeName=o.scopeName,i}var Fo=globalThis!=null&&globalThis.document?g.useLayoutEffect:()=>{},ev=ad[" useId ".trim().toString()]||(()=>{}),tv=0;function br(s){const[o,i]=g.useState(ev());return Fo(()=>{i(c=>c??String(tv++))},[s]),o?`radix-${o}`:""}var rv=ad[" useInsertionEffect ".trim().toString()]||Fo;function nv({prop:s,defaultProp:o,onChange:i=()=>{},caller:c}){const[u,f,m]=sv({defaultProp:o,onChange:i}),p=s!==void 0,v=p?s:u;{const b=g.useRef(s!==void 0);g.useEffect(()=>{const w=b.current;w!==p&&console.warn(`${c} is changing from ${w?"controlled":"uncontrolled"} to ${p?"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=p},[p,c])}const x=g.useCallback(b=>{var w;if(p){const P=ov(b)?b(s):b;P!==s&&((w=m.current)==null||w.call(m,P))}else f(b)},[p,s,f,m]);return[v,x]}function sv({defaultProp:s,onChange:o}){const[i,c]=g.useState(s),u=g.useRef(i),f=g.useRef(o);return rv(()=>{f.current=o},[o]),g.useEffect(()=>{var m;u.current!==i&&((m=f.current)==null||m.call(f,i),u.current=i)},[i,u]),[i,c,f]}function ov(s){return typeof s=="function"}var Oh=fh();function Dh(s){const o=g.forwardRef((i,c)=>{let{children:u,...f}=i,m=null,p=!1;const v=[];Op(u)&&typeof li=="function"&&(u=li(u._payload)),g.Children.forEach(u,P=>{var O;if(dv(P)){p=!0;const I=P;let j="child"in I.props?I.props.child:I.props.children;Op(j)&&typeof li=="function"&&(j=li(j._payload)),m=iv(I,j),v.push((O=m==null?void 0:m.props)==null?void 0:O.children)}else v.push(P)}),m?m=g.cloneElement(m,void 0,v):!p&&g.Children.count(u)===1&&g.isValidElement(u)&&(m=u);const x=m?cv(m):void 0,b=Ln(c,x);if(!m){if(u||u===0)throw new Error(p?hv(s):pv(s));return u}const w=av(f,m.props??{});return m.type!==g.Fragment&&(w.ref=c?b:x),g.cloneElement(m,w)});return o.displayName=`${s}.Slot`,o}var lv=Symbol.for("radix.slottable"),iv=(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 av(s,o){const i={...o};for(const c in o){const u=s[c],f=o[c];/^on[A-Z]/.test(c)?u&&f?i[c]=(...p)=>{const v=f(...p);return u(...p),v}:u&&(i[c]=u):c==="style"?i[c]={...u,...f}:c==="className"&&(i[c]=[u,f].filter(Boolean).join(" "))}return{...s,...i}}function cv(s){var c,u;let o=(c=Object.getOwnPropertyDescriptor(s.props,"ref"))==null?void 0:c.get,i=o&&"isReactWarning"in o&&o.isReactWarning;return i?s.ref:(o=(u=Object.getOwnPropertyDescriptor(s,"ref"))==null?void 0:u.get,i=o&&"isReactWarning"in o&&o.isReactWarning,i?s.props.ref:s.props.ref||s.ref)}function dv(s){return g.isValidElement(s)&&typeof s.type=="function"&&"__radixId"in s.type&&s.type.__radixId===lv}var uv=Symbol.for("react.lazy");function Op(s){return s!=null&&typeof s=="object"&&"$$typeof"in s&&s.$$typeof===uv&&"_payload"in s&&fv(s._payload)}function fv(s){return typeof s=="object"&&s!==null&&"then"in s}var pv=s=>`${s} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,hv=s=>`${s} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,li=ad[" use ".trim().toString()],mv=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],it=mv.reduce((s,o)=>{const i=Dh(`Primitive.${o}`),c=g.forwardRef((u,f)=>{const{asChild:m,...p}=u,v=m?i:o;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),r.jsx(v,{...p,ref:f})});return c.displayName=`Primitive.${o}`,{...s,[o]:c}},{});function xv(s,o){s&&Oh.flushSync(()=>s.dispatchEvent(o))}function Uo(s){const o=g.useRef(s);return g.useEffect(()=>{o.current=s}),g.useMemo(()=>((...i)=>{var c;return(c=o.current)==null?void 0:c.call(o,...i)}),[])}function gv(s,o=globalThis==null?void 0:globalThis.document){const i=Uo(s);g.useEffect(()=>{const c=u=>{u.key==="Escape"&&i(u)};return o.addEventListener("keydown",c,{capture:!0}),()=>o.removeEventListener("keydown",c,{capture:!0})},[i,o])}var vv="DismissableLayer",td="dismissableLayer.update",yv="dismissableLayer.pointerDownOutside",bv="dismissableLayer.focusOutside",Dp,hd=g.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Th=g.forwardRef((s,o)=>{const{disableOutsidePointerEvents:i=!1,deferPointerDownOutside:c=!1,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:m,onInteractOutside:p,onDismiss:v,...x}=s,b=g.useContext(hd),[w,P]=g.useState(null),O=(w==null?void 0:w.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,I]=g.useState({}),j=Ln(o,ne=>P(ne)),N=Array.from(b.layers),[M]=[...b.layersWithOutsidePointerEventsDisabled].slice(-1),R=N.indexOf(M),B=w?N.indexOf(w):-1,L=b.layersWithOutsidePointerEventsDisabled.size>0,T=B>=R,$=g.useRef(!1),V=Nv(ne=>{const fe=ne.target;if(!(fe instanceof Node))return;const je=[...b.branches].some(ue=>ue.contains(fe));!T||je||(f==null||f(ne),p==null||p(ne),ne.defaultPrevented||v==null||v())},{ownerDocument:O,deferPointerDownOutside:c,isDeferredPointerDownOutsideRef:$,dismissableSurfaces:b.dismissableSurfaces}),ee=Sv(ne=>{if(c&&$.current)return;const fe=ne.target;[...b.branches].some(ue=>ue.contains(fe))||(m==null||m(ne),p==null||p(ne),ne.defaultPrevented||v==null||v())},O);return gv(ne=>{B===b.layers.size-1&&(u==null||u(ne),!ne.defaultPrevented&&v&&(ne.preventDefault(),v()))},O),g.useEffect(()=>{if(w)return i&&(b.layersWithOutsidePointerEventsDisabled.size===0&&(Dp=O.body.style.pointerEvents,O.body.style.pointerEvents="none"),b.layersWithOutsidePointerEventsDisabled.add(w)),b.layers.add(w),Tp(),()=>{i&&(b.layersWithOutsidePointerEventsDisabled.delete(w),b.layersWithOutsidePointerEventsDisabled.size===0&&(O.body.style.pointerEvents=Dp))}},[w,O,i,b]),g.useEffect(()=>()=>{w&&(b.layers.delete(w),b.layersWithOutsidePointerEventsDisabled.delete(w),Tp())},[w,b]),g.useEffect(()=>{const ne=()=>I({});return document.addEventListener(td,ne),()=>document.removeEventListener(td,ne)},[]),r.jsx(it.div,{...x,ref:j,style:{pointerEvents:L?T?"auto":"none":void 0,...s.style},onFocusCapture:rn(s.onFocusCapture,ee.onFocusCapture),onBlurCapture:rn(s.onBlurCapture,ee.onBlurCapture),onPointerDownCapture:rn(s.onPointerDownCapture,V.onPointerDownCapture)})});Th.displayName=vv;var wv="DismissableLayerBranch",jv=g.forwardRef((s,o)=>{const i=g.useContext(hd),c=g.useRef(null),u=Ln(o,c);return g.useEffect(()=>{const f=c.current;if(f)return i.branches.add(f),()=>{i.branches.delete(f)}},[i.branches]),r.jsx(it.div,{...s,ref:u})});jv.displayName=wv;function kv(){const s=g.useContext(hd),[o,i]=g.useState(null);return g.useEffect(()=>{if(o)return s.dismissableSurfaces.add(o),()=>{s.dismissableSurfaces.delete(o)}},[o,s.dismissableSurfaces]),i}function Nv(s,o){const{ownerDocument:i=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:c=!1,isDeferredPointerDownOutsideRef:u,dismissableSurfaces:f}=o,m=Uo(s),p=g.useRef(!1),v=g.useRef(!1),x=g.useRef(new Map),b=g.useRef(()=>{});return g.useEffect(()=>{function w(){v.current=!1,u.current=!1,x.current.clear()}function P(){return Array.from(x.current.values()).some(Boolean)}function O(R){if(!v.current)return;const B=R.target;B instanceof Node&&[...f].some(T=>T.contains(B))||x.current.set(R.type,!0),R.type==="click"&&window.setTimeout(()=>{v.current&&b.current()},0)}function I(R){v.current&&x.current.set(R.type,!1)}const j=R=>{if(R.target&&!p.current){let B=function(){i.removeEventListener("click",b.current);const T=P();w(),T||Ah(yv,m,L,{discrete:!0})};const L={originalEvent:R};v.current=!0,u.current=c&&R.button===0,x.current.clear(),!c||R.button!==0?B():(i.removeEventListener("click",b.current),b.current=B,i.addEventListener("click",b.current,{once:!0}))}else i.removeEventListener("click",b.current),w();p.current=!1},N=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const R of N)i.addEventListener(R,O,!0),i.addEventListener(R,I);const M=window.setTimeout(()=>{i.addEventListener("pointerdown",j)},0);return()=>{window.clearTimeout(M),i.removeEventListener("pointerdown",j),i.removeEventListener("click",b.current);for(const R of N)i.removeEventListener(R,O,!0),i.removeEventListener(R,I)}},[i,m,c,u,f]),{onPointerDownCapture:()=>p.current=!0}}function Sv(s,o=globalThis==null?void 0:globalThis.document){const i=Uo(s),c=g.useRef(!1);return g.useEffect(()=>{const u=f=>{f.target&&!c.current&&Ah(bv,i,{originalEvent:f},{discrete:!1})};return o.addEventListener("focusin",u),()=>o.removeEventListener("focusin",u)},[o,i]),{onFocusCapture:()=>c.current=!0,onBlurCapture:()=>c.current=!1}}function Tp(){const s=new CustomEvent(td);document.dispatchEvent(s)}function Ah(s,o,i,{discrete:c}){const u=i.originalEvent.target,f=new CustomEvent(s,{bubbles:!1,cancelable:!0,detail:i});o&&u.addEventListener(s,o,{once:!0}),c?xv(u,f):u.dispatchEvent(f)}var kc="focusScope.autoFocusOnMount",Nc="focusScope.autoFocusOnUnmount",Ap={bubbles:!1,cancelable:!0},Cv="FocusScope",zh=g.forwardRef((s,o)=>{const{loop:i=!1,trapped:c=!1,onMountAutoFocus:u,onUnmountAutoFocus:f,...m}=s,[p,v]=g.useState(null),x=Uo(u),b=Uo(f),w=g.useRef(null),P=Ln(o,j=>v(j)),O=g.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;g.useEffect(()=>{if(c){let j=function(B){if(O.paused||!p)return;const L=B.target;p.contains(L)?w.current=L:Gr(w.current,{select:!0})},N=function(B){if(O.paused||!p)return;const L=B.relatedTarget;L!==null&&(p.contains(L)||Gr(w.current,{select:!0}))},M=function(B){if(document.activeElement===document.body)for(const T of B)T.removedNodes.length>0&&Gr(p)};document.addEventListener("focusin",j),document.addEventListener("focusout",N);const R=new MutationObserver(M);return p&&R.observe(p,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",j),document.removeEventListener("focusout",N),R.disconnect()}}},[c,p,O.paused]),g.useEffect(()=>{if(p){Lp.add(O);const j=document.activeElement;if(!p.contains(j)){const M=new CustomEvent(kc,Ap);p.addEventListener(kc,x),p.dispatchEvent(M),M.defaultPrevented||(Ev(Ov(Lh(p)),{select:!0}),document.activeElement===j&&Gr(p))}return()=>{p.removeEventListener(kc,x),setTimeout(()=>{const M=new CustomEvent(Nc,Ap);p.addEventListener(Nc,b),p.dispatchEvent(M),M.defaultPrevented||Gr(j??document.body,{select:!0}),p.removeEventListener(Nc,b),Lp.remove(O)},0)}}},[p,x,b,O]);const I=g.useCallback(j=>{if(!i&&!c||O.paused)return;const N=j.key==="Tab"&&!j.altKey&&!j.ctrlKey&&!j.metaKey,M=document.activeElement;if(N&&M){const R=j.currentTarget,[B,L]=_v(R);B&&L?!j.shiftKey&&M===L?(j.preventDefault(),i&&Gr(B,{select:!0})):j.shiftKey&&M===B&&(j.preventDefault(),i&&Gr(L,{select:!0})):M===R&&j.preventDefault()}},[i,c,O.paused]);return r.jsx(it.div,{tabIndex:-1,...m,ref:P,onKeyDown:I})});zh.displayName=Cv;function Ev(s,{select:o=!1}={}){const i=document.activeElement;for(const c of s)if(Gr(c,{select:o}),document.activeElement!==i)return}function _v(s){const o=Lh(s),i=zp(o,s),c=zp(o.reverse(),s);return[i,c]}function Lh(s){const o=[],i=document.createTreeWalker(s,NodeFilter.SHOW_ELEMENT,{acceptNode:c=>{const u=c.tagName==="INPUT"&&c.type==="hidden";return c.disabled||c.hidden||u?NodeFilter.FILTER_SKIP:c.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;i.nextNode();)o.push(i.currentNode);return o}function zp(s,o){for(const i of s)if(!Pv(i,{upTo:o}))return i}function Pv(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 Mv(s){return s instanceof HTMLInputElement&&"select"in s}function Gr(s,{select:o=!1}={}){if(s&&s.focus){const i=document.activeElement;s.focus({preventScroll:!0}),s!==i&&Mv(s)&&o&&s.select()}}var Lp=Rv();function Rv(){let s=[];return{add(o){const i=s[0];o!==i&&(i==null||i.pause()),s=Ip(s,o),s.unshift(o)},remove(o){var i;s=Ip(s,o),(i=s[0])==null||i.resume()}}}function Ip(s,o){const i=[...s],c=i.indexOf(o);return c!==-1&&i.splice(c,1),i}function Ov(s){return s.filter(o=>o.tagName!=="A")}var Dv="Portal",Ih=g.forwardRef((s,o)=>{var p;const{container:i,...c}=s,[u,f]=g.useState(!1);Fo(()=>f(!0),[]);const m=i||u&&((p=globalThis==null?void 0:globalThis.document)==null?void 0:p.body);return m?Oh.createPortal(r.jsx(it.div,{...c,ref:o}),m):null});Ih.displayName=Dv;function Tv(s,o){return g.useReducer((i,c)=>o[i][c]??i,s)}var ki=s=>{const{present:o,children:i}=s,c=Av(o),u=typeof i=="function"?i({present:c.isPresent}):g.Children.only(i),f=zv(c.ref,Lv(u));return typeof i=="function"||c.isPresent?g.cloneElement(u,{ref:f}):null};ki.displayName="Presence";function Av(s){const[o,i]=g.useState(),c=g.useRef(null),u=g.useRef(s),f=g.useRef("none"),m=s?"mounted":"unmounted",[p,v]=Tv(m,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return g.useEffect(()=>{const x=ii(c.current);f.current=p==="mounted"?x:"none"},[p]),Fo(()=>{const x=c.current,b=u.current;if(b!==s){const P=f.current,O=ii(x);s?v("MOUNT"):O==="none"||(x==null?void 0:x.display)==="none"?v("UNMOUNT"):v(b&&P!==O?"ANIMATION_OUT":"UNMOUNT"),u.current=s}},[s,v]),Fo(()=>{if(o){let x;const b=o.ownerDocument.defaultView??window,w=O=>{const j=ii(c.current).includes(CSS.escape(O.animationName));if(O.target===o&&j&&(v("ANIMATION_END"),!u.current)){const N=o.style.animationFillMode;o.style.animationFillMode="forwards",x=b.setTimeout(()=>{o.style.animationFillMode==="forwards"&&(o.style.animationFillMode=N)})}},P=O=>{O.target===o&&(f.current=ii(c.current))};return o.addEventListener("animationstart",P),o.addEventListener("animationcancel",w),o.addEventListener("animationend",w),()=>{b.clearTimeout(x),o.removeEventListener("animationstart",P),o.removeEventListener("animationcancel",w),o.removeEventListener("animationend",w)}}else v("ANIMATION_END")},[o,v]),{isPresent:["mounted","unmountSuspended"].includes(p),ref:g.useCallback(x=>{c.current=x?getComputedStyle(x):null,i(x)},[])}}function Fp(s,o){if(typeof s=="function")return s(o);s!=null&&(s.current=o)}function zv(...s){const o=g.useRef(s);return o.current=s,g.useCallback(i=>{const c=o.current;let u=!1;const f=c.map(m=>{const p=Fp(m,i);return!u&&typeof p=="function"&&(u=!0),p});if(u)return()=>{for(let m=0;m<f.length;m++){const p=f[m];typeof p=="function"?p():Fp(c[m],null)}}},[])}function ii(s){return(s==null?void 0:s.animationName)||"none"}function Lv(s){var c,u;let o=(c=Object.getOwnPropertyDescriptor(s.props,"ref"))==null?void 0:c.get,i=o&&"isReactWarning"in o&&o.isReactWarning;return i?s.ref:(o=(u=Object.getOwnPropertyDescriptor(s,"ref"))==null?void 0:u.get,i=o&&"isReactWarning"in o&&o.isReactWarning,i?s.props.ref:s.props.ref||s.ref)}var ai=0,tr=null;function Iv(){g.useEffect(()=>{tr||(tr={start:Up(),end:Up()});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),ai++,()=>{ai===1&&(tr==null||tr.start.remove(),tr==null||tr.end.remove(),tr=null),ai=Math.max(0,ai-1)}},[])}function Up(){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,c=1,u=arguments.length;c<u;c++){i=arguments[c];for(var f in i)Object.prototype.hasOwnProperty.call(i,f)&&(o[f]=i[f])}return o},or.apply(this,arguments)};function Fh(s,o){var i={};for(var c in s)Object.prototype.hasOwnProperty.call(s,c)&&o.indexOf(c)<0&&(i[c]=s[c]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function")for(var u=0,c=Object.getOwnPropertySymbols(s);u<c.length;u++)o.indexOf(c[u])<0&&Object.prototype.propertyIsEnumerable.call(s,c[u])&&(i[c[u]]=s[c[u]]);return i}function Fv(s,o,i){if(i||arguments.length===2)for(var c=0,u=o.length,f;c<u;c++)(f||!(c in o))&&(f||(f=Array.prototype.slice.call(o,0,c)),f[c]=o[c]);return s.concat(f||Array.prototype.slice.call(o))}var xi="right-scroll-bar-position",gi="width-before-scroll-bar",Uv="with-scroll-bars-hidden",$v="--removed-body-scroll-bar-size";function Sc(s,o){return typeof s=="function"?s(o):s&&(s.current=o),s}function Bv(s,o){var i=g.useState(function(){return{value:s,callback:o,facade:{get current(){return i.value},set current(c){var u=i.value;u!==c&&(i.value=c,i.callback(c,u))}}}})[0];return i.callback=o,i.facade}var Vv=typeof window<"u"?g.useLayoutEffect:g.useEffect,$p=new WeakMap;function Hv(s,o){var i=Bv(null,function(c){return s.forEach(function(u){return Sc(u,c)})});return Vv(function(){var c=$p.get(i);if(c){var u=new Set(c),f=new Set(s),m=i.current;u.forEach(function(p){f.has(p)||Sc(p,null)}),f.forEach(function(p){u.has(p)||Sc(p,m)})}$p.set(i,s)},[s]),i}function Wv(s){return s}function Gv(s,o){o===void 0&&(o=Wv);var i=[],c=!1,u={read:function(){if(c)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,c);return i.push(m),function(){i=i.filter(function(p){return p!==m})}},assignSyncMedium:function(f){for(c=!0;i.length;){var m=i;i=[],m.forEach(f)}i={push:function(p){return f(p)},filter:function(){return i}}},assignMedium:function(f){c=!0;var m=[];if(i.length){var p=i;i=[],p.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 u}function Kv(s){s===void 0&&(s={});var o=Gv(null);return o.options=or({async:!0,ssr:!1},s),o}var Uh=function(s){var o=s.sideCar,i=Fh(s,["sideCar"]);if(!o)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var c=o.read();if(!c)throw new Error("Sidecar medium not found");return g.createElement(c,or({},i))};Uh.isSideCarExport=!0;function Qv(s,o){return s.useMedium(o),Uh}var $h=Kv(),Cc=function(){},Ni=g.forwardRef(function(s,o){var i=g.useRef(null),c=g.useState({onScrollCapture:Cc,onWheelCapture:Cc,onTouchMoveCapture:Cc}),u=c[0],f=c[1],m=s.forwardProps,p=s.children,v=s.className,x=s.removeScrollBar,b=s.enabled,w=s.shards,P=s.sideCar,O=s.noRelative,I=s.noIsolation,j=s.inert,N=s.allowPinchZoom,M=s.as,R=M===void 0?"div":M,B=s.gapMode,L=Fh(s,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),T=P,$=Hv([i,o]),V=or(or({},L),u);return g.createElement(g.Fragment,null,b&&g.createElement(T,{sideCar:$h,removeScrollBar:x,shards:w,noRelative:O,noIsolation:I,inert:j,setCallbacks:f,allowPinchZoom:!!N,lockRef:i,gapMode:B}),m?g.cloneElement(g.Children.only(p),or(or({},V),{ref:$})):g.createElement(R,or({},V,{className:v,ref:$}),p))});Ni.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Ni.classNames={fullWidth:gi,zeroRight:xi};var qv=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Zv(){if(!document)return null;var s=document.createElement("style");s.type="text/css";var o=qv();return o&&s.setAttribute("nonce",o),s}function Yv(s,o){s.styleSheet?s.styleSheet.cssText=o:s.appendChild(document.createTextNode(o))}function Jv(s){var o=document.head||document.getElementsByTagName("head")[0];o.appendChild(s)}var Xv=function(){var s=0,o=null;return{add:function(i){s==0&&(o=Zv())&&(Yv(o,i),Jv(o)),s++},remove:function(){s--,!s&&o&&(o.parentNode&&o.parentNode.removeChild(o),o=null)}}},ey=function(){var s=Xv();return function(o,i){g.useEffect(function(){return s.add(o),function(){s.remove()}},[o&&i])}},Bh=function(){var s=ey(),o=function(i){var c=i.styles,u=i.dynamic;return s(c,u),null};return o},ty={left:0,top:0,right:0,gap:0},Ec=function(s){return parseInt(s||"",10)||0},ry=function(s){var o=window.getComputedStyle(document.body),i=o[s==="padding"?"paddingLeft":"marginLeft"],c=o[s==="padding"?"paddingTop":"marginTop"],u=o[s==="padding"?"paddingRight":"marginRight"];return[Ec(i),Ec(c),Ec(u)]},ny=function(s){if(s===void 0&&(s="margin"),typeof window>"u")return ty;var o=ry(s),i=document.documentElement.clientWidth,c=window.innerWidth;return{left:o[0],top:o[1],right:o[2],gap:Math.max(0,c-i+o[2]-o[0])}},sy=Bh(),vs="data-scroll-locked",oy=function(s,o,i,c){var u=s.left,f=s.top,m=s.right,p=s.gap;return i===void 0&&(i="margin"),`
.`.concat(Uv,` {
overflow: hidden `).concat(c,`;
padding-right: `).concat(p,"px ").concat(c,`;
}
body[`).concat(vs,`] {
overflow: hidden `).concat(c,`;
overscroll-behavior: contain;
`).concat([o&&"position: relative ".concat(c,";"),i==="margin"&&`
padding-left: `.concat(u,`px;
padding-top: `).concat(f,`px;
padding-right: `).concat(m,`px;
margin-left:0;
margin-top:0;
margin-right: `).concat(p,"px ").concat(c,`;
`),i==="padding"&&"padding-right: ".concat(p,"px ").concat(c,";")].filter(Boolean).join(""),`
}
.`).concat(xi,` {
right: `).concat(p,"px ").concat(c,`;
}
.`).concat(gi,` {
margin-right: `).concat(p,"px ").concat(c,`;
}
.`).concat(xi," .").concat(xi,` {
right: 0 `).concat(c,`;
}
.`).concat(gi," .").concat(gi,` {
margin-right: 0 `).concat(c,`;
}
body[`).concat(vs,`] {
`).concat($v,": ").concat(p,`px;
}
`)},Bp=function(){var s=parseInt(document.body.getAttribute(vs)||"0",10);return isFinite(s)?s:0},ly=function(){g.useEffect(function(){return document.body.setAttribute(vs,(Bp()+1).toString()),function(){var s=Bp()-1;s<=0?document.body.removeAttribute(vs):document.body.setAttribute(vs,s.toString())}},[])},iy=function(s){var o=s.noRelative,i=s.noImportant,c=s.gapMode,u=c===void 0?"margin":c;ly();var f=g.useMemo(function(){return ny(u)},[u]);return g.createElement(sy,{styles:oy(f,!o,u,i?"":"!important")})},rd=!1;if(typeof window<"u")try{var ci=Object.defineProperty({},"passive",{get:function(){return rd=!0,!0}});window.addEventListener("test",ci,ci),window.removeEventListener("test",ci,ci)}catch{rd=!1}var fs=rd?{passive:!1}:!1,ay=function(s){return s.tagName==="TEXTAREA"},Vh=function(s,o){if(!(s instanceof Element))return!1;var i=window.getComputedStyle(s);return i[o]!=="hidden"&&!(i.overflowY===i.overflowX&&!ay(s)&&i[o]==="visible")},cy=function(s){return Vh(s,"overflowY")},dy=function(s){return Vh(s,"overflowX")},Vp=function(s,o){var i=o.ownerDocument,c=o;do{typeof ShadowRoot<"u"&&c instanceof ShadowRoot&&(c=c.host);var u=Hh(s,c);if(u){var f=Wh(s,c),m=f[1],p=f[2];if(m>p)return!0}c=c.parentNode}while(c&&c!==i.body);return!1},uy=function(s){var o=s.scrollTop,i=s.scrollHeight,c=s.clientHeight;return[o,i,c]},fy=function(s){var o=s.scrollLeft,i=s.scrollWidth,c=s.clientWidth;return[o,i,c]},Hh=function(s,o){return s==="v"?cy(o):dy(o)},Wh=function(s,o){return s==="v"?uy(o):fy(o)},py=function(s,o){return s==="h"&&o==="rtl"?-1:1},hy=function(s,o,i,c,u){var f=py(s,window.getComputedStyle(o).direction),m=f*c,p=i.target,v=o.contains(p),x=!1,b=m>0,w=0,P=0;do{if(!p)break;var O=Wh(s,p),I=O[0],j=O[1],N=O[2],M=j-N-f*I;(I||M)&&Hh(s,p)&&(w+=M,P+=I);var R=p.parentNode;p=R&&R.nodeType===Node.DOCUMENT_FRAGMENT_NODE?R.host:R}while(!v&&p!==document.body||v&&(o.contains(p)||o===p));return(b&&Math.abs(w)<1||!b&&Math.abs(P)<1)&&(x=!0),x},di=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},my=function(s,o){return s[0]===o[0]&&s[1]===o[1]},xy=function(s){return`
.block-interactivity-`.concat(s,` {pointer-events: none;}
.allow-interactivity-`).concat(s,` {pointer-events: all;}
`)},gy=0,ps=[];function vy(s){var o=g.useRef([]),i=g.useRef([0,0]),c=g.useRef(),u=g.useState(gy++)[0],f=g.useState(Bh)[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(u));var j=Fv([s.lockRef.current],(s.shards||[]).map(Wp),!0).filter(Boolean);return j.forEach(function(N){return N.classList.add("allow-interactivity-".concat(u))}),function(){document.body.classList.remove("block-interactivity-".concat(u)),j.forEach(function(N){return N.classList.remove("allow-interactivity-".concat(u))})}}},[s.inert,s.lockRef.current,s.shards]);var p=g.useCallback(function(j,N){if("touches"in j&&j.touches.length===2||j.type==="wheel"&&j.ctrlKey)return!m.current.allowPinchZoom;var M=di(j),R=i.current,B="deltaX"in j?j.deltaX:R[0]-M[0],L="deltaY"in j?j.deltaY:R[1]-M[1],T,$=j.target,V=Math.abs(B)>Math.abs(L)?"h":"v";if("touches"in j&&V==="h"&&$.type==="range")return!1;var ee=window.getSelection(),ne=ee&&ee.anchorNode,fe=ne?ne===$||ne.contains($):!1;if(fe)return!1;var je=Vp(V,$);if(!je)return!0;if(je?T=V:(T=V==="v"?"h":"v",je=Vp(V,$)),!je)return!1;if(!c.current&&"changedTouches"in j&&(B||L)&&(c.current=T),!T)return!0;var ue=c.current||T;return hy(ue,N,j,ue==="h"?B:L)},[]),v=g.useCallback(function(j){var N=j;if(!(!ps.length||ps[ps.length-1]!==f)){var M="deltaY"in N?Hp(N):di(N),R=o.current.filter(function(T){return T.name===N.type&&(T.target===N.target||N.target===T.shadowParent)&&my(T.delta,M)})[0];if(R&&R.should){N.cancelable&&N.preventDefault();return}if(!R){var B=(m.current.shards||[]).map(Wp).filter(Boolean).filter(function(T){return T.contains(N.target)}),L=B.length>0?p(N,B[0]):!m.current.noIsolation;L&&N.cancelable&&N.preventDefault()}}},[]),x=g.useCallback(function(j,N,M,R){var B={name:j,delta:N,target:M,should:R,shadowParent:yy(M)};o.current.push(B),setTimeout(function(){o.current=o.current.filter(function(L){return L!==B})},1)},[]),b=g.useCallback(function(j){i.current=di(j),c.current=void 0},[]),w=g.useCallback(function(j){x(j.type,Hp(j),j.target,p(j,s.lockRef.current))},[]),P=g.useCallback(function(j){x(j.type,di(j),j.target,p(j,s.lockRef.current))},[]);g.useEffect(function(){return ps.push(f),s.setCallbacks({onScrollCapture:w,onWheelCapture:w,onTouchMoveCapture:P}),document.addEventListener("wheel",v,fs),document.addEventListener("touchmove",v,fs),document.addEventListener("touchstart",b,fs),function(){ps=ps.filter(function(j){return j!==f}),document.removeEventListener("wheel",v,fs),document.removeEventListener("touchmove",v,fs),document.removeEventListener("touchstart",b,fs)}},[]);var O=s.removeScrollBar,I=s.inert;return g.createElement(g.Fragment,null,I?g.createElement(f,{styles:xy(u)}):null,O?g.createElement(iy,{noRelative:s.noRelative,gapMode:s.gapMode}):null)}function yy(s){for(var o=null;s!==null;)s instanceof ShadowRoot&&(o=s.host,s=s.host),s=s.parentNode;return o}const by=Qv($h,vy);var Gh=g.forwardRef(function(s,o){return g.createElement(Ni,or({},s,{ref:o,sideCar:by}))});Gh.classNames=Ni.classNames;var wy=function(s){if(typeof document>"u")return null;var o=Array.isArray(s)?s[0]:s;return o.ownerDocument.body},hs=new WeakMap,ui=new WeakMap,fi={},_c=0,Kh=function(s){return s&&(s.host||Kh(s.parentNode))},jy=function(s,o){return o.map(function(i){if(s.contains(i))return i;var c=Kh(i);return c&&s.contains(c)?c:(console.error("aria-hidden",i,"in not contained inside",s,". Doing nothing"),null)}).filter(function(i){return!!i})},ky=function(s,o,i,c){var u=jy(o,Array.isArray(s)?s:[s]);fi[i]||(fi[i]=new WeakMap);var f=fi[i],m=[],p=new Set,v=new Set(u),x=function(w){!w||p.has(w)||(p.add(w),x(w.parentNode))};u.forEach(x);var b=function(w){!w||v.has(w)||Array.prototype.forEach.call(w.children,function(P){if(p.has(P))b(P);else try{var O=P.getAttribute(c),I=O!==null&&O!=="false",j=(hs.get(P)||0)+1,N=(f.get(P)||0)+1;hs.set(P,j),f.set(P,N),m.push(P),j===1&&I&&ui.set(P,!0),N===1&&P.setAttribute(i,"true"),I||P.setAttribute(c,"true")}catch(M){console.error("aria-hidden: cannot operate on ",P,M)}})};return b(o),p.clear(),_c++,function(){m.forEach(function(w){var P=hs.get(w)-1,O=f.get(w)-1;hs.set(w,P),f.set(w,O),P||(ui.has(w)||w.removeAttribute(c),ui.delete(w)),O||w.removeAttribute(i)}),_c--,_c||(hs=new WeakMap,hs=new WeakMap,ui=new WeakMap,fi={})}},Ny=function(s,o,i){i===void 0&&(i="data-aria-hidden");var c=Array.from(Array.isArray(s)?s:[s]),u=wy(s);return u?(c.push.apply(c,Array.from(u.querySelectorAll("[aria-live], script"))),ky(c,u,i,"aria-hidden")):function(){return null}},Si="Dialog",[Qh]=J0(Si),[Sy,qt]=Qh(Si),qh=s=>{const{__scopeDialog:o,children:i,open:c,defaultOpen:u,onOpenChange:f,modal:m=!0}=s,p=g.useRef(null),v=g.useRef(null),[x,b]=nv({prop:c,defaultProp:u??!1,onChange:f,caller:Si});return r.jsx(Sy,{scope:o,triggerRef:p,contentRef:v,contentId:br(),titleId:br(),descriptionId:br(),open:x,onOpenChange:b,onOpenToggle:g.useCallback(()=>b(w=>!w),[b]),modal:m,children:i})};qh.displayName=Si;var Zh="DialogTrigger",Cy=g.forwardRef((s,o)=>{const{__scopeDialog:i,...c}=s,u=qt(Zh,i),f=Ln(o,u.triggerRef);return r.jsx(it.button,{type:"button","aria-haspopup":"dialog","aria-expanded":u.open,"aria-controls":u.open?u.contentId:void 0,"data-state":xd(u.open),...c,ref:f,onClick:rn(s.onClick,u.onOpenToggle)})});Cy.displayName=Zh;var md="DialogPortal",[Ey,Yh]=Qh(md,{forceMount:void 0}),Jh=s=>{const{__scopeDialog:o,forceMount:i,children:c,container:u}=s,f=qt(md,o);return r.jsx(Ey,{scope:o,forceMount:i,children:g.Children.map(c,m=>r.jsx(ki,{present:i||f.open,children:r.jsx(Ih,{asChild:!0,container:u,children:m})}))})};Jh.displayName=md;var ji="DialogOverlay",Xh=g.forwardRef((s,o)=>{const i=Yh(ji,s.__scopeDialog),{forceMount:c=i.forceMount,...u}=s,f=qt(ji,s.__scopeDialog);return f.modal?r.jsx(ki,{present:c||f.open,children:r.jsx(Py,{...u,ref:o})}):null});Xh.displayName=ji;var _y=Dh("DialogOverlay.RemoveScroll"),Py=g.forwardRef((s,o)=>{const{__scopeDialog:i,...c}=s,u=qt(ji,i),f=kv(),m=Ln(o,f);return r.jsx(Gh,{as:_y,allowPinchZoom:!0,shards:[u.contentRef],children:r.jsx(it.div,{"data-state":xd(u.open),...c,ref:m,style:{pointerEvents:"auto",...c.style}})})}),As="DialogContent",em=g.forwardRef((s,o)=>{const i=Yh(As,s.__scopeDialog),{forceMount:c=i.forceMount,...u}=s,f=qt(As,s.__scopeDialog);return r.jsx(ki,{present:c||f.open,children:f.modal?r.jsx(My,{...u,ref:o}):r.jsx(Ry,{...u,ref:o})})});em.displayName=As;var My=g.forwardRef((s,o)=>{const i=qt(As,s.__scopeDialog),c=g.useRef(null),u=Ln(o,i.contentRef,c);return g.useEffect(()=>{const f=c.current;if(f)return Ny(f)},[]),r.jsx(tm,{...s,ref:u,trapFocus:i.open,disableOutsidePointerEvents:i.open,onCloseAutoFocus:rn(s.onCloseAutoFocus,f=>{var m;f.preventDefault(),(m=i.triggerRef.current)==null||m.focus()}),onPointerDownOutside:rn(s.onPointerDownOutside,f=>{const m=f.detail.originalEvent,p=m.button===0&&m.ctrlKey===!0;(m.button===2||p)&&f.preventDefault()}),onFocusOutside:rn(s.onFocusOutside,f=>f.preventDefault())})}),Ry=g.forwardRef((s,o)=>{const i=qt(As,s.__scopeDialog),c=g.useRef(!1),u=g.useRef(!1);return r.jsx(tm,{...s,ref:o,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:f=>{var m,p;(m=s.onCloseAutoFocus)==null||m.call(s,f),f.defaultPrevented||(c.current||(p=i.triggerRef.current)==null||p.focus(),f.preventDefault()),c.current=!1,u.current=!1},onInteractOutside:f=>{var v,x;(v=s.onInteractOutside)==null||v.call(s,f),f.defaultPrevented||(c.current=!0,f.detail.originalEvent.type==="pointerdown"&&(u.current=!0));const m=f.target;((x=i.triggerRef.current)==null?void 0:x.contains(m))&&f.preventDefault(),f.detail.originalEvent.type==="focusin"&&u.current&&f.preventDefault()}})}),tm=g.forwardRef((s,o)=>{const{__scopeDialog:i,trapFocus:c,onOpenAutoFocus:u,onCloseAutoFocus:f,...m}=s,p=qt(As,i);return Iv(),r.jsx(r.Fragment,{children:r.jsx(zh,{asChild:!0,loop:!0,trapped:c,onMountAutoFocus:u,onUnmountAutoFocus:f,children:r.jsx(Th,{role:"dialog",id:p.contentId,"aria-describedby":p.descriptionId,"aria-labelledby":p.titleId,"data-state":xd(p.open),...m,ref:o,deferPointerDownOutside:!0,onDismiss:()=>p.onOpenChange(!1)})})})}),rm="DialogTitle",Oy=g.forwardRef((s,o)=>{const{__scopeDialog:i,...c}=s,u=qt(rm,i);return r.jsx(it.h2,{id:u.titleId,...c,ref:o})});Oy.displayName=rm;var nm="DialogDescription",Dy=g.forwardRef((s,o)=>{const{__scopeDialog:i,...c}=s,u=qt(nm,i);return r.jsx(it.p,{id:u.descriptionId,...c,ref:o})});Dy.displayName=nm;var sm="DialogClose",Ty=g.forwardRef((s,o)=>{const{__scopeDialog:i,...c}=s,u=qt(sm,i);return r.jsx(it.button,{type:"button",...c,ref:o,onClick:rn(s.onClick,()=>u.onOpenChange(!1))})});Ty.displayName=sm;function xd(s){return s?"open":"closed"}var Eo='[cmdk-group=""]',Pc='[cmdk-group-items=""]',Ay='[cmdk-group-heading=""]',om='[cmdk-item=""]',Gp=`${om}:not([aria-disabled="true"])`,nd="cmdk-item-select",xs="data-value",zy=(s,o,i)=>Y0(s,o,i),lm=g.createContext(void 0),Qo=()=>g.useContext(lm),im=g.createContext(void 0),gd=()=>g.useContext(im),am=g.createContext(void 0),cm=g.forwardRef((s,o)=>{let i=gs(()=>{var E,Y;return{search:"",value:(Y=(E=s.value)!=null?E:s.defaultValue)!=null?Y:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),c=gs(()=>new Set),u=gs(()=>new Map),f=gs(()=>new Map),m=gs(()=>new Set),p=dm(s),{label:v,children:x,value:b,onValueChange:w,filter:P,shouldFilter:O,loop:I,disablePointerSelection:j=!1,vimBindings:N=!0,...M}=s,R=br(),B=br(),L=br(),T=g.useRef(null),$=Ky();zn(()=>{if(b!==void 0){let E=b.trim();i.current.value=E,V.emit()}},[b]),zn(()=>{$(6,Re)},[]);let V=g.useMemo(()=>({subscribe:E=>(m.current.add(E),()=>m.current.delete(E)),snapshot:()=>i.current,setState:(E,Y,X)=>{var Z,le,pe,be;if(!Object.is(i.current[E],Y)){if(i.current[E]=Y,E==="search")ue(),fe(),$(1,je);else if(E==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let U=document.getElementById(L);U?U.focus():(Z=document.getElementById(R))==null||Z.focus()}if($(7,()=>{var U;i.current.selectedItemId=(U=Ee())==null?void 0:U.id,V.emit()}),X||$(5,Re),((le=p.current)==null?void 0:le.value)!==void 0){let U=Y??"";(be=(pe=p.current).onValueChange)==null||be.call(pe,U);return}}V.emit()}},emit:()=>{m.current.forEach(E=>E())}}),[]),ee=g.useMemo(()=>({value:(E,Y,X)=>{var Z;Y!==((Z=f.current.get(E))==null?void 0:Z.value)&&(f.current.set(E,{value:Y,keywords:X}),i.current.filtered.items.set(E,ne(Y,X)),$(2,()=>{fe(),V.emit()}))},item:(E,Y)=>(c.current.add(E),Y&&(u.current.has(Y)?u.current.get(Y).add(E):u.current.set(Y,new Set([E]))),$(3,()=>{ue(),fe(),i.current.value||je(),V.emit()}),()=>{f.current.delete(E),c.current.delete(E),i.current.filtered.items.delete(E);let X=Ee();$(4,()=>{ue(),(X==null?void 0:X.getAttribute("id"))===E&&je(),V.emit()})}),group:E=>(u.current.has(E)||u.current.set(E,new Set),()=>{f.current.delete(E),u.current.delete(E)}),filter:()=>p.current.shouldFilter,label:v||s["aria-label"],getDisablePointerSelection:()=>p.current.disablePointerSelection,listId:R,inputId:L,labelId:B,listInnerRef:T}),[]);function ne(E,Y){var X,Z;let le=(Z=(X=p.current)==null?void 0:X.filter)!=null?Z:zy;return E?le(E,i.current.search,Y):0}function fe(){if(!i.current.search||p.current.shouldFilter===!1)return;let E=i.current.filtered.items,Y=[];i.current.filtered.groups.forEach(Z=>{let le=u.current.get(Z),pe=0;le.forEach(be=>{let U=E.get(be);pe=Math.max(U,pe)}),Y.push([Z,pe])});let X=T.current;Le().sort((Z,le)=>{var pe,be;let U=Z.getAttribute("id"),me=le.getAttribute("id");return((pe=E.get(me))!=null?pe:0)-((be=E.get(U))!=null?be:0)}).forEach(Z=>{let le=Z.closest(Pc);le?le.appendChild(Z.parentElement===le?Z:Z.closest(`${Pc} > *`)):X.appendChild(Z.parentElement===X?Z:Z.closest(`${Pc} > *`))}),Y.sort((Z,le)=>le[1]-Z[1]).forEach(Z=>{var le;let pe=(le=T.current)==null?void 0:le.querySelector(`${Eo}[${xs}="${encodeURIComponent(Z[0])}"]`);pe==null||pe.parentElement.appendChild(pe)})}function je(){let E=Le().find(X=>X.getAttribute("aria-disabled")!=="true"),Y=E==null?void 0:E.getAttribute(xs);V.setState("value",Y||void 0)}function ue(){var E,Y,X,Z;if(!i.current.search||p.current.shouldFilter===!1){i.current.filtered.count=c.current.size;return}i.current.filtered.groups=new Set;let le=0;for(let pe of c.current){let be=(Y=(E=f.current.get(pe))==null?void 0:E.value)!=null?Y:"",U=(Z=(X=f.current.get(pe))==null?void 0:X.keywords)!=null?Z:[],me=ne(be,U);i.current.filtered.items.set(pe,me),me>0&&le++}for(let[pe,be]of u.current)for(let U of be)if(i.current.filtered.items.get(U)>0){i.current.filtered.groups.add(pe);break}i.current.filtered.count=le}function Re(){var E,Y,X;let Z=Ee();Z&&(((E=Z.parentElement)==null?void 0:E.firstChild)===Z&&((X=(Y=Z.closest(Eo))==null?void 0:Y.querySelector(Ay))==null||X.scrollIntoView({block:"nearest"})),Z.scrollIntoView({block:"nearest"}))}function Ee(){var E;return(E=T.current)==null?void 0:E.querySelector(`${om}[aria-selected="true"]`)}function Le(){var E;return Array.from(((E=T.current)==null?void 0:E.querySelectorAll(Gp))||[])}function Oe(E){let Y=Le()[E];Y&&V.setState("value",Y.getAttribute(xs))}function Pe(E){var Y;let X=Ee(),Z=Le(),le=Z.findIndex(be=>be===X),pe=Z[le+E];(Y=p.current)!=null&&Y.loop&&(pe=le+E<0?Z[Z.length-1]:le+E===Z.length?Z[0]:Z[le+E]),pe&&V.setState("value",pe.getAttribute(xs))}function K(E){let Y=Ee(),X=Y==null?void 0:Y.closest(Eo),Z;for(;X&&!Z;)X=E>0?Wy(X,Eo):Gy(X,Eo),Z=X==null?void 0:X.querySelector(Gp);Z?V.setState("value",Z.getAttribute(xs)):Pe(E)}let se=()=>Oe(Le().length-1),Q=E=>{E.preventDefault(),E.metaKey?se():E.altKey?K(1):Pe(1)},C=E=>{E.preventDefault(),E.metaKey?Oe(0):E.altKey?K(-1):Pe(-1)};return g.createElement(it.div,{ref:o,tabIndex:-1,...M,"cmdk-root":"",onKeyDown:E=>{var Y;(Y=M.onKeyDown)==null||Y.call(M,E);let X=E.nativeEvent.isComposing||E.keyCode===229;if(!(E.defaultPrevented||X))switch(E.key){case"n":case"j":{N&&E.ctrlKey&&Q(E);break}case"ArrowDown":{Q(E);break}case"p":case"k":{N&&E.ctrlKey&&C(E);break}case"ArrowUp":{C(E);break}case"Home":{E.preventDefault(),Oe(0);break}case"End":{E.preventDefault(),se();break}case"Enter":{E.preventDefault();let Z=Ee();if(Z){let le=new Event(nd);Z.dispatchEvent(le)}}}}},g.createElement("label",{"cmdk-label":"",htmlFor:ee.inputId,id:ee.labelId,style:qy},v),Ci(s,E=>g.createElement(im.Provider,{value:V},g.createElement(lm.Provider,{value:ee},E))))}),Ly=g.forwardRef((s,o)=>{var i,c;let u=br(),f=g.useRef(null),m=g.useContext(am),p=Qo(),v=dm(s),x=(c=(i=v.current)==null?void 0:i.forceMount)!=null?c:m==null?void 0:m.forceMount;zn(()=>{if(!x)return p.item(u,m==null?void 0:m.id)},[x]);let b=um(u,f,[s.value,s.children,f],s.keywords),w=gd(),P=on($=>$.value&&$.value===b.current),O=on($=>x||p.filter()===!1?!0:$.search?$.filtered.items.get(u)>0:!0);g.useEffect(()=>{let $=f.current;if(!(!$||s.disabled))return $.addEventListener(nd,I),()=>$.removeEventListener(nd,I)},[O,s.onSelect,s.disabled]);function I(){var $,V;j(),(V=($=v.current).onSelect)==null||V.call($,b.current)}function j(){w.setState("value",b.current,!0)}if(!O)return null;let{disabled:N,value:M,onSelect:R,forceMount:B,keywords:L,...T}=s;return g.createElement(it.div,{ref:Ts(f,o),...T,id:u,"cmdk-item":"",role:"option","aria-disabled":!!N,"aria-selected":!!P,"data-disabled":!!N,"data-selected":!!P,onPointerMove:N||p.getDisablePointerSelection()?void 0:j,onClick:N?void 0:I},s.children)}),Iy=g.forwardRef((s,o)=>{let{heading:i,children:c,forceMount:u,...f}=s,m=br(),p=g.useRef(null),v=g.useRef(null),x=br(),b=Qo(),w=on(O=>u||b.filter()===!1?!0:O.search?O.filtered.groups.has(m):!0);zn(()=>b.group(m),[]),um(m,p,[s.value,s.heading,v]);let P=g.useMemo(()=>({id:m,forceMount:u}),[u]);return g.createElement(it.div,{ref:Ts(p,o),...f,"cmdk-group":"",role:"presentation",hidden:w?void 0:!0},i&&g.createElement("div",{ref:v,"cmdk-group-heading":"","aria-hidden":!0,id:x},i),Ci(s,O=>g.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":i?x:void 0},g.createElement(am.Provider,{value:P},O))))}),Fy=g.forwardRef((s,o)=>{let{alwaysRender:i,...c}=s,u=g.useRef(null),f=on(m=>!m.search);return!i&&!f?null:g.createElement(it.div,{ref:Ts(u,o),...c,"cmdk-separator":"",role:"separator"})}),Uy=g.forwardRef((s,o)=>{let{onValueChange:i,...c}=s,u=s.value!=null,f=gd(),m=on(x=>x.search),p=on(x=>x.selectedItemId),v=Qo();return g.useEffect(()=>{s.value!=null&&f.setState("search",s.value)},[s.value]),g.createElement(it.input,{ref:o,...c,"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":p,id:v.inputId,type:"text",value:u?s.value:m,onChange:x=>{u||f.setState("search",x.target.value),i==null||i(x.target.value)}})}),$y=g.forwardRef((s,o)=>{let{children:i,label:c="Suggestions",...u}=s,f=g.useRef(null),m=g.useRef(null),p=on(x=>x.selectedItemId),v=Qo();return g.useEffect(()=>{if(m.current&&f.current){let x=m.current,b=f.current,w,P=new ResizeObserver(()=>{w=requestAnimationFrame(()=>{let O=x.offsetHeight;b.style.setProperty("--cmdk-list-height",O.toFixed(1)+"px")})});return P.observe(x),()=>{cancelAnimationFrame(w),P.unobserve(x)}}},[]),g.createElement(it.div,{ref:Ts(f,o),...u,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":p,"aria-label":c,id:v.listId},Ci(s,x=>g.createElement("div",{ref:Ts(m,v.listInnerRef),"cmdk-list-sizer":""},x)))}),By=g.forwardRef((s,o)=>{let{open:i,onOpenChange:c,overlayClassName:u,contentClassName:f,container:m,...p}=s;return g.createElement(qh,{open:i,onOpenChange:c},g.createElement(Jh,{container:m},g.createElement(Xh,{"cmdk-overlay":"",className:u}),g.createElement(em,{"aria-label":s.label,"cmdk-dialog":"",className:f},g.createElement(cm,{ref:o,...p}))))}),Vy=g.forwardRef((s,o)=>on(i=>i.filtered.count===0)?g.createElement(it.div,{ref:o,...s,"cmdk-empty":"",role:"presentation"}):null),Hy=g.forwardRef((s,o)=>{let{progress:i,children:c,label:u="Loading...",...f}=s;return g.createElement(it.div,{ref:o,...f,"cmdk-loading":"",role:"progressbar","aria-valuenow":i,"aria-valuemin":0,"aria-valuemax":100,"aria-label":u},Ci(s,m=>g.createElement("div",{"aria-hidden":!0},m)))}),ms=Object.assign(cm,{List:$y,Item:Ly,Input:Uy,Group:Iy,Separator:Fy,Dialog:By,Empty:Vy,Loading:Hy});function Wy(s,o){let i=s.nextElementSibling;for(;i;){if(i.matches(o))return i;i=i.nextElementSibling}}function Gy(s,o){let i=s.previousElementSibling;for(;i;){if(i.matches(o))return i;i=i.previousElementSibling}}function dm(s){let o=g.useRef(s);return zn(()=>{o.current=s}),o}var zn=typeof window>"u"?g.useEffect:g.useLayoutEffect;function gs(s){let o=g.useRef();return o.current===void 0&&(o.current=s()),o}function on(s){let o=gd(),i=()=>s(o.snapshot());return g.useSyncExternalStore(o.subscribe,i,i)}function um(s,o,i,c=[]){let u=g.useRef(),f=Qo();return zn(()=>{var m;let p=(()=>{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():u.current}})(),v=c.map(x=>x.trim());f.value(s,p,v),(m=o.current)==null||m.setAttribute(xs,p),u.current=p}),u}var Ky=()=>{let[s,o]=g.useState(),i=gs(()=>new Map);return zn(()=>{i.current.forEach(c=>c()),i.current=new Map},[s]),(c,u)=>{i.current.set(c,u),o({})}};function Qy(s){let o=s.type;return typeof o=="function"?o(s.props):"render"in o?o.render(s.props):s}function Ci({asChild:s,children:o},i){return s&&g.isValidElement(o)?g.cloneElement(Qy(o),{ref:o.ref},i(o.props.children)):i(o)}var qy={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function Zy({onNavigate:s}){const[o,i]=g.useState(!1);return g.useEffect(()=>{const c=u=>{(u.metaKey||u.ctrlKey)&&u.key.toLowerCase()==="k"&&(u.preventDefault(),i(f=>!f))};return document.addEventListener("keydown",c),()=>document.removeEventListener("keydown",c)},[]),r.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:r.jsxs("div",{className:"w-full max-w-lg overflow-hidden rounded-xl border border-border bg-popover text-popover-foreground shadow-2xl",onClick:c=>c.stopPropagation(),children:[r.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"}),r.jsxs(ms.List,{className:"max-h-80 overflow-y-auto p-2",children:[r.jsx(ms.Empty,{className:"px-3 py-6 text-center text-sm text-muted-foreground",children:"Nichts gefunden."}),r.jsx(ms.Group,{heading:"Bereiche",className:"px-1 py-1 text-xs text-muted-foreground",children:Xc.map(c=>r.jsxs(ms.Item,{value:`${c.label} ${c.hint}`,onSelect:()=>{s(c.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:[r.jsx(c.icon,{className:"h-4 w-4 text-primary"}),r.jsx("span",{children:c.label}),r.jsx("span",{className:"ml-auto truncate text-xs text-muted-foreground",children:c.hint})]},c.id))})]})]})})}async function ye(s,o){var v;const i={"Content-Type":"application/json",...o==null?void 0:o.headers},c=localStorage.getItem("mc_sudo_password"),u=localStorage.getItem("mc_hf_token");c&&(i["X-Sudo-Password"]=c);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;c&&!("sudo_password"in x)&&(x.sudo_password=c,b=!0),u&&!("hf_token"in x)&&(x.hf_token=u,b=!0),b&&(f=JSON.stringify(x))}catch{}else if(!f){const x={};c&&(x.sudo_password=c),u&&(x.hf_token=u),Object.keys(x).length>0&&(f=JSON.stringify(x))}}const p=await fetch(s,{...o,headers:i,body:f});if(!p.ok)throw new Error(`${p.status} ${p.statusText}`);return p.json()}const Ze={health:["health"],systemStatus:["system-status"],services:["services"],models:["models"],routing:["routing"],jobs:["jobs"],tokenStats:["token-stats"],agentStatus:["agent-status"],updates:["updates"],discover:["discover"],drafts:s=>["drafts",s??""],connect:s=>["connect",s??""],memory:(s,o)=>["memory",s??"",o??""]},Yy=()=>Dt({queryKey:Ze.health,queryFn:()=>ye("/api/health"),refetchInterval:1e4}),vd=(s=5e3)=>Dt({queryKey:Ze.systemStatus,queryFn:()=>ye("/api/system/status"),refetchInterval:s}),Jy=(s=3e3)=>Dt({queryKey:Ze.services,queryFn:()=>ye("/api/system/services"),refetchInterval:s}),zs=(s=4e3)=>Dt({queryKey:Ze.models,queryFn:()=>ye("/api/models"),refetchInterval:s}),Xy=(s=4e3)=>Dt({queryKey:Ze.routing,queryFn:()=>ye("/api/routing"),refetchInterval:s}),fm=(s=2e3)=>Dt({queryKey:Ze.jobs,queryFn:()=>ye("/api/jobs"),refetchInterval:s,select:o=>o.jobs??[]}),pm=(s=3e3)=>Dt({queryKey:Ze.tokenStats,queryFn:()=>ye("/api/system/token-stats"),refetchInterval:s}),hm=(s=5e3)=>Dt({queryKey:Ze.agentStatus,queryFn:()=>ye("/api/agent/status"),refetchInterval:s}),yd=s=>Dt({queryKey:Ze.updates,queryFn:()=>ye("/api/maintenance/updates"),refetchInterval:s}),eb=()=>Dt({queryKey:Ze.discover,queryFn:()=>ye("/api/discover")}),tb=s=>Dt({queryKey:Ze.drafts(s),queryFn:()=>ye(`/api/models/drafts?target=${encodeURIComponent(s??"")}`),enabled:!!s}),mm=s=>Dt({queryKey:Ze.connect(s),queryFn:()=>ye(s?`/api/connect?${s}`:"/api/connect")}),xm=s=>Dt({queryKey:Ze.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),ye(`/api/memory?${o}`)},select:o=>s!=null&&s.limit?o.slice(0,s.limit):o});function St(s){return(s/1024**3).toFixed(1)}function sd(s){return s?s>1024**3?`${(s/1024**3).toFixed(1)} GB`:`${(s/1024**2).toFixed(0)} MB`:""}function gr(s){if(!s)return"—";const o=s/1024**3;return o>=1?`${o.toFixed(1)} GB`:`${(s/1024**2).toFixed(0)} MB`}function rb(s){if(!s)return"";const o=Math.floor(s/60);return o>0?`${o} min`:`${s} s`}function Kp(s){return s?`${Math.round(s/1024)}k`:"—"}function gm(s){var o,i,c="";if(typeof s=="string"||typeof s=="number")c+=s;else if(typeof s=="object")if(Array.isArray(s)){var u=s.length;for(o=0;o<u;o++)s[o]&&(i=gm(s[o]))&&(c&&(c+=" "),c+=i)}else for(i in s)s[i]&&(c&&(c+=" "),c+=i);return c}function nb(){for(var s,o,i=0,c="",u=arguments.length;i<u;i++)(s=arguments[i])&&(o=gm(s))&&(c&&(c+=" "),c+=o);return c}const bd="-",sb=s=>{const o=lb(s),{conflictingClassGroups:i,conflictingClassGroupModifiers:c}=s;return{getClassGroupId:m=>{const p=m.split(bd);return p[0]===""&&p.length!==1&&p.shift(),vm(p,o)||ob(m)},getConflictingClassGroupIds:(m,p)=>{const v=i[m]||[];return p&&c[m]?[...v,...c[m]]:v}}},vm=(s,o)=>{var m;if(s.length===0)return o.classGroupId;const i=s[0],c=o.nextPart.get(i),u=c?vm(s.slice(1),c):void 0;if(u)return u;if(o.validators.length===0)return;const f=s.join(bd);return(m=o.validators.find(({validator:p})=>p(f)))==null?void 0:m.classGroupId},Qp=/^\[(.+)\]$/,ob=s=>{if(Qp.test(s)){const o=Qp.exec(s)[1],i=o==null?void 0:o.substring(0,o.indexOf(":"));if(i)return"arbitrary.."+i}},lb=s=>{const{theme:o,prefix:i}=s,c={nextPart:new Map,validators:[]};return ab(Object.entries(s.classGroups),i).forEach(([f,m])=>{od(m,c,f,o)}),c},od=(s,o,i,c)=>{s.forEach(u=>{if(typeof u=="string"){const f=u===""?o:qp(o,u);f.classGroupId=i;return}if(typeof u=="function"){if(ib(u)){od(u(c),o,i,c);return}o.validators.push({validator:u,classGroupId:i});return}Object.entries(u).forEach(([f,m])=>{od(m,qp(o,f),i,c)})})},qp=(s,o)=>{let i=s;return o.split(bd).forEach(c=>{i.nextPart.has(c)||i.nextPart.set(c,{nextPart:new Map,validators:[]}),i=i.nextPart.get(c)}),i},ib=s=>s.isThemeGetter,ab=(s,o)=>o?s.map(([i,c])=>{const u=c.map(f=>typeof f=="string"?o+f:typeof f=="object"?Object.fromEntries(Object.entries(f).map(([m,p])=>[o+m,p])):f);return[i,u]}):s,cb=s=>{if(s<1)return{get:()=>{},set:()=>{}};let o=0,i=new Map,c=new Map;const u=(f,m)=>{i.set(f,m),o++,o>s&&(o=0,c=i,i=new Map)};return{get(f){let m=i.get(f);if(m!==void 0)return m;if((m=c.get(f))!==void 0)return u(f,m),m},set(f,m){i.has(f)?i.set(f,m):u(f,m)}}},ym="!",db=s=>{const{separator:o,experimentalParseClassName:i}=s,c=o.length===1,u=o[0],f=o.length,m=p=>{const v=[];let x=0,b=0,w;for(let N=0;N<p.length;N++){let M=p[N];if(x===0){if(M===u&&(c||p.slice(N,N+f)===o)){v.push(p.slice(b,N)),b=N+f;continue}if(M==="/"){w=N;continue}}M==="["?x++:M==="]"&&x--}const P=v.length===0?p:p.substring(b),O=P.startsWith(ym),I=O?P.substring(1):P,j=w&&w>b?w-b:void 0;return{modifiers:v,hasImportantModifier:O,baseClassName:I,maybePostfixModifierPosition:j}};return i?p=>i({className:p,parseClassName:m}):m},ub=s=>{if(s.length<=1)return s;const o=[];let i=[];return s.forEach(c=>{c[0]==="["?(o.push(...i.sort(),c),i=[]):i.push(c)}),o.push(...i.sort()),o},fb=s=>({cache:cb(s.cacheSize),parseClassName:db(s),...sb(s)}),pb=/\s+/,hb=(s,o)=>{const{parseClassName:i,getClassGroupId:c,getConflictingClassGroupIds:u}=o,f=[],m=s.trim().split(pb);let p="";for(let v=m.length-1;v>=0;v-=1){const x=m[v],{modifiers:b,hasImportantModifier:w,baseClassName:P,maybePostfixModifierPosition:O}=i(x);let I=!!O,j=c(I?P.substring(0,O):P);if(!j){if(!I){p=x+(p.length>0?" "+p:p);continue}if(j=c(P),!j){p=x+(p.length>0?" "+p:p);continue}I=!1}const N=ub(b).join(":"),M=w?N+ym:N,R=M+j;if(f.includes(R))continue;f.push(R);const B=u(j,I);for(let L=0;L<B.length;++L){const T=B[L];f.push(M+T)}p=x+(p.length>0?" "+p:p)}return p};function mb(){let s=0,o,i,c="";for(;s<arguments.length;)(o=arguments[s++])&&(i=bm(o))&&(c&&(c+=" "),c+=i);return c}const bm=s=>{if(typeof s=="string")return s;let o,i="";for(let c=0;c<s.length;c++)s[c]&&(o=bm(s[c]))&&(i&&(i+=" "),i+=o);return i};function xb(s,...o){let i,c,u,f=m;function m(v){const x=o.reduce((b,w)=>w(b),s());return i=fb(x),c=i.cache.get,u=i.cache.set,f=p,p(v)}function p(v){const x=c(v);if(x)return x;const b=hb(v,i);return u(v,b),b}return function(){return f(mb.apply(null,arguments))}}const $e=s=>{const o=i=>i[s]||[];return o.isThemeGetter=!0,o},wm=/^\[(?:([a-z-]+):)?(.+)\]$/i,gb=/^\d+\/\d+$/,vb=new Set(["px","full","screen"]),yb=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,bb=/\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$/,wb=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,jb=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,kb=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,mr=s=>ys(s)||vb.has(s)||gb.test(s),Vr=s=>Ls(s,"length",Rb),ys=s=>!!s&&!Number.isNaN(Number(s)),Mc=s=>Ls(s,"number",ys),_o=s=>!!s&&Number.isInteger(Number(s)),Nb=s=>s.endsWith("%")&&ys(s.slice(0,-1)),Ne=s=>wm.test(s),Hr=s=>yb.test(s),Sb=new Set(["length","size","percentage"]),Cb=s=>Ls(s,Sb,jm),Eb=s=>Ls(s,"position",jm),_b=new Set(["image","url"]),Pb=s=>Ls(s,_b,Db),Mb=s=>Ls(s,"",Ob),Po=()=>!0,Ls=(s,o,i)=>{const c=wm.exec(s);return c?c[1]?typeof o=="string"?c[1]===o:o.has(c[1]):i(c[2]):!1},Rb=s=>bb.test(s)&&!wb.test(s),jm=()=>!1,Ob=s=>jb.test(s),Db=s=>kb.test(s),Tb=()=>{const s=$e("colors"),o=$e("spacing"),i=$e("blur"),c=$e("brightness"),u=$e("borderColor"),f=$e("borderRadius"),m=$e("borderSpacing"),p=$e("borderWidth"),v=$e("contrast"),x=$e("grayscale"),b=$e("hueRotate"),w=$e("invert"),P=$e("gap"),O=$e("gradientColorStops"),I=$e("gradientColorStopPositions"),j=$e("inset"),N=$e("margin"),M=$e("opacity"),R=$e("padding"),B=$e("saturate"),L=$e("scale"),T=$e("sepia"),$=$e("skew"),V=$e("space"),ee=$e("translate"),ne=()=>["auto","contain","none"],fe=()=>["auto","hidden","clip","visible","scroll"],je=()=>["auto",Ne,o],ue=()=>[Ne,o],Re=()=>["",mr,Vr],Ee=()=>["auto",ys,Ne],Le=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Oe=()=>["solid","dashed","dotted","double","none"],Pe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],K=()=>["start","end","center","between","around","evenly","stretch"],se=()=>["","0",Ne],Q=()=>["auto","avoid","all","avoid-page","page","left","right","column"],C=()=>[ys,Ne];return{cacheSize:500,separator:":",theme:{colors:[Po],spacing:[mr,Vr],blur:["none","",Hr,Ne],brightness:C(),borderColor:[s],borderRadius:["none","","full",Hr,Ne],borderSpacing:ue(),borderWidth:Re(),contrast:C(),grayscale:se(),hueRotate:C(),invert:se(),gap:ue(),gradientColorStops:[s],gradientColorStopPositions:[Nb,Vr],inset:je(),margin:je(),opacity:C(),padding:ue(),saturate:C(),scale:C(),sepia:se(),skew:C(),space:ue(),translate:ue()},classGroups:{aspect:[{aspect:["auto","square","video",Ne]}],container:["container"],columns:[{columns:[Hr]}],"break-after":[{"break-after":Q()}],"break-before":[{"break-before":Q()}],"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:[...Le(),Ne]}],overflow:[{overflow:fe()}],"overflow-x":[{"overflow-x":fe()}],"overflow-y":[{"overflow-y":fe()}],overscroll:[{overscroll:ne()}],"overscroll-x":[{"overscroll-x":ne()}],"overscroll-y":[{"overscroll-y":ne()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[j]}],"inset-x":[{"inset-x":[j]}],"inset-y":[{"inset-y":[j]}],start:[{start:[j]}],end:[{end:[j]}],top:[{top:[j]}],right:[{right:[j]}],bottom:[{bottom:[j]}],left:[{left:[j]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",_o,Ne]}],basis:[{basis:je()}],"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:se()}],shrink:[{shrink:se()}],order:[{order:["first","last","none",_o,Ne]}],"grid-cols":[{"grid-cols":[Po]}],"col-start-end":[{col:["auto",{span:["full",_o,Ne]},Ne]}],"col-start":[{"col-start":Ee()}],"col-end":[{"col-end":Ee()}],"grid-rows":[{"grid-rows":[Po]}],"row-start-end":[{row:["auto",{span:[_o,Ne]},Ne]}],"row-start":[{"row-start":Ee()}],"row-end":[{"row-end":Ee()}],"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:[P]}],"gap-x":[{"gap-x":[P]}],"gap-y":[{"gap-y":[P]}],"justify-content":[{justify:["normal",...K()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...K(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...K(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[R]}],px:[{px:[R]}],py:[{py:[R]}],ps:[{ps:[R]}],pe:[{pe:[R]}],pt:[{pt:[R]}],pr:[{pr:[R]}],pb:[{pb:[R]}],pl:[{pl:[R]}],m:[{m:[N]}],mx:[{mx:[N]}],my:[{my:[N]}],ms:[{ms:[N]}],me:[{me:[N]}],mt:[{mt:[N]}],mr:[{mr:[N]}],mb:[{mb:[N]}],ml:[{ml:[N]}],"space-x":[{"space-x":[V]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[V]}],"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:[Hr]},Hr]}],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",Hr,Vr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Mc]}],"font-family":[{font:[Po]}],"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",ys,Mc]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",mr,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":[M]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[s]}],"text-opacity":[{"text-opacity":[M]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Oe(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",mr,Vr]}],"underline-offset":[{"underline-offset":["auto",mr,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":[M]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...Le(),Eb]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Cb]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Pb]}],"bg-color":[{bg:[s]}],"gradient-from-pos":[{from:[I]}],"gradient-via-pos":[{via:[I]}],"gradient-to-pos":[{to:[I]}],"gradient-from":[{from:[O]}],"gradient-via":[{via:[O]}],"gradient-to":[{to:[O]}],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:[p]}],"border-w-x":[{"border-x":[p]}],"border-w-y":[{"border-y":[p]}],"border-w-s":[{"border-s":[p]}],"border-w-e":[{"border-e":[p]}],"border-w-t":[{"border-t":[p]}],"border-w-r":[{"border-r":[p]}],"border-w-b":[{"border-b":[p]}],"border-w-l":[{"border-l":[p]}],"border-opacity":[{"border-opacity":[M]}],"border-style":[{border:[...Oe(),"hidden"]}],"divide-x":[{"divide-x":[p]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[p]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[M]}],"divide-style":[{divide:Oe()}],"border-color":[{border:[u]}],"border-color-x":[{"border-x":[u]}],"border-color-y":[{"border-y":[u]}],"border-color-s":[{"border-s":[u]}],"border-color-e":[{"border-e":[u]}],"border-color-t":[{"border-t":[u]}],"border-color-r":[{"border-r":[u]}],"border-color-b":[{"border-b":[u]}],"border-color-l":[{"border-l":[u]}],"divide-color":[{divide:[u]}],"outline-style":[{outline:["",...Oe()]}],"outline-offset":[{"outline-offset":[mr,Ne]}],"outline-w":[{outline:[mr,Vr]}],"outline-color":[{outline:[s]}],"ring-w":[{ring:Re()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[s]}],"ring-opacity":[{"ring-opacity":[M]}],"ring-offset-w":[{"ring-offset":[mr,Vr]}],"ring-offset-color":[{"ring-offset":[s]}],shadow:[{shadow:["","inner","none",Hr,Mb]}],"shadow-color":[{shadow:[Po]}],opacity:[{opacity:[M]}],"mix-blend":[{"mix-blend":[...Pe(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Pe()}],filter:[{filter:["","none"]}],blur:[{blur:[i]}],brightness:[{brightness:[c]}],contrast:[{contrast:[v]}],"drop-shadow":[{"drop-shadow":["","none",Hr,Ne]}],grayscale:[{grayscale:[x]}],"hue-rotate":[{"hue-rotate":[b]}],invert:[{invert:[w]}],saturate:[{saturate:[B]}],sepia:[{sepia:[T]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[i]}],"backdrop-brightness":[{"backdrop-brightness":[c]}],"backdrop-contrast":[{"backdrop-contrast":[v]}],"backdrop-grayscale":[{"backdrop-grayscale":[x]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[b]}],"backdrop-invert":[{"backdrop-invert":[w]}],"backdrop-opacity":[{"backdrop-opacity":[M]}],"backdrop-saturate":[{"backdrop-saturate":[B]}],"backdrop-sepia":[{"backdrop-sepia":[T]}],"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:C()}],ease:[{ease:["linear","in","out","in-out",Ne]}],delay:[{delay:C()}],animate:[{animate:["none","spin","ping","pulse","bounce",Ne]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[L]}],"scale-x":[{"scale-x":[L]}],"scale-y":[{"scale-y":[L]}],rotate:[{rotate:[_o,Ne]}],"translate-x":[{"translate-x":[ee]}],"translate-y":[{"translate-y":[ee]}],"skew-x":[{"skew-x":[$]}],"skew-y":[{"skew-y":[$]}],"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:[mr,Vr,Mc]}],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"]}}},Ab=xb(Tb);function J(...s){return Ab(nb(s))}function $o(s){return s?s.replace(/127\.0\.0\.1|localhost/g,"192.168.178.151"):""}const zb={fast:"bg-cyan-500/15 text-cyan-400 border-cyan-500/25",heavy:"bg-amber-500/15 text-amber-400 border-amber-500/25",coder:"bg-violet-500/15 text-violet-400 border-violet-500/25",reasoning:"bg-emerald-500/15 text-emerald-400 border-emerald-500/25",vision:"bg-pink-500/15 text-pink-400 border-pink-500/25",scout:"bg-teal-500/15 text-teal-400 border-teal-500/25",hermes:"bg-indigo-500/15 text-indigo-400 border-indigo-500/25"};function Lb(){const{data:s}=zs(2e3),{data:o}=pm(2e3),i=(s==null?void 0:s.models)??[],c=(s==null?void 0:s.running)??[],u=i.filter(v=>c.includes(v.name)),f=g.useRef(null),[m,p]=g.useState(!1);return g.useEffect(()=>{if(!o)return;const v=o.total_tokens;if(f.current!==null&&v>f.current){p(!0);const x=setTimeout(()=>p(!1),4e3);return f.current=v,()=>clearTimeout(x)}f.current=v},[o==null?void 0:o.total_tokens]),r.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/15",children:[r.jsxs("div",{className:"flex items-center justify-between mb-4",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(To,{className:"h-4.5 w-4.5 text-primary"}),r.jsx("h2",{className:"text-sm font-semibold tracking-wide uppercase text-foreground",children:"Aktive Modelle (Live)"})]}),r.jsxs("span",{className:J("flex items-center gap-1.5 text-[10px] font-bold uppercase tracking-wider font-mono px-2 py-0.5 rounded-full border transition-colors",m?"bg-emerald-500/10 text-emerald-400 border-emerald-500/30":"bg-background/30 text-muted-foreground/70 border-border/40"),children:[m?r.jsx(wi,{className:"h-3 w-3 animate-pulse"}):r.jsx(D0,{className:"h-3 w-3"}),m?"Inferenz aktiv":"Idle"]})]}),u.length===0?r.jsx("div",{className:"flex items-center justify-center gap-2 h-20 text-xs text-muted-foreground/70 italic",children:"Kein Modell geladen — Auto-Swap lädt bei Anfrage."}):r.jsx("div",{className:"grid gap-2 sm:grid-cols-2 xl:grid-cols-3",children:u.map(v=>{var x;return r.jsxs("div",{className:"flex items-center justify-between gap-2 p-3 rounded-xl bg-emerald-500/5 border border-emerald-500/20",children:[r.jsxs("div",{className:"min-w-0",children:[r.jsxs("div",{className:"flex items-center gap-1.5",children:[v.role&&r.jsx("span",{className:J("text-[8px] font-semibold uppercase px-1.5 py-0.5 rounded font-mono border tracking-wider shrink-0",zb[v.role]||"bg-slate-500/15 text-slate-300 border-slate-500/25"),children:v.role}),r.jsx("span",{className:"text-xs font-semibold font-mono text-foreground truncate",children:(x=v.name.split("/").pop())==null?void 0:x.replace(/\.gguf$/i,"")})]}),r.jsxs("div",{className:"text-[9px] font-mono text-muted-foreground/70 mt-0.5",children:[gr(v.size_bytes)," im Unified-RAM"]})]}),r.jsxs("span",{className:"flex items-center gap-1 text-[8px] font-semibold text-emerald-400 uppercase tracking-wider font-mono shrink-0",children:[r.jsx("span",{className:J("h-1.5 w-1.5 rounded-full bg-emerald-500",m&&"animate-pulse")})," warm"]})]},v.name)})})]})}function pi({value:s,label:o,detail:i}){const u=2*Math.PI*24,f=u-Math.min(s,100)/100*u,m=s>90?"stroke-red-500":s>75?"stroke-amber-500":"stroke-primary";return r.jsxs("div",{className:"flex flex-col items-center gap-1.5 p-2 bg-background/20 rounded-xl border border-border/40",children:[r.jsxs("div",{className:"relative flex h-16 w-16 items-center justify-center",children:[r.jsxs("svg",{className:"absolute inset-0 h-full w-full -rotate-90",children:[r.jsx("circle",{cx:"32",cy:"32",r:24,className:"stroke-muted fill-none",strokeWidth:"4.5"}),r.jsx("circle",{cx:"32",cy:"32",r:24,className:J("fill-none transition-all duration-700 ease-out",m),strokeWidth:"4.5",strokeDasharray:u,strokeDashoffset:f,strokeLinecap:"round"})]}),r.jsxs("span",{className:"text-xs font-mono font-bold tracking-tight text-foreground",children:[Math.round(s),"%"]})]}),r.jsx("span",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wider",children:o}),i&&r.jsx("span",{className:"text-[10px] font-mono text-muted-foreground/80",children:i})]})}function Ib(){const{data:s}=vd(3e3);return r.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:[r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[r.jsx(Ot,{className:"h-4.5 w-4.5 text-primary"}),r.jsx("h2",{className:"text-sm font-semibold tracking-wide uppercase text-foreground",children:"System-Status"})]}),s?r.jsxs("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-4",children:[r.jsx(pi,{value:s.cpu.percent,label:"CPU",detail:s.cpu.cores?`${s.cpu.cores} Cores`:void 0}),r.jsx(pi,{value:s.ram.percent,label:"RAM",detail:`${St(s.ram.used)} / ${St(s.ram.total)} GB`}),s.gpu&&s.gpu.busy_percent!=null&&s.gpu.gtt_used!=null&&s.gpu.gtt_total!=null&&r.jsx(pi,{value:s.gpu.busy_percent,label:"GPU",detail:`${St(s.gpu.gtt_used)} / ${St(s.gpu.gtt_total)} GB`}),s.disk&&r.jsx(pi,{value:s.disk.percent,label:"Disk",detail:`${St(s.disk.used)} / ${St(s.disk.total)} GB`})]}):r.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)&&r.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&&r.jsxs("span",{children:["CPU Temp: ",s.temp.cpu," °C"]}),s.temp.gpu!=null&&r.jsxs("span",{children:["GPU Temp: ",s.temp.gpu," °C"]})]})]})}function km({type:s,title:o,message:i,defaultValue:c,onConfirm:u,onCancel:f}){const m=g.useRef(null);return r.jsx("div",{className:"fixed inset-0 z-[99] bg-black/60 backdrop-blur-sm flex items-center justify-center p-4",children:r.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:[r.jsxs("div",{className:"flex items-center justify-between border-b border-border/20 pb-2",children:[r.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-primary",children:o}),r.jsx("button",{onClick:f||(()=>u()),className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground cursor-pointer",children:r.jsx(sn,{className:"h-4 w-4"})})]}),r.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:i}),s==="prompt"&&r.jsx("input",{ref:m,type:"text",defaultValue:c,className:"w-full h-9 px-3 text-xs bg-background/40 border border-border/60 rounded-lg outline-none focus:border-primary transition-colors text-foreground",autoFocus:!0,onKeyDown:p=>{var v;p.key==="Enter"&&u((v=m.current)==null?void 0:v.value)}}),r.jsxs("div",{className:"flex justify-end gap-3 pt-2",children:[(s==="confirm"||s==="prompt")&&r.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"}),r.jsx("button",{onClick:()=>{var v;const p=s==="prompt"?(v=m.current)==null?void 0:v.value:void 0;u(p)},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 In(){const[s,o]=g.useState(null),i=g.useCallback(()=>o(null),[]),c=g.useCallback((p,v,x)=>{o({type:"alert",title:p,message:v,onConfirm:()=>{o(null),x==null||x()}})},[]),u=g.useCallback((p,v,x,b)=>{o({type:"confirm",title:p,message:v,onConfirm:()=>{o(null),x()},onCancel:()=>{o(null),b==null||b()}})},[]),f=g.useCallback((p,v,x,b,w)=>{o({type:"prompt",title:p,message:v,defaultValue:x,onConfirm:P=>{o(null),b(P)},onCancel:()=>{o(null),w==null||w()}})},[]),m=s?r.jsx(km,{...s}):null;return{showAlert:c,showConfirm:u,showPrompt:f,close:i,dialogElement:m}}function Fb(){const s=ln(),{data:o}=yd(3e3),{data:i=[]}=fm(3e3),{showConfirm:c,dialogElement:u}=In(),[f,m]=g.useState(""),[p,v]=g.useState(!1),[x,b]=g.useState(""),[w,P]=g.useState(!1),[O,I]=g.useState({open:!1,actionPath:"",actionLabel:""}),j=()=>{s.invalidateQueries({queryKey:Ze.updates}),s.invalidateQueries({queryKey:Ze.jobs}),s.invalidateQueries({queryKey:Ze.models})};async function N(T,$,V,ee){m(`${$} wird ausgeführt...`),v(!0);try{const ne={...V},fe=await ye(T,{method:"POST",body:JSON.stringify(ne)});if(fe.status==="password_required"||fe.status==="incorrect_password"){I({open:!0,actionPath:T,actionLabel:$,payload:V,error:fe.status==="incorrect_password"?"Falsches Sudo-Passwort. Bitte erneut versuchen.":void 0}),m("");return}fe.job_id?m(`${$} gestartet (Job-ID: ${fe.job_id})`):fe.ok?m(`${$} erfolgreich ausgeführt.`):m(`Fehler: ${fe.err||"Unbekannter Fehler"}`),j()}catch(ne){m(`Fehler bei ${$}: ${ne.message}`)}finally{v(!1)}}async function M(){P(!0);try{const T={...O.payload,sudo_password:x},$=await ye(O.actionPath,{method:"POST",body:JSON.stringify(T)});if($.status==="password_required"||$.status==="incorrect_password"){I(V=>({...V,error:"Falsches Sudo-Passwort. Bitte erneut versuchen."}));return}$.job_id?m(`${O.actionLabel} gestartet (Job-ID: ${$.job_id})`):$.ok?m(`${O.actionLabel} erfolgreich ausgeführt.`):m(`Fehler: ${$.err||"Unbekannter Fehler"}`),I({open:!1,actionPath:"",actionLabel:""}),b(""),j()}catch(T){m(`Fehler: ${T.message}`),I({open:!1,actionPath:"",actionLabel:""}),b("")}finally{P(!1)}}async function R(T,$){m(`Upgrade für ${T} wird gestartet...`);try{await ye("/api/models/install",{method:"POST",body:JSON.stringify({repo:T,role:$,quant:"Q4_K_M",jinja:!0})}),m("Upgrade-Download gestartet."),j()}catch(V){m(`Upgrade fehlgeschlagen: ${V.message}`)}}const B=i.find(T=>T.label.includes("OS-Update")&&(T.state==="running"||T.state==="queued")),L=i.find(T=>T.label.includes("Engine-Update")&&(T.state==="running"||T.state==="queued"));return r.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:[O.open&&r.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm p-4",children:r.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:[r.jsxs("div",{className:"flex items-center justify-between border-b border-border/20 pb-2",children:[r.jsx("span",{className:"text-xs font-bold uppercase tracking-wider text-primary font-space",children:"Sudo-Passwort erforderlich"}),r.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:r.jsx(sn,{className:"h-4 w-4"})})]}),r.jsxs("p",{className:"text-[10px] text-muted-foreground leading-normal",children:["Für die Aktion ",r.jsx("strong",{children:O.actionLabel})," wird das Administrator-Passwort (Sudo) auf der Box benötigt."]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx("input",{type:"password",value:x,onChange:T=>b(T.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:T=>T.key==="Enter"&&M(),autoFocus:!0}),O.error&&r.jsx("div",{className:"text-[10px] font-semibold text-red-400",children:O.error})]}),r.jsxs("div",{className:"flex gap-2 justify-end",children:[r.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"}),r.jsx("button",{onClick:M,disabled:!x||w,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:w?"Prüfe...":"Ausführen"})]})]})}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-2 border-b border-border/20 pb-2",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(F0,{className:"h-4.5 w-4.5 text-primary"}),r.jsx("h2",{className:"text-sm font-semibold tracking-wide uppercase text-foreground",children:"Updates & Pflege"})]}),(o==null?void 0:o.last_check)&&r.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?r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"space-y-1.5",children:[r.jsxs("div",{className:J("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:[r.jsx("span",{children:"OS-Pakete"}),r.jsx("span",{className:"font-mono",children:o.os>0?`${o.os} verfügbar`:"aktuell"})]}),r.jsxs("div",{className:J("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:[r.jsx("span",{children:"Engine (llama.cpp)"}),r.jsx("span",{className:"font-mono",children:o.engine>0?"Update verfügbar":"aktuell"})]}),r.jsxs("div",{className:J("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:[r.jsx("span",{children:"Modell-Upgrades"}),r.jsx("span",{className:"font-mono",children:o.models>0?`${o.models} verfügbar`:"aktuell"})]})]}),r.jsxs("div",{className:"grid grid-cols-2 gap-2 border-t border-border/20 pt-3",children:[r.jsx("button",{onClick:()=>N("/api/maintenance/os-update","OS-Update"),disabled:p||!!B,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:B?r.jsxs(r.Fragment,{children:[r.jsx(Tn,{className:"h-3 w-3 animate-spin text-primary"}),r.jsxs("span",{children:["Aktiv (",B.progress??0,"%)"]})]}):r.jsx("span",{children:"OS Update"})}),r.jsx("button",{onClick:()=>N("/api/maintenance/engine-update","Engine-Update"),disabled:p||!!L,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:L?r.jsxs(r.Fragment,{children:[r.jsx(Tn,{className:"h-3 w-3 animate-spin text-primary"}),r.jsxs("span",{children:["Aktiv (",L.progress??0,"%)"]})]}):r.jsx("span",{children:"Engine Update"})})]}),r.jsxs("button",{onClick:()=>{c("Host-System neu starten?","Bist du sicher, dass du das Host-System neu starten willst?",()=>N("/api/maintenance/reboot","Reboot"))},disabled:p,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:[r.jsx(Ph,{className:"h-3.5 w-3.5"}),r.jsx("span",{children:"Host Reboot"})]}),o.model_list.length>0&&r.jsxs("div",{className:"space-y-1.5 border-t border-border/20 pt-3",children:[r.jsx("div",{className:"text-[9px] uppercase font-bold text-muted-foreground/60 tracking-wider",children:"Verfügbare Modell-Upgrades:"}),r.jsx("div",{className:"max-h-24 overflow-y-auto space-y-1.5 pr-1 scrollbar-thin",children:o.model_list.map(T=>r.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:[r.jsxs("span",{className:"truncate flex-1 mr-1.5",title:`${T.role}: ${T.repo}`,children:[r.jsx("span",{className:"text-primary font-bold uppercase",children:T.role}),": ",T.repo.split("/").pop()]}),r.jsxs("button",{onClick:()=>R(T.repo,T.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:[r.jsx(An,{className:"h-2.5 w-2.5"})," Laden"]})]},T.repo))})]})]}):r.jsx("div",{className:"h-24 flex items-center justify-center text-xs text-muted-foreground",children:"Lade Updates..."}),f&&r.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}),r.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:[r.jsx(Ds,{className:"h-3 w-3 shrink-0 text-muted-foreground/50 mt-0.5"}),r.jsxs("span",{children:["OS-Update & Reboot benötigen NOPASSWD in ",r.jsx("code",{children:"/etc/sudoers"})," (z.B. ",r.jsx("code",{children:"hitonabi ALL=(root) NOPASSWD:..."}),") oder ein gültiges Sudo-Passwort per Pop-up."]})]})]}),r.jsx("div",{className:"mt-4 border-t border-border/30 pt-3 shrink-0",children:r.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"})}),u]})}function Ub(){const s=ln(),{data:o}=hm(3e3),{data:i}=zs(),{showAlert:c,dialogElement:u}=In(),[f,m]=g.useState(!1),p=(i==null?void 0:i.models)??[];async function v(x){try{await ye("/api/agent/brain",{method:"POST",body:JSON.stringify({model:x})}),c("Erfolgreich",`Hermes-Gehirn wurde auf '${x}' geändert. Der Gateway-Dienst wurde neu gestartet.`),s.invalidateQueries({queryKey:Ze.agentStatus}),m(!1)}catch(b){c("Fehler",`Fehler beim Wechseln des Gehirns: ${b.message}`)}}return r.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:[r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center justify-between mb-4",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Ao,{className:"h-4.5 w-4.5 text-primary"}),r.jsx("h2",{className:"text-sm font-semibold tracking-wide uppercase text-foreground",children:"Hermes Agent"})]}),(o==null?void 0:o.webui_url)&&r.jsxs("a",{href:$o(o.webui_url),target:"_blank",rel:"noopener",className:J("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:[r.jsx(yi,{className:"h-3 w-3"})," Hermes öffnen"]})]}),o?r.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[r.jsxs("div",{className:"p-3 bg-background/20 rounded-xl border border-border/40",children:[r.jsx("div",{className:"text-[10px] text-muted-foreground uppercase font-semibold",children:"Gateway"}),r.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[r.jsx("span",{className:J("h-2 w-2 rounded-full",o.gateway_reachable?"bg-emerald-500 animate-pulse":"bg-amber-500")}),r.jsx("span",{className:"text-xs font-medium",children:o.gateway_reachable?"Online":"Offline"})]})]}),r.jsxs("div",{className:"p-3 bg-background/20 rounded-xl border border-border/40",children:[r.jsx("div",{className:"text-[10px] text-muted-foreground uppercase font-semibold",children:"WebUI"}),r.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[r.jsx("span",{className:J("h-2 w-2 rounded-full",o.webui_reachable?"bg-emerald-500 animate-pulse":"bg-amber-500")}),r.jsx("span",{className:"text-xs font-medium",children:o.webui_reachable?"Online":"Offline"})]})]}),r.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",children:[r.jsxs("div",{className:"flex justify-between items-center",children:[r.jsx("span",{className:"text-[10px] text-muted-foreground uppercase font-semibold",children:"Gehirn"}),r.jsx(Ot,{className:"h-3 w-3 text-primary"})]}),r.jsxs("div",{className:"text-xs font-medium mt-1 font-mono text-primary truncate flex items-center gap-1",children:[r.jsx(Lo,{className:"h-3 w-3 shrink-0"}),o.brain_model||"auto"]})]}),r.jsxs("div",{className:"p-3 bg-background/20 rounded-xl border border-border/40",children:[r.jsxs("div",{className:"flex justify-between items-center",children:[r.jsx("span",{className:"text-[10px] text-muted-foreground uppercase font-semibold",children:"Verdrahtung"}),r.jsx(Io,{className:"h-3 w-3 text-primary"})]}),r.jsxs("div",{className:"text-[10px] font-mono mt-1 space-y-0.5 text-muted-foreground",children:[r.jsxs("div",{children:["Config: ",o.has_config?r.jsx("span",{className:"text-emerald-400",children:"✓"}):"—"]}),r.jsxs("div",{children:["Skills: ",o.has_skills?r.jsx("span",{className:"text-emerald-400",children:"✓"}):"—"]}),r.jsxs("div",{children:["Memory: ",o.has_memories?r.jsx("span",{className:"text-emerald-400",children:"✓"}):"—"]})]})]})]}):r.jsx("div",{className:"h-28 flex items-center justify-center text-xs text-muted-foreground",children:"Lade Agenten-Status…"})]}),o&&r.jsxs("div",{className:"mt-3 border-t border-border/30 pt-3 space-y-1.5",children:[r.jsxs("div",{className:"flex items-center justify-between text-[10px] text-muted-foreground",children:[r.jsx("span",{children:"Telegram"}),r.jsx("span",{className:J("font-semibold",o.telegram_enabled?"text-emerald-400":""),children:o.telegram_enabled?"aktiv":"nicht konfiguriert"})]}),r.jsxs("div",{className:"flex items-center justify-between text-[10px] text-muted-foreground",children:[r.jsx("span",{children:"MCP-Server"}),r.jsxs("span",{className:"font-semibold text-foreground",children:[o.mcp_server_count??0," verbunden"]})]}),r.jsxs("div",{className:"flex items-center justify-between text-[10px] text-muted-foreground",children:[r.jsx("span",{children:"PC Executor"}),r.jsx("span",{className:J("font-semibold",o.pc_executor_reachable?"text-emerald-400":""),children:o.pc_executor_reachable?"erreichbar":"nicht verbunden"})]})]}),o&&f&&r.jsx("div",{className:"fixed inset-0 z-50 bg-black/60 backdrop-blur-sm flex items-center justify-center p-4",children:r.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:[r.jsxs("div",{className:"flex items-center justify-between border-b border-border/20 pb-2",children:[r.jsxs("h3",{className:"text-xs font-bold uppercase tracking-wider text-primary flex items-center gap-1.5",children:[r.jsx(Ot,{className:"h-4 w-4"}),r.jsx("span",{children:"Hermes-Gehirn konfigurieren"})]}),r.jsx("button",{onClick:()=>m(!1),className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground cursor-pointer",children:r.jsx(sn,{className:"h-4 w-4"})})]}),r.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 (',r.jsx("code",{className:"text-primary font-semibold",children:"auto"})," / ",r.jsx("code",{className:"text-primary font-semibold",children:"fast"})," / ",r.jsx("code",{className:"text-primary font-semibold",children:"heavy"}),"):"]}),r.jsx("div",{className:"space-y-1.5 max-h-60 overflow-y-auto pr-1",children:["auto","fast","heavy",...p.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 r.jsxs("button",{onClick:()=>v(x),className:J("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:[r.jsxs("div",{className:"flex flex-col text-left",children:[r.jsx("span",{className:"font-semibold truncate max-w-[280px]",children:x}),r.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")&&r.jsx(nn,{className:"h-4 w-4 shrink-0 text-primary"})]},x)})})]})}),u]})}const $b=["fast","heavy","coder","vision","scout"];function Bb(){const{data:s}=zs(3e3),o=(s==null?void 0:s.models)??[],i=(s==null?void 0:s.running)??[];return r.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:[r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[r.jsx(Lo,{className:"h-4.5 w-4.5 text-primary"}),r.jsx("h2",{className:"text-sm font-semibold tracking-wide uppercase text-foreground",children:"Rollen-Belegung"})]}),r.jsx("div",{className:"space-y-2 max-h-48 overflow-y-auto pr-1 scrollbar-thin",children:$b.map(c=>{var m;const u=o.find(p=>p.role===c),f=u?i.includes(u.name):!1;return r.jsxs("div",{className:J("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":u?"border-primary/20 bg-primary/5":"border-border/30 bg-background/10 opacity-60"),children:[r.jsx("div",{className:"min-w-0 flex-1 mr-2",children:r.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[r.jsx("span",{className:J("text-[9px] font-semibold uppercase px-1.5 py-0.5 rounded font-mono border tracking-wider shrink-0",c==="fast"?"bg-cyan-500/15 text-cyan-400 border-cyan-500/25":c==="heavy"?"bg-amber-500/15 text-amber-400 border-amber-500/25":c==="coder"?"bg-violet-500/15 text-violet-400 border-violet-500/25":c==="vision"?"bg-pink-500/15 text-pink-400 border-pink-500/25":"bg-teal-500/15 text-teal-400 border-teal-500/25"),children:c}),r.jsxs("div",{className:"flex flex-col min-w-0",children:[r.jsx("span",{className:"text-xs font-semibold truncate font-mono text-foreground",children:u?(m=u.name.split("/").pop())==null?void 0:m.replace(/\.gguf$/i,""):"nicht zugewiesen"}),u&&r.jsxs("div",{className:"flex gap-1 items-center mt-0.5 flex-wrap",children:[u.prompt_cache&&r.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"}),u.spec_draft_model&&r.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: ${u.spec_draft_model})`,children:"SPEC"}),u.parallel_slots>1&&r.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:`${u.parallel_slots} parallele Slots aktiv`,children:["SLOTS: ",u.parallel_slots]}),u.incomplete&&r.jsx("span",{className:"text-[7px] leading-none font-mono font-bold bg-amber-500/10 text-amber-400 border border-amber-500/20 px-1 py-0.5 rounded",title:"GGUF-Datei fehlt",children:"⚠ fehlt"})]})]})]})}),r.jsx("div",{className:"flex items-center gap-1.5 shrink-0",children:u?f?r.jsxs("span",{className:"flex items-center gap-1 text-[8px] font-semibold text-emerald-400 uppercase tracking-wider font-mono",children:[r.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500 animate-pulse"})," warm"]}):r.jsx("span",{className:"text-[8px] font-semibold text-muted-foreground uppercase tracking-wider font-mono",children:"bereit"}):r.jsx("span",{className:"text-[8px] font-semibold text-muted-foreground/60 uppercase tracking-wider font-mono",children:"—"})})]},c)})})]}),r.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 Vb(){const s=ln(),{data:o=[]}=xm({limit:3}),[i,c]=g.useState(""),[u,f]=g.useState("stable"),[m,p]=g.useState(!1);async function v(){if(!(!i.trim()||m)){p(!0);try{await ye("/api/memory",{method:"POST",body:JSON.stringify({content:i,category:u,source:"dashboard"})}),c(""),s.invalidateQueries({queryKey:["memory"]})}catch(x){console.error(x)}finally{p(!1)}}}return r.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:[r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[r.jsx(zo,{className:"h-4.5 w-4.5 text-primary"}),r.jsx("h2",{className:"text-sm font-semibold tracking-wide uppercase text-foreground",children:"Gedächtnis"})]}),r.jsxs("div",{className:"space-y-3",children:[r.jsx("textarea",{value:i,onChange:x=>c(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"}),r.jsxs("div",{className:"flex items-center gap-2 justify-between",children:[r.jsxs("select",{value:u,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:[r.jsx("option",{value:"stable",children:"🔵 Fakt"}),r.jsx("option",{value:"instruction",children:"📋 Regel"}),r.jsx("option",{value:"user",children:"👤 User"}),r.jsx("option",{value:"versioned",children:"🟡 Version"})]}),r.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:[r.jsx(_h,{className:"h-3.5 w-3.5"})," Speichern"]})]})]}),r.jsxs("div",{className:"mt-3.5 space-y-1.5",children:[r.jsx("div",{className:"text-[9px] text-muted-foreground uppercase font-bold tracking-wider",children:"Zuletzt gespeichert:"}),r.jsx("div",{className:"max-h-20 overflow-y-auto space-y-1 pr-1 scrollbar-thin",children:o.length===0?r.jsx("div",{className:"text-[10px] text-muted-foreground/75 py-1",children:"Keine Einträge vorhanden."}):o.map(x=>r.jsxs("div",{className:"text-[10px] bg-background/10 border border-border/30 rounded p-1.5 flex items-start gap-1.5",children:[r.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}),r.jsx("span",{className:"truncate flex-1 text-muted-foreground hover:text-foreground transition-colors",title:x.content,children:x.content})]},x.id))})]})]}),r.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 Hb(){var o;const{data:s}=pm(3e3);return r.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:[r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[r.jsx(N0,{className:"h-4.5 w-4.5 text-primary animate-pulse"}),r.jsx("h2",{className:"text-sm font-semibold tracking-wide uppercase text-foreground",children:"Effizienz & Ersparnis"})]}),s?r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"grid grid-cols-2 gap-2.5",children:[r.jsxs("div",{className:"p-3 bg-background/20 rounded-xl border border-border/40 text-left",children:[r.jsx("div",{className:"text-[8px] uppercase tracking-wider font-semibold text-muted-foreground/60",children:"Geld gespart"}),r.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})," €"]}),r.jsxs("div",{className:"text-[8px] text-muted-foreground/80 mt-0.5 font-mono",children:["(",s.saved_usd.toLocaleString("en-US",{minimumFractionDigits:2})," $)"]})]}),r.jsxs("div",{className:"p-3 bg-background/20 rounded-xl border border-border/40 text-left",children:[r.jsx("div",{className:"text-[8px] uppercase tracking-wider font-semibold text-muted-foreground/60",children:"Gesamt-Tokens"}),r.jsx("div",{className:"text-base font-bold text-primary mt-0.5 tracking-tight font-space",children:s.total_tokens.toLocaleString("de-DE")}),r.jsx("div",{className:"text-[8px] text-muted-foreground/80 mt-0.5 font-mono",children:"(Lokale Inferenz)"})]})]}),r.jsxs("div",{className:"space-y-2 border-t border-border/20 pt-3 text-[10px] text-muted-foreground",children:[r.jsxs("div",{className:"flex justify-between items-center font-mono",children:[r.jsx("span",{children:"Input (Prompts):"}),r.jsxs("span",{className:"font-semibold text-foreground",children:[s.prompt_tokens.toLocaleString("de-DE")," tkn"]})]}),r.jsxs("div",{className:"flex justify-between items-center font-mono",children:[r.jsx("span",{children:"Output (Antworten):"}),r.jsxs("span",{className:"font-semibold text-foreground",children:[s.completion_tokens.toLocaleString("de-DE")," tkn"]})]})]})]}):r.jsx("div",{className:"h-28 flex items-center justify-center text-xs text-muted-foreground",children:"Lade Statistiken…"})]}),r.jsxs("div",{className:"mt-4 text-[9px] text-muted-foreground/70 border-t border-border/30 pt-2.5 leading-normal",children:["Berechnet ggü. Cloud-APIs",(o=s==null?void 0:s.pricing)!=null&&o.heavy?`${(s.pricing.heavy.in??0).toFixed(2).replace(".",",")} $ / ${(s.pricing.heavy.out??0).toFixed(2).replace(".",",")} $ pro 1M tkn).`:"."]})]})}function Wb(){return r.jsxs("div",{className:"space-y-6",children:[r.jsxs("div",{children:[r.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"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"Aktueller Status von System, Modellen und Agent."})]}),r.jsx(Lb,{}),r.jsxs("div",{className:"grid gap-6 md:grid-cols-3",children:[r.jsx(Ib,{}),r.jsx(Fb,{})]}),r.jsxs("div",{className:"grid gap-6 md:grid-cols-2 xl:grid-cols-4",children:[r.jsx(Ub,{}),r.jsx(Bb,{}),r.jsx(Vb,{}),r.jsx(Hb,{})]})]})}function Gb(){const s=ln(),{data:o=[]}=fm(2e3),{showAlert:i,dialogElement:c}=In();async function u(p){try{await ye(`/api/jobs/${p}/cancel`,{method:"POST"}),s.invalidateQueries({queryKey:Ze.jobs})}catch(v){i("Fehler",v.message)}}const f=o.filter(p=>p.state==="running"||p.state==="queued"),m=o.filter(p=>p.state!=="running"&&p.state!=="queued").slice(-3);return f.length===0&&m.length===0?null:r.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:[r.jsx("div",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wider",children:"Aktive Downloads"}),f.map(p=>r.jsxs("div",{className:"space-y-1.5 p-3 rounded-xl bg-background/20 border border-border/40",children:[r.jsxs("div",{className:"flex justify-between items-center text-xs",children:[r.jsx("span",{className:"font-semibold truncate max-w-[250px]",children:p.label}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsxs("span",{className:"text-muted-foreground font-mono",children:[p.progress??0,"% • ",sd(p.done_bytes),"/",sd(p.total_bytes),p.eta_s?` • ETA ${rb(p.eta_s)}`:""]}),r.jsx("button",{onClick:()=>u(p.id),className:"text-[10px] text-red-400 hover:text-red-300 font-semibold border border-red-500/25 bg-red-500/5 px-2 py-0.5 rounded transition-all cursor-pointer",children:"Abbrechen"})]})]}),r.jsx("div",{className:"h-1.5 overflow-hidden rounded-full bg-muted",children:r.jsx("div",{className:"h-full rounded-full bg-primary transition-all duration-500",style:{width:`${p.progress??0}%`}})})]},p.id)),m.map(p=>r.jsxs("div",{className:"flex justify-between items-center text-xs text-muted-foreground px-1",children:[r.jsx("span",{className:"truncate",children:p.label}),r.jsx("span",{className:J("font-semibold text-[10px] px-1.5 py-0.5 rounded uppercase font-mono",p.state==="done"?"bg-emerald-500/10 text-emerald-400":"bg-amber-500/10 text-amber-400"),children:p.state})]},p.id)),c]})}function kn({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 r.jsx("span",{className:`rounded px-1.5 py-0.5 text-[11px] font-medium ${i[o]}`,children:s})}function Zp({caps:s}){return s?r.jsxs("span",{className:"inline-flex flex-wrap gap-1",children:[s.coder&&r.jsx(kn,{children:"💻 Code"}),s.vision&&r.jsx(kn,{children:"👁 Bild"}),s.reasoning&&r.jsx(kn,{children:"🧠 Reason"}),s.moe&&r.jsxs(kn,{tone:"primary",children:["🧩 MoE",s.active_b?`·${s.active_b}b`:""]}),s.tools==="yes"&&r.jsx(kn,{tone:"primary",children:"🛠 Tools"}),s.tools==="likely"&&r.jsx(kn,{tone:"warn",children:"🛠 Tools?"}),s.embedding&&r.jsx(kn,{children:"🔢 Embed"})]}):null}const Kb=["fast","heavy","coder","agent","vision","scout"];function Qb({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 r.jsxs("span",{className:J("rounded px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wider font-mono",o),children:[s.text," • ",s.req_gb," GB RAM"]})}function Yp(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 qb({model:s,onClose:o,onChanged:i}){var j,N;const{data:c,isLoading:u}=tb(s.gguf_path),[f,m]=g.useState(null),[p,v]=g.useState(""),x=c==null?void 0:c.target_vocab,b=(c==null?void 0:c.drafts)??[],w=b.filter(M=>M.compatible===!0),P=s.spec_draft_model;async function O(M){m(M??"__clear__"),v("");try{await ye(`/api/models/${encodeURIComponent(s.name)}/draft`,{method:"POST",body:JSON.stringify({draft_path:M})}),i(),o()}catch(R){v(String((R==null?void 0:R.message)||R)),m(null)}}const I=M=>{var R;return M?`${M.pre??"?"} · ${((R=M.n_vocab)==null?void 0:R.toLocaleString())??"?"} Tokens`:"—"};return r.jsx("div",{className:"fixed inset-0 z-50 bg-black/60 backdrop-blur-sm flex items-center justify-center p-4",children:r.jsxs("div",{className:"w-full max-w-lg 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:[r.jsxs("div",{className:"flex items-center justify-between border-b border-border/20 pb-2",children:[r.jsxs("h3",{className:"text-xs font-bold uppercase tracking-wider text-primary flex items-center gap-2",children:[r.jsx(wi,{className:"h-4 w-4"})," Speculative Draft"]}),r.jsx("button",{onClick:o,className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground cursor-pointer",children:r.jsx(sn,{className:"h-4 w-4"})})]}),r.jsxs("div",{className:"text-xs text-muted-foreground leading-relaxed",children:['Beschleunigt die Token-Generierung mit einem kleinen "Draft"-Modell. Voraussetzung: der Draft muss den ',r.jsx("strong",{className:"text-foreground",children:"exakt gleichen Tokenizer (Vocab)"})," haben wie das Modell — sonst lehnt llama.cpp es ab."]}),r.jsxs("div",{className:"rounded-lg border border-border/40 bg-background/30 px-3 py-2 text-[11px] font-mono flex items-center justify-between",children:[r.jsx("span",{className:"text-muted-foreground",children:(j=s.name.split("/").pop())==null?void 0:j.replace(/\.gguf$/i,"")}),r.jsxs("span",{className:"text-foreground",children:["Vocab: ",I(x)]})]}),s.spec_active&&P&&r.jsxs("div",{className:"rounded-lg border border-emerald-500/30 bg-emerald-500/5 px-3 py-2 flex items-center justify-between gap-2",children:[r.jsxs("span",{className:"text-[11px] text-emerald-400 font-mono flex items-center gap-1.5 truncate",children:[r.jsx(nn,{className:"h-3.5 w-3.5 shrink-0"})," Aktiv: ",P]}),r.jsx("button",{onClick:()=>O(null),disabled:f!==null,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 shrink-0 cursor-pointer disabled:opacity-50",children:"Deaktivieren"})]}),!(c!=null&&c.target_exists)&&r.jsxs("div",{className:"rounded-lg border border-amber-500/30 bg-amber-500/5 px-3 py-2 text-[11px] text-amber-400 flex items-center gap-2",children:[r.jsx(Jc,{className:"h-3.5 w-3.5 shrink-0"}),"Modell-GGUF noch nicht vorhanden — Spec-Draft ist nach dem Download konfigurierbar."]}),r.jsx("div",{className:"space-y-1.5 max-h-64 overflow-y-auto pr-1",children:u?r.jsx("div",{className:"text-xs text-muted-foreground py-6 text-center",children:"Prüfe Vocab-Kompatibilität…"}):b.length===0?r.jsxs("div",{className:"text-[11px] text-muted-foreground border border-dashed border-border/50 rounded-lg p-4 text-center",children:["Keine Draft-Modelle in ",r.jsx("code",{className:"font-mono",children:"/srv/models/drafts"}),". Lade ein kleines same-family-Modell (z.B. Qwen3-0.6B) und lege es dort ab."]}):b.map(M=>{var L,T;const R=M.filename===P,B=M.compatible===!0;return r.jsxs("div",{className:J("rounded-lg border px-3 py-2 flex items-center justify-between gap-2 text-left",B?"border-border/40 bg-background/20":"border-border/20 bg-background/10 opacity-60",R&&"border-primary/40 bg-primary/10"),children:[r.jsxs("div",{className:"min-w-0",children:[r.jsx("div",{className:"text-[11px] font-mono font-semibold text-foreground truncate",children:M.filename}),r.jsxs("div",{className:"text-[9px] text-muted-foreground font-mono",children:[gr(M.size_bytes)," · Vocab: ",I(M.vocab)]})]}),B?R?r.jsxs("span",{className:"text-[9px] font-bold uppercase text-primary flex items-center gap-1 shrink-0",children:[r.jsx(nn,{className:"h-3.5 w-3.5"})," Aktiv"]}):r.jsx("button",{onClick:()=>O(M.path),disabled:f!==null,className:"h-7 px-3 rounded-lg border border-emerald-500/30 bg-emerald-500/5 hover:bg-emerald-500/15 text-emerald-400 text-[9px] font-bold uppercase shrink-0 cursor-pointer disabled:opacity-50",children:"Aktivieren"}):r.jsxs("span",{className:"text-[9px] font-bold uppercase text-amber-400/80 flex items-center gap-1 shrink-0",title:M.compatible===!1?`Inkompatibel: Tokenizer/Vocab weicht ab (Draft ${(L=M.vocab)==null?void 0:L.pre}/${(T=M.vocab)==null?void 0:T.n_vocab} ≠ Modell ${x==null?void 0:x.pre}/${x==null?void 0:x.n_vocab}).`:"Kompatibilität nicht prüfbar (Datei fehlt).",children:[r.jsx(Jc,{className:"h-3.5 w-3.5"})," ",M.compatible===!1?"Vocab ≠":"n/a"]})]},M.path)})}),!u&&(c==null?void 0:c.target_exists)&&b.length>0&&w.length===0&&r.jsxs("div",{className:"rounded-lg border border-amber-500/30 bg-amber-500/5 px-3 py-2 text-[11px] text-amber-400 leading-relaxed",children:["Kein vocab-kompatibler Draft verfügbar — Speculative Decoding ist für dieses Modell nicht möglich. Es braucht einen Draft mit identischem Tokenizer (pre=",r.jsx("span",{className:"font-mono",children:x==null?void 0:x.pre}),", n_vocab=",r.jsx("span",{className:"font-mono",children:(N=x==null?void 0:x.n_vocab)==null?void 0:N.toLocaleString()}),")."]}),p&&r.jsx("div",{className:"text-[10px] text-red-400 font-mono",children:p})]})})}function Zb(){var Fs,Un,Us,$n,jr;const s=ln(),{data:o,isLoading:i,error:c}=zs(4e3),{data:u}=Xy(4e3),{data:f}=mm(),{data:m}=yd(4e3),{showAlert:p,showConfirm:v,showPrompt:x,dialogElement:b}=In(),w=(o==null?void 0:o.models)??[],P=(o==null?void 0:o.running)??[],O=c?String(c):"",I=()=>{s.invalidateQueries({queryKey:Ze.models}),s.invalidateQueries({queryKey:Ze.routing})},[j,N]=g.useState(null),[M,R]=g.useState(null),[B,L]=g.useState(null),[T,$]=g.useState(!1),[V,ee]=g.useState(null),[ne,fe]=g.useState("grid"),[je,ue]=g.useState("all"),Re=w.filter(A=>je==="in_use"?!!A.role||P.includes(A.name):!0),[Ee,Le]=g.useState({width:800,height:360}),Oe=g.useRef(null),Pe=g.useCallback(A=>{if(Oe.current&&(Oe.current.disconnect(),Oe.current=null),A){const ie=new ResizeObserver(ke=>{if(!ke||ke.length===0)return;const Ae=ke[0].contentRect;Le({width:Ae.width,height:Ae.height})});ie.observe(A),Oe.current=ie}},[]),K=Ee.width,se=Ee.height,Q=A=>{const ie=K*.1,ke=se*A,Ae=K*.5,Ve=se*.5,lr=K*.3,cn=ke,kr=K*.3;return`M ${ie} ${ke} C ${lr} ${cn}, ${kr} ${Ve}, ${Ae} ${Ve}`},C=A=>{const ie=K*.5,ke=se*.5,Ae=K*.9,Ve=se*A,lr=K*.7,cn=ke,kr=K*.7;return`M ${ie} ${ke} C ${lr} ${cn}, ${kr} ${Ve}, ${Ae} ${Ve}`};async function E(A){try{await ye(`/api/models/${encodeURIComponent(A)}/load`,{method:"POST"}),I()}catch(ie){p("Fehler",`Fehler beim Laden des Modells: ${ie.message}`)}}async function Y(A){try{await ye(`/api/models/${encodeURIComponent(A)}/unload`,{method:"POST"}),I()}catch(ie){p("Fehler",`Fehler beim Entladen des Modells: ${ie.message}`)}}async function X(){try{await ye("/api/models/unload",{method:"POST"}),I()}catch(A){p("Fehler",`Fehler beim Entladen aller Modelle: ${A.message}`)}}async function Z(A,ie){try{await ye(`/api/models/${encodeURIComponent(ie)}/role`,{method:"POST",body:JSON.stringify({role:A||null})}),I()}catch(ke){p("Fehler",`Fehler beim Zuweisen der Rolle: ${ke.message||ke}`)}}async function le(A,ie){x("Kontextlänge anpassen","Gib die gewünschte Kontextlänge in Tokens an:",String(ie||32768),async ke=>{if(ke)try{await ye(`/api/models/${encodeURIComponent(A)}/ctx`,{method:"POST",body:JSON.stringify({ctx:parseInt(ke,10)})}),I()}catch(Ae){p("Fehler",`Fehler beim Setzen des Kontexts: ${Ae.message||Ae}`)}})}async function pe(A){v("Modell löschen?",`Modell '${A}' und alle zugehörigen GGUF-Dateien unwiderruflich von der Box löschen?`,async()=>{try{await ye(`/api/models/${encodeURIComponent(A)}`,{method:"DELETE"}),I()}catch(ie){p("Fehler",`Fehler beim Löschen: ${ie.message||ie}`)}})}async function be(A,ie,ke,Ae){try{await ye("/api/models/install",{method:"POST",body:JSON.stringify({repo:A,role:ie,quant:ke,jinja:Ae})}),p("Herunterladen gestartet",`Download für '${A}' gestartet! Der Fortschritt wird oben angezeigt.`)}catch(Ve){p("Fehler",`Fehler beim Starten des Upgrades: ${Ve.message||Ve}`)}}async function U(A){A&&(await navigator.clipboard.writeText(A),$(!0),setTimeout(()=>$(!1),1500))}if(i)return r.jsx("div",{className:"text-xs text-muted-foreground py-12 text-center",children:"Initialisiere HUD Cockpit…"});if(O)return r.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 (",O,")."]});const me=w.filter(A=>P.includes(A.name)),pt=me.reduce((A,ie)=>A+(ie.size_bytes||0),0),Is=16*1024**3,an=pt>Is?pt*1.2:Is,Fn=A=>w.find(ie=>ie.role===A),wr=A=>{const ie=Fn(A);return ie?P.includes(ie.name):!1};return r.jsxs("div",{className:"space-y-8",children:[r.jsx("style",{children:`
@keyframes flow-dash {
to {
stroke-dashoffset: -20;
}
}
.svg-flow-path {
stroke-dasharray: 4 6;
animation: flow-dash 1s linear infinite;
}
`}),r.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:[r.jsxs("div",{className:"flex justify-between items-center",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Zc,{className:"h-4.5 w-4.5 text-primary"}),r.jsx("span",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"VRAM / Memory Belegung"})]}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsxs("span",{className:"text-[10px] font-mono text-muted-foreground",children:["Llama Swap VRAM-Pool: ",gr(pt)," / ",gr(an)," geladen"]}),P.length>0&&r.jsx("button",{onClick:X,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"})]})]}),r.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:me.length===0?r.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"}):me.map((A,ie)=>{var Ve;const ke=(A.size_bytes||0)/an*100,Ae=["from-teal-500 to-emerald-500","from-indigo-500 to-blue-500","from-purple-500 to-pink-500","from-cyan-500 to-sky-500"][ie%4];return r.jsxs("div",{style:{width:`${ke}%`},className:J("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",Ae),title:`${A.name} (${gr(A.size_bytes)})`,children:[r.jsxs("span",{className:"text-[9px] font-bold truncate max-w-[120px] font-space tracking-wide",children:[A.role?`[${A.role}] `:"",(Ve=A.name.split("/").pop())==null?void 0:Ve.replace(".gguf","")]}),r.jsx("span",{className:"text-[8px] font-mono opacity-80",children:gr(A.size_bytes)})]},A.name)})})]}),r.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:[r.jsxs("div",{children:[r.jsx("span",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"Interactive Gateway Graph"}),r.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."})]}),r.jsxs("div",{ref:Pe,className:"relative w-full h-96 border border-border/30 rounded-xl bg-black/25 overflow-hidden flex",children:[r.jsxs("svg",{className:"absolute inset-0 pointer-events-none w-full h-full",children:[r.jsxs("defs",{children:[r.jsxs("linearGradient",{id:"cyan-to-teal",x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[r.jsx("stop",{offset:"0%",stopColor:"#06b6d4",stopOpacity:"0.45"}),r.jsx("stop",{offset:"100%",stopColor:"#0d9488",stopOpacity:"0.45"})]}),r.jsxs("linearGradient",{id:"active-glow",x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[r.jsx("stop",{offset:"0%",stopColor:"#3b82f6",stopOpacity:"0.8"}),r.jsx("stop",{offset:"100%",stopColor:"#10b981",stopOpacity:"0.8"})]})]}),r.jsx("path",{d:Q(.1),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),(V==="roocode"||j==="roocode")&&r.jsx("path",{d:Q(.1),stroke:"#06b6d4",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"}),r.jsx("path",{d:Q(.3),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),(V==="cursor"||j==="cursor")&&r.jsx("path",{d:Q(.3),stroke:"#06b6d4",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"}),r.jsx("path",{d:Q(.5),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),(V==="opencode"||j==="opencode")&&r.jsx("path",{d:Q(.5),stroke:"#06b6d4",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"}),r.jsx("path",{d:Q(.7),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),(V==="zed"||j==="zed")&&r.jsx("path",{d:Q(.7),stroke:"#06b6d4",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"}),r.jsx("path",{d:Q(.9),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),(V==="continue"||j==="continue")&&r.jsx("path",{d:Q(.9),stroke:"#06b6d4",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"}),r.jsx("path",{d:C(.12),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),wr("fast")&&r.jsx("path",{d:C(.12),stroke:"url(#active-glow)",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"}),r.jsx("path",{d:C(.31),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),wr("heavy")&&r.jsx("path",{d:C(.31),stroke:"url(#active-glow)",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"}),r.jsx("path",{d:C(.5),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),wr("coder")&&r.jsx("path",{d:C(.5),stroke:"url(#active-glow)",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"}),r.jsx("path",{d:C(.69),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),wr("vision")&&r.jsx("path",{d:C(.69),stroke:"url(#active-glow)",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"}),r.jsx("path",{d:C(.88),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),wr("scout")&&r.jsx("path",{d:C(.88),stroke:"url(#active-glow)",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"})]}),r.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:()=>ee("roocode"),onMouseLeave:()=>ee(null),onClick:()=>N(A=>A==="roocode"?null:"roocode"),children:[r.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-cyan-400 animate-pulse"}),r.jsx("span",{children:"Roo Code"})]}),r.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:()=>ee("cursor"),onMouseLeave:()=>ee(null),onClick:()=>N(A=>A==="cursor"?null:"cursor"),children:[r.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-cyan-400 animate-pulse"}),r.jsx("span",{children:"Cursor IDE"})]}),r.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:()=>ee("opencode"),onMouseLeave:()=>ee(null),onClick:()=>N(A=>A==="opencode"?null:"opencode"),children:[r.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-cyan-400 animate-pulse"}),r.jsx("span",{children:"OpenCode"})]}),r.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:()=>ee("zed"),onMouseLeave:()=>ee(null),onClick:()=>N(A=>A==="zed"?null:"zed"),children:[r.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-cyan-400 animate-pulse"}),r.jsx("span",{children:"Zed"})]}),r.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:()=>ee("continue"),onMouseLeave:()=>ee(null),onClick:()=>N(A=>A==="continue"?null:"continue"),children:[r.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-cyan-400 animate-pulse"}),r.jsx("span",{children:"Continue"})]}),r.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:[r.jsx("div",{className:"text-[10px] uppercase font-bold text-primary font-space tracking-wide",children:"Gateway Auto"}),r.jsxs("div",{className:"text-[10px] font-mono text-muted-foreground mt-0.5",children:["Schwelle: > ",u!=null&&u.heavy_threshold_chars?u.heavy_threshold_chars/1e3:"4","k Zeichen"]}),r.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"})]}),Kb.map(A=>{var lr;const ie=["12%","31%","50%","69%","88%"],ke=Fn(A),Ae=ke?P.includes(ke.name):!1;if(A==="agent")return null;const Ve={fast:0,heavy:1,coder:2,vision:3,scout:4}[A];return r.jsxs("div",{className:J("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",Ae?"border-emerald-500/50 bg-emerald-500/5 shadow-emerald-500/5":ke?"border-border/60 bg-card/75":"border-dashed border-border/40 bg-background/20"),style:{left:"90%",top:ie[Ve]},onClick:()=>R(A),children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground",children:A}),Ae&&r.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-400 animate-pulse"})]}),r.jsx("div",{className:"text-[10px] font-mono font-medium truncate mt-0.5 text-foreground max-w-[150px]",children:ke?(lr=ke.name.split("/").pop())==null?void 0:lr.replace(".gguf",""):"Keine Zuweisung"})]},A)}),j&&f&&r.jsx("div",{className:"fixed inset-0 z-50 bg-black/60 backdrop-blur-sm flex items-center justify-center p-4",children:r.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:[r.jsxs("div",{className:"flex items-center justify-between border-b border-border/20 pb-2",children:[r.jsxs("span",{className:"text-xs font-bold uppercase tracking-wider text-primary",children:[j==="roocode"&&"Roo Code Setup",j==="cursor"&&"Cursor Setup",j==="opencode"&&"OpenCode Setup",j==="zed"&&"Zed Setup",j==="continue"&&"Continue Setup"]}),r.jsx("button",{onClick:()=>N(null),className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground cursor-pointer",children:r.jsx(sn,{className:"h-4 w-4"})})]}),r.jsxs("div",{className:"text-xs text-muted-foreground leading-relaxed space-y-2",children:[j==="roocode"&&r.jsxs("ul",{className:"list-decimal pl-4 space-y-1",children:[r.jsxs("li",{children:["Suche in VS Code nach der Erweiterung ",r.jsx("strong",{children:"Roo Code"})," und installiere sie."]}),r.jsxs("li",{children:["Wähle in den Roo Code Einstellungen: Provider: ",r.jsx("strong",{children:"OpenAI Compatible"}),"."]}),r.jsxs("li",{children:["Füge das untenstehende JSON-Snippet in die ",r.jsx("code",{children:"settings.json"})," ein."]})]}),j==="cursor"&&r.jsxs("ul",{className:"list-decimal pl-4 space-y-1",children:[r.jsxs("li",{children:["Öffne Cursor Settings ➔ ",r.jsx("strong",{children:"Models"}),"."]}),r.jsxs("li",{children:["Deaktiviere Cloud-Modelle, klappe ",r.jsx("strong",{children:"OpenAI API"})," auf."]}),r.jsxs("li",{children:["Trage die Base URL unten ein und aktiviere das Modell ",r.jsx("strong",{children:"auto"}),"."]})]}),j==="opencode"&&r.jsxs("ul",{className:"list-decimal pl-4 space-y-1",children:[r.jsxs("li",{children:["Öffne die ",r.jsx("code",{children:"opencode.jsonc"})," Konfigurationsdatei."]}),r.jsxs("li",{children:["Ersetze den Provider-Eintrag unter ",r.jsx("code",{children:"provider"})," mit dem Snippet unten."]})]}),j==="zed"&&r.jsxs("ul",{className:"list-decimal pl-4 space-y-1",children:[r.jsxs("li",{children:["Öffne die Zed Settings (",r.jsx("code",{children:"ctrl+,"}),")."]}),r.jsxs("li",{children:["Füge das untenstehende JSON-Segment unter ",r.jsx("code",{children:"language_models"})," ein."]})]}),j==="continue"&&r.jsxs("ul",{className:"list-decimal pl-4 space-y-1",children:[r.jsx("li",{children:"Klicke auf das Zahnrad-Symbol in der Continue-Erweiterung."}),r.jsxs("li",{children:["Füge den Gateway-Eintrag zum ",r.jsx("code",{children:"models"}),"-Array hinzu."]})]})]}),f.tools&&r.jsxs("div",{className:"relative rounded-xl border border-border/40 bg-black/40 overflow-hidden mt-1 shrink-0",children:[r.jsxs("div",{className:"flex items-center justify-between px-3 py-1.5 border-b border-border/20 bg-black/20",children:[r.jsx("span",{className:"text-[10px] font-mono text-muted-foreground",children:"JSON Config"}),r.jsxs("button",{onClick:()=>{var A,ie,ke,Ae,Ve;return U(j==="roocode"?(A=f.tools.cline)==null?void 0:A.snippet:j==="cursor"?(ie=f.tools.cursor)==null?void 0:ie.snippet:j==="opencode"?(ke=f.tools.opencode)==null?void 0:ke.snippet:j==="zed"?(Ae=f.tools.zed)==null?void 0:Ae.snippet:(Ve=f.tools.continue)==null?void 0:Ve.snippet)},className:"text-xs font-semibold text-primary hover:text-primary-foreground flex items-center gap-1 cursor-pointer",children:[T?r.jsx(nn,{className:"h-3.5 w-3.5 text-emerald-400"}):r.jsx(Eh,{className:"h-3.5 w-3.5"}),r.jsx("span",{children:T?"Kopiert":"Kopieren"})]})]}),r.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:r.jsxs("code",{children:[j==="roocode"&&((Fs=f.tools.cline)==null?void 0:Fs.snippet),j==="cursor"&&((Un=f.tools.cursor)==null?void 0:Un.snippet),j==="opencode"&&((Us=f.tools.opencode)==null?void 0:Us.snippet),j==="zed"&&(($n=f.tools.zed)==null?void 0:$n.snippet),j==="continue"&&((jr=f.tools.continue)==null?void 0:jr.snippet)]})})]}),r.jsx("button",{onClick:()=>N(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"})]})})]}),r.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:[r.jsxs("span",{className:"flex items-center gap-1.5",children:[r.jsx("span",{className:"h-2 w-2 rounded-full bg-cyan-400"}),r.jsx("span",{children:"Cyan-Fluss: Client-Anfrage an Gateway"})]}),r.jsxs("span",{className:"flex items-center gap-1.5",children:[r.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-500 animate-pulse"}),r.jsx("span",{children:"Grüner Puls: Aktive Verbindung / Warmes Modell geladen"})]}),r.jsxs("span",{className:"flex items-center gap-1.5",children:[r.jsx("span",{className:"h-2 w-2 rounded bg-gradient-to-r from-teal-500 to-emerald-500"}),r.jsx("span",{children:"VRAM-Verlauf: Modellspezifischer Speicheranteil"})]})]})]}),r.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:[r.jsx("div",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground px-1",children:"Gateway Steckplatz-Belegung (Slot-Zuweisung)"}),r.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-6 gap-3",children:["fast","heavy","coder","vision","scout"].map(A=>{var Ae;const ie=w.find(Ve=>Ve.role===A),ke=ie?P.includes(ie.name):!1;return r.jsxs("div",{onClick:()=>R(A),className:J("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]",ke?"border-emerald-500/40 shadow-sm shadow-emerald-500/5":ie?"border-primary/20 bg-primary/5":"border-border/30 border-dashed opacity-75"),children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx("span",{className:J("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==="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}),ke&&r.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-400 animate-pulse"})]}),r.jsx("div",{className:"text-[10px] font-mono font-medium truncate text-foreground/90 pr-1 font-space",title:ie==null?void 0:ie.name,children:ie?(Ae=ie.name.split("/").pop())==null?void 0:Ae.replace(/\.gguf$/i,""):"nicht zugewiesen"}),r.jsx("div",{className:"text-[8px] text-primary/70 group-hover:text-primary font-bold uppercase tracking-wider transition-colors font-space",children:"Ändern ➔"})]},A)})})]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3 px-1",children:[r.jsxs("div",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:["Installierte Modell-Bibliothek (",Re.length," von ",w.length,")"]}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsxs("div",{className:"flex rounded-lg border border-border/40 bg-card/45 p-0.5",children:[r.jsx("button",{onClick:()=>ue("all"),className:J("px-2.5 py-1 rounded-md text-[9px] font-bold uppercase transition-all cursor-pointer",je==="all"?"bg-primary text-primary-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:"Vorhanden"}),r.jsx("button",{onClick:()=>ue("in_use"),className:J("px-2.5 py-1 rounded-md text-[9px] font-bold uppercase transition-all cursor-pointer",je==="in_use"?"bg-primary text-primary-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:"In Benutzung"})]}),r.jsxs("div",{className:"flex rounded-lg border border-border/40 bg-card/45 p-0.5",children:[r.jsx("button",{onClick:()=>fe("grid"),className:J("px-2.5 py-1 rounded-md text-[9px] font-bold uppercase transition-all cursor-pointer",ne==="grid"?"bg-primary text-primary-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:"Grid"}),r.jsx("button",{onClick:()=>fe("list"),className:J("px-2.5 py-1 rounded-md text-[9px] font-bold uppercase transition-all cursor-pointer",ne==="list"?"bg-primary text-primary-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:"List"})]})]})]}),ne==="grid"?r.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:Re.length===0?r.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:je==="in_use"?"Keine Modelle in Benutzung (keine Zuweisung oder warm geladene Modelle).":'Keine Modelle konfiguriert. Verwende den Tab "Modelle finden" zum Herunterladen.'}):Re.map(A=>{const ie=P.includes(A.name),ke=m==null?void 0:m.model_list.find(Ve=>Ve.role===A.role),Ae=Yp(A.name);return r.jsxs("div",{className:J("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",ie?"border-primary/45 shadow-primary/5":A.role?"border-primary/30 bg-primary/5 shadow-inner":"border-border/60"),children:[r.jsxs("div",{className:"space-y-3",children:[r.jsx("div",{className:"flex items-start justify-between gap-3",children:r.jsxs("div",{className:"flex gap-2.5 min-w-0",children:[r.jsx("div",{className:J("w-7 h-7 rounded-lg border flex items-center justify-center font-bold text-xs shrink-0 shadow-sm",Ae.color),title:Ae.name,children:Ae.initial}),r.jsxs("div",{className:"min-w-0",children:[r.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()}),r.jsxs("div",{className:"flex items-center gap-2 flex-wrap mt-1",children:[r.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"}),ie&&r.jsxs("span",{className:"flex items-center gap-1 text-[9px] font-semibold text-emerald-400 uppercase tracking-wider",children:[r.jsx(To,{className:"h-3 w-3 animate-pulse"})," Warm"]}),A.role&&r.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&&r.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_active?r.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.spec_draft_model?r.jsx("span",{className:"px-1.5 py-0.5 rounded bg-amber-500/10 border border-amber-500/20 text-[9px] font-mono text-amber-400 font-bold uppercase",title:`Draft gesetzt (${A.spec_draft_model}), aber INAKTIV — --spec-type fehlt oder Vocab inkompatibel. Über 'Spec' neu konfigurieren.`,children:"SPEC?"}):null,A.parallel_slots>1&&r.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]}),A.incomplete&&r.jsx("span",{className:"px-1.5 py-0.5 rounded bg-amber-500/10 border border-amber-500/20 text-[9px] font-mono text-amber-400 font-bold uppercase",title:"GGUF-Datei fehlt — Modell kann nicht geladen werden",children:"⚠ Datei fehlt"})]})]})]})}),r.jsx("div",{className:"border-t border-border/30 pt-3 flex flex-wrap gap-1",children:r.jsx(Zp,{caps:A.capabilities})})]}),r.jsxs("div",{className:"space-y-3 pt-1",children:[r.jsxs("div",{className:"grid grid-cols-2 gap-2 text-[10px] font-mono text-muted-foreground",children:[r.jsxs("div",{className:"flex items-center gap-1.5 p-2 bg-background/20 rounded-lg border border-border/20",children:[r.jsx(Zc,{className:"h-3.5 w-3.5 text-primary/80"}),r.jsxs("div",{children:[r.jsx("div",{className:"text-[8px] uppercase tracking-wider font-semibold text-muted-foreground/60",children:"Größe"}),r.jsx("div",{className:"text-foreground font-semibold",children:gr(A.size_bytes)})]})]}),r.jsxs("div",{className:"flex items-center gap-1.5 p-2 bg-background/20 rounded-lg border border-border/20",children:[r.jsx(T0,{className:"h-3.5 w-3.5 text-primary/80"}),r.jsxs("div",{children:[r.jsx("div",{className:"text-[8px] uppercase tracking-wider font-semibold text-muted-foreground/60",children:"Kontext"}),r.jsx("div",{className:"text-foreground font-semibold",children:Kp(A.ctx)})]})]})]}),ke&&r.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:[r.jsxs("div",{className:"text-[9px] font-semibold text-amber-400 flex items-center gap-1",children:[r.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-400 animate-ping"}),r.jsxs("span",{children:["Upgrade verfügbar: ",ke.repo.split("/").pop()]})]}),r.jsxs("button",{onClick:()=>be(ke.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:[r.jsx(An,{className:"h-3 w-3"})," Smart-Swap starten"]})]}),r.jsxs("div",{className:"flex items-center gap-1.5 border-t border-border/20 pt-3 mt-auto",children:[r.jsx("button",{onClick:()=>ie?Y(A.name):E(A.name),disabled:A.incomplete&&!ie,className:J("flex-1 h-7 rounded-lg text-[9px] font-bold uppercase transition-all border flex items-center justify-center gap-1",A.incomplete&&!ie?"border-border/30 bg-background/10 text-muted-foreground/50 cursor-not-allowed":ie?"border-amber-500/30 bg-amber-500/5 hover:bg-amber-500/15 text-amber-400 cursor-pointer":"border-primary/30 bg-primary/5 hover:bg-primary/15 text-primary cursor-pointer"),children:ie?"Entladen":"Laden"}),r.jsx("button",{onClick:()=>le(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"}),r.jsxs("button",{onClick:()=>L(A),className:J("h-7 px-2.5 rounded-lg border text-[9px] font-bold uppercase transition-colors cursor-pointer flex items-center gap-1",A.spec_active?"border-emerald-500/30 text-emerald-400 hover:bg-emerald-500/10":A.spec_draft_model?"border-amber-500/30 text-amber-400 hover:bg-amber-500/10":"border-border/40 text-muted-foreground hover:bg-accent"),title:"Speculative Draft konfigurieren (Vocab-geprüft)",children:[r.jsx(wi,{className:"h-3 w-3"})," Spec"]}),r.jsx("button",{onClick:()=>pe(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:r.jsx(Yc,{className:"h-3.5 w-3.5"})})]})]})]},A.name)})}):r.jsx("div",{className:"space-y-2",children:Re.length===0?r.jsx("div",{className:"text-xs text-muted-foreground border border-dashed border-border/60 rounded-2xl p-12 text-center select-none",children:je==="in_use"?"Keine Modelle in Benutzung (keine Zuweisung oder warm geladene Modelle).":'Keine Modelle konfiguriert. Verwende den Tab "Modelle finden" zum Herunterladen.'}):Re.map(A=>{const ie=P.includes(A.name),ke=Yp(A.name);return r.jsxs("div",{className:J("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",ie?"border-primary/45":A.role?"border-primary/30 bg-primary/5":"border-border/60"),children:[r.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[r.jsx("div",{className:J("w-8 h-8 rounded-lg border border-border/40 flex items-center justify-center font-bold text-xs shrink-0 shadow-sm",ke.color),title:ke.name,children:ke.initial}),r.jsxs("div",{className:"min-w-0 text-left",children:[r.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[r.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&&r.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&&r.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_active?r.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.spec_draft_model?r.jsx("span",{className:"px-1.5 py-0.5 rounded bg-amber-500/10 border border-amber-500/20 text-[8px] font-mono text-amber-400 font-bold uppercase shrink-0",title:`Draft gesetzt (${A.spec_draft_model}), aber INAKTIV — --spec-type fehlt oder Vocab inkompatibel.`,children:"SPEC?"}):null,A.parallel_slots>1&&r.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]}),A.incomplete&&r.jsx("span",{className:"px-1.5 py-0.5 rounded bg-amber-500/10 border border-amber-500/20 text-[8px] font-mono text-amber-400 font-bold uppercase shrink-0",title:"GGUF-Datei fehlt",children:"⚠ Datei fehlt"}),ie&&r.jsxs("span",{className:"flex items-center gap-0.5 text-[8px] font-semibold text-emerald-400 uppercase tracking-wider shrink-0",children:[r.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500 animate-pulse"})," warm"]})]}),r.jsxs("div",{className:"text-[10px] text-muted-foreground/80 flex items-center gap-2 mt-0.5",children:[r.jsxs("span",{children:["Größe: ",gr(A.size_bytes)]}),r.jsx("span",{children:"•"}),r.jsxs("span",{children:["Kontext: ",Kp(A.ctx)]}),r.jsx("span",{children:"•"}),r.jsx("span",{className:"font-mono text-[9px]",children:A.quant||"GGUF"})]})]})]}),r.jsxs("div",{className:"flex items-center gap-3 shrink-0 self-end sm:self-auto",children:[r.jsx("div",{className:"hidden lg:flex flex-wrap gap-1",children:r.jsx(Zp,{caps:A.capabilities})}),r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx("button",{onClick:()=>ie?Y(A.name):E(A.name),disabled:A.incomplete&&!ie,className:J("h-7 px-3 rounded-lg text-[9px] font-bold uppercase transition-all border flex items-center gap-1",A.incomplete&&!ie?"border-border/30 bg-background/10 text-muted-foreground/50 cursor-not-allowed":ie?"border-amber-500/30 bg-amber-500/5 hover:bg-amber-500/15 text-amber-400 cursor-pointer":"border-primary/30 bg-primary/5 hover:bg-primary/15 text-primary cursor-pointer"),children:ie?"Entladen":"Laden"}),r.jsx("button",{onClick:()=>le(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"}),r.jsxs("button",{onClick:()=>L(A),className:J("h-7 px-2.5 rounded-lg border text-[9px] font-bold uppercase transition-all cursor-pointer flex items-center gap-1",A.spec_active?"border-emerald-500/30 text-emerald-400 hover:bg-emerald-500/10":A.spec_draft_model?"border-amber-500/30 text-amber-400 hover:bg-amber-500/10":"border-border/40 text-muted-foreground hover:bg-accent"),title:"Speculative Draft konfigurieren (Vocab-geprüft)",children:[r.jsx(wi,{className:"h-3 w-3"})," Spec"]}),r.jsx("button",{onClick:()=>pe(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:r.jsx(Yc,{className:"h-3.5 w-3.5"})})]})]})]},A.name)})})]}),M&&r.jsx("div",{className:"fixed inset-0 z-50 bg-black/60 backdrop-blur-sm flex items-center justify-center p-4",children:r.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:[r.jsxs("div",{className:"flex items-center justify-between border-b border-border/20 pb-2",children:[r.jsxs("h3",{className:"text-xs font-bold uppercase tracking-wider text-primary",children:["Rolle '",M,"' konfigurieren"]}),r.jsx("button",{onClick:()=>R(null),className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground cursor-pointer",children:r.jsx(sn,{className:"h-4 w-4"})})]}),r.jsxs("p",{className:"text-xs text-muted-foreground",children:["Wähle ein Modell aus deiner Bibliothek für die Rolle ",r.jsx("strong",{className:"text-foreground",children:M}),":"]}),r.jsxs("div",{className:"space-y-1.5 max-h-60 overflow-y-auto pr-1",children:[r.jsx("button",{onClick:()=>{Z(M,""),R(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:r.jsx("span",{children:"Zuweisung entfernen"})}),w.map(A=>{var ie;return r.jsxs("button",{onClick:()=>{Z(M,A.name),R(null)},className:J("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===M?"text-primary font-bold bg-primary/10 border-primary/30":"text-foreground bg-background/20"),children:[r.jsxs("div",{className:"flex flex-col text-left",children:[r.jsx("span",{className:"truncate max-w-[280px] font-semibold",children:(ie=A.name.split("/").pop())==null?void 0:ie.replace(".gguf","")}),r.jsxs("span",{className:"text-[9px] text-muted-foreground mt-0.5",children:[gr(A.size_bytes)," · ",A.quant]})]}),A.role===M&&r.jsx(nn,{className:"h-4 w-4 shrink-0 text-primary"})]},A.name)})]})]})}),B&&r.jsx(qb,{model:B,onClose:()=>L(null),onChanged:I}),b]})}function Yb(){const[s,o]=g.useState(""),[i,c]=g.useState([]),[u,f]=g.useState("Q4_K_M"),[m,p]=g.useState(""),[v,x]=g.useState(""),[b,w]=g.useState(""),[P,O]=g.useState([]),I=["fast","heavy","coder","vision","scout"];async function j(R){const B=R??s;if(B.trim()){p("Analysiere HuggingFace Repository...");try{const L=await ye(`/api/hf/quants?repo=${encodeURIComponent(B)}`);o(L.repo),c(L.quants),L.quants.length&&f(L.quants.includes("Q4_K_M")?"Q4_K_M":L.quants[0]),p(L.quants.length?"":"Keine GGUF-Dateien in diesem Repository gefunden.")}catch(L){p(`Fehler: ${L}`)}}}async function N(){if(b.trim()){p("Durchsuche HuggingFace...");try{const R=await ye(`/api/hf/search?q=${encodeURIComponent(b)}`);O(R.results),p(R.results.length?"":"Keine Ergebnisse gefunden.")}catch(R){p(`Suche fehlgeschlagen: ${R}`)}}}async function M(){if(s.trim()){p("Download-Job wird initiiert...");try{await ye("/api/models/install",{method:"POST",body:JSON.stringify({repo:s,quant:u,role:v||void 0,jinja:!0})}),p(`Download gestartet: ${s} (${u})${v?`, Rolle: ${v}`:""}. Fortschritt oben.`+(v==="fast"||v==="coder"?" Speculative Draft (Vocab-geprüft) kannst du nach dem Download an der Modellkarte (»Spec«) setzen.":""))}catch(R){p(`Download-Fehler: ${R}`)}}}return r.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:[r.jsx("div",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"HF Download & Suche"}),r.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[r.jsx("input",{value:s,onChange:R=>o(R.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"}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx("button",{onClick:()=>j(),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&&r.jsxs(r.Fragment,{children:[r.jsx("select",{value:u,onChange:R=>f(R.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(R=>r.jsx("option",{value:R,className:"bg-popover text-foreground",children:R},R))}),r.jsxs("select",{value:v,onChange:R=>x(R.target.value),title:"Rolle (optional) — bestimmt Auto-Konfiguration wie parallele Slots",className:"h-9 rounded-lg border border-border/60 bg-background/40 px-3 text-xs outline-none text-foreground font-semibold",children:[r.jsx("option",{value:"",className:"bg-popover text-foreground",children:"Rolle…"}),I.map(R=>r.jsx("option",{value:R,className:"bg-popover text-foreground",children:R},R))]}),r.jsxs("button",{onClick:M,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:[r.jsx(An,{className:"h-3.5 w-3.5"})," Herunterladen"]})]})]})]}),r.jsxs("div",{className:"flex gap-2 border-t border-border/20 pt-4",children:[r.jsxs("div",{className:"relative flex-1",children:[r.jsx("input",{value:b,onChange:R=>w(R.target.value),onKeyDown:R=>R.key==="Enter"&&N(),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"}),r.jsx(pd,{className:"absolute left-3 top-2.5 h-3.5 w-3.5 text-muted-foreground"})]}),r.jsx("button",{onClick:N,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"})]}),P.length>0&&r.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:P.map(R=>r.jsxs("button",{onClick:()=>{o(R.repo),O([]),w(""),j(R.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:[r.jsx("span",{className:"font-semibold truncate",children:R.repo}),r.jsxs("span",{className:"text-[10px] font-mono text-muted-foreground flex items-center gap-1 shrink-0",children:[r.jsx(An,{className:"h-3 w-3"})," ",R.downloads.toLocaleString()]})]},R.repo))}),m&&r.jsx("div",{className:"text-[10px] font-medium text-primary font-mono",children:m})]})}const Jb={vision:{title:"Bilder & Vision",desc:"Verarbeitet Bilder, Screenshots und visuelle Diagramme in multimodalen Chats.",icon:qc},coder:{title:"Coden & Entwicklung",desc:"Autovervollständigung, Refactoring und Codegenerierung direkt in deiner IDE.",icon:Kc},reasoning:{title:"Logik & Nachdenken",desc:"Komplexe logische Gedankengänge, Mathematik und tiefgründiges Planen (Reasoning).",icon:zo},agent:{title:"Autonomer Agent (Hermes)",desc:"Führt selbstständig Terminalbefehle aus und interagiert mit deinem Homelab.",icon:Ao},scout:{title:"Allrounder & Chat",desc:"Schnelle Antworten, Zusammenfassungen, Übersetzungen und alltägliche Fragen.",icon:Qc}};function Xb(){const{data:s,isLoading:o,error:i}=eb(),{data:c}=zs(),{data:u}=yd(),f=(c==null?void 0:c.models)??[],m=i?String(i):"",[p,v]=g.useState({}),[x,b]=g.useState({}),[w,P]=g.useState(!1);async function O(I,j,N,M){v(R=>({...R,[I]:"Starte..."}));try{await ye("/api/models/install",{method:"POST",body:JSON.stringify({repo:I,role:j,quant:N,jinja:M})}),v(R=>({...R,[I]:"Download läuft"}))}catch{v(B=>({...B,[I]:"Fehler"}))}}return o?r.jsx("div",{className:"text-xs text-muted-foreground py-12 text-center",children:"Analysiere Hardware und suche passende GGUF-Empfehlungen…"}):m||!s?r.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,")."]}):r.jsxs("div",{className:"space-y-8",children:[r.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:[r.jsxs("div",{children:["Modell-Registry geladen für ",r.jsxs("span",{className:"text-foreground font-bold",children:[s.sys_ram_gb," GB"]})," System-RAM."]}),r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx(Mh,{className:"h-3.5 w-3.5 text-primary fill-primary/20"}),r.jsx("span",{children:"Empfehlungen sind automatisch auf deine Box-Hardware optimiert."})]})]}),r.jsx("div",{className:"grid gap-6 md:grid-cols-2",children:s.categories.map(I=>{const j=Jb[I.role]||{title:I.title||I.role,desc:"Spezifisches Modell für diese Systemrolle.",icon:Lo},N=j.icon,M=f.find(V=>V.role===I.role),R=u==null?void 0:u.model_list.find(V=>V.role===I.role),B=I.models.find(V=>V.repo===I.recommended)||I.models[0];if(!B)return null;const L=p[B.repo],T=I.models.filter(V=>V.repo!==I.recommended),$=!!x[I.role];return r.jsxs("div",{className:J("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",M?"border-border/60":"border-primary/20 shadow-primary/5"),children:[r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex items-start justify-between gap-3",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.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:r.jsx(N,{className:"h-5.5 w-5.5"})}),r.jsxs("div",{children:[r.jsx("h3",{className:"text-sm font-bold tracking-tight text-foreground",children:j.title}),r.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: ",I.role]})]})]}),M?r.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:[r.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500 animate-pulse"}),"Aktiviert"]}):r.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"})]}),r.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:j.desc}),r.jsx("div",{className:"p-3.5 rounded-xl bg-background/35 border border-border/30 space-y-2.5",children:M?r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("div",{className:"text-[9px] font-bold uppercase tracking-wider text-muted-foreground/60",children:"Aktive GGUF-Belegung"}),r.jsx("div",{className:"text-xs font-mono font-bold text-foreground truncate",title:M.name,children:M.name.split("/").pop()}),r.jsxs("div",{className:"text-[10px] text-muted-foreground/80 flex items-center gap-2",children:[r.jsxs("span",{children:["Größe: ",sd(M.size_bytes||0)]}),r.jsx("span",{children:"•"}),r.jsxs("span",{children:["Quant: ",M.quant||"GGUF"]})]})]}):r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("div",{className:"text-[9px] font-bold uppercase tracking-wider text-primary/80",children:"Empfohlenes Modell"}),r.jsx("div",{className:"text-xs font-mono font-bold text-foreground truncate",title:B.name,children:B.name}),r.jsxs("div",{className:"text-[10px] text-muted-foreground/80 flex items-center gap-2 flex-wrap",children:[r.jsxs("span",{children:["Ersteller: ",B.author]}),r.jsx("span",{children:"•"}),r.jsxs("span",{children:["Quant: ",B.quant]})]}),r.jsx("div",{className:"flex items-center gap-1.5 pt-0.5",children:r.jsx(Qb,{fit:B.fit})})]})}),r.jsx("div",{className:"pt-1",children:M?R?r.jsxs("div",{className:"space-y-2",children:[r.jsxs("div",{className:"text-[9px] font-semibold text-amber-400 flex items-center gap-1.5",children:[r.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-400 animate-ping shrink-0"}),r.jsxs("span",{children:["Bessere Version in der Registry: ",R.repo.split("/").pop()]})]}),r.jsxs("button",{onClick:()=>O(R.repo,I.role,B.quant||"Q4_K_M",B.caps.tools!=="no"),disabled:!!p[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:[r.jsx(An,{className:"h-3.5 w-3.5"}),p[R.repo]||"Auf neue Version aktualisieren"]})]}):r.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:[r.jsx(nn,{className:"h-4 w-4"})," Auf neuestem Stand"]}):r.jsxs("button",{onClick:()=>O(B.repo,I.role,B.quant||"Q4_K_M",B.caps.tools!=="no"),disabled:!!L,className:J("h-8 w-full flex items-center justify-center gap-1.5 rounded-lg text-xs font-bold transition-all cursor-pointer border",L?"border-primary/40 bg-primary/5 text-primary":"bg-primary text-primary-foreground hover:opacity-90 shadow-md shadow-primary/10"),children:[r.jsx(An,{className:"h-3.5 w-3.5"}),L||"Optimales Modell einsetzen"]})})]}),T.length>0&&r.jsxs("div",{className:"border-t border-border/20 pt-3",children:[r.jsxs("button",{onClick:()=>b(V=>({...V,[I.role]:!$})),className:"flex items-center gap-1.5 text-[10px] text-muted-foreground/80 hover:text-foreground transition-colors cursor-pointer",children:[$?r.jsx(w0,{className:"h-3 w-3"}):r.jsx(v0,{className:"h-3 w-3"}),r.jsxs("span",{children:["Alternative Empfehlungen anzeigen (",T.length,")"]})]}),$&&r.jsx("div",{className:"mt-2.5 space-y-2 max-h-36 overflow-y-auto pr-1 scrollbar-thin",children:T.map(V=>r.jsxs("div",{className:"p-2 rounded-lg bg-background/25 border border-border/20 flex items-center justify-between gap-3",children:[r.jsxs("div",{className:"min-w-0",children:[r.jsx("div",{className:"text-[10px] font-mono font-bold text-foreground truncate",title:V.name,children:V.name}),r.jsxs("div",{className:"text-[9px] text-muted-foreground flex items-center gap-1.5 mt-0.5",children:[r.jsxs("span",{children:["Quant: ",V.quant]}),r.jsx("span",{children:"•"}),r.jsx("span",{children:V.fit.text})]})]}),r.jsx("button",{onClick:()=>O(V.repo,I.role,V.quant||"Q4_K_M",V.caps.tools!=="no"),disabled:!!p[V.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:p[V.repo]||"Installieren"})]},V.repo))})]})]},I.role)})}),r.jsxs("div",{className:"border border-border/50 bg-card/20 rounded-2xl overflow-hidden shadow-md mt-4",children:[r.jsxs("button",{onClick:()=>P(!w),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:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(pd,{className:"h-4 w-4 text-primary"}),r.jsx("span",{children:"Eigenes Modell von Hugging Face laden (Erweiterte Ansicht)"})]}),r.jsx("span",{className:"text-[10px] text-primary hover:underline",children:w?"Ausblenden ▲":"Anzeigen ▼"})]}),w&&r.jsx("div",{className:"p-5 border-t border-border/20 bg-card/10",children:r.jsx(Yb,{})})]})]})}function e1(){const[s,o]=g.useState("cockpit");return r.jsxs("div",{className:"space-y-6",children:[r.jsxs("div",{className:"flex flex-col sm:flex-row justify-between sm:items-center gap-4",children:[r.jsxs("div",{children:[r.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"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"Verwalte deine Modelle und passe das Gateway-Routing live über das interaktive Cockpit an."})]}),r.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=>r.jsx("button",{onClick:()=>o(i),className:J("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))})]}),r.jsx(Gb,{}),r.jsx("div",{className:"transition-all duration-300",children:s==="cockpit"?r.jsx(Zb,{}):r.jsx(Xb,{})})]})}function hi({label:s,percent:o,detail:i,icon:c}){const u=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 r.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:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(c,{className:"h-4.5 w-4.5 text-primary"}),r.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-foreground",children:s})]}),r.jsxs("span",{className:"text-xs font-mono font-bold text-foreground",children:[Math.round(o),"%"]})]}),r.jsx("div",{className:"w-full h-2 bg-background/40 rounded-full overflow-hidden border border-border/20",children:r.jsx("div",{className:J("h-full transition-all duration-700 ease-out",u),style:{width:`${Math.min(o,100)}%`}})}),i&&r.jsx("div",{className:"text-[10px] font-mono text-muted-foreground/80",children:i})]})}function t1(){const{data:s,error:o}=vd(3e3),{data:i}=Jy(3e3),{showAlert:c,dialogElement:u}=In(),f=o?String(o):"",[m,p]=g.useState(""),[v,x]=g.useState({});async function b(){p("Backup snapshotted...");try{const P=await ye("/api/system/backup",{method:"POST"});p(P.ok?`Snapshot erzeugt: ${P.snapshot} (${P.files.length} Dateien)`:"Keine Änderungen zu sichern.")}catch(P){p(`Fehler: ${P.message}`)}}async function w(P){x(O=>({...O,[P]:!0}));try{const O=await ye("/api/maintenance/restart",{method:"POST",body:JSON.stringify({service:P})});O.ok?c("Erfolgreich",`Dienst ${P} wurde erfolgreich neu gestartet.`):c("Fehler beim Neustart",`Fehler beim Neustart: ${O.err||"Unbekannter Fehler"}`)}catch(O){c("Fehler",`Fehler: ${O.message}`)}finally{x(O=>({...O,[P]:!1}))}}return r.jsxs("div",{className:"space-y-6",children:[r.jsxs("div",{children:[r.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"}),r.jsx("p",{className:"text-sm text-muted-foreground flex items-center gap-1",children:"Echtzeit-Ressourcen der Box, Dienst-Überwachung und Systempflege."})]}),f&&r.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&&r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[r.jsx(hi,{label:"CPU",percent:s.cpu.percent,detail:s.cpu.cores?`${s.cpu.cores} Cores`:void 0,icon:Ot}),r.jsx(hi,{label:"RAM",percent:s.ram.percent,detail:`${St(s.ram.used)} / ${St(s.ram.total)} GB`,icon:To}),s.gpu&&s.gpu.busy_percent!=null&&r.jsx(hi,{label:"GPU",percent:s.gpu.busy_percent,detail:s.gpu.gtt_used!=null&&s.gpu.gtt_total?`${St(s.gpu.gtt_used)} / ${St(s.gpu.gtt_total)} GB (GTT/unified)`:s.gpu.vram_used!=null&&s.gpu.vram_total?`${St(s.gpu.vram_used)} / ${St(s.gpu.vram_total)} GB VRAM`:void 0,icon:Ot}),s.disk&&r.jsx(hi,{label:"Disk",percent:s.disk.percent,detail:`${St(s.disk.used)} / ${St(s.disk.total)} GB`,icon:Zc})]}),s.temp&&(s.temp.cpu||s.temp.gpu)&&r.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&&r.jsxs("span",{className:"flex items-center gap-1",children:["CPU-Temperatur: ",r.jsxs("span",{className:"text-foreground font-bold",children:[s.temp.cpu," °C"]})]}),s.temp.cpu!=null&&s.temp.gpu!=null&&r.jsx("span",{children:"|"}),s.temp.gpu!=null&&r.jsxs("span",{className:"flex items-center gap-1",children:["GPU-Temperatur: ",r.jsxs("span",{className:"text-foreground font-bold",children:[s.temp.gpu," °C"]})]})]})]}),i&&r.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:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx("div",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Homelab-Dienste"}),r.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"})]}),r.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:i.services.map(P=>r.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:[r.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[r.jsx("span",{className:J("h-2.5 w-2.5 rounded-full ring-2 ring-black/40",P.ok?"bg-emerald-500":"bg-amber-500")}),r.jsxs("div",{className:"truncate",children:[r.jsx("div",{className:"text-xs font-bold text-foreground truncate",children:P.name}),r.jsx("div",{className:"text-[9px] text-muted-foreground/60 font-mono mt-0.5 truncate",children:P.url})]})]}),r.jsx("button",{onClick:()=>w(P.name),disabled:v[P.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:r.jsx(Tn,{className:J("h-3.5 w-3.5",v[P.name]&&"animate-spin")})})]},P.name))}),r.jsxs("div",{className:"flex flex-wrap gap-4 border-t border-border/20 pt-4 text-[10px] font-semibold text-muted-foreground",children:[r.jsxs("a",{href:$o(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:[r.jsx(yi,{className:"h-3 w-3"})," Engine Dashboard (llama-swap)"]}),r.jsxs("a",{href:$o(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:[r.jsx(yi,{className:"h-3 w-3"})," OpenAI Gateway"]})]})]}),r.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:[r.jsxs("div",{className:"space-y-1",children:[r.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"System-Backup & Snapshot"}),r.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Erzeuge einen Git-Snapshot der aktuellen Konfigurationen und des System-Zustands."})]}),r.jsx("div",{className:"flex items-center gap-3 self-start sm:self-auto shrink-0",children:r.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:[r.jsx(z0,{className:"h-4 w-4"})," Snapshot erstellen"]})})]}),m&&r.jsx("div",{className:"text-[10px] font-mono text-primary font-medium bg-primary/5 p-3 rounded-xl border border-primary/20",children:m}),u]})}function r1(){const[s,o]=g.useState(localStorage.getItem("mc_host")||"192.168.178.151"),[i,c]=g.useState(localStorage.getItem("mc_mcp_path")||""),[u,f]=g.useState("cline"),[m,p]=g.useState(!1),v=new URLSearchParams({host:s});i&&v.set("mcp_path",i);const{data:x,error:b}=mm(v.toString()),w=b?String(b):"";function P(N){o(N),N&&localStorage.setItem("mc_host",N)}function O(N){c(N),localStorage.setItem("mc_mcp_path",N)}const I=x==null?void 0:x.tools[u];async function j(){I&&(await navigator.clipboard.writeText(I.snippet),p(!0),setTimeout(()=>p(!1),1500))}return r.jsxs("div",{className:"space-y-6",children:[r.jsxs("div",{children:[r.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"}),r.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."})]}),r.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:[r.jsxs("div",{className:"space-y-1.5",children:[r.jsxs("label",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground flex items-center gap-1.5",children:[r.jsx(_0,{className:"h-3.5 w-3.5 text-primary"})," Box LAN IP-Adresse"]}),r.jsx("input",{value:s,onChange:N=>P(N.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"})]}),r.jsxs("div",{className:"space-y-1.5",children:[r.jsxs("label",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground flex items-center gap-1.5",children:[r.jsx(E0,{className:"h-3.5 w-3.5 text-primary"})," Lokaler MCP-Scriptpfad"]}),r.jsx("input",{value:i,onChange:N=>O(N.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"})]})]}),w&&r.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: ",w]}),x&&r.jsxs("div",{className:"space-y-4",children:[r.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(([N,M])=>r.jsx("button",{onClick:()=>f(N),className:J("rounded-lg px-4 py-1.5 text-xs font-semibold tracking-wide uppercase transition-all cursor-pointer",u===N?"bg-primary text-primary-foreground shadow-md shadow-primary/10":"text-muted-foreground hover:text-foreground"),children:M.label},N))}),I&&r.jsxs("div",{className:"space-y-3",children:[I.note&&r.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:[r.jsx(P0,{className:"h-4.5 w-4.5 text-primary shrink-0 mt-0.5"}),r.jsx("span",{children:I.note})]}),r.jsxs("div",{className:"flex flex-col border border-border/60 bg-black/60 rounded-2xl overflow-hidden shadow-2xl",children:[r.jsxs("div",{className:"flex h-11 items-center justify-between px-4 border-b border-border/40 bg-black/40 shrink-0",children:[r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx("span",{className:"h-3 w-3 rounded-full bg-red-500/80 shadow-md shadow-red-500/10"}),r.jsx("span",{className:"h-3 w-3 rounded-full bg-amber-500/80 shadow-md shadow-amber-500/10"}),r.jsx("span",{className:"h-3 w-3 rounded-full bg-emerald-500/80 shadow-md shadow-emerald-500/10"})]}),r.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:[r.jsx(bi,{className:"h-3.5 w-3.5 text-primary"}),r.jsx("span",{children:u==="cline"||u==="cursor"?"config.json":"settings.json"})]}),r.jsxs("button",{onClick:j,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?r.jsx(nn,{className:"h-3.5 w-3.5 text-emerald-400"}):r.jsx(Eh,{className:"h-3.5 w-3.5"}),r.jsx("span",{children:m?"Kopiert":"Kopieren"})]})]}),r.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:r.jsx("code",{children:I.snippet})})]})]})]})]})}const Jp=["user","instruction","stable","versioned","ephemeral"],Rc={user:{label:"User",icon:B0,color:"text-cyan-400",border:"border-cyan-500/30",bg:"bg-cyan-500/10",text:"text-cyan-400"},instruction:{label:"Regel",icon:L0,color:"text-violet-400",border:"border-violet-500/30",bg:"bg-violet-500/10",text:"text-violet-400"},stable:{label:"Fakt",icon:Ds,color:"text-indigo-400",border:"border-indigo-500/30",bg:"bg-indigo-500/10",text:"text-indigo-400"},versioned:{label:"Version",icon:$0,color:"text-amber-400",border:"border-amber-500/30",bg:"bg-amber-500/10",text:"text-amber-400"},ephemeral:{label:"Temporär",icon:k0,color:"text-pink-400",border:"border-pink-500/30",bg:"bg-pink-500/10",text:"text-pink-400"}},Xp={label:"Gedächtnis",icon:Ch,bg:"bg-muted/10",text:"text-muted-foreground"},n1={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 s1(){const[s,o]=g.useState(""),[i,c]=g.useState(""),[u,f]=g.useState(""),[m,p]=g.useState("stable"),[v,x]=g.useState(!1),b=ln(),{showAlert:w,showConfirm:P,dialogElement:O}=In(),{data:I=[],error:j}=xm({q:i,category:s}),N=j?String(j):"",M=()=>b.invalidateQueries({queryKey:["memory"]});async function R(){u.trim()&&(await ye("/api/memory",{method:"POST",body:JSON.stringify({content:u,category:m,source:"ui"})}),f(""),M())}async function B(T){await ye(`/api/memory/${T}`,{method:"DELETE"}),M()}async function L(){x(!0);try{const T=await ye("/api/memory/dedupe",{method:"POST",body:JSON.stringify({apply:!1})});if(T.duplicate_count===0){w("Ergebnis","Keine Dubletten gefunden — alles sauber.");return}P("Deduplizierung bestätigen",`${T.duplicate_count} Dublette(n) in ${T.groups.length} Gruppe(n) gefunden. Entfernen?`,async()=>{try{await ye("/api/memory/dedupe",{method:"POST",body:JSON.stringify({apply:!0})}),M()}catch($){w("Fehler",`Fehler beim Löschen: ${$.message}`)}})}catch(T){w("Fehler",`Fehler bei der Deduplizierung: ${T.message}`)}finally{x(!1)}}return r.jsxs("div",{className:"space-y-6",children:[r.jsxs("div",{className:"flex flex-col sm:flex-row justify-between sm:items-center gap-4",children:[r.jsxs("div",{children:[r.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)"}),r.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."})]}),r.jsxs("button",{onClick:L,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:[r.jsx(U0,{className:"h-4 w-4 text-primary animate-pulse"}),r.jsx("span",{children:"Deduplizieren"})]})]}),r.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:[r.jsx("div",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Neuen Eintrag anlegen"}),r.jsx("textarea",{value:u,onChange:T=>f(T.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"}),r.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wider",children:"Kategorie"}),r.jsx("select",{value:m,onChange:T=>p(T.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:Jp.map(T=>{var $;return r.jsx("option",{value:T,className:"bg-popover text-foreground",children:(($=Rc[T])==null?void 0:$.label)||T},T)})})]}),r.jsxs("button",{onClick:R,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:[r.jsx(_h,{className:"h-4 w-4"})," Speichern"]})]})]}),r.jsxs("div",{className:"flex flex-col md:flex-row items-stretch md:items-center gap-3",children:[r.jsxs("div",{className:"relative flex-1",children:[r.jsx("input",{value:i,onChange:T=>c(T.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"}),r.jsx(pd,{className:"absolute left-3 top-2.5 h-3.5 w-3.5 text-muted-foreground"})]}),r.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:[r.jsx("button",{onClick:()=>o(""),className:J("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"}),Jp.map(T=>{const $=Rc[T]||Xp,V=$.icon;return r.jsxs("button",{onClick:()=>o(T),className:J("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===T?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"),children:[r.jsx(V,{className:"h-3 w-3"}),r.jsx("span",{children:$.label})]},T)})]})]}),N&&r.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: ",N]}),r.jsx("div",{className:"space-y-3",children:I.length===0?r.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(T=>{const $=Rc[T.category]||Xp,V=$.icon;return r.jsxs("div",{className:J("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",n1[T.category]||"border-l-muted"),children:[r.jsxs("div",{className:"flex items-start gap-3 flex-1 min-w-0",children:[r.jsxs("span",{className:J("flex items-center gap-1 px-2 py-0.5 rounded text-[9px] font-bold uppercase tracking-wider font-mono shrink-0",$.bg,$.text),children:[r.jsx(V,{className:"h-3 w-3"}),r.jsx("span",{className:"hidden sm:inline",children:$.label})]}),r.jsx("span",{className:"text-xs text-foreground leading-relaxed break-words whitespace-pre-wrap flex-1",children:T.content})]}),r.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[r.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:T.source}),r.jsx("button",{onClick:()=>B(T.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:r.jsx(Yc,{className:"h-3.5 w-3.5"})})]})]},T.id)})}),O]})}function mi({label:s,ok:o,detail:i,icon:c,onClick:u}){return r.jsxs("div",{onClick:u,className:J("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",u&&"cursor-pointer hover:bg-card/70"),children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground",children:s}),r.jsx(c,{className:J("h-4.5 w-4.5",o?"text-primary":"text-amber-500")})]}),r.jsxs("div",{className:"space-y-1.5",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:J("h-2 w-2 rounded-full ring-2 ring-black/40",o?"bg-emerald-500 animate-pulse":"bg-amber-500")}),r.jsx("span",{className:"text-xs font-semibold text-foreground",children:o?"Bereit / Online":"Offline / Inaktiv"})]}),i&&r.jsx("div",{className:"text-[10px] font-mono text-muted-foreground truncate max-w-[200px]",title:i,children:i})]}),u&&r.jsxs("button",{onClick:f=>{f.stopPropagation(),u()},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:[r.jsx(Ot,{className:"h-3.5 w-3.5"}),r.jsx("span",{children:"Gehirn wechseln"})]})]})}function o1(){const{data:s,error:o}=hm(5e3),{data:i}=zs(),{showAlert:c,dialogElement:u}=In(),f=ln(),m=o?String(o):"",p=g.useMemo(()=>["auto","fast","heavy",...((i==null?void 0:i.models)??[]).map(T=>{var $;return(($=T.name.split("/").pop())==null?void 0:$.replace(".gguf",""))||T.name})],[i]),[v,x]=g.useState(null),[b,w]=g.useState(!1),[P,O]=g.useState({width:800,height:360}),I=g.useRef(null),j=g.useCallback(L=>{if(I.current&&(I.current.disconnect(),I.current=null),L){const T=new ResizeObserver($=>{if(!$||$.length===0)return;const V=$[0].contentRect;O({width:V.width,height:V.height})});T.observe(L),I.current=T}},[]),N=P.width,M=P.height,R=(L,T,$,V)=>{const ee=(L+$)/2;return`M ${L} ${T} C ${ee} ${T}, ${ee} ${V}, ${$} ${V}`};async function B(L){try{await ye("/api/agent/brain",{method:"POST",body:JSON.stringify({model:L})}),c("Erfolgreich",`Hermes-Gehirn wurde auf '${L}' geändert. Der Gateway-Dienst wurde neu gestartet.`),f.invalidateQueries({queryKey:Ze.agentStatus}),w(!1)}catch(T){c("Fehler",`Fehler beim Wechseln des Gehirns: ${T.message}`)}}return r.jsxs("div",{className:"space-y-6",children:[r.jsx("style",{children:`
@keyframes flow-dash {
to {
stroke-dashoffset: -20;
}
}
.svg-flow-path {
stroke-dasharray: 4 6;
animation: flow-dash 1s linear infinite;
}
`}),r.jsxs("div",{className:"flex flex-col sm:flex-row justify-between sm:items-center gap-4",children:[r.jsxs("div",{children:[r.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"}),r.jsxs("p",{className:"text-sm text-muted-foreground",children:["Hermes ist ein autonomer Agent, der im Hintergrund der Box läuft (Port ",r.jsx("code",{children:":8642"}),") und seine eigene UI besitzt."]})]}),(s==null?void 0:s.webui_url)&&r.jsxs("a",{href:$o(s.webui_url),target:"_blank",rel:"noopener",className:J("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:[r.jsx(yi,{className:"h-4 w-4"}),r.jsx("span",{children:"Hermes WebUI öffnen"})]})]}),m&&r.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&&r.jsxs("div",{className:"space-y-6",children:[r.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[r.jsx(mi,{label:"Agent Gateway",ok:s.gateway_reachable,detail:"Port :8642 (REST API)",icon:Ao}),r.jsx(mi,{label:"Agent WebUI",ok:s.webui_reachable,detail:"Port :8787 (Chat UI)",icon:To}),r.jsx(mi,{label:"Aktives Gehirn",ok:s.gateway_reachable,detail:s.brain_model?`Model: ${s.brain_model}`:"Model: auto",icon:Ot,onClick:()=>w(!0)}),r.jsx(mi,{label:"Verdrahtung",ok:s.has_config,detail:`Config: ${s.has_config?"✓":"—"} · Skills: ${s.has_skills?"✓":"—"} · Memory: ${s.has_memories?"✓":"—"}`,icon:Io})]}),r.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:[r.jsxs("div",{children:[r.jsx("span",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"Interactive Agent Flow Graph"}),r.jsx("p",{className:"text-[10px] text-muted-foreground mt-0.5 leading-relaxed",children:"Visualisiert das Zusammenspiel und die Verbindungspfade zwischen den Hermes-Systemkomponenten."})]}),r.jsxs("div",{ref:j,className:"relative w-full h-96 border border-border/30 rounded-xl bg-black/25 overflow-hidden flex",children:[r.jsxs("svg",{className:"absolute inset-0 pointer-events-none w-full h-full",children:[r.jsxs("defs",{children:[r.jsxs("linearGradient",{id:"cyan-to-teal",x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[r.jsx("stop",{offset:"0%",stopColor:"#06b6d4",stopOpacity:"0.45"}),r.jsx("stop",{offset:"100%",stopColor:"#0d9488",stopOpacity:"0.45"})]}),r.jsxs("linearGradient",{id:"active-glow",x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[r.jsx("stop",{offset:"0%",stopColor:"#3b82f6",stopOpacity:"0.8"}),r.jsx("stop",{offset:"100%",stopColor:"#10b981",stopOpacity:"0.8"})]})]}),r.jsx("path",{d:R(N*.15,M*.5,N*.5,M*.5),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),(v==="webui"||s.webui_reachable)&&r.jsx("path",{d:R(N*.15,M*.5,N*.5,M*.5),stroke:"#06b6d4",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"}),r.jsx("path",{d:R(N*.5,M*.5,N*.85,M*.3),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),(v==="gateway"||v==="brain"||s.gateway_reachable)&&r.jsx("path",{d:R(N*.5,M*.5,N*.85,M*.3),stroke:"url(#active-glow)",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"}),r.jsx("path",{d:R(N*.5,M*.5,N*.85,M*.7),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),(v==="gateway"||v==="wiring"||s.gateway_reachable)&&r.jsx("path",{d:R(N*.5,M*.5,N*.85,M*.7),stroke:"url(#active-glow)",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"})]}),r.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($o(s.webui_url),"_blank"),title:s.webui_reachable?"Klicken um Chat-WebUI zu öffnen":"WebUI Offline",children:[r.jsx(To,{className:J("h-3.5 w-3.5",s.webui_reachable?"text-emerald-400":"text-amber-500")}),r.jsx("span",{children:"Agent WebUI"}),r.jsx("span",{className:J("w-1.5 h-1.5 rounded-full animate-pulse ml-auto",s.webui_reachable?"bg-emerald-500":"bg-amber-500")})]}),r.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:[r.jsxs("div",{className:"flex items-center gap-1",children:[r.jsx(Ao,{className:"h-3.5 w-3.5 text-primary"}),r.jsx("span",{className:"text-[10px] uppercase font-bold text-primary font-space tracking-wide",children:"Agent Gateway"})]}),r.jsx("div",{className:"text-[9px] font-mono text-muted-foreground mt-0.5",children:"Port :8642"}),r.jsx("div",{className:J("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"})]}),r.jsxs("div",{className:J("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:()=>w(!0),children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"flex items-center gap-1 text-muted-foreground",children:[r.jsx(Ot,{className:"h-3 w-3 text-primary"}),r.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider",children:"Aktives Gehirn"})]}),s.gateway_reachable&&r.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-400 animate-pulse"})]}),r.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"})]}),r.jsxs("div",{className:J("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:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"flex items-center gap-1 text-muted-foreground",children:[r.jsx(Io,{className:"h-3 w-3 text-primary"}),r.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider",children:"Verdrahtung"})]}),s.has_config&&r.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-400 animate-pulse"})]}),r.jsxs("div",{className:"text-[9px] font-mono mt-0.5 text-muted-foreground flex gap-1 justify-between",children:[r.jsxs("span",{children:["Config: ",s.has_config?"✓":"—"]}),r.jsxs("span",{children:["Skills: ",s.has_skills?"✓":"—"]}),r.jsxs("span",{children:["Memory: ",s.has_memories?"✓":"—"]})]})]})]}),r.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:[r.jsxs("span",{className:"flex items-center gap-1.5",children:[r.jsx("span",{className:"h-2 w-2 rounded-full bg-cyan-400"}),r.jsx("span",{children:"Cyan-Fluss: Client-Anfrage an Agenten"})]}),r.jsxs("span",{className:"flex items-center gap-1.5",children:[r.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-500 animate-pulse"}),r.jsx("span",{children:"Grüner Puls: Verbindung hergestellt / Modul online"})]})]})]}),r.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:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(O0,{className:"h-5 w-5 text-primary"}),r.jsx("h3",{className:"text-sm font-bold uppercase tracking-wider text-foreground",children:"PC Verbindung"})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:J("h-2 w-2 rounded-full",s.pc_executor_reachable?"bg-emerald-500 animate-pulse":"bg-amber-500")}),r.jsx("span",{className:"text-xs font-semibold text-foreground",children:s.pc_executor_reachable?"Erreichbar":"Nicht verbunden"})]})]}),r.jsxs("div",{className:"grid gap-6 md:grid-cols-2 text-xs text-muted-foreground leading-relaxed text-left",children:[r.jsxs("div",{className:"space-y-3",children:[r.jsxs("p",{children:["Der ",r.jsx("strong",{className:"text-foreground",children:"Hermes PC Executor"})," läuft auf ",r.jsx("code",{className:"text-foreground font-mono px-1 py-0.5 rounded bg-muted/40 border border-border/30",children:"192.168.178.98:7777"})," und ermöglicht Hermes den direkten Zugriff auf deinen Windows-PC — Shell-Befehle, Screenshots, Tastatureingaben."]}),r.jsxs("p",{children:["Hermes erreicht den PC über den MCP-Server ",r.jsx("code",{className:"text-foreground font-mono px-1 py-0.5 rounded bg-muted/40 border border-border/30",children:"hermes-pc-control"}),", der automatisch beim Gateway-Start verbunden wird."]})]}),r.jsx("div",{className:"space-y-3",children:s.pc_executor_reachable?r.jsxs("div",{className:"p-3.5 bg-emerald-500/5 border border-emerald-500/20 rounded-xl space-y-1",children:[r.jsxs("div",{className:"text-emerald-400 font-semibold text-xs flex items-center gap-1.5",children:[r.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500 animate-pulse"}),"PC Executor verbunden"]}),r.jsxs("p",{className:"text-[10px]",children:["Hermes kann jetzt per Telegram oder WebUI Befehle auf TobisNicerPC ausführen. Nutze ",r.jsx("code",{className:"text-foreground",children:"pc_shell"}),", ",r.jsx("code",{className:"text-foreground",children:"pc_screenshot"})," oder ",r.jsx("code",{className:"text-foreground",children:"pc_open"}),"."]})]}):r.jsxs("div",{className:"space-y-2",children:[r.jsx("h4",{className:"text-xs font-bold text-foreground",children:"PC Executor starten"}),r.jsxs("p",{children:["Starte ",r.jsx("code",{className:"text-foreground font-mono",children:"start.bat"})," im Ordner ",r.jsx("code",{className:"text-foreground font-mono",children:"client\\hermes-pc\\"})," auf dem Windows-PC und lasse das Fenster offen."]}),r.jsx("div",{className:"p-3 bg-background/25 rounded-xl border border-border/30 font-mono text-[9px] text-cyan-300",children:"client\\hermes-pc\\start.bat"})]})})]})]}),!s.gateway_reachable&&r.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:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Ds,{className:"h-5 w-5 text-amber-500"}),r.jsx("h3",{className:"text-sm font-bold uppercase tracking-wider text-foreground",children:"Hermes-Agent Diagnostics"})]}),r.jsxs("div",{className:"text-xs text-muted-foreground space-y-3 leading-relaxed",children:[r.jsx("p",{children:"Der Hermes-Dienst ist auf der Box derzeit offline oder kann sich nicht mit dem lokalen llama-swap verbinden."}),r.jsxs("p",{children:["Stelle sicher, dass die systemd-Dienste auf der Box laufen. Du kannst den Status im ",r.jsx("strong",{children:"OS & Updates Drawer"})," prüfen und die Dienste bei Bedarf neu starten."]}),r.jsxs("div",{className:"p-3.5 bg-background/25 rounded-xl border border-border/30 font-mono text-[10px] space-y-1",children:[r.jsx("div",{className:"text-muted-foreground/60",children:"# Dienste manuell auf der Box prüfen:"}),r.jsx("div",{className:"text-primary",children:"systemctl --user status hermes-gateway"}),r.jsx("div",{className:"text-primary",children:"systemctl --user status hermes-webui"})]}),r.jsxs("p",{children:["Weitere Einrichtungsdetails (Brain-Konfiguration, MCP-Kopplungen, SSH-Tunneling und Such-Engines) findest du in der Dokumentationsdatei:",r.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&&r.jsx("div",{className:"fixed inset-0 z-50 bg-black/60 backdrop-blur-sm flex items-center justify-center p-4",children:r.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:[r.jsxs("div",{className:"flex items-center justify-between border-b border-border/20 pb-2",children:[r.jsxs("h3",{className:"text-xs font-bold uppercase tracking-wider text-primary flex items-center gap-1.5",children:[r.jsx(Ot,{className:"h-4 w-4"}),r.jsx("span",{children:"Hermes-Gehirn konfigurieren"})]}),r.jsx("button",{onClick:()=>w(!1),className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground cursor-pointer",children:r.jsx(sn,{className:"h-4 w-4"})})]}),r.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 (',r.jsx("code",{className:"text-primary font-semibold",children:"auto"})," / ",r.jsx("code",{className:"text-primary font-semibold",children:"fast"})," / ",r.jsx("code",{className:"text-primary font-semibold",children:"heavy"}),"):"]}),r.jsx("div",{className:"space-y-1.5 max-h-60 overflow-y-auto pr-1",children:p.map(L=>{const T=["auto","fast","heavy"].includes(L);return r.jsxs("button",{onClick:()=>B(L),className:J("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===L||!s.brain_model&&L==="auto"?"text-primary font-bold bg-primary/10 border-primary/30":"text-foreground bg-background/20"),children:[r.jsxs("div",{className:"flex flex-col text-left",children:[r.jsx("span",{className:"font-semibold truncate max-w-[280px]",children:L}),r.jsx("span",{className:"text-[9px] text-muted-foreground mt-0.5",children:T?"Gateway Routing Alias":"Installiertes GGUF Modell"})]}),(s.brain_model===L||!s.brain_model&&L==="auto")&&r.jsx(nn,{className:"h-4 w-4 shrink-0 text-primary"})]},L)})})]})}),u]})}function l1(){const[s,o]=g.useState("connect"),[i,c]=g.useState("roocode"),[u,f]=g.useState(null),m="192.168.178.151",[p,v]=g.useState(!1),[x,b]=g.useState(null);function w(){v(!0),ye("/api/health").then(P=>{f(P),b(P.engine_reachable?"success":"partial")}).catch(()=>{f(null),b("fail")}).finally(()=>v(!1))}return g.useEffect(()=>{w()},[]),r.jsxs("div",{className:"space-y-6",children:[r.jsxs("div",{children:[r.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"}),r.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."})]}),r.jsxs("div",{className:"flex gap-4 border-b border-border/40 pb-px",children:[r.jsx("button",{onClick:()=>o("connect"),className:J("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"}),r.jsx("button",{onClick:()=>o("concepts"),className:J("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"?r.jsxs(r.Fragment,{children:[r.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:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("span",{className:J("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")}),r.jsxs("div",{children:[r.jsx("div",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"Lokaler Verbindungs-Check"}),r.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${(u==null?void 0:u.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..."]})]})]}),r.jsxs("button",{onClick:w,disabled:p,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:[r.jsx(Tn,{className:J("h-3.5 w-3.5",p&&"animate-spin")}),r.jsx("span",{children:"Testen"})]})]}),r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"flex items-center gap-2 px-1",children:[r.jsx(Ch,{className:"h-4.5 w-4.5 text-primary"}),r.jsx("h2",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"Wie funktioniert mein Stack?"})]}),r.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[r.jsxs("div",{className:"p-4 rounded-xl border border-border/60 bg-card/20 space-y-2",children:[r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx(Ot,{className:"h-4 w-4 text-cyan-400"}),r.jsx("h3",{className:"text-xs font-bold text-foreground",children:"1. Die Zentrale"})]}),r.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."})]}),r.jsxs("div",{className:"p-4 rounded-xl border border-border/60 bg-card/20 space-y-2",children:[r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx(Lo,{className:"h-4 w-4 text-violet-400"}),r.jsx("h3",{className:"text-xs font-bold text-foreground",children:"2. Modell-Zentrale"})]}),r.jsxs("p",{className:"text-[11px] text-muted-foreground leading-relaxed",children:["Deine GGUF-Datenbank. Gesteuert von ",r.jsx("strong",{children:"llama-swap"}),". Lädt dein schnelles Alltags-Hirn (`fast`) oder dein schweres Logik-Hirn (`heavy`) vollautomatisch im VRAM."]})]}),r.jsxs("div",{className:"p-4 rounded-xl border border-border/60 bg-card/20 space-y-2",children:[r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx(zo,{className:"h-4 w-4 text-indigo-400"}),r.jsx("h3",{className:"text-xs font-bold text-foreground",children:"3. Das Gedächtnis"})]}),r.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."})]})]})]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex items-center gap-2 px-1",children:[r.jsx(Kc,{className:"h-4.5 w-4.5 text-primary"}),r.jsx("h2",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"Vibe Coding auf dem PC einrichten"})]}),r.jsxs("div",{className:"flex gap-1.5 bg-card/20 p-1 border border-border/40 rounded-xl max-w-fit",children:[r.jsxs("button",{onClick:()=>c("roocode"),className:J("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:[r.jsx(Mh,{className:"h-3.5 w-3.5 fill-amber-400/20"}),"Roo Code (VS Code)"]}),r.jsx("button",{onClick:()=>c("cursor"),className:J("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"}),r.jsx("button",{onClick:()=>c("opencode"),className:J("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"})]}),r.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"&&r.jsxs("div",{className:"space-y-4 text-xs leading-relaxed text-muted-foreground",children:[r.jsxs("div",{className:"space-y-1",children:[r.jsx("h3",{className:"text-sm font-bold text-foreground",children:"Roo Code Kopplung (Empfohlene Open-Source-Erweiterung)"}),r.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."})]}),r.jsxs("div",{className:"space-y-3.5 border-t border-border/20 pt-4",children:[r.jsxs("div",{className:"space-y-1",children:[r.jsxs("div",{className:"font-semibold text-foreground flex items-center gap-1.5",children:[r.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"]}),r.jsxs("p",{className:"pl-6",children:["Suche in VS Code nach der Erweiterung ",r.jsx("strong",{children:"Roo Code"})," und installiere sie."]})]}),r.jsxs("div",{className:"space-y-1",children:[r.jsxs("div",{className:"font-semibold text-foreground flex items-center gap-1.5",children:[r.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"]}),r.jsx("p",{className:"pl-6",children:"Klicke auf das Roo-Code-Symbol in der Sidebar, öffne die Einstellungen (Zahnrad) und stelle folgendes ein:"}),r.jsx("div",{className:"pl-6 pt-1",children:r.jsxs("div",{className:"p-3 bg-background/25 rounded-xl border border-border/30 font-mono text-[10px] space-y-1 text-foreground",children:[r.jsxs("div",{children:[r.jsx("span",{className:"text-muted-foreground/60",children:"API Provider:"})," OpenAI Compatible"]}),r.jsxs("div",{children:[r.jsx("span",{className:"text-muted-foreground/60",children:"Base URL:"})," http://",m,":9001/v1"]}),r.jsxs("div",{children:[r.jsx("span",{className:"text-muted-foreground/60",children:"API Key:"})," ",r.jsx("span",{className:"italic text-muted-foreground/50",children:'beliebig (z.B. "local")'})]}),r.jsxs("div",{children:[r.jsx("span",{className:"text-muted-foreground/60",children:"Model ID:"})," auto"]})]})})]}),r.jsxs("div",{className:"space-y-1",children:[r.jsxs("div",{className:"font-semibold text-foreground flex items-center gap-1.5",children:[r.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)"]}),r.jsxs("p",{className:"pl-6",children:["Damit Roo Code auf deinen ",r.jsx("strong",{children:"Gedächtnis-Pool"})," zugreifen kann, kopiere die MCP-Konfiguration aus dem Reiter ",r.jsx("strong",{children:"Verbinden"})," und füge sie in deine lokale Roo-Code-Konfigurationsdatei ein."]})]})]})]}),i==="cursor"&&r.jsxs("div",{className:"space-y-4 text-xs leading-relaxed text-muted-foreground",children:[r.jsxs("div",{className:"space-y-1",children:[r.jsx("h3",{className:"text-sm font-bold text-foreground",children:"Cursor IDE Kopplung (Proprietäre All-in-One IDE)"}),r.jsx("p",{children:"Cursor ist ein polierter, extrem schneller VS-Code-Fork mit hervorragenden, tief integrierten Autovervollständigungen (Tab-Completions)."})]}),r.jsxs("div",{className:"space-y-3.5 border-t border-border/20 pt-4",children:[r.jsxs("div",{className:"space-y-1",children:[r.jsxs("div",{className:"font-semibold text-foreground flex items-center gap-1.5",children:[r.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"]}),r.jsxs("p",{className:"pl-6",children:["Öffne Cursor, klicke oben rechts auf das Zahnrad (Settings) und navigiere zu ",r.jsx("strong",{children:"Models"}),"."]})]}),r.jsxs("div",{className:"space-y-1",children:[r.jsxs("div",{className:"font-semibold text-foreground flex items-center gap-1.5",children:[r.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"]}),r.jsxs("p",{className:"pl-6",children:["Deaktiviere die Standard-Cloudmodelle, klappe den Bereich ",r.jsx("strong",{children:"OpenAI API"})," auf und konfiguriere:"]}),r.jsx("div",{className:"pl-6 pt-1",children:r.jsxs("div",{className:"p-3 bg-background/25 rounded-xl border border-border/30 font-mono text-[10px] space-y-1 text-foreground",children:[r.jsxs("div",{children:[r.jsx("span",{className:"text-muted-foreground/60",children:"Override Base URL:"})," http://",m,":9001/v1"]}),r.jsxs("div",{children:[r.jsx("span",{className:"text-muted-foreground/60",children:"API Key:"})," ",r.jsx("span",{className:"italic text-muted-foreground/50",children:'beliebig (z.B. "local")'})]})]})})]}),r.jsxs("div",{className:"space-y-1",children:[r.jsxs("div",{className:"font-semibold text-foreground flex items-center gap-1.5",children:[r.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"]}),r.jsxs("p",{className:"pl-6",children:["Trage in der Modell-Liste ein neues Modell mit dem Namen ",r.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"&&r.jsxs("div",{className:"space-y-4 text-xs leading-relaxed text-muted-foreground",children:[r.jsxs("div",{className:"space-y-1",children:[r.jsx("h3",{className:"text-sm font-bold text-foreground",children:"OpenCode Desktop Kopplung (Open-Source Vibe-Coding-App)"}),r.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."})]}),r.jsxs("div",{className:"space-y-3.5 border-t border-border/20 pt-4",children:[r.jsxs("div",{className:"space-y-1",children:[r.jsxs("div",{className:"font-semibold text-foreground flex items-center gap-1.5",children:[r.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"]}),r.jsx("p",{className:"pl-6",children:"Lade die Desktop-Anwendung von der offiziellen Website (opencode.ai) herunter und starte sie."})]}),r.jsxs("div",{className:"space-y-1",children:[r.jsxs("div",{className:"font-semibold text-foreground flex items-center gap-1.5",children:[r.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"]}),r.jsx("p",{className:"pl-6",children:"Gehe in den Bereich Einstellungen ➔ Provider, deaktiviere die Cloud-Voreinstellungen und trage deinen lokalen Server ein:"}),r.jsx("div",{className:"pl-6 pt-1",children:r.jsxs("div",{className:"p-3 bg-background/25 rounded-xl border border-border/30 font-mono text-[10px] space-y-1 text-foreground",children:[r.jsxs("div",{children:[r.jsx("span",{className:"text-muted-foreground/60",children:"Base URL:"})," http://",m,":9001/v1"]}),r.jsxs("div",{children:[r.jsx("span",{className:"text-muted-foreground/60",children:"Model:"})," auto"]})]})})]}),r.jsxs("div",{className:"space-y-1",children:[r.jsxs("div",{className:"font-semibold text-foreground flex items-center gap-1.5",children:[r.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"]}),r.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.'})]})]})]})]})]}),r.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:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(bi,{className:"h-4.5 w-4.5 text-primary"}),r.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"Was tun, wenn das Coden hakt?"})]}),r.jsxs("ul",{className:"text-[11px] text-muted-foreground space-y-2 list-disc pl-4 leading-relaxed",children:[r.jsxs("li",{children:[r.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."]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Modell antwortet nicht?"})," Schaue unter ",r.jsx("strong",{children:"Diagnose"}),", ob der Dienst `llama-swap` aktiv (grün) is. Wenn nicht, klicke daneben auf ",r.jsx("strong",{children:"Restart"}),"."]}),r.jsxs("li",{children:[r.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."]})]})]})]}):r.jsxs("div",{className:"space-y-6",children:[r.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:[r.jsx(Qc,{className:"h-8 w-8 text-primary shrink-0 mt-0.5"}),r.jsxs("div",{className:"space-y-1",children:[r.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"Entwickler-Guide: Modernes Agentic Coding (2026)"}),r.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."})]})]}),r.jsxs("div",{className:"grid gap-6 md:grid-cols-2",children:[r.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 p-6 shadow-lg shadow-black/10 space-y-4",children:[r.jsxs("div",{className:"flex items-center gap-2 border-b border-border/20 pb-3",children:[r.jsx(Lo,{className:"h-5 w-5 text-cyan-400"}),r.jsxs("div",{children:[r.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"1. Mixture of Experts (MoE)"}),r.jsx("span",{className:"text-[9px] text-cyan-400 font-mono",children:"Effizienz durch Spezialisierung"})]})]}),r.jsxs("div",{className:"text-xs text-muted-foreground space-y-2 leading-normal",children:[r.jsxs("p",{children:[r.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 ",r.jsx("em",{children:"Experts"}),"). Ein intelligenter ",r.jsx("em",{children:"Router"})," entscheidet pro Token (Wortteil), welche Experten zur Berechnung herangezogen werden."]}),r.jsxs("p",{children:[r.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."]}),r.jsxs("div",{className:"p-3 bg-background/25 rounded-xl border border-border/30 font-mono text-[10px] text-foreground",children:[r.jsx("span",{className:"text-cyan-400",children:"Vorteil:"})," GPT-4-Klasse Performance bei einem Bruchteil der aktiven VRAM-Last auf deinem Homelab!"]})]})]}),r.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 p-6 shadow-lg shadow-black/10 space-y-4",children:[r.jsxs("div",{className:"flex items-center gap-2 border-b border-border/20 pb-3",children:[r.jsx(Qc,{className:"h-5 w-5 text-violet-400"}),r.jsxs("div",{children:[r.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"2. Model Context Protocol (MCP)"}),r.jsx("span",{className:"text-[9px] text-violet-400 font-mono",children:"Standardisierte Agenten-Tools"})]})]}),r.jsxs("div",{className:"text-xs text-muted-foreground space-y-2 leading-normal",children:[r.jsxs("p",{children:[r.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."]}),r.jsxs("p",{children:[r.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."]}),r.jsxs("div",{className:"space-y-1.5 p-3 bg-background/25 rounded-xl border border-border/30 text-[10px]",children:[r.jsx("div",{className:"font-bold text-foreground",children:"Gute Quellen für MCP Server:"}),r.jsxs("ul",{className:"list-disc pl-4 space-y-1 text-muted-foreground",children:[r.jsxs("li",{children:[r.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."]}),r.jsxs("li",{children:[r.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."]}),r.jsxs("li",{children:[r.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."]})]})]})]})]}),r.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 p-6 shadow-lg shadow-black/10 space-y-4",children:[r.jsxs("div",{className:"flex items-center gap-2 border-b border-border/20 pb-3",children:[r.jsx(zo,{className:"h-5 w-5 text-emerald-400"}),r.jsxs("div",{children:[r.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"3. Agent Skills"}),r.jsx("span",{className:"text-[9px] text-emerald-400 font-mono",children:"Modulbasierte Fähigkeiten"})]})]}),r.jsxs("div",{className:"text-xs text-muted-foreground space-y-2 leading-normal",children:[r.jsxs("p",{children:[r.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)."]}),r.jsxs("p",{children:[r.jsx("strong",{children:"Wie benutzt man sie?"})," Lege einen Skill-Ordner unter ",r.jsx("code",{children:".agents/skills/<name>"})," in deinem Projekt an. Das Herzstück ist die Datei ",r.jsx("code",{children:"SKILL.md"})," mit folgendem Aufbau:"]}),r.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
...`}),r.jsxs("div",{className:"space-y-1.5 p-3 bg-background/25 rounded-xl border border-border/30 text-[10px]",children:[r.jsx("div",{className:"font-bold text-foreground",children:"Wo gibt es Skills & wo liegen sie?"}),r.jsxs("ul",{className:"list-disc pl-4 space-y-2.5 text-muted-foreground",children:[r.jsxs("li",{children:[r.jsx("strong",{children:"skills.sh Registry & CLI:"})," Das offizielle offene Portal für Agent-Skills (",r.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:",r.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:",r.jsx("br",{}),r.jsx("span",{className:"text-foreground",children:"npx skills find"}),r.jsx("br",{}),"# Skill zum aktuellen Projekt hinzufügen:",r.jsx("br",{}),r.jsx("span",{className:"text-foreground",children:"npx skills add [owner/repo]"})]})]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Globaler Pfad:"})," ",r.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 ",r.jsx("i",{children:"code-simplification"}),", ",r.jsx("i",{children:"api-and-interface-design"}),", etc.) abgelegt."]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Projekt-Pfad:"})," ",r.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."]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Vorlagen / Beispiele:"})," Kopiere einfach bestehende Skills aus dem globalen Verzeichnis oder erstelle deine eigenen, indem du eine ",r.jsx("code",{children:"SKILL.md"})," mit YAML-Header (name, description) anlegst."]})]})]})]})]}),r.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 p-6 shadow-lg shadow-black/10 space-y-4",children:[r.jsxs("div",{className:"flex items-center gap-2 border-b border-border/20 pb-3",children:[r.jsx(Ot,{className:"h-5 w-5 text-indigo-400"}),r.jsxs("div",{children:[r.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"4. Arbeiten mit Hermes"}),r.jsx("span",{className:"text-[9px] text-indigo-400 font-mono",children:"Autonomer Box-Agent"})]})]}),r.jsxs("div",{className:"text-xs text-muted-foreground space-y-2 leading-normal",children:[r.jsxs("p",{children:[r.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."]}),r.jsx("p",{children:r.jsx("strong",{children:"Best Practices für Hermes:"})}),r.jsxs("ul",{className:"list-disc pl-4 space-y-1",children:[r.jsxs("li",{children:[r.jsx("strong",{children:"Chat-Kontext sauber halten:"})," Starte regelmäßig neue Chats. Zu große Historien verlangsamen den Agenten und führen zu Halluzinationen."]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Gehirn festlegen:"})," Konfiguriere im Gateway die Modell-Rolle ",r.jsx("code",{children:"brain"})," für Hermes, damit er automatisch das passende Modell per Llama Swap lädt."]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Sandbox umgehen:"})," Erweitere Hermes' System-Prompt (WebUI-Einstellungen), um Befehle über SSH an deinen Windows-PC zu leiten."]})]})]})]}),r.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:[r.jsxs("div",{className:"flex items-center gap-2 border-b border-border/20 pb-3",children:[r.jsx(Io,{className:"h-5 w-5 text-amber-400"}),r.jsxs("div",{children:[r.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"5. Richtiges Arbeiten mit Tools (Dateien, Terminal, DevTools)"}),r.jsx("span",{className:"text-[9px] text-amber-400 font-mono",children:"Fehler vermeiden & Kosten senken"})]})]}),r.jsxs("div",{className:"grid md:grid-cols-3 gap-4 text-xs text-muted-foreground leading-normal",children:[r.jsxs("div",{className:"space-y-1.5 p-3 bg-background/10 rounded-xl border border-border/30",children:[r.jsxs("h4",{className:"font-bold text-foreground flex items-center gap-1",children:[r.jsx(bi,{className:"h-3.5 w-3.5 text-primary"})," Terminal"]}),r.jsxs("p",{className:"text-[11px]",children:["Verwende nur non-interaktive Befehle. Hänge bei langen Tasks (wie dev-Servern) ein ",r.jsx("code",{children:"&"})," an oder nutze die integrierte Job-Verwaltung. Verwende niemals interaktive Eingabeaufforderungen."]})]}),r.jsxs("div",{className:"space-y-1.5 p-3 bg-background/10 rounded-xl border border-border/30",children:[r.jsxs("h4",{className:"font-bold text-foreground flex items-center gap-1",children:[r.jsx(Kc,{className:"h-3.5 w-3.5 text-cyan-400"})," Dateimanager"]}),r.jsxs("p",{className:"text-[11px]",children:["Überschreibe keine ganzen Dateien, wenn du nur eine Zeile ändern willst. Verwende gezielte Ersetzungs-Tools (wie ",r.jsx("code",{children:"replace_file_content"}),"). Das spart massiv Token-Kosten und beugt Fehlern vor."]})]}),r.jsxs("div",{className:"space-y-1.5 p-3 bg-background/10 rounded-xl border border-border/30",children:[r.jsxs("h4",{className:"font-bold text-foreground flex items-center gap-1",children:[r.jsx(Io,{className:"h-3.5 w-3.5 text-violet-400"})," Browser DevTools"]}),r.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."})]})]})]}),r.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:[r.jsxs("div",{className:"flex items-center gap-2 border-b border-border/20 pb-3",children:[r.jsx(Ds,{className:"h-5 w-5 text-emerald-400"}),r.jsxs("div",{children:[r.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"Wie autonom ist Mission Control 2 wirklich?"}),r.jsx("span",{className:"text-[9px] text-emerald-400 font-mono",children:"Die Grenze zwischen Automatisierung und Kontrolle"})]})]}),r.jsxs("div",{className:"text-xs text-muted-foreground space-y-3 leading-normal",children:[r.jsxs("p",{children:["Mission Control 2 ist als ",r.jsx("strong",{children:"semi-autonomes Gateway"})," konzipiert. Es besitzt die Fähigkeit, komplexe Workflows komplett selbstständig durchzuführen, unterliegt jedoch strikten Sicherheitsplanken:"]}),r.jsxs("div",{className:"grid sm:grid-cols-2 gap-4 pt-1",children:[r.jsxs("div",{className:"space-y-1.5",children:[r.jsxs("h4",{className:"font-bold text-foreground flex items-center gap-1 text-[11px]",children:[r.jsx(Ep,{className:"h-3 w-3 text-emerald-400"})," Was läuft vollautomatisch?"]}),r.jsxs("ul",{className:"list-disc pl-4 space-y-1 text-[11px]",children:[r.jsx("li",{children:"Modellaustausch (Routing) per llama-swap je nach Anfragetyp (z.B. Code vs. Reasoning)."}),r.jsx("li",{children:"Hintergrund-Synchronisation und Speicherung von Gedächtniseinträgen (Memory)."}),r.jsx("li",{children:"Modell-Installation und API-Key-Injektionen in Gateway-Verbindungen."})]})]}),r.jsxs("div",{className:"space-y-1.5",children:[r.jsxs("h4",{className:"font-bold text-foreground flex items-center gap-1 text-[11px]",children:[r.jsx(Ep,{className:"h-3 w-3 text-amber-400"})," Wo ist menschliche Freigabe nötig?"]}),r.jsxs("ul",{className:"list-disc pl-4 space-y-1 text-[11px]",children:[r.jsxs("li",{children:[r.jsx("strong",{children:"Systembefehle:"})," Das Ausführen von Terminal-Kommandos auf deinem PC erfordert standardmäßig deine Bestätigung."]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Kritische Systemeingriffe:"})," OS-Updates, Engine-Rebuilds und Host-Reboots müssen manuell über das Dashboard ausgelöst werden."]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Gedächtnis-Löschung:"})," Permanentes Verwerfen von gesammelten Memorys wird von dir freigegeben."]})]})]})]}),r.jsxs("p",{className:"text-[11px] bg-background/25 p-3 rounded-xl border border-border/30 mt-2",children:[r.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 i1({title:s,hint:o}){return r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{children:[r.jsx("h1",{className:"text-xl font-semibold",children:s}),r.jsx("p",{className:"text-sm text-muted-foreground",children:o})]}),r.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:[r.jsx(C0,{className:"h-8 w-8 text-muted-foreground"}),r.jsx("div",{className:"text-sm text-muted-foreground",children:"Kommt in einer späteren Phase."})]})]})}const a1=[{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 Oc(s){return s==null?"":s>1024**3?`${(s/1024**3).toFixed(2)} GB`:`${(s/1024**2).toFixed(1)} MB`}function c1({open:s,onClose:o,defaultTab:i="maintenance"}){const[c,u]=g.useState(null),[f,m]=g.useState([]),[p,v]=g.useState("llama-swap"),[x,b]=g.useState(""),[w,P]=g.useState(!1),[O,I]=g.useState(null),[j,N]=g.useState({}),[M,R]=g.useState("maintenance"),[B,L]=g.useState(!1),[T,$]=g.useState(null);function V(U,me,pt){$({type:"alert",title:U,message:me,onConfirm:()=>{$(null),pt&&pt()}})}function ee(U,me,pt){$({type:"confirm",title:U,message:me,onConfirm:()=>{$(null),pt()},onCancel:()=>$(null)})}function ne(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[fe,je]=g.useState(""),[ue,Re]=g.useState(""),[Ee,Le]=g.useState(!1),[Oe,Pe]=g.useState(!1);g.useEffect(()=>{s&&(je(localStorage.getItem("mc_sudo_password")||""),Re(localStorage.getItem("mc_hf_token")||""))},[s]),g.useEffect(()=>{s&&i&&R(i)},[s,i]);const K=g.useRef(null);function se(){ye("/api/maintenance/updates").then(u).catch(U=>console.error("Error loading updates",U))}function Q(){ye("/api/jobs").then(U=>m(U.jobs||[])).catch(U=>console.error("Error loading jobs",U))}function C(U){P(!0),I(null),ye(`/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(()=>{P(!1),setTimeout(()=>{K.current&&(K.current.scrollTop=K.current.scrollHeight)},50)})}g.useEffect(()=>{if(!s)return;se(),Q();const U=setInterval(()=>{Q(),se()},3e3);return()=>clearInterval(U)},[s]),g.useEffect(()=>{!s||M!=="logs"||C(p)},[s,M,p]);async function E(){try{await ye("/api/maintenance/os-update",{method:"POST"}),Q(),R("maintenance")}catch(U){V("Fehler",`Fehler beim Starten des OS-Updates: ${U.message}`)}}async function Y(){try{await ye("/api/maintenance/engine-update",{method:"POST"}),Q(),R("maintenance")}catch(U){V("Fehler",`Fehler beim Engine-Update: ${U.message}`)}}async function X(){L(!0);try{await ye("/api/maintenance/check-updates",{method:"POST"}),Q(),R("maintenance")}catch(U){V("Fehler",`Fehler bei der Update-Suche: ${U.message}`)}finally{L(!1)}}async function Z(U,me){try{await ye("/api/models/install",{method:"POST",body:JSON.stringify({repo:U,role:me})}),V("Gestartet",`Modell-Upgrade für '${me}' (${U}) gestartet.`),Q(),R("maintenance")}catch(pt){V("Fehler",`Fehler beim Starten des Modell-Upgrades: ${pt.message}`)}}async function le(){ee("Reboot bestätigen","Bist du sicher, dass du das gesamte Host-System neu starten willst?",async()=>{try{await ye("/api/maintenance/reboot",{method:"POST"}),V("Reboot","Reboot ausgelöst. System startet neu...",()=>{o()})}catch(U){V("Fehler",`Fehler beim Reboot: ${U.message}`)}})}async function pe(U){N(me=>({...me,[U]:!0}));try{const me=await ye("/api/maintenance/restart",{method:"POST",body:JSON.stringify({service:U})});me.ok?V("Dienst neu gestartet",`Dienst ${U} wurde erfolgreich neu gestartet.`,()=>{M==="logs"&&p===U&&C(U)}):V("Fehler",`Fehler beim Neustart: ${me.err||"Unbekannter Fehler"}`)}catch(me){V("Fehler",`Fehler beim Neustart: ${me.message}`)}finally{N(me=>({...me,[U]:!1}))}}async function be(U){try{await ye(`/api/jobs/${U}/cancel`,{method:"POST"}),Q()}catch(me){V("Fehler",`Fehler beim Abbrechen: ${me.message}`)}}return r.jsxs(r.Fragment,{children:[r.jsx("div",{className:J("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}),r.jsxs("div",{className:J("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:[r.jsxs("div",{className:"flex h-16 shrink-0 items-center justify-between border-b border-border/40 px-6",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Ot,{className:"h-4.5 w-4.5 text-primary"}),r.jsx("h2",{className:"text-sm font-semibold tracking-wide uppercase font-space",children:"OS-Zentrale & Pflege"})]}),r.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:r.jsx(sn,{className:"h-4 w-4"})})]}),r.jsxs("div",{className:"flex border-b border-border/40 px-6",children:[r.jsx("button",{onClick:()=>R("maintenance"),className:J("flex-1 py-3 text-xs font-semibold uppercase tracking-wider border-b-2 text-center transition-all",M==="maintenance"?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"),children:"System-Wartung"}),r.jsx("button",{onClick:()=>R("logs"),className:J("flex-1 py-3 text-xs font-semibold uppercase tracking-wider border-b-2 text-center transition-all",M==="logs"?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"),children:"System-Logs"}),r.jsx("button",{onClick:()=>R("settings"),className:J("flex-1 py-3 text-xs font-semibold uppercase tracking-wider border-b-2 text-center transition-all",M==="settings"?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"),children:"Einstellungen"})]}),r.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-6",children:[M==="maintenance"&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Wartungsaktionen"}),r.jsxs("div",{className:"flex items-center gap-2",children:[(c==null?void 0:c.last_check)&&r.jsxs("span",{className:"text-[9px] text-muted-foreground",children:["Zuletzt gesucht: ",ne(c.last_check)]}),r.jsxs("button",{onClick:X,disabled:B,className:"flex items-center gap-1 text-[10px] font-semibold text-primary hover:text-primary/80 transition-colors disabled:opacity-50",children:[r.jsx(Tn,{className:J("h-3 w-3",B&&"animate-spin")}),"Nach Updates suchen"]})]})]}),r.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[r.jsxs("button",{onClick:E,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:[r.jsx(Ds,{className:"h-5 w-5 text-cyan-400 mb-1 group-hover:scale-105 transition-transform"}),r.jsx("span",{className:"text-xs font-semibold",children:"OS Update (apt)"}),r.jsx("span",{className:"text-[10px] text-muted-foreground",children:c!=null&&c.os?`${c.os} Updates verfügbar`:"Auf neuestem Stand"})]}),r.jsxs("button",{onClick:Y,className:"flex flex-col items-start gap-1 p-4 rounded-xl border border-border/60 bg-background/20 hover:border-primary/50 transition-all text-left group",children:[r.jsx(I0,{className:"h-5 w-5 text-violet-400 mb-1 group-hover:scale-105 transition-transform"}),r.jsx("span",{className:"text-xs font-semibold",children:"Engine Update"}),r.jsx("span",{className:"text-[10px] text-muted-foreground",children:c!=null&&c.engine?"Update verfügbar":"Auf neuestem Stand"})]})]}),r.jsxs("button",{onClick:le,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:[r.jsx(Ph,{className:"h-4.5 w-4.5"}),r.jsxs("div",{children:[r.jsx("div",{children:"Host-System neu starten (Reboot)"}),r.jsx("div",{className:"text-[10px] text-red-400/80 font-normal",children:"Startet das gesamte Betriebssystem des Homelabs neu"})]})]})]}),(c==null?void 0:c.model_list)&&c.model_list.length>0&&r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Verfügbare Modell-Upgrades"}),(c==null?void 0:c.last_check)&&r.jsxs("span",{className:"text-[9px] text-muted-foreground",children:["Gesucht: ",ne(c.last_check)]})]}),r.jsx("div",{className:"space-y-2",children:c.model_list.map(U=>r.jsx("div",{className:"p-3 rounded-xl border border-border/60 bg-background/20 flex flex-col gap-2",children:r.jsxs("div",{className:"flex items-start justify-between gap-3",children:[r.jsxs("div",{children:[r.jsx("div",{className:"text-xs font-semibold",children:U.title}),r.jsx("div",{className:"text-[10px] font-mono text-muted-foreground",children:U.repo}),r.jsxs("div",{className:"text-[10px] text-primary font-semibold uppercase mt-0.5",children:["Rolle: ",U.role]})]}),r.jsxs("button",{onClick:()=>Z(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:[r.jsx(An,{className:"h-3.5 w-3.5"}),"Upgrade"]})]})},U.role))})]}),r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Hintergrund-Aufgaben"}),r.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"]})]}),r.jsx("div",{className:"space-y-3",children:f.length===0?r.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 r.jsxs("div",{className:J("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:[r.jsxs("div",{className:"flex items-start justify-between gap-3",children:[r.jsxs("div",{className:"space-y-1",children:[r.jsxs("div",{className:"text-xs font-semibold flex items-center gap-1.5",children:[me&&r.jsxs("span",{className:"flex h-2 w-2 relative",children:[r.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-primary opacity-75"}),r.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-primary"})]}),U.label]}),r.jsxs("div",{className:"text-[10px] font-mono text-muted-foreground uppercase flex items-center gap-2",children:[r.jsxs("span",{children:["ID: ",U.id]}),r.jsx("span",{children:"•"}),r.jsx("span",{className:J(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&&r.jsx("button",{onClick:()=>be(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"&&r.jsxs("div",{className:"mt-3 space-y-1",children:[r.jsx("div",{className:"w-full h-1.5 bg-muted rounded-full overflow-hidden",children:r.jsx("div",{className:"h-full bg-primary transition-all duration-500",style:{width:`${U.progress??0}%`}})}),r.jsxs("div",{className:"flex justify-between items-center text-[9px] font-mono text-muted-foreground",children:[r.jsxs("span",{children:[U.progress??0,"%"]}),U.done_bytes!=null&&U.total_bytes!=null&&r.jsxs("span",{children:[Oc(U.done_bytes)," / ",Oc(U.total_bytes),U.rate_bps!=null&&` (${Oc(U.rate_bps)}/s)`]}),U.eta_s!=null&&r.jsxs("span",{children:["ETA: ",U.eta_s,"s"]})]})]})]},U.id)})})]})]}),M==="logs"&&r.jsxs("div",{className:"flex flex-col h-full space-y-4",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("select",{value:p,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:a1.map(U=>r.jsxs("option",{value:U.id,children:[U.label," (",U.type==="system"?"systemd-root":"user",")"]},U.id))}),r.jsxs("button",{onClick:()=>pe(p),disabled:j[p],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:[r.jsx(Tn,{className:J("h-3.5 w-3.5",j[p]&&"animate-spin")}),"Restart"]})]}),r.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:[r.jsxs("div",{className:"flex h-9 items-center justify-between px-4 border-b border-border/40 bg-black/30 shrink-0",children:[r.jsxs("div",{className:"flex items-center gap-1.5 text-[10px] font-mono text-muted-foreground",children:[r.jsx(bi,{className:"h-3 w-3 text-primary"}),r.jsxs("span",{children:["stdout/stderr - ",p]})]}),r.jsx("button",{onClick:()=>C(p),disabled:w,className:"text-muted-foreground hover:text-foreground transition-colors",children:r.jsx(Tn,{className:J("h-3 w-3",w&&"animate-spin")})})]}),r.jsx("pre",{ref:K,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:O==="password_required"||O==="incorrect_password"?r.jsxs("div",{className:"flex flex-col items-center justify-center p-6 text-center h-full space-y-3",children:[r.jsx(Jc,{className:"h-8 w-8 text-amber-400 animate-pulse animate-duration-1000"}),r.jsx("div",{className:"text-xs font-semibold text-amber-300",children:O==="incorrect_password"?"Falsches Sudo-Passwort hinterlegt.":"Sudo-Passwort für systemd-Dienste erforderlich."}),r.jsxs("p",{className:"text-[10px] text-muted-foreground max-w-xs leading-normal",children:["Für das Auslesen der systemd-Logs von ",p," werden Root-Rechte benötigt. Hinterlege dein Passwort in den Einstellungen."]}),r.jsx("button",{onClick:()=>R("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"})]}):w&&!x?r.jsx("span",{className:"text-muted-foreground",children:"Lade Logs..."}):x||r.jsx("span",{className:"text-muted-foreground",children:"Keine Logeinträge vorhanden."})})]})]}),M==="settings"&&r.jsxs("div",{className:"space-y-6",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Zugangsdaten & Schlüssel"}),r.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."})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsxs("label",{className:"text-xs font-semibold flex items-center gap-1.5",children:[r.jsx(Ds,{className:"h-4 w-4 text-amber-400"}),"Host Sudo-Passwort"]}),r.jsxs("div",{className:"relative",children:[r.jsx("input",{type:Ee?"text":"password",value:fe,onChange:U=>je(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"}),r.jsx("button",{type:"button",onClick:()=>Le(!Ee),className:"absolute inset-y-0 right-0 flex items-center pr-3 text-muted-foreground hover:text-foreground transition-colors",children:Ee?r.jsx(_p,{className:"h-4 w-4"}):r.jsx(qc,{className:"h-4 w-4"})})]}),r.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."})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsxs("label",{className:"text-xs font-semibold flex items-center gap-1.5",children:[r.jsx(M0,{className:"h-4 w-4 text-violet-400"}),"HuggingFace API Token"]}),r.jsxs("div",{className:"relative",children:[r.jsx("input",{type:Oe?"text":"password",value:ue,onChange:U=>Re(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"}),r.jsx("button",{type:"button",onClick:()=>Pe(!Oe),className:"absolute inset-y-0 right-0 flex items-center pr-3 text-muted-foreground hover:text-foreground transition-colors",children:Oe?r.jsx(_p,{className:"h-4 w-4"}):r.jsx(qc,{className:"h-4 w-4"})})]}),r.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."})]}),r.jsxs("div",{className:"flex gap-3 pt-2",children:[r.jsx("button",{onClick:()=>{localStorage.setItem("mc_sudo_password",fe),localStorage.setItem("mc_hf_token",ue),V("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"}),r.jsx("button",{onClick:()=>{je(""),Re(""),localStorage.removeItem("mc_sudo_password"),localStorage.removeItem("mc_hf_token"),V("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"})]})]})]})]}),T&&r.jsx(km,{type:T.type,title:T.title,message:T.message,onConfirm:T.onConfirm,onCancel:T.onCancel})]})}function d1(){var w,P,O,I,j;const[s,o]=g.useState("dashboard"),[i,c]=g.useState(()=>localStorage.getItem("mc_sidebar_collapsed")==="true"),[u,f]=g.useState(!1),[m,p]=g.useState("maintenance"),{data:v}=Yy(),{data:x}=vd(2e4);g.useEffect(()=>{document.documentElement.classList.add("dark")},[]),g.useEffect(()=>{const N=M=>{var B;p(((B=M.detail)==null?void 0:B.tab)||"maintenance"),f(!0)};return window.addEventListener("open-system-drawer",N),()=>window.removeEventListener("open-system-drawer",N)},[]);const b=Xc.find(N=>N.id===s);return r.jsxs("div",{className:"flex h-full relative",children:[r.jsxs("div",{className:"fixed inset-0 -z-50 pointer-events-none overflow-hidden bg-[hsl(224,30%,6%)]",children:[r.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]"}),r.jsx("div",{className:"absolute top-[-10%] left-[-10%] h-[50%] w-[50%] rounded-full bg-teal-500/15 blur-[160px]"}),r.jsx("div",{className:"absolute bottom-[-10%] right-[-10%] h-[50%] w-[50%] rounded-full bg-purple-500/15 blur-[160px]"}),r.jsx("div",{className:"absolute top-[30%] right-[20%] h-[40%] w-[40%] rounded-full bg-indigo-500/10 blur-[140px]"})]}),r.jsx(Zy,{onNavigate:o}),r.jsx(c1,{open:u,onClose:()=>f(!1),defaultTab:m}),r.jsxs("aside",{className:J("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:[r.jsxs("div",{className:J("flex items-center py-4 border-b border-border/40 shrink-0",i?"flex-col gap-3 px-2":"justify-between px-5"),children:[r.jsxs("div",{className:"flex items-center gap-2 overflow-hidden",children:[r.jsx("div",{className:"h-7 w-7 rounded-lg bg-primary shadow-md shadow-primary/20 shrink-0"}),!i&&r.jsxs("div",{className:"leading-tight",children:[r.jsx("div",{className:"text-sm font-semibold tracking-wide font-space",children:"Mission Control"}),r.jsx("div",{className:"text-xs text-muted-foreground",children:"2.0"})]})]}),r.jsx("button",{onClick:()=>{c(N=>{const M=!N;return localStorage.setItem("mc_sidebar_collapsed",M.toString()),M})},className:"p-1 rounded-md hover:bg-accent text-muted-foreground transition-colors cursor-pointer",title:i?"Maximieren":"Minimieren",children:i?r.jsx(b0,{className:"h-4 w-4"}):r.jsx(y0,{className:"h-4 w-4"})})]}),r.jsx("nav",{className:"flex-1 space-y-1 px-3 py-4 overflow-y-auto",children:Xc.map(N=>r.jsxs("button",{onClick:()=>o(N.id),className:J("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===N.id?"bg-primary/15 text-primary shadow-sm shadow-primary/5":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),title:i?N.label:void 0,children:[r.jsx(N.icon,{className:"h-4.5 w-4.5 shrink-0"}),!i&&r.jsx("span",{className:"truncate",children:N.label})]},N.id))}),r.jsx("div",{className:J("py-3 text-xs text-muted-foreground border-t border-border/40 shrink-0",i?"px-2 text-center":"px-5"),children:i?r.jsx("div",{className:"flex justify-center",children:r.jsx("span",{className:J("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"})}):r.jsxs("div",{className:"space-y-2 text-left",children:[v?r.jsxs("span",{className:"flex items-center gap-2",children:[r.jsx("span",{className:J("h-2 w-2 rounded-full animate-pulse",v.engine_reachable?"bg-emerald-500":"bg-amber-500")}),r.jsxs("span",{className:"truncate",children:["Engine ",v.engine_reachable?"online":"offline"]})]}):r.jsxs("span",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"h-2 w-2 rounded-full bg-red-500"})," ",r.jsx("span",{className:"truncate",children:"Backend offline"})]}),(x==null?void 0:x.versions)&&r.jsxs("div",{className:"space-y-1 text-[9px] text-muted-foreground/60 mt-2 pt-2 border-t border-border/30",children:[r.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:[r.jsx("strong",{children:"MC2:"})," ",x.versions.mc2?`${x.versions.mc2.hash}${x.versions.mc2.dirty?"*":""}`:"—"]}),r.jsxs("div",{className:"truncate",title:((w=x.versions.engine)==null?void 0:w.type)==="git"?`${x.versions.engine.branch}-${x.versions.engine.hash}${x.versions.engine.dirty?"*":""} (${x.versions.engine.date})`:((P=x.versions.engine)==null?void 0:P.version_text)||"unbekannt",children:[r.jsx("strong",{children:"Engine:"})," ",((O=x.versions.engine)==null?void 0:O.type)==="git"?`${x.versions.engine.hash}${x.versions.engine.dirty?"*":""}`:((j=(I=x.versions.engine)==null?void 0:I.version_text)==null?void 0:j.split(" ").pop())||"—"]}),r.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:[r.jsx("strong",{children:"Hermes UI:"})," ",x.versions.hermes_ui?`${x.versions.hermes_ui.hash}${x.versions.hermes_ui.dirty?"*":""}`:"—"]}),r.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:[r.jsx("strong",{children:"Hermes Agent:"})," ",x.versions.hermes_agent?`${x.versions.hermes_agent.hash}${x.versions.hermes_agent.dirty?"*":""}`:"—"]})]})]})})]}),r.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[r.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:[r.jsx("div",{className:"text-xs font-medium text-muted-foreground tracking-wide uppercase font-sans",children:b.hint}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.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"}),r.jsxs("button",{onClick:()=>{const N=new KeyboardEvent("keydown",{key:"k",metaKey:!0});document.dispatchEvent(N)},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:[r.jsx(S0,{className:"h-3.5 w-3.5"}),r.jsx("span",{children:"Suchen"}),r.jsx("kbd",{className:"rounded bg-muted px-1.5 py-0.5 font-mono text-[9px]",children:"⌘K"})]})]})]}),r.jsxs("main",{className:"flex-1 overflow-y-auto p-6 scrollbar-thin",children:[s==="dashboard"&&r.jsx(Wb,{}),s==="models"&&r.jsx(e1,{}),s==="system"&&r.jsx(t1,{}),s==="connect"&&r.jsx(r1,{}),s==="memory"&&r.jsx(s1,{}),s==="agent"&&r.jsx(o1,{}),s==="guide"&&r.jsx(l1,{}),!["dashboard","models","system","connect","memory","agent","guide"].includes(s)&&r.jsx(i1,{title:b.label,hint:b.hint})]})]})]})}const u1=new t0({defaultOptions:{queries:{retry:1,refetchOnWindowFocus:!1,staleTime:5e3}}});Pg.createRoot(document.getElementById("root")).render(r.jsx(uh.StrictMode,{children:r.jsx(r0,{client:u1,children:r.jsx(d1,{})})}));